:root {
  --ink: #f8f3e6;
  --muted: #aebbd0;
  --navy: #071225;
  --navy-2: #0b1c36;
  --panel: rgba(12, 30, 57, 0.9);
  --gold: #f6bd45;
  --gold-2: #ffe09a;
  --blue: #0e56b8;
  --blue-2: #1576e8;
  --red: #ef6a6a;
  --green: #5fe0a6;
  --border: rgba(255, 255, 255, 0.13);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--navy); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(21, 118, 232, 0.14), transparent 34rem),
    linear-gradient(150deg, #061020 0%, #09162b 55%, #050d1a 100%);
}
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.stage-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}
.app-shell { position: relative; width: min(1500px, 100%); margin: auto; padding: 24px clamp(18px, 3vw, 48px) 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); background: none; border: 0; padding: 0; text-align: left; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgba(246,189,69,.65); transform: rotate(45deg); color: var(--gold); font-family: "Libre Baskerville", serif; font-size: .9rem; }
.brand-mark::first-letter { transform: rotate(-45deg); }
.brand strong, .brand small { display: block; }
.brand strong { font-family: "Libre Baskerville", serif; font-size: 1rem; }
.brand small { color: var(--gold); text-transform: uppercase; letter-spacing: .19em; font-size: .65rem; margin-top: 3px; }
.top-actions { display: flex; gap: 10px; }
.icon-button, .secondary-button, .nav-button { border: 1px solid var(--border); color: var(--ink); background: rgba(255,255,255,.045); border-radius: 99px; min-height: 42px; padding: 0 18px; }
.icon-button { width: 42px; padding: 0; font-weight: 700; }
.icon-button:hover, .secondary-button:hover, .nav-button:hover { background: rgba(255,255,255,.1); }
.nav-button { color: var(--muted); font-size: .85rem; }

