/* =====================================================================
   HistorySprout.com - Main Stylesheet
   Theme: Dark navy + warm gold, historical + modern gaming
   ===================================================================== */

:root {
  --navy-950: #0a0f1e;
  --navy-900: #0f1729;
  --navy-800: #16213b;
  --navy-700: #1e2c4a;
  --navy-600: #2a3d63;
  --gold-500: #d4a531;
  --gold-400: #e6bd52;
  --gold-300: #f0d488;
  --cream: #f7f3ea;
  --white: #ffffff;
  --ink: #1a1f2e;
  --text-muted: #93a0bd;
  --text-soft: #c3cbde;
  --success: #3ecf8e;
  --danger: #e6584f;
  --warning: #e6bd52;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-md: 0 8px 24px rgba(6, 10, 20, 0.35);
  --shadow-lg: 0 20px 48px rgba(6, 10, 20, 0.45);
  --font-heading: Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: radial-gradient(circle at top, var(--navy-800) 0%, var(--navy-950) 60%);
  color: var(--text-soft);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--gold-400); text-decoration: none; }
a:hover { color: var(--gold-300); }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--gold-500); color: var(--navy-950);
  padding: 10px 16px; z-index: 1000; border-radius: 0 0 8px 0; font-weight: 700;
}
.skip-link:focus { left: 0; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--white); margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

:focus-visible {
  outline: 3px solid var(--gold-400);
  outline-offset: 2px;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  padding: 14px 28px; border-radius: var(--radius-md); border: 2px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none; line-height: 1;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: var(--navy-950); box-shadow: var(--shadow-md); }
.btn-primary:hover { color: var(--navy-950); box-shadow: 0 12px 28px rgba(212,165,49,.35); }
.btn-secondary { background: var(--navy-700); color: var(--white); border-color: var(--navy-600); }
.btn-secondary:hover { color: var(--white); border-color: var(--gold-500); }
.btn-outline { background: transparent; color: var(--gold-400); border-color: var(--gold-500); }
.btn-outline:hover { background: rgba(212,165,49,.1); color: var(--gold-300); }
.btn-lg { padding: 18px 36px; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------------- Header / Nav ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 15, 30, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212,165,49,.15);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700; color: var(--white); }
.brand-icon { font-size: 1.6rem; }
.brand-accent { color: var(--gold-400); }
.main-nav { display: flex; gap: 26px; flex: 1; justify-content: center; }
.main-nav a { color: var(--text-soft); font-weight: 600; font-size: .95rem; padding: 8px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--gold-400); border-color: var(--gold-500); }
.header-stats { display: flex; gap: 14px; }
.hp-stat { background: var(--navy-800); border: 1px solid var(--navy-600); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: .9rem; color: var(--gold-300); white-space: nowrap; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--white); border-radius: 2px; }
.mobile-nav { display: none; flex-direction: column; background: var(--navy-900); border-top: 1px solid var(--navy-700); }
.mobile-nav a { padding: 14px 20px; color: var(--text-soft); border-bottom: 1px solid var(--navy-800); font-weight: 600; }
.mobile-nav.open { display: flex; }

@media (max-width: 860px) {
  .main-nav { display: none; }
  .header-stats { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------------- Hero ---------------- */
.hero {
  padding: 72px 0 56px; text-align: center; position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  border-bottom: 1px solid rgba(212,165,49,.12);
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .08; pointer-events: none;
  background-image: repeating-linear-gradient(45deg, var(--gold-400) 0 2px, transparent 2px 40px);
}
.hero-inner { position: relative; max-width: 780px; margin: 0 auto; }
.hero-eyebrow { display: inline-block; color: var(--gold-400); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; margin-bottom: 14px; }
.hero h1 { color: var(--white); }
.hero p.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 620px; margin: 0 auto 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 20px; }
.hero-note { color: var(--text-muted); font-size: .85rem; }

/* ---------------- Sections / Cards ---------------- */
section { padding: 56px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head p { color: var(--text-muted); }

.card {
  background: var(--navy-800); border: 1px solid var(--navy-700); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-md);
}
.card-white {
  background: var(--white); color: var(--ink); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-md);
}
.card-white h3, .card-white h2 { color: var(--ink); }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.game-card {
  display: flex; flex-direction: column; gap: 12px; text-align: left; position: relative; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.game-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.game-card .icon { font-size: 2.4rem; }
.game-card .tag { display: inline-block; background: rgba(212,165,49,.15); color: var(--gold-300); font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: .04em; text-transform: uppercase; width: fit-content; }
.game-card ul { margin: 0; padding-left: 20px; color: var(--text-muted); font-size: .92rem; }

.feature { text-align: center; padding: 10px; }
.feature .icon { font-size: 2rem; margin-bottom: 10px; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--text-muted); font-size: .92rem; }

