:root {
  color-scheme: light;
  --paper: #f3f3ea;
  --cream: #fffdf3;
  --ink: #173a32;
  --muted: #60756d;
  --line: #ccd9cf;
  --green: #23705a;
  --green-dark: #184e40;
  --mint: #dceadd;
  --orange: #e99d49;
  --shadow: 0 22px 60px rgba(31, 67, 49, .12);
  font-family: ui-rounded, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 75% -10%, #fff3cf 0, transparent 36%), var(--paper); }
button, input, select { font: inherit; }
button { color: inherit; }
.shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 48px; }
.topbar { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wordmark, .text-button { border: 0; background: none; cursor: pointer; }
.wordmark { display: flex; align-items: center; gap: 9px; padding: 7px 0; font-weight: 900; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 25px; height: 25px; border: 2px solid var(--green); border-radius: 50%; color: var(--green); line-height: 1; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.language-select { max-width: 120px; min-height: 36px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream); color: var(--ink); font-size: 12px; }
.language-select:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.brand-mark { flex-shrink: 0; }
.wordmark { text-align: left; }
html:is([lang="en"],[lang="de"],[lang="fr"]) .intro-copy h1 { font-size: clamp(45px, 5.5vw, 76px); line-height: 1.04; }
html[lang="ja"] .intro-copy h1, html[lang="ko"] .intro-copy h1 { font-size: clamp(45px, 5.8vw, 78px); line-height: 1.15; }
.intro-copy h1, .summary-heading h1, .challenge-card h1 { overflow-wrap: anywhere; text-wrap: balance; }
.button { white-space: normal; }
.text-button { padding: 7px 3px; font-weight: 750; color: var(--muted); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; }
.text-button:hover { color: var(--ink); text-decoration-color: currentColor; }
.seed-pill { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.55); color: var(--muted); font: 800 10px/1.1 ui-monospace, monospace; letter-spacing: .08em; }

