:root {
  --hero-size: clamp(52px,10.7vw,94px);
  color-scheme: dark;
  --bg: #111210;
  --fg: #f1f2e9;
  --muted: #a1a598;
  --line: #383c32;
  --acid: #00FF41;
  font-family: Arial,Helvetica,sans-serif;
  background: var(--bg);
  color: var(--fg);
}

/* Optional result utilities stay below the primary action. */
.result-actions { padding-top: 12px; }
.result-actions button {
  background: none; border: 0; padding: 12px 0; min-height: 44px;
  font: 12px 'Courier New',monospace; letter-spacing: .6px;
  color: var(--fg);
}
.result-actions .result-share { display: block; width: min(100%,360px); min-height: 56px; border: 1px solid var(--muted); padding: 16px 22px; text-align: left; font: 700 16px Arial,Helvetica,sans-serif; }
.result-utilities { display: flex; gap: 20px; }
.result-utilities button { color: var(--muted); font-size: 11px; }
@media(max-width:480px) {
  :root { --hero-size: clamp(44px,11.4vw,55px); }
  .result-actions .result-share { width: 100%; text-align: left; }

}
.result-actions button:hover { color: var(--acid); }
.result-actions button:focus-visible { outline: 1px solid var(--acid); outline-offset: 3px; }
.result-actions button:disabled { opacity: .6; cursor: default; }
.share-status { min-height: 14px; margin: 0; font: 11px 'Courier New',monospace; color: var(--muted); }

