/* AnimeQuiz — dark neutral UI, each anime tints it with --accent */
:root, body {
  --bg: #0E1014;
  --surface: #171A20;
  --surface-2: #22252D;
  --line: #23262E;
  --line-2: #2C3039;
  --text: #F5F6F8;
  --text-2: #C4C8D0;
  --muted: #B4B9C2;
  --faint: #9AA0AB;
  --accent: #F28C28;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-text: color-mix(in srgb, var(--accent) 72%, white);
  --ok: #2ECC71; --ok-soft: rgba(46, 204, 113, .14); --ok-text: #7BE3A6;
  --bad: #E5484D; --bad-soft: rgba(229, 72, 77, .14); --bad-text: #FF9A9D;
  --display: 'Unbounded', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[style*="--accent"] { --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent); --accent-text: color-mix(in srgb, var(--accent) 72%, white); }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); }
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-text); }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
main { flex: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.accent { color: var(--accent); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn { height: 50px; padding: 0 24px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--text);
  font: 600 15px var(--body); cursor: pointer; transition: background .15s, transform .1s; }
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 700; }
.btn-primary:hover { background: var(--accent-text); color: var(--bg); }
.btn-sm { height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pill-accent { background: var(--accent-soft); color: var(--accent-text); }
.pill-muted { background: var(--surface-2); color: var(--faint); font-weight: 600; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 20; }
.site-header .container { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 20px; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.nav { flex-grow: 1; display: flex; gap: 20px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.nav a.active { color: var(--accent-text); font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; font-size: 13px; font-weight: 600; }
.lang-switch a { padding: 8px 10px; color: var(--faint); }
.lang-switch a.current { background: var(--surface-2); color: var(--text); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #2A2E37; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }

/* Anime dropdown */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown[open] > summary, .dropdown.selected > summary { border-color: var(--accent); }
.dropdown-panel { position: absolute; top: 52px; left: 0; width: 270px; padding: 8px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--surface); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); display: flex; flex-direction: column; gap: 2px; }
.dropdown-panel.right { left: auto; right: 0; width: 200px; }
.dropdown-panel .eyebrow { padding: 8px 10px 6px; }
.dropdown-item { display: flex; align-items: center; justify-content: space-between; padding: 10px; border-radius: 10px; font-size: 14px; width: 100%;
  background: none; border: 0; color: var(--text); font-family: var(--body); text-align: left; cursor: pointer; }
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.dropdown-item.disabled { color: var(--faint); cursor: default; }
.dropdown-item.disabled:hover { background: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* Home */
.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding: 72px 0 0; }
.hero-text { flex: 999 1 520px; min-width: 0; }
.hero h1 { font-weight: 800; font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.03em; }
.hero .lead { font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 520px; }
.hero-sample { flex: 1 1 360px; min-width: 0; padding: 24px; }
.badge-outline { align-self: flex-start; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); }
.section { padding-top: 72px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
.section-head h2 { font-size: 26px; }
.anime-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.anime-card { min-height: 200px; padding: 20px; border-radius: 18px; display: flex; flex-direction: column; justify-content: space-between; }
.anime-card.live { background: var(--card-color, var(--accent)); color: var(--bg); }
.anime-card.live:hover { color: var(--bg); transform: translateY(-2px); transition: transform .15s; }
.anime-card.soon { background: var(--surface); border: 1px dashed var(--line-2); }
.anime-card .title { font-family: var(--display); font-weight: 800; font-size: 22px; }
.anime-card.soon .title { font-weight: 700; font-size: 19px; color: var(--text-2); }
.tag { align-self: flex-start; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.live .tag { background: rgba(14, 16, 20, .15); }
.soon .tag { background: var(--surface-2); color: var(--faint); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; padding-bottom: 48px; }
.step { padding: 24px; }
.step-num { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; }

/* Answers */
.answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.answer { min-height: 64px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); font: 600 16px var(--body); text-align: left; display: flex; align-items: center; gap: 14px; cursor: pointer; width: 100%; }
.answer:hover:not(:disabled) { border-color: var(--accent); }
.answer:disabled { cursor: default; }
.answer .key { width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; background: var(--bg); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; font-size: 13px; }
.answer.correct { border-color: var(--ok); background: var(--ok-soft); color: var(--ok-text); }
.answer.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad-text); }
.answer.sample { min-height: 0; padding: 14px; font-size: 14px; font-weight: 500; cursor: default; }