.how-step { display: flex; gap: 16px; align-items: flex-start; }
.how-step .num { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--gold-500); color: var(--navy-950); font-weight: 800; display: flex; align-items: center; justify-content: center; }

.faq-item { border-bottom: 1px solid var(--navy-700); padding: 18px 0; }
.faq-item summary { cursor: pointer; font-weight: 700; color: var(--white); font-family: var(--font-heading); font-size: 1.05rem; }
.faq-item p { margin-top: 10px; color: var(--text-muted); }

.breadcrumbs { font-size: .85rem; color: var(--text-muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--gold-400); }

/* ---------------- Ad slot (kept visually separate from game controls) ---------------- */
.ad-slot {
  background: var(--navy-800); border: 1px dashed var(--navy-600); border-radius: var(--radius-md);
  padding: 18px; text-align: center; color: var(--text-muted); font-size: .8rem; margin: 32px 0;
}

/* =====================================================================
   GAME UI
   ===================================================================== */
.game-shell {
  max-width: 760px; margin: 0 auto; padding: 32px 20px 64px;
}
.game-hero {
  text-align: center; margin-bottom: 26px;
}
.game-hero .icon { font-size: 3rem; }

.name-gate {
  max-width: 460px; margin: 0 auto;
}
.name-gate label { display: block; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.name-gate input[type="text"] {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-sm); border: 2px solid var(--navy-600);
  background: var(--navy-900); color: var(--white); font-size: 1rem; margin-bottom: 16px;
}
.name-gate input[type="text"]:focus { border-color: var(--gold-500); }
.difficulty-picker { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.difficulty-picker button {
  flex: 1; min-width: 90px; padding: 10px; border-radius: var(--radius-sm); border: 2px solid var(--navy-600);
  background: var(--navy-900); color: var(--text-soft); font-weight: 700; cursor: pointer;
}
.difficulty-picker button.active { border-color: var(--gold-500); color: var(--gold-300); background: rgba(212,165,49,.12); }

.hud {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  background: var(--navy-800); border: 1px solid var(--navy-700); border-radius: var(--radius-md);
  padding: 14px 18px; margin-bottom: 20px;
}
.hud-item { text-align: center; min-width: 64px; }
.hud-item .label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.hud-item .value { font-size: 1.15rem; font-weight: 800; color: var(--white); }
.hud-lives { letter-spacing: 2px; }

.timer-bar-track { height: 8px; border-radius: 99px; background: var(--navy-700); overflow: hidden; margin-bottom: 22px; }
.timer-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold-400), var(--gold-500)); width: 100%; transition: width 1s linear; }
.timer-bar-fill.low { background: linear-gradient(90deg, var(--danger), #ff8a80); }

.progress-track { height: 6px; border-radius: 99px; background: var(--navy-700); overflow: hidden; margin-bottom: 16px; }
.progress-fill { height: 100%; background: var(--gold-500); transition: width .3s ease; }

.question-card {
  background: var(--white); color: var(--ink); border-radius: var(--radius-lg); padding: 30px;
  box-shadow: var(--shadow-lg); margin-bottom: 22px;
}
.question-meta { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.badge { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; }
.badge-category { background: #eef1fb; color: #3a4a8f; }
.badge-difficulty-easy { background: #e3f9ee; color: #1c8a55; }
.badge-difficulty-medium { background: #fff4e0; color: #b1720b; }
.badge-difficulty-hard { background: #fde7e6; color: #c23b32; }
.badge-type { background: #f3e9d2; color: #8a6a12; }

.question-card h2 { color: var(--ink); font-size: 1.35rem; margin-bottom: 6px; }
.question-image { border-radius: var(--radius-md); margin: 14px 0; overflow: hidden; }
.question-image img { width: 100%; height: auto; }

.options-grid { display: grid; gap: 12px; margin-top: 18px; }
.option-btn {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  padding: 16px 18px; border-radius: var(--radius-md); border: 2px solid #e3e6ef; background: #fbfbfd;
  cursor: pointer; font-size: 1rem; font-weight: 600; color: var(--ink); transition: border-color .15s, background .15s, transform .1s;
}
.option-btn:hover:not(:disabled) { border-color: var(--gold-500); transform: translateX(2px); }
.option-letter {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--navy-800); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem;
}
.option-btn:disabled { cursor: default; }
.option-btn.correct { border-color: var(--success); background: #e5f9f0; }
.option-btn.correct .option-letter { background: var(--success); }
.option-btn.incorrect { border-color: var(--danger); background: #fdeceb; }
.option-btn.incorrect .option-letter { background: var(--danger); }

.feedback-panel {
  background: var(--navy-800); border: 1px solid var(--navy-700); border-radius: var(--radius-md);
  padding: 20px; margin-top: 4px; animation: slideUp .25s ease;
}
.feedback-panel.is-correct { border-color: var(--success); }
.feedback-panel.is-incorrect { border-color: var(--danger); }
.feedback-title { font-weight: 800; font-size: 1.05rem; margin-bottom: 6px; }
.feedback-title.correct { color: var(--success); }
.feedback-title.incorrect { color: var(--danger); }
.feedback-panel p { color: var(--text-soft); margin-bottom: 8px; font-size: .95rem; }
.feedback-panel a.source-link { font-weight: 700; font-size: .88rem; }
.feedback-continue { margin-top: 12px; font-size: .8rem; color: var(--text-muted); }

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

.loading-state, .error-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.spinner { width: 42px; height: 42px; border: 4px solid var(--navy-700); border-top-color: var(--gold-500); border-radius: 50%; margin: 0 auto 16px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Results screen */
.results-card { text-align: center; }
.results-card .big-score { font-size: 3rem; font-weight: 800; color: var(--gold-400); font-family: var(--font-heading); }
.results-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 24px 0; }
.results-stats .stat { background: var(--navy-900); border-radius: var(--radius-md); padding: 16px 10px; }
.results-stats .stat .num { font-size: 1.4rem; font-weight: 800; color: var(--white); }
.results-stats .stat .lbl { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.reward-row { display: flex; justify-content: center; gap: 22px; margin: 18px 0 26px; font-weight: 700; }
.results-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.achievement-toast { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: var(--navy-950); border-radius: var(--radius-md); padding: 14px 18px; margin-top: 14px; font-weight: 700; text-align: left; display: flex; gap: 10px; align-items: center; }

/* Daily challenge specific */
.streak-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(135deg, #2a1e0d, #1e2c4a); border: 1px solid var(--gold-500);
  border-radius: var(--radius-md); padding: 16px; margin-bottom: 24px; text-align: center; font-weight: 700; color: var(--gold-300);
}
.streak-flames { font-size: 1.4rem; }

/* Leaderboard */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-bar button {
  padding: 10px 18px; border-radius: 999px; border: 2px solid var(--navy-600); background: var(--navy-800);
  color: var(--text-soft); font-weight: 700; cursor: pointer; font-size: .88rem;
}
.filter-bar button.active { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-950); }

table.leaderboard-table { width: 100%; border-collapse: collapse; background: var(--navy-800); border-radius: var(--radius-md); overflow: hidden; }
table.leaderboard-table th, table.leaderboard-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--navy-700); font-size: .92rem; }
table.leaderboard-table th { background: var(--navy-900); color: var(--gold-300); text-transform: uppercase; font-size: .72rem; letter-spacing: .05em; }
table.leaderboard-table tr:last-child td { border-bottom: none; }
.rank-badge { font-weight: 800; }
.rank-1 { color: #ffd54f; } .rank-2 { color: #d7dbe3; } .rank-3 { color: #cd8a4f; }
.table-scroll { overflow-x: auto; }

/* Name form for saving score */
.save-score-form { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.save-score-form input { flex: 1; min-width: 180px; padding: 12px 14px; border-radius: var(--radius-sm); border: 2px solid var(--navy-600); background: var(--navy-900); color: var(--white); }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--navy-950); border-top: 1px solid var(--navy-800); padding: 48px 0 20px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 30px; }
.footer-brand p { color: var(--text-muted); font-size: .88rem; margin-top: 10px; }
.footer-links h3 { font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gold-400); }
.footer-links a { display: block; color: var(--text-muted); padding: 4px 0; font-size: .92rem; }
.footer-links a:hover { color: var(--gold-300); }
.footer-bottom { border-top: 1px solid var(--navy-800); padding-top: 18px; color: var(--text-muted); font-size: .8rem; text-align: center; }
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr; } }

/* ---------------- Admin panel ---------------- */
.admin-body { background: var(--navy-950); }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 32px 20px 64px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.admin-nav a { padding: 10px 16px; background: var(--navy-800); border-radius: var(--radius-sm); color: var(--text-soft); font-weight: 600; font-size: .9rem; border: 1px solid var(--navy-700); }
.admin-nav a.active, .admin-nav a:hover { border-color: var(--gold-500); color: var(--gold-300); }
.admin-login-shell { max-width: 400px; margin: 90px auto; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; color: var(--white); margin-bottom: 6px; font-size: .9rem; }
.form-group input[type=text], .form-group input[type=password], .form-group input[type=url], .form-group input[type=email], .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 2px solid var(--navy-600); background: var(--navy-900); color: var(--white); font-size: .95rem; font-family: inherit;
}
.form-group textarea { min-height: 90px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.alert { padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-weight: 600; font-size: .92rem; }
.alert-error { background: #3a1d1b; color: #ff9d95; border: 1px solid #6b2d28; }
.alert-success { background: #163a2b; color: #7ee2ae; border: 1px solid #1f5c3f; }
.data-table { width: 100%; border-collapse: collapse; background: var(--navy-800); border-radius: var(--radius-md); overflow: hidden; font-size: .88rem; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--navy-700); text-align: left; vertical-align: top; }
.data-table th { background: var(--navy-900); color: var(--gold-300); text-transform: uppercase; font-size: .7rem; letter-spacing: .04em; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.pill-active { background: #163a2b; color: #7ee2ae; }
.pill-disabled { background: #3a1d1b; color: #ff9d95; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
@media (max-width: 800px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
.stat-cards .card { text-align: center; padding: 20px; }
.stat-cards .num { font-size: 1.8rem; font-weight: 800; color: var(--gold-400); }
.stat-cards .lbl { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; }
.action-links a, .action-links button { font-size: .82rem; margin-right: 10px; background: none; border: none; color: var(--gold-400); cursor: pointer; font-weight: 700; padding: 0; }
.pagination { display: flex; gap: 8px; margin-top: 20px; }
.pagination a { padding: 6px 12px; border: 1px solid var(--navy-600); border-radius: var(--radius-sm); color: var(--text-soft); }
.pagination a.active { background: var(--gold-500); color: var(--navy-950); border-color: var(--gold-500); }

/* =====================================================================
   v2 ADDITIONS: nav link to profile, hero stats, daily banner, topics,
   articles, enemy bar, combo, lifelines, clue list, timeline rush,
   toasts, confetti, profile page
   ===================================================================== */

.header-stats { text-decoration: none; }
.hero-stats { list-style: none; display: flex; gap: 32px; justify-content: center; margin: 30px 0 0; padding: 0; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; align-items: center; }
.hero-stats strong { font-family: var(--font-heading); font-size: 1.6rem; color: var(--gold-400); }
.hero-stats span { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

.daily-banner { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; justify-content: space-between; }
.daily-emoji { font-size: 5rem; line-height: 1; }
.countdown-line { color: var(--text-muted); font-size: .9rem; }
.countdown-line strong { color: var(--gold-300); font-variant-numeric: tabular-nums; }

.fact-card { background: var(--navy-800); border: 1px solid var(--gold-500); border-radius: var(--radius-lg); padding: 26px 30px; text-align: center; }
.fact-card h2 { margin-bottom: 10px; }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.topic-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--navy-800); border: 1px solid var(--navy-700); border-radius: var(--radius-md); padding: 18px 10px; text-align: center; color: var(--text-soft); transition: border-color .15s, transform .15s; }
.topic-tile:hover { border-color: var(--gold-500); transform: translateY(-3px); color: var(--text-soft); }
.topic-icon { font-size: 1.8rem; }
.topic-tile strong { color: var(--white); font-size: .92rem; }
.topic-tile span { font-size: .75rem; color: var(--text-muted); }

.article-card { text-decoration: none; display: flex; flex-direction: column; gap: 8px; }
.article-card .meta { color: var(--gold-400); font-size: .82rem; font-weight: 700; margin-top: auto; }
.mini-board { list-style: none; margin: 0; padding: 0; }
.mini-board li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--navy-700); }
.mini-board li:last-child { border-bottom: none; }
.mini-board .pos { width: 26px; height: 26px; border-radius: 50%; background: var(--navy-700); color: var(--gold-300); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem; }
.mini-board .nm { flex: 1; }
.mini-board strong { color: var(--gold-400); }

.pill-link { padding: 8px 16px; border-radius: 999px; border: 2px solid var(--navy-600); background: var(--navy-800); color: var(--text-soft); font-weight: 700; font-size: .85rem; text-decoration: none; }
.pill-link:hover { border-color: var(--gold-500); color: var(--gold-300); }
.pill-link.active { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-950); }
.pill-link.small { font-size: .75rem; padding: 5px 12px; }
.muted { color: var(--text-muted); }
.muted.small, p.small { font-size: .8rem; }
table.leaderboard-table small.muted { font-size: .75rem; }

.content-narrow { max-width: 760px; margin: 0 auto; }
.content-narrow h2 { margin-top: 36px; }
.content-narrow ul, .content-narrow ol { color: var(--text-soft); }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--navy-800); border: 1px solid var(--navy-700); color: var(--text-soft); font-size: .85rem; text-decoration: none; }
.chip:hover { border-color: var(--gold-500); color: var(--gold-300); }
.chip-gold { background: rgba(212,165,49,.12); border-color: var(--gold-500); color: var(--gold-300); font-weight: 700; }
.link-list { list-style: none; padding: 0; }
.link-list li { padding: 6px 0; border-bottom: 1px dashed var(--navy-700); }
.link-list li:last-child { border-bottom: none; }

.qa-item { background: var(--navy-800); border: 1px solid var(--navy-700); border-radius: var(--radius-md); padding: 18px 20px; margin-bottom: 14px; }
.qa-item h3 { font-size: 1rem; color: var(--white); margin-bottom: 8px; }
.qa-answer { color: var(--gold-300); font-weight: 700; margin-bottom: 6px; }

.article .tldr { background: rgba(212,165,49,.1); border-left: 4px solid var(--gold-500); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 14px 18px; margin: 18px 0 26px; color: var(--text-soft); }
.article-body h2 { margin-top: 32px; font-size: 1.3rem; }
.article-body ul, .article-body ol { color: var(--text-soft); padding-left: 22px; }
.article-body li { margin-bottom: 6px; }
.cta-card { text-align: center; margin: 34px 0; }
.related-line { color: var(--text-muted); font-size: .85rem; margin-top: 16px; }

/* Sound toggle */
.sound-toggle { background: var(--navy-900); border: 1px solid var(--navy-600); border-radius: 999px; width: 38px; height: 38px; font-size: 1rem; cursor: pointer; color: var(--text-soft); margin-left: auto; }
.hud .sound-toggle { align-self: center; }

/* Enemy HP bar (Battle) */
.enemy-bar { display: flex; align-items: center; gap: 10px; background: var(--navy-800); border: 1px solid var(--navy-700); border-radius: var(--radius-md); padding: 10px 14px; margin-bottom: 14px; }
.enemy-name { font-weight: 700; color: var(--white); font-size: .9rem; white-space: nowrap; }
.hp-track { flex: 1; height: 10px; border-radius: 99px; background: var(--navy-700); overflow: hidden; }
.hp-fill { height: 100%; background: linear-gradient(90deg, #e6584f, #ff8a80); transition: width .4s ease; }
.hp-text { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }

/* Combo + hearts */
.hud-item.combo.hot .value { color: var(--gold-400); animation: pulse 0.6s ease infinite alternate; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.12); } }
.hearts { letter-spacing: 2px; font-size: 1rem; }
.heart.lost { opacity: .35; filter: grayscale(1); }

/* Lifelines */
.lifelines { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.lifeline { flex: 1; min-width: 90px; padding: 10px; border-radius: var(--radius-sm); border: 2px solid var(--gold-500); background: rgba(212,165,49,.1); color: var(--gold-300); font-weight: 700; cursor: pointer; font-size: .85rem; }
.lifeline:disabled { opacity: .35; cursor: not-allowed; border-color: var(--navy-600); color: var(--text-muted); background: var(--navy-800); }
.option-btn.eliminated { opacity: .3; text-decoration: line-through; }

/* Timer row with number */
.timer-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.timer-row .timer-bar-track { flex: 1; margin-bottom: 0; }
.timer-num { font-weight: 800; color: var(--white); font-variant-numeric: tabular-nums; width: 26px; text-align: right; }

/* Clue list (Detective) */
.clue-list { list-style: none; counter-reset: clue; padding: 0; margin: 0 0 14px; }
.clue-list .clue { counter-increment: clue; position: relative; padding: 10px 10px 10px 34px; margin-bottom: 8px; border-radius: var(--radius-sm); background: #f3f0e6; color: var(--ink); font-weight: 600; }
.clue-list .clue::before { content: counter(clue); position: absolute; left: 8px; top: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--navy-800); color: #fff; font-size: .72rem; display: flex; align-items: center; justify-content: center; }
.clue-list .clue.hidden { display: none; }
.clue-prompt { font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.clue-btn { margin-bottom: 6px; }
.clue-worth { font-size: .8rem; color: #7a6a3a; margin-bottom: 14px; }

/* Float score pop */
.question-card { position: relative; overflow: hidden; }
.float-pop { position: absolute; right: 22px; top: 18px; font-weight: 800; font-size: 1.3rem; pointer-events: none; animation: floatPop 1.1s ease forwards; }
.float-pop.good { color: #1c8a55; }
.float-pop.bad { color: #c23b32; }
@keyframes floatPop { 0% { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-28px); } }
.shake { animation: shakeX .4s; }
@keyframes shakeX { 10%,90%{transform:translateX(-2px)} 20%,80%{transform:translateX(4px)} 30%,50%,70%{transform:translateX(-8px)} 40%,60%{transform:translateX(8px)} }

.feedback-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.auto-note { font-size: .78rem; color: var(--text-muted); }

.result-banner { font-family: var(--font-heading); font-weight: 800; font-size: 1.4rem; padding: 10px; border-radius: var(--radius-sm); margin-bottom: 6px; }
.result-banner.victory { color: var(--gold-400); }
.result-banner.defeat { color: var(--text-muted); }
.score-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-top: 6px; }
.levelup { background: rgba(212,165,49,.14); border: 1px solid var(--gold-500); border-radius: var(--radius-md); padding: 12px; margin: 14px 0; color: var(--gold-300); font-weight: 700; }
.result-note { color: var(--text-muted); font-size: .9rem; }
.big-emoji { font-size: 2.6rem; }

/* Timeline Rush */
.rush-head { text-align: center; margin-bottom: 16px; }
.rush-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 640px) { .rush-grid { grid-template-columns: 1fr; } }
.rush-card { background: var(--white); color: var(--ink); border-radius: var(--radius-lg); padding: 26px 18px; text-align: center; border: 3px solid transparent; cursor: pointer; display: flex; flex-direction: column; gap: 8px; min-height: 150px; justify-content: center; }
.rush-card:hover:not(:disabled) { border-color: var(--gold-500); }
.rush-cat { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: #7a6a3a; }
.rush-title { font-weight: 800; font-size: 1.05rem; }
.rush-year { font-weight: 800; color: var(--gold-500); font-size: 1.1rem; min-height: 1.3em; }
.rush-note { font-size: .8rem; color: #555; }
.rush-card.correct { border-color: var(--success); background: #e5f9f0; }
.rush-card.incorrect { border-color: var(--danger); background: #fdeceb; }
.rush-card:disabled { cursor: default; }

/* Toast */
.hs-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--navy-800); border: 1px solid var(--gold-500); color: var(--gold-300); padding: 10px 18px; border-radius: 999px; font-size: .85rem; font-weight: 600; opacity: 0; transition: opacity .25s, transform .25s; z-index: 999; box-shadow: var(--shadow-md); }
.hs-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Confetti canvas */
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 998; }

/* Profile page */
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: var(--navy-950); font-weight: 800; font-size: 1.6rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-head .grow { flex: 1; min-width: 220px; }
.rank-line { color: var(--gold-300); margin-bottom: 8px; }
.profile-stats { margin: 22px 0; }
.stat-box { background: var(--navy-800); border: 1px solid var(--navy-700); border-radius: var(--radius-md); padding: 16px; text-align: center; }
.stat-box strong { display: block; font-size: 1.3rem; color: var(--white); }
.stat-box span { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 30px; }
.ach { background: var(--navy-800); border: 1px solid var(--navy-700); border-radius: var(--radius-md); padding: 14px; text-align: center; }
.ach.off { opacity: .5; }
.ach-icon { font-size: 1.8rem; display: block; margin-bottom: 6px; }
.ach strong { display: block; font-size: .85rem; color: var(--white); margin-bottom: 2px; }
.ach small { color: var(--text-muted); font-size: .72rem; }

/* Streak banner reuse for name-gate rules */
.name-gate .rules { list-style: none; padding: 0; margin: 0 0 18px; color: var(--text-muted); font-size: .88rem; }
.name-gate .rules li { padding: 4px 0; }
