:root { color-scheme: dark; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #f0f6ee; background: #0d1912; --muted: #a3b9a8; --line: #2c4433; --lime: #c7f574; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body { background: #000; }
#app, #game-container { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#game-container canvas { display: block; touch-action: none; }
[hidden], .scene-hidden { display: none !important; }
button, select, input { font: inherit; }
button { min-height: 48px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 12px; background: #223c2b; color: inherit; font-weight: 650; cursor: pointer; touch-action: manipulation; }
button:hover { border-color: #84a67c; }
button:disabled { opacity: .45; cursor: default; }
:where(button, select, input, a, [tabindex]):focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
button svg { width: 24px; height: 24px; }
a { color: var(--lime); text-underline-offset: 4px; }
h1, h2, p, figure { margin: 0; }
h1 { font-size: clamp(30px, 5vw, 40px); line-height: 1.15; letter-spacing: -1.4px; font-weight: 800; }
h2 { font-size: 17px; letter-spacing: -.25px; }
#menu-shell { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 0, #263e2b 0, #14261b 40%, #0d1912 85%); }
#menu-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-color: #48634e #14261b; }
.menu-content { width: min(100%, 680px); margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 28px max(20px, env(safe-area-inset-left)); }
.menu-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 30px; }
.wordmark { display: flex; align-items: center; gap: 9px; letter-spacing: 2.5px; font-size: 14px; font-weight: 850; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; background: var(--lime); color: #213523; border-radius: 10px; font-size: 25px; font-style: italic; letter-spacing: -2px; padding-right: 3px; }
.quiet-button { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-color: transparent; color: #c1d3bc; background: transparent; font-size: 13px; }
.quiet-button > span { font-size: 25px; color: var(--lime); }
.page-heading { margin-bottom: 22px; }
.eyebrow { display: block; font-size: 10px; font-weight: 800; letter-spacing: 1.8px; color: #a9c593; }
.page-heading .eyebrow { margin-bottom: 10px; }
.page-heading > p:last-child { margin-top: 9px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.preview-card { overflow: hidden; border: 1px solid #486648; border-radius: 20px; background: #203a29; box-shadow: 0 8px 30px #07120b33; margin-bottom: 22px; }
#snake-preview { width: 100%; height: auto; min-height: 126px; max-height: 210px; display: block; object-fit: cover; }
.preview-card figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: 12px; color: #bbcfb9; }
.preview-card figcaption > span:first-child { display: flex; align-items: center; gap: 7px; }
#preview-detail { font-weight: 650; text-align: right; color: #e1ecd8; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
[role="tabpanel"] { outline-offset: -3px; }
.primary-button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 60px; color: #1e331d; background: var(--lime); border-color: var(--lime); border-radius: 16px; font-size: 21px; font-weight: 800; box-shadow: 0 4px 0 #80ac44; }
.primary-button:hover { background: #d8ffa2; border-color: #d8ffa2; }
.primary-button:active { transform: translateY(2px); box-shadow: 0 2px 0 #80ac44; }
.play-hint { font-size: 12px; color: var(--muted); text-align: center; margin: 18px 0 24px; }
.run-summary { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #192c20; }
.run-summary > div { display: flex; flex-direction: column; gap: 7px; }
.run-summary strong { font-size: 19px; }
.run-summary span:last-child { font-size: 12px; color: var(--muted); }
.best-score { padding-left: 20px; border-left: 1px solid var(--line); }
.best-score strong { color: var(--lime); font-size: 24px; line-height: 1; }
#pwa-tools { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 22px; }
#offline-status { color: #95ad93; font-size: 11px; }
#offline-status:empty { display: none; }
.secondary-button { background: #233e2c; border-color: #3d5b43; font-size: 14px; }
#install-button { min-height: 44px; background: transparent; border-color: #36503c; }
.settings-group { border: 1px solid var(--line); background: #192c20; border-radius: 16px; margin-bottom: 16px; overflow: hidden; }
.settings-group > h2 { padding: 18px 18px 8px; color: var(--lime); font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px; }
.setting-row { margin: 0 18px; padding: 15px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 70px; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-row label, .setting-row strong { font-size: 14px; font-weight: 650; }
.setting-row p, .setting-row small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 4px; font-weight: 400; }
select { min-height: 44px; max-width: 50%; padding: 10px 28px 10px 12px; border: 1px solid #405b45; border-radius: 10px; background: #213b2a; color: #f0f6ee; font-size: 14px; cursor: pointer; }
select:disabled { opacity: .45; }
.stepper { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.stepper button { width: 44px; min-height: 44px; padding: 0; font-size: 23px; background: #294631; }
.stepper output { display: block; width: 28px; text-align: center; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.toggle-row { cursor: pointer; }
input[role="switch"] { appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 50px; height: 32px; margin: 4px 0; border: 1px solid #526859; border-radius: 20px; background: #354b3b; cursor: pointer; position: relative; }
input[role="switch"]::before { content: ''; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #c2cdc1; transition: transform .15s; }
input[role="switch"]:checked { background: var(--lime); border-color: var(--lime); }
input[role="switch"]:checked::before { background: #273d23; transform: translateX(18px); }
.app-row { flex-wrap: wrap; }
.text-button { background: transparent; border-color: transparent; padding: 8px 0; font-size: 13px; }
.danger-button { color: #f0aa9c; }
#settings-message:empty { display: none; }
#settings-message { padding: 0 18px 16px; color: var(--lime); font-size: 13px; }
.creator-links { text-align: center; color: var(--muted); font-size: 12px; margin-top: 24px; }
.creator-links a { display: inline-block; min-height: 44px; padding: 14px 12px; font-size: 13px; }
.section-heading { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.section-heading > span { color: var(--muted); font-size: 11px; }
.skin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.skin-card { position: relative; padding: 15px 6px 13px; min-width: 0; border-radius: 14px; background: #1c3123; border: 1px solid #344d3b; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 7px; }
.skin-card canvas { width: 100%; height: auto; max-width: 148px; }
.skin-card > span:not(.skin-check) { font-size: 11px; font-weight: 600; line-height: 1.35; }
.skin-card[aria-pressed="true"] { border-color: var(--lime); background: #30472a; box-shadow: inset 0 0 0 1px var(--lime); }
.skin-check { display: none; position: absolute; top: 6px; right: 6px; border-radius: 50%; background: var(--lime); color: #1e331d; width: 16px; height: 16px; font-size: 11px; line-height: 16px; }
.skin-card[aria-pressed="true"] .skin-check { display: block; }
.color-group { padding: 18px; }
.color-group .section-heading { margin-bottom: 8px; }
#color-help { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 14px; }
.color-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.color-swatch { min-height: 44px; padding: 4px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; border-radius: 50%; }
.color-swatch > span { display: grid; place-items: center; width: 26px; height: 26px; background: var(--swatch); color: transparent; border-radius: 50%; font-size: 16px; }
.color-swatch[aria-pressed="true"] { border-color: var(--lime); }
.color-swatch[aria-pressed="true"] > span { color: #182b1b; }
.bottom-nav { flex: 0 0 auto; border-top: 1px solid #314636; padding: 8px max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); background: #14231a; box-shadow: 0 -8px 30px #08100b44; }
.bottom-nav > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 640px; margin: 0 auto; }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 58px; padding: 7px 12px; border-color: transparent; border-radius: 14px; background: transparent; color: #90a795; font-size: 11px; }
.bottom-nav button[aria-selected="true"] { color: var(--lime); background: #2a4028; }
.bottom-nav button:hover { background: #223729; }
.bottom-nav svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#update-notice { position: fixed; z-index: 20; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(440px, calc(100% - 32px)); padding: 20px; border: 1px solid #699d6c; border-radius: 16px; background: #142219; box-shadow: 0 12px 40px #0009; line-height: 1.5; }
.menu-open #update-notice { bottom: calc(88px + env(safe-area-inset-bottom)); }
#update-notice p { margin-bottom: 12px; }
dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 24px; border: 1px solid #699d6c; border-radius: 20px; color: #fff; background: #142219; box-shadow: 0 12px 60px #0008; touch-action: pan-y; line-height: 1.5; }
dialog::backdrop { background: #000b; }
dialog h2 { margin-bottom: 12px; font-size: 24px; }
dialog ol { padding-left: 24px; margin: 20px 0 0; }
dialog li { padding-left: 6px; margin-bottom: 16px; }
dialog li::marker { color: var(--lime); font-weight: bold; }
#install-guide-note, .muted { color: var(--muted); font-size: 14px; }
#install-guide-close, #scores-close { width: 100%; margin-top: 20px; }
#scores-list { margin-top: 16px; }
.score-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.score-row strong { color: var(--lime); font-size: 20px; }
@media (min-width: 600px) { .menu-content { padding-top: 28px; } .skin-card { padding: 18px 10px; } .skin-card > span:not(.skin-check) { font-size: 13px; } .color-grid { grid-template-columns: repeat(8, 44px); justify-content: space-between; } }
@media (max-width: 359px) { .menu-content { padding-left: 14px; padding-right: 14px; } .run-summary { padding: 15px; gap: 10px; } .best-score { padding-left: 12px; } .run-summary .eyebrow { font-size: 9px; letter-spacing: 1px; } .skin-grid { gap: 7px; } .color-grid { grid-template-columns: repeat(4, 1fr); } .setting-row { margin: 0 14px; gap: 8px; } }
@media (max-height: 600px) and (min-width: 600px) { .menu-content { padding-top: max(12px, env(safe-area-inset-top)); } .menu-header { margin-bottom: 12px; } .page-heading { margin-bottom: 16px; } #snake-preview { min-height: 100px; max-height: 130px; object-fit: contain; } .bottom-nav { padding-top: 4px; } .bottom-nav button { min-height: 48px; gap: 2px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Skin collection and earned rewards. Locked skins can be previewed. */
.collection-button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin-top: 14px; padding: 16px 18px; text-align: left; background: #1d3324; }
.collection-button > span:first-child { display: flex; flex-direction: column; gap: 6px; }
.collection-button strong { font-size: 16px; }
#home-apples { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: auto; }
.unlock-detail { padding: 18px; border: 1px solid #486648; border-radius: 16px; background: #203527; margin-bottom: 18px; }
.unlock-detail .section-heading { align-items: center; margin-bottom: 10px; }
#skin-category { margin-bottom: 5px; color: #b9d4a6; font-size: 9px; }
#skin-ownership { color: var(--lime); font-weight: 650; font-size: 11px; }
#skin-ownership[data-locked="true"] { color: #ebcd8a; }
#skin-requirement { color: #c3d1c1; font-size: 13px; line-height: 1.5; }
#skin-progress-row { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
#skin-progress { appearance: none; width: 100%; min-width: 30px; height: 7px; border: none; border-radius: 8px; overflow: hidden; background: #102318; color: var(--lime); }
#skin-progress::-webkit-progress-bar { background: #102318; border-radius: 8px; }
#skin-progress::-webkit-progress-value { background: var(--lime); border-radius: 8px; }
#skin-progress::-moz-progress-bar { background: var(--lime); border-radius: 8px; }
#skin-progress-text { flex-shrink: 0; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
#equip-skin { width: 100%; min-height: 42px; background: var(--lime); color: #20321d; border-color: var(--lime); }
#equip-skin:disabled { background: #2c4431; color: #bfd1b7; border-color: #41583e; opacity: 1; }
.collection-stats { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.collection-stats strong { color: var(--lime); font-size: 16px; margin-right: 3px; }
.collection-hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: 20px; }
.skin-card { gap: 5px; padding-top: 18px; }
.skin-status { font-size: 9px; color: #adc49f; line-height: 1.4; font-weight: 400; }
.skin-card[data-locked="true"] { background: #192d21; }
.skin-card[data-locked="true"] .skin-status { color: #c6b791; }
.skin-card[aria-pressed="true"] { background: #30472a; }
.skin-card[aria-pressed="true"] .skin-check { display: none; }
.skin-card[data-locked="true"] .skin-check, .skin-card[data-equipped="true"] .skin-check { display: block; }
.skin-card[data-locked="true"] .skin-check { background: #233b29; color: #e8c989; width: 19px; height: 19px; line-height: 19px; }
.earned-notice { color: #d9fab3; border: 1px solid #71944f; border-radius: 12px; padding: 13px 16px; background: #2b4527; font-size: 13px; line-height: 1.5; margin-bottom: 16px; }
#skin-unlock-toast { position: fixed; z-index: 12; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 13px 20px; border: 1px solid var(--lime); border-radius: 14px; color: var(--lime); background: #182d20ed; box-shadow: 0 6px 20px #0006; font-size: 14px; font-weight: 700; text-align: center; pointer-events: none; }
@media (min-width: 600px) { .skin-status { font-size: 11px; } }
