@charset "UTF-8";

:root {
  color-scheme: dark;
  --page: #101715;
  --surface: #17211d;
  --surface-raised: #1c2722;
  --border: #2a3830;
  --mint: #78efbb;
  --text: #edf5ef;
  --muted: #8f9d94;
  --soft: #64766b;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; font-family: var(--font); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; background: radial-gradient(ellipse at 15% 0%, #1b2c203b, transparent 45%), var(--page); }
button, a, canvas { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .35; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--mint); outline-offset: 5px; }
button { -webkit-user-select: none; user-select: none; }
a { color: inherit; text-decoration: none; }
button, h1, h2, h3, p, ol { margin: 0; }
button { border: 0; }
::selection { background: #78efbb35; color: #edfff5; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; flex: 0 0 auto; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.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; }
.site-shell { width: min(1440px, 100%); padding: 0 46px; margin: auto; }
.site-header { min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 13px; flex-shrink: 0; }
.brand-mark { width: 43px; height: 43px; transition: transform .2s ease; }
.brand:hover .brand-mark { transform: rotate(-6deg); }
.brand-copy { display: flex; flex-direction: column; gap: 6px; }
.brand-copy strong { font-size: 18px; letter-spacing: 1px; display: flex; align-items: center; gap: 12px; }
.brand-divider { color: #506057; font-weight: 400; }
.brand-english { font-size: 11px; font-weight: 600; letter-spacing: 1.8px; color: #bbc9c0; }
.brand-tagline { font-size: 10px; color: var(--muted); letter-spacing: 2px; }
.header-actions { display: flex; align-items: center; gap: 20px; }
.offline-badge { display: flex; gap: 8px; align-items: center; color: #bccac1; font-size: 12px; white-space: nowrap; }
.status-dot { display: inline-block; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px #78efbb30; }
.header-separator { height: 20px; width: 1px; background: var(--border); margin: 0 1px; }
.tool-button { background: none; padding: 10px 0; color: var(--muted); display: flex; align-items: center; gap: 7px; font-size: 12px; white-space: nowrap; transition: color .15s; }
.tool-button:hover { color: var(--mint); }
.tool-button .icon { width: 17px; height: 17px; }
.sound-on { display: none; }
#sound-button[data-enabled="true"] .sound-off { display: none; }
#sound-button[data-enabled="true"] .sound-on { display: inline-block; }
#sound-button[data-enabled="true"] { color: var(--mint); }
.section-heading { display: flex; align-items: center; justify-content: space-between; padding: 33px 0 27px; }
.eyebrow { color: var(--mint); font-family: var(--mono); font-size: 10px; line-height: 1.5; letter-spacing: 1.8px; font-weight: 500; }
.section-heading .eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.section-heading .eyebrow > span { width: 15px; height: 1px; background: var(--mint); }
h1 { display: flex; align-items: center; gap: 16px; font-size: 28px; font-weight: 650; letter-spacing: 1px; line-height: 1.45; }
.mode-tag { color: #a8c5b5; border: 1px solid #334b3e; padding: 4px 8px; border-radius: 5px; font-size: 10px; font-weight: 400; letter-spacing: .5px; }
.section-heading p { color: var(--muted); font-size: 12px; margin-top: 6px; letter-spacing: .35px; }
.heading-note { display: flex; align-items: center; gap: 11px; color: #6f8275; font-size: 11px; line-height: 1.9; }
.heading-note .icon { color: #6a9379; width: 27px; height: 27px; stroke-width: 1.2; }
.heading-note strong { font-weight: 400; color: #9cafa2; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; align-items: stretch; }
.game-column { min-width: 0; display: flex; flex-direction: column; }
.arena { position: relative; flex: 1 0 auto; height: clamp(490px, calc(100svh - 345px), 670px); min-width: 0; overflow: hidden; border: 1px solid #344639; border-radius: 14px 14px 0 0; background: #101d17; isolation: isolate; }
#game-canvas { position: absolute; display: block; inset: 0; width: 100%; height: 100%; touch-action: none; }
#game-canvas:focus-visible { outline: 2px solid var(--mint); outline-offset: -3px; }
.arena[data-state="playing"] #game-canvas { cursor: crosshair; }
.arena-vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 100px #08140e65; z-index: 1; }
.arena-topbar { position: absolute; top: 17px; left: 20px; right: 17px; display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 4; pointer-events: none; }
.arena-live { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 500; color: #abc1b2; letter-spacing: .5px; padding: 9px 11px; border: 1px solid #a8d0b413; border-radius: 6px; background: #102018a8; backdrop-filter: blur(8px); }
.arena-live .status-dot { width: 5px; height: 5px; flex-basis: 5px; }
.live-divider { width: 1px; height: 10px; margin: 0 3px; background: #56715b66; }
.arena-tools { display: flex; gap: 7px; pointer-events: auto; }
.arena-icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #92bfa923; border-radius: 6px; background: #14211acc; color: #b1c2b6; transition: background .15s, color .15s; }
.arena-icon-button .icon { width: 16px; height: 16px; }
.arena-icon-button:hover:not(:disabled) { color: var(--mint); background: #284735; }
.screen { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; text-align: center; padding: 66px 20px 43px; }
.menu-screen { background: radial-gradient(ellipse at center, #101b15f5 2%, #101b15db 31%, #101b155e 67%, #101b150c 100%); }
.menu-content { width: 405px; max-width: 100%; animation: rise-in .6s ease both; }
.menu-kicker { color: #badac7; font-size: 11px; letter-spacing: 2px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 17px; }
.sparkle { color: var(--mint); font-size: 18px; line-height: 1; }
.menu-content h2 { font-size: clamp(39px, 4.1vw, 57px); font-weight: 800; line-height: 1.3; letter-spacing: 2px; }
.menu-content h2 span { color: var(--mint); }
.menu-description { color: #99b0a1; margin-top: 17px; font-size: 12px; letter-spacing: .75px; line-height: 1.9; }
.snake-selector { margin: 23px 0 22px; display: flex; justify-content: center; align-items: center; gap: 16px; }
.snake-selector > span { color: #91a599; font-size: 10px; }
.color-options { display: flex; gap: 12px; align-items: center; }
.color-option { height: 19px; width: 19px; border-radius: 50%; background: var(--option-color); position: relative; padding: 0; transition: transform .15s, box-shadow .15s; }
.color-option::after { content: ""; position: absolute; inset: -5px; border: 1px solid transparent; border-radius: 50%; }
.color-option:hover { transform: translateY(-2px); }
.color-option.is-selected::after { border-color: var(--option-color); }
.color-option.is-selected { box-shadow: 0 0 14px color-mix(in srgb, var(--option-color) 30%, transparent); }
.primary-button { width: 100%; border-radius: 8px; min-height: 47px; padding: 13px 24px; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--mint); color: #103223; font-size: 14px; font-weight: 700; letter-spacing: 1px; box-shadow: 0 3px 0 #4aaa7e, 0 6px 24px #78efbb12; transition: background .15s, transform .15s, box-shadow .15s; }
.primary-button:hover { background: #a0ffd0; transform: translateY(-2px); box-shadow: 0 5px 0 #4aaa7e, 0 8px 30px #78efbb22; }
.primary-button:active { transform: translateY(2px); box-shadow: 0 0 0 #4aaa7e; }
.start-button { max-width: 265px; margin: 0 auto; min-height: 48px; }
.start-button > .icon:first-child { height: 18px; width: 18px; margin-left: 33px; }
.button-arrow { width: 16px; height: 16px; margin-left: auto; }
.menu-footnote { color: #668272; margin-top: 19px; font-size: 10px; letter-spacing: 1px; }
.arena-coordinate { position: absolute; bottom: 20px; font-family: var(--mono); font-size: 8px; letter-spacing: 1.7px; color: #607d6a; }
.coordinate-left { left: 23px; }
.coordinate-right { right: 23px; }
.boost-meter { position: absolute; bottom: 25px; left: 22px; width: 148px; z-index: 2; pointer-events: none; }
.boost-meter-label { display: flex; align-items: center; gap: 5px; color: #b6d3c1; font-size: 9px; margin-bottom: 8px; text-shadow: 0 1px 6px #000; }
.boost-meter-label .icon { color: var(--mint); width: 13px; height: 13px; }
.boost-track { height: 4px; background: #97c5a82b; border-radius: 4px; overflow: hidden; }
.boost-fill { height: 100%; width: 20%; background: var(--mint); border-radius: 4px; box-shadow: 0 0 10px #78efbb88; transition: width .2s linear; }
.minimap-shell { position: absolute; width: 140px; right: 20px; bottom: 21px; padding: 8px; background: #101e17b8; backdrop-filter: blur(6px); border: 1px solid #81b59229; border-radius: 6px; z-index: 2; pointer-events: none; }
.minimap-caption { display: flex; align-items: center; font-size: 8px; gap: 5px; color: #90ac9b; margin-bottom: 7px; }
.minimap-caption .status-dot { width: 3px; height: 3px; flex-basis: 3px; }
.minimap-caption > span:last-child { margin-left: auto; color: #587c65; font-family: var(--mono); font-size: 7px; letter-spacing: 1px; }
#minimap-canvas { width: 100%; height: auto; aspect-ratio: 10 / 7; display: block; border-radius: 2px; }
.arena[data-state="menu"] .minimap-shell, .arena[data-state="menu"] .boost-meter, .arena[data-state="over"] .minimap-shell, .arena[data-state="over"] .boost-meter { display: none; }
.spawn-notice { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 8px 12px; color: #c7f5de; border: 1px solid #78efbb36; border-radius: 20px; background: #183a2cce; font-size: 11px; z-index: 2; white-space: nowrap; pointer-events: none; }
.spawn-notice .icon { height: 15px; width: 15px; }
.toast { position: absolute; bottom: 145px; left: 50%; transform: translate(-50%, 8px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 8; background: #e4f7eb; box-shadow: 0 6px 24px #0004; color: #173425; font-size: 11px; padding: 10px 16px; border-radius: 6px; max-width: 85%; width: max-content; text-align: center; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.stats-bar { display: grid; grid-template-columns: 1.08fr 1fr 1fr 1fr; border: 1px solid #344639; border-top: 0; background: #1a2820; border-radius: 0 0 12px 12px; padding: 20px 0 18px; }
.stat-item { padding: 0 24px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stat-item + .stat-item { border-left: 1px solid #354336; }
.stat-label { font-size: 10px; color: #93a69a; display: flex; align-items: center; gap: 6px; letter-spacing: .5px; white-space: nowrap; }
.player-dot { height: 7px; width: 7px; border-radius: 50%; background: var(--snake-color); box-shadow: 0 0 8px color-mix(in srgb, var(--snake-color) 30%, transparent); }
.stat-item strong { font-family: var(--mono); font-size: 23px; font-weight: 500; line-height: 1; letter-spacing: -.5px; white-space: nowrap; }
.stat-item strong small { font-size: 11px; color: #93a69a; margin-left: 5px; }
.score-stat strong { color: var(--mint); }
.arena-caption { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; color: #6b8173; padding: 14px 1px 0; }
.arena-caption > span:first-child { display: flex; gap: 7px; align-items: center; }
.caption-dot { width: 4px; height: 4px; background: #71917d; border-radius: 50%; }
.sidebar { display: flex; flex-direction: column; gap: 15px; }
.sidebar section { border: 1px solid var(--border); border-radius: 11px; background: var(--surface); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 500; }
.panel-heading h2 { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; }
.panel-heading > .icon { color: #80998a; width: 17px; height: 17px; }
.record-panel { padding: 19px 20px; position: relative; min-height: 152px; background: linear-gradient(115deg, #233b2c, #1a2e23) !important; border-color: #39513f !important; }
.record-panel .panel-heading { color: #c1d6c7; }
.record-panel .panel-heading > .icon { color: #a6c493; width: 19px; height: 19px; }
.record-value { display: flex; align-items: baseline; gap: 8px; margin-top: 13px; position: relative; z-index: 1; }
.record-value strong { color: #d4f5b5; font-family: var(--mono); font-weight: 500; font-size: 37px; line-height: 1.1; letter-spacing: -1.5px; }
.record-value > span { color: #9eb595; font-size: 11px; }
.record-panel p { color: #92ab98; margin-top: 10px; font-size: 10px; position: relative; z-index: 1; }
.record-decoration { position: absolute; right: 20px; bottom: 39px; display: flex; align-items: flex-end; gap: 4px; height: 45px; opacity: .3; pointer-events: none; }
.record-decoration span { display: block; width: 4px; height: 10%; background: #a8cb8d; border-radius: 2px; }
.record-decoration span:nth-child(2n) { height: 24%; }
.record-decoration span:nth-child(3n) { height: 36%; }
.record-decoration span:nth-child(4n) { height: 46%; }
.record-decoration span:nth-child(5n) { height: 36%; }
.record-decoration span:nth-child(6n) { height: 57%; }
.record-decoration span:nth-child(7n) { height: 52%; }
.record-decoration span:nth-child(8n) { height: 69%; }
.record-decoration span:nth-child(9n) { height: 63%; }
.record-decoration span:nth-child(10n) { height: 78%; }
.record-decoration span:nth-child(11n) { height: 91%; }
.record-decoration span:nth-child(12n) { height: 100%; }
.leaderboard-panel { padding: 18px 16px 0; }
.leaderboard-panel .panel-heading { padding: 0 3px; }
.leaderboard-panel .panel-heading h2 .icon { width: 16px; height: 16px; color: #cab58b; }
.tiny-tag { color: #8c9d92; background: #25322a; padding: 3px 6px; border-radius: 4px; font-size: 9px; font-weight: 400; }
.leaderboard-columns { display: flex; justify-content: space-between; color: #687e6f; font-size: 9px; margin: 17px 8px 6px; }
.leaderboard { list-style: none; padding: 0; min-height: 238px; }
.leaderboard-row { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 7px 8px; border-radius: 5px; font-size: 11px; }
.leaderboard-rank { width: 14px; color: #6b8273; font-family: var(--mono); font-size: 10px; flex: 0 0 14px; }
.leaderboard-dot { height: 6px; width: 6px; border-radius: 50%; background: var(--snake-color); flex: 0 0 6px; }
.leaderboard-name { flex: 1; color: #b3c3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leaderboard-score { color: #96aa9d; font-size: 11px; font-family: var(--mono); flex-shrink: 0; }
.leaderboard-row.is-top .leaderboard-rank { color: #dcc38d; }
.leaderboard-row.is-player { background: #78efbb0c; box-shadow: inset 0 0 0 1px #78efbb17; }
.leaderboard-row.is-player .leaderboard-name { color: var(--mint); font-weight: 600; }
.leaderboard-row.is-player .leaderboard-score { color: var(--mint); }
.leaderboard-note { border-top: 1px solid var(--border); padding: 12px 0; margin: 9px 3px 0; font-size: 9px; color: #728779; display: flex; align-items: center; gap: 6px; }
.leaderboard-note .status-dot { width: 4px; height: 4px; flex-basis: 4px; background: #7e9d85; }
.controls-panel { padding: 18px 19px 16px; }
.controls-panel .panel-heading { margin-bottom: 18px; }
.control-line { display: flex; align-items: center; justify-content: space-between; min-height: 29px; gap: 10px; font-size: 10px; color: #93a598; }
.control-keys { display: flex; gap: 7px; align-items: center; }
.control-keys .icon { width: 13px; height: 13px; color: #afc1b4; }
.key-or { color: #516759; }
kbd { color: #aabcb0; background: #202e25; border: 1px solid #354639; border-bottom-width: 2px; padding: 3px 6px; border-radius: 4px; font-family: var(--mono); font-size: 8px; letter-spacing: .6px; line-height: 1; }
.control-tip { display: flex; align-items: flex-start; gap: 6px; font-size: 9px; line-height: 1.9; color: #77927f; border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.control-tip .icon { height: 12px; width: 12px; color: #a0b586; margin-top: 3px; }
.touch-tip { display: none; color: #77927f; font-size: 10px; line-height: 1.8; margin-top: 10px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; color: #587060; padding: 23px 0 25px; margin-top: 25px; border-top: 1px solid #24342a; font-size: 9px; }
.site-footer > span:first-child { font-family: var(--mono); letter-spacing: 1.2px; }
.footer-dot { padding: 0 8px; }
.modal-screen { background: #0c1712c9; backdrop-filter: blur(9px); z-index: 5; padding: 26px 20px; overflow-y: auto; align-items: flex-start; }
.result-card { max-width: 340px; width: 100%; margin-block: auto; animation: rise-in .3s ease both; }
.modal-symbol { display: inline-grid; place-items: center; height: 42px; width: 42px; border-radius: 13px; background: #78efbb12; color: var(--mint); border: 1px solid #78efbb23; margin-bottom: 14px; }
.modal-symbol .icon { width: 23px; height: 23px; }
.result-card h2 { margin-top: 10px; font-size: 27px; letter-spacing: 1px; font-weight: 650; }
.modal-description { color: #98afa0; line-height: 1.8; font-size: 11px; margin-top: 10px; }
#pause-screen .primary-button { margin-top: 30px; }
.secondary-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 43px; gap: 9px; border: 1px solid #55736255; border-radius: 8px; background: #304d3b30; color: #b4cabc; font-size: 12px; margin-top: 13px; transition: background .15s; }
.secondary-button:hover { background: #304d3b80; }
.secondary-button .icon { height: 16px; width: 16px; }
.modal-footnote { font-size: 10px; margin-top: 20px; color: #759180; }
.final-score { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 17px; }
.final-score > span:first-child { font-size: 50px; color: var(--mint); font-family: var(--mono); letter-spacing: -2px; line-height: 1.1; }
.final-score > span:last-child { font-size: 10px; color: #96ae9f; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 0 25px; padding: 16px 0; border-top: 1px solid #7293812b; border-bottom: 1px solid #7293812b; }
.result-stats > div { display: flex; flex-direction: column; gap: 7px; }
.result-stats > div + div { border-left: 1px solid #7293812b; }
.result-stats strong { font-family: var(--mono); font-size: 16px; font-weight: 500; }
.result-stats span { font-size: 9px; color: #90a99a; }
.text-button { display: flex; gap: 7px; align-items: center; justify-content: center; margin: 19px auto 0; color: #9cb7a6; background: none; font-size: 11px; padding: 4px 10px; }
.text-button .icon { height: 13px; width: 13px; }
.text-button:hover { color: var(--mint); }
.new-record { display: inline-flex; gap: 5px; align-items: center; justify-content: center; color: #e9d8a6; font-size: 10px; background: #eed58e12; padding: 5px 10px; border-radius: 20px; margin-top: 10px; }
.new-record .icon { width: 13px; height: 13px; }
.help-dialog { background: #18271f; color: var(--text); border: 1px solid #415f4b; border-radius: 15px; padding: 0; width: min(490px, calc(100vw - 32px)); max-height: min(85svh, 750px); box-shadow: 0 20px 120px #0009; }
.help-dialog::backdrop { background: #06120bc9; backdrop-filter: blur(7px); }
.help-content { padding: 34px; position: relative; }
.dialog-close { position: absolute; right: 15px; top: 15px; }
.help-content .eyebrow { font-size: 9px; padding-right: 20px; }
.help-content h2 { font-size: 29px; margin: 12px 0; }
.help-intro { color: #9bb4a4; font-size: 12px; line-height: 1.9; margin-bottom: 24px; }
.help-step { display: flex; gap: 17px; margin-top: 21px; }
.help-step > span { color: var(--mint); font-size: 13px; font-family: var(--mono); margin-top: 1px; }
.help-step h3 { font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.help-step p { font-size: 11px; line-height: 1.9; color: #91aa9b; }
.help-privacy { border-top: 1px solid #35493c; padding-top: 18px; margin-top: 25px; display: flex; gap: 10px; align-items: flex-start; color: #789684; font-size: 10px; line-height: 1.9; }
.help-privacy .icon { margin-top: 3px; width: 17px; height: 17px; }
.noscript-notice { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); padding: 15px 24px; border-radius: 10px; background: #f5d69e; color: #2a2212; z-index: 20; width: min(90%, 600px); }
.touch-controls { display: none; }
.game-column:fullscreen { width: 100vw; height: 100dvh; background: var(--page); }
.game-column:fullscreen .arena { width: 100%; height: auto; min-height: 0; flex: 1 1 0; border: 0; border-radius: 0; }
.game-column:fullscreen .stats-bar { flex: 0 0 auto; border-radius: 0; border-left: 0; border-right: 0; }
.game-column:fullscreen .arena-caption { display: none; }
.game-column:fullscreen .arena .menu-screen { overflow-y: auto; align-items: flex-start; }
.game-column:fullscreen .arena .menu-content { width: 440px; margin-block: auto; }
.game-column:fullscreen .arena .menu-content h2 { font-size: 65px; }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 1500px) {
  .site-shell { padding: 0 35px; }
  .game-layout { grid-template-columns: minmax(0, 1fr) 286px; gap: 25px; }
  .arena { min-height: 560px; }
  .sidebar { gap: 19px; }
  .leaderboard-row { min-height: 38px; }
}
@media (max-width: 1100px) {
  .site-shell { padding: 0 28px; }
  .game-layout { grid-template-columns: minmax(0, 1fr) 238px; gap: 17px; }
  .brand-english { font-size: 9px; letter-spacing: 1px; }
  .header-actions { gap: 15px; }
  .arena { min-height: 505px; }
  .menu-content h2 { font-size: 44px; }
  .stat-item { padding: 0 16px; }
  .stat-item strong { font-size: 20px; }
  .controls-panel { padding: 17px 15px; }
  .leaderboard-panel { padding: 17px 12px 0; }
  .coordinate-right { display: none; }
}
@media (max-width: 860px) {
  .site-shell { padding: 0 24px; }
  .site-header { min-height: 87px; }
  .brand-english, .brand-divider { display: none; }
  .game-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .arena { height: clamp(500px, 65svh, 640px); }
  .menu-content h2 { font-size: 53px; }
  .coordinate-right { display: initial; }
  .sidebar { display: grid; grid-template-columns: 1fr 1.2fr; align-items: start; gap: 16px; }
  .record-panel { grid-column: 1; grid-row: 1; }
  .controls-panel { grid-column: 1; grid-row: 2; }
  .leaderboard-panel { grid-column: 2; grid-row: 1 / 3; height: 100%; }
  .leaderboard-row { min-height: 40px; }
  .leaderboard-note { margin-top: 18px; }
  .section-heading { padding: 27px 0 23px; }
  .stats-bar { padding: 20px 0; }
  .stat-item { padding: 0 25px; }
  .stat-item strong { font-size: 24px; }
  .site-footer { margin-top: 28px; }
}
@media (max-width: 560px) {
  .site-shell { padding: 0 15px; }
  .site-header { min-height: 77px; gap: 10px; }
  .brand { gap: 10px; }
  .brand-mark { height: 35px; width: 35px; }
  .brand-copy strong { font-size: 16px; }
  .brand-copy { gap: 5px; }
  .brand-tagline { font-size: 8px; letter-spacing: 1px; }
  .header-actions { gap: 14px; }
  .header-separator, .offline-badge, .tool-button > span { display: none; }
  .tool-button { padding: 11px 2px; }
  .tool-button .icon { width: 19px; height: 19px; }
  .heading-note { display: none; }
  .section-heading { padding: 23px 0 20px; }
  .section-heading .eyebrow { font-size: 9px; margin-bottom: 7px; }
  h1 { font-size: 25px; gap: 12px; }
  .mode-tag { font-size: 9px; padding: 3px 7px; }
  .section-heading p { font-size: 10px; margin-top: 7px; }
  .arena { height: clamp(470px, 67svh, 580px); min-height: 470px; border-radius: 11px 11px 0 0; }
  .arena-topbar { top: 12px; right: 12px; left: 12px; }
  .arena-live { font-size: 9px; gap: 5px; padding: 8px; }
  .arena-icon-button { width: 30px; height: 30px; }
  .menu-content h2 { font-size: 45px; line-height: 1.35; }
  .menu-kicker { font-size: 10px; margin-bottom: 17px; }
  .menu-description { font-size: 11px; margin-top: 15px; }
  .snake-selector { margin: 22px 0; }
  .menu-screen { padding-bottom: 43px; }
  .menu-content { max-width: 310px; }
  .arena-coordinate { font-size: 7px; letter-spacing: 1px; bottom: 16px; }
  .coordinate-left { left: 15px; }
  .coordinate-right { display: none; }
  .stats-bar { padding: 16px 0; }
  .stat-item { padding: 0 11px; gap: 9px; }
  .stat-item strong { font-size: 17px; letter-spacing: -.8px; }
  .stat-item:nth-child(3) strong { font-size: clamp(12px, 3.5vw, 17px); line-height: 17px; }
  .stat-label { font-size: 9px; letter-spacing: 0; gap: 4px; }
  .stat-item strong small { font-size: 9px; margin-left: 3px; }
  .player-dot { width: 5px; height: 5px; }
  .arena-caption { font-size: 8px; padding-top: 12px; gap: 5px; }
  .game-layout { gap: 20px; }
  .sidebar { gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .record-panel { padding: 15px 14px; min-height: 142px; }
  .record-decoration { right: 15px; gap: 3px; opacity: .2; }
  .record-value strong { font-size: 32px; }
  .record-panel p { font-size: 9px; max-width: 125px; line-height: 1.7; }
  .panel-heading, .panel-heading h2 { font-size: 11px; }
  .leaderboard-panel { padding: 15px 8px 0; }
  .leaderboard-panel .panel-heading h2 { gap: 4px; }
  .leaderboard-panel .panel-heading h2 .icon { width: 14px; height: 14px; }
  .leaderboard-row { min-height: 37px; gap: 5px; padding: 7px 5px; }
  .leaderboard-rank { width: 12px; flex-basis: 12px; font-size: 9px; }
  .leaderboard-name { font-size: 10px; }
  .leaderboard-score { font-size: 10px; }
  .leaderboard-dot { width: 5px; height: 5px; flex-basis: 5px; }
  .leaderboard-columns { font-size: 8px; }
  .leaderboard-note { font-size: 8px; margin: 14px 3px 0; line-height: 1.6; }
  .controls-panel { padding: 15px 12px; }
  .control-line { font-size: 9px; gap: 5px; }
  .control-keys { gap: 3px; }
  kbd { font-size: 7px; padding: 3px 4px; letter-spacing: .2px; }
  .control-tip { font-size: 8px; gap: 3px; }
  .control-tip .icon { width: 10px; height: 10px; }
  .controls-panel .panel-heading { margin-bottom: 12px; }
  .controls-panel .panel-heading > .icon { width: 14px; height: 14px; }
  .site-footer { flex-direction: column; align-items: center; gap: 10px; font-size: 8px; padding: 20px 0; margin-top: 23px; }
  .site-footer > span:first-child { font-size: 8px; }
  .result-card { max-width: 300px; }
  .result-card h2 { font-size: 24px; }
  .modal-symbol { margin-bottom: 11px; height: 35px; width: 35px; border-radius: 11px; }
  .result-card .eyebrow { font-size: 9px; }
  .result-stats { margin: 16px 0 21px; padding: 13px 0; }
  .final-score > span:first-child { font-size: 43px; }
  .result-card .primary-button { min-height: 43px; }
  .text-button { margin-top: 17px; }
  .help-content { padding: 29px 24px; }
  .help-content .eyebrow { max-width: 245px; font-size: 8px; }
  .help-content h2 { font-size: 26px; }
  .minimap-shell { width: 102px; right: 13px; bottom: 17px; padding: 6px; }
  .minimap-caption { font-size: 7px; }
  .minimap-caption > span:last-child { font-size: 6px; }
  .boost-meter { left: 16px; bottom: 24px; width: 120px; }
  .game-column:fullscreen .arena .menu-content h2 { font-size: 48px; }
}
@media (pointer: coarse) {
  .touch-controls { position: absolute; inset: auto 0 0; height: 155px; z-index: 4; display: block; pointer-events: none; }
  .arena:not([data-state="playing"]) .touch-controls { display: none; }
  .joystick-area { position: absolute; left: max(20px, env(safe-area-inset-left)); bottom: max(23px, env(safe-area-inset-bottom)); width: 108px; height: 108px; border: 1px solid #90d7b23b; background: #8bd4a60b; border-radius: 50%; pointer-events: auto; touch-action: none; -webkit-user-select: none; user-select: none; }
  .joystick-guide { position: absolute; inset: 24px; border: 1px dashed #a3e5bd27; border-radius: 50%; }
  .joystick-knob { position: absolute; width: 42px; height: 42px; left: 32px; top: 32px; border-radius: 50%; background: #a7ecc83b; border: 1px solid #b5f1ce61; box-shadow: 0 2px 12px #091c1370; pointer-events: none; }
  .touch-boost { position: absolute; right: max(25px, env(safe-area-inset-right)); bottom: max(35px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; height: 73px; width: 73px; border-radius: 50%; border: 1px solid #97e3b948; background: #6cbd8d25; color: #c1f5d9; touch-action: none; pointer-events: auto; }
  .touch-boost .icon { width: 24px; height: 24px; }
  .touch-boost > span { font-size: 9px; }
  .touch-boost:active, .touch-boost.is-active { background: #80dba652; box-shadow: 0 0 22px #78efbb25; }
  .arena[data-state="playing"] .boost-meter { left: auto; right: 22px; bottom: 15px; width: 79px; }
  .arena[data-state="playing"] .boost-meter-label { display: none; }
  .arena[data-state="playing"] .minimap-shell { top: 60px; bottom: auto; right: 13px; width: 91px; opacity: .75; }
  .touch-tip { display: block; font-size: 9px; }
  .spawn-notice { top: 61px; left: 14px; transform: none; font-size: 9px; padding: 7px 9px; }
}
@media (max-height: 550px) and (orientation: landscape) and (pointer: coarse) {
  .game-column:fullscreen .arena .screen { padding: 15px; }
  .game-column:fullscreen .arena .menu-content h2 { font-size: 33px; }
  .game-column:fullscreen .arena .menu-kicker { margin-bottom: 8px; }
  .game-column:fullscreen .arena .menu-description { margin-top: 8px; font-size: 10px; }
  .game-column:fullscreen .arena .snake-selector { margin: 13px 0; }
  .game-column:fullscreen .arena .menu-footnote { margin-top: 12px; }
  .game-column:fullscreen .arena .result-card { max-width: 360px; }
  .game-column:fullscreen .arena .modal-symbol { display: none; }
  .game-column:fullscreen .arena .result-card h2 { font-size: 22px; margin-top: 6px; }
  .game-column:fullscreen .arena .final-score { margin-top: 6px; }
  .game-column:fullscreen .arena .final-score > span:first-child { font-size: 32px; }
  .game-column:fullscreen .arena .result-stats { margin: 10px 0; padding: 8px 0; }
  .game-column:fullscreen .arena .new-record { margin-top: 3px; padding: 2px 8px; }
  .game-column:fullscreen .arena .text-button { margin-top: 10px; }
  .game-column:fullscreen .arena .modal-description { margin-top: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