#share-panel { width: min(460px,calc(100% - 32px)); max-height: calc(100svh - 32px); overflow-y: auto; padding: 16px 20px 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
#share-panel::backdrop { background: rgb(0 0 0 / .78); }
#share-panel[open] { display: flex; flex-direction: column; overflow: hidden; }
html:has(#share-panel[open]) { overflow: hidden; }
.panel-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 2px 2px; }
#share-panel .panel-heading { flex-shrink: 0; }
#panel-extras h3 { font: 11px 'Courier New',monospace; letter-spacing: 1px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 10px; margin: 20px 0 8px; }
#share-panel .panel-secondary button { border-color: transparent; border-bottom-color: rgb(240 240 230 / .12); color: var(--muted); }
#share-panel .panel-secondary button:focus-visible { color: var(--acid); border-color: var(--acid); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
#panel-title { font: 700 20px Arial,Helvetica,sans-serif; letter-spacing: -.5px; margin: 0; }
#share-panel button { min-height: 44px; padding: 10px 12px; border: 1px solid rgb(240 240 230 / .12); background: none; color: var(--fg); font: 12px 'Courier New',monospace; text-align: left; }
#share-panel button:focus-visible,#share-panel button:active { border-color: var(--acid); color: var(--acid); }
@media(hover:hover) { #share-panel button:hover { border-color: var(--acid); color: var(--acid); } }
#share-panel button:focus-visible,#panel-copy:focus-visible { outline: 1px solid var(--acid); outline-offset: 2px; }
.panel-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
#share-panel #panel-close,#share-panel #panel-more,#share-panel #panel-back { border: 0; color: var(--muted); }
#share-panel #panel-close { flex-shrink: 0; font-size: 10px; padding: 12px 8px; }
#share-panel #panel-more { display: flex; align-items: center; gap: 8px; padding-left: 0; margin-top: 2px; }
#share-panel #panel-close:focus-visible,#share-panel #panel-more:focus-visible,#share-panel #panel-back:focus-visible { color: var(--acid); }
@media(hover:hover) { #share-panel #panel-close:hover,#share-panel #panel-more:hover,#share-panel #panel-back:hover { color: var(--acid); } }
#share-panel #panel-back { flex-shrink: 0; align-self: flex-start; padding-left: 0; }
#panel-extras section:first-child h3 { margin-top: 0; }
#panel-status { font: 12px/1.5 'Courier New',monospace; color: var(--muted); margin-bottom: 0; }
#panel-status:empty { display: none; }
#panel-copy { margin-top: 12px; width: 100%; padding: 10px; resize: vertical; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: 12px/1.5 'Courier New',monospace; }
@media(max-width:360px) { #share-panel { padding: 12px 16px 10px; } #share-panel button { padding: 10px 8px; font-size: 11px; } }

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button: focus-visible {;
  outline: 3px solid var(--fg);
  outline-offset: 5px;
}

button: disabled {;
  cursor: default;
}

button,h1,h2,.play {
  -webkit-user-select: none;
  user-select: none;
}

button {
  color: inherit;
}

[hidden] {
  display: none!important;
}

.shell {
  max-width: 780px;
  min-height: 100svh;
  margin: auto;
  padding: 24px 32px 18px;
  display: flex;
  flex-direction: column;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 19px;
}

.wordmark {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -2px;
}

.sound {
  background: none;
  border: 1px solid var(--line);
  padding: 12px;
  font: 12px 'Courier New',monospace;
  letter-spacing: 1px;
  min-height: 44px;
}

.sound span {
  margin-left: 12px;
  color: var(--acid);
}

main {
  flex: 1;
  display: flex;
}

.screen {
  width: 100%;
}

.intro {
  display: flex;
  flex-direction: column;
  padding-top: 50px;
}

.eyebrow,.round-label,.stats span,.timer-label,.control-note,footer,.record span,.final-score>span,.results span {
  font: 12px 'Courier New',monospace;
  letter-spacing: 1.2px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

h1,h2 {
  font-family: 'Arial Black',Arial,Helvetica,sans-serif;
  font-weight: 950;
  font-size: var(--hero-size);
  line-height: .91;
  letter-spacing: -.07em;
  margin: 32px 0 23px;
}

h1>span:not(.period),h2>span {
  color: var(--acid);
}

.period {
  color: var(--fg);
}

.subtitle {
  font-size: 20.24px;
  margin: 0;
}

.start-bottom {
  margin-top: auto;
}

.record {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.record span {
  color: var(--muted);
}

.record strong {
  font: 22px 'Courier New',monospace;
}

.primary {
  background: var(--acid);
  border: 0;
  color: var(--bg);
  padding: 23px 25px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -1px;
  min-height: 78px;
}

.primary:active {
  transform: translateY(2px);
}

footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 16px;
  font-size: 10px;
  letter-spacing: 1px;
}

.play {
  display: flex;
  flex-direction: column;
  padding-top: 24px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-bottom: 27px;
}

.stats span,.results span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stats strong {
  display: inline-block;
  font: 900 32px 'Courier New',monospace;
}

.lives-stat {
  text-align: right;
}

#lives {
  color: var(--acid);
  letter-spacing: 8px;
}

#lives .lost {
  color: #55594f;
}

.timer-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 9px;
}

.timer {
  height: 5px;
  background: var(--line);
  overflow: hidden;
}

.timer>div {
  height: 100%;
  background: var(--acid);
  transform-origin: left;
  will-change: transform;
}

.instruction-area {
  flex: 1;
  min-height: 290px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0;
}

.round-label {
  color: var(--muted);
  margin-bottom: 25px;
}

.instruction {
  font-family: 'Arial Black',Arial,sans-serif;
  font-size: clamp(43px,10vw,78px);
  font-weight: 950;
  line-height: 1.04;
  letter-spacing: -.06em;
}

.instruction>span {
  display: block;
}

.instruction>span:last-child {
  color: var(--acid);
  font-size: 1.25em;
}

.feedback {
  font: 700 14px 'Courier New',monospace;
  min-height: 20px;
  margin: 22px 0 0;
  color: var(--acid);
}

.feedback.error {
  color: var(--fg);
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 132px;
  padding: 17px 22px;
  background: var(--fg);
  color: var(--bg);
  border: 2px solid var(--fg);
  font-weight: 900;
  font-size: 32px;
  letter-spacing: -1px;
}

.choice:active {
  background: var(--acid);
  border-color: var(--acid);
}

.choice.reveal {
  background: var(--acid);
  border-color: var(--acid);
}

.choice:disabled:not(.reveal) {
  background: #262922;
  color: var(--muted);
  border-color: var(--line);
}

.control-note {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin: 16px 0 0;
}

.control-note span {
  padding: 0 10px;
  color: var(--line);
}

.over {
  padding-top: 40px;
  display: flex;
  flex-direction: column;
}

.over h2 {
  font-size: var(--hero-size);
  margin: 30px 0;
}

.final-score {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.final-score>span {
  color: var(--muted);
}

.final-score strong {
  font-size: 76px;
  letter-spacing: -5px;
}

.results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  padding: 20px 0 25px;
  margin-bottom: 30px;
}

.results>div:last-child {
  text-align: right;
}

.results strong {
  font: 700 27px 'Courier New',monospace;
}

.over .primary {
  margin-top: auto;
}

@media(min-width:900px) {
  .shell {
    min-height: min(900px,100svh);
    padding-top: 32px;
  }
  .intro {
    padding-top: 54px;
  }
}

/* Bound desktop whitespace without limiting content height or touch layouts. */
@media(min-width:481px) and (hover:hover) and (pointer:fine) {
  .shell {
    min-height: min(900px,100svh);
  }
}

@media(hover:none) and (pointer:coarse) {
  .shell {
    min-height: 100svh;
  }
}

@media(max-width:480px) {
  .shell {
    padding: max(16px,env(safe-area-inset-top)) 20px max(16px,env(safe-area-inset-bottom));
  }
  .masthead {
    padding-bottom: 12px;
  }
  .intro {
    padding-top: 35px;
  }
  h1 {
    font-size: var(--hero-size);
    margin-top: 30px;
  }
  .subtitle {
    font-size: 18.4px;
  }
  .eyebrow {
    font-size: 11px;
    letter-spacing: .6px;
  }
  .play {
    padding-top: 20px;
  }
  .stats {
    margin-bottom: 22px;
  }
  .instruction {
    font-size: clamp(41px,11.8vw,57px);
  }
  .instruction-area {
    min-height: 280px;
  }
  .choice {
    min-height: 125px;
    padding: 16px;
    font-size: 29px;
  }
  footer {
    margin-top: 22px;
    font-size: 9px;
    letter-spacing: .5px;
  }
}

@media(max-height:700px) {
  .intro {
    padding-top: 24px;
  }
  .instruction-area {
    min-height: 225px;
    padding: 15px 0;
  }
  .round-label {
    margin-bottom: 17px;
  }
  .choice {
    min-height: 105px;
  }
  .over {
    padding-top: 25px;
  }
  .over h2 {
    margin: 20px 0;
    font-size: var(--hero-size);
  }
  .final-score strong {
    font-size: 60px;
  }
  footer {
    margin-top: 18px;
  }
}

@media(max-height:600px) and (max-width:480px) {
  .shell {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .masthead {
    padding-bottom: 8px;
  }
  .play {
    padding-top: 12px;
  }
  .stats {
    margin-bottom: 12px;
  }
  .stats strong {
    font-size: 27px;
  }
  .stats span {
    margin-bottom: 4px;
  }
  .instruction-area {
    min-height: 185px;
    padding: 12px 0;
  }
  .round-label {
    margin-bottom: 12px;
    font-size: 10px;
  }
  .feedback {
    margin-top: 12px;
    font-size: 12px;
  }
  .choice {
    min-height: 90px;
    padding: 10px 15px;
    font-size: 27px;
  }
  .control-note {
    margin-top: 12px;
  }
  footer {
    margin-top: 14px;
    padding-top: 10px;
  }
  .intro {
    padding-top: 20px;
  }
  .intro h1 {
    margin: 22px 0 18px;
  }
  .primary {
    min-height: 64px;
    padding: 18px 22px;
  }
  .over {
    padding-top: 22px;
  }
  .over h2 {
    font-size: var(--hero-size);
    margin: 22px 0;
  }
  .final-score {
    padding-top: 12px;
  }
  .final-score strong {
    font-size: 54px;
  }
  .results {
    padding: 14px 0;
    margin-bottom: 22px;
  }
}

@media(max-height:600px) and (max-width:480px) {
  .intro .intro h1 {
    margin-top: 18px;
  }
}

.intro .eyebrow,.record span {
  font-size: 14.1px;
}

footer {
  font-size: 11.8px;
}

@media(max-width:480px) {
  .intro .eyebrow {
    font-size: 12.94px;
  }
  footer {
    font-size: 10.6px;
  }
}

.wordmark {
  position: relative;
  display: block;
  width: 76px;
  height: 44px;
  overflow: hidden;
  flex: none;
  transform: scale(.85);
  transform-origin: left top;
  background: var(--bg);
}

.wordmark:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 5px;
}

.wordmark img {
  position: absolute;
  display: block;
  width: 229.27px;
  height: auto;
  max-width: none;
  left: -76px;
  top: -60.8px;
  mix-blend-mode: screen;
}

.header-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

#sound {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  padding: 12px 0 12px 12px;
  color: var(--muted);
  font-size: 13px;
}

