.game-workspace {
  --game-well: #0c1325;
  --game-grid: #090f1e;
  --game-cell: #151f36;
  --game-tile-two: #263653;
  --game-tile-four: #303e6a;
  --game-tile-ink: #e8edff;
  --game-cyan: #7cdef4;
  --game-soft-glow: rgba(115, 133, 248, .1);
  --game-shadow: rgba(0, 0, 0, .2);
  --reaction-idle: #14203a;
  --reaction-idle-ink: #d5e0ff;
  --reaction-wait: #2c244a;
  --reaction-wait-ink: #e0c4ff;
  --reaction-early: #3b2438;
  --reaction-early-ink: #ffafca;
  --reaction-pause: #1b2539;
  --reaction-pause-ink: #b5c0d8;
  --reaction-finish: #203a50;
  --reaction-finish-ink: #b7edff;
  color: var(--ink);
  animation: game-panel-in .32s ease-out both;
}
[data-theme="light"] .game-workspace {
  --game-well: #f1f5ff;
  --game-grid: #dce4f5;
  --game-cell: #cdd8ed;
  --game-tile-two: #f4f7ff;
  --game-tile-four: #e2e7ff;
  --game-tile-ink: #344478;
  --game-cyan: #1b708d;
  --game-soft-glow: rgba(100, 119, 222, .07);
  --game-shadow: rgba(44, 64, 122, .09);
  --reaction-idle: #ebf0ff;
  --reaction-idle-ink: #354d85;
  --reaction-wait: #eee7ff;
  --reaction-wait-ink: #67439c;
  --reaction-early: #ffeaf2;
  --reaction-early-ink: #a83359;
  --reaction-pause: #e9edf5;
  --reaction-pause-ink: #5b6b88;
  --reaction-finish: #e2f1fc;
  --reaction-finish-ink: #235a82;
}
.game-workspace [hidden] { display: none !important; }
.game-columns { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.game-play-panel, .game-guide { border: 1px solid var(--line); border-radius: var(--radius, 20px); background: linear-gradient(145deg, var(--game-soft-glow), transparent 55%), var(--surface); box-shadow: inset 0 1px 0 rgba(170, 190, 255, .045), 0 12px 40px var(--game-shadow); }
.game-play-panel { padding: 28px; min-width: 0; }
.game-scorebar { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.game-eyebrow { display: block; color: var(--game-cyan); font-size: 10px; font-weight: 650; letter-spacing: .12em; }
.game-workspace h2 { font-size: 21px; line-height: 1.5; letter-spacing: -.04em; margin: 8px 0 0; font-weight: 650; }
.game-scores { display: flex; gap: 8px; }
.game-scores > div { min-width: 80px; padding: 11px 15px; background: var(--game-well); border: 1px solid var(--line); border-radius: 12px; box-shadow: inset 0 1px 0 rgba(170, 190, 255, .04); }
.game-scores span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.game-scores strong { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 17px; font-weight: 650; white-space: nowrap; color: var(--accent); font-variant-numeric: tabular-nums; }
.game-board-wrap { max-width: 420px; margin: 0 auto; }
.game-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 9px; aspect-ratio: 1; border-radius: 19px; padding: 12px; border: 1px solid var(--line); background: var(--game-grid); box-shadow: inset 0 2px 14px var(--game-shadow), 0 0 35px var(--game-soft-glow); touch-action: none; user-select: none; -webkit-user-select: none; outline-offset: 5px; }
.game-board:focus-visible, .reaction-pad:focus-visible { outline: 3px solid var(--accent); }
.game-tile { display: flex; align-items: center; justify-content: center; min-width: 0; border-radius: 11px; background: var(--game-cell); font-family: ui-rounded, 'SF Pro Rounded', system-ui, sans-serif; font-size: clamp(22px, 3.5vw, 39px); font-weight: 740; color: var(--game-tile-ink); font-variant-numeric: tabular-nums; }
.game-tile-filled { animation: game-tile-in 160ms cubic-bezier(.18, .7, .3, 1); box-shadow: inset 0 1px 0 rgba(220, 230, 255, .14), 0 4px 9px rgba(0, 0, 0, .1); }
.game-tile[data-value="2"] { background: var(--game-tile-two); }
.game-tile[data-value="4"] { background: var(--game-tile-four); }
.game-tile[data-value="8"] { background: linear-gradient(145deg, #405eaa, #344c8b); color: #f3f6ff; }
.game-tile[data-value="16"] { background: linear-gradient(145deg, #5d64cc, #4850aa); color: #f6f5ff; }
.game-tile[data-value="32"] { background: linear-gradient(145deg, #7a65d8, #6150b6); color: #fff; }
.game-tile[data-value="64"] { background: linear-gradient(145deg, #9766cc, #784bab); color: #fff; }
.game-tile[data-value="128"] { background: linear-gradient(145deg, #a954ba, #84439d); color: #fff; font-size: clamp(21px, 3.1vw, 34px); }
.game-tile[data-value="256"] { background: linear-gradient(145deg, #7762ca, #5b4ba5); color: #fff; font-size: clamp(21px, 3.1vw, 34px); }
.game-tile[data-value="512"] { background: linear-gradient(145deg, #4b79c9, #355fa8); color: #fff; font-size: clamp(21px, 3.1vw, 34px); }
.game-tile[data-value="1024"] { background: linear-gradient(145deg, #287d9f, #216786); color: #f1fbff; font-size: clamp(17px, 2.7vw, 29px); }
.game-tile[data-value="2048"] { background: linear-gradient(145deg, #8de5f4, #42bfda); color: #0b354b; font-size: clamp(17px, 2.7vw, 29px); box-shadow: inset 0 0 0 1px #d7faff88, 0 0 20px #6cdbf340; }
.game-tile[data-value="4096"] { background: linear-gradient(145deg, #a7b8ff, #8973e9); color: #202c57; font-size: clamp(15px, 2.6vw, 25px); box-shadow: inset 0 1px 0 #e2e8ff66, 0 0 20px #9187ff30; }
.game-status { min-height: 42px; margin: 18px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.65; text-align: center; display: flex; align-items: center; justify-content: center; }
.game-status-highlight { padding: 10px 15px; background: var(--accent-soft); border: 1px solid var(--line); border-radius: 12px; color: var(--accent); animation: game-panel-in .25s ease-out both; }
.game-actions { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.game-workspace .btn { transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.game-workspace .btn:active { transform: translateY(1px); }
.game-dpad { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-top: 20px; }
.game-dpad > div { display: flex; gap: 5px; }
.game-dpad .btn { padding: 0; min-height: 40px; min-width: 49px; font-size: 20px; border-radius: 9px; }
.game-key-hint { text-align: center; color: var(--muted); margin: 13px 0 0; font-size: 10px; }
.game-guide { padding: 26px 24px; background: radial-gradient(ellipse at 100% 0, var(--game-soft-glow), transparent 70%), var(--surface); }
.game-guide h3 { font-size: 23px; letter-spacing: -.04em; line-height: 1.6; font-weight: 550; margin: 18px 0 14px; }
.game-guide p, .game-guide li { color: var(--muted); font-size: 12px; line-height: 1.95; }
.game-guide ol { padding-left: 18px; margin: 22px 0; }
.game-guide li { padding-left: 3px; margin-bottom: 10px; }
.game-tip { border-radius: 12px; background: var(--game-well); border: 1px solid var(--line); border-left: 2px solid var(--accent); padding: 15px 16px; margin: 24px 0; }
.game-tip > span { color: var(--accent); font-size: 11px; font-weight: 650; }
.game-tip p { margin: 6px 0 0; color: var(--accent); }
.game-local-note { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; line-height: 1.8; }
.game-local-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--game-cyan); box-shadow: 0 0 7px var(--game-soft-glow); flex-shrink: 0; }
.game-clear { display: block; padding: 0; margin-top: 12px; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font: inherit; font-size: 10px; cursor: pointer; }
.game-clear:hover { color: var(--ink); }
.game-guide .game-clear-note { font-size: 10px; }
.game-guide .game-small-print { font-size: 10px; line-height: 1.8; margin: 20px 0; }
.reaction-pad { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 350px; padding: 34px 20px; border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(ellipse at 50% 0, var(--game-soft-glow), transparent 70%), var(--reaction-idle); color: var(--reaction-idle-ink); cursor: pointer; user-select: none; -webkit-user-select: none; text-align: center; overflow: hidden; outline-offset: 4px; touch-action: manipulation; }
.reaction-pad::before { content: ''; position: absolute; z-index: -1; inset: 0; background-image: linear-gradient(rgba(140, 165, 240, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(140, 165, 240, .055) 1px, transparent 1px); background-size: 30px 30px; mask-image: linear-gradient(transparent, #000); pointer-events: none; }
/* The ready signal changes immediately: no color transition or timing animation. */
.reaction-pad[data-state="waiting"] { background: var(--reaction-wait); color: var(--reaction-wait-ink); }
.reaction-pad[data-state="ready"] { background: #39dabc; color: #073d38; border-color: #75efd3; box-shadow: inset 0 0 45px rgba(222, 255, 244, .2), 0 0 26px rgba(57, 218, 188, .14); }
.reaction-pad[data-state="early"] { background: var(--reaction-early); color: var(--reaction-early-ink); }
.reaction-pad[data-state="paused"] { background: var(--reaction-pause); color: var(--reaction-pause-ink); }
.reaction-pad[data-state="complete"] { background: var(--reaction-finish); color: var(--reaction-finish-ink); }
.reaction-orbit { position: relative; display: flex; align-items: center; justify-content: center; width: 68px; height: 68px; margin-bottom: 28px; border: 1px solid currentColor; border-radius: 50%; opacity: .8; gap: 5px; }
.reaction-orbit::before { content: ''; position: absolute; inset: -9px; border: 1px dashed currentColor; border-radius: 50%; opacity: .28; pointer-events: none; }
.reaction-pad[data-state="idle"] .reaction-orbit::before, .reaction-pad[data-state="complete"] .reaction-orbit::before { animation: game-orbit 24s linear infinite; }
.reaction-orbit span { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.reaction-pad[data-state="ready"] .reaction-orbit { border-width: 2px; opacity: 1; }
.reaction-pad[data-state="ready"] .reaction-orbit::before { border-style: solid; opacity: .45; }
.reaction-pad[data-state="ready"] .reaction-orbit span:nth-child(2) { width: 9px; height: 9px; }
.reaction-kicker { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 10px; letter-spacing: .19em; opacity: .85; }
.reaction-title { font-size: clamp(27px, 3.4vw, 41px); letter-spacing: -.055em; font-weight: 580; line-height: 1.6; margin: 5px 0 7px; }
.reaction-caption { font-size: 12px; line-height: 1.8; opacity: .85; }
.reaction-input-hint { font-size: 10px; border: 1px solid currentColor; border-radius: 6px; padding: 5px 11px; opacity: .7; margin-top: 24px; }
.reaction-rounds { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 18px 0 26px; }
.reaction-round { border: 1px solid var(--line); border-radius: 12px; padding: 14px 6px; text-align: center; background: var(--game-well); }
.reaction-round > span { font-size: 10px; color: var(--muted); display: block; }
.reaction-round strong { display: block; font-family: 'SFMono-Regular', Consolas, monospace; font-weight: 600; font-size: 19px; margin-top: 10px; }
.reaction-round small { font-size: 9px; font-weight: 400; margin-left: 3px; color: var(--muted); }
.reaction-round.is-complete { background: var(--accent-soft); border-color: var(--line); color: var(--game-cyan); box-shadow: inset 0 2px 0 var(--accent); }
.reaction-summary { display: flex; gap: 25px; align-items: center; border-top: 1px solid var(--line); padding-top: 24px; margin: 24px 0; }
.reaction-summary > div > span { display: block; font-size: 11px; color: var(--muted); }
.reaction-summary strong { display: block; font-family: 'SFMono-Regular', Consolas, monospace; font-size: 28px; margin-top: 8px; color: var(--game-cyan); }
.reaction-summary small { font-size: 11px; margin-left: 4px; }
.reaction-summary p { font-size: 11px; color: var(--muted); margin-left: auto; line-height: 1.9; }
.reaction-session-hint { font-size: 10px; color: var(--muted); }
@keyframes game-tile-in { from { opacity: .76; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes game-panel-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes game-orbit { to { transform: rotate(360deg); } }
@media (hover: hover) { .game-workspace .btn:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 5px 18px var(--game-soft-glow); } }
@media (max-width: 1100px) { .game-columns { grid-template-columns: minmax(0, 1fr) 245px; gap: 18px; } .game-guide { padding: 23px 20px; } .game-play-panel { padding: 24px; } .game-scores > div { padding: 9px 12px; } }
@media (max-width: 850px) { .game-columns { grid-template-columns: 1fr; } .game-guide { padding: 25px; } .game-guide h3 { font-size: 21px; margin: 10px 0; } .game-guide ol { margin: 14px 0; } .game-tip { margin: 16px 0; } .game-tile { font-size: clamp(25px, 7vw, 39px); } .game-tile[data-value="128"], .game-tile[data-value="256"], .game-tile[data-value="512"] { font-size: 32px; } .game-tile[data-value="1024"], .game-tile[data-value="2048"] { font-size: 27px; } .game-tile[data-value="4096"] { font-size: 24px; } }
@media (max-width: 480px) { .game-play-panel { padding: 18px 14px; } .game-scorebar { margin-bottom: 20px; gap: 16px; } .game-workspace h2 { font-size: 19px; } .game-scores { width: 100%; } .game-scores > div { flex: 1; } .game-scores strong { font-size: 18px; } .game-board { padding: 9px; gap: 7px; border-radius: 13px; } .game-tile { border-radius: 7px; font-size: 30px; } .game-tile[data-value="128"], .game-tile[data-value="256"], .game-tile[data-value="512"] { font-size: 26px; } .game-tile[data-value="1024"], .game-tile[data-value="2048"] { font-size: 22px; } .game-tile[data-value="4096"] { font-size: 19px; } .reaction-pad { min-height: 310px; } .reaction-rounds { gap: 5px; } .reaction-round strong { font-size: 15px; } .reaction-round small { display: block; margin: 3px 0 0; } .reaction-summary { gap: 20px; flex-wrap: wrap; } .reaction-summary p { margin: 0; } }
@media (prefers-reduced-motion: reduce) { .game-workspace, .game-workspace *, .game-workspace *::before, .game-workspace *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } .game-workspace .btn:hover { transform: none; } }