/* Quiz */
.quiz { padding: 48px 0; }
.progress { display: grid; grid-template-columns: repeat(var(--n, 10), minmax(0, 1fr)); gap: 6px; }
.progress span { height: 6px; border-radius: 3px; background: var(--line-2); }
.progress .ok { background: var(--ok); } .progress .bad { background: var(--bad); } .progress .now { background: var(--accent); }
.question-card { padding: 36px; display: flex; flex-direction: column; gap: 26px; }
.question-card h1 { font-weight: 700; font-size: clamp(22px, 3vw, 30px); line-height: 1.3; letter-spacing: -0.01em; }
.timer { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.timer.low { color: var(--bad-text); }
.feedback-ok { color: var(--ok-text); font-weight: 600; }
.feedback-bad { color: var(--bad-text); font-weight: 600; }

/* Difficulty */
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.level { padding: 26px; display: flex; flex-direction: column; gap: 18px; }
.level.featured { border: 2px solid var(--accent); }
.level h2 { font-size: 26px; font-weight: 700; }
.bars { display: flex; gap: 5px; }
.bars span { width: 22px; height: 8px; border-radius: 4px; background: var(--line-2); }
.bars span.on { background: var(--accent); }

/* Results */
.score-big { font-family: var(--display); font-weight: 800; font-size: 88px; line-height: 1; color: var(--accent); }
.score-big small { font-size: 40px; color: #6B7180; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 18px; border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.stat .label { font-size: 13px; color: var(--faint); }
.stat .value { font-family: var(--display); font-weight: 700; font-size: 24px; }
.list-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.strike { color: var(--bad-text); text-decoration: line-through; }

/* Forms */
.auth-card { width: 100%; max-width: 420px; padding: 32px; display: flex; flex-direction: column; gap: 22px; }
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px; border-radius: 12px; background: var(--bg); }
.tabs a { height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; color: var(--text-2); }
.tabs a.current { background: #2A2E37; color: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.input { height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: 15px var(--body); }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.error { color: var(--bad-text); font-size: 13px; font-weight: 500; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.alert { padding: 14px 18px; border-radius: 14px; background: var(--surface); font-size: 14px; color: var(--muted); }
.alert-error { background: var(--bad-soft); color: var(--bad-text); }

/* Leaderboard / profile */
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; padding: 48px 0; }
.split aside { flex: 1 1 320px; min-width: 0; }
.split section { flex: 999 1 560px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; font-weight: 600; }
.chips a { padding: 8px 12px; border-radius: 999px; background: var(--surface-2); }
.chips a.current { background: var(--accent); color: var(--bg); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 460px; }
th { padding: 10px 8px; font-weight: 600; text-align: left; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
td { padding: 14px 8px; border-top: 1px solid var(--line); }
tr.me td { background: var(--accent-soft); }
.rank-1 { color: #FFD166; } .rank-2 { color: #C9CED6; } .rank-3 { color: #E0A26B; }
.meter { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.meter span { display: block; height: 6px; background: var(--accent); }
.big-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 22px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; }
.site-footer .container { padding-top: 24px; padding-bottom: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--faint); }

/* Mobile */
@media (max-width: 720px) {
  .site-header .container { gap: 10px; }
  .nav { order: 5; flex-basis: 100%; }
  .header-right .pill { display: none; }
  .answers { grid-template-columns: 1fr; }
  .question-card { padding: 22px; }
  .hero { padding-top: 40px; }
  .stats { grid-template-columns: 1fr 1fr 1fr; }
  .score-big { font-size: 64px; }
}

/* ===================== Ninja Path (career) ===================== */
.user-chip { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.user-chip::-webkit-details-marker { display: none; }
.user-chip .avatar { width: 32px; height: 32px; font-size: 12px; }
.rank-badge { padding-right: 10px; font-size: 13px; font-weight: 600; }
.tag-solid { align-self: flex-start; padding: 5px 12px; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.tag-muted { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 700; letter-spacing: .06em; }

.path-card { position: relative; padding: 32px; border: 2px solid var(--accent); display: flex; flex-wrap: wrap; gap: 28px; align-items: center; }
.path-card:hover { color: var(--text); border-color: var(--accent-text); }
.path-card-title { font-family: var(--display); font-weight: 800; font-size: clamp(24px, 3vw, 32px); line-height: 1.1; }
.rank-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; font-size: 10px; font-weight: 700; text-align: center; color: var(--faint); }
.rank-strip span { padding: 8px 2px; border-radius: 8px; background: var(--surface-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-strip .done { background: var(--accent); color: var(--bg); }
.rank-strip .now { border: 1px solid var(--accent); background: transparent; color: var(--accent-text); }

.chapter-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; color: var(--faint); }
.chapter-row.done, .chapter-row.current { color: var(--text); }
.chapter-row.selected { background: var(--surface-2); }
.chapter-row:hover { background: var(--surface-2); color: var(--text); }
.chapter-num { width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.chapter-row.done .chapter-num { background: var(--ok); color: var(--bg); }
.chapter-row.current .chapter-num { background: var(--accent); color: var(--bg); }
.chapter-tag { font-size: 12px; font-weight: 700; color: #6B7180; }
.chapter-row.done .chapter-tag { color: var(--ok-text); }
.chapter-row.current .chapter-tag { color: var(--accent-text); }

.path-track { padding: 28px 0 44px; background: #12151A; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.path-row { display: flex; justify-content: center; }
.path-node-wrap { display: flex; align-items: center; gap: 14px; }
.path-node-wrap.flip { flex-direction: row-reverse; }
.path-node-wrap.flip .path-meta { align-items: flex-end; }
.path-node { width: 64px; height: 64px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 800; font-size: 18px; cursor: pointer; transition: transform .15s; }
.path-node:hover { transform: scale(1.06); }
.path-node.done { background: var(--accent); color: var(--bg); }
.path-node.current { width: 84px; height: 84px; font-size: 24px; background: var(--accent-text); color: var(--bg); border: 4px solid var(--text); box-shadow: 0 0 0 8px var(--accent-soft); }
.path-node.locked { background: #1B1E25; color: #6B7180; border: 2px dashed var(--line-2); cursor: default; }
.path-node.locked:hover { transform: none; }
.path-node.boss { width: 96px; height: 96px; font-size: 16px; border: 3px solid var(--bad); background: var(--surface-2); color: var(--bad-text); }
.path-node.boss.done { background: var(--bad); color: var(--bg); }
.path-meta { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.path-stars { font-size: 12px; letter-spacing: 2px; color: var(--accent-text); }
.path-format { font-size: 12px; font-weight: 600; color: var(--faint); }

.lives { display: flex; gap: 4px; }
.tf-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: 100%; max-width: 520px; margin: 0 auto; }
.answer.tf { height: 72px; justify-content: center; font: 800 20px var(--display); }
.input-lg { height: 56px; font-size: 18px; font-weight: 600; border-radius: 14px; }
.input.is-ok { border: 2px solid var(--ok); }
.input.is-bad { border: 2px solid var(--bad); }
.hint { color: var(--accent-text); font-weight: 600; }
.quote-box { margin: 0; padding: 28px 28px 24px; border-radius: 18px; background: var(--bg); display: flex; flex-direction: column; gap: 14px; }
.quote-box blockquote { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(20px, 2.6vw, 28px); line-height: 1.35; }
.clue-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.clue-list li { display: flex; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line-2); color: #6B7180; line-height: 1.5; }
.clue-list li.open { border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); }
.clue-pts { flex-shrink: 0; min-width: 48px; font-size: 12px; font-weight: 800; color: #6B7180; }
.clue-list li.open .clue-pts { color: var(--accent-text); }
.order-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.order-item { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); }
.order-item.correct { border-color: var(--ok); }
.order-item.wrong { border-color: var(--bad); }
.order-num { width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.btn.icon { width: 44px; padding: 0; }
.match-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.answer.match-left, .answer.match-right { min-height: 54px; justify-content: space-between; }
.answer.selected { border: 2px solid var(--accent); }
.answer.paired { border-color: var(--accent); background: var(--accent-soft); }
.pair-tag { font-size: 12px; font-weight: 800; color: var(--accent-text); }
.match-result { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); font-weight: 600; }
.match-result.correct { border-color: var(--ok); color: var(--ok-text); }
.match-result.wrong { border-color: var(--bad); color: var(--bad-text); }
.image-q { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.image-frame { border-radius: 16px; overflow: hidden; background: #2A2E37; aspect-ratio: 1 / 1; }
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .9s linear, transform .9s linear; }
.image-frame.mode-silhouette img { filter: brightness(0); }
.image-q .answers { grid-template-columns: 1fr; }

.upload-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px 12px; border-radius: 14px;
  border: 2px dashed var(--line-2); background: var(--bg); color: var(--faint); font-size: 14px; text-align: center; cursor: pointer; }
.upload-box input { max-width: 100%; font-size: 12px; color: var(--faint); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.admin-card { border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.admin-card img { width: 100%; height: 130px; object-fit: cover; display: block; background: #2A2E37; }

@media (max-width: 720px) {
  .path-node-wrap { transform: none !important; }
  .image-q, .match-grid, .form-grid { grid-template-columns: 1fr; }
  .rank-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