.setup-screen { min-height: calc(100vh - 100px); display: grid; grid-template-columns: 1.12fr .88fr; align-items: center; gap: clamp(40px, 7vw, 112px); padding: 64px 3vw; }
.eyebrow { margin: 0 0 14px; color: var(--gold); font-size: .75rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.setup-copy h1, .game-toolbar h1, dialog h2 { font-family: "Libre Baskerville", serif; }
.setup-copy h1 { margin: 0; font-size: clamp(3.3rem, 7vw, 7.5rem); line-height: .98; letter-spacing: -.055em; max-width: 820px; }
.setup-copy h1 em { color: var(--gold); font-style: normal; }
.intro { max-width: 610px; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.25rem); line-height: 1.7; margin: 28px 0 38px; }
.value-key { display: flex; align-items: center; gap: 14px; color: var(--gold-2); font-weight: 700; }
.value-key span { display: flex; align-items: baseline; gap: 7px; }
.value-key small { color: var(--muted); font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
.value-key i { width: 90px; height: 1px; background: linear-gradient(90deg, var(--gold), var(--blue-2)); position: relative; }

.setup-card { background: linear-gradient(145deg, rgba(18,43,79,.95), rgba(7,20,40,.98)); border: 1px solid var(--border); border-radius: 24px; padding: clamp(24px, 3.4vw, 44px); box-shadow: var(--shadow); }
.step-label { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.step-label:not(:first-child) { margin-top: 30px; }
.step-label span { color: var(--gold); }
.mode-switch, .format-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-switch input, .format-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mode-switch label > span, .format-switch label > span { display: block; min-height: 78px; border: 1px solid var(--border); border-radius: 14px; padding: 15px; background: rgba(255,255,255,.03); transition: .2s ease; }
.mode-switch input:checked + span, .format-switch input:checked + span { border-color: var(--gold); background: rgba(246,189,69,.09); box-shadow: inset 0 0 0 1px rgba(246,189,69,.25); }
.mode-switch b, .mode-switch small, .format-switch b, .format-switch small { display: block; }
.mode-switch small, .format-switch small { color: var(--muted); margin-top: 5px; line-height: 1.35; }
.player-inputs { display: grid; gap: 9px; }
.player-row { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 8px; }
.player-number { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(246,189,69,.1); color: var(--gold); font-weight: 700; font-size: .78rem; }
.player-row input { width: 100%; height: 46px; border: 1px solid var(--border); border-radius: 10px; padding: 0 13px; color: var(--ink); background: rgba(0,0,0,.15); outline: 0; }
.player-row input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246,189,69,.12); }
.remove-player { border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; }
.remove-player:hover { color: var(--red); }
.text-button { background: transparent; color: var(--gold); border: 0; padding: 12px 0 0 42px; font-size: .9rem; }
.start-button { width: 100%; min-height: 56px; border: 0; border-radius: 12px; margin-top: 30px; padding: 0 20px; color: #17130a; background: linear-gradient(135deg, #f8c95c, #e9a92f); font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 14px; box-shadow: 0 12px 30px rgba(232,164,41,.2); }
.start-button:hover { filter: brightness(1.08); transform: translateY(-1px); }

.game-screen { padding-top: 44px; }
.game-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 22px; }
.game-toolbar h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.8rem); }
.progress-wrap { min-width: 210px; color: var(--muted); font-size: .78rem; text-align: right; }
.progress-track { height: 4px; margin-top: 9px; border-radius: 3px; overflow: hidden; background: rgba(255,255,255,.1); }
.progress-track span { display: block; width: 0; height: 100%; background: var(--gold); transition: width .3s ease; }
.scoreboard { display: flex; gap: 10px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 4px; }
.score-card { min-width: 150px; flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 14px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 15px; background: rgba(255,255,255,.035); }
.score-card.active { border-color: var(--gold); background: rgba(246,189,69,.08); box-shadow: inset 3px 0 0 var(--gold); }
.score-card span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.score-card b { display: block; color: var(--ink); font-size: .95rem; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.score-card strong { color: var(--gold); font-size: 1.15rem; white-space: nowrap; }
.board { display: grid; grid-template-columns: repeat(var(--category-count, 6), minmax(120px, 1fr)); gap: 8px; }
.category-title { min-height: 90px; display: grid; place-items: end center; padding: 14px 8px; text-align: center; color: var(--ink); font-family: "Libre Baskerville", serif; font-size: clamp(.76rem, 1.15vw, 1rem); line-height: 1.35; border-bottom: 2px solid var(--gold); }
.clue-button { min-height: clamp(64px, 7vw, 94px); border: 1px solid rgba(52,137,245,.35); border-radius: 8px; background: linear-gradient(145deg, #0c4da1, #082f69); color: var(--gold-2); font-family: "Libre Baskerville", serif; font-size: clamp(1.1rem, 2vw, 1.8rem); text-shadow: 0 2px 0 rgba(0,0,0,.4); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); transition: .18s ease; }
.clue-button:hover { background: linear-gradient(145deg, #1265cb, #0a3e82); transform: translateY(-2px); border-color: rgba(246,189,69,.7); }
.clue-button.used { background: rgba(255,255,255,.025); border-color: rgba(255,255,255,.05); color: transparent; box-shadow: none; pointer-events: none; }

dialog { color: var(--ink); background: #0b1c36; border: 1px solid rgba(255,255,255,.18); border-radius: 24px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(2, 7, 16, .86); backdrop-filter: blur(8px); }
.question-dialog { width: min(920px, calc(100% - 28px)); max-height: 92dvh; padding: 0; overflow: hidden; }
.question-panel { height: min(650px, 92dvh); display: flex; flex-direction: column; overflow: hidden; }
.question-fixed-top { flex: 0 0 auto; background: #0b1c36; }
.question-topline { display: flex; justify-content: space-between; gap: 20px; padding: 24px 30px 16px; border-bottom: 1px solid var(--border); }
.question-category { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.question-value { color: var(--gold); font-family: "Libre Baskerville", serif; font-size: 1.3rem; }
.timer-row { display: flex; align-items: center; gap: 13px; padding: 14px 30px 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.timer-track { height: 4px; flex: 1; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.1); }
.timer-track span { display: block; width: 100%; height: 100%; background: var(--gold); transition: width 1s linear; }
.lifeline-row { display: flex; justify-content: center; gap: 9px; padding: 14px 20px 0; }
.lifeline-button { border: 1px solid rgba(246,189,69,.35); color: var(--gold-2); background: rgba(246,189,69,.07); border-radius: 99px; padding: 9px 15px; font-size: .82rem; font-weight: 700; }
.lifeline-button:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.question-body { flex: 1; min-height: 0; display: grid; align-content: center; justify-items: center; overflow-y: auto; overscroll-behavior: contain; text-align: center; padding: 42px clamp(24px, 7vw, 80px); scroll-padding: 18px; }
.prompt-label { color: var(--gold); text-transform: uppercase; letter-spacing: .2em; font-weight: 700; margin-bottom: 16px; }
.question-body > p { margin: 0 0 36px; font-family: "Libre Baskerville", serif; font-size: clamp(1.6rem, 3.4vw, 3rem); line-height: 1.4; }
.reveal-button { border: 1px solid var(--gold); border-radius: 99px; color: var(--gold); background: transparent; padding: 13px 24px; font-weight: 700; }
.reveal-button:hover { color: #17130a; background: var(--gold); }
.answer-area small { color: var(--gold); letter-spacing: .18em; text-transform: uppercase; font-weight: 700; }
.answer-area p { margin: 10px 0 0; color: var(--ink); font-size: clamp(1.25rem, 2.4vw, 2rem); }
.learning-card { display: grid; gap: 7px; margin: 24px auto 0; max-width: 660px; padding: 16px 18px; border: 1px solid rgba(246,189,69,.24); border-radius: 12px; background: rgba(246,189,69,.06); text-align: left; }
.learning-card b { color: var(--gold); }
.learning-card span { color: var(--muted); line-height: 1.5; }
.learning-card small { color: #8494ad; }
.reference-link { width: fit-content; border: 0; padding: 0; color: var(--gold); background: transparent; font-weight: 800; text-align: left; text-decoration: underline; text-underline-offset: 4px; }
.reference-link:hover { color: var(--gold-2); }
.judging-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 18px 30px 28px; border-top: 1px solid var(--border); }
.judging-controls button { min-height: 54px; border-radius: 10px; font-weight: 800; }
.incorrect-button { color: #ffd5d5; border: 1px solid rgba(239,106,106,.45); background: rgba(239,106,106,.1); }
.half-button { color: var(--gold-2); border: 1px solid rgba(246,189,69,.45); background: rgba(246,189,69,.1); }
.correct-button { color: #061c13; border: 0; background: var(--green); }

.rules-dialog { width: min(540px, calc(100% - 28px)); padding: 40px; }
.dialog-close { position: absolute; top: 14px; right: 16px; border: 0; color: var(--muted); background: none; font-size: 1.6rem; }
.rules-dialog h2, .winner-dialog h2 { margin: 0 0 22px; font-size: 2rem; }
.rules-dialog ol { padding-left: 22px; color: var(--muted); line-height: 1.65; }
.rules-dialog li { margin-bottom: 10px; padding-left: 6px; }
.rules-dialog .secondary-button { margin-top: 12px; }
.winner-dialog { width: min(520px, calc(100% - 28px)); padding: 46px; text-align: center; }
.winner-dialog .start-button { max-width: 260px; margin-inline: auto; }
.winner-dialog > p:not(.eyebrow) { color: var(--muted); font-size: 1.1rem; }
.crown { color: var(--gold); font-size: 4.5rem; line-height: 1; margin-bottom: 20px; }

.wide-dialog { width: min(980px, calc(100% - 28px)); max-height: 88vh; overflow: auto; padding: clamp(26px, 4vw, 46px); }
.wide-dialog h2, .mini-dialog h2 { font-family: "Libre Baskerville", serif; margin: 0 0 12px; font-size: clamp(1.8rem, 3vw, 2.6rem); }
.dialog-intro { color: var(--muted); max-width: 700px; line-height: 1.6; }
.study-tabs { display: flex; gap: 6px; margin: 26px 0 22px; padding: 5px; width: fit-content; border: 1px solid var(--border); border-radius: 99px; }
.study-tabs button { border: 0; border-radius: 99px; background: transparent; color: var(--muted); padding: 10px 17px; font-weight: 700; }
.study-tabs button.active { background: var(--gold); color: #17130a; }
.testament-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.testament-grid article { border: 1px solid var(--border); border-radius: 16px; padding: 24px; background: rgba(255,255,255,.035); }
.testament-grid article > span { color: var(--gold); font-weight: 700; }
.testament-grid h3 { font-family: "Libre Baskerville", serif; font-size: 1.45rem; margin: 10px 0; }
.testament-grid p { color: var(--muted); line-height: 1.55; }
.section-heading { margin: 28px 0 12px; }
.library-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.library-grid article { display: grid; gap: 5px; padding: 15px; border-left: 2px solid var(--gold); background: rgba(255,255,255,.035); }
.library-grid span { color: var(--muted); font-size: .86rem; }
.search-label { display: grid; gap: 8px; color: var(--muted); font-weight: 700; max-width: 420px; }
.search-label input, .editor-fields input, .editor-fields textarea { width: 100%; border: 1px solid var(--border); border-radius: 9px; color: var(--ink); background: rgba(0,0,0,.18); outline: 0; padding: 11px 12px; }
.search-label input:focus, .editor-fields input:focus, .editor-fields textarea:focus { border-color: var(--gold); }
.word-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.word-card { border: 1px solid var(--border); border-radius: 14px; padding: 18px; background: rgba(255,255,255,.035); }
.word-card .original { color: var(--gold); font-family: "Libre Baskerville", serif; font-size: 1.3rem; }
.word-card .easy-name { margin: 8px 0 4px; color: #f4f7fb; font-size: 1rem; }
.word-card .easy-name strong { color: var(--gold); font-size: 1.08rem; }
.word-card small { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.word-card h3 { margin: 9px 0 6px; }
.word-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.dictionary-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.board-size-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.board-size-controls label { display: grid; gap: 7px; color: var(--muted); font-size: .86rem; font-weight: 700; }
.board-size-controls select { min-height: 46px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--ink); background: #10213c; font: inherit; }
.kids-hero { display: flex; gap: 18px; align-items: center; padding: 20px; border-radius: 16px; background: linear-gradient(135deg,rgba(246,189,69,.16),rgba(52,137,245,.12)); }
.kids-hero>span { display: grid; place-items: center; flex: 0 0 58px; height: 58px; border-radius: 50%; color: #17130a; background: var(--gold); font-size: 1.8rem; }
.kids-hero h3,.kids-hero p { margin: 4px 0; }
.kids-hero p:last-child { color: var(--muted); }
.kids-lesson-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 18px; }
.kids-lesson-grid button { display: grid; gap: 7px; min-height: 128px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; color: var(--ink); background: rgba(255,255,255,.04); text-align: left; }
.kids-lesson-grid button:hover { border-color: var(--gold); }
.kids-lesson-grid button span { font-size: 1.65rem; }
.kids-lesson-grid button small { color: var(--gold); }
.kids-lesson { position: relative; margin-top: 18px; padding: clamp(20px,4vw,34px); border: 2px solid rgba(246,189,69,.45); border-radius: 18px; background: rgba(4,16,34,.7); }
.kids-lesson h3 { margin: 4px 0 10px; font: 700 clamp(1.5rem,4vw,2rem)/1.25 "Libre Baskerville",serif; }
.kids-lesson h4 { margin: 24px 0 6px; color: var(--gold); }
.kids-close { position: absolute; right: 14px; top: 12px; border: 0; color: var(--muted); background: transparent; font-size: 1.5rem; }
.kids-big-icon { font-size: 2.4rem; }
.kids-choices { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.kids-choices button { min-height: 48px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; color: var(--ink); background: rgba(255,255,255,.05); font-weight: 800; }
.kids-choices button.correct { color: #061c13; background: var(--green); }
.kids-choices button.incorrect { color: #fff; background: var(--red); }
.kids-feedback { min-height: 24px; margin-top: 12px; color: var(--gold-2); font-weight: 800; }
.kids-activity { margin-top: 16px; padding: 14px; border-radius: 10px; color: var(--muted); background: rgba(52,137,245,.1); }
.kids-home-button { width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; margin: 22px 0; padding: 16px 18px; border: 1px solid rgba(246,189,69,.5); border-radius: 14px; color: var(--ink); background: linear-gradient(135deg,rgba(246,189,69,.16),rgba(52,137,245,.1)); text-align: left; }
.kids-home-button>span { grid-row: 1 / 3; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #17130a; background: var(--gold); font-size: 1.25rem; }
.kids-home-button b { font-size: 1rem; }
.kids-home-button small { color: var(--muted); }
.kids-generator-controls { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 20px 0; }
.kids-generator-controls label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; }
.kids-generator-controls select { min-height: 46px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--ink); background: #10213c; font: inherit; }
.kids-topic-picker { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; padding: 0; border: 0; }
.kids-topic-picker legend { margin-bottom: 10px; color: var(--gold); font-weight: 800; }
.kids-topic-picker label { cursor: pointer; }
.kids-topic-picker input { position: absolute; opacity: 0; }
.kids-topic-picker span { display: block; min-height: 48px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.035); font-weight: 700; }
.kids-topic-picker input:checked+span { border-color: var(--gold); color: var(--gold-2); background: rgba(246,189,69,.1); box-shadow: inset 0 0 0 1px var(--gold); }
.kids-generator-actions { display: grid; gap: 10px; margin-top: 20px; }
.kids-generator-actions small { color: var(--muted); line-height: 1.45; }
.language-filters { display: flex; gap: 6px; }
.language-filters button { border: 1px solid var(--border); border-radius: 99px; padding: 9px 14px; color: var(--muted); background: transparent; }
.language-filters button.active { color: #17130a; background: var(--gold); border-color: var(--gold); }
.lexicon-mode { display: inline-flex; gap: 6px; padding: 5px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.025); }
.lexicon-mode button { border: 0; border-radius: 8px; padding: 10px 16px; color: var(--muted); background: transparent; }
.lexicon-mode button.active { color: #17130a; background: var(--gold); }
.lexicon-status { color: var(--muted); margin: 16px 0 0; }
.word-card .strong-number { display: inline-block; margin-top: 9px; color: var(--gold); font-weight: 700; letter-spacing: .06em; }
.translation-note a { color: var(--gold); }
.reader-controls { display: grid; grid-template-columns: 1.4fr 1.2fr .7fr auto; align-items: end; gap: 10px; }
.reader-controls label { display: grid; gap: 7px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.reader-controls select, .passage-search input { min-height: 46px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; color: var(--ink); background: #09182f; }
.reader-button { min-height: 46px; border: 0; border-radius: 10px; padding: 0 17px; color: #17130a; background: var(--gold); font-weight: 800; }
.passage-search { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 12px; }
.licensed-versions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 16px 0; color: var(--muted); font-size: .84rem; }
.licensed-versions a { border: 1px solid var(--border); border-radius: 99px; padding: 8px 12px; color: var(--gold-2); text-decoration: none; }
.licensed-versions a:hover { border-color: var(--gold); }
.bible-status { margin: 24px 0; padding: 22px; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); text-align: center; }
.bible-text { margin-top: 24px; padding: clamp(20px, 4vw, 38px); border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.035); }
.bible-heading { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.bible-heading h3 { margin: 0; font-family: "Libre Baskerville", serif; font-size: 1.8rem; }
.verse { display: inline; color: #e4e8f0; font-family: Georgia, serif; font-size: 1.08rem; line-height: 1.9; }
.verse sup { color: var(--gold); font-family: "DM Sans", sans-serif; font-size: .67rem; margin-right: 4px; }
.translation-note { color: #8290a6; font-size: .78rem; line-height: 1.5; margin-top: 20px; }
.editor-content { display: grid; gap: 12px; margin-top: 24px; }
.editor-category { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.editor-category summary { padding: 17px 20px; cursor: pointer; color: var(--gold-2); font-weight: 800; background: rgba(255,255,255,.045); }
.editor-category-body { padding: 18px; }
.category-name-input { margin-bottom: 14px; }
.editor-question { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.editor-value { color: var(--gold); font-family: "Libre Baskerville", serif; padding-top: 10px; }
.editor-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.editor-fields textarea { grid-column: 1 / -1; min-height: 72px; resize: vertical; }
.reference-editor { display: grid; grid-column: 1 / -1; gap: 8px; }
.reference-actions, .reference-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.reference-actions button, .reference-suggestions button { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--gold-2); background: rgba(255,255,255,.04); font-weight: 700; }
.reference-suggestions span { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.reference-status { min-height: 18px; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.reference-status strong, .reference-status span { display: block; }
.reference-status.valid { padding: 10px; border-left: 3px solid #67d6a2; color: #ccebdd; background: rgba(68,177,124,.08); }
.reference-status.invalid { color: #ffc0c0; }
.editor-fields .learning-input { grid-column: 1 / -1; }
.editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; position: sticky; bottom: -1px; padding-top: 20px; background: linear-gradient(transparent, #0b1c36 22%); }
.editor-actions .start-button { width: auto; min-width: 220px; margin: 0; }
.danger-button { border: 1px solid rgba(239,106,106,.4); border-radius: 10px; color: #ffd5d5; background: rgba(239,106,106,.08); padding: 12px 16px; }
.mini-dialog { width: min(460px, calc(100% - 28px)); padding: 38px; text-align: center; }
.mini-dialog > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.lifeline-hero { font-size: 3rem; color: var(--gold); margin-bottom: 12px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 20; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 18px; border: 1px solid rgba(246,189,69,.4); border-radius: 99px; color: #17130a; background: var(--gold); font-weight: 800; transition: .25s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.room-nav { color: var(--gold-2); }
.room-tabs { display: flex; gap: 8px; margin: 20px 0; border-bottom: 1px solid var(--border); }
.room-tabs button { padding: 10px 14px; border: 0; border-bottom: 3px solid transparent; color: var(--muted); background: transparent; font-weight: 800; }
.room-tabs button.active { color: var(--gold); border-color: var(--gold); }
.room-type-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.room-type-grid label { cursor: pointer; }
.room-type-grid input { position: absolute; opacity: 0; }
.room-type-grid span { display: grid; gap: 6px; min-height: 130px; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.035); }
.room-type-grid input:checked+span { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.room-type-grid small, .room-result p { color: var(--muted); line-height: 1.5; }
.join-room-form { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; align-items: end; }
.join-room-form label { display: grid; gap: 6px; color: var(--muted); font-size: .85rem; }
.join-room-form input { min-height: 46px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--ink); background: rgba(0,0,0,.18); }
.room-result { margin-top: 20px; padding: 20px; border: 1px solid rgba(246,189,69,.35); border-radius: 14px; background: rgba(246,189,69,.06); }
.room-code-display { font: 700 2rem/1 "Libre Baskerville",serif; letter-spacing: .18em; color: var(--gold); }
.room-secret { display: inline-block; margin: 8px 0; padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,.08); font-weight: 800; letter-spacing: .12em; }
.live-room-bar { position: sticky; top: 80px; z-index: 8; display: flex; align-items: center; gap: 16px; margin: 0 auto 18px; padding: 12px 16px; max-width: 1180px; border: 1px solid rgba(246,189,69,.4); border-radius: 14px; background: rgba(7,18,37,.95); box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.live-room-bar>div:first-child { display: grid; min-width: 150px; }
.live-room-bar small { color: var(--gold); letter-spacing: .12em; }
.live-room-bar strong { font-size: 1.25rem; letter-spacing: .15em; }
.live-room-bar span { color: var(--muted); font-size: .8rem; }
.live-players { display: flex; flex: 1; gap: 8px; overflow-x: auto; }
.live-player { white-space: nowrap; padding: 7px 10px; border-radius: 99px; background: rgba(255,255,255,.06); }
.live-player.buzzed { color: #17130a; background: var(--gold); }
.buzz-button { min-width: 130px; min-height: 54px; border: 0; border-radius: 12px; color: white; background: var(--red); font-size: 1.1rem; font-weight: 900; box-shadow: 0 0 0 5px rgba(239,106,106,.15); }

@media (max-width: 900px) {
  .live-player button { margin-left: 4px; border: 0; border-radius: 5px; color: inherit; background: rgba(255,255,255,.12); }
  .room-result form { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; margin-top: 14px; }
  .room-result select, .room-result input { min-height: 44px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; color: var(--ink); background: #10213c; }
  .setup-screen { grid-template-columns: 1fr; padding-top: 70px; gap: 46px; }
  .setup-copy h1 { font-size: clamp(3.5rem, 13vw, 6rem); }
  .setup-card { max-width: 620px; width: 100%; }
  .board { overflow-x: auto; grid-template-columns: repeat(var(--category-count, 6), 132px); padding-bottom: 12px; scroll-snap-type: x proximity; }
  .board > * { scroll-snap-align: start; }
  .category-title { min-height: 78px; }
}
@media (max-width: 600px) {
  .app-shell { padding-inline: 14px; }
  .brand strong { font-size: .9rem; }
  .setup-screen { padding-inline: 0; }
  .setup-copy h1 { font-size: 3.6rem; }
  .mode-switch, .format-switch { grid-template-columns: 1fr; }
  .room-type-grid, .join-room-form { grid-template-columns: 1fr; }
  .live-room-bar { top: 70px; flex-wrap: wrap; }
  .nav-button { font-size: 0; width: 42px; padding: 0; }
  .nav-button::first-letter { font-size: 1rem; }
  #studyButton::after { content: "📖"; font-size: 1rem; }
  #editorButton::after { content: "✎"; font-size: 1rem; }
  .game-toolbar { align-items: start; }
  .progress-wrap { min-width: 120px; }
  .score-card { min-width: 140px; }
  .question-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .question-panel { height: 100dvh; min-height: 0; }
  .question-topline { padding: 14px 16px 10px; }
  .timer-row { padding: 10px 16px 0; }
  .lifeline-row { justify-content: flex-start; overflow-x: auto; padding: 10px 14px 8px; }
  .lifeline-button, .lifeline-extra button { flex: 0 0 auto; min-height: 44px; font-size: .82rem; }
  .question-body { align-content: start; padding: 24px 18px 32px; }
  .question-body > p { margin-bottom: 24px; font-size: clamp(1.45rem,7vw,2.1rem); }
  .answer-area { width: 100%; scroll-margin-top: 12px; }
  .learning-card { margin-top: 16px; }
  .judging-controls { position: sticky; bottom: 0; z-index: 2; grid-template-columns: repeat(3,1fr); gap: 6px; padding: 9px max(9px,env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(9px,env(safe-area-inset-left)); background: #08182f; box-shadow: 0 -12px 28px rgba(0,0,0,.35); }
  .judging-controls button { min-height: 52px; padding: 7px 4px; font-size: .76rem; }
  .judging-controls button span { display: block; margin-top: 2px; }
  .board-size-controls, .kids-choices { grid-template-columns: 1fr; }
  .kids-generator-controls, .kids-topic-picker { grid-template-columns: 1fr; }
  .study-tabs { width: 100%; overflow-x: auto; border-radius: 14px; }
  .study-tabs button { flex: 0 0 auto; min-height: 44px; }
  .kids-lesson-grid { grid-template-columns: 1fr 1fr; }
  .testament-grid, .library-grid, .word-grid { grid-template-columns: 1fr; }
  .reader-controls { grid-template-columns: 1fr 1fr; }
  .reader-controls label:first-child { grid-column: 1 / -1; }
  .passage-search { grid-template-columns: 1fr; }
  .dictionary-toolbar { align-items: stretch; flex-direction: column; }
  .editor-question { grid-template-columns: 1fr; }
  .editor-value { padding-top: 0; }
  .editor-fields { grid-template-columns: 1fr; }
  .editor-fields input, .editor-fields textarea { grid-column: 1; }
  .editor-actions { align-items: stretch; flex-direction: column; }
  .editor-actions .start-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
.bot-trap{position:absolute!important;left:-10000px!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
