:root {
  color-scheme: light;
  --paper: #f6f3e9;
  --white: #fffdf6;
  --ink: #172f29;
  --green: #143e32;
  --muted: #4e6158;
  --line: #d8ddd0;
  --yellow: #f9d56f;
  font-family: "Nunito", "Aptos", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input, select { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, a { touch-action: manipulation; }
a { color: inherit; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
button:focus-visible, a:focus-visible, select:focus-visible, label:has(input:focus-visible) {
  outline: 3px solid #31614f;
  outline-offset: 4px;
}
.shell { width: min(1160px, calc(100% - 72px)); margin-inline: auto; }
.topbar { position: sticky; z-index: 3; top: 0; height: 79px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; border-bottom: 1px solid #d9dacd; background: var(--paper); }
.back { justify-self: start; display: inline-flex; align-items: center; gap: 9px; min-height: 44px; text-decoration: none; font-weight: 750; }
button.back { padding: 0; border: 0; background: transparent; color: inherit; white-space: nowrap; }
.back:hover { text-decoration: underline; }
.back span { font-size: 1.3rem; }
#menu-title:focus { outline: none; }
.masthead { display: flex; align-items: center; gap: 9px; font-size: .88rem; font-weight: 800; letter-spacing: .035em; }
.brand-mark { width: 19px; height: 19px; border: 2px solid #347358; border-radius: 4px 9px 4px 9px; transform: rotate(-12deg); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 3px; background: #99be83; border-radius: 2px 5px 2px 5px; }
.utilities { justify-self: end; display: flex; gap: 8px; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #d5dacd; border-radius: 13px; background: var(--white); color: var(--ink); }
.icon-button:hover, .quiet:hover { background: #edf1e4; }
.instruction-button { display: flex; align-items: center; justify-content: center; gap: 6px; width: auto; padding-inline: 12px; border-color: #c6a655; background: var(--yellow); font-size: .9rem; font-weight: 800; }
.instruction-button:hover { background: #ffe08a; }
.speaker { position: relative; width: 20px; height: 18px; }
.speaker::before { content: ""; position: absolute; inset: 1px 8px 1px 0; background: currentColor; clip-path: polygon(0 30%, 39% 30%, 100% 0, 100% 100%, 39% 70%, 0 70%); }
.speaker::after { content: ""; position: absolute; inset: 1px 0 1px 11px; border-right: 2px solid currentColor; border-radius: 50%; }
#mute[aria-pressed="false"] .speaker::after { inset: 1px 3px; border: 0; border-radius: 0; border-right: 2px solid currentColor; transform: translateX(-4px) rotate(-44deg); }
.fullscreen-icon { width: 17px; height: 17px; background: conic-gradient(from 90deg at 2px 2px, transparent 25%, currentColor 0) top left, conic-gradient(from 180deg at calc(100% - 2px) 2px, transparent 25%, currentColor 0) top right, conic-gradient(from 0deg at 2px calc(100% - 2px), transparent 25%, currentColor 0) bottom left, conic-gradient(from 270deg at calc(100% - 2px) calc(100% - 2px), transparent 25%, currentColor 0) bottom right; background-size: 6px 6px; background-repeat: no-repeat; }
.welcome { padding-block: 34px; }
.opening { display: grid; grid-template-columns: 1.52fr 1fr; gap: 24px; }
.hero { container-type: inline-size; position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; min-height: 460px; border-radius: 26px; background: #173f33; color: #fff6de; }
.hero-copy { position: relative; z-index: 2; padding: 30px 0 36px clamp(26px, 8.3cqw, 62px); }
.bureau { display: inline-flex; align-items: center; gap: 9px; color: #f7d57c; font-size: .75rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.bureau span { width: 8px; height: 8px; border: 1.5px solid; transform: rotate(45deg); }
.hero h1 { margin: 19px 0 23px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.63rem, 14.2cqw, 6.25rem); font-weight: 700; letter-spacing: -.078em; line-height: .82; }
.hero p { margin: 0; font-size: clamp(1rem, 1.65vw, 1.3rem); line-height: 1.45; font-weight: 650; color: #e7ebd4; }
.hero-art { position: absolute; z-index: 1; inset: 0 0 0 45%; pointer-events: none; }
.art-grid { position: absolute; inset: 0; opacity: .35; background-image: radial-gradient(#aad19f 1px, transparent 1px); background-size: 16px 16px; mask-image: linear-gradient(90deg, transparent, #000 30%); }
.art-grid::after { content: ""; position: absolute; top: 11%; right: -25%; width: 119%; aspect-ratio: 1; border: 1px solid #a6bc8e; border-radius: 50%; box-shadow: 0 0 0 20px #173f33, 0 0 0 21px #809f7c; }
.photo { position: absolute; display: grid; place-items: center; width: 21cqw; aspect-ratio: 1 / 1.11; padding: 9px 9px 18px; border: 1px solid #d9dbc9; border-radius: 10px; background: #fbf8e9; box-shadow: 0 10px 20px #0e291f59; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 5px; mix-blend-mode: multiply; }
.photo-one { top: 13%; right: 26%; transform: rotate(-17deg); }
.photo-two { top: 11%; right: 3%; transform: rotate(14deg) scale(.89); }
.photo-three { right: 28%; bottom: 8%; transform: rotate(-12deg) scale(.87); }
.photo-missing { z-index: 2; right: 10%; top: 40%; transform: rotate(13deg); background: var(--yellow); border: 1px solid #fbe2a6; color: var(--green); padding: 11px; }
.photo-missing span { display: grid; width: 100%; height: 100%; place-items: center; border: 1.5px dashed #674d20; border-radius: 5px; font: 700 clamp(3rem, 7vw, 6rem)/1 Georgia, serif; }
.setup { display: flex; flex-direction: column; justify-content: center; padding: clamp(20px, 3.05vw, 36px); background: var(--white); border: 1px solid var(--line); border-radius: 26px; }
.levels { border: 0; padding: 0; margin: 0; min-width: 0; }
.levels legend { margin-bottom: 13px; padding: 0; font-size: 1.52rem; line-height: 1.15; font-weight: 850; letter-spacing: -.035em; }
.level input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.level { position: relative; cursor: pointer; display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; min-height: 64px; margin-bottom: 8px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 13px; }
.level:hover { border-color: #799583; }
.level:has(input:checked) { background: #eaf0e0; border-color: #728d75; }
.level strong { display: block; line-height: 1.2; }
.level small { display: block; margin-top: 3px; font-size: .78rem; color: var(--muted); line-height: 1.2; }
.level-bars { display: flex; align-items: end; justify-content: center; gap: 3px; padding: 9px; height: 39px; border-radius: 9px; background: #ecede1; }
.level-bars i { width: 5px; height: 7px; border-radius: 2px; background: #366f55; }
.level-bars i:nth-child(2) { height: 13px; }
.level-bars i:nth-child(3) { height: 20px; }
.bars-one i:nth-child(n+2), .bars-two i:nth-child(3) { background: #97a598; }
.choice-dot { width: 17px; height: 17px; border-radius: 50%; border: 1px solid #829587; }
.level input:checked ~ .choice-dot { border: 5px solid #2e614c; background: #fff; }
.pace { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 4px 0 12px; }
.pace label { font-weight: 780; }
.pace select { flex: 1; min-width: 0; min-height: 44px; padding: 6px 8px; border: 1px solid #829887; border-radius: 9px; background: var(--white); color: var(--ink); cursor: pointer; }
.menu-actions { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.menu-actions .quiet, .menu-actions .start { padding-inline: clamp(9px, 1.4vw, 19px); }
.primary, .quiet { display: inline-flex; align-items: center; justify-content: center; gap: 13px; min-height: 48px; padding: 10px 19px; border-radius: 12px; border: 1px solid transparent; font-weight: 780; line-height: 1.2; }
.primary { color: #173629; background: var(--yellow); border-color: #d5af55; box-shadow: 0 2px 0 #ba984f; }
.primary:hover { background: #ffe08a; }
.primary:active { transform: translateY(2px); box-shadow: none; }
.quiet { color: var(--ink); border-color: #c6d0c3; background: var(--white); }
.start { width: 100%; justify-content: space-between; min-height: 53px; }
.start span { font-size: 1.35rem; }
.how-to { display: grid; grid-template-columns: repeat(3, 1fr); margin: 21px 0 0; padding: 17px 13px; list-style: none; border-block: 1px solid var(--line); }
.how-to li { display: flex; gap: 11px; align-items: center; justify-content: center; }
.how-to li + li { border-left: 1px solid var(--line); }
.how-to li > span { display: grid; place-items: center; border-radius: 9px; width: 30px; height: 30px; flex: 0 0 30px; border: 1px solid #c9d4bf; color: #355946; background: #e6ecdc; font-weight: 800; }
.how-to strong, .how-to small { display: block; }
.how-to small { color: var(--muted); }

.game { max-width: 1000px; margin: 0 auto; padding: 23px 0 34px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.session-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-bottom: 16px; }
.eyebrow { margin: 0; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.round-label { margin-top: 3px; font-weight: 800; }
.round-track { display: flex; gap: 5px; }
.round-track span { width: clamp(10px, 3vw, 24px); height: 7px; border-radius: 10px; background: #d9ded2; }
.round-track .done { background: #60917b; }
.round-track .current { background: #245943; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px #67917c; }
.pause-button { grid-column: 3; justify-self: end; min-height: 44px; }
.board { border: 1px solid #d1d9ca; border-radius: 25px; overflow: hidden; background: var(--white); }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 18px 24px; background: #10362a; color: #fff8e9; }
.board-head h2 { margin: 3px 0 1px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.65rem, 4vw, 2.65rem); letter-spacing: -.045em; line-height: 1.04; }
#phase-title:focus, #result-title:focus { outline: none; }
.board-head p { margin: 6px 0 0; font-size: .9rem; color: #e7ebd9; }
.board-head .theme-label { margin: 0; color: #f6d377; font-size: .71rem; }
.timer { flex: 0 0 clamp(64px, 15vw, 145px); text-align: right; font-variant-numeric: tabular-nums; }
.timer-track { margin-top: 6px; height: 6px; background: #517766; border-radius: 9px; overflow: hidden; }
#timer-fill { height: 100%; background: var(--yellow); transform-origin: left; }
.tray-wrap { position: relative; margin: 16px 18px 0; min-height: 150px; border-radius: 16px; background: #e9eddd; border: 1px solid #d7decd; overflow: hidden; }
.tray { display: grid; grid-template-columns: repeat(var(--columns, 3), minmax(0, 126px)); grid-auto-rows: 1fr; gap: 9px; justify-content: center; align-content: center; min-height: 148px; max-width: 844px; margin: 0 auto; padding: 12px; }
.object { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; min-height: 110px; gap: 3px; padding: 6px; border: 1px solid #829887; border-radius: 11px; background: #fffdf7; color: var(--ink); font-weight: 780; text-align: center; line-height: 1.15; }
.object img { display: block; width: min(100%, 86px); height: 83px; object-fit: contain; mix-blend-mode: multiply; }
.object span { font-size: .8rem; }
.tray .restored { border: 2px solid #36725a; background: #e4efdc; }
.location-slot { min-width: 0; border: 2px dashed #856321; border-radius: 11px; background: #fcf3d6; box-shadow: inset 0 0 0 4px #f4dd98; }
.shutter { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 7px; background: #d9e7d0; color: var(--ink); }
.shutter canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .6; }
.shutter > :not(canvas) { z-index: 1; }
.shutter-tag { display: grid; place-items: center; width: 48px; height: 49px; transform: rotate(-9deg); border-radius: 6px; background: var(--yellow); border: 1px solid #cda550; box-shadow: 0 3px 0 #274e361f; font: 700 2rem Georgia, serif; }
@media (prefers-reduced-motion: no-preference) {
  .shutter-tag, .result-emblem { animation: tag-in .24s ease-out; }
  .tray .restored { animation: found-in .34s ease-out; }
  @keyframes tag-in { from { opacity: 0; transform: translateY(7px) rotate(4deg); } }
  @keyframes found-in { from { transform: scale(.93); background: #f9e2a0; } }
}
.answer-area { padding: 12px 18px 16px; }
.answer-panel { padding: 0 9px 8px; margin-bottom: 8px; border: 1px solid #dac98d; border-radius: 14px; background: #fcf3d6; }
.answer-heading { display: grid; place-items: center; margin: 0; min-height: 44px; font-size: 1rem; line-height: 1.12; text-align: center; }
.options { display: grid; grid-template-columns: repeat(var(--options, 2), minmax(0, 1fr)); gap: 8px; max-width: 650px; margin: 0 auto; }
.options .object:not(:disabled):hover { border-color: #2f674f; background: #edf2e5; transform: translateY(-2px); }
.options .object.wrong { border-color: #956355; background: #fbebe4; color: #713a2e; }
.options .object .mark { min-height: .9rem; font-size: .73rem; }
.options .object .mark:empty { display: none; }
.board-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 48px; }
.feedback { flex: 1; margin: 0; color: var(--muted); font-weight: 650; font-size: .9rem; }
.hint-box { flex: 1; padding: 7px 11px; border: 1px solid #e1cd97; border-radius: 8px; background: #fff4cf; font-size: .9rem; }

.results { max-width: 680px; margin: 34px auto; padding: 28px; text-align: center; border-radius: 24px; border: 1px solid var(--line); background: var(--white); }
.result-emblem { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 15px; border: 1px solid #cba458; border-radius: 16px; transform: rotate(-7deg); background: var(--yellow); color: var(--green); font-size: 2rem; font-weight: 850; }
.results h2 { margin: 5px 0; font: 700 clamp(2.1rem, 5vw, 3.4rem)/1.1 Georgia, serif; letter-spacing: -.05em; }
.results p { margin-block: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 22px 0; }
.stats div { display: flex; flex-direction: column-reverse; gap: 5px; padding: 9px 5px; justify-content: center; border: 1px solid #d4dccf; border-radius: 10px; background: #eff1e6; }
.stats dt { font-size: .79rem; color: var(--muted); }
.stats dd { margin: 0; font-size: 1.6rem; font-weight: 800; }
.results .result-tip { margin-bottom: 18px; color: var(--muted); }
.result-actions, .dialog-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
dialog { width: min(420px, calc(100% - 32px)); padding: 25px; border: 1px solid #cdd9c8; border-radius: 20px; background: var(--white); color: var(--ink); }
dialog::backdrop { background: #112b22cc; }
dialog h2 { margin: 0; }
dialog p { color: var(--muted); }

@media (max-width: 900px) {
  .shell { width: calc(100% - 40px); }
  .opening { gap: 14px; }
}
@media (max-width: 680px) {
  .shell { width: calc(100% - 24px); }
  .topbar { height: 63px; gap: 6px; }
  .topbar, .session-head { grid-template-columns: 1fr auto 1fr; }
  .masthead { font-size: .73rem; gap: 6px; }
  .brand-mark { width: 14px; height: 14px; }
  .brand-mark::after { inset: 2px; }
  .utilities { gap: 5px; }
  .instruction-button { padding-inline: 9px; }
  .welcome { padding-block: 13px; }
  .opening { grid-template-columns: 1fr; }
  .hero { min-height: 240px; border-radius: 19px; }
  .hero h1 { margin-block: 11px 13px; }
  .hero-copy { padding: 19px 0 23px 21px; }
  .hero p { font-size: .92rem; }
  .bureau { font-size: .65rem; }
  .photo { width: min(22cqw, 130px); }
  .photo-one { top: 11%; }
  .photo-two { right: 1%; top: 8%; }
  .photo-missing span { font-size: clamp(2rem, 11cqw, 4.4rem); }
  .setup { padding: 16px; border-radius: 19px; }
  .levels legend { font-size: 1.26rem; margin-bottom: 9px; }
  .level { min-height: 53px; margin-bottom: 6px; padding-block: 5px; }
  .how-to { gap: 8px; margin-top: 14px; padding: 10px 0; }
  .how-to li { justify-content: start; gap: 6px; padding-left: 5px; }
  .how-to li > span { width: 23px; height: 23px; flex-basis: 23px; font-size: .75rem; }
  .how-to small { display: none; }
  .game { padding-top: 12px; }
  .session-head { margin-bottom: 9px; }
  .pause-button { padding-inline: 8px; gap: 5px; font-size: .84rem; }
  .round-label { font-size: .83rem; }
  .board { border-radius: 18px; }
  .board-head { padding: 13px 11px; }
  .board-head p { font-size: .8rem; }
  .tray-wrap { margin: 10px 8px 0; min-height: 108px; }
  .tray { grid-template-columns: repeat(var(--mobile-columns, 3), minmax(0, 1fr)); padding: 7px; gap: 5px; min-height: 106px; }
  .object { min-height: 82px; padding: 4px; }
  .object img { width: min(100%, 72px); height: 54px; }
  .object span { font-size: .73rem; }
  .answer-area { padding: 8px; }
  .answer-panel { padding-inline: 5px; }
  .options { gap: 5px; }
  .options .object span { overflow-wrap: anywhere; }
  .board-footer { flex-wrap: wrap; }
  .board-footer p { flex-basis: 100%; min-height: 0; }
  .board-footer .hint-box { flex-basis: 100%; }
  .board-footer p:empty { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .results { padding: 21px 13px; margin: 18px 0; }
}
@media (max-width: 420px) {
  .topbar { grid-template-columns: 1fr auto; }
  .masthead { display: none; }
}
@media (max-width: 375px) {
  .options:has(.object:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .options:has(.object:nth-child(4)) .object { min-height: 64px; }
  .options:has(.object:nth-child(4)) img { height: 42px; }
}

.game .quiet, .game .primary { min-height: 56px; }

@media (min-width: 681px) {
  .shell { width: min(1720px, calc(100% - 44px)); }
  .game { max-width: 1600px; }
  .topbar { height: clamp(57px, 9vh, 96px); }
  .icon-button { min-width: 54px; min-height: 50px; }
  .board-head { padding: clamp(11px, 2vh, 24px) clamp(16px, 2.2vw, 34px); }
  .board-head h2 { font-size: clamp(1.8rem, 4.9vh, 3.8rem); }
  .board-head p, .round-label, .feedback { font-size: clamp(1rem, 2.4vh, 1.55rem); }
  .eyebrow { font-size: clamp(.82rem, 1.8vh, 1.1rem); }
  .timer { font-size: clamp(1rem, 3vh, 1.75rem); }
  .tray { max-width: 1430px; grid-template-columns: repeat(var(--columns, 3), minmax(0, 224px)); min-height: 0; }
  .object { gap: 5px; min-height: 0; }
  .object img { width: min(100%, 178px); height: clamp(74px, 13.5vh, 166px); }
  .object span { font-size: clamp(1rem, 2.7vh, 1.55rem); overflow-wrap: anywhere; }
  .object .mark { font-size: .9rem; }
  .answer-panel { border-color: #b69c58; }
  .answer-heading { font-size: clamp(1.3rem, 3.2vh, 2.1rem); }
  .options { max-width: 1020px; }
  .hint-box, .game .quiet, .game .primary, .instruction-button { font-size: clamp(1rem, 2.3vh, 1.42rem); }
}

@media (min-width: 681px) and (max-height: 760px) {
  .object img { height: clamp(64px, 11.2vh, 90px); }
}

@media (min-width: 681px) and (max-height: 700px) {
  .game { padding-block: 10px; }
  .session-head { margin-bottom: 7px; }
  .board-head { padding-block: 9px; }
  .tray-wrap { margin-top: 10px; min-height: 0; }
  .tray { padding: 8px; }
  .answer-area { padding-block: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
