* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0f0f13; color: #e8e8e8; min-height: 100vh; }


.app { max-width: 1300px; margin: 0 auto; padding: 24px; }


header { text-align: center; padding: 32px 0 24px; }
header h1 { font-size: 2rem; font-weight: 700; color: #fff; }
header p  { color: #888; margin-top: 6px; }


.upload-zone { border: 2px dashed #333; border-radius: 16px; padding: 60px; text-align: center; cursor: pointer; transition: all .2s; margin: 20px 0; }
.upload-zone:hover, .upload-zone.drag-over { border-color: #ff3c3c; background: rgba(255,60,60,0.05); }
.upload-icon { font-size: 3rem; display: block; margin-bottom: 12px; }
.upload-zone p { font-size: 1.1rem; color: #aaa; }
.upload-zone small { color: #555; }


.hidden { display: none !important; }


.editor-section { margin-top: 16px; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 0; flex-wrap: wrap; }
.btn { padding: 8px 16px; border-radius: 8px; border: 1px solid #333; background: #1e1e26; color: #ccc; cursor: pointer; font-size: 0.9rem; transition: all .15s; }
.btn:hover { background: #2a2a35; border-color: #555; }
.btn.active { background: #2a1f2e; border-color: #ff3c3c; color: #ff3c3c; }
.btn.primary { background: #ff3c3c; border-color: #ff3c3c; color: #fff; font-weight: 600; margin-left: auto; }
.btn.primary:hover { background: #e03030; }
.btn.danger { border-color: #663; color: #cc9900; }
.btn.danger:hover { background: #2a2a10; border-color: #cc9900; }
.spot-count { color: #666; font-size: 0.9rem; }
.canvas-wrap { border-radius: 12px; overflow: hidden; border: 1px solid #222; display: inline-block; max-width: 100%; }
.hint { color: #555; font-size: 0.8rem; margin-top: 8px; }


.result-section { margin-top: 24px; }
.result-section h2 { font-size: 1.4rem; margin-bottom: 16px; }
.compare-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare-item label { display: block; color: #888; font-size: 0.85rem; margin-bottom: 6px; }
.compare-item img { width: 100%; border-radius: 10px; border: 1px solid #222; }
.result-actions { display: flex; gap: 12px; margin-top: 16px; }
.result-actions a.btn { text-decoration: none; }


.loader { position: fixed; inset: 0; background: rgba(0,0,0,0.82); display: flex; align-items: center; justify-content: center; z-index: 999; }
.progress-box { background: #1a1a22; border: 1px solid #333; border-radius: 16px; padding: 36px 48px; text-align: center; min-width: 340px; }
.progress-box #loader-text { color: #ccc; font-size: 1rem; margin-bottom: 20px; }
.progress-bar-wrap { background: #2a2a35; border-radius: 99px; height: 10px; overflow: hidden; margin-bottom: 12px; }
.progress-bar-fill { height: 100%; width: 0%; background: #ff3c3c; border-radius: 99px; transition: width 0.4s ease; }
#progress-pct { font-size: 1.4rem; font-weight: 700; color: #ff3c3c; }


@media (max-width: 768px) {
  .app { padding: 12px; }
  header h1 { font-size: 1.4rem; }
  .upload-zone { padding: 32px 16px; }
  .toolbar { gap: 6px; }
  .btn { font-size: 0.78rem; padding: 6px 10px; }
  .btn.primary { margin-left: 0; width: 100%; text-align: center; }
  .compare-wrap { grid-template-columns: 1fr; }
  .progress-box { min-width: unset; width: 90vw; padding: 24px 20px; }
}

.lang-switcher {
  position: absolute;
  top: 0;
  right: 0;
}

.lang-drop-btn {
  background: #1e1e26;
  border: 1px solid #333;
  color: #ccc;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-drop-btn:hover {
  background: #2a2a35;
  border-color: #555;
}

.lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #1e1e26;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  z-index: 100;
  min-width: 160px;
}

.lang-menu.open {
  display: block;
}

.lang-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: #ccc;
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
}

.lang-menu button:hover {
  background: #2a2a35;
}