:root {
  color-scheme: dark;
  --night: #0c2021;
  --panel: #153230;
  --ink: #f5ecd5;
  --muted: #bbcabd;
  --gold: #f2cb73;
  --rule: #41615a;
  --red: #c84438;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* {box-sizing: border-box}
body {margin: 0; background: var(--night); color: var(--ink); font: 16px/1.5 system-ui, sans-serif}
button, a {touch-action: manipulation}
button {cursor: pointer; color: inherit}
a {color: inherit}
button:focus-visible, a:focus-visible {outline: 3px solid var(--gold); outline-offset: 3px}
.arcade {width: min(1192px, 100%); padding: 0 clamp(15px, 4vw, 56px) 35px; margin: auto}
.cabinet-top {height: 56px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--rule)}
.cabinet-top .experiment-back {justify-self: start; padding: 0; font-size: 14px; text-decoration: none}
.venue, .panel-label, .lane-top, .overline, .card-head > span, .rack-head > span:last-child, .original-actions > span {
  font: 500 11px/1.45 var(--mono); letter-spacing: .1em; text-transform: uppercase
}
.venue {font-size: 12px; font-weight: 600; letter-spacing: .16em}
#sound {justify-self: end; background: transparent; border: 1px solid var(--rule); border-radius: 4px; font-size: 12px; min-height: 34px; padding: 4px 12px}
#sound[aria-pressed="true"] {color: var(--gold); border-color: var(--gold)}
.mast {display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 22px 0 18px}
.overline {margin: 0; color: var(--gold); font-weight: 600}
.overline span {margin-right: 3px}
.mast h1 {font-size: clamp(46px, 6.5vw, 84px); line-height: .99; margin: 4px 0 0; letter-spacing: -.058em!important; font-weight: 700 !important}
.mast h1 span {color: #e26952}
.classic-link {color: var(--muted); font-size: 14px; text-underline-offset: 4px; margin-bottom: 4px}
.cabinet {display: grid; grid-template-columns: minmax(0, 3.35fr) minmax(194px, 1fr); border: 1px solid var(--rule); border-radius: 5px; overflow: hidden; background: var(--panel)}
.lane-panel {min-width: 0}
.lane-top, .score-head, .rack-head, .card-head, .card-foot {display: flex; justify-content: space-between; align-items: center}
.lane-top {padding: 7px 16px; background: #233f39; color: #ece9d4}
.stage {position: relative; isolation: isolate; background: #183b42; aspect-ratio: 16/9; overflow: hidden; cursor: crosshair; touch-action: manipulation}
canvas {display: block; height: 100%; width: 100%}
.result-sign {position: absolute; left: 50%; bottom: 10%; transform: translateX(-50%) rotate(-2deg); padding: .12em .55em .2em; white-space: nowrap; font-size: clamp(18px, 3vw, 39px); color: #fff2c8; font-weight: 750; letter-spacing: -.04em; background: #862d29; border: 2px solid #f3c573; border-radius: 4px; box-shadow: 3px 3px 0 #102927; pointer-events: none}
.controls {display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-top: 1px solid var(--rule); min-height: 67px}
#bowl, .primary-small, .download {background: var(--gold); color: #202b24; border: 1px solid #f2cb73; font-weight: 700; border-radius: 3px; padding: 10px 17px; line-height: 1.25; white-space: nowrap}
#bowl {min-height: 44px; min-width: 125px; font-size: 16px}
#bowl:disabled {opacity: .65; cursor: default}
#bowl kbd {margin-left: 5px; padding: 2px 4px; font-size: 10px; text-transform: uppercase; color: #474132; border: 1px solid #98814e; border-radius: 2px}
.controls p {flex: 1; margin: 0; color: #dfdfce; font-size: 14px; line-height: 1.35}
.quiet {background: transparent; border: 1px solid #678076; border-radius: 50%; height: 32px; width: 32px; flex-shrink: 0; font: 600 17px/1 var(--mono)}
.booth {border-left: 1px solid var(--rule); padding: 18px clamp(14px, 2vw, 25px); display: flex; flex-direction: column}
.score-head {color: var(--muted)}
.score-line {display: flex; align-items: baseline; gap: 12px}
.score-line strong {font: 600 clamp(39px, 5vw, 71px)/1.1 var(--mono); color: var(--gold); letter-spacing: -.08em}
.score-line span {font-size: 13px; color: var(--muted)}
.rack-head {border-top: 1px solid var(--rule); padding-top: 13px; margin-top: 13px; color: var(--muted)}
.rack-head > span:last-child {letter-spacing: 0; text-transform: none}
.pin-deck {width: 82px; height: 61px; margin: 13px auto 16px; position: relative}
.pin-deck i {height: 10px; width: 10px; position: absolute; background: var(--ink); border: 1px solid var(--ink); border-radius: 50%}
.pin-deck i.down {background: transparent; border-color: #71867c}
.radio {border-top: 1px solid var(--rule); padding-top: 14px}
.radio .panel-label {color: var(--muted)}
.radio i {display: inline-block; width: 7px; height: 7px; background: #ef8b69; border-radius: 50%; margin-right: 5px; vertical-align: 1px}
#speaker {color: var(--gold); font: 600 12px/1.3 var(--mono); margin: 10px 0 3px}
blockquote {margin: 0; font-size: clamp(15px, 1.55vw, 21px); line-height: 1.3; letter-spacing: -.012em}
.scorecard {margin-top: 19px; border: 1px solid #bcb39c; color: #273a31; background: #efe8d2; border-radius: 4px; padding: 12px 17px 7px}
.card-head h2 {margin: 0; font-size: 22px; line-height: 1.15}
.card-head > span {letter-spacing: .035em}
#frames {list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(10,minmax(0,1fr)); border: solid #aca990; border-width: 0 0 1px 1px}
#frames li {border: solid #aca990; border-width: 1px 1px 0 0; text-align: center; font-family: var(--mono); font-variant-numeric: tabular-nums}
#frames .current {background: #e8d5a5; box-shadow: inset 0 3px #846625}
.frame-number, .marks, .total {display: block}
.frame-number {font-size: 10px; padding: 3px 0 1px; color: #44594c}
.marks {font-size: 13px; white-space: pre; line-height: 1.4; min-height: 19px}
.total {border-top: 1px dotted #b9b49c; min-height: 20px; font-size: 13px; font-weight: 600}
.card-foot {font: 11px/1.5 var(--mono); padding-top: 3px; color: #46564b}
.text-btn {background: transparent; font-size: 12px; border: 0; text-decoration: underline; text-underline-offset: 3px; min-height: 33px}
.original {display: flex; justify-content: space-between; align-items: center; gap: 22px; margin-top: 30px; border-top: 1px solid var(--rule); padding-top: 23px}
.original h2, .guide h2 {margin: 4px 0 3px; font-size: clamp(24px, 3vw, 32px); line-height: 1.2}
.original p:not(.overline), .credit {margin: 7px 0 0; max-width: 580px; color: var(--muted); font-size: 14px}
.original-actions {display: grid; justify-items: start; gap: 5px; flex-shrink: 0}
.original-actions > span {letter-spacing: .035em; color: var(--muted)}
.download {display: inline-block; text-decoration: none; font-size: 14px}
.credit {font-size: 12px; margin-top: 20px; max-width: none}
.guide {border: 1px solid #7f9688; border-radius: 5px; background: #193631; color: var(--ink); padding: 25px; max-width: min(430px, calc(100vw - 24px)); box-shadow: 0 20px 80px #07100ec7}
.guide::backdrop {background: #071614c9}
.guide p {font-size: 15px}
.guide button {min-height: 42px}
.choices {display: flex; gap: 12px}
.choices button:first-child {border: 1px solid var(--rule); background: transparent; padding: 6px 14px; border-radius: 3px}
.sr {position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0}
[hidden] {display:none !important}
@media (max-width: 760px) {
  .booth {padding: 12px}
  .score-line strong {font-size: 37px}
  .venue {font-size: 10px}
  .controls {gap: 8px}
}
@media (max-width: 650px) {
  .cabinet-top {height: 45px}
  .mast {padding: 16px 0 13px}
  .mast h1 {font-size: clamp(41px, 10.8vw, 60px)}
  .classic-link {font-size: 12px}
  .cabinet {display: block}
  .booth {display: grid; grid-template-columns: 77px minmax(0,1fr); align-items: center; column-gap: 11px; padding: 10px 12px; border: 0; border-top: 1px solid var(--rule)}
  .score-head {grid-area: 1/1; align-self: end}
  .score-head span:last-child, .rack-head, .pin-deck {display: none}
  .score-line {grid-area: 2/1; align-self: start; flex-wrap: wrap; gap: 0 5px}
  .score-line strong {font-size: 31px}
  .score-line span {font-size: 11px}
  .radio {grid-area: 1/2/3/3; border: 0; border-left: 1px solid var(--rule); padding: 0 0 0 11px; min-height: 62px}
  .radio .panel-label {display: none}
  #speaker {margin: 0 0 3px; font-size: 11px}
  blockquote {font-size: 15px}
  .controls {padding: 8px; min-height: 58px}
  #bowl {min-width: 90px; padding: 8px 10px}
  #bowl kbd {display: none}
  .controls p {font-size: 12px}
  .lane-top {padding: 5px 10px; font-size: 10px}
  .scorecard {padding: 10px 10px 4px; margin-top: 12px}
  .card-head h2 {font-size: 20px}
  #frames {grid-template-columns: repeat(5,minmax(0,1fr))}
  #frames li {display: grid; grid-template-columns: 14px 1fr}
  .frame-number {grid-area: 1/1; padding: 1px 0 0; align-self: center}
  .marks {grid-area: 1/2; font-size: 12px}
  .total {grid-column: span 2; min-height: 14px; font-size: 11px; line-height: 1.25}
  .original {margin-top: 20px; padding-top: 18px; flex-wrap: wrap; gap: 10px}
}

.mast .classic-link {padding: 10px 15px; background: var(--gold); color: #202b24; font-weight: 650; border-radius: 3px; text-decoration: none}
.mast .classic-link:hover, #bowl:not(:disabled):hover, .download:hover {background: #ffe09b}
.zip-link {font-size: 14px; text-underline-offset: 3px}
@media (max-width: 460px) {
  .mast .classic-link {padding: 8px 9px; max-width: 126px; line-height: 1.25}
}
