* { box-sizing: border-box; }
html { color-scheme: light; background: #f5f6f8; }
body { margin: 0; color: #000; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
.games { max-width: 680px; padding: 14px 16px 20px; margin: auto; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
h1 { margin: 0; font-size: 26px; }
#sound { font-size: 13px; min-height: 44px; padding: 8px 12px; }
button { color: #000; background: #e2e8f0; border: 1px solid #000; border-radius: 14px; min-height: 48px; padding: 10px 14px; font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1.3; cursor: pointer; touch-action: manipulation; }
button:hover { background: #d5dce6; }
button:focus-visible, input:focus-visible, canvas:focus-visible { outline: 3px solid #000; outline-offset: 3px; }
button[aria-pressed="true"] { background: #ede4f5; box-shadow: inset 0 0 0 1px #000; }
.game-picker { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.game-picker > * { flex: 0 0 94px; }
.game-picker .cosmic-link { background: #d4dfef; }
.arcade-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #000; text-align: center; text-decoration: none; border: 1px solid #000; border-radius: 14px; padding: 6px 3px; background: #d5e6df; font-size: 13px; font-weight: 750; min-height: 48px; }
.arcade-link:nth-child(2) { background: #d9e2f0; }
.arcade-link small { font-size: 9px; font-weight: 500; }
.arcade-link:focus-visible { outline: 3px solid #000; outline-offset: 2px; }
.game-picker button { padding: 6px; font-size: 13px; min-height: 68px; }
.game-picker span { display: block; font-size: 24px; line-height: 1.1; margin-bottom: 3px; }
h2 { font-size: 21px; margin: 0 0 4px; }
#instructions { margin: 0 0 8px; font-size: 14px; }
.score { font-weight: 700; text-align: center; margin: 6px 0; font-variant-numeric: tabular-nums; }
.board { position: relative; width: 100%; max-width: 400px; margin: auto; border-radius: 16px; overflow: hidden; border: 2px solid #000; }
#court { display: block; width: 100%; height: auto; max-height: 360px; touch-action: none; background: #145956; }
.overlay { pointer-events: none; position: absolute; inset: 30% 8% auto; display: grid; gap: 4px; padding: 16px 10px; border: 1px solid #000; border-radius: 14px; background: #fffffff0; text-align: center; }
.overlay strong { font-size: 22px; }
.overlay span { font-size: 14px; }
.actions { display: flex; gap: 8px; margin: 10px auto 8px; max-width: 400px; }
.actions button { flex: 1; }
.steering { display: grid; gap: 0; font-size: 12px; max-width: 400px; margin: auto; }
input[type="range"] { accent-color: #000; width: 100%; min-height: 40px; margin: 0; cursor: ew-resize; }
.hint { font-size: 12px; margin: 4px 0 0; text-align: center; }
#story-art { display: block; width: 100%; height: auto; max-height: 235px; border: 1px solid #000; border-radius: 16px; background: #dce9f2; margin: 12px 0; }
h3 { margin: 8px 0; font-size: 22px; }
#story-text { line-height: 1.6; margin: 6px 0; }
.inventory { font-size: 13px; background: #fff; border: 1px solid #000; border-radius: 8px; padding: 8px 10px; }
.choices { display: grid; gap: 8px; margin: 14px 0; }
.choices button { text-align: left; background: #fff; }
#story-restart { font-size: 13px; margin-top: 8px; }
.episode-list { display: grid; gap: 14px; margin: 16px 0; }
.episode-card { display: grid; gap: 6px; width: 100%; text-align: left; padding: 16px; background: #fff; }
.episode-card strong { font-size: 20px; }
.episode-number, .episode-status { font-size: 13px; }
.episode-description { font-weight: 400; line-height: 1.5; }
.episode-status { margin-top: 4px; text-decoration: underline; }
.story-toolbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 6px 0; background: #f5f6f8; border-bottom: 1px solid #cbd5e1; }
.story-toolbar button { flex: none; font-size: 13px; }
#story-chapter { font-size: 13px; font-weight: 600; }
#scene-title { scroll-margin-top: 100px; }
#story-text p { margin: 0 0 14px; }
.story-save-status { font-size: 12px; }
.restart-confirm { padding: 12px; margin-top: 12px; border: 1px solid #000; border-radius: 10px; background: #fff; }
.restart-confirm button { margin: 4px 4px 0 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 360px) { .games { padding: 10px; } .game-picker { gap: 5px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
