/* The Quiz Consortium — shared layout skeleton.
   All color comes from CSS custom properties set per-world in base.html. */

*, *::before, *::after { box-sizing: border-box; }

/* the hidden attribute must always win, even over display:flex rules */
[hidden] { display: none !important; }

:root {
  --maxw: 1080px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px -12px rgba(20, 25, 45, 0.25);
  --shadow-sm: 0 4px 14px -8px rgba(20, 25, 45, 0.30);
  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; margin: 0 0 .4em; letter-spacing: -0.01em; }
a { color: var(--primary); text-decoration: none; }
p { margin: 0 0 1rem; }

/* ---------- header / footer ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  padding: 18px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.brand-gem { width: 30px; height: auto; display: block; flex: none; }
.brand-gem-sm { width: 22px; }
.brand-name { font-family: var(--font-head); font-size: 1.25rem; letter-spacing: -0.01em; }
.site-nav a { color: var(--muted); font-weight: 600; font-size: .95rem; }
.site-nav a:hover { color: var(--ink); }

.site-footer { flex-shrink: 0; padding: 32px 24px; margin-top: 48px; border-top: 1px solid rgba(0,0,0,.07); }
.foot-inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--ink); font-weight: 600; font-size: .95rem; }
.foot-brand { display: flex; align-items: center; gap: 8px; }
.foot-endorse { display: flex; align-items: center; gap: 7px; color: var(--muted);
  font-weight: 600; font-size: .9rem; }
.foot-dot { color: var(--muted); }
.foot-muted { color: var(--muted); font-weight: 400; }
.foot-nav { display: flex; gap: 18px; }
.foot-nav a { color: var(--muted); font-weight: 600; }
.foot-nav a:hover { color: var(--ink); }

/* ---------- prose (content pages) ---------- */
.hero-page { padding: 36px 24px 42px; }
.prose { max-width: 740px; margin: 0 auto; }
.prose h2 { font-size: 1.3rem; margin-top: 1.8em; }
.prose p { color: var(--ink); }
.prose a { text-decoration: underline; }
.prose-updated { color: var(--muted); font-size: .9rem; margin-top: 2em;
  padding-top: 1em; border-top: 1px solid rgba(0,0,0,.08); }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  color: #fff;
  padding: 44px 24px 52px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(900px 400px at 85% -10%, rgba(255,255,255,.18), transparent 60%);
  pointer-events: none;
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: .35em; }
.hero-brand { display: flex; align-items: center; gap: 16px; margin-bottom: .3em; }
.hero-brand img { width: 116px; height: 116px; flex: none; }
.hero-brand h1 { margin-bottom: 0; }
@media (max-width: 560px) {
  .hero-brand { gap: 11px; }
  .hero-brand img { width: 76px; height: 76px; }
}
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 60ch; color: rgba(255,255,255,.92); }
.hero-meta { color: rgba(255,255,255,.8); font-weight: 600; font-size: .95rem; margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700;
  color: var(--accent); margin: 0 0 .8em; }
