:root {
  --accent: #ff5c7a;
  --accent-dark: #e04462;
  --ink: #15161a;
  --muted: #6b7280;
  --line: #e8e9ee;
  --bg: #fafafc;
  --card: #ffffff;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- header ---------- */

.site-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-mark { font-size: 20px; }
.brand-name em { font-style: normal; color: var(--accent); }

.site-header .inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-nav {
  display: inline-flex;
  gap: 22px;
  margin-left: auto;
  font-size: 14px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 550;
}

.site-nav a:hover { color: var(--ink); }

@media (max-width: 720px) {
  .site-nav { display: none; }
}

/* ---------- layout ---------- */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.stage { animation: fade .35s ease both; }

@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

h1 {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  text-align: center;
  font-weight: 800;
}

.accent { color: var(--accent); }

.lede {
  text-align: center;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
  margin: 0 auto 40px;
  max-width: 620px;
}

/* ---------- dropzone ---------- */

.dropzone {
  border: 2px dashed #d6d8e0;
  border-radius: 22px;
  background: var(--card);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
  outline: none;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  background: #fff7f9;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: #fff0f4;
  transform: scale(1.005);
}

.dz-icon { font-size: 40px; margin-bottom: 14px; }

.dz-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }

.dz-sub { font-size: 14px; color: var(--muted); }

.hints {
  list-style: none;
  padding: 0;
  margin: 32px auto 0;
  max-width: 620px;
  display: grid;
  gap: 10px;
}

.hints li {
  font-size: 14px;
  color: var(--muted);
  padding-left: 22px;
  position: relative;
}

.hints li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.hints strong { color: var(--ink); font-weight: 600; }

/* ---------- working ---------- */

.working-card {
  max-width: 420px;
  margin: 24px auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(21,22,26,.06);
}

.working-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 24px;
  background: #f2f3f7;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 3px solid #f0f1f5;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.working-card h2 {
  font-size: 19px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.working-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.progress {
  height: 6px;
  background: #f0f1f5;
  border-radius: 99px;
  overflow: hidden;
  margin: 24px 0 14px;
}

.progress-bar {
  height: 100%;
  width: 6%;
  background: linear-gradient(90deg, var(--accent), #ff9aad);
  border-radius: 99px;
  transition: width .6s ease;
}

.working-note { font-size: 12px !important; opacity: .75; }

/* ---------- result ---------- */

.result-title {
  font-size: clamp(24px, 4vw, 32px);
  text-align: center;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.result-sub {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 32px;
}

.compare-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.compare-item { margin: 0; }

.img-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #f2f3f7;
  border: 1px solid var(--line);
}

.img-frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #15161a;
  color: #fff;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
  z-index: 50;
  max-width: calc(100vw - 40px);
  text-align: center;
}

.toast.hidden { display: none; }

.compare-item figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ---------- unlock card ---------- */

.unlock-box {
  margin: 34px auto 0;
  max-width: 520px;
  padding: 26px 26px 22px;
  border: 1px solid #e6e3f4;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfaff 0%, #ffffff 100%);
  text-align: center;
}

.unlock-box h3 {
  margin: 0 0 8px;
  font-size: 19px;
  letter-spacing: -.01em;
}

.unlock-box p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.unlock-box .btn {
  width: 100%;
}

.unlock-box .unlock-note {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: #9aa0ad;
}

.unlock-box.is-done {
  border-color: #cde8d4;
  background: #f4fbf6;
}

.unlock-box.is-done .btn {
  background: #e6f4ea;
  color: #1c7a3e;
  cursor: default;
}

/* ---------- buttons ---------- */

.actions {
  margin: 36px auto 0;
  max-width: 460px;
  display: grid;
  gap: 12px;
}

.actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  padding: 15px 20px;
  cursor: pointer;
  transition: transform .12s, background .18s, box-shadow .18s;
}

.btn:active { transform: scale(.985); }

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255,92,122,.28);
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover { border-color: #cfd2dc; }

.btn-text {
  background: none;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  padding: 8px;
}

.btn-text:hover { color: var(--ink); }

/* ---------- answer ---------- */

.answer-box {
  max-width: 820px;
  margin: 28px auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
}

.answer-box h3 {
  margin: 0 0 14px;
  font-size: 16px;
  letter-spacing: -0.01em;
}

#answer-img {
  display: block;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.answer-box ol {
  margin: 0;
  padding-left: 20px;
  color: #374151;
  font-size: 15px;
  line-height: 1.7;
}

.answer-list {
  margin: 18px 0 0;
  padding-left: 22px;
}

.answer-list li {
  margin-bottom: 6px;
  padding-left: 2px;
}

.answer-list li::marker {
  color: var(--accent);
  font-weight: 700;
}

#btn-answer-download { margin-top: 18px; }

.answer-note {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.restart { text-align: center; margin-top: 28px; }

/* ---------- error ---------- */

.error-card {
  max-width: 420px;
  margin: 40px auto 0;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 28px;
}

.error-card h2 { margin: 0 0 10px; font-size: 20px; }
.error-card p { color: var(--muted); font-size: 14px; margin: 0 0 22px; line-height: 1.5; }

/* ---------- footer ---------- */

.site-footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: #9aa0ad;
  font-size: 12.5px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-bottom: 16px;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 550;
}

.footer-nav a:hover { color: var(--accent-dark); text-decoration: underline; }

/* ---------- mobile ---------- */

@media (max-width: 720px) {
  main { padding: 32px 18px 64px; }
  .compare-wrap { grid-template-columns: 1fr; gap: 20px; }
  .dropzone { padding: 40px 18px; }
  .lede { font-size: 15.5px; }
  h1 { font-size: 30px; }
  .btn { padding: 14px 18px; }
}
