:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #294f3b; background: #f8f6eb; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#game-shell { position: absolute; inset: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); overflow: hidden; touch-action: none; }
#game-canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.overlay { position: fixed; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px)); background: #f8f6eb; overflow-y: auto; touch-action: pan-y; }
.overlay[hidden], [hidden] { display: none !important; }
.card { width: 100%; max-width: 430px; max-height: 100%; overflow-y: auto; text-align: center; }
.card img { border-radius: 24px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .22em; color: #6a9073; margin: 24px 0 12px; }
h1, h2 { font-size: clamp(24px, 5vw, 32px); line-height: 1.15; margin: 0 0 18px; font-weight: 750; letter-spacing: -.035em; }
p { font-size: 16px; line-height: 1.5; margin: 0 0 16px; }
.hint { font-size: 13px; color: #5b7d64; margin-top: 20px; }
.credits { font-size: 12px; line-height: 1.5; color: #5b7d64; margin: 18px 0 0; }
progress { width: min(230px, 100%); height: 7px; border: 0; border-radius: 20px; overflow: hidden; accent-color: #78ad71; background: #e0e9d8; }
progress::-webkit-progress-bar { background: #e0e9d8; border-radius: 20px; }
progress::-webkit-progress-value { background: #78ad71; border-radius: 20px; }
progress::-moz-progress-bar { background: #78ad71; border-radius: 20px; }
button { min-height: 44px; padding: 10px 24px; border: 0; border-radius: 24px; color: white; background: #477e55; font: inherit; cursor: pointer; }
button:focus-visible, summary:focus-visible { outline: 3px solid #477e55; outline-offset: 3px; }
/* The collapsed control fits entirely inside the existing 48px game header. */
#about { position: fixed; z-index: 1; top: calc(env(safe-area-inset-top, 0px) + 2px); right: calc(env(safe-area-inset-right, 0px) + 4px); touch-action: manipulation; }
#about > summary { display: flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 12px; border: 1px solid #dce5d5; border-radius: 22px; background: #fffdf2; color: #477356; font-size: 13px; font-weight: 600; list-style: none; cursor: pointer; }
#about > summary::-webkit-details-marker { display: none; }
#about[open] > summary { background: #e2edd9; }
.about-card { position: absolute; top: 48px; right: 0; width: min(340px, calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 28px)); max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 80px); padding: 20px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; border: 1px solid #dce5d5; border-radius: 20px; background: #fffdf7; box-shadow: 0 12px 36px #294f3b24; }
.about-card .eyebrow { margin: 0 0 10px; }
.about-card h2 { font-size: 23px; margin-bottom: 12px; }
.about-card p:not(.eyebrow):not(.credits) { font-size: 14px; margin-bottom: 0; }
.about-card .credits { padding-top: 14px; border-top: 1px solid #e1e8db; }
#error-details { margin-top: 14px; text-align: left; font-size: 12px; color: #5b7d64; }
#error-details > summary { display: list-item; min-height: 44px; padding: 14px 4px; cursor: pointer; }
#error-message { max-height: 120px; margin: 0; padding: 12px; border: 1px solid #dce5d5; border-radius: 12px; background: #eff2e7; color: #294f3b; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; -webkit-user-select: text; user-select: text; touch-action: pan-y; }
noscript { position: fixed; z-index: 4; inset: 0; display: grid; place-items: center; padding: 24px; background: #f8f6eb; text-align: center; }
@media (max-height: 430px) and (orientation: landscape) { .card img { width: 44px; height: 44px; border-radius: 14px; } .eyebrow { margin: 8px 0; } h1 { font-size: 25px; margin-bottom: 10px; } #loading-message { font-size: 14px; margin-bottom: 10px; } .hint { margin: 10px 0 0; } .credits { margin-top: 12px; font-size: 11px; } .about-card { padding: 16px; } .about-card h2 { font-size: 20px; } }

#sound-toggle { display: block; margin: 0 0 16px; padding: 0 16px; min-height: 44px; background: #e2edd9; color: #294f3b; font-size: 14px; touch-action: manipulation; }

/* Keep the complete reference image visible in either phone orientation. */
.welcome-card { max-width: 1000px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
.card .welcome-art { display: block; width: 100%; height: auto; max-height: calc(100dvh - 48px); object-fit: contain; border-radius: 24px; }
.welcome-copy .eyebrow { margin-top: 0; }
.welcome-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin: 18px 0 0; }
.sound-button { color: #294f3b; background: #e2edd9; font-size: 14px; }
@media (orientation: portrait) {
  .welcome-card { max-width: 500px; grid-template-columns: 1fr; gap: 20px; }
  .card .welcome-art { max-height: 45dvh; width: auto; max-width: 100%; justify-self: center; }
  .welcome-copy h1 { margin-bottom: 10px; }
  .welcome-copy .hint { margin-top: 12px; }
}
@media (max-height: 430px) and (orientation: landscape) {
  .welcome-card { gap: 24px; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); }
  .card .welcome-art { max-height: calc(100dvh - 40px); border-radius: 20px; }
  .welcome-actions { margin-top: 12px; }
}
