:root { font-family: "Segoe UI", "Yu Gothic", Meiryo, sans-serif; color: #263e3b; background: #f6f3e9; font-synthesis: none; color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
.viewport { position: fixed; top: env(safe-area-inset-top, 0px); right: env(safe-area-inset-right, 0px); bottom: env(safe-area-inset-bottom, 0px); left: env(safe-area-inset-left, 0px); overflow: hidden; }
button, a, [role="button"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-underline-offset: 4px; }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible { outline: 3px solid #c45c21; outline-offset: 3px; }
[hidden] { display: none !important; }
.app { position: absolute; left: 50%; top: 50%; width: 390px; height: 780px; padding: 0 12px; display: flex; flex-direction: column; background: #f6f3e9; transform: translate(-50%, -50%) scale(var(--game-scale, 1)); transform-origin: center; visibility: hidden; }
.app[data-ready] { visibility: visible; }
.topbar { flex-shrink: 0; height: 40px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #dbdfd2; font-size: 10px; letter-spacing: .06em; }
.topbar a { padding: 12px 0; font-weight: 700; }
.screen { flex: 1; min-height: 0; }
.intro, .result { text-align: center; align-self: center; width: 100%; padding: 32px 0; }
.intro-art { display: flex; justify-content: center; gap: 10px; }
.intro-art span { display: grid; place-items: center; width: 54px; height: 44px; border-radius: 12px; background: #d3e4c4; color: #3e674d; font-weight: 800; }
.intro-art span:nth-child(2) { background: #d7e5e7; color: #43656d; transform: rotate(-5deg); }
.intro-art span:nth-child(3) { background: #f3d6b8; color: #805639; transform: rotate(5deg); }
.eyebrow { font-weight: 700; font-size: 12px; letter-spacing: .14em; margin: 22px 0 10px; }
h1 { font-size: 52px; line-height: 1.12; margin: 12px 0 22px; letter-spacing: -.05em; }
h1 em { font-style: normal; color: #237b64; }
.intro p { line-height: 1.7; }
.instructions { font-size: 13px; color: #58685d; margin: 20px 0; }
.primary { border: 0; border-radius: 12px; background: #256e58; color: white; padding: 18px 22px; min-height: 56px; width: 100%; display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.primary:hover { background: #195740; }
.primary span { font-size: 12px; }
.play { display: flex; flex-direction: column; padding: 8px 0; }
.hud { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; flex-shrink: 0; }
.hud > div { display: flex; flex-direction: column; align-items: center; }
.hud > div > span { font-size: 11px; font-weight: 700; color: #53675a; }
.hud strong { font-size: 25px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.hud small { font-size: 13px; margin-left: 4px; }
.time-stat { color: #256e58; }
.timer-track { height: 5px; background: #dfe4d8; border-radius: 5px; overflow: hidden; margin: 5px 0; flex-shrink: 0; }
#timer-fill { height: 100%; width: 100%; background: #338b6e; transform-origin: left; }
.urgent .time-stat { color: #af3c29; }
.urgent #timer-fill { background: #c24d35; }
.play-caption { display: flex; justify-content: space-between; margin: 3px 0 6px; font-size: 12px; flex-shrink: 0; }
#question { color: #657463; font-variant-numeric: tabular-nums; }
.scenes { display: grid; grid-template-columns: 1fr; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 6px; flex: 1; min-height: 0; }
.scene { border: 2px solid #d3dbca; border-radius: 14px; overflow: hidden; background: #fffdf7; min-width: 0; max-height: 100%; display: flex; flex-direction: column; }
.scene h2 { margin: 0; padding: 3px 10px; font-size: 11px; display: flex; justify-content: space-between; flex-shrink: 0; }
.scene h2 span { color: #78816e; font-size: 11px; }
.scene svg { display: block; width: 100%; min-height: 0; height: 0; flex: 1; user-select: none; }
.scene [role="button"] { cursor: pointer; outline-offset: -3px; }
.scene.correct { border-color: #238463; }
.scene.wrong { border-color: #c04c35; }
.answer-ring { fill: none; stroke: #177b52; stroke-width: 4; pointer-events: none; }
.feedback { height: 36px; line-height: 18px; margin: 6px 0 0; text-align: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.feedback.good { color: #1c7352; }
.feedback.bad { color: #ad382a; }
.result h2 { font-size: 24px; margin: 12px 0; }
.rank { display: grid; place-items: center; margin: 20px auto 8px; width: 92px; height: 92px; background: #f4cf76; border-radius: 50%; font-size: 60px; font-weight: 800; }
#rank-message { font-size: 14px; }
.result-score span { display: block; font-size: 12px; }
.result-score strong { font-size: 46px; font-variant-numeric: tabular-nums; }
.result-stats { display: flex; justify-content: center; gap: 64px; margin-bottom: 20px; }
.result-stats p { font-size: 12px; margin: 6px 0; }
.result-stats strong { display: block; font-size: 24px; }
.back-link { display: inline-block; margin: 18px 0; font-size: 13px; }
