/* Offline system-font fallback: no external font requests. */

:root {
  --bg: #070914;
  --bg-deep: #04050d;
  --panel: rgba(14, 17, 34, 0.82);
  --panel-solid: #101326;
  --panel-soft: rgba(21, 26, 50, 0.78);
  --line: rgba(128, 142, 202, 0.18);
  --line-bright: rgba(146, 164, 255, 0.36);
  --text: #f3f6ff;
  --muted: #8890ad;
  --dim: #737c9f;
  --cyan: #65f6ed;
  --violet: #9a7cff;
  --pink: #ff659d;
  --yellow: #f4d36f;
  --lime: #b5f66a;
  --danger: #ff5c78;
  --radius: 22px;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 7%, rgba(113, 84, 255, 0.16), transparent 28rem),
    radial-gradient(circle at 7% 93%, rgba(46, 221, 203, 0.09), transparent 30rem),
    linear-gradient(135deg, #070914 0%, #090c1b 46%, #05060f 100%);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: '';
  opacity: 0.14;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

button, input { font: inherit; }
button { color: inherit; }

.ambient { position: fixed; z-index: -1; width: 32rem; height: 32rem; pointer-events: none; border-radius: 50%; filter: blur(90px); opacity: 0.1; }
.ambient-one { top: 16%; left: -21rem; background: var(--cyan); }
.ambient-two { right: -24rem; bottom: 3%; background: var(--pink); }

.app-shell { width: min(1500px, calc(100% - 64px)); margin: 0 auto; padding: 26px 0 24px; }

.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 62px; margin-bottom: 26px; }
.brand { display: inline-flex; align-items: center; gap: 13px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 11px); grid-template-rows: repeat(2, 11px); gap: 3px; width: 29px; height: 29px; transform: rotate(-10deg); }
.brand-mark span { display: block; border: 1px solid rgba(255,255,255,0.7); background: var(--cyan); box-shadow: 0 0 16px rgba(101,246,237,0.45); }
.brand-mark span:nth-child(2) { background: var(--violet); box-shadow: 0 0 16px rgba(154,124,255,0.45); }
.brand-mark span:nth-child(3) { background: var(--pink); box-shadow: 0 0 16px rgba(255,101,157,0.45); }
.brand-mark span:nth-child(4) { background: transparent; border-color: var(--line-bright); }
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: 0.16em; line-height: 1; }
.brand-name em { color: var(--cyan); font-style: normal; }
.brand-subtitle, .eyebrow, .micro-label, .app-footer, .live-chip, .mini-card-key, .overlay-kicker, .overlay-hint, .note-orb + span, .progress-meta, .record-meta, .modal-footer { font-family: var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.brand-subtitle { margin-top: 2px; color: var(--dim); font-size: 10px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.live-chip { display: inline-flex; align-items: center; gap: 9px; min-height: 35px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; }
.live-dot, .footer-center i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px rgba(181,246,106,0.85); }
.live-chip, .live-dot { transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease; }
.live-chip[data-state="ready"] .live-dot { background: var(--muted); box-shadow: none; }
.live-chip[data-state="playing"] { color: var(--text); border-color: rgba(181,246,106,0.35); }
.live-chip[data-state="playing"] .live-dot { animation: live-pulse 1.6s ease-in-out infinite; }
.live-chip[data-state="paused"] { color: var(--yellow); border-color: rgba(244,211,111,0.35); }
.live-chip[data-state="paused"] .live-dot { background: var(--yellow); box-shadow: 0 0 10px rgba(244,211,111,0.75); }
.live-chip[data-state="gameover"] { color: var(--danger); border-color: rgba(255,92,120,0.35); }
.live-chip[data-state="gameover"] .live-dot { background: var(--danger); box-shadow: 0 0 10px rgba(255,92,120,0.75); }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: rgba(14, 17, 34, 0.55); cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.icon-button:hover { border-color: var(--line-bright); background: var(--panel-soft); transform: translateY(-1px); }
.icon-button svg { width: 18px; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 22px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(20, 24, 48, 0.87), rgba(10, 12, 26, 0.92)); box-shadow: 0 22px 70px rgba(0,0,0,0.2), inset 0 1px rgba(255,255,255,0.045); }
.game-stage { min-width: 0; padding: 29px clamp(20px, 3.8vw, 54px) 25px; overflow: hidden; }
.stage-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 9px; color: var(--dim); font-size: 10px; }
.eyebrow-line { display: inline-block; width: 26px; height: 1px; background: var(--line-bright); }
.stage-header h1 { margin: 0; font-size: clamp(26px, 3vw, 42px); line-height: 0.98; letter-spacing: -0.055em; font-weight: 600; }
.stage-header h1 span { color: var(--cyan); }
.stage-score { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; padding-bottom: 1px; }
.micro-label { color: var(--dim); font-size: 10px; }
.stage-score strong { color: var(--text); font-family: var(--mono); font-size: clamp(20px, 2.1vw, 27px); font-weight: 500; letter-spacing: 0.04em; }

