:root { color-scheme: light; --ink: #162f26; --green: #315b3e; --paper: #fbf6e7; --line: #bba47c; --vermillion: #c9512f; font-family: Meiryo, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; color: var(--ink); background: #e9e3d3; font-size: 18px; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { color: var(--ink); cursor: pointer; border: 2px solid var(--line); border-radius: 12px; min-height: 52px; padding: 8px 16px; font-weight: 700; touch-action: manipulation; }
button:hover { filter: brightness(.97); }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible { outline: 3px solid #87451d; outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
p, h1, h2 { margin: 0; }
.app { max-width: 440px; min-height: 100svh; margin: 0 auto; padding: 22px 18px 24px; background: var(--paper) url('./assets/garden-paper.png') center top / 100% 100% no-repeat; box-shadow: 0 0 35px #403b2720; }
.brand { text-align: center; }
.brand h1 { font-size: clamp(38px, 12vw, 48px); font-weight: 900; letter-spacing: -.05em; line-height: 1.3; }
.wood { background: #ebca91 url('./assets/wood.png') center / cover; border-color: #b78b54; box-shadow: inset 0 0 0 2px #fff5d640, 0 2px 2px #4f34151c; }
.subtitle { display: inline-block; margin-top: 5px; padding: 3px 22px; font-size: 20px; font-weight: 700; border: 1px solid #b78b54; border-radius: 5px; letter-spacing: .08em; }
.garden { display: block; width: calc(100% + 36px); max-width: none; margin-left: -18px; object-fit: cover; }
.hero { height: 174px; margin-top: 5px; }
.intro { text-align: center; font-size: 18px; line-height: 1.6; margin: 8px -4px 12px; }
.courses { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.course { display: flex; align-items: center; gap: 16px; min-height: 78px; border: 2px solid #d1b98e; border-radius: 10px; padding: 8px 16px; background: #fffbeded; cursor: pointer; }
.course:has(input:checked) { border-color: var(--green); background-color: #f4f6e8f5; box-shadow: inset 0 0 0 1px var(--green); }
.course:focus-within { outline: 3px solid #87451d; outline-offset: 2px; }
.course input { width: 26px; height: 26px; margin: 0; accent-color: var(--green); flex: none; }
.course strong { display: block; font-size: 24px; line-height: 1.25; }
.course span span { font-size: 18px; }
.course-mark { margin-left: auto; width: 52px; height: 52px; object-fit: contain; }
.best { text-align: center; border-top: 1px solid #bba47c; margin-top: 12px; padding: 8px 0 10px; }
.best-time { font-size: 36px; line-height: 1.25; font-weight: 800; font-variant-numeric: tabular-nums; }
.best-pair { display: grid; grid-template-columns: 1fr 1fr; margin-top: 8px; gap: 8px; }
.best-pair span { font-size: 15px; }
.best-pair .best-time { font-size: 28px; }
.settings-panel { background: #fffbed; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.settings-panel summary { cursor: pointer; min-height: 36px; padding: 6px 0; font-size: 16px; }
.setting { display: flex; align-items: center; gap: 12px; text-align: left; min-height: 48px; cursor: pointer; }
.setting input { width: 24px; height: 24px; accent-color: var(--green); flex: none; }
.play-note { text-align: center; margin-bottom: 10px; }
#pause-settings { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.item-count { text-align: center; font-weight: 700; }
.pickup { min-height: 52px; display: flex; gap: 6px; justify-content: center; align-items: center; margin: 6px 0; color: #79451d; }
.pickup p { font-size: 16px; }
#pickup-icon svg { display: block; width: 32px; height: 32px; }
.instructions { margin-top: 10px; }
.score-card { background: #fff9e9; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 12px; }
.score-total { font-size: 42px; font-weight: 900; color: #95422b; font-variant-numeric: tabular-nums; }
#score-parts { margin: 12px 0 0; font-size: 16px; }
#score-parts div { display: flex; justify-content: space-between; gap: 6px; padding: 4px 0; border-top: 1px solid #d7c6a1; }
#score-parts dd { margin: 0; }
.best-stamps { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.best-stamps span { color: #a9442c; border: 2px solid currentColor; border-radius: 4px; padding: 4px 8px; font-size: 16px; font-weight: 700; }
#result-screen { position: relative; }
#celebration { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#celebration img { position: absolute; width: 40px; height: 40px; top: 10%; left: 2%; opacity: 0; }
#celebration img:nth-child(2) { left: auto; right: 2%; top: 18%; }
#celebration img:nth-child(3) { top: 35%; }
.reduced-motion button:active { transform: none; }
.note { font-size: 14px; margin-top: 4px; }
.primary { width: 100%; min-height: 60px; font-size: 22px; }
.secondary { background: #fffcf0ed; border-color: #647255; width: 100%; }
.game-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fbf6e7ed; border-radius: 8px; }
.game-header h1 { font-size: 20px; }
.game-header button { min-height: 46px; padding: 5px 18px; }
.clock { text-align: center; margin: 4px 0 10px; }
#timer { font-size: 40px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.clock p + p { font-size: 14px; }
.maze-frame { border: 5px solid #8e714b; outline: 1px solid #685539; border-radius: 2px; background: #fdf9e9; box-shadow: 0 3px 4px #3c2d1f26; }
#maze { display: block; width: 100%; height: auto; background: #fffbed; }
.maze-wall { stroke: #304d31; stroke-width: 2.3px; vector-effect: non-scaling-stroke; stroke-linecap: square; fill: none; }
.maze-footprint { fill: #a6b493; }
.maze-trace { stroke: #d0ad6b; stroke-width: .25; stroke-linecap: round; fill: none; opacity: .65; }
.maze-player { fill: var(--vermillion); stroke: #352b22; stroke-width: .065; }
.maze-start { fill: #fffbed; stroke: #34563d; stroke-width: .07; }
.legend { display: flex; justify-content: center; gap: 22px; margin: 8px 0; font-size: 15px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.player-dot { width: 17px; height: 17px; border-radius: 50%; border: 2px solid #352b22; background: var(--vermillion); }
.instructions { font-size: 16px; text-align: center; line-height: 1.45; }
.move-status { text-align: center; min-height: 26px; font-size: 16px; color: #624222; font-weight: 700; margin-top: 3px; }
.direction-pad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 56px); justify-content: center; gap: 4px 8px; margin: 4px auto 12px; }
.direction { padding: 0; min-height: 56px; font-family: sans-serif; font-size: 40px; line-height: 1; }
.up { grid-area: 1 / 2; }.left { grid-area: 2 / 1; }.right { grid-area: 2 / 3; }.down { grid-area: 3 / 2; }
.direction[aria-disabled="true"] { background-color: #e5dccb; background-image: none; color: #7c776d; border-color: #b3a58e; box-shadow: none; }
.direction.is-hint { outline: 4px solid #ad5c1b; outline-offset: 2px; }
#result-screen { text-align: center; padding-top: 25px; }
#result-heading { font-size: clamp(26px, 8.5vw, 36px); letter-spacing: -.04em; }
.result-garden { height: 245px; margin-top: 10px; margin-bottom: 12px; }
.result-course { font-size: 22px; font-weight: 700; }
.result-label { margin-top: 16px; font-size: 21px; font-weight: 700; }
.result-time { font-size: 76px; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
#result-hint { margin-top: 5px; }
.result-message { min-height: 58px; margin: 16px 0; padding-top: 12px; border-top: 1px solid #bba47c; color: #285d3e; font-weight: 700; font-size: 23px; }
.result-actions { display: grid; gap: 12px; }
.result-actions .primary { font-size: 20px; }
dialog { width: min(360px, calc(100% - 32px)); max-height: calc(100svh - 32px); overflow: auto; color: var(--ink); background: #fbf6e7; border: 2px solid #987b50; border-radius: 16px; padding: 28px 22px; text-align: center; box-shadow: 0 10px 50px #0004; }
dialog::backdrop { background: #203428; }
dialog h2 { font-size: 26px; margin-bottom: 12px; }
dialog p { line-height: 1.6; margin-bottom: 16px; }
dialog button { margin-top: 10px; }
.eyebrow { color: #6e6d49; font-size: 16px; }
.notice { font-size: 16px; background: #fff4d5; border: 1px solid #9a682f; padding: 12px; margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-width: 600px) { .app { margin: 24px auto; min-height: calc(100svh - 48px); border: 1px solid #c5bda9; border-radius: 18px; } }
@media (max-width: 350px) { .app { padding-inline: 14px; }.garden { width: calc(100% + 28px); margin-left: -14px; }.hero { height: 145px; }.course { gap: 10px; padding-inline: 12px; }.course-mark { display: none; }.game-header h1 { font-size: 18px; }.result-actions .primary { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { button:active { transform: none; } }
