:root {
  color-scheme: dark;
  --bg: #080d12;
  --panel: #10171d;
  --panel-soft: #0d141a;
  --line: #1e2a31;
  --muted: #75828a;
  --text: #e9f0ed;
  --green: #a9f36c;
  --green-dark: #315a30;
  --mono: "DM Mono", Consolas, monospace;
  --sans: "Manrope", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(ellipse at 27% 0%, rgba(37, 69, 60, .19), transparent 42%), var(--bg);
  font-family: var(--sans);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image: linear-gradient(rgba(130, 168, 151, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(130, 168, 151, .06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}
button, a { font: inherit; }
button { color: inherit; }
.app-shell { width: min(1420px, calc(100% - 80px)); margin: 0 auto; position: relative; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(138, 160, 151, .13); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.brand-mark { width: 25px; height: 25px; position: relative; display: flex; align-items: center; gap: 2px; transform: rotate(-20deg); }
.brand-mark i { display: block; width: 6px; height: 6px; border: 1px solid var(--green); border-radius: 2px; box-shadow: 0 0 8px #a9f36666; }
.brand-mark i:nth-child(2) { width: 7px; height: 7px; background: #91d95a; }
.brand-mark i:nth-child(3) { width: 7px; height: 7px; background: #b1f47a; }
.brand-mark b { width: 4px; height: 4px; background: var(--green); border-radius: 50%; position: absolute; right: 0; top: 2px; }
.brand-name { font-size: 13px; font-weight: 800; letter-spacing: .14em; }
.brand-name span { color: var(--green); margin-left: 5px; }
.topbar-note, .top-link { font: 10px var(--mono); letter-spacing: .08em; color: #8d9b99; }
.topbar-note { display: flex; align-items: center; gap: 9px; }
.live-dot, .mini-dot, .footer-pulse { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px #a9f36c99; }
.top-link { color: #aab5b1; text-decoration: none; transition: color .2s; }
.top-link:hover { color: var(--green); }
.top-link span { margin-left: 8px; color: var(--green); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(32px, 5vw, 76px); padding: 56px 0 48px; align-items: start; }
.game-column { min-width: 0; }
.game-heading, .board-frame, .control-row { width: min(100%, 620px); }
.game-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 23px; gap: 18px; }
.eyebrow, .card-heading, .brain-top, .brain-foot, .board-topline, .board-footer, .stat-label, .algorithm-tags, .side-footer { font-family: var(--mono); letter-spacing: .065em; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: #80908d; font-size: 9px; margin-bottom: 12px; }
.eyebrow-line { width: 18px; height: 1px; background: var(--green); }
h1 { font-size: clamp(27px, 3.4vw, 39px); line-height: 1.12; letter-spacing: -.055em; margin: 0; font-weight: 700; }
h1 span { color: #82918d; font-weight: 500; }
.mode-switch { height: 33px; border-radius: 20px; border: 1px solid #2b3b36; background: #111a1a; color: #c7d3cc; padding: 0 10px; display: inline-flex; align-items: center; gap: 8px; font: 9px var(--mono); letter-spacing: .07em; cursor: pointer; white-space: nowrap; transition: .2s; }
.mode-switch:hover { border-color: #5f8852; }
.switch-orb { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 9px #a9f36c; }
.switch-state { color: var(--green); font-weight: 500; }
.mode-switch.is-off .switch-orb { background: #7b8588; box-shadow: none; }
.mode-switch.is-off .switch-state { color: #929c9e; }
.board-frame { border: 1px solid #243239; background: linear-gradient(140deg, rgba(20, 30, 33, .92), rgba(11, 17, 22, .96)); box-shadow: 0 25px 70px #0005, inset 0 1px #ffffff08; padding: 12px; border-radius: 8px; }
.board-topline { height: 28px; padding: 0 3px 9px; display: flex; align-items: center; justify-content: space-between; color: #75847f; font-size: 8px; }
.board-topline > span:first-child { display: flex; align-items: center; gap: 7px; }
.mini-dot { width: 5px; height: 5px; }
.board-topline #gameState { color: var(--green); }
.board-wrap { position: relative; overflow: hidden; border-radius: 4px; background: #0b1517; line-height: 0; }
canvas { width: 100%; height: auto; aspect-ratio: 1; display: block; }
.board-overlay { position: absolute; inset: 0; z-index: 2; background: rgba(5, 10, 12, .72); backdrop-filter: blur(4px); display: grid; place-items: center; line-height: 1.5; }
.board-overlay[hidden] { display: none; }
.overlay-card { width: min(330px, calc(100% - 34px)); text-align: center; padding: 29px 24px 26px; border: 1px solid #34483d; border-radius: 8px; background: rgba(13, 22, 21, .94); box-shadow: 0 18px 60px #0008; }
.overlay-mark { display: inline-grid; place-items: center; width: 39px; height: 39px; border: 1px solid #49683b; border-radius: 50%; color: var(--green); font-size: 21px; margin-bottom: 15px; }
.overlay-kicker { color: var(--green); font: 9px var(--mono); letter-spacing: .09em; margin: 0 0 8px; }
.overlay-card h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.04em; }
.overlay-card > p:not(.overlay-kicker) { margin: 0 auto 19px; max-width: 245px; color: #9ba9a4; font-size: 12px; }
.overlay-actions { display: grid; justify-items: center; gap: 8px; }
.button { border: 0; border-radius: 5px; cursor: pointer; font-weight: 700; font-size: 12px; padding: 0 16px; height: 42px; display: inline-flex; gap: 9px; align-items: center; justify-content: center; transition: transform .16s, background .16s, border-color .16s; }
.button[hidden] { display: none; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { background: var(--green); color: #12200f; box-shadow: 0 5px 20px #a9f36c19; }
.button-primary:hover { background: #bcff83; }
.button-primary span:last-child { font-size: 16px; }
.button-secondary { background: #172126; border: 1px solid #2a373c; color: #c1ccc8; }
.button-secondary:hover { background: #202e32; border-color: #43564e; }
.button-log { height: 34px; color: #a9f36c; background: transparent; border: 1px solid #34513a; font-size: 10px; }
.button-log:hover { background: #17241a; border-color: #719d58; }
.sound-settings { height: 42px; display: inline-flex; align-items: center; gap: 8px; padding: 0 9px; border: 1px solid #29383b; border-radius: 5px; background: #111a1e; }
.sound-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: #b8c6be; cursor: pointer; font: 8px var(--mono); letter-spacing: .05em; white-space: nowrap; }
.sound-icon { color: var(--green); font-size: 14px; }
.sound-toggle.is-off, .sound-toggle.is-off .sound-icon { color: #75827e; }
#soundVolume { width: 64px; height: 3px; accent-color: var(--green); cursor: pointer; }
.board-footer { min-height: 32px; padding: 9px 3px 0; display: flex; justify-content: space-between; align-items: center; color: #72817e; font-size: 8px; }
kbd { display: inline-grid; min-width: 19px; height: 17px; place-items: center; padding: 0 4px; border: 1px solid #2b383a; border-radius: 3px; color: #9ba8a3; font: 8px var(--mono); margin-right: 4px; background: #111a1d; }
.board-footer-center { display: flex; align-items: center; gap: 7px; color: #94a29d; }
.footer-pulse { width: 5px; height: 5px; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.control-row { display: flex; align-items: center; gap: 10px; padding-top: 15px; }
.pause-icon { font-size: 14px; letter-spacing: -3px; width: 15px; }
.restart-icon { font-size: 17px; font-weight: 400; }
.keyboard-hint { margin-left: auto; display: flex; align-items: center; gap: 8px; color: #697873; font-size: 9px; }
.key-cluster { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.key-cluster span { display: flex; }
.key-cluster kbd { min-width: 17px; height: 15px; font-size: 8px; margin-right: 1px; }
.side-column { display: flex; flex-direction: column; gap: 14px; padding-top: 43px; }
.stats-card, .brain-card, .record-card, .about-card { border: 1px solid #202d32; border-radius: 7px; background: linear-gradient(145deg, rgba(17, 25, 30, .94), rgba(13, 19, 23, .94)); }
.stats-card { padding: 19px 20px 17px; }
.card-heading { display: flex; justify-content: space-between; font-size: 8px; color: #87938f; }
.card-index { color: #596762; }
.score-block { padding: 22px 0 17px; }
.stat-label { display: block; font-size: 8px; color: #72817c; }
.score-value { display: flex; align-items: baseline; gap: 8px; margin-top: 3px; }
.score-value > span:first-child { font-size: 54px; font-weight: 600; line-height: 1.05; letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.score-unit { color: #87948e; font-size: 11px; }
.stats-divider { height: 1px; background: #222e32; margin-bottom: 9px; }
.metric-row { display: flex; align-items: baseline; justify-content: space-between; color: #899691; font-size: 11px; padding: 7px 0; }
.metric-row strong { color: #dce5e0; font: 13px var(--mono); font-variant-numeric: tabular-nums; }
.metric-row strong small { color: #7b8984; font-size: 9px; }
.metric-row .speed-readout { color: var(--green); }
.speed-track { position: relative; height: 3px; background: #263136; border-radius: 5px; margin: 3px 0 9px; overflow: visible; }
.speed-track span { display: block; width: 7%; height: 100%; background: linear-gradient(90deg, #71bd51, #bbfa72); border-radius: inherit; transition: width .35s; box-shadow: 0 0 9px #a9f36c60; }
.speed-track i { position: absolute; left: 7%; top: -2px; width: 7px; height: 7px; border-radius: 50%; background: #d4ffab; box-shadow: 0 0 8px #bcff83; transition: left .35s; }
.time-row { border-top: 1px solid #202b30; margin-top: 5px; padding-top: 12px; }
.time-row strong { font-size: 11px; color: #aebbb5; }
.brain-card { position: relative; overflow: hidden; padding: 17px 19px 15px; background: linear-gradient(130deg, #14211d, #101a1b 65%, #111b1c); border-color: #293b33; }
.brain-card::after { content: ""; position: absolute; right: -38px; top: 25px; width: 120px; height: 120px; border: 1px solid #a9f36c0c; border-radius: 50%; box-shadow: 0 0 0 13px #a9f36c05, 0 0 0 27px #a9f36c04; pointer-events: none; }
.brain-top { display: flex; align-items: center; gap: 8px; font-size: 8px; color: #92a097; }
.brain-icon { display: grid; place-items: center; width: 19px; height: 19px; background: #25382b; color: var(--green); border-radius: 5px; font-size: 13px; }
.brain-card h2 { position: relative; z-index: 1; margin: 15px 0 6px; font-size: 15px; letter-spacing: -.03em; }
.brain-card > p { position: relative; z-index: 1; margin: 0; max-width: 256px; color: #929f99; font-size: 10px; line-height: 1.65; }
.scanline { height: 1px; background: #293833; margin: 15px 0 10px; }
.scanline span { display: block; width: 34%; height: 1px; background: var(--green); box-shadow: 0 0 7px var(--green); animation: scan 2.4s ease-in-out infinite alternate; }
@keyframes scan { to { transform: translateX(190%); } }
.brain-foot { display: flex; justify-content: space-between; color: #6f8177; font-size: 7px; }
.brain-foot strong { font-weight: 400; color: var(--green); }
.record-card { padding: 13px 15px; display: flex; align-items: center; gap: 11px; }
.record-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #34423c; border-radius: 6px; color: var(--green); font-size: 17px; }
.record-card .stat-label { font-size: 7px; margin-bottom: 3px; }
.record-card strong { font: 14px var(--mono); }
.record-card strong small { color: #82908b; font-size: 9px; }
.record-tag { margin-left: auto; font: 7px var(--mono); color: #83928b; border: 1px solid #34423c; border-radius: 3px; padding: 4px 5px; }
.about-card { padding: 17px 18px 15px; background: rgba(13, 19, 23, .72); }
.about-heading { display: flex; align-items: flex-start; gap: 10px; }
.about-number { padding-top: 3px; color: var(--green); font: 8px var(--mono); }
.about-card h2 { max-width: 220px; margin: 0; font-size: 13px; letter-spacing: -.03em; line-height: 1.45; }
.about-card p { color: #84918d; font-size: 9px; line-height: 1.75; margin: 11px 0 13px 19px; }
.algorithm-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-left: 19px; }
.algorithm-tags span { padding: 4px 5px; border: 1px solid #273438; border-radius: 3px; color: #71817a; font-size: 6px; }
.side-footer { display: flex; justify-content: space-between; color: #596762; font-size: 7px; padding: 2px 1px; }
@media (min-width: 1500px) { .layout { grid-template-columns: minmax(0, 820px) 320px; justify-content: center; } }
@media (max-width: 1050px) { .app-shell { width: min(100% - 48px, 920px); } .layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; } .side-column { padding-top: 39px; } .stats-card { padding-inline: 16px; } }
@media (max-width: 760px) { .app-shell { width: min(100% - 32px, 560px); } .topbar { height: 64px; } .topbar-note { display: none; } .layout { display: flex; flex-direction: column; gap: 28px; padding-top: 32px; } .game-column, .side-column { width: 100%; } .side-column { padding-top: 0; display: grid; grid-template-columns: 1fr 1fr; align-items: start; } .stats-card { grid-row: span 2; } .brain-card, .record-card, .about-card, .side-footer { grid-column: 2; } .about-card { grid-row: 3; } .side-footer { grid-row: 4; } .game-heading { margin-bottom: 16px; } h1 { font-size: clamp(25px, 6vw, 34px); } }
@media (max-width: 520px) { .app-shell { width: calc(100% - 24px); } .top-link { font-size: 8px; } .layout { padding-top: 25px; } .eyebrow { font-size: 7px; margin-bottom: 8px; } h1 { max-width: 230px; line-height: 1.12; } h1 span { display: block; font-size: .83em; margin-top: 2px; } .mode-switch { padding: 0 8px; font-size: 7px; gap: 6px; height: 29px; } .board-frame { padding: 7px; } .board-topline { font-size: 7px; height: 23px; } .board-footer { font-size: 6px; } .board-footer-center { max-width: 52%; text-align: center; justify-content: center; } .board-footer-center #decisionText { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .control-row { flex-wrap: wrap; gap: 7px; padding-top: 10px; } .control-row .button { height: 39px; font-size: 10px; padding: 0 11px; } .sound-settings { height: 39px; padding-inline: 8px; } #soundVolume { width: 54px; } .keyboard-hint { display: none; } .side-column { gap: 9px; grid-template-columns: 1fr; } .stats-card, .brain-card, .record-card, .about-card, .side-footer { grid-column: 1; grid-row: auto; } .stats-card { padding: 15px 17px; } .score-block { padding: 16px 0 11px; } .score-value > span:first-child { font-size: 46px; } .brain-card { padding: 15px 17px 13px; } .record-card { padding: 12px 14px; } .about-card { padding: 15px 16px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