.game-wrap { display: flex; justify-content: center; gap: 24px; min-height: 600px; }
.board-frame { --board-h: clamp(420px, 70vh, 600px); position: relative; flex: 0 0 auto; width: calc(var(--board-h) / 2 + 1px); height: var(--board-h); border: 1px solid rgba(147, 166, 255, 0.3); border-radius: 16px; background: #080b18; box-shadow: 0 0 0 5px rgba(4, 6, 14, 0.4), 0 0 48px rgba(62, 74, 177, 0.14), inset 0 0 45px rgba(67, 52, 145, 0.12); overflow: hidden; transition: transform .18s ease; }
.board-frame.screen-shake { animation: screen-shake .28s ease; }
.board-frame::before { position: absolute; inset: 0; z-index: 1; pointer-events: none; content: ''; background: linear-gradient(90deg, rgba(101,246,237,0.04), transparent 25%, transparent 75%, rgba(255,101,157,0.035)); }
.board-topline { position: absolute; top: 0; right: 13px; left: 13px; z-index: 5; display: flex; gap: 4px; height: 4px; }
.board-topline span { flex: 1; background: var(--line-bright); opacity: 0.7; }
.board-topline span:nth-child(2) { background: var(--cyan); }
.board-topline span:nth-child(4) { background: var(--violet); }
#gameCanvas { display: block; width: 100%; height: 100%; image-rendering: auto; }
.board-overlay { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: rgba(6, 8, 18, 0.72); backdrop-filter: blur(5px); transition: opacity .25s ease, visibility .25s ease; }
.board-overlay.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.overlay-grid { position: absolute; inset: 0; opacity: 0.28; background-image: linear-gradient(rgba(120,135,222,0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(120,135,222,0.08) 1px, transparent 1px); background-size: 30px 30px; mask-image: linear-gradient(to bottom, black, transparent 90%); }
.overlay-content { position: relative; width: min(280px, calc(100% - 30px)); padding: 29px 23px 25px; border: 1px solid rgba(151, 164, 254, 0.25); border-radius: 16px; background: rgba(12, 15, 31, 0.87); box-shadow: 0 16px 45px rgba(0,0,0,0.24); text-align: center; }
.overlay-kicker { margin-bottom: 11px; color: var(--cyan); font-size: 10px; }
.overlay-content h2 { margin: 0 0 10px; font-size: 24px; letter-spacing: -0.04em; font-weight: 600; }
.overlay-content p { margin: 0 auto; max-width: 220px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.overlay-content .primary-button { margin-top: 22px; }
.overlay-hint { margin-top: 16px !important; color: var(--dim) !important; font-size: 10px !important; }
.flash-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(101,246,237,0.32), transparent 68%); }
.flash-layer.flash { animation: line-flash .38s ease-out; }
.board-toast { position: absolute; top: 36%; left: 50%; z-index: 6; padding: 10px 18px; border: 1px solid rgba(101,246,237,0.4); border-radius: 12px; color: var(--cyan); background: rgba(8, 11, 24, 0.78); box-shadow: 0 0 32px rgba(101,246,237,0.22); font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: 0.18em; white-space: nowrap; text-shadow: 0 0 14px rgba(101,246,237,0.7); pointer-events: none; opacity: 0; transform: translate(-50%, 10px) scale(.92); transition: opacity .25s ease, transform .25s ease; }
.board-toast.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); }

