:root {
  --bg: #0b1020;
  --bg-2: #131a33;
  --panel: rgba(23, 31, 58, 0.86);
  --panel-solid: #171f3a;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #eef2ff;
  --muted: #9aa6cc;
  --accent: #ff8a3d;
  --accent-2: #ffc247;
  --good: #37d39a;
  --bad: #ff5f6d;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(255, 138, 61, 0.18), transparent 60%),
    radial-gradient(900px 560px at 92% 0%, rgba(88, 122, 255, 0.22), transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

/* ---------------- top bar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 26px rgba(255, 138, 61, 0.35);
  position: relative;
  flex: none;
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 12px 11px;
  border-radius: 50% 50% 6px 6px;
  border: 3px solid rgba(20, 12, 0, 0.75);
  border-top-color: transparent;
}

.brand h1 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.stats { display: flex; gap: 10px; }

.stat {
  min-width: 74px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stat-label {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------------- panels & buttons ---------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  backdrop-filter: blur(14px);
}

.panel-start h2,
.panel-results h2 {
  margin: 0 0 12px;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.lead { color: var(--muted); line-height: 1.6; margin: 0 0 18px; }
.lead strong { color: var(--accent-2); }

.rules {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.rules li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.rules-key {
  flex: none;
  min-width: 44px;
  text-align: center;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255, 138, 61, 0.14);
  border: 1px solid rgba(255, 138, 61, 0.32);
  color: var(--accent-2);
  font-weight: 700;
  font-size: 0.78rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 650;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(255, 194, 71, 0.5); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(140deg, var(--accent), #ff6f2a);
  color: #200f00;
  box-shadow: 0 12px 28px rgba(255, 111, 42, 0.32);
}
.btn-primary:hover { background: linear-gradient(140deg, #ffa155, var(--accent)); }

.btn-ghost { border-color: var(--line-strong); background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

.btn-lg { padding: 14px 28px; font-size: 1.02rem; }

.fineprint {
  margin: 16px 0 0;
  font-size: 0.76rem;
  color: rgba(154, 166, 204, 0.75);
  line-height: 1.5;
}

/* ---------------- progress ---------------- */
.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.progress-track {
  flex: 1;
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.32s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: right;
}

/* ---------------- photo ---------------- */
.photo {
  position: relative;
  margin: 0 0 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #05070f;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.photo.is-ready img { opacity: 1; }

.censor-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.censor-patch {
  position: absolute;
  border-radius: 8px;
  backdrop-filter: blur(16px) saturate(0.4);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.photo-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  background: #05070f;
}

.photo.is-ready .photo-loading { display: none; }

.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  animation: spin 0.85s linear infinite;
}

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

.photo-tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  margin: 0;
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffd9bb;
  background: rgba(11, 16, 32, 0.78);
  border: 1px solid rgba(255, 138, 61, 0.4);
  backdrop-filter: blur(6px);
}

/* ---------------- question + options ---------------- */
.question {
  margin: 0 0 16px;
  font-size: 1.12rem;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 17px;
  text-align: left;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease;
}

.option:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.option:disabled { cursor: default; }

.option-key {
  flex: none;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  color: var(--muted);
}

.option-name { line-height: 1.3; }

.option.is-correct {
  background: rgba(55, 211, 154, 0.16);
  border-color: rgba(55, 211, 154, 0.6);
}
.option.is-correct .option-key { background: rgba(55, 211, 154, 0.9); color: #04231a; border-color: transparent; }

.option.is-wrong {
  background: rgba(255, 95, 109, 0.15);
  border-color: rgba(255, 95, 109, 0.55);
}
.option.is-wrong .option-key { background: rgba(255, 95, 109, 0.9); color: #2c0407; border-color: transparent; }

.option.is-muted { opacity: 0.42; }

/* ---------------- feedback ---------------- */
.feedback {
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise 0.28s ease both;
}

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

.feedback-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.verdict { font-size: 1.16rem; font-weight: 720; letter-spacing: -0.01em; }
.verdict.is-good { color: var(--good); }
.verdict.is-bad { color: var(--bad); }

.points {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

.facts {
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px 18px;
}

.facts div { min-width: 0; }

.facts dt {
  font-size: 0.63rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.facts dd {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
}

.feedback-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ---------------- results ---------------- */
.results-eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.results-score {
  margin: 0;
  font-size: 3.2rem;
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.05;
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.results-line {
  margin: 10px 0 22px;
  color: var(--muted);
  line-height: 1.6;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  font-size: 0.83rem;
  line-height: 1.3;
}

.result-item .dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bad);
}

.result-item.is-hit .dot { background: var(--good); }

.results-actions { display: flex; justify-content: center; }

.results-actions .fineprint { text-align: center; width: 100%; }

/* ---------------- SEO footer ---------------- */
.site-footer {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.site-info h2 {
  margin: 0 0 12px;
  font-size: 1.16rem;
  letter-spacing: -0.015em;
}

.site-info h2 + p { margin-top: 0; }

.site-info p {
  color: var(--muted);
  line-height: 1.68;
  font-size: 0.9rem;
  margin: 0 0 16px;
}

.site-em { color: var(--text); }

.site-note {
  font-size: 0.82rem !important;
  color: rgba(154, 166, 204, 0.8) !important;
  margin-bottom: 10px !important;
}

.seo-index {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  column-count: 3;
  column-gap: 22px;
  font-size: 0.78rem;
  line-height: 1.5;
}

.seo-index li {
  color: var(--muted);
  padding: 3px 0;
  break-inside: avoid;
}

.seo-index a { color: var(--muted); text-decoration: none; }
.seo-index a:hover { color: var(--accent-2); text-decoration: underline; }
.seo-index .seo-park { color: rgba(154, 166, 204, 0.62); }

.seo-faq { margin: 0; }
.seo-faq dt {
  font-weight: 650;
  font-size: 0.88rem;
  margin-bottom: 5px;
}
.seo-faq dd {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.62;
  max-width: 68ch;
}

/* ---------------- responsive ---------------- */
@media (max-width: 640px) {
  .app { padding: 18px 14px 40px; }
  .panel { padding: 22px; }
  .options { grid-template-columns: 1fr; }
  .stat { min-width: 60px; padding: 6px 10px; }
  .stat-value { font-size: 0.95rem; }
  .brand h1 { font-size: 1.1rem; }
  .photo { aspect-ratio: 4 / 3; }
  .results-score { font-size: 2.5rem; }
  .seo-index { column-count: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
