:root { --ink: #19312e; --forest: #183b35; --moss: #39634f; --cream: #fff8e9; --paper: #f6e8c6; --sun: #f2b84b; --coral: #d9654f; --line: #cda978; --shadow: 0 18px 40px rgb(42 55 39 / 18%); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: #e7d6ad; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at top, #f7e9c8 0, #e6ce9b 52%, #d3ae72 100%); }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(1120px, 100%); margin: 0 auto; padding: clamp(16px, 3vw, 42px); }
.screen { display: none; animation: rise .28s ease-out; }
.screen.is-active { display: block; }
.sound-toggle { position: fixed; z-index: 10; top: 14px; right: 14px; min-height: 40px; padding: 8px 12px; color: #fff9e8; background: var(--forest); border: 2px solid #fff9e8; border-radius: 999px; font: inherit; font-size: .82rem; font-weight: 800; box-shadow: 0 3px 0 rgb(0 0 0 / 20%); }
.sound-toggle[aria-pressed="false"] { color: var(--ink); background: #f6e5bd; }
.hero, .setup-card, .question-card, .feedback-card, .results-card, .history-card { background: color-mix(in srgb, var(--cream) 92%, white); border: 2px solid rgb(115 77 42 / 25%); border-radius: 28px; box-shadow: var(--shadow); }
.hero { padding: clamp(24px, 5vw, 56px); text-align: center; background: linear-gradient(135deg, #183b35, #275344); color: #fff9e8; overflow: hidden; position: relative; }
.hero::after { content: "✦  ✦  ✦"; position: absolute; color: rgb(250 211 109 / 55%); bottom: 16px; left: 0; right: 0; letter-spacing: 18px; }
.hero__logo { width: min(420px, 82%); max-height: 170px; object-fit: contain; }
.eyebrow { margin: 0 0 8px; color: var(--coral); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero .eyebrow { color: #f9cf72; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.65rem, 4vw, 3rem); line-height: 1.1; }
h1 strong { color: var(--sun); }
.intro { max-width: 650px; margin: 18px auto 10px; font-size: 1.08rem; }
.setup-card { width: min(650px, 100%); margin: 24px auto; padding: clamp(22px, 4vw, 38px); }
label, legend { display: block; font-weight: 800; }
input[type="text"], input[type="number"] { width: 100%; margin-top: 8px; padding: 13px 14px; color: var(--ink); background: #fffdf7; border: 2px solid var(--line); border-radius: 12px; }
input:focus-visible, button:focus-visible { outline: 4px solid #5c9ba1; outline-offset: 3px; }
.field-help { margin: 7px 0 18px; color: #695641; font-size: .92rem; }
.timer-settings { margin: 24px 0; padding: 18px; border: 2px dashed var(--line); border-radius: 18px; }
.choice-line { display: flex; gap: 9px; align-items: center; margin: 11px 0; font-weight: 650; }
.choice-line input { accent-color: var(--forest); }
.seconds-setting { margin-top: 16px; }
.seconds-setting input:disabled { opacity: .48; }
.button { width: 100%; margin-top: 10px; padding: 14px 18px; border: 0; border-radius: 14px; font-weight: 850; transition: transform .16s ease, filter .16s ease; }
.button:hover { transform: translateY(-2px); filter: brightness(1.04); }
.button--primary { color: #fffaf0; background: linear-gradient(135deg, var(--coral), #bb493e); box-shadow: 0 6px 0 #8d332e; }
.button--quiet { color: var(--forest); background: transparent; border: 2px solid var(--moss); }
.button--danger { color: #8c2929; background: #fff1e7; border: 2px solid #d2826d; }
.form-error { margin: 12px 0; color: #9c2727; font-weight: 750; }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.category-grid article { padding: 8px; text-align: center; color: #fff9e9; background: var(--forest); border-radius: 18px; box-shadow: 0 8px 18px rgb(39 58 40 / 18%); }
.category-grid img { width: 100%; aspect-ratio: 1.1; object-fit: cover; border-radius: 13px; }
.category-grid h2 { margin: 8px 4px 5px; font-size: .9rem; }
.game-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 14px; }
.game-header strong { display: block; font-size: 1.12rem; }
.flair-chip { min-width: 88px; padding: 9px 13px; color: #fff8dd; text-align: center; background: var(--forest); border-radius: 18px; }
.flair-chip span { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #f3c96c; }
.flair-chip strong { font-size: 1.4rem; }
.timer { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.timer__bar { flex: 1; height: 13px; overflow: hidden; background: #d5b979; border-radius: 99px; }
.timer__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--moss), var(--sun), var(--coral)); border-radius: inherit; transition: width .1s linear; }
.timer strong { min-width: 44px; text-align: right; }
.question-card, .feedback-card, .results-card, .history-card { padding: clamp(24px, 5vw, 54px); }
.question-card { position: relative; min-height: 420px; }
.question-card h1 { max-width: 800px; margin: 12px auto 30px; text-align: center; }
.mascot { display: block; width: min(220px, 52vw); max-height: 180px; margin: 0 auto 12px; object-fit: contain; }
.mascot--thinking { width: min(180px, 42vw); max-height: 135px; }
.answers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 820px; margin: 0 auto; }
.answer-button { min-height: 70px; padding: 14px; color: var(--ink); background: #fffdf6; border: 2px solid var(--line); border-radius: 16px; font-weight: 760; font-size: 1.02rem; box-shadow: 0 4px 0 #b58d5e; }
.answer-button:hover { color: #fff; background: var(--moss); border-color: var(--moss); }
.feedback-card, .results-card { max-width: 650px; margin: 0 auto; text-align: center; }
.feedback-card h1, .results-card h1 { margin-bottom: 16px; }
.flair-earned { margin: 20px 0; color: var(--coral); font-size: 1.15rem; font-weight: 850; }
.result-score { margin: 20px 0; font-size: 1.5rem; }
.result-score strong { display: block; color: var(--coral); font-size: clamp(3.4rem, 12vw, 6rem); line-height: .95; }
.result-rank { margin: 0 auto 24px; padding: 13px 18px; color: #fff9e8; background: var(--forest); border-radius: 14px; font-weight: 850; }
.result-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 28px 0; }
.result-details div { padding: 14px 8px; background: #f6e5bd; border-radius: 14px; }
.result-details dt { font-size: .78rem; font-weight: 700; }
.result-details dd { margin: 6px 0 0; color: var(--coral); font-size: 1.4rem; font-weight: 900; }
.history-card { max-width: 800px; margin: 0 auto; }
.history-head { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.history-head .button { width: auto; margin: 0; }
.history-item { display: grid; grid-template-columns: 1.15fr 1fr 1.25fr 1fr; gap: 10px; align-items: center; margin-top: 12px; padding: 14px; background: #f6e5bd; border-radius: 14px; font-size: .9rem; }
.history-item strong { color: var(--forest); }
.empty-state { padding: 28px 0; color: #695641; text-align: center; }
dialog { width: min(510px, calc(100% - 32px)); color: var(--ink); background: var(--cream); border: 2px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(20 35 30 / 62%); }
.dialog-actions { display: flex; gap: 12px; margin-top: 18px; }
.dialog-actions .button { margin: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 680px) { .app-shell { padding: 14px; } .hero, .setup-card, .question-card, .feedback-card, .results-card, .history-card { border-radius: 20px; } .category-grid { grid-template-columns: repeat(2, 1fr); } .answers { grid-template-columns: 1fr; } .answer-button { min-height: 64px; } .result-details { grid-template-columns: 1fr; } .history-item { grid-template-columns: 1fr 1fr; } .history-head { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