#sound span {
  display: block;
  flex: 0 0 calc(3ch + 3px);
  width: calc(3ch + 3px);
  margin-left: 0;
  text-align: left;
  color: var(--fg);
}

#sound[aria-pressed='true'] span {
  color: var(--muted);
}

#sound:hover {
  color: var(--fg);
}

@media(max-width:360px) {
  .header-controls {
    gap: 6px;
  }
  .header-controls .sound {
    padding: 10px 8px;
  }
  .sound span {
    margin-left: 5px;
  }
}

#start-best {
  font-size: 26px;
}

.primary {
  position: relative;
  isolation: isolate;
  background: var(--acid);
}

.primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
  border: 2px solid var(--acid);
  clip-path: inset(0 0 0 100%);
  z-index: -1;
  pointer-events: none;
}

.primary .action-command {
  display: none;
  position: absolute;
  right: 25px;
  font: 11.8px 'Courier New',monospace;
  letter-spacing: 1px;
  color: var(--acid);
  pointer-events: none;
}

.primary:focus-visible {
  color: var(--acid);
}

.primary:focus-visible::before {
  clip-path: inset(0);
}

@media(hover:hover) and (pointer:fine) {
  .primary::before {
    transition: clip-path 140ms ease-out;
  }
  .primary:hover {
    color: var(--acid);
    transition: color 90ms step-end;
  }
  .primary:hover::before {
    clip-path: inset(0);
  }
  .primary:hover .action-command {
    display: block;
  }
}

