/* Contour arcade mode lives within the original three glass apertures. */
.signal-run[hidden], .signal-run-controller[hidden], .signal-run-distance[hidden],
.signal-run-message[hidden] { display: none !important; }
.signal-run-launch {
  position: relative; z-index: 16;
  flex: 0 0 32px; align-self: stretch; border: 0; border-radius: 6px;
  padding: 0; background: none; color: var(--k-acc); font: 22px/1 var(--font);
  cursor: pointer; touch-action: manipulation;
}
.signal-run-launch:active { background: #84e7ce18; }
.contour-face[data-game=true] .contour-display > :not(.contour-status):not(.signal-run),
.contour-face[data-game=true] .contour-lower > :not(.signal-run-controller) {
  visibility: hidden !important; opacity: 0 !important; pointer-events: none !important;
}
.contour-face[data-game=true] .contour-key-pixels { visibility: hidden; }
.signal-run { position: absolute; inset: 8% 0 0; display: flex; flex-direction: column; overflow: hidden; color: #b7f6df; }
.signal-run-header {
  flex: 0 0 11%; min-height: 40px; display: flex; align-items: center; gap: 3px;
  border-bottom: 1px solid #bcebd426; font: 500 clamp(10px,2.8cqw,16px)/1 var(--mono);
}
.signal-run-header > span { flex: 1; white-space: nowrap; font-style: italic; letter-spacing: .04em; }
.signal-run-header button { flex: 0 0 32px; min-height: 36px; padding: 0; border: 0; border-radius: 7px; background: none; color: #c2f1de; cursor: pointer; font: 21px/1 var(--font); }
.signal-run-header button:disabled { opacity: .25; }
.signal-run-header button:active { background: #84e7ce18; }
.signal-run-score { flex: 0 0 auto; min-width: 5ch; text-align: right; font: inherit; font-variant-numeric: tabular-nums; }
.signal-run-board { position: relative; flex: 1; min-height: 0; }
/* A selected game owns the main glass; the chooser keeps the radio status row. */
:root[data-skin=contour] .contour-face[data-arcade] .contour-display {
  left: 5.3%; top: 15.3%; width: 66.2%; height: 57.4%;
}
.contour-face[data-arcade] .contour-status { display: none; }
.contour-face[data-arcade] .signal-run { inset: 0; }
.contour-face[data-arcade] .signal-run-header { flex: 0 0 36px; min-height: 36px; }
.pulse-snake .snake-hud { flex: 0 0 auto; padding: 0 5px; border: 0; font: inherit; letter-spacing: 0; }
.pulse-snake .signal-run-score { margin-left: 3px; padding-left: 7px; border-left: 1px solid #bcebd426; }
.signal-run-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.signal-run-message {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 8%; gap: 14px; text-align: center;
  background: #050d0bed; color: #d3f6e7;
}
.signal-run-message-title { font: 500 clamp(17px,5cqw,28px)/1.2 var(--font); letter-spacing: .06em; }
.signal-run-message-description { max-width: 28ch; font: 400 clamp(12px,3.3cqw,17px)/1.6 var(--font); color: #abcbbd; overflow-wrap: anywhere; }
.signal-run-primary { min-height: 44px; padding: 10px 26px; border: 1px solid #88e7c56b; border-radius: 10px; background: #84e7ce12; color: #c9ffea; font: 500 clamp(14px,3.5cqw,18px)/1.2 var(--font); cursor: pointer; }
.signal-run-primary:disabled { opacity: .35; cursor: default; }
.signal-run-primary:not(:disabled):active { background: #84e7ce2b; }
.signal-run-record { font: 400 clamp(11px,2.8cqw,15px)/1.3 var(--mono); color: #85b6a2; }
.signal-run-controller { position: absolute; inset: 4% 5% max(9%,var(--contour-safe-bottom,0px)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #c2f1de; }
.signal-run-steer { font: 500 clamp(11px,3cqw,16px)/1.2 var(--font); letter-spacing: .18em; }
.signal-run-pad { display: flex; align-items: center; width: 100%; flex: 1; min-height: 44px; max-height: 82px; gap: 12px; padding: 0 10px; border: 1px solid #9decc52b; border-radius: 999px; background: #04100c33; cursor: ew-resize; touch-action: none; user-select: none; -webkit-user-select: none; }
.signal-run-pad[aria-disabled=true] { opacity: .4; }
.signal-run-chevron { font: 300 30px/1 var(--font); color: #c2ead8; }
.signal-run-track { position: relative; flex: 1; height: 2px; background: #8aecc267; }
.signal-run-thumb { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: clamp(22px,6.5cqw,36px); aspect-ratio: 1; border-radius: 50%; background: #aff7d7; border: 1px solid #dbffed; box-shadow: 0 0 12px #77edbc50,inset 0 0 8px #f0fff830; }
.signal-run-pad:focus-visible { outline: 2px solid var(--k-hi); outline-offset: 3px; }
.signal-run-instruction { font: 400 clamp(9px,2.5cqw,14px)/1.2 var(--font); letter-spacing: .08em; color: #a9ccbb; text-align: center; }
.signal-run-distance { position: absolute; top: 11%; left: 0; right: 0; pointer-events: none; text-align: center; color: #b9edda; font: 500 clamp(11px,3.3cqw,18px)/1.3 var(--mono); font-variant-numeric: tabular-nums; }
@media (max-height: 650px) {
  .signal-run-header { min-height: 36px; font-size: 10px; }
  .signal-run-header button { flex-basis: 28px; }
  .signal-run-message { gap: 9px; }
  .signal-run-controller { gap: 4px; }
}

.contour-game-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 16px; padding: 7% 0; overflow-y: auto; }
.contour-game-card:first-child { margin-top: auto; }
.contour-game-card:last-child { margin-bottom: auto; }
.contour-game-card { display: grid; grid-template-columns: 36px 1fr; gap: 8px 10px; align-items: center; min-height: 98px; padding: 16px 12px; border: 1px solid #8ae5bb40; border-radius: 12px; background: #5ec39809; color: #c8f6e1; text-align: left; cursor: pointer; }
.contour-game-card strong { font: 500 clamp(12px,3.5cqw,19px)/1.3 var(--mono); letter-spacing: .035em; }
.contour-game-card > span:last-child { grid-column: 2; font: 400 clamp(11px,3cqw,16px)/1.4 var(--font); color: #9ec5b3; }
.contour-game-glyph { grid-row: span 2; text-align: center; font: 28px/1 var(--font); color: #a5f5cc; }
.contour-game-card:active { background: #8ae5bb1c; }
.contour-game-help { gap: 12px; text-align: center; font: 400 clamp(12px,3.2cqw,17px)/1.4 var(--font); }
.contour-game-help small { color: #8ab59f; font-size: .85em; }
.microplex-hud { flex: 0 0 auto; padding: 8px 0; color: #a6d3bb; font: 400 clamp(10px,2.7cqw,15px)/1.3 var(--mono); white-space: nowrap; text-align: center; border-bottom: 1px solid #8ae5bb20; }
.microplex-controller { inset: 3% 4% max(7%,var(--contour-safe-bottom,0px)); gap: 4px; }
.microplex-dpad { display: grid; grid-template-columns: repeat(3,minmax(44px,1fr)); grid-template-rows: repeat(2,minmax(44px,1fr)); gap: 3px; width: min(90%,240px); flex: 1; min-height: 91px; max-height: 120px; }
.microplex-direction { min-width: 44px; min-height: 44px; padding: 0; border: 1px solid #8ae5bb4d; border-radius: 10px; background: #5ec39810; color: #c8f6e1; font: 24px/1 var(--font); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.microplex-direction.up { grid-column: 2; }
.microplex-direction.left { grid-column: 1; grid-row: 2; }
.microplex-direction.down { grid-column: 2; grid-row: 2; }
.microplex-direction.right { grid-column: 3; grid-row: 2; }
.microplex-direction:active { background: #8ae5bb32; box-shadow: inset 0 0 9px #8ae5bb12; }
.microplex-direction:disabled { opacity: .3; }
.microplex-restart { min-height: 36px; border: 0; background: none; color: #8ebba5; font: 400 clamp(11px,3cqw,16px)/1.3 var(--font); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.microplex-restart[hidden] { display: none; }
.microplex .signal-run-message { padding: 6%; gap: 10px; }
/* Two thumb zones mirror as groups; the P mark stays upright. */
.snake-controller { inset: 1% 2% max(3%,var(--contour-safe-bottom,0px)); display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); column-gap: clamp(12px,3cqw,18px); align-items: stretch; }
.snake-controller[data-hand=left] { grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr); }
.snake-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: minmax(0,1fr) 28px; gap: 5px clamp(14px,4cqw,20px); min-width: 0; min-height: 0; }
.snake-action { --snake-charge: 0; position: relative; width: 100%; aspect-ratio: 1; align-self: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 0; padding: 4px 0; border: 1px solid #99e0bd66; border-radius: 11px; color: #c8f6df; background: linear-gradient(145deg,#8ae5bb12,#5e9b8503); cursor: pointer; touch-action: manipulation; }
.snake-action-label { font: 500 clamp(8px,2.25cqw,11px)/1 var(--mono); letter-spacing: .02em; }
.snake-action:disabled,.snake-direction:disabled { opacity: .35; cursor: default; }
.snake-action:not(:disabled):active,.snake-direction:not(:disabled):active { background: #8ae5bb26; box-shadow: inset 0 0 14px #a9f8d423; }
.snake-play-glyph { font: 24px/1 sans-serif; }
.snake-reverse-glyph { position: relative; isolation: isolate; display: grid; place-items: center; width: 28px; height: 28px; font: 23px/1 sans-serif; }
.snake-reverse-glyph::before { content: ''; position: absolute; inset: 0; z-index: -2; border-radius: 50%; background: conic-gradient(from -90deg,#a1f6c6 calc(var(--snake-charge)*1turn),#59877625 0); }
.snake-reverse-glyph::after { content: ''; position: absolute; inset: 3px; z-index: -1; border-radius: 50%; background: #0a2019; }
.snake-charge { position: absolute; top: 3px; right: 3px; padding: 1px 2px; border-radius: 3px; background: #071510; font: 400 clamp(8px,2cqw,10px)/1 var(--mono); color: #b2d1bd; }
.snake-hand { grid-column: 1/-1; display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; padding: 0; border: 0; border-radius: 6px; background: none; color: #9bc4b4; font: 500 clamp(8px,2.1cqw,11px)/1 var(--mono); white-space: nowrap; cursor: pointer; touch-action: manipulation; }
.snake-hand > span:first-child { font: 19px/1 sans-serif; }
.snake-hand:active { background: #8ae5bb18; }
.snake-dpad { container-type: size; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); grid-template-rows: minmax(0,1fr) 28px minmax(0,1fr); gap: 4px; min-width: 0; min-height: 0; }
.snake-direction { width: min(calc((100cqw - 8px)/3),calc((100cqh - 36px)/2)); aspect-ratio: 1; place-self: center; min-width: 0; min-height: 0; padding: 0; border: 1px solid #99e0bd66; border-radius: 9px; color: #c8f6df; background: linear-gradient(145deg,#8ae5bb12,#5e9b8503); font: 25px/1 var(--font); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.snake-direction.up { grid-column: 2; grid-row: 1; }
.snake-direction.down { grid-column: 2; grid-row: 3; }
.snake-direction.left { grid-column: 1; grid-row: 2; }
.snake-direction.right { grid-column: 3; grid-row: 2; }
.snake-pad-logo { grid-column: 2; grid-row: 2; place-self: center; width: min(80%,28px); max-height: 100%; object-fit: contain; opacity: .76; filter: saturate(.6) brightness(.9); pointer-events: none; }
.snake-side-effects { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; border-radius: 999px; pointer-events: none; }
.snake-side-label { position: absolute; top: 25%; left: 0; right: 0; padding: 0 3px; color: #b0d7bf; font: 500 clamp(7px,2cqw,11px)/1.2 var(--mono); letter-spacing: .02em; text-align: center; overflow-wrap: anywhere; pointer-events: none; }
.snake-side-effects[hidden],.snake-side-label[hidden] { display: none !important; }
.snake-side-label:not([data-bonus=idle]) { top: 4%; font-size: clamp(8px,2.2cqw,12px); color: #f1d394; }
.pulse-snake[data-zone=side] .signal-run-header > span { color: #f1d394; }
.snake-bonus-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ptt-wrap:has(.ptt[data-held]) .ptt > :is(.icon,.lbl) { mask-image: none !important; -webkit-mask-image: none !important; }
.ptt-wrap:has(.ptt[data-held]) :is(.snake-side-effects,.snake-side-label,.signal-run-distance) { visibility: hidden; }
.pulse-snake .signal-run-message { padding: 6%; gap: 10px; }
@media (max-height: 650px) {
  .microplex-controller { inset-block: 2%; }
  .microplex-controller .signal-run-instruction { display: none; }
  .microplex .signal-run-message { gap: 6px; padding: 4%; }
  .microplex .signal-run-message-description { line-height: 1.35; }
  .contour-game-card { padding: 10px; min-height: 76px; }
  .contour-game-list { gap: 10px; }
  .snake-controller { inset-block: 3%; }
  .snake-actions { grid-template-rows: minmax(0,1fr) 24px; row-gap: 2px; }
  .snake-action { gap: 3px; }
  .snake-action-label { writing-mode: horizontal-tb; font-size: 8px; letter-spacing: 0; }
  .snake-dpad { gap: 3px; grid-template-rows: minmax(0,1fr) 20px minmax(0,1fr); }
  .snake-direction { width: min(calc((100cqw - 6px)/3),calc((100cqh - 26px)/2)); font-size: 22px; }
  .snake-play-glyph { font-size: 21px; }
  .snake-reverse-glyph { width: 23px; height: 23px; font-size: 20px; }
  .pulse-snake .signal-run-message { gap: 6px; padding: 4%; }
  .pulse-snake .signal-run-message-description { line-height: 1.35; }
}
/* Two Decks: playable basement and a compact bank of square controls. */
.two-deck .signal-run-header > span { letter-spacing: .02em; }
.two-deck-next { flex: 0 0 27px; display: flex; align-items: center; gap: 5px; font: 10px/1 var(--mono); color: #8fb9a8; }
.two-deck-next canvas { width: 84px; height: 16px; }
.two-deck-metrics { margin-left: auto; white-space: nowrap; }
.two-deck .signal-run-message { padding: 5%; gap: 10px; }
.two-deck-controller { inset: 4% 3% max(5%,var(--contour-safe-bottom,0px)); display: grid; grid-template-columns: minmax(0,1fr) minmax(0,30%); gap: 3%; align-items: stretch; }
.two-deck-controller[data-hand=left] { grid-template-columns: minmax(0,30%) minmax(0,1fr); }
.two-deck-cellar { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.two-deck-cellar-label { flex: 0 0 16px; font: 500 clamp(7px,2.05cqw,11px)/1.2 var(--mono); color: #95bba7; text-align: center; white-space: nowrap; }
.two-deck-cellar-board { flex: 1; min-height: 0; position: relative; }
.two-deck-cellar canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.two-deck-controls { container-type: size; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: repeat(3,minmax(0,1fr)); gap: 4px; min-height: 0; min-width: 0; align-items: center; }
.two-deck-key { position: relative; width: min(calc((100cqw - 4px)/2),calc((100cqh - 8px)/3)); aspect-ratio: 1; place-self: center; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 1px; padding: 0; border: 1px solid #98d9b961; border-radius: 7px; background: linear-gradient(145deg,#8ae5bb16,#5e9b8503); color: #c9f6e0; font: clamp(19px,5.5cqw,27px)/1 var(--font); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.two-deck-key.gate { color: #efd28e; border-color: #efd28e69; }
.two-deck-key.gate > span:last-child { position: absolute; right: 3px; top: 3px; font: 9px/1 var(--mono); }
.two-deck-key:disabled { opacity: .3; cursor: default; }
.two-deck-key:not(:disabled):active { background: #8ae5bb36; }
.two-deck-controller[data-deck=cellar] .two-deck-cellar-label { color: #efd28e; }
.two-deck[data-deck=cellar] .signal-run-header > span { color: #efd28e; }
.two-deck-key:focus-visible { outline: 2px solid #b5f6da; outline-offset: 1px; }
.two-deck-gate-word { font: 600 clamp(8px,2.4cqw,12px)/1 var(--mono); letter-spacing: .02em; }
.two-deck-key.pause[data-playing=true]::before,.two-deck-key.pause[data-playing=true]::after { content: ''; position: absolute; top: calc(50% - 7px); width: 3px; height: 14px; background: currentColor; border-radius: 1px; }
.two-deck-key.pause[data-playing=true]::before { left: calc(50% - 5px); }
.two-deck-key.pause[data-playing=true]::after { left: calc(50% + 2px); }
.two-deck-metrics[data-level-up=true] { color: #ffdf91; text-shadow: 0 0 7px #ffce6a66; }
.two-deck-controller[data-material=bomb] .two-deck-cellar-label { color: #efc083; }
.two-deck-controller[data-material=gun] .two-deck-cellar-label { color: #9ef2e3; }
.two-deck .signal-run-message { overflow-y: auto; overscroll-behavior: contain; justify-content: flex-start; }
.two-deck .signal-run-message > * { flex-shrink: 0; }
.two-deck .signal-run-message-title { margin-top: auto; }
.two-deck .signal-run-record { margin-bottom: auto; }
/* Direct field taps steer Snake without turning a touch into page scrolling. */
.pulse-snake .signal-run-canvas { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
