:root {
  color-scheme: light;
  --canvas: #e9efe5;
  --paper: #fffdf6;
  --pine: #163d31;
  --pine-dark: #12382c;
  --muted: #4c6356;
  --line: #cbd8c8;
  --sage: #e2ebd9;
  --sage-rich: #becfb1;
  --orange: #ed602f;
  --deep-orange: #b83719;
  --butter: #f5d078;
  --peach: #f9e5d7;
  --text: "Segoe UI", system-ui, sans-serif;
  --display: "Arial Black", "Segoe UI", system-ui, sans-serif;
  --radius: 16px;
  font-family: var(--text);
  color: var(--pine);
  background: var(--canvas);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
h1, h2, p { margin: 0; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #aa381e; outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }

.wrap { width: min(1100px, calc(100% - 64px)); margin-inline: auto; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.topbar { background: var(--pine-dark); color: var(--paper); border-bottom: 4px solid #a9be9a; }
.topbar-inner { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; color: #fff8e8; text-decoration: none; font: 900 39px/1 var(--display); letter-spacing: -.04em; }
.wordmark > span:last-child { color: #ff824f; margin-left: -7px; }
.brand-mark { height: 24px; width: 27px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; transform: skew(-11deg); }
.brand-mark i { width: 5px; background: #ff824f; border-radius: 2px; height: 10px; }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 22px; }
.topbar-help { display: flex; align-items: center; gap: 8px; border: 1px solid #719184; color: var(--paper); background: transparent; border-radius: 8px; min-height: 40px; padding: 0 12px; font-size: .9rem; font-weight: 650; }
.topbar-help span { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid #bdcec5; border-radius: 50%; font-size: .78rem; }
.topbar-help:hover { background: #285141; }

.page-intro { display: flex; justify-content: space-between; align-items: end; margin-block: 39px 27px; gap: 20px; }
.overline, .game-label, .field-label { font-size: .82rem; font-weight: 800; letter-spacing: .085em; }
.overline { display: flex; align-items: center; gap: 8px; }
.overline .icon { width: 17px; height: 17px; }
.sun { color: var(--deep-orange); line-height: 1; font-size: 1.15rem; }
.page-intro h1 { font: 900 clamp(2.75rem, 6.4vw, 4.68rem)/1.09 var(--display); letter-spacing: -.04em; margin: 5px 0 7px; }
.page-intro h1 span { color: var(--deep-orange); }
.page-intro p:last-child { color: var(--muted); font-size: 1.06rem; }
.daily-date { display: flex; align-items: center; gap: 8px; font-weight: 670; border: 1px solid #bdcdbc; padding: 9px 13px; border-radius: 8px; white-space: nowrap; margin-bottom: 2px; font-size: .88rem; }
.daily-date .icon { width: 17px; height: 17px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 284px; align-items: start; gap: 21px; }
.game-card { background: var(--paper); border: 1px solid #b6c7b4; border-radius: var(--radius); min-width: 0; overflow: hidden; }
.game-top { padding: 15px 25px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f7f8eb; border-bottom: 1px solid var(--line); }
.round-status { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px; }
.game-label { white-space: nowrap; }
.progress { display: flex; gap: 4px; }
.progress span { width: 17px; height: 6px; border-radius: 2px; background: #d4dfce; }
.progress .current { background: var(--orange); }
.progress .done { background: #4d765b; }
.round-counter { font-size: .86rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.points-chip { white-space: nowrap; font-size: .94rem; font-weight: 850; padding: 6px 10px; border: 1px solid #e4cf95; background: #fcf1cb; border-radius: 7px; }
.points-chip span { color: #795412; margin-right: 2px; }
.points-chip small { font-size: .77rem; font-weight: 650; }

.play-content { padding: 24px 25px 25px; }
.round-intro { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.round-copy { min-width: 0; flex: 1; }
.category { display: inline-flex; align-items: center; gap: 6px; border-radius: 5px; padding: 5px 9px; text-transform: uppercase; letter-spacing: .085em; font-size: .76rem; font-weight: 850; color: #7c301b; background: var(--peach); }
.category span { font-size: .8rem; }
.round-title { max-width: 27ch; margin-top: 11px; font-weight: 830; font-size: clamp(1.8rem, 3.18vw, 2.72rem); line-height: 1.1; letter-spacing: -.037em; text-wrap: pretty; }
.question-hint { color: var(--muted); font-size: 1rem; margin-top: 11px; line-height: 1.5; }
.active-player { margin-top: 8px; font-size: .87rem; color: var(--muted); }
.mascot { width: clamp(120px, 26%, 190px); height: auto; object-fit: contain; margin-inline-end: 7px; flex: 0 0 auto; }

.answer-form { display: grid; gap: 17px; }
.scale-box { display: grid; grid-template-columns: minmax(145px, 155px) 1fr; gap: 16px 25px; align-items: center; border-radius: 12px; border: 1px solid #c8d9bc; background: #e8efdd; padding: 16px 18px 14px; color: var(--pine); }
.estimate { min-width: 0; }
.field-label { display: block; font-size: .75rem; color: var(--muted); }
.number-editor { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 5px; margin-top: 1px; }
.number-editor input { border: 0; border-bottom: 2px solid #9fb395; border-radius: 0; background: transparent; padding: 0; max-width: 100%; font-weight: 850; font-size: 1.85rem; letter-spacing: -.035em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.number-editor input[aria-invalid="true"] { border-color: var(--deep-orange); }
.number-editor > span { font-size: .84rem; font-weight: 650; }
.edit-guess { display: inline-grid; place-items: center; align-self: center; border: 0; border-radius: 4px; padding: 2px 5px; background: transparent; color: var(--muted); }
.edit-guess:hover { background: #d5e1cb; }
.edit-guess .icon { width: 15px; height: 15px; }
.scale-control { min-width: 0; }
.range { appearance: none; display: block; width: 100%; height: 26px; margin: 0; cursor: ew-resize; background: transparent; }
.range::-webkit-slider-runnable-track { height: 7px; border-radius: 4px; background: linear-gradient(90deg, #ed602f 0 var(--position), #adc29e var(--position) 100%); }
.range::-moz-range-track { height: 7px; border-radius: 4px; background: linear-gradient(90deg, #ed602f 0 var(--position), #adc29e var(--position) 100%); }
.range::-webkit-slider-thumb { appearance: none; height: 24px; width: 24px; margin-top: -8.5px; background: #f58049; border: 2px solid #7f341a; border-radius: 50%; box-shadow: inset 0 0 0 3px #fbb48a; }
.range::-moz-range-thumb { height: 20px; width: 20px; background: #f58049; border: 2px solid #7f341a; border-radius: 50%; box-shadow: inset 0 0 0 3px #fbb48a; }
.scale-ticks { height: 7px; margin: 1px 3px 0; background: repeating-linear-gradient(90deg, #78946e 0 1px, transparent 1px 10%); border-right: 1px solid #78946e; }
.scale-limits { display: flex; justify-content: space-between; margin-top: 4px; color: var(--muted); font-size: .81rem; font-variant-numeric: tabular-nums; }
.estimate-error { color: #9b2a17; grid-column: 1 / -1; font-size: .9rem; }

.choices { padding: 0; margin: 0; border: 0; display: grid; gap: 9px; min-width: 0; }
.choice { position: relative; display: flex; align-items: center; gap: 13px; min-height: 52px; padding: 8px 12px; border: 1px solid #c8d9bc; border-radius: 9px; font-weight: 650; background: #f4f6eb; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice:has(:checked) { border-color: #668e62; background: #e3edda; box-shadow: inset 0 0 0 1px #668e62; }
.choice:has(:focus-visible) { outline: 3px solid #aa381e; outline-offset: 3px; }
.choice-letter { display: grid; place-items: center; flex: 0 0 28px; height: 28px; background: #e0e9d8; border-radius: 5px; font-weight: 800; }
.choice:has(:checked) .choice-letter { background: var(--pine); color: white; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; min-height: 47px; padding: 9px 17px; font-weight: 780; transition: background-color 120ms ease; text-align: center; }
.button .icon { width: 17px; height: 17px; }
.primary { background: var(--pine-dark); border-color: var(--pine-dark); color: var(--paper); }
.primary:hover:not(:disabled) { background: #27533f; }
.primary:active:not(:disabled) { background: #0b291f; }
.primary:disabled { background: #dfe7d8; border-color: #d2dec9; color: var(--muted); }
.secondary { background: var(--paper); border-color: #a8bea4; }
.secondary:hover { background: #edf2e6; }
.lock-button { width: 100%; }

.side { display: grid; gap: 16px; }
.mode-card { border-radius: var(--radius); border: 1px solid #bdcdbc; background: var(--paper); padding: 17px 13px 13px; }
.mode-card h2 { padding: 0 5px; margin-bottom: 10px; font-size: 1.17rem; font-weight: 830; letter-spacing: -.025em; }
.mode-button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 63px; padding: 7px; border: 1px solid transparent; border-radius: 9px; text-align: start; background: transparent; }
.mode-button + .mode-button { margin-top: 3px; }
.mode-button:hover { background: #f0f4e8; }
.mode-button.active { border-color: #c7d7be; background: #ebf1e3; }
.mode-button strong, .mode-button small { display: block; }
.mode-button strong { font-size: .97rem; font-weight: 790; }
.mode-button small { margin-top: 2px; color: var(--muted); font-size: .82rem; line-height: 1.32; }
.mode-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; }
.mode-icon .icon { width: 19px; height: 19px; }
.mode-icon.sage { background: #d8e5d0; }
.mode-icon.peach { background: var(--peach); color: #8c331b; }
.mode-icon.butter { background: #faebbd; color: #785414; }
.tip-card { display: flex; gap: 12px; background: #f3d88c; border: 1px solid #d9bc73; padding: 16px; border-radius: var(--radius); }
.tip-mark { font-size: 1.55rem; line-height: 1; color: #85421d; }
.tip-card h2 { font-size: .98rem; font-weight: 850; }
.tip-card p { font-size: .92rem; margin-top: 4px; line-height: 1.43; }

.state-content { padding: 26px; }
.state-content > h2, dialog h2 { font: 900 clamp(2rem, 4vw, 3.25rem)/1.1 var(--display); letter-spacing: -.04em; margin-top: 7px; overflow-wrap: anywhere; }
.state-content > p:not(.overline), dialog > p:not(.overline) { margin-top: 10px; line-height: 1.5; color: var(--muted); }
.state-content > .button, .state-content > .button-row { margin-top: 20px; }
.state-symbol { display: grid; place-items: center; width: 51px; height: 51px; border-radius: 10px; background: var(--peach); color: #8b3a1e; margin-bottom: 15px; }
.state-symbol .icon { width: 25px; height: 25px; }
.handoff { min-height: 305px; }
.handoff b { overflow-wrap: anywhere; }
.reveal-box { border-radius: 12px; border: 1px solid #c9d6bf; background: #edf3e4; margin: 17px 0 12px; padding: 15px 16px; }
.answer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.answer-top strong { display: block; margin-top: 4px; font-size: clamp(1.38rem, 3vw, 2.25rem); line-height: 1.12; letter-spacing: -.025em; }
.earned { white-space: nowrap; padding: 5px 8px; border-radius: 6px; background: #f9e7a7; font-weight: 780; font-size: .88rem; }
.reveal-scale { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; font-size: .82rem; color: var(--muted); margin-top: 17px; }
.reveal-scale > div { grid-column: 1 / -1; height: 7px; background: #aec19e; border-radius: 5px; position: relative; margin-inline: 5px; }
.reveal-scale > span:last-child { text-align: right; }
.reveal-marker { position: absolute; left: var(--marker); top: 3.5px; width: 13px; height: 13px; background: var(--marker-color, var(--orange)); border: 1px solid #183d31; border-radius: 50%; transform: translate(-50%, -50%); }
.reveal-marker.right-answer { width: 9px; height: 18px; border-radius: 2px; background: #173d30; border: 1px solid #f8f8ee; }
.coral { --marker-color: #ef8a62; --result-color: #66321e; }
.yellow { --marker-color: #f0cf64; --result-color: #513d13; }
.green { --marker-color: #a7c390; --result-color: #25442d; }
.pine { --marker-color: #325d47; --result-color: #fffdf6; }
.violet { --marker-color: #b49ad0; }
.blue { --marker-color: #92bbce; }
.your-answer { margin-top: 9px; color: var(--muted); }
.your-answer b { color: var(--pine); margin-left: 5px; }
.explanation a { font-size: .87rem; font-weight: 750; text-underline-offset: .18em; }
.table-guess { margin-top: 13px; border-radius: 6px; background: #f9e6a6; padding: 7px 10px; font-size: .93rem; }
.table-guess p { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.table-guess small { display: block; margin-top: 2px; color: #5b4b23; font-size: .81rem; }
.player-answers, .rankings { list-style: none; padding: 0; margin: 8px 0 0; }
.player-answers li { display: grid; grid-template-columns: 9px minmax(36px, 1fr) minmax(34px, 2fr) auto; align-items: baseline; gap: 8px; padding: 8px 0; border-bottom: 1px solid #ccd8c2; font-size: .92rem; }
.player-answers li:last-child { border: 0; padding-bottom: 1px; }
.player-answers li > span:nth-last-child(2) { color: var(--muted); }
.player-answers strong, .rankings strong { overflow-wrap: anywhere; }
.player-dot { width: 8px; height: 8px; background: var(--marker-color); border: 1px solid #5d6f5e; border-radius: 50%; }
.rankings li { display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 8px; padding: 10px; background: #eef3e7; border-radius: 7px; margin: 6px 0; }
.rankings li:first-child { background: #f9e6a6; }
.score-display { display: flex; align-items: baseline; gap: 7px 12px; flex-wrap: wrap; margin: 11px 0; }
.score-display strong { font-weight: 890; font-size: clamp(2.7rem, 6vw, 4.65rem); line-height: 1; letter-spacing: -.04em; }
.score-display > span { font-weight: 600; color: var(--muted); }
.round-results { display: flex; flex-wrap: wrap; gap: 6px; margin: 15px 0; }
.result-marker { display: grid; place-items: center; min-width: 42px; min-height: 36px; padding: 3px 6px; border-radius: 6px; font-size: .85rem; font-weight: 780; background: var(--marker-color); color: var(--result-color); }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.share-message:empty { display: none; }
.share-fallback { display: block; max-width: 100%; width: 28rem; padding: 6px 8px; margin-top: 7px; border: 1px solid var(--line); border-radius: 6px; background: #edf3e4; }

.setup-form { display: grid; gap: 15px; margin-top: 17px; }
.count-control { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.count-control > div { display: flex; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; font-weight: 800; }
.count-control button { display: grid; place-items: center; width: 38px; height: 36px; border: 1px solid #b7c9b3; border-radius: 7px; background: #eef4e8; }
.count-control button:disabled { opacity: .51; }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.names label, .pack-select { display: grid; gap: 5px; font-weight: 710; }
.names input, .pack-select select { width: 100%; min-width: 0; background: #fbfcf6; border: 1px solid #b8c9b4; min-height: 43px; border-radius: 7px; padding: 8px 10px; font-weight: 450; }
.practice-packs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
.practice-packs .mode-button { border: 1px solid #c2d2bd; margin: 0; }

.footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-block: 25px 14px; padding-block: 12px; border-top: 1px solid #c9d6c7; font-size: .83rem; color: var(--muted); }
.footer b { font-weight: 870; color: var(--pine); }
.footer-divider { margin-inline: 4px; color: #748a7a; }
.footer button { border: 0; background: none; text-decoration: underline; text-underline-offset: .18em; padding: 5px 0; }

dialog { max-width: min(520px, calc(100% - 26px)); background: var(--paper); color: var(--pine); border: 1px solid #9fbaaa; border-radius: var(--radius); padding: 25px; }
dialog::backdrop { background: #10382cb3; }
dialog h2 { font-size: 2.3rem; }
dialog .button { margin-top: 17px; }
.close-dialog { position: absolute; top: 10px; right: 10px; border: 0; border-radius: 6px; background: var(--sage); font-size: 1.4rem; line-height: 1; width: 31px; height: 31px; }
.rules-list { padding-left: 21px; line-height: 1.5; }
.rules-list li + li { margin-top: 8px; }

@media (max-width: 900px) {
  .wrap { width: calc(100% - 44px); }
  .layout { grid-template-columns: minmax(0, 1fr) 230px; gap: 13px; }
  .game-top, .play-content, .state-content { padding-inline: 18px; }
  .scale-box { gap: 12px; }
}

@media (max-width: 700px) {
  .wrap { width: calc(100% - 30px); }
  .topbar-inner { min-height: 57px; }
  .wordmark { font-size: 34px; }
  .page-intro { margin-block: 23px 16px; align-items: start; flex-direction: column; gap: 10px; }
  .page-intro h1 { font-size: clamp(2.35rem, 9.4vw, 3.5rem); }
  .page-intro p:last-child { font-size: .96rem; }
  .daily-date { font-size: .8rem; padding: 5px 8px; }
  .daily-date .icon { width: 15px; height: 15px; }
  .layout { grid-template-columns: 1fr; }
  .side { gap: 10px; }
  .game-top { padding-block: 11px; }
  .round-intro { margin-bottom: 16px; }
  .round-title { font-size: clamp(1.54rem, 6.4vw, 2.38rem); }
  .mascot { margin-inline-end: 0; width: clamp(85px, 27%, 145px); }
  .play-content, .state-content { padding-block: 16px; }
}

@media (max-width: 440px) {
  .wrap { width: calc(100% - 24px); }
  .topbar-help { min-height: 36px; padding-inline: 7px; }
  .game-top, .play-content, .state-content { padding-inline: 13px; }
  .round-status { gap: 5px 7px; }
  .game-label { font-size: .72rem; }
  .points-chip { padding: 4px 6px; }
  .progress span { width: 10px; }
  .round-counter { font-size: .76rem; }
  .round-intro { gap: 6px; }
  .question-hint { font-size: .9rem; }
  .scale-box { grid-template-columns: 1fr; gap: 6px; padding: 11px 12px 9px; }
  .number-editor input { font-size: 1.62rem; }
  .answer-form { gap: 12px; }
  .practice-packs { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