@media(max-width:480px) {
  .primary .action-command {
    font-size: 10.6px;
    letter-spacing: .5px;
  }
}

@media(max-height:600px) and (max-width:480px) {
  .primary .action-command {
    right: 22px;
  }
}

#start .action-command { font-size: 14.1px; }

/* Compact only the gameplay utilities; the command area's flex space and
   minimum height stay intact, preserving its separation from the choices. */
#play-screen {
  padding-top: 18px;
}

#play-screen .stats {
  margin-bottom: 16px;
}

#play-screen .stats span {
  margin-bottom: 4px;
}

#play-screen .timer-label {
  justify-content: flex-end;
  margin-bottom: 7px;
}

#home {
  border: 0;
  color: var(--muted);
  font-size: 13px;
}

#home:hover {
  color: var(--fg);
}

#play-screen .control-note {
  font-size: 12.5px;
  letter-spacing: .8px;
}

@media(hover:hover) and (pointer:fine) {
  #play-screen .choice:hover:not(:disabled):not(:active) {
    background: var(--bg);
    color: var(--fg);
    border-color: var(--fg);
  }
}

#play-screen .choice:active:not(:disabled) {
  background: var(--acid);
  color: var(--bg);
  border-color: var(--acid);
}

@media(max-width:480px) {
  #play-screen {
    padding-top: 16px;
  }
  #play-screen .stats {
    margin-bottom: 14px;
  }
}

@media(max-height:600px) and (max-width:480px) {
  #play-screen {
    padding-top: 10px;
  }
  #play-screen .stats {
    margin-bottom: 10px;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation: none!important;
    transition: none!important;
  }
}

#over-title:focus {
  outline: none;
}

.complete {
  display: flex;
  flex-direction: column;
  padding-top: 40px;
}

.complete h2 {
  font-size: var(--hero-size);
  margin: 26px 0 12px;
}

#complete-title:focus {
  outline: none;
}

.eventually {
  font-family: 'Arial Black',Arial,Helvetica,sans-serif;
  font-size: calc(var(--hero-size) * .6);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.05em;
  color: var(--fg);
  margin: 0 0 24px;
  min-height: 14px;
  opacity: 0;
}

.eventually span {
  visibility: hidden;
}

.eventually.revealed {
  opacity: 1;
}

.eventually.revealed span {
  visibility: visible;
}

/* One clean registration, one traveling rule accent, then the static verdict. */
.complete.completion-entry #complete-title > span {
  position: relative;
  animation: completion-register 240ms cubic-bezier(.2,.8,.2,1);
}
.complete .final-score { position: relative; }
.complete.completion-entry .final-score::before {
  content: '';
  position: absolute;
  pointer-events: none;
  top: -1px; left: 0;
  width: 12%; height: 1px;
  background: var(--acid);
  opacity: 0;
  animation: completion-sweep 280ms 40ms linear;
}
.complete.completion-entry .eventually {
  animation: completion-punchline 160ms 560ms ease-out backwards;
}
@keyframes completion-register {
  from { left: -2px; }
  65%,to { left: 0; }
}
@keyframes completion-sweep {
  0% { transform: translateX(0); opacity: 0; }
  20% { opacity: .7; }
  100% { transform: translateX(733.333%); opacity: 0; }
}
@keyframes completion-punchline {
  from { opacity: 0; }
  to { opacity: 1; }
}

