@font-face {
  font-family: Manrope;
  src: url('./manrope.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
:root {
  font-family: Manrope, 'Yu Gothic UI', Meiryo, sans-serif;
  color: #173d35;
  background: #dcfff4;
  color-scheme: light;
  font-synthesis: none;
  --bg: #dcfff4;
  --ink: #173d35;
  --muted: #416457;
  --yellow: #facc15;
  --green: #006a44;
  --line: #83b6a0;
  --surface: #c7eedf;
}
* { box-sizing: border-box; scrollbar-color: #416457 #dcfff4; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, a, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; cursor: pointer; color: inherit; background: none; border: 0; }
button:disabled { cursor: default; }
button:hover:not(:disabled), a:hover { color: var(--green); }
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible, a:focus-visible, summary:focus-visible, .board:focus-visible {
  outline: 3px solid var(--green); outline-offset: 4px;
}
a { color: inherit; text-underline-offset: 5px; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: var(--yellow); color: var(--ink); }
.masthead { max-width: 1000px; margin: auto; padding: 16px 30px; display: flex; align-items: center; justify-content: space-between; }
.wordmark { display: flex; gap: 8px; align-items: center; font-size: 35px; line-height: 1; font-weight: 800; text-decoration: none; letter-spacing: -.04em; }
.brand-square { width: 9px; height: 9px; background: var(--yellow); align-self: end; margin-bottom: 3px; }
.preferences { display: flex; gap: 7px; }
.preferences button { min-height: 44px; padding: 8px 12px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); border-radius: 6px; }
.preferences button[aria-pressed=true] { background: var(--ink); color: var(--bg); }
.preferences button[aria-pressed=true]:hover { background: var(--green); color: var(--bg); }
main { padding: 10px 22px 0; }
.game { position: relative; width: min(100%, 540px); margin: auto; }
.play-heading { display: grid; align-items: center; margin-bottom: 12px; }
.play-heading > * { grid-area: 1/1; }
.play-heading:has(.selection-note:not([hidden])) .scorebar { visibility: hidden; }
.scorebar { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,.9fr) auto; align-items: center; gap: 24px; padding: 0 3px; }
.scorebar > div { position: relative; min-width: 0; container-type: inline-size; --score-cap: 54px; }
.scorebar > .best-score { --score-cap: 27px; }
.score-label { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.scorebar strong { display: block; font-size: clamp(14px,calc(145cqw / (var(--score-digits,3) + 1)),var(--score-cap)); line-height: 1.2; letter-spacing: -.03em; font-weight: 800; font-variant-numeric: tabular-nums; }
.best-score strong { color: var(--muted); }
#gain { position: absolute; left: 36px; top: -5px; font-size: 14px; line-height: 1; font-weight: 800; color: var(--green); white-space: nowrap; pointer-events: none; --gain-rise: -16px; }
.score-pop { animation: score-rise 570ms ease-out forwards; }
@keyframes score-rise { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(var(--gain-rise)); } }
.restart { display: flex; align-items: center; gap: 7px; margin-left: auto; min-height: 44px; padding: 9px 12px; border: 1px solid #84948e; border-radius: 7px; font-size: 13px; font-weight: 700; }
.restart svg { width: 18px; height: 18px; }
.board-shell { width: min(100%,max(272px,calc(100svh - 296px))); margin: auto; padding: 9px; background: var(--green); border-radius: 16px; }
.board { position: relative; width: 100%; aspect-ratio: 1; touch-action: none; user-select: none; -webkit-touch-callout: none; outline: none; overflow: clip; border-radius: 8px; --gap: 9px; --cell: calc((100% - 27px)/4); }
.board:focus-visible { outline-offset: 7px; }
.cells { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--gap); height: 100%; }
.cell { background: #145d4b; border-radius: 8px; }
.tile { position: absolute; left: 0; top: 0; width: var(--cell); height: var(--cell); z-index: 2; will-change: transform; container-type: inline-size; --selection-ink: #173d35; }
.tile-face { height: 100%; display: grid; place-items: center; border-radius: 8px; font-size: clamp(12px,calc(130cqw / (var(--digits,2) + .4)),54px); line-height: 1; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; background: var(--tile-bg); color: var(--tile-fg,#173d35); backface-visibility: hidden; }
.tile[data-value="2"] { --tile-bg: #dcfff4; }
.tile[data-value="4"] { --tile-bg: #b1e8cb; }
.tile[data-value="8"] { --tile-bg: #79d499; }
.tile[data-value="16"] { --tile-bg: #f4e48e; }
.tile[data-value="32"] { --tile-bg: #facc15; }
.tile[data-value="64"] { --tile-bg: #ff9d59; }
.tile[data-value="128"] { --tile-bg: #ff766c; }
.tile[data-value="256"] { --tile-bg: #eea2dc; }
.tile[data-value="512"] { --tile-bg: #c9b2ff; }
.tile[data-value="1024"] { --tile-bg: #a6ccff; }
.tile[data-value="2048"] { --tile-bg: #facc15; }
.tile.super { --tile-bg: #292933; --tile-fg: #facc15; --selection-ink: #dcfff4; }
.tile:focus-visible { outline: none; }
.tile.selected .tile-face, .tile.preview .tile-face { outline: 4px solid var(--selection-ink); outline-offset: -5px; }
.tile:focus-visible .tile-face { outline: 3px dashed var(--selection-ink); outline-offset: -5px; }
.selecting .tile { cursor: pointer; }
.selecting .tile:hover:not(:focus-visible):not(.selected) .tile-face { outline: 3px solid var(--selection-ink); outline-offset: -5px; }
.underboard { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.highest-chip { white-space: nowrap; }
.highest-chip strong, .move-count b { color: var(--ink); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.move-count { margin-left: auto; white-space: nowrap; }
#state-note { text-align: center; font-size: 12px; }
#powerups { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 5px; }
.power { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px; min-height: 78px; padding: 14px 12px; border-radius: 9px; background: var(--surface); text-align: left; font-size: 14px; line-height: 1.3; font-weight: 700; }
.power:disabled { color: #416457; background: #d3ecdf; }
.power:disabled strong { color: var(--muted); }
.power small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.power strong { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--green); }
.power strong span { font-size: 11px; color: var(--muted); }
.power-key { position: absolute; top: 4px; left: 6px; color: var(--muted); font-size: 10px; font-weight: 500; }
.power.refilled { animation: refill 650ms ease-out; }
@keyframes refill { from { background-color: #facc15; } to { background-color: #c7eedf; } }
.selection-note { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.5; }
.selection-note button { flex: none; min-height: 44px; padding: 8px 0 8px 8px; text-decoration: underline; text-underline-offset: 4px; }
.control-note { margin: 19px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.tap-controls { margin-top: 3px; text-align: center; }
.tap-controls summary { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 10px; font-size: 12px; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.direction-pad { display: grid; grid-template-columns: repeat(3,48px); grid-template-rows: repeat(3,44px); justify-content: center; gap: 5px; margin: 5px 0 12px; }
.direction-pad button { display: grid; place-items: center; border: 1px solid #84948e; border-radius: 6px; }
.direction-pad button:disabled { opacity: .4; }
.direction-pad [data-dir=up] { grid-column: 2; grid-row: 1; }
.direction-pad [data-dir=left] { grid-column: 1; grid-row: 2; }
.direction-pad [data-dir=right] { grid-column: 3; grid-row: 2; }
.direction-pad [data-dir=down] { grid-column: 2; grid-row: 3; }
.direction-pad svg { width: 18px; height: 18px; }
.rules-inline { margin-top: 23px; padding-top: 14px; border-top: 1px solid var(--line); }
.rules-inline summary { min-height: 44px; display: flex; align-items: center; font-size: 14px; font-weight: 700; cursor: pointer; }
.rules-inline summary::after { content: '+'; margin-left: auto; font-size: 20px; font-weight: 400; color: var(--muted); }
.rules-inline[open] summary::after { content: '−'; }
.rules-inline p { margin: 6px 0 13px; font-size: 14px; line-height: 1.9; color: var(--muted); }
.tile-record { position: absolute; width: 72px; right: calc(100% + 40px); top: 77px; }
.tile-record h2 { margin: 0 0 13px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tile-record ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
.tile-record li { display: flex; align-items: center; justify-content: end; width: 60px; min-height: 32px; padding: 3px 9px; color: #416457; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; border-radius: 6px; }
.tile-record li.reached { color: #006a44; }
.tile-record li[aria-current=true] { background: #006a44; color: #dcfff4; font-weight: 800; }
.tile-record li.target { width: 72px; color: var(--green); font-size: 22px; font-weight: 800; margin-top: 5px; }
.tile-record li.target[aria-current=true] { color: var(--bg); }
.outcome { margin: 0 0 10px; padding: 10px 12px; background: var(--surface); border-radius: 12px; }
.outcome-label { margin: 0 0 5px; color: var(--muted); font-size: 13px; }
.outcome h2 { margin: 0 0 2px; color: var(--ink); font-size: 24px; line-height: 1.25; letter-spacing: -.03em; }
.outcome > p:last-of-type { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.outcome-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.outcome-actions button { min-height: 44px; padding: 8px 12px; font-size: 13px; }
.outcome.won { color: var(--bg); background: var(--ink); }
.outcome.won h2 { color: var(--bg); line-height: 1; }
.outcome.won #end-value { color: var(--yellow); font-size: 54px; line-height: 1; font-weight: 800; }
.outcome.won > p:last-of-type { color: var(--bg); }
.outcome.won .secondary { color: var(--bg); border-color: var(--line); }
.outcome.won .secondary:hover { color: var(--yellow); border-color: var(--yellow); }
.outcome.won button:focus-visible { outline-color: var(--bg); }
.primary, .secondary { min-height: 48px; padding: 12px 18px; border-radius: 7px; font: inherit; font-size: 14px; font-weight: 800; }
.primary { color: #292933; background: var(--yellow); }
.primary:hover:not(:disabled) { color: #292933; background: #ffe265; }
.secondary { border: 1px solid #84948e; }
dialog { width: min(460px,calc(100% - 32px)); max-height: calc(100svh - 32px); overflow-y: auto; padding: 30px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 16px; }
dialog::backdrop { background: #101b19b8; }
dialog h2 { margin: 0 0 18px; font-size: 24px; letter-spacing: -.03em; }
dialog p { color: var(--muted); font-size: 14px; line-height: 1.9; }
.gesture-preference { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; margin: 16px 0; padding: 4px 0; font-size: 14px; line-height: 1.6; font-weight: 600; cursor: pointer; }
.gesture-preference input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--green); }
.gesture-preference input:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 10px; margin-top: 25px; }
.storage-error { max-width: 520px; margin: 15px auto; padding: 14px; font-size: 13px; border: 1px solid var(--yellow); line-height: 1.7; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; max-width: 960px; margin: 40px auto 0; padding: 23px 30px 28px; color: var(--muted); font-size: 12px; }
footer a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 11px; }
footer svg { width: 14px; height: 14px; }
.particle { position: absolute; left: var(--px); top: var(--py); width: 5px; height: 5px; background: var(--yellow); z-index: 6; pointer-events: none; animation: particle 420ms ease-out forwards; }
@keyframes particle { from { opacity: 1; transform: translate(0,0) rotate(0); } to { opacity: 0; transform: translate(var(--dx),var(--dy)) rotate(100deg); } }
.no-move { animation: nudge 130ms ease-out; }
@keyframes nudge { 33% { transform: translateX(-2px); } 66% { transform: translateX(2px); } }
.reduced *, .reduced *::before, .reduced *::after { animation: none !important; transition: none !important; }
.reduced #gain { display: none; }
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  #gain { display: none; }
}
@media(max-width:900px) { .tile-record { display: none; } }
@media(max-width:600px) {
  #gain { --gain-rise: -4px; }
  .masthead { padding: 8px 17px; }
  .wordmark { font-size: 29px; }
  .brand-square { width: 7px; height: 7px; }
  .preferences { gap: 5px; }
  .preferences button { min-height: 44px; padding: 7px 9px; font-size: 12px; }
  main { padding: 4px 16px 0; }
  .play-heading { margin-bottom: 9px; }
  .scorebar { gap: 18px; }
  .scorebar > div { --score-cap: 38px; }
  .scorebar > .best-score { --score-cap: 23px; }
  .score-label { font-size: 12px; }
  .restart { padding: 8px 10px; font-size: 12px; }
  .board-shell { padding: 8px; border-radius: 14px; }
  .board { --gap: 7px; --cell: calc((100% - 21px)/4); }
  .underboard { gap: 8px; min-height: 28px; font-size: 11px; }
  #state-note { font-size: 11px; }
  .highest-chip strong, .move-count b { font-size: 13px; }
  #powerups { gap: 7px; margin-top: 3px; }
  .power { display: block; min-height: 82px; padding: 9px 8px; font-size: 14px; }
  .power-key { display: none; }
  .power small { margin-top: 5px; font-size: 12px; }
  .power strong { display: block; margin-top: 5px; font-size: 20px; line-height: 1; }
  .power strong span { font-size: 12px; }
  .control-note { margin-top: 17px; }
  .selection-note { font-size: 12px; gap: 8px; }
  .outcome { padding: 9px 10px; }
  .outcome h2 { font-size: 21px; }
  .outcome.won #end-value { font-size: 35px; }
  .outcome-actions button { flex: 1 1 125px; }
  footer { flex-wrap: wrap; margin-top: 23px; padding: 20px 17px 25px; font-size: 11px; }
}
@media(max-width:350px) {
  .masthead { padding: 7px 12px; }
  .wordmark { font-size: 26px; }
  .preferences button { padding: 7px 6px; font-size: 12px; }
  main { padding: 4px 12px 0; }
  .scorebar { gap: 21px; }
  .scorebar > div { --score-cap: 29px; }
  .restart { padding: 8px; }
  .restart svg { width: 16px; }
  .power { padding: 12px 6px; font-size: 12px; }
  .power small { font-size: 11px; }
  #state-note { max-width: 150px; }
}
@media(min-width:560px) and (max-height:500px) {
  .masthead { max-width: 740px; padding: 7px 16px; }
  main { padding: 0 12px; }
  .game { width: min(100%,720px); display: grid; grid-template-columns: min(320px,calc(100svh - 88px)) minmax(0,1fr); column-gap: 18px; align-items: start; }
  .game > .board-shell { grid-column: 1; grid-row: 1/6; width: 100%; margin: 0; padding: 8px; }
  .game > .play-heading { grid-column: 2; grid-row: 1; margin: 0 0 6px; }
  .scorebar { gap: 12px; }
  .scorebar > div { --score-cap: 36px; }
  .scorebar > .best-score { --score-cap: 23px; }
  .restart { padding: 8px; font-size: 12px; }
  .game > .underboard { grid-column: 2; grid-row: 2; min-height: 28px; gap: 6px; }
  .game > #powerups, .game > .outcome { grid-column: 2; grid-row: 3; }
  #powerups { gap: 6px; margin-top: 2px; }
  .power { display: block; min-height: 80px; padding: 8px 6px; font-size: 12px; }
  .power small { font-size: 11px; }
  .power strong { display: block; margin-top: 5px; font-size: 20px; line-height: 1; }
  .power-key { display: none; }
  .game > .control-note { grid-column: 2; grid-row: 4; margin: 9px 0 0; }
  .game > .tap-controls { grid-column: 2; grid-row: 5; margin: 0; }
  .game > .rules-inline { grid-column: 1/-1; grid-row: 6; margin-top: 18px; }
  .outcome { padding: 8px 10px; }
  .outcome h2 { font-size: 20px; }
  .outcome.won #end-value { font-size: 35px; }
  .outcome-actions button { flex: 1 1 120px; }
  footer { margin-top: 20px; }
}

/* A15: the established dark table on A13 geometry and behavior. */
:root {
  color: #dcfff4;
  background: #292933;
  color-scheme: dark;
  --bg: #292933;
  --ink: #dcfff4;
  --muted: #b8cec7;
  --line: #83b6a0;
  --surface: #363940;
}
* { scrollbar-color: #b8cec7 #292933; }
button:hover:not(:disabled), a:hover { color: var(--yellow); }
button:focus-visible, a:focus-visible, summary:focus-visible, .board:focus-visible { outline-color: var(--yellow); }
::selection { color: #292933; background: var(--yellow); }
.preferences button[aria-pressed=true]:hover { color: #292933; background: var(--yellow); }
#gain, .power strong { color: var(--yellow); }
.power:disabled { color: var(--muted); background: #31353c; }
.tile-record li { color: var(--muted); }
.tile-record li.reached { color: #91edc6; }
.tile-record li[aria-current=true] { color: #dcfff4; }
.tile-record li.target { color: var(--yellow); }
.tile-record li.target[aria-current=true] { color: #dcfff4; }
.outcome.won { color: #dcfff4; background: #173d35; }
.outcome.won h2, .outcome.won > p:last-of-type, .outcome.won .secondary { color: #dcfff4; }
.outcome.won .secondary:hover { color: var(--yellow); }
.outcome.won button:focus-visible { outline-color: #dcfff4; }
.gesture-preference input { accent-color: var(--yellow); }
.gesture-preference input:focus-visible { outline-color: var(--yellow); }
@keyframes refill { from { background-color: #145d4b; } to { background-color: #363940; } }

/* A20: the pieces carry a lower edge; operation outlines keep a flat face. */
.tile-face {
  --piece-lip: clamp(3px,5cqw,7px);
  box-shadow: inset 0 calc(-1 * var(--piece-lip)) 1px color-mix(in srgb,var(--tile-bg) 64%,#173d35), inset 0 1px 1px #ffffff66, 0 3px 5px #00281855;
}
.tile:is(.selected,.preview,:focus-visible) .tile-face,
.selecting .tile:hover .tile-face { box-shadow: none; }

/* A23: the explanation scrolls; its title and return action stay in view. */
#help-dialog { padding: 0; overflow: hidden; }
#help-dialog[open] { display: flex; flex-direction: column; }
.help-heading { flex: none; display: flex; align-items: flex-start; gap: 12px; padding: 24px 24px 16px; }
.help-heading h2 { flex: 1; min-width: 0; margin: 0; font-size: 22px; }
.help-heading form { flex: none; }
.help-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 24px 24px; }
.help-content:focus-visible { outline: 2px solid var(--yellow); outline-offset: -4px; }
.help-content h3 { margin: 24px 0 8px; font-size: 15px; line-height: 1.5; }
.help-content section:first-child h3 { margin-top: 0; }
.help-powers { margin: 12px 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.help-powers li + li { margin-top: 8px; }
.help-powers strong { color: var(--ink); }

/* A25: symbols stay on the board; explanations are deliberately requested. */
.icon-button { display: inline-grid; place-items: center; width: 44px; min-width: 44px; min-height: 44px; padding: 9px; }
.preferences .icon-button { padding: 9px; }
.icon-button svg { width: 22px; height: 22px; }
.score-label { height: 22px; margin-bottom: 3px; }
.score-label svg { width: 19px; height: 19px; }
.restart.icon-button { display: grid; padding: 9px; }
.restart.icon-button svg { width: 22px; height: 22px; }
.highest-chip, .move-count, .goal-mark { display: inline-flex; align-items: center; gap: 5px; }
.underboard svg { width: 15px; height: 15px; }
.underboard [data-icon] { display: inline-flex; }
.goal-mark { margin: auto; color: var(--muted); font-size: 12px; font-weight: 700; }
.move-count { margin-left: 0; }
.power-slot { min-width: 0; border-radius: 9px; }
.power-slot:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
.power { width: 100%; min-height: 72px; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px 10px 10px; }
.power-symbol { display: inline-flex; }
.power-symbol svg { width: 27px; height: 27px; }
.power strong { display: inline-block; margin: 0; font-size: 24px; line-height: 1; }
.power strong span { font-size: 12px; }
.power-key { display: block; top: 5px; left: 8px; font-size: 11px; }
.tap-controls { margin: 12px 0 24px; }
.tap-controls summary { display: inline-grid; place-items: center; width: 44px; min-height: 44px; padding: 9px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.tap-controls summary::marker { content: ''; }
.tap-controls summary::-webkit-details-marker { display: none; }
.tap-controls summary [data-icon] { display: inline-flex; }
.tap-controls[open] summary { background: var(--surface); }
.selection-note .icon-button { padding: 9px; text-decoration: none; }
.control-tip { position: fixed; z-index: 20; width: max-content; max-width: min(270px,calc(100vw - 16px)); padding: 12px 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.65; font-weight: 600; box-shadow: 0 5px 14px #0005; }
.help-heading { align-items: center; }
.help-heading .icon-button { min-height: 44px; }
.language-choice { display: flex; justify-content: end; gap: 6px; margin: 0 0 20px; }
.language-choice button { min-height: 44px; padding: 8px 12px; border-radius: 6px; font-size: 13px; }
.language-choice [aria-pressed=true] { color: var(--bg); background: var(--ink); }
.merge-example { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 18px 0; }
.merge-example > span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 7px; background: #dcfff4; color: #173d35; font-size: 26px; font-weight: 800; }
.merge-example .example-four { background: #b1e8cb; }
.merge-example b { color: var(--muted); font-size: 18px; }
.help-content p { margin: 8px 0 12px; line-height: 1.75; }
.help-details { color: var(--muted); font-size: 14px; line-height: 1.75; }
.help-details summary { min-height: 44px; padding: 10px 0; cursor: pointer; color: var(--ink); font-weight: 700; }
.help-powers { list-style: none; padding: 0; }
.help-powers li { display: flex; gap: 14px; padding: 12px 0; }
.help-powers li + li { margin: 0; border-top: 1px solid var(--surface); }
.help-power-symbol { display: inline-flex; flex: none; align-items: flex-start; padding-top: 5px; color: var(--ink); }
.help-power-symbol svg { width: 27px; height: 27px; }
.help-powers p { margin: 4px 0; }
.help-powers small { color: #91edc6; font-size: 12px; }
.help-powers kbd { font-family: inherit; font-size: 12px; margin-right: 5px; color: var(--muted); }
.about-game { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); }
.about-game a { overflow-wrap: anywhere; }
@media(max-width:600px) {
  .preferences { gap: 6px; }
  .power { min-height: 72px; padding: 17px 6px 10px; gap: 9px; }
  .power-symbol svg { width: 24px; height: 24px; }
  .power strong { font-size: 22px; }
  .board-shell { width: min(100%,max(272px,calc(100svh - 270px))); }
}
@media(max-width:350px) {
  .power { gap: 6px; }
  .power-symbol svg { width: 22px; height: 22px; }
  .power strong { font-size: 20px; }
  .help-heading { padding: 16px 16px 12px; }
  .help-content { padding: 0 16px 20px; }
}
@media(min-width:560px) and (max-height:500px) {
  .game > .tap-controls { grid-column: 2; grid-row: 4; margin: 8px 0 0; }
  .game > .board-shell { grid-row: 1/5; }
  .power { min-height: 72px; gap: 7px; padding: 16px 6px 10px; }
  .power-symbol svg { width: 22px; height: 22px; }
  .power strong { font-size: 20px; }
}

/* A26: cushioned sampler pads in a graphite chassis. */
:root {
  color: #f3f0e8; background: #181a1d;
  --bg: #181a1d; --ink: #f3f0e8; --muted: #b7bbc0;
  --line: #747a82; --surface: #282c31; --yellow: #eed5a1; --green: #eed5a1;
}
* { scrollbar-color: #969ca3 #181a1d; }
.masthead { gap: 10px; }
.preferences { gap: 6px; }
.brand-square { background: #e4ad56; border-radius: 2px; }
.preferences .icon-button, .restart.icon-button, .tap-controls summary {
  color: var(--ink); border-color: #51575f; background: #25292e;
  box-shadow: inset 0 1px 1px #ffffff12, 0 2px 3px #0005;
}
.preferences button[aria-pressed=true], .preferences button[aria-pressed=true]:hover {
  color: #181a1d; background: #eed5a1; border-color: #eed5a1;
}
.numbers-button { font-size: 13px; font-weight: 800; letter-spacing: -.03em; }
.numbers-button[aria-pressed=false] span { text-decoration: line-through; text-decoration-thickness: 1px; }
.board-shell {
  background: #202429; padding: 12px; border: 1px solid #474d55; border-radius: 18px;
  box-shadow: inset 0 1px 2px #ffffff16, inset 0 -5px 7px #0005, 0 12px 24px #0004;
}
.board { border-radius: 10px; }
.cell {
  border-radius: 10px; background: #30353b; border: 1px solid #454c54;
  box-shadow: inset 0 1px 2px #ffffff12, inset 0 -4px 5px #0005, 0 3px 4px #0006;
}
.tile { --selection-ink: #fff1c6; }
.tile-face {
  border-radius: 10px; border: 2px solid color-mix(in srgb,var(--tile-bg) 85%,#25292e);
  background: color-mix(in srgb,var(--tile-bg) 20%,#262b31); color: #f5f3ed;
  padding-bottom: 3px;
  box-shadow: inset 0 1px 2px #ffffff26, inset 0 -4px 5px #0007, 0 4px 6px #0007;
}
.tile-number { max-width: 100%; }
.numbers-hidden .tile-number { visibility: hidden; }
.tile-face { position: relative; }
.music-light { position: absolute; inset: 0; border-radius: inherit; background: var(--tile-bg); opacity: 0; pointer-events: none; }
.preferences #sound { position: relative; }
#sound.preparing::after { content: ''; position: absolute; bottom: 3px; left: 3px; height: 2px; width: calc((100% - 6px) * var(--music-ready,0)); background: currentColor; border-radius: 1px; pointer-events: none; }
.music-part-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 16px; padding: 0; list-style: none; }
.tile-number { position: relative; z-index: 1; }
.tile:is(.selected,.preview,:focus-visible) .tile-face,
.selecting .tile:hover .tile-face { box-shadow: inset 0 -3px 4px #0005; }
.selecting .tile:active .tile-face { transform: translateY(2px); }
:is(.tile,.tile-record li)[data-value="2"] { --tile-bg: #cbd4df; }
:is(.tile,.tile-record li)[data-value="4"] { --tile-bg: #f2b544; }
:is(.tile,.tile-record li)[data-value="8"] { --tile-bg: #f47b50; }
:is(.tile,.tile-record li)[data-value="16"] { --tile-bg: #ed557a; }
:is(.tile,.tile-record li)[data-value="32"] { --tile-bg: #bc82f5; }
:is(.tile,.tile-record li)[data-value="64"] { --tile-bg: #6b9fff; }
:is(.tile,.tile-record li)[data-value="128"] { --tile-bg: #48c9ed; }
:is(.tile,.tile-record li)[data-value="256"] { --tile-bg: #5ad8ba; }
:is(.tile,.tile-record li)[data-value="512"] { --tile-bg: #a5d66f; }
:is(.tile,.tile-record li)[data-value="1024"] { --tile-bg: #e7d86a; }
:is(.tile,.tile-record li)[data-value="2048"] { --tile-bg: #f6e9ca; }
.tile.super { --tile-bg: hsl(calc(var(--rank) * 137.508) 70% 70%); --selection-ink: #fff1c6; }
.tile-record { right: calc(100% + 20px); width: 88px; top: 84px; }
.tile-record ol { gap: 6px; }
.tile-record li, .tile-record li.target {
  width: 88px; min-height: 30px; margin: 0; padding: 3px 5px;
  justify-content: flex-start; gap: 10px; color: #f3f0e8; font-size: 14px; font-weight: 700;
  background: none; opacity: .25;
}
.tile-record li.present { opacity: 1; }
.inventory-swatch { flex: none; width: 11px; height: 11px; border-radius: 3px; background: var(--tile-bg); }
.power { background: #2a2e34; }
.power:disabled { color: #b7bbc0; background: #23272c; }
.power strong, #gain { color: #eed5a1; }
.power strong span { color: #b7bbc0; }
.help-powers small { color: #bde0c7; }
.merge-example > span { color: #f5f3ed; background: #424950; border: 2px solid #cbd4df; }
.merge-example .example-four { background: #50452e; border-color: #f2b544; }
.control-tip { color: #181a1d; background: #f3f0e8; }
@keyframes refill { from { background-color: #495544; } to { background-color: #2a2e34; } }
@media(max-width:900px) {
  .tile-record { display: block; position: static; width: 100%; margin: 5px 0 8px; }
  .tile-record ol { display: grid; grid-template-columns: repeat(11,minmax(0,1fr)); gap: 3px; }
  .tile-record li, .tile-record li.target {
    width: auto; min-height: 33px; padding: 0; flex-direction: column; justify-content: center;
    gap: 4px; font-size: 10px; line-height: 1;
  }
  .inventory-swatch { width: 9px; height: 9px; border-radius: 2px; }
}
@media(max-width:600px) {
  .wordmark { font-size: 27px; }
  .board-shell { width: min(100%,max(272px,calc(100svh - 310px))); padding: 9px; border-radius: 15px; }
  .cell, .tile-face { border-radius: 8px; }
  .tile-face { border-width: 2px; }
}
@media(max-width:350px) {
  .wordmark { font-size: 25px; }
  .preferences { gap: 4px; }
  .masthead { gap: 6px; }
  .tile-record li, .tile-record li.target { font-size: 9px; }
}
@media(max-width:310px) { .masthead { flex-wrap: wrap; } .preferences { margin-left: auto; } }
@media(min-width:560px) and (max-height:500px) {
  .game > .board-shell { grid-row: 1/6; }
  .game > .tile-record { grid-column: 2; grid-row: 3; margin: 4px 0; }
  .game > #powerups, .game > .outcome { grid-column: 2; grid-row: 4; }
  .game > .tap-controls { grid-column: 2; grid-row: 5; }
}

/* A27: thresholds and receipts tie real merges to their destination control. */
.power { min-height: 86px; padding: 23px 8px 25px; }
.power-source { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 10px; line-height: 1; font-weight: 600; }
.power-source i { width: 6px; height: 6px; border-radius: 2px; background: var(--tile-bg); }
.power-source svg { width: 12px; height: 12px; }
.power-source[data-value="128"] { --tile-bg: #48c9ed; }
.power-source[data-value="256"] { --tile-bg: #5ad8ba; }
.power-source[data-value="512"] { --tile-bg: #a5d66f; }
.power.earned { outline: 2px solid var(--award-color); outline-offset: 2px; }
.power-award { position: absolute; top: 4px; right: 6px; min-width: 25px; padding: 3px 5px; border-radius: 4px; background: var(--award-color); color: #181a1d; font-size: 12px; line-height: 1; font-weight: 800; }
.power-award-full { background: #f3f0e8; color: #181a1d; }
.tile.award-origin .tile-face { outline: 2px solid #f5f3ed; outline-offset: -7px; }
#power-links { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 8; pointer-events: none; overflow: hidden; }
@media(max-width:900px) { .tile-record li, .tile-record li.target { justify-content: center; } }
.outcome:not([hidden]) { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; padding: 4px 8px 4px 14px; background: #282c31; color: #f3f0e8; }
.outcome h2, .outcome.won h2 { margin: 0; color: #f3f0e8; font-size: 20px; line-height: 1; }
.outcome.won { background: #282c31; outline: 1px solid #eed5a1; }
.outcome.won #end-value { color: #eed5a1; font-size: 24px; }
.outcome-actions { flex: none; flex-wrap: nowrap; gap: 2px; margin: 0; }
.outcome-actions button { flex: none; width: 44px; height: 44px; padding: 10px; color: #f3f0e8; }
@media(min-width:560px) and (max-height:500px) { .game > .outcome { grid-column: 2; grid-row: 6; } }
/* A29: size the surface, rather than hiding page overflow. */
main { padding-bottom: 0; }
.board-shell { width: min(100%,var(--fit-board,540px)); }
.outcome-slot { height: 64px; }
.outcome { transition: opacity 240ms ease-out; }
.outcome.dismissing { opacity: 0; pointer-events: none; }
.preferences .tap-controls { position: relative; flex: none; margin: 0; text-align: center; }
.preferences .tap-controls summary { width: 44px; height: 44px; padding: 10px; }
.preferences .tap-controls[open] summary { background: #3b4148; border-color: #a0a8b2; }
.tap-controls .direction-pad { position: absolute; right: 0; top: calc(100% + 10px); z-index: 15; margin: 0; padding: 10px; background: #282c31; border: 1px solid #59616c; border-radius: 10px; box-shadow: 0 5px 14px #0005; }
.control-tip { color: #f3f0e8; background: #2d3238; border-color: #59616c; border-radius: 8px; padding: 10px 12px; font-weight: 500; box-shadow: 0 4px 8px #0005; }
.control-tip::before { content: ''; position: absolute; left: var(--tip-anchor,50%); width: 10px; height: 10px; background: #2d3238; transform: translateX(-50%) rotate(45deg); }
.control-tip[data-side=below]::before { top: -6px; border-top: 1px solid #59616c; border-left: 1px solid #59616c; }
.control-tip[data-side=above]::before { bottom: -6px; border-bottom: 1px solid #59616c; border-right: 1px solid #59616c; }
.control-tip[data-side=left]::before { left: auto; right: -6px; top: var(--tip-anchor-y); transform: translateY(-50%) rotate(45deg); border-top: 1px solid #59616c; border-right: 1px solid #59616c; }
.control-tip[data-side=right]::before { left: -6px; top: var(--tip-anchor-y); transform: translateY(-50%) rotate(45deg); border-bottom: 1px solid #59616c; border-left: 1px solid #59616c; }
@media(max-width:350px) {
 .preferences { gap: 4px; }
 .preferences .icon-button,.preferences .tap-controls summary { width: 36px; min-width: 36px; height: 40px; min-height: 40px; padding: 8px; }
 .masthead { gap: 6px; }
}
@media(min-width:560px) and (max-height:500px) {
 .game > .board-shell { grid-row: 1/6; width: 100%; }
 .game > .outcome-slot { grid-column: 2; grid-row: 5; height: 56px; }
 .game > .play-heading { margin-bottom: 0; }
 .scorebar > div { --score-cap: 28px; }
 .scorebar > .best-score { --score-cap: 20px; }
 .game > .tile-record { margin: 2px 0; }
 .tile-record li,.tile-record li.target { min-height: 27px; }
 .power { min-height: 64px; padding: 17px 5px 20px; }
 .power strong { font-size: 20px; }
 .power-symbol svg { width: 20px; height: 20px; }
 .outcome:not([hidden]) { margin: 4px 0 0; padding: 0 4px 0 10px; }
}
@media(prefers-reduced-motion:reduce) { .outcome { transition: none; } }
.reduced .outcome { transition: none; }
.play-heading { height: 90px; }
@media(max-width:600px) { .play-heading { height: 72px; } }
.power { min-height: 74px; }
.outcome-slot { height: 60px; }
.outcome-slot { display: flow-root; }
.outcome:not([hidden]) { margin: 4px 0; }
.tile-face { font-size: clamp(8px,calc(130cqw / (var(--digits,2) + .4)),54px); }
@media(max-width:559px) and (max-height:600px) {
 .play-heading { height: 64px; }
 .scorebar > div { --score-cap: 32px; }
 .scorebar > .best-score { --score-cap: 23px; }
 .play-heading { margin-bottom: 6px; }
}
@media(min-width:560px) and (max-height:500px) { .power { min-height: 64px; } }
@media(min-width:560px) and (max-height:500px) { .play-heading { height: 60px; } }
@media(min-width:560px) and (max-height:300px) {
 .play-heading { height: 54px; }
 .masthead { padding: 2px 12px; }
 .wordmark { font-size: 24px; }
 .preferences .icon-button,.preferences .tap-controls summary { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 8px; }
 .scorebar > div { --score-cap: 24px; }
 .scorebar > .best-score { --score-cap: 18px; }
 .game > .underboard { min-height: 24px; }
 .tile-record li,.tile-record li.target { min-height: 24px; }
 .power { min-height: 56px; padding: 14px 5px 18px; }
 .power-source { bottom: 5px; }
 .game > .outcome-slot { height: 48px; }
}
.music-choice{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:center;margin-bottom:12px}
.music-choice select{min-width:0;width:100%;min-height:36px;padding:6px 8px;font:inherit;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:6px}

/* Unlocked digital instrument panel. Geometry and input targets stay shared. */
:root.denpa-mode{color-scheme:dark;color:#e8f8ff;background:#080f22;--bg:#080f22;--ink:#e8f8ff;--muted:#a8bdd3;--surface:#101f36;--line:#416681;--yellow:#58e5ed;--green:#58e5ed}
.denpa-mode *{scrollbar-color:#6586a5 #080f22}
.denpa-mode .masthead{border-bottom:1px solid #294762}
.denpa-mode .brand-square{background:#ff71d5;border-radius:0}
.denpa-mode .scorebar strong,.denpa-mode .tile-number,.denpa-mode .move-count,.denpa-mode .power strong{letter-spacing:0;font-variant-numeric:tabular-nums}
.denpa-mode .preferences .icon-button,.denpa-mode .restart.icon-button,.denpa-mode .tap-controls summary{background:#101f36;border-color:#416681;border-radius:3px;box-shadow:none}
.denpa-mode .preferences button[aria-pressed=true],.denpa-mode .preferences button[aria-pressed=true]:hover{background:#58e5ed;border-color:#58e5ed;color:#080f22}
.denpa-mode .board-shell{background:#0d1b30;border-color:#58e5ed;border-radius:4px;box-shadow:none}
.denpa-mode .board,.denpa-mode .cell{border-radius:2px}
.denpa-mode .cell{background:#111f37;border-color:#294762;box-shadow:none}
.denpa-mode .tile{--selection-ink:#ffffff}
.denpa-mode .tile-face{border-radius:2px;background:color-mix(in srgb,var(--tile-bg) 13%,#0d1930);border:1px solid var(--tile-bg);color:#e8f8ff;box-shadow:inset 0 2px 0 color-mix(in srgb,var(--tile-bg) 50%,transparent)}
.denpa-mode :is(.tile,.tile-record li)[data-value="2"]{--tile-bg:#92bfd9}
.denpa-mode :is(.tile,.tile-record li)[data-value="4"]{--tile-bg:#58e5ed}
.denpa-mode :is(.tile,.tile-record li)[data-value="8"]{--tile-bg:#7cf0c4}
.denpa-mode :is(.tile,.tile-record li)[data-value="16"]{--tile-bg:#a2c1ff}
.denpa-mode :is(.tile,.tile-record li)[data-value="32"]{--tile-bg:#c5a1ff}
.denpa-mode :is(.tile,.tile-record li)[data-value="64"]{--tile-bg:#f798eb}
.denpa-mode :is(.tile,.tile-record li)[data-value="128"]{--tile-bg:#58e5ed}
.denpa-mode :is(.tile,.tile-record li)[data-value="256"]{--tile-bg:#7cf0c4}
.denpa-mode :is(.tile,.tile-record li)[data-value="512"]{--tile-bg:#a2c1ff}
.denpa-mode :is(.tile,.tile-record li)[data-value="1024"]{--tile-bg:#f798eb}
.denpa-mode :is(.tile,.tile-record li)[data-value="2048"]{--tile-bg:#fff3aa}
.denpa-mode .inventory-swatch{border-radius:0}
.denpa-mode .tile-record li,.denpa-mode .tile-record li.target{color:#e8f8ff}
.denpa-mode .power{background:#13243d;border:1px solid #416681;border-radius:3px}
.denpa-mode .power:disabled{background:#0e1a2f;color:#a8bdd3}
.denpa-mode .power-slot{border-radius:3px}
.denpa-mode .power strong,.denpa-mode #gain,.denpa-mode #state-note{color:#58e5ed}
.denpa-mode .power strong span{color:#a8bdd3}
.denpa-mode dialog,.denpa-mode .control-tip,.denpa-mode .tap-controls .direction-pad{background:#101f36;color:#e8f8ff;border-color:#416681;border-radius:4px}
.denpa-mode dialog::backdrop{background:#040914c9}
.denpa-mode .direction-pad button,.denpa-mode .music-choice select{border-color:#416681;border-radius:3px}
.denpa-mode .merge-example>span{background:#13243d;border-color:#58e5ed;color:#e8f8ff;border-radius:2px}
.denpa-mode .help-powers small{color:#7cf0c4}
.denpa-mode ::selection{background:#58e5ed;color:#080f22}
@font-face{font-family:DotGothic16;src:url('./dotgothic16.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}
.pixel-icon{display:none}
.denpa-mode .vector-icon{display:none}
.denpa-mode .pixel-icon{display:inline;fill:currentColor;stroke:none;shape-rendering:crispEdges}
.denpa-mode,.denpa-mode .scorebar strong,.denpa-mode .tile-number,.denpa-mode .move-count,.denpa-mode .power strong{font-family:DotGothic16,Manrope,'Yu Gothic UI',sans-serif;font-weight:400;letter-spacing:0}
.denpa-mode button,.denpa-mode select,.denpa-mode input,.denpa-mode kbd{font-family:inherit;font-weight:400}

/* Riddim's red / gold / green instrument face. */
:root:not(.denpa-mode){--bg:#131b17;--surface:#203128;--line:#6d8274;--green:#e8c45b;--yellow:#e8c45b;background:var(--bg)}
:root:not(.denpa-mode) .masthead{border-bottom:3px solid transparent;border-image:linear-gradient(90deg,#d86558 0 33.33%,#e8c45b 33.33% 66.66%,#74b486 66.66%) 1}
.wordmark{gap:9px;white-space:nowrap}
#game-mode-title{font-size:.68em;letter-spacing:0}
:root:not(.denpa-mode) .brand-number{color:#e8c45b}
:root:not(.denpa-mode) #game-mode-title{color:#8ac59b}
:root:not(.denpa-mode) .brand-square{background:#d86558}
:root:not(.denpa-mode) .board-shell{background:#1b2a22;border-color:#708b76}
:root:not(.denpa-mode) .cell{background:#2b3a30;border-color:#506956}
.stage-volume{display:flex;align-items:center;justify-content:inherit;gap:inherit;min-height:30px;width:100%;padding:0;color:inherit;font:inherit}
.volume-panel{position:fixed;inset:auto;margin:0;padding:16px;max-width:calc(100vw - 24px);max-height:calc(100svh - 24px);overflow:auto;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:10px;box-shadow:0 7px 20px #0006}
.volume-panel h2{margin:0;font-size:16px;line-height:1.4;letter-spacing:0}
.volume-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}
.volume-close{display:grid;place-items:center;width:36px;height:36px;padding:6px}
.master-level{display:grid;gap:12px;font-size:13px;min-width:220px}
.volume-panel input[type=range]{accent-color:var(--yellow);cursor:pointer}
.master-level input{width:100%;min-height:36px;margin:0}
#volume-mute{min-height:44px;padding:8px 12px;margin-top:10px;border:1px solid var(--line);border-radius:5px;width:100%}
.mixer-panel{width:320px}
.mixer-faders{display:grid;gap:4px}
.mixer-channel{display:grid;grid-template-columns:38px minmax(0,1fr) 46px;align-items:center;gap:5px;min-height:38px;font-size:12px}
.mixer-name{grid-column:2;grid-row:auto;font-size:11px;color:var(--muted)}
.mixer-channel input{width:100%;min-width:0;grid-column:2;grid-row:auto;margin:0}
.mixer-channel output{grid-column:3;grid-row:span 2;text-align:right;font-variant-numeric:tabular-nums}
.mixer-number{grid-row:span 2;font-weight:700;color:var(--muted)}
.mixer-channel.part-present .mixer-number{color:var(--yellow)}
.game>.outcome-slot{height:0;min-height:0;margin:0}
dialog#overlay.outcome:not([open]){display:none}
dialog#overlay.outcome[open]{position:fixed;inset:0;display:block;margin:auto;padding:26px;width:min(440px,calc(100vw - 32px));max-height:calc(100svh - 32px);background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:14px;opacity:1;transform:none}
dialog#overlay.outcome::backdrop{background:#07110cd9}
dialog#overlay.outcome h2,dialog#overlay.outcome.won h2{color:var(--ink);font-size:28px;line-height:1.3}
dialog#overlay.outcome.won #end-value{font-size:52px;color:var(--yellow)}
dialog#overlay.outcome #end-copy{color:var(--muted);margin:12px 0;line-height:1.7}
dialog#overlay .outcome-actions{display:grid;gap:8px;margin-top:20px}
dialog#overlay .outcome-actions button{display:flex;justify-content:center;align-items:center;gap:10px;width:100%;height:auto;min-height:44px;padding:10px 14px;border:1px solid var(--line);border-radius:5px;color:var(--ink)}
dialog#overlay #continue{background:var(--yellow);color:var(--bg);border-color:var(--yellow)}
.denpa-mode .volume-panel,.denpa-mode dialog#overlay.outcome[open]{border-radius:3px}
.volume-open #control-tip{display:none}
@media(max-width:900px),(max-height:500px){
 .stage-volume{flex-direction:column;justify-content:center;gap:4px}
 .mixer-panel{width:640px}
 .mixer-faders{grid-template-columns:repeat(11,minmax(0,1fr));gap:6px}
 .mixer-channel{display:flex;flex-direction:column;gap:7px;min-width:0}
 .mixer-name{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .mixer-channel input{writing-mode:vertical-lr;direction:rtl;width:30px;height:100px}
 .mixer-channel output{font-size:11px}
}
@media(max-width:600px){.masthead{flex-wrap:wrap;padding:10px 16px;gap:8px}.wordmark{font-size:27px}.preferences{margin-left:auto}.preferences .icon-button,.preferences .tap-controls summary{width:40px;height:40px;min-height:40px;padding:8px}}
@media(max-width:450px){.masthead .wordmark{width:100%;justify-content:center}.masthead .preferences{width:100%;justify-content:center;margin:0}.mixer-faders{grid-template-columns:repeat(6,minmax(0,1fr));gap:14px 6px}.mixer-channel input{height:78px;width:36px}}
@media(max-height:400px){dialog#overlay.outcome[open]{padding:16px}dialog#overlay.outcome h2{font-size:22px}dialog#overlay.outcome.won #end-value{font-size:36px}dialog#overlay #end-copy{margin:8px 0}dialog#overlay .outcome-actions{grid-template-columns:repeat(auto-fit,minmax(110px,1fr));margin-top:10px}dialog#overlay .outcome-actions button{font-size:12px;padding:8px;gap:5px;flex-wrap:wrap}}
#overlay.outcome-toast{position:fixed;z-index:18;inset:auto 20px 20px auto;display:block;width:360px;max-width:calc(100vw - 24px);margin:0;padding:18px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:10px;box-shadow:0 6px 22px #0006;outline:none;transition:opacity .2s ease-out}
#overlay.outcome-toast h2{padding-right:38px;font-size:22px;line-height:1.3;color:var(--ink)}
#overlay.outcome-toast.won #end-value{font-size:28px;color:var(--yellow)}
#overlay.outcome-toast #end-copy{font-size:12px;line-height:1.6;margin:6px 0 0;color:var(--muted)}
#overlay.outcome-toast .outcome-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
#overlay.outcome-toast.won .outcome-actions{margin:0}
#overlay.outcome-toast.game-over{width:auto;min-width:160px}
#overlay.outcome-toast.game-over h2{padding-right:0}
#overlay.outcome-toast.game-over .outcome-actions{display:none}
.power.rescue-available{box-shadow:0 0 18px 5px #eed5a14d;border-color:#eed5a1}
.denpa-mode .power.rescue-available{box-shadow:0 0 18px 5px #49e1ea55;border-color:#49e1ea}
#overlay.outcome-toast .outcome-actions button{display:flex;align-items:center;justify-content:center;gap:6px;width:auto;height:auto;min-height:40px;padding:8px;border:1px solid var(--line);border-radius:5px;font-size:12px;color:var(--ink)}
#overlay.outcome-toast .outcome-actions svg{width:18px;height:18px;flex:none}
#overlay.outcome-toast #continue{position:absolute;right:6px;top:6px;width:40px;height:40px;border:0;background:transparent;color:var(--ink)}
.denpa-mode #overlay.outcome-toast{border-radius:3px}
@media(max-width:600px){#overlay.outcome-toast{right:12px;bottom:12px;padding:14px;width:336px}}
@media(prefers-reduced-motion:reduce){#overlay.outcome-toast{transition:none}}