.side-rail { display: flex; flex-direction: column; width: 155px; gap: 14px; }
.mini-card { padding: 14px 13px 12px; border: 1px solid var(--line); border-radius: 15px; background: rgba(6, 9, 20, 0.54); }
.mini-card-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 9px; border-bottom: 1px solid rgba(134, 149, 222, 0.12); }
.mini-card-key { color: var(--dim); font-size: 10px; }
.mini-canvas-wrap { position: relative; display: grid; place-items: center; min-height: 89px; }
.mini-canvas-wrap canvas { width: 100%; height: auto; max-height: 96px; }
.mini-empty { position: absolute; color: var(--dim); font-family: var(--mono); font-size: 22px; }
.queue-strip { display: flex; justify-content: center; gap: 2px; min-height: 34px; margin: -2px -3px 0; }
.queue-strip canvas { width: 36px; height: 28px; opacity: 0.65; }
.side-rail-note { display: flex; align-items: flex-start; gap: 9px; margin-top: auto; padding: 4px 2px; color: var(--dim); font-family: var(--mono); font-size: 10px; line-height: 1.55; }
.side-rail-note strong { color: var(--violet); font-weight: 500; }
.note-orb { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 12px rgba(154,124,255,0.85); }

.stage-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 25px; padding-top: 17px; border-top: 1px solid var(--line); }
.key-hints { display: flex; flex-wrap: wrap; gap: 17px; color: var(--dim); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.hint-group { display: inline-flex; align-items: center; gap: 5px; }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid rgba(145, 160, 234, 0.23); border-bottom-color: rgba(145, 160, 234, 0.4); border-radius: 5px; color: #abb4da; background: rgba(79, 89, 142, 0.16); font-family: var(--mono); font-size: 10px; line-height: 1; }
.key-hints kbd { color: var(--cyan); }
.key-hints .hint-group:nth-child(2) kbd { color: var(--violet); }
.key-hints .hint-group:nth-child(3) kbd { min-width: 40px; color: var(--pink); }
.secondary-button, .primary-button, .reset-button { border: 0; cursor: pointer; }
.secondary-button { display: inline-flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 13px; border: 1px solid var(--line-bright); border-radius: 9px; color: var(--muted); background: rgba(76, 83, 157, 0.1); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; transition: .2s ease; }
.secondary-button:hover { color: var(--text); border-color: var(--violet); background: rgba(154,124,255,0.14); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 20px; border-radius: 11px; color: #05101a; background: linear-gradient(135deg, var(--cyan), #8fdcff 55%, var(--violet)); box-shadow: 0 10px 28px rgba(101,246,237,0.22), inset 0 1px rgba(255,255,255,0.45); font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; transition: transform .2s ease, box-shadow .2s ease; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(101,246,237,0.34), inset 0 1px rgba(255,255,255,0.5); }
.primary-button:active { transform: translateY(0); }
.primary-button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.button-arrow { font-size: 14px; line-height: 1; transition: transform .2s ease; }
.primary-button:hover .button-arrow { transform: translate(2px, -2px); }
.pause-icon { display: inline-flex; gap: 3px; }
.pause-icon i { display: block; width: 3px; height: 11px; border-radius: 2px; background: currentColor; }
.touch-controls { display: none; }

.info-column { display: flex; flex-direction: column; gap: 14px; }
.info-column .panel { padding: 18px; }
.section-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 17px; }
.section-number { color: var(--cyan); font-family: var(--mono); font-size: 10px; }
.section-heading h2 { margin: 0; color: #c7cce1; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.14em; }
.section-rule { flex: 1; height: 1px; background: var(--line); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid rgba(139, 152, 223, 0.11); border-radius: 11px; overflow: hidden; }
.stat-cell { display: flex; flex-direction: column; gap: 8px; min-height: 78px; padding: 13px; background: rgba(7, 10, 21, 0.24); }
.stat-cell:nth-child(odd) { border-right: 1px solid rgba(139, 152, 223, 0.11); }
.stat-cell:nth-child(-n+2) { border-bottom: 1px solid rgba(139, 152, 223, 0.11); }
.stat-cell strong { color: var(--text); font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: 0.02em; }
.stat-primary strong { color: var(--cyan); }
.combo-cell strong { color: var(--pink); }
.level-progress { margin-top: 16px; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--dim); font-size: 10px; }
.progress-meta span:last-child { color: var(--muted); }
.progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(135, 146, 211, 0.14); }
.progress-track span { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--cyan)); box-shadow: 0 0 12px rgba(101,246,237,0.55); transition: width .25s ease; }
.control-list { display: flex; flex-direction: column; gap: 12px; }
.control-row { display: flex; align-items: center; justify-content: space-between; color: var(--dim); font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
.control-row > span:last-child { color: #9da5c1; }
.control-name { display: inline-flex; align-items: center; gap: 4px; }
.control-row kbd { min-width: 22px; color: var(--violet); }
.record-card { position: relative; min-height: 109px; padding: 17px 18px; overflow: hidden; border: 1px solid rgba(101,246,237,0.25); border-radius: 15px; background: linear-gradient(135deg, rgba(38, 83, 93, 0.34), rgba(11, 20, 39, 0.84)); box-shadow: inset 0 1px rgba(255,255,255,0.08); }
.record-noise { position: absolute; inset: 0; opacity: 0.26; background-image: linear-gradient(120deg, transparent 25%, rgba(101,246,237,0.22) 25.5%, transparent 26%, transparent 65%, rgba(255,101,157,0.18) 65.5%, transparent 66%); background-size: 86px 86px; }
.record-content { position: relative; }
.record-score { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.record-score > span:first-child { color: var(--cyan); font-family: var(--mono); font-size: 25px; letter-spacing: 0.02em; }
.record-unit { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.record-meta { display: flex; justify-content: space-between; margin-top: 9px; color: var(--muted); font-size: 10px; }
.record-mark { position: absolute; right: 17px; bottom: 13px; color: rgba(101,246,237,0.55); font-size: 23px; transform: rotate(18deg); }
.reset-button { align-self: flex-end; padding: 0 3px; color: var(--dim); background: transparent; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; transition: color .2s ease; }
.reset-button:hover { color: var(--cyan); }
.reset-button span { margin-right: 5px; font-size: 15px; vertical-align: -1px; }
.app-footer { display: flex; justify-content: space-between; margin-top: 18px; padding: 0 4px; color: var(--dim); font-size: 9px; }
.footer-center { display: inline-flex; align-items: center; gap: 7px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(3, 4, 12, 0.75); backdrop-filter: blur(8px); }
.modal-backdrop[hidden] { display: none; }
.settings-modal { width: min(460px, 100%); border: 1px solid var(--line-bright); border-radius: 20px; background: #0c1022; box-shadow: 0 28px 90px rgba(0,0,0,0.55); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 23px 23px 18px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 3px 0 0; font-size: 25px; font-weight: 600; letter-spacing: -0.04em; }
.modal-close { border-color: var(--line); font-size: 25px; font-weight: 300; }
.settings-list { padding: 8px 23px; }
.setting-row { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid rgba(139,152,223,0.11); cursor: pointer; }
.setting-row:last-child { border-bottom: 0; }
.setting-row > span:first-child { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.setting-row strong { font-size: 14px; font-weight: 500; }
.setting-row small { color: var(--muted); font-size: 12px; }
.setting-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { position: relative; flex: 0 0 auto; width: 41px; height: 23px; border-radius: 999px; background: rgba(131,143,202,0.2); transition: background .2s ease; }
.toggle-ui::after { position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; content: ''; border-radius: 50%; background: var(--muted); transition: transform .2s ease, background .2s ease; }
.setting-row input:checked + .toggle-ui { background: rgba(101,246,237,0.25); }
.setting-row input:focus-visible + .toggle-ui { outline: 2px solid var(--cyan); outline-offset: 3px; }
.setting-row input:checked + .toggle-ui::after { background: var(--cyan); transform: translateX(18px); box-shadow: 0 0 10px rgba(101,246,237,0.55); }
.modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 23px 21px; color: var(--dim); font-size: 9px; }

@keyframes line-flash { 0% { opacity: 0; transform: scale(.78); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.12); } }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes screen-shake { 0%, 100% { transform: translate(0); } 25% { transform: translate(2px, -1px); } 50% { transform: translate(-2px, 1px); } 75% { transform: translate(1px, 0); } }

body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }

@media (max-width: 980px) {
  .app-shell { width: min(760px, calc(100% - 32px)); }
  .game-layout { grid-template-columns: 1fr; }
  .info-column { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .info-column .record-card, .info-column .reset-button { grid-column: span 2; }
  .info-column .reset-button { justify-self: end; }
  .game-wrap { min-height: 0; }
}

@media (max-width: 610px) {
  .app-shell { width: calc(100% - 24px); padding-top: 15px; }
  .topbar { margin-bottom: 15px; }
  .brand-name { font-size: 14px; }
  .brand-subtitle { font-size: 9px; }
  .live-chip { padding: 0 9px; font-size: 9px; }
  .icon-button { width: 35px; height: 35px; }
  .game-stage { padding: 21px 13px 15px; border-radius: 18px; }
  .stage-header { margin: 0 6px 18px; }
  .stage-header h1 { font-size: 28px; }
  .stage-score strong { font-size: 19px; }
  .stage-score .micro-label { font-size: 9px; }
  .game-wrap { gap: 10px; align-items: stretch; }
  .board-frame { --board-w: min(calc(100vw - 119px), 296px); width: var(--board-w); height: calc(var(--board-w) * 2 - 2px); }
  .side-rail { width: 91px; gap: 8px; }
  .mini-card { padding: 9px 7px 8px; border-radius: 11px; }
  .mini-card-header { padding-bottom: 6px; }
  .mini-card .micro-label { font-size: 9px; }
  .mini-card-key { display: none; }
  .mini-canvas-wrap { min-height: 62px; }
  .queue-strip { display: none; }
  .side-rail-note { display: none; }
  .stage-footer { margin-top: 16px; padding-top: 13px; }
  .key-hints { gap: 7px; font-size: 9px; }
  .hint-group { gap: 3px; }
  .key-hints .hint-group:nth-child(2), .key-hints .hint-group:nth-child(3) { display: none; }
  .stage-footer .secondary-button { min-height: 31px; padding: 0 10px; font-size: 9px; }
  .touch-controls { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-areas: 'hold left rotate right down' 'hold drop drop drop down'; gap: 7px; margin-top: 12px; }
  .touch-button { min-height: 38px; border: 1px solid var(--line-bright); border-radius: 9px; color: var(--muted); background: rgba(81, 92, 165, 0.13); font-family: var(--mono); font-size: 10px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .touch-button:active, .touch-button.is-pressed { color: var(--cyan); border-color: var(--cyan); background: rgba(101,246,237,0.16); transform: translateY(1px); }
  .touch-hold { grid-area: hold; }
  .touch-button[data-action="left"] { grid-area: left; }
  .touch-rotate { grid-area: rotate; color: var(--violet); }
  .touch-button[data-action="right"] { grid-area: right; }
  .touch-down { grid-area: down; }
  .touch-drop { grid-area: drop; color: var(--pink); }
  .info-column { grid-template-columns: 1fr 1fr; gap: 9px; }
  .info-column .panel { padding: 13px; border-radius: 15px; }
  .section-heading { margin-bottom: 12px; gap: 6px; }
  .section-heading h2 { font-size: 10px; }
  .section-number { font-size: 10px; }
  .stat-cell { min-height: 66px; padding: 10px; }
  .stat-cell strong { font-size: 16px; }
  .stat-cell .micro-label { font-size: 9px; }
  .level-progress { margin-top: 11px; }
  .progress-meta { font-size: 9px; }
  .control-list { gap: 8px; }
  .control-row { font-size: 9px; }
  .control-row kbd { min-width: 19px; height: 18px; font-size: 9px; }
  .info-column .record-card { min-height: 96px; padding: 14px; }
  .record-score { margin-top: 7px; }
  .record-score > span:first-child { font-size: 21px; }
  .modal-footer { flex-direction: column; align-items: flex-start; }
  .modal-footer .secondary-button { align-self: flex-end; }
  .app-footer { font-size: 9px; }
  .app-footer > span:last-child { display: none; }
}

@media (max-width: 390px) {
  .board-frame { --board-w: min(calc(100vw - 111px), 296px); }
  .side-rail { width: 83px; }
  .stage-header h1 { font-size: 24px; }
  .key-hints .hint-group:first-child span { display: none; }
  .record-meta { font-size: 9px; }
}

[hidden] { display:none !important; }
.board-overlay.is-hidden { visibility:hidden; }
progress.progress-track { width:100%; border:0; }
progress::-webkit-progress-bar { background:#161b32; }
progress::-webkit-progress-value { background:#65f6ed; }
.flash-layer { background:radial-gradient(ellipse at center, rgba(101,246,237,.32), transparent 68%); }
.flash-layer.tetris-flash { background:radial-gradient(ellipse at center, rgba(255,101,157,.42), transparent 68%); }