.complete .primary {
  margin-top: auto;
}

@media(max-width:480px) {
  .complete {
    padding-top: 28px;
  }
  .complete h2 {
    font-size: var(--hero-size);
    margin: 24px 0 12px;
  }
}

@media(max-height:700px) {
  .complete {
    padding-top: 22px;
  }
  .complete h2 {
    font-size: var(--hero-size);
    margin: 20px 0 10px;
  }
  .complete .eventually {
    margin-bottom: 18px;
  }
}

@media(max-height:600px) and (max-width:480px) {
  .complete {
    padding-top: 16px;
  }
  .complete h2 {
    font-size: var(--hero-size);
    margin: 16px 0 8px;
  }
  .complete .eventually {
    margin-bottom: 14px;
  }
}

@media(prefers-reduced-motion:reduce) {
  .complete.completion-entry #complete-title > span,
  .complete.completion-entry .final-score::before,
  .complete.completion-entry .eventually {
    animation: none;
  }
}

/* Gameplay polish: keep the command slot and controls stable at every layer count. */
#play-screen .stats {
  align-items: baseline;
}

#play-screen .stats>div:nth-child(2) {
  text-align: center;
}

#play-screen #lives .lost {
  display: inline;
  margin: 0;
}

#play-screen .timer-label {
  margin-bottom: 4px;
}

#time.urgent,#level.advanced,#score.confirmed {
  color: var(--acid);
}

#play-screen .instruction-area {
  position: relative;
  flex-shrink: 0;
}

#play-screen .instruction {
  min-height: 3.38em;
}

#play-screen .feedback {
  height: 34px;
  flex-shrink: 0;
  font-size: clamp(16px,2.2vw,18px);
}

#play-screen .feedback.error {
  font-size: clamp(20.8px,2.86vw,23.4px);
  line-height: 1;
}

.feedback.error .failure-state {
  color: var(--acid);
}

#run-status {
  position: absolute;
  bottom: 24px;
  left: 0;
  margin: 0;
  font: 22px 'Courier New',monospace;
  letter-spacing: 1.2px;
  color: var(--muted);
}

#play-screen.paused #instruction {
  visibility: hidden;
}

#play-screen.paused .feedback {
  visibility: hidden;
}

#pause {
  border: 0;
  color: var(--muted);
  font-size: 13px;
  min-width: 70px;
}

#pause:hover {
  color: var(--fg);
}

#play-screen .choice[aria-disabled='true'] {
  cursor: default;
}

#play-screen .choice.accepted,#play-screen .choice.reveal {
  background: var(--acid)!important;
  border-color: var(--acid)!important;
  color: var(--bg)!important;
}

@media(max-width:480px) {
  .header-controls:has(#pause:not([hidden])) {
    gap: 0;
  }
  .header-controls:has(#pause:not([hidden])) #home,.header-controls:has(#pause:not([hidden])) #pause {
    padding: 12px 6px;
  }
  .header-controls:has(#pause:not([hidden])) #sound {
    padding-left: 4px;
  }
}

/* Resume cue occupies the instruction anchor without changing its layout slot. */
#play-screen .command-slot {
  position: relative;
  font-size: clamp(43px,10vw,78px);
}

#play-screen .command-slot .instruction {
  font-size: inherit;
}

#ready-cue {
  position: absolute;
  left: 0;
  top: 0;
  font-family: 'Arial Black',Arial,Helvetica,sans-serif;
  font-size: .55em;
  font-weight: 950;
  line-height: 1.04;
  letter-spacing: -.06em;
  color: var(--fg);
}

#play-screen.ready #instruction {
  visibility: hidden;
}

#play-screen.ready .feedback {
  visibility: hidden;
}

#play-screen .control-note .input-help,#play-screen .control-note .keyboard-hint {
  padding: 0;
  color: var(--muted);
}

#mobile-pause {
  display: none;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  letter-spacing: inherit;
  min-width: 78px;
  min-height: 44px;
  padding: 12px 0 12px 12px;
  text-align: right;
}

#mobile-pause:hover,#mobile-pause:focus-visible {
  color: var(--fg);
}

@media(max-width:480px) {
  #play-screen .command-slot {
    font-size: clamp(41px,11.8vw,57px);
  }
}

@media(hover:none) and (pointer:coarse) {
  #play-screen .control-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    margin-top: 8px;
    min-height: 44px;
  }
  #mobile-pause {
    display: block;
  }
  #play-screen .keyboard-hint {
    display: none;
  }
}

