:root {
  color-scheme: dark;
  --bg: #080a10;
  --ink: #e8edf7;
  --muted: #727c93;
  --line: #202637;
  --lime: #c1ff56;
  --cyan: #5fddff;
  --board-width: min(300px, calc((100svh - 224px) / 2));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
body:before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 50% 35%, #2423443b, transparent 62%); }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; }
button { color: inherit; }
svg { width: 19px; height: 19px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.page-shell { width: min(1120px, 100%); margin: 0 auto; padding: 0 36px; }
.site-header { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark { display: flex; gap: 6px; align-items: center; font-size: 21px; letter-spacing: -1px; font-weight: 850; font-style: italic; }
.wordmark>span:not(.brand-blocks) { color: var(--lime); }
.wordmark sup { font: 9px ui-monospace, monospace; color: var(--muted); border: 1px solid #343c4d; padding: 4px 6px; margin-left: 7px; letter-spacing: 1px; }
.brand-blocks { position: relative; width: 22px; height: 23px; margin-right: 6px; transform: rotate(-7deg); }
.brand-blocks i { position: absolute; width: 7px; height: 7px; background: var(--lime); }
.brand-blocks i:nth-child(1) { left: 7px; top: 0; }
.brand-blocks i:nth-child(2) { left: 0; top: 8px; }
.brand-blocks i:nth-child(3) { left: 7px; top: 8px; }
.brand-blocks i:nth-child(4) { left: 14px; top: 8px; }
.back-link { color: #8e98ad; font: 10px ui-monospace, monospace; letter-spacing: 1px; display: flex; gap: 12px; }
.back-link:hover { color: var(--ink); }
main { padding: 20px 0 24px; }
.game-layout { display: grid; grid-template-columns: 168px calc(var(--board-width) + 20px) 168px; justify-content: center; gap: 30px; align-items: start; }
.left-column, .right-column { padding-top: 42px; min-width: 0; }
.panel-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 1.7px; }
.score-value { display: block; margin: 13px 0 10px; color: var(--ink); font: 600 37px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.best-row { display: flex; justify-content: space-between; gap: 10px; font: 9px ui-monospace, monospace; letter-spacing: 1px; color: #858fa5; }
.best-row>span:last-child { color: #a0aac0; }
.stats-grid { display: flex; margin-top: 31px; gap: 34px; }
.stats-grid>div { display: flex; flex-direction: column; gap: 9px; }
.stats-grid span { font: 9px ui-monospace, monospace; letter-spacing: 1px; color: var(--muted); }
.stats-grid strong { font: 500 24px ui-monospace, monospace; }
.level-track { height: 2px; background: var(--line); margin-top: 17px; }
.level-track>span { display: block; height: 100%; background: var(--cyan); box-shadow: 0 0 7px #5fddff66; transition: width .25s; }
kbd { font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; color: #a1abc1; border: 1px solid #30384c; background: #141925; padding: 3px 5px; border-radius: 3px; line-height: 1; }
.hold-card { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.hold-piece { background: #10141d; border: 1px solid #212a3c; border-radius: 5px; padding: 0; position: relative; width: 100%; margin-top: 12px; height: 72px; display: block; }
.hold-piece:hover:not(:disabled) { border-color: #5fddff77; }
.hold-piece:disabled { opacity: .55; }
#hold-canvas { display: block; width: 100%; height: 72px; object-fit: contain; }
#hold-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #485169; font: 17px ui-monospace, monospace; }
.pulse-card { margin-top: 31px; }
#energy { color: var(--lime); font-size: 10px; letter-spacing: .5px; }
.energy-track { height: 4px; border-radius: 2px; background: #242b39; margin-top: 12px; overflow: hidden; }
.energy-track>span { display: block; height: 100%; width: 100%; background: var(--lime); transition: width .2s; }
.pulse-button { width: 100%; border: 1px solid #333e36; background: #182216; margin-top: 13px; min-height: 44px; border-radius: 4px; display: flex; align-items: center; gap: 9px; padding: 0 11px; font-size: 11px; color: var(--lime); transition: background .2s, box-shadow .2s; }
.pulse-button kbd { margin-left: auto; color: #b6c8a4; background: transparent; border-color: #4a5842; }
.pulse-button svg { width: 17px; height: 17px; }
.pulse-button:disabled { color: #697260; background: #11170f; border-color: #263024; }
.pulse-card.ready .pulse-button { border-color: #9acd43; box-shadow: inset 0 0 18px #c1ff5608, 0 0 15px #c1ff5612; }
.pulse-card.ready .pulse-button:hover { background: #253719; box-shadow: 0 0 22px #c1ff5620; }
.charge-note { display: block; font-size: 9px; letter-spacing: .4px; color: #646e80; margin-top: 10px; }
.board-toolbar { height: 32px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; padding: 0 3px; }
#game-state { display: flex; align-items: center; gap: 7px; color: #8996ad; font: 9px ui-monospace, monospace; letter-spacing: 1.3px; }
.live-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 6px #c1ff5680; }
.toolbar-actions { display: flex; gap: 8px; }
.icon-button { display: grid; place-items: center; width: 27px; height: 28px; padding: 0; color: #9ba7be; border: none; background: transparent; }
.icon-button svg { width: 15px; height: 15px; }
.icon-button:hover:not(:disabled) { color: var(--cyan); }
.icon-button:disabled { opacity: .25; }
.board-frame { position: relative; width: calc(var(--board-width) + 20px); padding: 9px; border: 1px solid #3b485b; border-radius: 5px; background: linear-gradient(145deg, #1d2532, #11151e 35%, #151c29); box-shadow: 0 0 0 3px #0b0e15, 0 0 0 4px #1c2432, 0 0 60px #5fddff07, 0 22px 60px #0007; }
.board-frame:before, .board-frame:after { content: ''; position: absolute; width: 23px; height: 23px; pointer-events: none; z-index: 3; }
.board-frame:before { left: -2px; top: -2px; border-left: 2px solid var(--cyan); border-top: 2px solid var(--cyan); }
.board-frame:after { right: -2px; bottom: -2px; border-right: 2px solid var(--lime); border-bottom: 2px solid var(--lime); }
#board { display: block; width: var(--board-width); height: calc(var(--board-width) * 2); background: #0a0c14; }
.board-overlay { position: absolute; inset: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; background: linear-gradient(#0a0c14c4, #0a0c14ee 72%); text-align: center; backdrop-filter: blur(4px); z-index: 2; }
.overlay-eyebrow { font: 9px ui-monospace, monospace; letter-spacing: 3.4px; color: var(--cyan); margin-bottom: 14px; }
.board-overlay h1 { font: 900 clamp(33px, 4vw, 48px)/1.1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-style: italic; letter-spacing: -2px; margin: 0; color: var(--ink); }
.board-overlay h1 span { color: var(--lime); }
.board-overlay p { color: #939fb5; font-size: 11px; line-height: 1.8; margin: 17px 0 25px; }
.primary-button { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-width: 150px; border: 0; padding: 14px 18px; border-radius: 3px; color: #0e1707; background: var(--lime); font-size: 12px; font-weight: 650; box-shadow: 0 0 24px #c1ff5618; }
.primary-button:hover { background: #d3ff8c; }
.primary-button svg { width: 16px; height: 16px; }
.overlay-secondary { background: transparent; border: 0; color: #abb4c5; font-size: 11px; margin-top: 17px; }
.overlay-secondary:hover { color: var(--ink); }
.overlay-footnote { color: #58657c; font: 8px ui-monospace, monospace; margin-top: 25px; letter-spacing: .5px; }
.board-toast { position: absolute; top: 45%; left: 0; right: 0; text-align: center; pointer-events: none; z-index: 1; color: var(--lime); text-shadow: 0 0 20px #c1ff5680; font: 800 23px ui-monospace, monospace; opacity: 0; }
.board-toast.show { animation: toast .85s ease-out both; }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 18%, 55% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-12px); } }
.board-bottom { display: flex; justify-content: space-between; margin-top: 11px; padding: 0 2px; color: #505c73; font: 8px ui-monospace, monospace; letter-spacing: 1px; }
.next-card>canvas { display: block; width: 100%; height: auto; margin-top: 12px; }
.camera-panel { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 19px; }
.camera-button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 8px 0; background: transparent; border: 0; color: #a0acc3; font-size: 11px; text-align: left; }
.camera-button:hover { color: var(--cyan); }
.camera-button svg { width: 16px; height: 16px; }
.button-plus { margin-left: auto; color: #7b88a1; }
.camera-privacy { display: block; color: #525e74; font-size: 9px; line-height: 1.6; margin-top: 6px; }
.camera-preview { margin-top: 15px; position: relative; width: 100%; aspect-ratio: 4 / 3; background: #101520; border: 1px solid #29334a; overflow: hidden; }
.camera-preview video, .camera-preview canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.camera-preview video { transform: scaleX(-1); opacity: .6; }
.camera-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #35455b; }
.camera-badge { position: absolute; bottom: 7px; left: 7px; color: #c5d5e8; font: 6px ui-monospace, monospace; letter-spacing: 1px; }
.tracking-meter { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #263344; }
.tracking-meter>span { display: block; height: 100%; width: 0; background: var(--cyan); }
.camera-status { color: #6d7b95; font-size: 9px; line-height: 1.7; margin: 8px 0 0; overflow-wrap: anywhere; }
.camera-status:empty { display: none; }
.camera-status.error { color: #ff9eaa; }
.camera-guide { color: #8b98b0; font-size: 10px; line-height: 2; margin-top: 10px; }
.controls-guide { max-width: 750px; margin: 24px auto 0; text-align: center; }
.controls-guide p { display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: 7px 17px; font-size: 9px; color: #71809a; margin: 0; line-height: 1.8; }
.controls-guide p span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.controls-guide p+p { margin-top: 11px; font-size: 10px; color: #8e9baf; gap: 7px; }
.controls-guide p+p kbd { color: var(--lime); border-color: #425330; }
.touch-controls { display: none; }
.secret { position: absolute; inset: 9px; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; background: #0a0c14eb; }
.secret>span { color: #ff6d9f; font-size: 60px; text-shadow: 0 0 40px #ff6d9f55; }
.secret strong { font: 600 26px ui-monospace, monospace; letter-spacing: 5px; }
.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; }
.noscript { text-align: center; color: var(--lime); font-size: 14px; }
@media(max-width: 900px) and (min-width: 541px) {
  .page-shell { padding: 0 24px; }
  .game-layout { grid-template-columns: 138px calc(var(--board-width) + 20px) 138px; gap: 20px; }
  .score-value { font-size: 31px; }
  .stats-grid { gap: 25px; }
  .pulse-button { gap: 6px; padding: 0 8px; font-size: 10px; }
}
@media(max-width: 760px) and (min-width: 541px) {
  :root { --board-width: min(270px, calc(100vw - 314px), calc((100svh - 224px) / 2)); }
  .game-layout { grid-template-columns: 115px calc(var(--board-width) + 20px) 115px; gap: 14px; }
  .page-shell { padding: 0 18px; }
  .score-value { font-size: 27px; }
  .stats-grid { gap: 17px; }
  .pulse-button kbd { display: none; }
  .camera-privacy { font-size: 8px; }
}
@media(max-width: 540px) {
  :root { --board-width: min(calc(100vw - 114px), calc((100svh - 314px) / 2)); }
  .page-shell { padding: 0 16px; }
  .site-header { height: 58px; }
  .wordmark { font-size: 18px; gap: 4px; }
  .wordmark sup { font-size: 7px; padding: 3px 5px; margin-left: 5px; }
  .back-link { font-size: 8px; gap: 7px; }
  main { padding: 15px 0 18px; }
  .game-layout { grid-template-columns: calc(var(--board-width) + 14px) 56px; gap: 12px; }
  .left-column { grid-column: 1 / -1; padding: 0; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
  .score-card { display: grid; grid-template-columns: auto auto auto; align-items: center; column-gap: 15px; }
  .score-card>.panel-label { display: none; }
  .score-value { font-size: 25px; margin: 0; letter-spacing: -1.5px; }
  .best-row { font-size: 7px; gap: 5px; flex-direction: column; }
  .stats-grid { margin: 0; gap: 12px; }
  .stats-grid>div { gap: 3px; }
  .stats-grid span { font-size: 6px; letter-spacing: .5px; }
  .stats-grid strong { font-size: 15px; }
  .level-track { display: none; }
  .hold-card { margin-top: 14px; padding-top: 12px; }
  .hold-piece, #hold-canvas { height: 40px; }
  .pulse-card { margin: 0; position: relative; width: 88px; }
  .pulse-card>.panel-label { position: absolute; right: 5px; top: 7px; font-size: 0; letter-spacing: 0; pointer-events: none; }
  #energy { font-size: 7px; }
  .pulse-button { height: 33px; min-height: 0; margin: 0; padding: 0 5px; gap: 4px; font-size: 9px; }
  .pulse-button>span { font-size: 0; }
  .pulse-button>span:after { content: '脉冲'; font-size: 9px; }
  .pulse-button svg { width: 13px; height: 13px; }
  .pulse-button kbd, .charge-note { display: none; }
  .energy-track { position: absolute; bottom: 0; left: 1px; right: 1px; height: 2px; margin: 0; }
  .play-column { grid-column: 1; grid-row: 2; min-width: 0; }
  .board-toolbar { height: 25px; margin-bottom: 7px; }
  #game-state { font-size: 7px; letter-spacing: .7px; gap: 5px; }
  .toolbar-actions { gap: 4px; }
  .icon-button { width: 24px; height: 25px; }
  .icon-button svg { width: 13px; height: 13px; }
  .board-frame { padding: 6px; width: calc(var(--board-width) + 14px); border-radius: 3px; }
  .board-overlay, .secret { inset: 6px; }
  .board-overlay { padding: 20px 8px; }
  .board-overlay h1 { font-size: 34px; }
  .board-overlay p { font-size: 10px; margin: 14px 0 20px; }
  .overlay-eyebrow { font-size: 7px; letter-spacing: 2.5px; }
  .primary-button { min-width: 125px; font-size: 11px; padding: 12px 15px; }
  .overlay-footnote { font-size: 6px; letter-spacing: 0; margin-top: 20px; }
  .board-bottom { font-size: 6px; margin-top: 8px; }
  .right-column { grid-column: 2; grid-row: 2; padding-top: 35px; }
  .panel-label { font-size: 7px; letter-spacing: 1px; }
  .next-card>canvas { width: 56px; height: 175px; margin-top: 8px; }
  .camera-panel { margin-top: 14px; padding-top: 12px; }
  .camera-button { justify-content: center; padding: 8px; border: 1px solid #29334a; border-radius: 3px; }
  .camera-button>span { display: none; }
  .camera-button svg { width: 16px; height: 16px; }
  .camera-privacy { font-size: 7px; text-align: center; margin-top: 8px; }
  .camera-preview { width: 56px; height: 60px; aspect-ratio: auto; }
  .camera-badge { font-size: 4px; left: 2px; bottom: 5px; letter-spacing: 0; }
  .camera-status { font-size: 7px; line-height: 1.5; }
  .camera-guide { font-size: 7px; line-height: 1.8; }
  .touch-controls { display: flex; gap: 6px; margin-top: 13px; }
  .touch-controls button { flex: 1; height: 42px; display: grid; place-items: center; padding: 0; border: 1px solid #2c364b; background: #141b29; border-radius: 4px; color: #9aabc8; touch-action: none; }
  .touch-controls button:last-child { color: var(--lime); border-color: #485e32; background: #1a2413; }
  .touch-controls button:active { background: #273951; color: #fff; }
  .touch-controls button:disabled { opacity: .35; }
  .touch-controls svg { width: 17px; height: 17px; }
  .controls-guide { margin-top: 17px; }
  .controls-guide p { gap: 6px 10px; font-size: 8px; }
  .controls-guide kbd { font-size: 7px; padding: 3px; }
  .controls-guide p+p { font-size: 8px; line-height: 1.8; margin-top: 10px; }
}
.flip { transform: rotate(180deg); }
@media(pointer: coarse) and (min-width: 541px) {
  .touch-controls { display: flex; gap: 7px; margin-top: 14px; }
  .touch-controls button { flex: 1; height: 42px; border: 1px solid #2c364b; border-radius: 4px; background: #141b29; display: grid; place-items: center; touch-action: none; }
}
@media(prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