.back-link { display: inline-block; color: rgba(255,255,255,.85); font-weight: 600; margin-bottom: 1rem; }
.back-link:hover { color: #fff; }

/* quiz hero — more compact than landing hero */
.hero-quiz { padding: 28px 24px 32px; }
.hero-quiz .hero-inner { position: relative; }
.hero-quiz .back-link { margin-bottom: .5rem; }
/* world name pinned to the top-right, off the vertical stack */
.hero-quiz .eyebrow { position: absolute; top: 2px; right: 0; margin: 0; }
.hero-quiz h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  padding: 13px 22px; border-radius: 999px; border: 1.5px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { filter: brightness(1.05); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; border-color: currentColor; color: var(--ink); }
.btn-ghost:hover { background: rgba(0,0,0,.04); }
.btn-lg { padding: 15px 28px; font-size: 1.08rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.hero .btn-primary { background: #fff; color: var(--grad-a); }

/* ---------- sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 56px 24px; width: 100%; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-sub { color: var(--muted); max-width: 52ch; margin: 0 auto; }

/* ---------- world grid (home) ---------- */
.world-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.world-card {
  position: relative; color: #fff; border-radius: var(--radius); padding: 26px;
  background: linear-gradient(150deg, var(--grad-a), var(--grad-b));
  box-shadow: var(--shadow); overflow: hidden; min-height: 220px;
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.world-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -16px rgba(20,25,45,.45); }
.world-card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px 200px at 90% -20%, rgba(255,255,255,.22), transparent 60%);
}
.world-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; position: relative; z-index: 1; }
.world-emoji { font-size: 2rem; }
.world-count { background: rgba(255,255,255,.22); padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.world-card h3 { font-size: 1.5rem; position: relative; z-index: 1; color: #fff; }
.world-card p { color: rgba(255,255,255,.9); font-size: .95rem; position: relative; z-index: 1; flex: 1; }
.world-go { font-weight: 700; color: var(--accent); position: relative; z-index: 1; }

/* ---------- world rows (home, alternating image/text) ---------- */
.world-rows { display: flex; flex-direction: column; gap: 28px; }
.world-row {
  display: grid; grid-template-columns: 1fr 1fr; align-items: stretch;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,.05);
}
.world-row-media {
  position: relative; display: block; min-height: 300px; order: 0;
  background: linear-gradient(140deg, var(--grad-a), var(--grad-b));
}
.world-row.reverse .world-row-media { order: 2; }
.world-row-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.world-row-emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: 4rem; }
.world-row-body { padding: 36px 40px; display: flex; flex-direction: column; justify-content: center; }
.world-row-body h3 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: .35em; }
.world-row-blurb { color: var(--muted); font-size: 1.02rem; margin-bottom: 18px; }
.world-row-feat { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.world-row-feat a {
  display: inline-block; background: var(--surface-2); color: var(--ink);
  font-size: .82rem; font-weight: 600;
  padding: 6px 13px; border-radius: 999px; border: 1px solid rgba(0,0,0,.05);
  transition: border-color .12s ease, color .12s ease, transform .12s ease;
}
.world-row-feat a:hover { border-color: var(--primary); color: var(--primary);
  transform: translateY(-1px); }
.world-row-cta { align-self: flex-start; }
@media (max-width: 760px) {
  .world-row { grid-template-columns: 1fr; }
  .world-row-media, .world-row.reverse .world-row-media { order: 0; min-height: 200px; }
  .world-row-body { padding: 26px 24px; }
}

/* ---------- category grid (world) ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cat-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); color: var(--ink); border-radius: var(--radius-sm);
  padding: 18px; box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,.04);
  transition: transform .12s ease, box-shadow .12s ease;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cat-icon {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: 12px;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.5rem;
  color: var(--primary-ink); background: linear-gradient(140deg, var(--grad-a), var(--grad-b));
}
.cat-body { flex: 1; }
.cat-body h3 { font-size: 1.08rem; margin: 0 0 2px; }
.cat-count { color: var(--muted); font-size: .85rem; }
.cat-go { color: var(--primary); font-size: 1.4rem; font-weight: 700; }

/* ---------- coming-soon CTA ---------- */
.section-cta { padding-top: 0; }
.cta-card {
  text-align: center; background: var(--surface); border-radius: var(--radius);
  padding: 48px 32px; box-shadow: var(--shadow-sm); border: 1px dashed rgba(0,0,0,.14);
}
.cta-badge { display: inline-block; background: var(--accent); color: var(--ink);
  padding: 4px 14px; border-radius: 999px; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.cta-card p { color: var(--muted); max-width: 46ch; margin: 0 auto 1.4rem; }

/* ---------- quiz shell ---------- */
.quiz-shell { max-width: 760px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-sm); }

.quiz-hero { width: 100%; max-height: 280px; object-fit: cover; border-radius: var(--radius-sm);
  margin: -8px 0 22px; display: block; }
.q-image { width: 100%; max-width: 360px; aspect-ratio: 1/1; object-fit: cover;
  border-radius: var(--radius-sm); margin: 0 auto 18px; display: block; }
.welcome-body :is(h2,h3) { font-size: 1.2rem; }
.welcome-body p { color: var(--muted); }
.welcome-more { margin: 8px 0 22px; }
.welcome-more summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.welcome-more[open] summary { margin-bottom: 12px; }
.welcome-card #start-btn { display: flex; width: fit-content; margin: 26px auto 0; }

/* quiz card */
.quiz-top { margin-bottom: 22px; }
.progress-wrap { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.progress-bar { height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .35s ease; }
.quiz-meta { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 600; color: var(--muted); }
.score-pill { color: var(--primary); }
.lead-in { color: var(--muted); font-size: .98rem; margin-bottom: 14px; }
.lead-in p { margin: 0 0 .6rem; }
.question { font-size: 1.35rem; margin-bottom: 20px; }

.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--surface-2); border: 2px solid transparent; border-radius: var(--radius-sm);
  padding: 15px 18px; display: flex; align-items: center; gap: 12px;
  transition: border-color .12s ease, background .12s ease, transform .08s ease;
}
.option:hover:not(:disabled) { border-color: var(--primary); }
.option:active:not(:disabled) { transform: scale(.995); }
.option .opt-letter {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: #fff; border: 1.5px solid rgba(0,0,0,.1); font-weight: 700; font-size: .9rem;
}
.option.correct { border-color: #1aa251; background: #e9f9ef; }
.option.correct .opt-letter { background: #1aa251; color: #fff; border-color: #1aa251; }
.option.wrong { border-color: #e03131; background: #fdecec; }
.option.wrong .opt-letter { background: #e03131; color: #fff; border-color: #e03131; }
.option:disabled { cursor: default; }

.feedback { margin-top: 18px; padding: 16px 18px; border-radius: var(--radius-sm); font-size: .97rem; }
.feedback.ok { background: #e9f9ef; border: 1px solid #b7e4c7; }
.feedback.no { background: #fdecec; border: 1px solid #f3b9b9; }
.feedback strong { display: block; margin-bottom: 4px; }
.feedback .explain { color: var(--muted); margin-top: 6px; }
#next-btn { margin-top: 20px; }

/* results */
.results-card { text-align: center; }
.results-emoji { font-size: 3rem; margin-bottom: 8px; }
.results-score { font-family: var(--font-head); font-size: 2.4rem; color: var(--primary); margin: 4px 0; }
.results-msg { color: var(--muted); max-width: 44ch; margin: 0 auto 1.6rem; }
.results-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.save-stub { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px; font-size: .9rem; color: var(--muted); }
.save-stub em { color: var(--ink); }

/* ---------- header auth slot ---------- */
.site-nav { display: flex; align-items: center; gap: 18px; }
.nav-auth { display: inline-flex; align-items: center; }
.nav-signin { cursor: pointer; font: inherit; font-weight: 600; font-size: .95rem;
  white-space: nowrap; line-height: 1;
  color: var(--primary); background: transparent; border: 1.5px solid currentColor;
  padding: 7px 16px; border-radius: 999px; }
.nav-signin:hover { background: rgba(0,0,0,.04); }
.nav-account { font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.nav-account::before { content: "👤"; font-size: .9em; }

/* ---------- auth / name modal ---------- */
.auth-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.auth-backdrop { position: absolute; inset: 0; background: rgba(15,20,35,.55); backdrop-filter: blur(2px); }
.auth-modal { position: relative; z-index: 1; background: var(--surface); color: var(--ink);
  width: 100%; max-width: 420px; border-radius: var(--radius); padding: 32px 28px;
  box-shadow: 0 24px 60px -20px rgba(15,20,35,.5); text-align: center; }
.auth-x { position: absolute; top: 12px; right: 14px; background: none; border: none;
  font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }
.auth-emoji { font-size: 2.4rem; margin-bottom: 6px; }
.auth-modal h3 { font-size: 1.4rem; margin-bottom: .4em; }
.auth-modal p { color: var(--muted); font-size: .95rem; margin-bottom: 1.2rem; }
.auth-input { width: 100%; font: inherit; padding: 13px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid rgba(0,0,0,.14); margin-bottom: 12px; }
.auth-input:focus { outline: none; border-color: var(--primary); }
.auth-submit { width: 100%; justify-content: center; }
.auth-msg { margin-top: 12px; font-size: .9rem; font-weight: 600; min-height: 1em; }
.auth-msg.ok { color: #1aa251; }
.auth-msg.err { color: #e03131; }
.auth-msg.warn { color: #b8860b; }

/* ---------- results: save CTA + leaderboard ---------- */
.score-save { margin-top: 22px; }
.save-ok { background: #e9f9ef; border: 1px solid #b7e4c7; color: #14241f;
  border-radius: var(--radius-sm); padding: 14px; font-weight: 600; }
.save-cta { display: flex; flex-direction: column; gap: 8px; align-items: center;
  background: var(--surface-2); border-radius: var(--radius-sm); padding: 20px; }
.save-cta strong { font-size: 1.05rem; }
.save-cta span { color: var(--muted); font-size: .92rem; }
.save-cta .btn { margin-top: 6px; }
.linklike { background: none; border: none; padding: 0; font: inherit; color: var(--primary);
  font-weight: 600; cursor: pointer; text-decoration: underline; }

.leaderboard { margin-top: 18px; }
.lb-card { background: var(--surface-2); border-radius: var(--radius-sm); padding: 18px 20px; text-align: left; }
.lb-head { font-weight: 700; margin-bottom: 12px; }
.lb-empty { color: var(--muted); font-size: .92rem; padding: 6px 0; }
.lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; }
.lb-row:nth-child(odd) { background: rgba(0,0,0,.03); }
.lb-rank { flex-shrink: 0; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  font-weight: 700; font-size: .85rem; background: var(--primary); color: var(--primary-ink); }
.lb-row:nth-child(1) .lb-rank { background: #f4c441; color: #5a4500; }
.lb-row:nth-child(2) .lb-rank { background: #c7ccd6; color: #2a2f3a; }
.lb-row:nth-child(3) .lb-rank { background: #e0a878; color: #4a2c12; }
.lb-name { flex: 1; font-weight: 600; }
.lb-score { color: var(--muted); font-weight: 600; font-size: .92rem; }
.lb-score em { color: var(--primary); font-style: normal; }

/* ---------- account page ---------- */
.account-card { max-width: 720px; margin: 0 auto; }
.account-signedout { text-align: center; }
.acct-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding-bottom: 18px; border-bottom: 1px solid rgba(0,0,0,.08); margin-bottom: 18px; flex-wrap: wrap; }
.acct-label { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: var(--muted); font-weight: 700; }
.acct-name { font-family: var(--font-head); font-size: 1.4rem; }
.acct-email { color: var(--muted); font-size: .9rem; }
.acct-stats { display: flex; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.acct-stat { flex: 1; min-width: 120px; background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; color: var(--muted); font-size: .85rem; font-weight: 600; }
.acct-stat span { display: block; font-family: var(--font-head); font-size: 1.6rem; color: var(--ink); margin-bottom: 2px; }
.acct-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.acct-table th { text-align: left; color: var(--muted); font-size: .82rem; text-transform: uppercase;
  letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid rgba(0,0,0,.08); }
.acct-table td { padding: 10px; border-bottom: 1px solid rgba(0,0,0,.05); }
.acct-empty { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .hero { padding: 32px 20px 38px; }
  .hero-quiz { padding: 16px 20px 18px; }
  .hero-page { padding: 28px 20px 32px; }
  .section { padding: 40px 20px; }
  .card { padding: 22px; }
  .results-actions { flex-direction: column; }
  .results-actions .btn { width: 100%; justify-content: center; }
  /* compact header: drop the wordmark (the gem stays tappable), tighten nav */
  .site-header { padding: 12px 16px; }
  .brand-name { display: none; }
  .brand-gem { width: 30px; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: .9rem; }
  .nav-signin { padding: 6px 12px; font-size: .88rem; }
}

/* ---------- hero search pill (home) ---------- */
.hero-search {
  display: flex; align-items: center; gap: 12px;
  width: 100%; max-width: 480px; margin: 4px 0 22px;
  padding: 14px 18px; border: 0; border-radius: 999px;
  background: #fff; color: var(--muted); cursor: text;
  font: inherit; font-size: 1rem; text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease;
}
.hero-search:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.hero-search svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--grad-a); }
.hero-search-ph { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-search-kbd {
  flex-shrink: 0; font-family: var(--font-body); font-size: .72rem; font-weight: 700;
  color: var(--muted); background: var(--surface-2); border: 1px solid rgba(0,0,0,.12);
  border-radius: 6px; padding: 2px 8px;
}
.hero-search .ph-short { display: none; }
@media (max-width: 560px) {
  .hero-search { padding: 12px 16px; margin-bottom: 18px; }
  .hero-search-kbd { display: none; }  /* no keyboard, no shortcut hint */
  .hero-search .ph-long { display: none; }   /* long prompt truncates on small */
  .hero-search .ph-short { display: inline; }
}

/* ---------- header search ---------- */
.nav-search {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: color .12s ease, background .12s ease;
}
.nav-search:hover { color: var(--ink); background: rgba(0,0,0,.06); }
.nav-search svg { width: 18px; height: 18px; }

.search-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20,25,45,.45); backdrop-filter: blur(2px);
  display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh 16px 16px;
}
.search-panel {
  width: 100%; max-width: 560px; background: var(--surface);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden;
}
.search-box {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.search-box svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.search-box input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 1.05rem; color: var(--ink);
}
.search-box input::-webkit-search-cancel-button { display: none; }
.search-close {
  flex-shrink: 0; border: 1px solid rgba(0,0,0,.12); background: var(--surface-2);
  color: var(--muted); cursor: pointer; font: inherit; font-size: .72rem;
  font-weight: 700; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px;
}
.search-close:hover { color: var(--ink); }
.search-results { max-height: 55vh; overflow-y: auto; padding: 8px; }
.search-hint { color: var(--muted); font-size: .9rem; text-align: center; padding: 18px 14px; }
.search-result {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px; color: var(--ink);
}
.search-result:hover, .search-result.is-active { background: var(--surface-2); }
.sr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sr-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-sub { color: var(--muted); font-size: .82rem; }
.search-result .diff-chip { flex-shrink: 0; }
@media (max-width: 560px) {
  .search-overlay { padding: 7vh 10px 10px; }
  .search-results { max-height: 62vh; }
}

/* ---------- difficulty chips ---------- */
.diff-chip { display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.diff-easy { background: #e9f9ef; color: #14793c; }
.diff-medium { background: #fff4dd; color: #946200; }
.diff-hard { background: #fdecec; color: #b02525; }
.hero .diff-chip { box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.hero-meta .diff-chip { vertical-align: 1px; }

/* ---------- welcome: start row + timed toggle ---------- */
.start-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 26px 0 0; }
.start-row #start-btn { display: inline-flex; width: auto; margin: 0; }
.timed-row { display: flex; gap: 8px; align-items: center; justify-content: center;
  margin-top: 16px; font-size: .92rem; color: var(--muted); cursor: pointer; user-select: none; }
.timed-row input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* ---------- timer ---------- */
.timer-pill { font-variant-numeric: tabular-nums; color: var(--muted); }
.timer-low { color: #e03131; animation: timer-pulse 1s ease infinite; }
@keyframes timer-pulse { 50% { opacity: .45; } }

/* ---------- results extras ---------- */
.results-note { background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: .9rem; color: var(--muted); max-width: 52ch; margin: 0 auto 1.4rem; }

/* play another */
.quiz-recs { margin-top: 28px; text-align: left; }
.quiz-recs h3 { font-size: 1.05rem; margin-bottom: 12px; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.rec-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface);
  border-radius: var(--radius-sm); padding: 14px 16px; color: var(--ink);
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.rec-card:hover { border-color: var(--primary); box-shadow: 4px 4px 0 var(--primary);
  transform: translate(-1px, -1px); }
.rec-name { font-weight: 600; }
.rec-meta { font-size: .8rem; color: var(--muted); }

/* ---------- daily question ---------- */
.daily-strip-wrap { padding-top: 28px; padding-bottom: 0;
  display: flex; flex-direction: column; gap: 12px; }
.daily-strip.arcade-strip { background: var(--ink); color: #fff; }
.daily-strip.arcade-strip .daily-strip-body span { color: rgba(255,255,255,.75); }
.daily-strip.arcade-strip .daily-strip-go { color: #fff; }
.daily-strip { display: flex; align-items: center; gap: 16px; background: var(--surface);
  border-radius: var(--radius-sm); padding: 16px 20px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,.04); color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease; }
.daily-strip:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.daily-strip-emoji { font-size: 1.8rem; }
.daily-strip-body { flex: 1; display: flex; flex-direction: column; }
.daily-strip-body span { color: var(--muted); font-size: .9rem; }
.daily-strip-go { color: var(--primary); font-weight: 700; }

/* featured daily card — gradient, comparison hook, streak chip */
.daily-strip.daily-feature { background: linear-gradient(120deg, var(--grad-b), var(--primary));
  color: #fff; border: none; padding: 24px 26px; gap: 18px; }
.daily-feature .daily-strip-emoji { font-size: 2.3rem; }
.daily-feature .daily-strip-body strong { font-family: var(--font-head); font-size: 1.35rem;
  line-height: 1.2; margin: 2px 0; }
.daily-feature .daily-feature-date { color: var(--accent); font-weight: 700; font-size: .76rem;
  letter-spacing: .14em; text-transform: uppercase; }
.daily-feature .daily-feature-sub { color: rgba(255,255,255,.82); font-size: .95rem; }
.daily-feature .daily-feature-streak { margin-top: 10px; align-self: flex-start; display: inline-flex;
  align-items: center; gap: 6px; background: rgba(255,255,255,.16); border-radius: 999px;
  padding: 4px 12px; font-size: .85rem; font-weight: 600; color: #fff; }
.daily-feature-go { background: #fff; color: var(--grad-a); font-weight: 700;
  border-radius: 999px; padding: 10px 18px; white-space: nowrap; flex: none;
  box-shadow: var(--shadow-sm); }
.daily-strip:hover .daily-feature-go { transform: scale(1.04); }
@media (max-width: 560px) {
  .daily-strip.daily-feature { flex-wrap: wrap; padding: 16px 18px; gap: 10px; }
  .daily-feature .daily-strip-emoji { display: none; }
  .daily-feature .daily-strip-body { flex-basis: 100%; }
  .daily-feature .daily-strip-body strong { font-size: 1.15rem; }
  .daily-feature .daily-feature-sub { font-size: .88rem; }
  .daily-feature .daily-feature-streak { margin-top: 6px; }
  .daily-feature-go { margin-left: auto; padding: 8px 14px; font-size: .9rem; }
}

.daily-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px; font-size: .9rem; }
.daily-date { font-weight: 700; }
.daily-src { color: var(--muted); }
.daily-streak { text-align: center; font-size: 1.05rem; margin: 22px 0 16px; }
.daily-community { margin-top: 24px; }
.comm-head { font-weight: 600; font-size: .92rem; margin-bottom: 10px; }
.comm-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: .9rem; }
.comm-label { width: 36px; font-weight: 700; color: var(--muted); }
.comm-correct .comm-label { color: #14793c; }
.comm-bar { flex: 1; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.comm-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.comm-correct .comm-bar span { background: #1aa251; }
.comm-pct { width: 42px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.lb-empty { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px;
  font-size: .9rem; color: var(--muted); text-align: center; }

/* ---------- badges ---------- */
#badge-toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 10px; z-index: 200; width: min(420px, calc(100vw - 32px)); }
.badge-toast { display: flex; gap: 12px; align-items: center; background: var(--ink); color: #fff;
  border-radius: var(--radius-sm); padding: 14px 18px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px); transition: opacity .3s ease, transform .3s ease; }
.badge-toast.show { opacity: 1; transform: translateY(0); }
.badge-toast-emoji { font-size: 1.6rem; }
.badge-toast-desc { font-size: .85rem; opacity: .75; }

.badges-card h2 { display: flex; align-items: baseline; gap: 10px; }
.badge-count { font-size: .9rem; color: var(--muted); font-family: var(--font-body, inherit); }
.badges-note { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.badge-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px;
  background: var(--surface-2); border-radius: 10px; padding: 10px 8px;
  opacity: .45; filter: grayscale(.8); line-height: 1.35; }
.badge-card.earned { opacity: 1; filter: none; border: 2px solid var(--primary); padding: 8px 6px; }
.badge-emoji { font-size: 1.5rem; }
.badge-name { font-weight: 700; font-size: .82rem; }
.badge-desc { font-size: .7rem; color: var(--muted); }
.badge-got { font-size: .68rem; font-weight: 700; color: var(--primary); margin-top: 2px; }
#badges-body { margin-top: 20px; }

/* ---------- type-in (format preview) ---------- */
.ti-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.ti-input { flex: 1; min-width: 180px; font: inherit; padding: 12px 16px;
  border: 2px solid rgba(0,0,0,.12); border-radius: var(--radius-sm); }
.ti-input:focus { outline: none; border-color: var(--primary); }
.ti-clock { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700;
  font-variant-numeric: tabular-nums; }
.ti-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px; margin-bottom: 20px; }
.ti-slot { background: var(--surface-2); border-radius: 8px; padding: 8px 10px;
  font-size: .85rem; color: var(--muted); text-align: center; min-height: 1.4em; }
.ti-found { background: #e9f9ef; color: #14793c; font-weight: 600; }
.ti-missed { background: #fdecec; color: #b02525; }
#ti-intro p { color: var(--muted); }
#ti-intro .btn { margin-top: 8px; }
.results-card-inner { text-align: center; margin-top: 24px; }

/* community summary + locked badge wall + games index (round 2) */
.comm-summary { font-size: 1rem; margin-bottom: 12px; }
.comm-summary strong { color: var(--primary); font-size: 1.2rem; }
.badge-grid-locked .badge-card { opacity: .55; filter: grayscale(1); }
.badges-note .linklike { border: 0; background: none; color: var(--primary);
  font: inherit; font-weight: 700; cursor: pointer; padding: 0; }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.game-card { display: flex; align-items: center; gap: 16px; background: var(--surface);
  color: var(--ink); border-radius: var(--radius-sm); padding: 20px;
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.game-card:hover { border-color: var(--primary); box-shadow: 4px 4px 0 var(--primary);
  transform: translate(-1px, -1px); }
.game-emoji { font-size: 2rem; }
.game-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.game-tagline { color: var(--muted); font-size: .9rem; }
.game-meta { color: var(--muted); font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }

.game-section { padding-top: 28px; padding-bottom: 12px; }
.game-section-head { margin-bottom: 18px; }
.game-section-head h2 { font-size: 1.4rem; margin-bottom: 2px; }
.game-section-head p { color: var(--muted); max-width: 62ch; margin: 0; }

/* ---------- clickable game ---------- */
.ck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px; margin-bottom: 20px; }
.ck-tile { font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--ink); border: 2px solid transparent;
  border-radius: 10px; padding: 12px 8px; text-align: center;
  transition: border-color .1s ease, transform .08s ease; }
.ck-tile:hover:not(:disabled) { border-color: var(--primary); }
.ck-tile:active:not(:disabled) { transform: scale(.97); }
.ck-tile:disabled { cursor: default; }
.ck-found { background: #e9f9ef; color: #14793c; border-color: #1aa251 !important; }
.ck-wrong { background: #fdecec; color: #b02525; border-color: #e03131 !important;
  animation: ck-shake .3s ease; }
.ck-fatal { background: #b02525; color: #fff; border-color: #b02525 !important; }
.ck-missed { background: var(--surface); color: #14793c; border: 2px dashed #1aa251 !important; }
.ck-decoy { opacity: .35; }
@keyframes ck-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* ---------- missing word game ---------- */
.mw-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.mw-row { background: var(--surface-2); border-radius: 10px; padding: 10px 14px;
  font-size: .95rem; }
.mw-blank { letter-spacing: 2px; color: var(--muted); }
.mw-fill { color: #14793c; }
.mw-found { background: #e9f9ef; }
.mw-missed { background: #fdecec; }
.mw-missed .mw-fill { color: #b02525; }

/* games index format chip */
.game-type { display: inline-block; background: var(--surface-2); color: var(--ink);
  padding: 1px 8px; border-radius: 999px; font-weight: 700; }
