:root {
  color-scheme: dark;
  --page: #081225;
  --text: #eef4ff;
  --muted: #9aabc7;
  --panel: rgba(17, 31, 58, .9);
  --panel-soft: rgba(22, 39, 72, .8);
  --line: rgba(154, 180, 225, .17);
  --teal: #63ddc1;
  --blue: #7aa7ff;
  --gold: #ffc75e;
  --coral: #ff718f;
  --max: 1120px;
}
* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; background: var(--page); }
body { min-height: 100vh; margin: 0; overflow-x: hidden; background: radial-gradient(ellipse at 50% -15%, #172e56 0, transparent 48%), radial-gradient(ellipse at 4% 25%, #0c496066 0, transparent 24%), radial-gradient(ellipse at 95% 37%, #50357055 0, transparent 23%), var(--page); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }
body.day-theme { color-scheme: light; --page: #eef3fb; --text: #17243d; --muted: #61718e; --panel: rgba(255,255,255,.88); --panel-soft: rgba(245,248,253,.94); --line: rgba(42,65,105,.13); background: radial-gradient(ellipse at 50% -15%, #d8e5fb 0, transparent 50%), radial-gradient(ellipse at 5% 28%, #9ee9de55 0, transparent 25%), radial-gradient(ellipse at 96% 40%, #ddc3f955 0, transparent 24%), var(--page); }
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.ambient-orbs { position: fixed; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }
.ambient-orbs::before, .ambient-orbs::after { position: absolute; width: 290px; height: 290px; border-radius: 50%; content: ""; filter: blur(85px); opacity: .16; animation: float-orb 16s ease-in-out infinite alternate; }
.ambient-orbs::before { top: 18%; left: -110px; background: #ff9e3d; }
.ambient-orbs::after { top: 52%; right: -120px; background: #a45cff; animation-delay: -7s; }
@keyframes float-orb { from { transform: translate3d(0,-15px,0) scale(.93); } to { transform: translate3d(26px,28px,0) scale(1.08); } }
.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid rgba(174,195,232,.11); background: rgba(5,13,29,.9); backdrop-filter: blur(18px); }
.header-inner { width: min(var(--max), calc(100% - 36px)); min-height: 70px; margin: auto; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 10px; color: #f4f7ff; text-decoration: none; font-size: 20px; font-weight: 850; letter-spacing: -.8px; }
.brand-accent { color: #65d8d0; }
.brand-mark { width: 32px; height: 32px; position: relative; display: flex; align-items: center; justify-content: center; gap: 2px; border-radius: 11px; background: #f3f6fd; box-shadow: 0 4px 18px #40cce340; transform: rotate(-8deg); }
.brand-mark i { display: block; width: 7px; height: 14px; border-radius: 5px; background: #57d9cf; }
.brand-mark i:nth-child(2) { height: 20px; background: #7f8dff; }
.brand-mark i:nth-child(3) { height: 11px; background: #d079f2; }
.primary-nav { display: flex; align-items: center; gap: 7px; margin-left: 8px; }
.nav-link { padding: 9px 13px; border-radius: 11px; color: #b7c4db; text-decoration: none; font-size: 13px; font-weight: 650; transition: color .18s, background .18s, transform .18s; }
.nav-link:hover, .nav-link.active { background: #ffffff12; color: #fff; }
.nav-link:hover { transform: translateY(-1px); }
.theme-toggle { min-height: 39px; margin-left: auto; padding: 0 15px; border: 1px solid #dce5f5; border-radius: 12px; background: #f4f7fd; color: #17233b; font-size: 12px; font-weight: 750; cursor: pointer; box-shadow: 0 4px 14px #0002; }
.theme-toggle:hover { background: #fff; transform: translateY(-1px); }
.page-shell { position: relative; z-index: 1; width: min(var(--max), calc(100% - 36px)); margin: 0 auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.game-column { width: min(100%, 930px); margin: 22px auto 0; }
.game-shell { overflow: hidden; border: 1px solid rgba(219,230,250,.86); border-radius: 23px; background: #f0f4fc; box-shadow: 0 24px 90px #0007, 0 0 0 1px #ffffff20, 0 0 50px #38cfcb18; }
.game-stats { min-height: 78px; display: flex; align-items: center; gap: 12px; padding: 12px 17px; background: linear-gradient(180deg, #f8faff, #edf2fb); color: #17233b; }
.arcade-label { min-width: 145px; display: flex; align-items: center; gap: 9px; color: #34435c; font-size: 10px; font-weight: 850; letter-spacing: .14em; }
.live-dot { width: 8px; height: 8px; display: inline-block; flex: 0 0 auto; border-radius: 50%; background: #27b88a; box-shadow: 0 0 0 4px #27b88a1d, 0 0 13px #27b88a9c; }
.stats-divider { width: 1px; height: 38px; margin: 0 5px 0 auto; background: #d7dfec; }
.stat-box { min-width: 76px; display: flex; flex-direction: column; justify-content: center; padding: 7px 10px; border: 1px solid #dbe3ef; border-radius: 12px; background: #fff; box-shadow: 0 3px 10px #1c355209; }
.stat-box > span { color: #73819a; font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.stat-box strong { margin-top: 1px; color: #17243d; font-size: 20px; font-variant-numeric: tabular-nums; font-weight: 850; line-height: 1.1; }
.stat-box.best-stat strong { color: #0b9b80; }
.game-actions { display: flex; gap: 8px; margin-left: 3px; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #d7e0ed; border-radius: 12px; background: #fff; color: #425b7d; font-size: 19px; cursor: pointer; transition: border-color .16s, color .16s, transform .16s, box-shadow .16s; box-shadow: 0 3px 10px #2036570b; }
.icon-button:hover:not(:disabled) { border-color: #74d9cc; color: #078d82; transform: translateY(-2px); box-shadow: 0 7px 18px #2ab9aa22; }
.icon-button:disabled { opacity: .42; cursor: not-allowed; }
.icon-button.sound-on { color: #078d82; background: #e1fbf4; }
.board-frame { position: relative; width: min(100%, 840px); aspect-ratio: 1 / 1; margin: 0 auto; overflow: hidden; border: 1px solid rgba(132,160,210,.18); background: #081225; box-shadow: 0 0 55px #02081755 inset; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.board-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(5,13,30,.45); backdrop-filter: blur(3px); transition: opacity .22s ease; }
.board-overlay.hidden { opacity: 0; pointer-events: none; }
.overlay-card { width: min(355px, 90%); padding: 28px 26px 25px; border: 1px solid #fff; border-radius: 22px; background: rgba(246,249,255,.96); color: #15233c; text-align: center; box-shadow: 0 22px 70px #02081780, 0 0 30px #7aa7ff20; }
.overlay-snake { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 16px; background: linear-gradient(145deg,#d6fff5,#e1f5ff); color: #16bcaa; font-size: 26px; text-shadow: 0 0 16px #1ee8cf; }
.eyebrow { margin: 0 0 7px; color: var(--teal); font-size: 9px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.overlay-card .eyebrow { color: #0a9d8a; }
.overlay-card h2 { margin: 0 0 7px; font-size: clamp(25px, 4vw, 32px); font-weight: 850; letter-spacing: -1.1px; line-height: 1.1; }
.overlay-card p:not(.eyebrow) { max-width: 265px; margin: 0 auto 20px; color: #64728a; font-size: 13px; line-height: 1.6; }
.primary-button { min-height: 47px; display: inline-flex; align-items: center; justify-content: center; gap: 17px; padding: 0 21px; border: 0; border-radius: 12px; background: linear-gradient(135deg,#44e0bc,#7ee779); color: #082535; text-decoration: none; font-size: 13px; font-weight: 850; cursor: pointer; box-shadow: 0 7px 20px #44d9b858, inset 0 1px #ffffff90; transition: transform .16s, filter .16s, box-shadow .16s; }
.primary-button:hover { transform: translateY(-2px); filter: saturate(1.12) brightness(1.04); box-shadow: 0 11px 28px #44d9b877, inset 0 1px #ffffffa0; }
.primary-button span { font-size: 18px; line-height: 1; }
.game-caption { min-height: 49px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 20px; background: #f4f7fd; color: #53647f; font-size: 11px; }
.caption-main { color: #167c72; font-weight: 800; }
.caption-side { font-size: 10px; }
.mobile-controls { display: none; }
.game-footer { display: flex; justify-content: center; gap: 28px; padding: 13px 8px 3px; color: #bdc9de; font-size: 10px; }
kbd { min-width: 21px; height: 22px; display: inline-grid; place-items: center; margin-right: 2px; padding: 0 5px; border: 1px solid #52637f66; border-bottom-width: 2px; border-radius: 6px; background: #182641; color: #ecf2ff; font-family: inherit; font-size: 9px; font-weight: 750; line-height: 1; }
.footer-help { margin-left: 5px; color: #8192b0; }
.leaderboard-card { margin: 43px auto 0; padding: 25px 28px 17px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg,var(--panel),rgba(11,22,43,.93)); box-shadow: 0 18px 55px #0002; }
.leaderboard-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 17px; }
.leaderboard-head .eyebrow { margin-bottom: 5px; }
.leaderboard-head h2, .section-heading h2 { margin: 0; font-size: clamp(23px,3vw,30px); letter-spacing: -1px; line-height: 1.15; }
.section-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.trophy { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid #ffc75e35; border-radius: 14px; background: #ffc75e15; color: var(--gold); font-size: 25px; }
.period-tabs { width: min(100%,410px); display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; margin: 0 0 4px auto; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: #07122570; }
.period-tab { min-height: 34px; padding: 0 7px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; transition: background .16s,color .16s; }
.period-tab:hover { color: var(--text); }
.period-tab.active { background: linear-gradient(135deg,#30527f,#224568); color: #8af0d5; box-shadow: 0 3px 10px #0002; }
.board-scope { margin: 8px 1px 0; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .11em; text-align: right; text-transform: uppercase; }
.leaderboard-status { min-height: 28px; display: flex; align-items: center; justify-content: center; color: var(--muted); text-align: center; font-size: 11px; }
.score-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.score-row { min-height: 57px; display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.score-row:first-child { border-color: #ffc75e55; background: linear-gradient(100deg,#ffc75e18,var(--panel-soft)); }
.rank-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: #324668; color: #d5e1f6; font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 800; }
.score-row:first-child .rank-number { background: var(--gold); color: #34230b; }
.score-row:nth-child(2) .rank-number { background: #d7e4f3; color: #263851; }
.score-row:nth-child(3) .rank-number { background: #d39477; color: #412318; }
.player-name { overflow: hidden; color: var(--text); font-size: 11px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.score-date { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 450; }
.player-score { color: #78ead2; font-size: 15px; font-variant-numeric: tabular-nums; font-weight: 850; }
.empty-board { grid-column: 1 / -1; min-height: 105px; display: grid; place-items: center; padding: 20px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.7; }
.leaderboard-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.leaderboard-bottom .live-dot { width: 7px; height: 7px; margin-right: 6px; }
.text-button { padding: 5px; border: 0; background: transparent; color: #9db1d0; font: inherit; font-size: 9px; letter-spacing: inherit; text-transform: uppercase; cursor: pointer; }
.text-button:hover { color: var(--teal); }
.challenge-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(260px,.75fr); gap: 14px; margin: 20px auto 0; }
.challenge-card, .progress-card { min-height: 190px; position: relative; overflow: hidden; padding: 23px 25px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(125deg,rgba(20,48,78,.96),rgba(17,31,58,.92)); box-shadow: 0 13px 38px #0002; }
.challenge-card { display: flex; align-items: flex-start; gap: 17px; background: radial-gradient(ellipse at 93% 6%,#43d6c426,transparent 48%),linear-gradient(125deg,#12344e,#11203a); }
.challenge-icon { width: 43px; height: 43px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #74efd242; border-radius: 14px; background: #7eebd21b; color: #92f4dd; font-size: 22px; box-shadow: 0 0 23px #43d6c420; }
.challenge-content { min-width: 0; flex: 1; }
.challenge-card .eyebrow, .progress-card .eyebrow { margin-bottom: 6px; }
.challenge-card h2, .progress-card h2 { margin: 0 0 5px; font-size: 20px; letter-spacing: -.55px; }
.challenge-card p:not(.eyebrow) { margin: 0 0 14px; color: #bbcadf; font-size: 11px; }
.mission-track { height: 9px; overflow: hidden; border: 1px solid #ffffff14; border-radius: 99px; background: #071225a6; box-shadow: inset 0 2px 5px #0003; }
.mission-track span { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,#37d7bb,#a5ef78); box-shadow: 0 0 14px #53ebc97a; transition: width .35s ease; }
.mission-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; color: #aabbd5; font-size: 9px; }
.mission-foot strong { color: #91f0dc; font-variant-numeric: tabular-nums; }
.progress-card h2 { margin-bottom: 17px; }
.progress-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.progress-stats div { display: flex; flex-direction: column; gap: 3px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px; background: #07122550; }
.progress-stats span { color: var(--muted); font-size: 8px; }
.progress-stats strong { color: #83edd6; font-size: 17px; font-variant-numeric: tabular-nums; }
.progress-note { margin: 9px 0 0; color: var(--muted); font-size: 9px; }
.feature-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin: 62px auto 0; }
.feature-card { min-height: 174px; padding: 21px 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); box-shadow: 0 12px 32px #0002; }
.feature-number { color: #79ebd1; font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.feature-card h2 { margin: 13px 0 6px; font-size: 16px; letter-spacing: -.3px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.guides-section { margin: 72px auto 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading .eyebrow { margin-bottom: 7px; }
.section-heading .section-subtitle { margin-top: 8px; }
.text-link { display: inline-flex; align-items: center; gap: 10px; padding: 8px 0; color: #85ead2; font-size: 12px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.text-link:hover { color: #c4fff1; }
.guide-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.guide-card { min-height: 202px; display: flex; flex-direction: column; padding: 21px 22px 17px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg,var(--panel),var(--panel-soft)); color: var(--text); text-decoration: none; box-shadow: 0 12px 35px #0002; transition: transform .18s,border-color .18s,box-shadow .18s; }
.guide-card:hover { transform: translateY(-3px); border-color: #5edbc866; box-shadow: 0 17px 42px #0003; }
.guide-tag { color: #8eeedb; font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.guide-card h3 { margin: 12px 0 6px; font-size: 17px; letter-spacing: -.4px; }
.guide-card p { margin: 0 0 17px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.guide-cta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; color: #82e8d2; font-size: 11px; font-weight: 800; }
.guide-cta b { font-size: 17px; }
.article-section { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(250px,.65fr); gap: clamp(28px,6vw,70px); align-items: start; margin: 70px auto 0; padding: 36px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(135deg,var(--panel),rgba(18,36,68,.72)); }
.article-copy > .eyebrow { margin-bottom: 10px; }
.article-copy h2 { margin: 0 0 13px; font-size: clamp(24px,3vw,33px); letter-spacing: -1.2px; line-height: 1.15; }
.article-copy > p:not(.eyebrow), .article-subsection p { color: var(--muted); font-size: 13px; line-height: 1.85; }
.article-copy > p:not(.eyebrow) { max-width: 680px; margin: 0; }
.article-subsection { margin-top: 26px; }
.article-subsection h3 { margin: 0 0 7px; font-size: 17px; letter-spacing: -.35px; }
.article-subsection p { margin: 0; }
.how-to-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #07122560; }
.how-to-card h3 { margin: 0 0 13px; font-size: 15px; }
.how-to-card > div { min-height: 41px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.how-to-card > div b { color: var(--text); font-size: 9px; font-weight: 600; }
.how-to-card kbd { min-width: 18px; height: 19px; margin-right: 1px; padding: 0 3px; font-size: 8px; }
.primary-link { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 13px; border-radius: 11px; background: linear-gradient(135deg,#44e0bc,#7ee779); color: #082535; font-size: 11px; font-weight: 850; text-decoration: none; }
.primary-link:hover { filter: brightness(1.06); }
.closing-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 58px 0 64px; padding: 25px 30px; border: 1px solid #57cfbe55; border-radius: 18px; background: radial-gradient(ellipse at 80% 30%,#438bba45,transparent 45%),linear-gradient(110deg,#122e54,#143c5a); box-shadow: 0 18px 50px #0003; }
.closing-cta .eyebrow { margin-bottom: 6px; }
.closing-cta h2 { margin: 0; font-size: 23px; letter-spacing: -.7px; }
.closing-cta p:not(.eyebrow) { margin: 4px 0 0; color: #b8c9df; font-size: 12px; }
.site-footer { position: relative; z-index: 1; border-top: 1px solid rgba(174,195,232,.12); background: rgba(4,11,25,.35); }
.footer-inner { width: min(var(--max),calc(100% - 36px)); display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 20px; min-height: 95px; margin: auto; }
.footer-inner .brand { font-size: 16px; }
.footer-inner .brand-mark { width: 27px; height: 27px; border-radius: 9px; }
.footer-inner .brand-mark i { width: 6px; height: 11px; }
.footer-inner .brand-mark i:nth-child(2) { height: 16px; }
.footer-inner p, .footer-inner small { margin: 0; color: var(--muted); font-size: 10px; }
.footer-inner nav { display: flex; gap: 15px; }
.footer-inner nav a { color: #afbdd4; font-size: 10px; text-decoration: none; }
.footer-inner nav a:hover { color: #8eecd9; }
.score-dialog, .settings-dialog { width: min(420px,calc(100% - 28px)); padding: 0; border: 1px solid #d7e2f2; border-radius: 20px; background: #f7f9fe; color: #17243d; box-shadow: 0 25px 100px #000a; }
.settings-dialog { width: min(450px,calc(100% - 28px)); }
.score-dialog::backdrop, .settings-dialog::backdrop { background: #030918c9; backdrop-filter: blur(7px); }
.score-dialog form, .settings-dialog form { position: relative; padding: 29px; }
.dialog-close { position: absolute; top: 14px; right: 15px; width: 34px; height: 34px; border: 1px solid #dce4ef; border-radius: 10px; background: #fff; color: #60708a; font-size: 22px; line-height: 1; cursor: pointer; }
.score-dialog .eyebrow, .settings-dialog .eyebrow { color: #129b88; }
.score-dialog h2, .settings-dialog h2 { margin: 0 0 8px; font-size: 27px; letter-spacing: -1px; }
.score-dialog h2 span { color: #078e82; font-variant-numeric: tabular-nums; }
.dialog-copy { margin: 0 0 19px; color: #66748d; font-size: 12px; line-height: 1.55; }
.score-dialog label, .settings-dialog label { display: block; margin: 14px 0 6px; color: #37465e; font-size: 11px; font-weight: 750; }
.score-dialog input, .settings-dialog select { width: 100%; height: 43px; padding: 0 12px; border: 1px solid #d5dfed; border-radius: 10px; outline: 0; background: white; color: #17243d; }
.score-dialog input:focus, .settings-dialog select:focus { border-color: #37cdb2; box-shadow: 0 0 0 3px #37cdb222; }
.public-score-note { margin: 8px 0 0; color: #75829a; font-size: 10px; line-height: 1.5; }
.submit-button { width: 100%; margin-top: 14px; }
.submit-status { min-height: 16px; margin: 8px 0 0; color: #66748d; text-align: center; font-size: 10px; }
.submit-status.error { color: #c44760; }
.submit-status.success { color: #078e82; }
.settings-dialog .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.settings-dialog .settings-grid label { margin-top: 12px; }
.settings-dialog select { cursor: pointer; }
.color-options { display: flex; gap: 11px; padding: 4px 1px; }
.color-option { width: 31px; height: 31px; border: 3px solid #f7f9fe; border-radius: 50%; background: var(--swatch); cursor: pointer; box-shadow: 0 0 0 1px #d7e0ed; }
.color-option[data-color="#b5fa55"] { --swatch: #b5fa55; }
.color-option[data-color="#63ddc1"] { --swatch: #63ddc1; }
.color-option[data-color="#7aa7ff"] { --swatch: #7aa7ff; }
.color-option[data-color="#c18aff"] { --swatch: #c18aff; }
.color-option[data-color="#ffc75e"] { --swatch: #ffc75e; }
.color-option.selected { outline: 2px solid #119b8a; outline-offset: 2px; }
.settings-hint { min-height: 14px; margin: 8px 0 0; color: #c44760; font-size: 10px; }
.board-frame:fullscreen { display: flex; align-items: center; justify-content: center; background: #081225; }
.board-frame:fullscreen canvas { width: auto; height: min(94vh,94vw); max-width: 94vw; aspect-ratio: 1; }
.board-frame:fullscreen .board-overlay { position: absolute; }
@media (max-width: 850px) {
  .header-inner { gap: 14px; }
  .primary-nav { gap: 1px; margin-left: auto; }
  .nav-link { padding: 8px 9px; font-size: 11px; }
  .theme-toggle { margin-left: 0; padding: 0 11px; }
  .game-column { margin-top: 16px; }
  .game-stats { gap: 8px; padding: 10px 12px; }
  .arcade-label { min-width: 115px; font-size: 9px; }
  .stat-box { min-width: 67px; padding: 7px 8px; }
  .icon-button { width: 39px; height: 40px; }
  .score-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .footer-inner { grid-template-columns: auto 1fr auto; }
  .footer-inner p { display: none; }
}
@media (max-width: 620px) {
  .header-inner { width: calc(100% - 24px); min-height: 60px; flex-wrap: wrap; gap: 0; }
  .brand { gap: 8px; font-size: 17px; }
  .brand-mark { width: 29px; height: 29px; }
  .primary-nav { order: 3; width: 100%; justify-content: space-between; margin: 0; padding: 0 0 8px; }
  .nav-link { padding: 6px 8px; font-size: 10px; }
  .theme-toggle { min-height: 34px; margin-left: auto; padding: 0 10px; font-size: 10px; }
  .page-shell { width: calc(100% - 20px); }
  .game-column { margin-top: 12px; }
  .game-shell { border-radius: 17px; }
  .game-stats { min-height: 63px; flex-wrap: wrap; gap: 6px; padding: 9px; }
  .arcade-label { min-width: auto; flex: 1 0 100%; gap: 7px; padding: 0 3px 3px; font-size: 8px; }
  .stats-divider { display: none; }
  .stat-box { min-width: 58px; flex: 1 1 0; padding: 5px 7px; border-radius: 9px; }
  .stat-box > span { font-size: 7px; }
  .stat-box strong { font-size: 16px; }
  .game-actions { gap: 5px; margin-left: 0; }
  .icon-button { width: 34px; height: 35px; border-radius: 9px; font-size: 16px; }
  .board-frame { border-left: 0; border-right: 0; }
  .game-caption { min-height: 42px; padding: 8px 11px; font-size: 10px; }
  .caption-side { display: none; }
  .mobile-controls { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 12px; }
  .controls-label { color: #92a4c2; font-size: 8px; font-weight: 800; letter-spacing: .15em; }
  .mobile-controls button { width: 49px; height: 42px; border: 1px solid #ffffff29; border-radius: 12px; background: linear-gradient(150deg,#233959,#142541); color: #e6f2ff; font-size: 13px; touch-action: manipulation; box-shadow: 0 5px 16px #0003; }
  .mobile-controls button:active { border-color: #63ddc1; background: #1a665e; color: #9ffff0; }
  .horizontal-controls { display: flex; gap: 7px; }
  .game-footer { flex-direction: column; align-items: center; gap: 6px; padding: 11px 0 0; font-size: 9px; }
  .leaderboard-card { margin-top: 34px; padding: 19px 14px 13px; border-radius: 16px; }
  .leaderboard-head { padding-bottom: 13px; }
  .leaderboard-head h2 { font-size: 23px; }
  .section-subtitle { font-size: 11px; }
  .trophy { width: 39px; height: 39px; border-radius: 12px; font-size: 21px; }
  .period-tabs { width: 100%; gap: 3px; margin-top: 12px; }
  .period-tab { min-height: 32px; font-size: 9px; }
  .board-scope { text-align: left; }
  .score-list { grid-template-columns: 1fr; gap: 6px; }
  .challenge-grid { grid-template-columns: 1fr; gap: 9px; margin-top: 11px; }
  .challenge-card, .progress-card { min-height: 0; padding: 18px; }
  .challenge-card { gap: 12px; }
  .challenge-icon { width: 37px; height: 37px; border-radius: 12px; font-size: 19px; }
  .challenge-card h2, .progress-card h2 { font-size: 18px; }
  .progress-card h2 { margin-bottom: 12px; }
  .progress-stats div { padding: 7px; }
  .progress-stats span { font-size: 8px; }
  .progress-stats strong { font-size: 15px; }
  .score-row { min-height: 50px; }
  .feature-grid { grid-template-columns: 1fr; gap: 9px; margin-top: 43px; }
  .feature-card { min-height: auto; padding: 17px 18px; }
  .feature-card h2 { margin: 8px 0 4px; font-size: 15px; }
  .feature-card p { font-size: 11px; }
  .guides-section { margin-top: 49px; }
  .section-heading { align-items: start; margin-bottom: 14px; }
  .section-heading h2 { font-size: 24px; }
  .guide-grid { grid-template-columns: 1fr; gap: 9px; }
  .guide-card { min-height: 0; padding: 17px 18px 14px; }
  .guide-card h3 { margin-top: 8px; font-size: 16px; }
  .guide-card p { margin-bottom: 10px; font-size: 11px; }
  .article-section { grid-template-columns: 1fr; gap: 24px; margin-top: 48px; padding: 21px 18px; border-radius: 17px; }
  .article-copy h2 { font-size: 26px; }
  .article-copy > p:not(.eyebrow), .article-subsection p { font-size: 12px; line-height: 1.75; }
  .article-subsection { margin-top: 21px; }
  .article-subsection h3 { font-size: 16px; }
  .closing-cta { align-items: flex-start; flex-direction: column; margin: 40px 0 45px; padding: 22px 20px; }
  .closing-cta h2 { font-size: 21px; }
  .closing-cta .primary-button { width: 100%; }
  .footer-inner { grid-template-columns: 1fr auto; gap: 12px; padding: 17px 0; }
  .footer-inner nav { grid-column: 1 / -1; order: 3; justify-content: space-between; }
  .footer-inner small { text-align: right; }
  .score-dialog form, .settings-dialog form { padding: 25px 21px; }
}
@media (max-width: 380px) {
  .nav-link { padding-inline: 5px; font-size: 9px; }
  .stat-box { min-width: 49px; }
  .game-actions { gap: 4px; }
  .icon-button { width: 31px; height: 33px; }
  .game-footer { font-size: 8px; }
  .leaderboard-card { padding-inline: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
