* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0b0d12;
  --bg-card: #12151d;
  --border: #232a3a;
  --text: #e8eaf0;
  --muted: #9aa3b5;
  --accent: #8b7cf8;
  --accent-2: #5eead4;
  --danger: #f87171;
  --ok: #4ade80;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.logo { font-size: 1.05rem; letter-spacing: 0.02em; }

main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }

.screen[hidden] { display: none; }

/* ---------- HOME ---------- */
.hero { text-align: center; padding-top: 0.75rem; }
.ghost-inline { font-size: 1em; display: inline-block; animation: float 3s ease-in-out infinite; }
.ghost-float { font-size: 4rem; display: inline-block; animation: float 3s ease-in-out infinite; }
.ghost-float.big { font-size: 4.6rem; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0.25rem 0 0.6rem; }
.sub { color: var(--muted); font-size: 1.05rem; line-height: 1.6; max-width: 580px; margin: 0 auto; }
.sub.small { font-size: 0.92rem; margin: 0 0 0.8rem; max-width: none; }

#check-form { margin-top: 1.5rem; }
.fields {
  display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap;
}
.fields input, .fields select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 1rem;
}
.fields input { width: min(100%, 320px); }
.fields select { width: min(100%, 220px); }
.fields input:focus, .fields select:focus { outline: none; border-color: var(--accent); }

#check-btn, .btn-primary {
  margin-top: 1rem;
  background: linear-gradient(135deg, var(--accent), #6d5ce6);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
}
#check-btn:disabled { opacity: 0.6; cursor: wait; }
#check-btn:hover, .btn-primary:hover { filter: brightness(1.1); }

.form-error { color: var(--danger); margin-top: 0.9rem; text-align: center; }

.how { margin-top: 3.25rem; text-align: center; }
.how h2 { margin-bottom: 1.25rem; font-size: 1.35rem; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; text-align: left; }
.how-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}
.how-card span {
  display: flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

/* ---------- IDENTIFY ---------- */
.identify-head { text-align: center; }
#identify-title { font-size: 1.6rem; }
#identify-note { margin-top: 0.5rem; }

.candidates { display: grid; gap: 0.7rem; margin-top: 1.5rem; }
.candidate {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font: inherit;
  width: 100%;
}
.candidate:hover { border-color: var(--accent); }
.candidate.selected { border-color: var(--accent); background: rgba(139, 124, 248, 0.09); }
.candidate .c-name { font-weight: 700; }
.candidate .c-cat { color: var(--accent-2); font-size: 0.85rem; margin-left: 0.5rem; }
.candidate .c-desc { color: var(--muted); font-size: 0.92rem; margin-top: 0.35rem; line-height: 1.5; }

#category-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  margin-top: 0.75rem;
}
#category-input:focus { outline: none; border-color: var(--accent); }

.chips.selectable .chip { cursor: pointer; user-select: none; }
.chips.selectable .chip:hover { border-color: var(--accent); }
.chips.selectable .chip.selected {
  border-color: var(--accent);
  background: rgba(139, 124, 248, 0.15);
  color: #fff;
}

/* ---------- PROGRESS ---------- */
.progress-head { text-align: center; }
#progress-title { margin-top: 0.75rem; font-size: 1.5rem; }
#progress-title em { color: var(--accent-2); font-style: normal; }
#progress-status { margin-top: 0.5rem; }

.progress-bar {
  height: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin: 1.25rem auto 0;
  max-width: 420px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 3%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.6s ease;
}

.progress-list { list-style: none; margin-top: 1.75rem; display: grid; gap: 0.6rem; }
.progress-list li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex; align-items: center; gap: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  opacity: 0.55;
}
.progress-list li.active { opacity: 1; border-color: var(--accent); }
.progress-list li.done { opacity: 1; }
.progress-list li .q-state { width: 1.4rem; text-align: center; flex-shrink: 0; }
.progress-list li.done.hit .q-state { color: var(--ok); }
.progress-list li.done.miss .q-state { color: var(--danger); }

.progress-list li.skeleton {
  height: 3rem;
  background: linear-gradient(100deg, var(--bg-card) 40%, #1a1f2b 50%, var(--bg-card) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-color: var(--border);
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent);
  display: inline-block; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- REPORT ---------- */
.score-wrap { text-align: center; padding-top: 0.75rem; }
.score-label {
  color: var(--muted);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.score-value { font-size: clamp(3.2rem, 11vw, 5.5rem); font-weight: 800; line-height: 1.05; margin-top: 0.25rem; }
.score-value span:first-child { color: var(--accent); }
.score-word { color: var(--text); }

.tier-badge {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.45rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: rgba(139, 124, 248, 0.12);
  font-size: 1.15rem;
  font-weight: 600;
}
.score-brandline { margin-top: 1.1rem; font-size: 1.1rem; }
.score-brandline strong { color: var(--accent-2); }
.score-brandline span { color: var(--muted); }
.score-note { color: var(--muted); margin-top: 0.4rem; font-size: 1rem; max-width: 520px; margin-left: auto; margin-right: auto; line-height: 1.55; }

.actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.75rem; }
.btn-primary { margin-top: 0; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--accent); }

.block { margin-top: 2.5rem; }
.block h3 { margin-bottom: 0.9rem; font-size: 1.15rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.95rem;
}

.breakdown { list-style: none; display: grid; gap: 0.6rem; }
.breakdown li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.breakdown .q-row { display: flex; gap: 0.6rem; align-items: baseline; }
.breakdown .q-mark { flex-shrink: 0; }
.breakdown li.hit .q-mark { color: var(--ok); }
.breakdown li.miss .q-mark { color: var(--danger); }
.breakdown .q-text { font-size: 0.98rem; }
.breakdown .q-snippet { color: var(--muted); font-size: 0.88rem; margin-top: 0.45rem; line-height: 1.5; }

.email-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}
.email-block .sub { margin: 0 0 1rem; max-width: none; }
#email-form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
#email-form input {
  flex: 1; min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-size: 1rem;
}
#email-form input:focus { outline: none; border-color: var(--accent); }
#email-form button {
  background: var(--accent-2);
  color: #06281f;
  border: none; border-radius: 10px;
  padding: 0.8rem 1.4rem;
  font-weight: 700; font-size: 1rem;
  cursor: pointer;
}
.email-done { color: var(--ok); margin-top: 0.75rem; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