.screen { display: none; }
.screen.is-active { display: block; animation: screen-in .42s both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } }
.kicker { margin: 0; color: var(--green); font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.product-subtitle { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.product-help-footer { margin-top: 48px; padding: 16px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.7; }
.product-help { max-width: 800px; }
.product-help > summary { min-height: 44px; width: fit-content; display: list-item; align-content: center; cursor: pointer; font-weight: 600; padding: 10px 3px; }
.product-help > summary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }
.help-content { padding: 0 3px 10px; }
.help-content h3 { font-size: 14px; font-weight: 650; margin: 22px 0 5px; color: var(--ink); }
.help-content p { margin: 0 0 12px; }
.link-notice { margin: 24px 0; padding: 16px 20px; border: 1px solid #c78346; border-radius: 16px; background: #fff5dc; }
.link-notice p { margin: 0 0 8px; line-height: 1.6; }
#shareRoundChallenge { width: 100%; margin-top: 10px; }
#restoredNotice { color: var(--muted); font-size: 14px; line-height: 1.6; }
.intro-screen { min-height: calc(100vh - 116px); grid-template-columns: 1fr .92fr; align-items: center; gap: 8vw; padding: 6vh 5vw 4vh; }
.intro-screen.is-active { display: grid; }
.intro-copy h1, .summary-heading h1 { margin: 22px 0; font-size: clamp(52px, 7.5vw, 104px); line-height: .96; letter-spacing: -.075em; }
em { color: var(--orange); font-style: normal; }
.intro-lead { max-width: 540px; margin: 0; color: var(--muted); font-size: clamp(17px, 2vw, 21px); line-height: 1.8; }
.intro-actions { margin-top: 42px; }
.intro-actions p, .summary-actions p { margin: 13px 0 0; color: #7c8b85; font-size: 12px; }
.button { border: 0; border-radius: 16px; padding: 16px 20px; cursor: pointer; font-weight: 900; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover { transform: translateY(-2px); }
.button:focus-visible, .text-button:focus-visible, input:focus-visible, .skip-button:focus-visible { outline: 3px solid rgba(233,157,73,.5); outline-offset: 3px; }
.button-primary { background: var(--green); color: white; box-shadow: 0 9px 20px rgba(35,112,90,.18); }
.button-primary:hover { background: var(--green-dark); box-shadow: 0 12px 24px rgba(35,112,90,.23); }
.button-large { min-width: 230px; padding: 19px 24px; font-size: 17px; }
.button span[aria-hidden="true"] { float: right; margin-left: 20px; }
.button-quiet { background: var(--mint); color: var(--green-dark); }
.intro-art { position: relative; min-height: min(560px, 65vh); display: grid; place-items: center; isolation: isolate; }
.orbit { position: absolute; border: 1px solid rgba(35,112,90,.17); border-radius: 50%; }
.orbit-one { width: min(520px, 42vw); aspect-ratio: 1; }
.orbit-two { width: min(410px, 34vw); aspect-ratio: 1; border-style: dashed; animation: spin 30s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sample { position: relative; z-index: 1; width: 230px; height: 300px; padding: 90px 32px 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-content: end; border: 3px solid rgba(255,255,255,.9); border-radius: 35px 35px 55px 55px; background: rgba(255,255,255,.32); box-shadow: inset 20px 0 30px rgba(255,255,255,.3), var(--shadow); transform: rotate(-6deg); }
.sample::before { content: ""; position: absolute; left: 28px; right: 28px; top: -19px; height: 42px; border-radius: 12px; background: var(--green); box-shadow: inset 0 -7px 0 rgba(0,0,0,.08); }
.sample span { width: 30px; height: 30px; border-radius: 50%; background: var(--orange); box-shadow: inset -4px -4px 0 rgba(0,0,0,.08); }
.sample span:nth-child(3n+1) { background: #3a936f; }
.sample span:nth-child(3n+2) { background: #e6bf63; }
.sample-number { position: absolute; right: 3%; bottom: 20%; z-index: 2; padding: 16px 21px; border-radius: 18px; background: var(--cream); box-shadow: var(--shadow); color: var(--green); font-size: 28px; font-weight: 950; transform: rotate(5deg); }
.intro-art > p { position: absolute; bottom: 5%; color: var(--muted); font: 800 12px/1 ui-monospace, monospace; letter-spacing: .12em; }

.challenge-intro { min-height: calc(100vh - 116px); place-items: center; }
.challenge-intro.is-active { display: grid; }
.challenge-card { width: min(640px, 100%); padding: clamp(34px, 7vw, 70px); text-align: center; border-radius: 34px; background: var(--cream); box-shadow: var(--shadow); }
.challenge-stamp { display: inline-block; padding: 8px 13px; border: 1px solid #e6c990; border-radius: 999px; color: #8b6428; background: #fff6d9; font-size: 12px; font-weight: 900; }
.challenge-card h1 { margin: 28px 0 18px; font-size: clamp(42px, 7vw, 70px); line-height: 1.03; letter-spacing: -.065em; }
.challenge-card p { margin: 0 auto 30px; max-width: 440px; color: var(--muted); line-height: 1.8; }
.standalone { display: block; margin: 14px auto 0; }

.game-screen { padding-top: 32px; }
.game-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.progress-dots { display: flex; gap: 6px; margin-top: 9px; }
.progress-dots span { width: 27px; height: 5px; border-radius: 999px; background: #d4dfd6; transition: background .2s, width .2s; }
.progress-dots span.done { background: #82ac98; }
.progress-dots span.current { width: 44px; background: var(--green); }
.skip-button { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: rgba(255,255,255,.6); color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 800; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: 18px; min-height: min(680px, calc(100vh - 142px)); }
.scene-card, .answer-card { border-radius: 30px; overflow: hidden; box-shadow: var(--shadow); }
.scene-card { position: relative; min-height: 560px; display: flex; flex-direction: column; background: linear-gradient(145deg, #d7eadb, #edf0d1); }
.scene-head, .scene-caption { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.scene-head { padding: 22px 25px 8px; }
.scene-type { padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.68); color: var(--green-dark); font-size: 12px; font-weight: 900; }
.scene-cue { color: #517365; font-size: 12px; font-weight: 800; }
.scene-surface { position: relative; width: 100%; min-height: 0; flex: 1; aspect-ratio: 900 / 620; overflow: hidden; isolation: isolate; }
#sceneCanvas, #pixiCanvas, #worldCanvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
#pixiCanvas { z-index: 2; }
#worldCanvas { z-index: 2; cursor: grab; touch-action: none; }
#worldCanvas.is-dragging { cursor: grabbing; }
.world-view-button { position: absolute; z-index: 4; right: 16px; top: 14px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; background: rgba(21,67,57,.76); color: #fff8e9; font-size: 11px; font-weight: 800; cursor: pointer; backdrop-filter: blur(8px); }
.world-controls-hint { position: absolute; z-index: 4; right: 18px; bottom: 13px; padding: 6px 10px; border-radius: 999px; background: rgba(17,51,42,.65); color: #fff8e9; backdrop-filter: blur(8px); font-size: 10px; font-weight: 800; pointer-events: none; }
.controls-mobile { display: none; }
.render-badge { position: absolute; z-index: 4; left: 24px; bottom: 13px; padding: 6px 8px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; background: rgba(17,51,42,.58); color: rgba(255,255,255,.82); backdrop-filter: blur(8px); font: 800 9px/1 ui-monospace, monospace; letter-spacing: .1em; pointer-events: none; }
.scene-caption { min-height: 59px; padding: 12px 25px 18px; color: #527063; font-size: 12px; }
.count-proof { color: var(--green-dark); font-weight: 900; }
.answer-card { padding: clamp(28px, 4vw, 48px); background: var(--cream); display: flex; }
.question-state, .reveal-state { width: 100%; display: flex; flex-direction: column; }
.question-state h2, .reveal-state h2 { margin: 18px 0 14px; font-size: clamp(33px, 4.2vw, 54px); line-height: 1.05; letter-spacing: -.055em; }
.question-copy { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
#guessForm { margin-top: auto; padding-top: 35px; }
#guessForm label { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 900; }
.number-field { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 2px solid #d9e4da; border-radius: 16px; background: #f2f5ed; transition: border .15s, box-shadow .15s; }
.number-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(35,112,90,.09); }
.number-field.error { border-color: #bc5c43; }
.number-field input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 28px; font-weight: 900; }
.number-field input::placeholder { color: #9aaba2; font-size: 17px; font-weight: 700; }
.number-field span { color: var(--muted); font-weight: 800; white-space: nowrap; }
.input-error { min-height: 18px; margin: 7px 2px 0; color: #a84934; font-size: 12px; font-weight: 700; }
.submit-button { width: 100%; margin-top: 8px; font-size: 15px; }
.submit-button:disabled { cursor: wait; opacity: .6; transform: none; }
.input-help { margin: 11px 0 0; text-align: center; color: #85958e; font-size: 11px; }
.actual-row { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 4px; }
.actual-row strong { font-size: clamp(60px, 7vw, 92px); line-height: .9; letter-spacing: -.07em; }
.actual-row span { color: var(--muted); font-size: 18px; font-weight: 800; }
.reveal-state .verdict { margin-top: 22px; font-size: clamp(27px, 3vw, 38px); }
.explanation { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.challenge-compare { margin-top: 18px; padding: 14px; border: 1px solid #e3d3ab; border-radius: 14px; background: #fff8df; font-size: 13px; line-height: 1.65; }
.reveal-state .submit-button { margin-top: auto; }

.summary-screen { padding: clamp(42px, 8vh, 90px) 5vw 20px; }
.summary-heading { display: grid; grid-template-columns: .4fr 1fr; align-items: end; gap: 30px; }
.summary-heading h1 { margin: 0; font-size: clamp(48px, 6.5vw, 88px); }
.summary-grid { display: grid; grid-template-columns: 2.1fr repeat(3, 1fr); gap: 12px; margin-top: 48px; }
.summary-grid article { min-height: 160px; padding: 24px; border-radius: 22px; background: rgba(255,255,255,.66); border: 1px solid rgba(204,217,207,.8); }
.summary-grid span { color: var(--muted); font-size: 12px; font-weight: 800; }
.summary-grid strong { display: inline-block; margin-top: 19px; font-size: clamp(43px, 5vw, 70px); line-height: .9; letter-spacing: -.06em; }
.summary-feature { background: var(--green) !important; color: white; border-color: transparent !important; }
.summary-feature span, .summary-feature p { color: #d7e8e0; }
.summary-feature p { margin: 12px 0 0; font-size: 13px; }
.summary-stat small { margin-left: 5px; color: var(--muted); font-weight: 800; }
.summary-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.summary-actions p { flex-basis: 100%; }

dialog { width: min(590px, calc(100% - 30px)); padding: clamp(28px, 5vw, 50px); border: 0; border-radius: 26px; background: var(--cream); color: var(--ink); box-shadow: 0 30px 90px rgba(16,43,32,.28); }
dialog::backdrop { background: rgba(17,42,34,.48); backdrop-filter: blur(4px); }
dialog h2 { margin: 16px 0; font-size: 38px; letter-spacing: -.045em; }
dialog p, dialog li { color: var(--muted); line-height: 1.7; }
dialog ul { padding-left: 20px; }
dialog li + li { margin-top: 8px; }
.dialog-close { position: absolute; top: 15px; right: 17px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--mint); cursor: pointer; font-size: 24px; }
.dialog-note { padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; }

@media (max-width: 820px) {
  .shell { width: min(100% - 24px, 640px); padding-top: 12px; }
  .topbar { min-height: 40px; flex-wrap: wrap; gap: 5px 12px; }
  .top-actions { margin-left: auto; gap: 10px; }
  .top-actions .text-button { font-size: 12px; }
  .seed-pill { display: none; }
  .wordmark { max-width: 100%; }
  .intro-screen { min-height: calc(100vh - 72px); grid-template-columns: 1fr; align-content: center; padding: 5vh 10px; }
  .intro-copy h1 { font-size: clamp(50px, 16vw, 80px); }
  .intro-art { display: none; }
  .game-screen { padding-top: 18px; }
  .game-layout { grid-template-columns: 1fr; min-height: 0; }
  .scene-card { min-height: 0; border-radius: 24px; }
  .scene-surface { flex: none; aspect-ratio: 900 / 620; }
  .world-controls-hint { right: 8px; bottom: 8px; font-size: 10px; }
  .world-view-button { right: 9px; top: 9px; padding: 6px 9px; font-size: 10px; }
  .controls-desktop { display: none; }
  .controls-mobile { display: inline; }
  .scene-head { padding: 15px 16px 2px; }
  .scene-caption { min-height: 45px; padding: 6px 16px 12px; }
  .answer-card { min-height: 390px; padding: 27px 23px; border-radius: 24px; }
  .question-state h2 { font-size: clamp(31px, 9vw, 44px); }
  #guessForm { padding-top: 28px; }
  .summary-screen { padding: 48px 6px 20px; }
  .summary-heading { grid-template-columns: 1fr; gap: 15px; }
  .summary-heading h1 { font-size: clamp(48px, 14vw, 70px); }
  .summary-grid { grid-template-columns: repeat(3, 1fr); margin-top: 35px; }
  .summary-feature { grid-column: 1 / -1; min-height: 145px !important; }
  .summary-stat { min-height: 125px !important; padding: 18px 12px !important; }
  .summary-stat strong { font-size: clamp(37px, 11vw, 54px); }
  .summary-stat small { display: block; margin: 4px 0 0; }
  .summary-actions .button { width: 100%; }
}

@media (max-width: 420px) {
  .wordmark { font-size: 14px; }
  .intro-screen { padding-inline: 4px; }
  .intro-copy h1 { letter-spacing: -.08em; }
  .scene-caption { font-size: 10px; }
  .render-badge { left: 14px; bottom: 8px; font-size: 8px; }
  .count-proof { display: none; }
  .answer-card { min-height: 370px; }
  .actual-row strong { font-size: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
