:root { color-scheme: dark; font-family: "Trebuchet MS", Arial, sans-serif; background: #102d2c; color: #f9f4df; --safe-area-top: env(safe-area-inset-top, 0px); --safe-area-bottom: env(safe-area-inset-bottom, 0px); --safe-area-left: env(safe-area-inset-left, 0px); --safe-area-right: env(safe-area-inset-right, 0px); }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; padding-inline: var(--safe-area-left) var(--safe-area-right); background: radial-gradient(circle at 50% 0%, #295748 0, #102d2c 58%, #0a2325 100%); }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
.page { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: calc(24px + var(--safe-area-top)) 0 calc(20px + var(--safe-area-bottom)); }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 900; letter-spacing: .15em; white-space: nowrap; }
.brand em { font-style: normal; color: #eec578; }
.brand-mark { display: inline-grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; border: 2px solid #d5b96e; color: #f7d47f; font-size: 21px; }
.chapter, footer { color: #adccba; font-size: 11px; font-weight: 800; letter-spacing: .2em; }
.chapter span, footer span { color: #eec578; padding: 0 7px; }
.game-shell { padding: 9px; border: 1px solid #62816b; border-radius: 19px; background: #315948; box-shadow: 0 28px 80px #06161699, inset 0 1px #ffffff44; }
.game-topbar { height: 43px; display: flex; align-items: center; gap: 12px; padding: 0 8px 8px; }
.scene-pill { display: flex; align-items: center; gap: 8px; border: 1px solid #88a99088; background: #183c36; border-radius: 20px; padding: 6px 11px; color: #f9e6ad; font-size: 12px; font-weight: 800; letter-spacing: .05em; white-space: nowrap; }
.scene-dot { width: 8px; height: 8px; background: #f9ca6d; border-radius: 50%; box-shadow: 0 0 10px #f9ca6d; }
.status { flex: 1; text-align: center; color: #e6f0d6; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.exit-button { border: 1px solid #d9bd80; border-radius: 8px; background: #254c3c; color: #ffe5a5; padding: 7px 11px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.exit-button:hover, .exit-button:focus-visible { background: #456c51; }
.exit-button[hidden] { display: none; }
.icon-button { width: 30px; height: 30px; border: 1px solid #89ac93; border-radius: 50%; background: #173b36; color: #f5e5b4; font-size: 18px; line-height: 1; }
.icon-button:hover, .icon-button:focus-visible { background: #456c51; }
.canvas-wrap { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 11px; background: #b5d2b6; box-shadow: inset 0 0 0 1px #0b2424; }
canvas { display: block; width: 100%; height: 100%; }
.hearts { position: absolute; top: 3%; left: 2%; display: flex; gap: 6px; pointer-events: none; }
.heart { color: #f47764; font-size: clamp(19px, 2.3vw, 29px); text-shadow: 0 2px #713f36, 0 3px 8px #082a2480; }
.heart.empty { color: #d5e4c9; opacity: .65; }
.interaction { position: absolute; left: 50%; bottom: 10%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 8px 9px 8px 17px; border: 2px solid #edc887; border-radius: 13px; color: #f8f3d9; background: #173b36ee; box-shadow: 0 10px 24px #091a19aa; white-space: nowrap; font-weight: 800; font-size: 13px; }
.interaction[hidden] { display: none; }
.interaction button { border: 0; border-radius: 8px; background: #efc877; color: #213d35; padding: 8px 14px; font-size: 12px; font-weight: 900; }
.interaction button:hover { background: #ffe2a5; }
.toast { position: absolute; left: 50%; top: 16%; transform: translateX(-50%) translateY(-8px); max-width: 85%; padding: 11px 18px; border-radius: 12px; background: #173b36ed; color: #ffedbe; font-weight: 800; text-align: center; font-size: 14px; box-shadow: 0 6px 18px #0a272075; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; background: linear-gradient(90deg, #0b2525db, #102e2da3 64%, #102e2d70); }
.overlay[hidden] { display: none; }
.overlay-card { width: min(470px, 90%); max-height: 100%; overflow-y: auto; padding: 24px 28px 20px; border: 1px solid #f4dc9f70; border-radius: 17px; background: #123c38ed; box-shadow: 0 22px 65px #071d1b91, inset 0 0 0 5px #ffffff08; text-align: center; }
.eyebrow { color: #f4cf86; font-size: 11px; font-weight: 900; letter-spacing: .25em; }
.overlay h1 { margin: 9px 0 8px; font-family: Georgia, serif; font-size: clamp(35px, 5vw, 60px); line-height: .95; letter-spacing: -.05em; }
.overlay h1 i { color: #f2c979; font-weight: 500; }
.overlay p { max-width: 360px; margin: 14px auto 20px; font-size: 14px; line-height: 1.5; color: #e6f0dc; }
.primary-button { display: inline-flex; justify-content: center; align-items: center; gap: 20px; min-width: 190px; padding: 12px 19px; border: 0; border-radius: 9px; background: #f1c977; color: #203b33; font-weight: 900; box-shadow: 0 4px #bb9552; }
.primary-button:hover, .primary-button:focus-visible { background: #ffe0a0; transform: translateY(-1px); }
.secondary-button { display: block; margin: 13px auto 0; padding: 7px 12px; border: 1px solid #b9d2ae; border-radius: 8px; background: transparent; color: #e8f1d6; font-size: 12px; font-weight: 800; }
.secondary-button:hover, .secondary-button:focus-visible { background: #ffffff1c; }
.secondary-button[hidden] { display: none; }
.overlay-hint { margin-top: 23px; color: #bdceba; font-size: 10px; letter-spacing: .12em; }
.overlay-hint b { color: #ffdf9b; font-size: 11px; }
.under-game { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 13px 5px 23px; }
.tip { color: #d7e6cc; font-family: Georgia, serif; font-size: 15px; font-style: italic; }
.tip-star { color: #ebc77d; font-size: 21px; font-style: normal; margin-right: 5px; }
.keyboard-hint { color: #a9c4b1; font-size: 10px; font-weight: 900; letter-spacing: .12em; white-space: nowrap; }
.keyboard-hint span { margin-left: 13px; }
kbd { display: inline-grid; place-items: center; min-width: 21px; height: 20px; margin-left: 4px; border: 1px solid #88a991; border-radius: 4px; color: #f8e5ad; font: inherit; }
.touch-controls { display: none; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.touch-group { display: flex; gap: 10px; }
.touch-controls, .touch-button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
.touch-button { min-width: 62px; min-height: 58px; border: 2px solid #719377; border-radius: 14px; color: #ffe5a5; background: #244b40; font-weight: 900; font-size: 24px; }
.touch-button:active, .touch-button.pressed { background: #53734d; transform: translateY(2px); }
.touch-action { font-size: 12px; }
.touch-jump { min-width: 84px; font-size: 14px; background: #9a6841; border-color: #d4aa6c; }
footer { text-align: center; opacity: .75; margin: 0 0 7px; }
@media (pointer: coarse) { .game-topbar { min-height: 52px; } .exit-button, .icon-button { min-height: 44px; } .icon-button { width: 44px; flex: none; } .touch-controls { display: flex; } .keyboard-hint { display: none; } }
@media (max-width: 700px) { .page { width: min(100% - 16px, 1120px); padding-top: calc(11px + var(--safe-area-top)); } .masthead { margin: 0 4px 10px; } .brand { font-size: 14px; gap: 7px; } .brand-mark { width: 26px; height: 26px; font-size: 17px; } .chapter { display: none; } .game-shell { padding: 5px; border-radius: 12px; } .game-topbar { height: 36px; gap: 6px; } .scene-pill { font-size: 9px; padding: 5px 7px; } .status { font-size: 8px; } .exit-button { padding: 5px 7px; font-size: 10px; } .overlay-card { padding: 15px; } .overlay p { font-size: 11px; margin: 7px auto 11px; } .overlay h1 { margin: 5px 0; } .overlay-hint { margin-top: 12px; font-size: 8px; } .eyebrow { font-size: 8px; } .primary-button { padding: 8px 12px; } .under-game { margin: 10px 4px 17px; } .tip { font-size: 13px; } footer { font-size: 8px; } .interaction { bottom: 4%; font-size: 10px; } }
@media (max-width: 480px) { .status { display: none; } .scene-pill { flex: 1; } .overlay h1 { font-size: 28px; } .overlay-card { width: 88%; padding: 10px; } .overlay p { display: block; font-size: 10px; line-height: 1.25; margin: 5px auto 8px; } .overlay-hint { display: none; } .primary-button { font-size: 11px; min-width: 0; } .secondary-button { margin-top: 7px; padding: 4px 8px; font-size: 10px; } .interaction { padding: 4px 5px 4px 9px; } .interaction button { padding: 5px 7px; font-size: 9px; } .touch-button { min-width: 55px; min-height: 52px; } }
@media (max-width: 480px) and (pointer: coarse) { .canvas-wrap:has(.overlay:not([hidden])) { width: 100%; height: 260px; aspect-ratio: auto; } .canvas-wrap:has(.overlay:not([hidden])) canvas { object-fit: cover; } .primary-button, .secondary-button, .interaction button { min-height: 44px; } }
