:root {
  --bg: #1a1b26;
  --panel: #24283b;
  --text: #c0caf5;
  --muted: #a9b1d6;
  --blue: #7aa2f7;
  --cyan: #7dcfff;
  --violet: #bb9af7;
  --red: #f7768e;
  --green: #9ece6a;
  --line: #3b4261;
  --cream: #f4f1ea;
  --orange: #ff8038;
  --wheel: #12141c;
  --rust: #4a5060;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html.play-page {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.play-page[data-play-phase="day"] {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1rem;
  line-height: 1.6;
}

html.play-page,
html.play-page body {
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

html.play-page {
  touch-action: manipulation;
  overscroll-behavior: none;
}

html.play-page.is-playing,
html.play-page.is-playing body {
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

a {
  color: var(--cyan);
}

a:hover {
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 3;
  background: var(--panel);
  color: var(--text);
  padding: 0.5rem 0.75rem;
}

.skip:focus {
  top: 0.75rem;
}

.wrap {
  width: min(46rem, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header,
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 1.25rem 0;
}

.wordmark {
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.wordmark span {
  color: var(--violet);
}

.prompt {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.1rem;
}

nav a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.terminal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.chrome {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.chrome span {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--line);
  display: inline-block;
}

.chrome span:nth-child(1) { background: #f7768e; }
.chrome span:nth-child(2) { background: #e0af68; }
.chrome span:nth-child(3) { background: #9ece6a; }

.chrome b {
  margin-left: 0.4rem;
  font-weight: 600;
}

.terminal-body {
  padding: 1.25rem 1.1rem 1.4rem;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: 1.7rem;
  line-height: 1.25;
  font-weight: 650;
}

h2 {
  margin: 1.3rem 0 0.45rem;
  font-size: 1.15rem;
  line-height: 1.35;
}

.kicker {
  margin: 0 0 0.8rem;
  color: var(--violet);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

p {
  margin: 0 0 0.9rem;
}

.lead {
  font-size: 1.05rem;
}

.button,
button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 4px;
  background: var(--blue);
  color: var(--bg);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
button:hover {
  background: var(--cyan);
  color: var(--bg);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.site-footer {
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 0.5rem;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  gap: 1.1rem;
}

.site-footer .play-link {
  color: var(--muted);
  letter-spacing: 0.04em;
}

.site-footer .play-link:hover,
.site-footer .play-link[aria-current="page"] {
  color: var(--cyan);
}

form {
  display: grid;
  gap: 0.95rem;
  margin-top: 1rem;
}

label {
  display: block;
  font-weight: 650;
  margin-bottom: 0.35rem;
}

.req,
.opt {
  font-weight: 500;
  color: var(--violet);
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 11rem;
  resize: vertical;
}

.hint,
.field-error,
.count {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.hint,
.count {
  color: var(--muted);
}

.count {
  text-align: right;
}

.field-error:empty {
  display: none;
}

.field-error {
  color: var(--red);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--red);
}

.form-status,
.form-alert {
  margin: 0;
  min-height: 1.5rem;
}

.form-alert:empty,
.form-status:empty {
  min-height: 0;
}

.form-alert {
  color: var(--red);
}

.form-status {
  color: var(--green);
}

.privacy-note,
.alt {
  color: var(--muted);
  font-size: 0.92rem;
}

#not-delivered {
  display: none;
}

#not-delivered:target {
  display: block;
}

#not-delivered:target + #result-accepted {
  display: none;
}

.play-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 16.5rem;
  margin: 0.4rem 0 0.9rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.play-stage[data-claim="open"]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  pointer-events: none;
}

.play-stage canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  background: var(--bg);
}

.play-debug {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 4;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border-radius: 3px;
  font: 11px/1.35 ui-monospace, Cascadia Code, SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
  color: #e8f0ff;
  background: color-mix(in srgb, #05060a 74%, transparent);
  pointer-events: none;
  white-space: pre;
}

.play-debug[hidden] {
  display: none;
}

.play-overlay {
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  text-align: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}

.play-overlay:not([hidden]) {
  display: flex;
}

.play-overlay-lost {
  justify-content: flex-start;
  padding-top: 2.35rem;
  background: transparent;
  pointer-events: none;
}

.play-overlay-lost .play-claim,
.play-overlay-lost .play-claim * {
  pointer-events: auto;
  touch-action: manipulation;
}

.play-overlay-lost .play-claim {
  margin-top: auto;
  margin-bottom: 1.1rem;
}

.play-restart-hint {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.play-overlay-lost .play-share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  width: min(100%, 22rem);
  margin-top: auto;
  pointer-events: none;
}

.play-overlay-lost .play-share,
.play-overlay-lost .play-share:hover,
.play-overlay-lost .play-share:focus,
.play-overlay-lost .play-share:active {
  pointer-events: auto;
  margin-top: 0;
  min-height: 2.4rem;
  padding: 0.4rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--cyan);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 650;
  box-shadow: none;
}

.play-overlay-lost .play-share[hidden] {
  display: none;
}

.play-overlay p {
  margin: 0;
  max-width: 100%;
  letter-spacing: 0.04em;
}

.play-count {
  color: var(--cyan);
  font-size: 4.5rem;
  line-height: 1;
  letter-spacing: 0;
}

.play-overlay p:empty {
  display: none;
}

[data-copy="touch"] {
  display: none;
}

@media (pointer: coarse) {
  [data-copy="keyboard"] {
    display: none;
  }

  [data-copy="touch"] {
    display: inline;
  }
}

html.is-touch [data-copy="keyboard"] {
  display: none;
}

html.is-touch [data-copy="touch"] {
  display: inline;
}

.play-block {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
}

@media (min-width: 721px) {
  html.play-page.is-playing,
  html.play-page.is-playing body {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .play-block > .play-claim:not([hidden]) {
    position: absolute;
    left: 50%;
    top: 3.4rem;
    transform: translateX(-50%);
    z-index: 6;
  }

  .play-page .play-stage,
  .play-page.is-playing .play-stage,
  .play-page .play-stage[data-mode="running"],
  .play-page .play-stage[data-mode="paused"],
  .play-page .play-stage[data-mode="lost"] {
    width: 100%;
    height: auto;
    aspect-ratio: 480 / 329;
    min-height: 0;
    max-height: none;
    align-items: stretch;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--cyan) 16%, transparent);
  }

  .play-page .play-keys {
    order: 2;
  }

  .play-page .play-world {
    order: 3;
  }

  .play-page .play-stage canvas {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
  }
}

.play-soundbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  margin: 0 0 0.35rem;
}

.play-mute {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  min-width: 2.15rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--cyan);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.play-mute:hover,
.play-mute:focus,
.play-mute:active {
  background: var(--panel);
  color: var(--cyan);
}

.play-mute:active {
  border-color: var(--cyan);
}

.play-mute:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-color: var(--cyan);
  background: var(--panel);
  color: var(--cyan);
}

@media (hover: hover) and (pointer: fine) {
  .play-mute:hover {
    border-color: var(--cyan);
  }
}

.play-mute[data-muted="true"],
.play-mute[data-muted="true"]:hover,
.play-mute[data-muted="true"]:focus,
.play-mute[data-muted="true"]:active {
  background: var(--panel);
  color: var(--muted);
}

.play-mute .play-mute-off {
  display: none;
}

.play-mute[data-muted="true"] .play-mute-on {
  display: none;
}

.play-mute[data-muted="true"] .play-mute-off {
  display: block;
}

.play-hud {
  display: none;
  margin: 0 0 0.55rem;
  text-align: center;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

html.play-page .terminal {
  overflow: visible;
}

html.play-page.is-playing.is-scores-open,
html.play-page.is-playing.is-scores-open body {
  overflow: auto;
}

.play-world {
  position: relative;
  margin: 0 0 0.9rem;
  z-index: 3;
}

.play-run-line {
  margin: 0 0 0.45rem;
  color: var(--cyan);
  font-weight: 650;
  letter-spacing: 0.06em;
}

.play-scores-link {
  appearance: none;
  display: inline-flex;
  min-height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.play-scores-link:hover,
.play-scores-link[aria-expanded="true"] {
  color: var(--cyan);
  background: transparent;
}

.play-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.play-challenge {
  margin: 0 0 0.45rem;
  color: var(--cyan);
  font-weight: 650;
  letter-spacing: 0.04em;
}

.play-share-note {
  flex: 1 1 100%;
  margin: 0;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.play-scores-link[hidden],
.play-challenge[hidden],
.play-share-note[hidden],
.play-share-sheet[hidden] {
  display: none;
}

.play-share-sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  text-align: center;
}

.play-share-sheet p {
  margin: 0;
  max-width: 28rem;
}

.play-share-sheet-hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.play-share-sheet img {
  width: min(100%, 40rem);
  height: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  -webkit-touch-callout: default;
}

.play-kit {
  margin: 0.45rem 0 0;
  padding: 0.55rem 0.65rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.play-kit button,
.run-earn button {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-weight: 650;
}

.play-kit button:hover,
.play-kit button:focus,
.run-earn button:hover,
.run-earn button:focus {
  background: transparent;
  color: inherit;
}

.kit-top,
.run-earn-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
}

.kit-dust {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: var(--violet);
  font-weight: 700;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.kit-dust small,
.kit-best,
.run-earn .lbl {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kit-best b {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.kit-dust .sd,
.run-earn .sd {
  width: 0.85em;
  height: 0.85em;
  fill: currentColor;
  flex: 0 0 auto;
}

.kit-tabs {
  display: flex;
  gap: 0.1rem;
  margin: 0.35rem 0 0.45rem;
  border-bottom: 1px solid var(--line);
}

.kit-tab {
  flex: 1 1 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.28rem 0.02rem 0.32rem;
}

.kit-tab[aria-selected="true"],
.kit-tab[aria-selected="true"]:hover,
.kit-tab[aria-selected="true"]:focus {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  background: transparent;
}

.kit-tab .dot {
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-left: 0.18rem;
  border-radius: 50%;
  background: var(--cyan);
  vertical-align: 0.08rem;
}

.kit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
}

.kit-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.02rem;
  width: 100%;
  padding: 0.35rem 0.2rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

.kit-tile canvas {
  width: 100%;
  height: 52px;
  display: block;
  pointer-events: none;
}

.kit-tile .nm {
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.2;
}

.kit-tile .st {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
}

.kit-tile.is-equipped {
  border-color: var(--cyan);
  box-shadow: inset 0 0 0 1px var(--cyan);
}

.kit-tile.is-equipped .st {
  color: var(--cyan);
}

.kit-tile.is-afford .st,
.kit-buy .need {
  color: var(--violet);
}

.kit-tile.is-preview {
  border-color: var(--violet);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--violet) 55%, transparent);
}

.kit-tile.is-locked,
.kit-tile.is-reach,
.kit-tile.is-secret {
  color: var(--muted);
}

.kit-tile.is-locked canvas,
.kit-tile.is-reach canvas,
.kit-tile.is-secret canvas {
  opacity: 0.72;
}

.kit-tile:disabled {
  opacity: 1;
  cursor: default;
}

.kit-lock {
  position: absolute;
  top: 0.28rem;
  right: 0.28rem;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.3;
}

.kit-lock rect {
  fill: var(--bg);
}

.kit-buy {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.45rem;
  border: 1px solid color-mix(in srgb, var(--violet) 45%, var(--line));
  border-radius: 4px;
  background: color-mix(in srgb, var(--violet) 8%, var(--bg));
  padding: 0.4rem 0.55rem;
}

.kit-buy .d {
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
}

.kit-buy .d b {
  color: var(--text);
  font-size: 0.76rem;
}

.kit-buy .need {
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.kit-buy-go {
  min-height: 1.8rem;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--violet);
  border-radius: 4px;
  background: transparent;
  color: var(--violet);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.play-kit .kit-buy-go:hover,
.play-kit .kit-buy-go:focus {
  background: var(--violet);
  color: var(--bg);
}

.kit-buy-go:disabled {
  border-color: var(--line);
  color: var(--muted);
  opacity: 0.7;
}

.kit-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
  margin: 0.55rem 0 0.1rem;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kit-foot .muted {
  flex: 1 1 auto;
  text-align: center;
}

.kit-spacer {
  visibility: hidden;
}

.play-kit .kit-link,
.play-kit .kit-link:hover,
.play-kit .kit-link:focus {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.kit-mission {
  margin-top: 0.55rem;
}

.kit-mission-head,
.kit-meta,
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.kit-label,
.kit-reward,
.kit-meta,
.kit-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kit-reward,
.kit-mission .what {
  color: var(--text);
  font-size: 0.74rem;
  letter-spacing: 0;
  text-transform: none;
}

.kit-reward {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  color: var(--violet);
  font-weight: 700;
}

.kit-mission .kit-bar {
  margin: 0.28rem 0;
}

.kit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.55rem;
}

.kit-row .tt {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.kit-row .tx,
.kit-sheet .tx,
.run-earn .tx {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.kit-switch {
  position: relative;
  width: 2.4rem;
  height: 1.35rem;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}

.kit-switch::after {
  content: "";
  position: absolute;
  top: 0.14rem;
  left: 0.14rem;
  width: 0.92rem;
  height: 0.92rem;
  border-radius: 50%;
  background: var(--muted);
}

.kit-switch[aria-checked="true"] {
  border-color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 22%, var(--bg));
}

.kit-switch[aria-checked="true"]::after {
  left: 1.22rem;
  background: var(--cyan);
}

.kit-sheet {
  margin-top: 0.45rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.stat {
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
}

.stat b {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.stat span {
  color: var(--muted);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.kit-code {
  display: block;
  width: 100%;
  min-height: 4.2rem;
  margin: 0.35rem 0;
  padding: 0.4rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.68rem;
  line-height: 1.35;
  resize: vertical;
}

.cp-note,
.run-lines {
  margin: 0.45rem 0 0;
  color: var(--text);
  font-size: 0.78rem;
}

.cp-note {
  font-weight: 700;
}

.run-earn {
  margin: 0.45rem 0 0;
  padding: 0.6rem 0.7rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.run-earn .big {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  margin-top: 0.12rem;
  color: var(--violet);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.run-earn-total {
  text-align: right;
}

.run-earn-total .kit-dust {
  justify-content: flex-end;
  margin-top: 0.15rem;
  font-size: 1rem;
}

.run-ready {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 0.55rem;
  color: var(--text);
  font-size: 0.78rem;
}

.run-earn .run-kit-link,
.run-earn .run-kit-link:hover,
.run-earn .run-kit-link:focus {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.run-next {
  margin-top: 0.55rem;
}

.run-next .nx {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
  color: var(--text);
  font-size: 0.78rem;
}

.run-next .nx span {
  color: var(--muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.run-next .nxr {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.28rem;
}

.run-next canvas {
  width: 46px;
  height: 28px;
  flex: 0 0 auto;
  display: block;
}

.kit-bar {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}

.kit-bar i {
  display: block;
  height: 100%;
  background: var(--violet);
}

.play-scoreboard {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 4;
  margin-top: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  padding: 0.75rem 0.85rem 0.85rem;
  overflow: auto;
  max-height: min(22rem, 42dvh);
}

.play-scoreboard h2 {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.play-scoreboard [data-play-board-status] {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.play-scoreboard [data-play-board-status]:empty {
  display: none;
}

.play-score-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.play-score-table th,
.play-score-table td {
  padding: 0.28rem 0.35rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.play-score-table th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.play-score-table th:first-child,
.play-score-table td:first-child {
  width: 3.2rem;
  color: var(--muted);
}

.play-score-table th:last-child,
.play-score-table td:last-child {
  text-align: right;
}

.play-score-table tbody tr:last-child td {
  border-bottom: 0;
}

.play-score-table tr.is-current td {
  color: var(--cyan);
}

.play-score-table tr.is-current td:first-child {
  color: var(--cyan);
}

.play-stage[data-mode="running"] ~ .play-world,
.play-stage[data-mode="paused"] ~ .play-world {
  visibility: hidden;
  pointer-events: none;
}

.play-claim {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: min(18.5rem, calc(100% - 1.2rem));
  padding: 0.65rem 0.75rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--bg) 70%, transparent);
}

.play-claim:not([hidden]) {
  display: flex;
}

.play-claim [hidden] {
  display: none !important;
}

.play-claim p {
  margin: 0;
}

.play-claim [data-play-claim-title] {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--cyan);
  font-size: 0.95rem;
  line-height: 1.3;
}

.play-claim fieldset.play-initials,
.play-initials {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-width: 0;
  min-width: 0;
  min-inline-size: 0;
  text-align: center;
}

.play-initials legend {
  display: table;
  float: none;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0 auto 0.15rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.play-initials-board {
  position: relative;
  display: flex;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
}

.play-initials-boxes {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  gap: 8px;
  justify-content: center;
  justify-items: center;
  margin-inline: auto;
  pointer-events: none;
}

.play-initials-boxes span,
.play-page .play-initials-boxes span {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  min-width: 48px;
  max-width: 48px;
  min-height: 48px;
  max-height: 48px;
  padding: 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--cyan);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.play-page .play-initials-board input[data-play-initials],
.play-initials-board input[data-play-initials] {
  position: absolute;
  inset: 0;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: none;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0.02;
  color: transparent;
  caret-color: transparent;
  background: transparent;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 48px;
}

.play-initials-boxes span.is-current {
  border-color: var(--cyan);
}

.play-claim-actions {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
  align-items: stretch;
}

.play-claim-actions button {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  height: 2.5rem;
  min-height: 2.5rem;
  padding: 0 0.7rem;
  font-size: 0.92rem;
  box-sizing: border-box;
}

.play-claim [data-play-skip] {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
}

.play-claim [data-play-skip]:hover {
  background: var(--line);
  color: var(--text);
}

.play-claim [data-play-claim-status] {
  margin: 0;
  min-height: 0;
}

.play-claim [data-play-claim-status]:empty {
  display: none;
}

.play-claim [data-play-claim-status][data-state="saved"] {
  color: var(--green);
}

.play-claim [data-play-claim-status][data-state="error"] {
  color: var(--red);
}

.play-overlay [data-play-summary] {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0.9rem;
  row-gap: 0.2rem;
}

.play-overlay [data-play-summary]:empty {
  display: none;
}

.play-overlay [data-play-summary] span {
  white-space: nowrap;
}

.play-overlay button {
  min-width: 8.5rem;
}

.play-score-name {
  white-space: nowrap;
}

.play-trophy {
  display: inline-flex;
  width: 12px;
  height: 12px;
  margin-right: 0.35rem;
  vertical-align: -1px;
}

.play-trophy-gold {
  color: #d4a017;
}

.play-trophy-silver {
  color: #c5ccd6;
}

.play-trophy-bronze {
  color: #c36b2d;
}

.play-trophy-platinum {
  color: #f4f7fb;
}

.play-trophy-plasma {
  color: #e08cff;
}

.play-trophy-star {
  color: var(--cream);
}

.play-trophy-legend {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.play-trophy-legend[hidden] {
  display: none;
}

.play-initials:not([hidden]) {
  display: flex;
}

.play-keys {
  margin: 0 0 0.85rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.play-controls {
  display: none;
  margin: 0;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.play-deck-face {
  display: flex;
  align-items: flex-end;
  position: relative;
  width: 100%;
  min-height: 10.5rem;
  overflow: hidden;
}

.play-deck-face::before {
  content: "NOVA-1";
  position: absolute;
  left: 0;
  right: 0;
  top: 22%;
  text-align: center;
  color: var(--line);
  letter-spacing: 0.42em;
  font-size: 0.72rem;
  pointer-events: none;
}

.play-round,
.play-round:hover,
.play-round:focus,
.play-round:active {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 1 1 50%;
  align-self: stretch;
  min-height: 8.75rem;
  margin: 0;
  padding: 0 0 0.85rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cream);
  box-shadow: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.play-round-face {
  width: min(42vw, 11rem);
  height: min(42vw, 11rem);
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: radial-gradient(circle at 50% 40%, var(--panel), var(--wheel) 74%);
  color: var(--cream);
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1;
  pointer-events: none;
}

.play-round[data-play-jump] .play-round-face {
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 55%, transparent);
}

.play-round[data-play-duck] .play-round-face {
  color: var(--orange);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange) 55%, transparent);
}

.play-round.is-held .play-round-face {
  background: var(--cyan);
  color: var(--bg);
  border-color: var(--cream);
  box-shadow: none;
}

.play-round[data-play-duck].is-held .play-round-face {
  background: var(--orange);
  color: var(--bg);
}

.play-deck-pills {
  display: flex;
  width: 100%;
}

.play-pill,
.play-pill:hover,
.play-pill:focus,
.play-pill:active {
  flex: 1 1 50%;
  min-height: 3.4rem;
  margin: 0;
  padding: 0.15rem 0 0.7rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  outline: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.play-pill:focus,
.play-pill:focus-visible {
  outline: none;
}

.play-pill-face {
  min-width: 5.6rem;
  padding: 0.38rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  pointer-events: none;
}

.play-pill:hover .play-pill-face,
.play-pill:focus .play-pill-face {
  border-color: var(--line);
  background: var(--panel);
  color: var(--muted);
}

.play-pill:active .play-pill-face {
  border-color: var(--cyan);
}

.play-pill.is-held .play-pill-face {
  border-color: var(--cyan);
  color: var(--cream);
  background: color-mix(in srgb, var(--cyan) 28%, var(--panel));
}

.play-pill:focus-visible .play-pill-face,
.play-round:focus-visible .play-round-face {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.play-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

ul {
  margin: 0 0 0.9rem;
  padding-left: 1.2rem;
}

@media (max-width: 720px), (pointer: coarse) {
  html.play-page,
  html.play-page body {
    height: 100dvh;
    min-height: 100dvh;
    overflow: auto;
  }

  html.play-page.is-playing,
  html.play-page.is-playing body {
    height: 100dvh;
    overflow: hidden;
  }

  html.play-page body,
  html.play-page .wrap,
  html.play-page .terminal,
  html.play-page .terminal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  html.play-page .wrap,
  html.play-page .terminal,
  html.play-page .terminal-body {
    flex: 1 1 auto;
  }

  html.play-page .terminal {
    margin: 0;
    border: 0;
    background: transparent;
  }

  .play-page .wrap {
    width: 100%;
    justify-content: flex-start;
  }

  .play-page .site-header,
  .play-page .site-footer,
  .play-page .prompt,
  .play-page .kicker,
  .play-page h1,
  .play-page .chrome,
  .play-page .play-lede,
  .play-page #play-help {
    display: none;
  }

  .play-page .terminal-body {
    padding: 0;
    justify-content: flex-start;
  }

  .play-page .play-block {
    flex: 1 1 auto;
    min-height: 0;
    justify-content: flex-start;
    background: var(--wheel);
  }

  .play-page .play-hud {
    display: none;
  }

  .play-page .play-soundbar,
  .play-page .play-keys {
    display: none;
  }

  .play-page .play-stage {
    flex: 0 0 auto;
    align-items: stretch;
    width: 100%;
    margin: 0;
    border-left: 0;
    border-right: 0;
    border-top: 2px solid var(--line);
    border-bottom: 2px solid var(--line);
    border-radius: 0;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 22%, transparent);
    background: var(--bg);
    height: auto;
    aspect-ratio: 480 / 329;
    min-height: 0;
    max-height: calc(100dvh - 15rem - var(--play-keyboard, 0px));
  }

  .play-page .play-stage canvas {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
  }

  .play-page .play-world {
    display: block;
    flex: 0 0 auto;
    margin: 0.45rem 0 0;
    padding: 0 0.85rem;
  }

  .play-page .play-controls {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 0;
    width: 100%;
    background: var(--wheel);
  }

  .play-page .play-deck-face {
    flex: 1 1 auto;
  }

  .play-page .play-stage[data-mode="running"] ~ .play-world,
  .play-page .play-stage[data-mode="paused"] ~ .play-world {
    display: none;
  }

  html.play-page[data-play-mode="lost"] .play-controls,
  .play-page .play-stage[data-mode="lost"] ~ .play-controls {
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  html.play-page[data-play-mode="lost"] .play-controls .play-deck-face,
  .play-page .play-stage[data-mode="lost"] ~ .play-controls .play-deck-face,
  html.play-page[data-play-mode="lost"] .play-hud,
  .play-page .play-stage[data-mode="lost"] ~ .play-hud {
    display: none;
  }

  .play-page .kit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .play-page .kit-tab {
    font-size: 0.54rem;
    letter-spacing: 0.01em;
  }

  .play-page .play-scoreboard {
    position: relative;
    max-height: min(22rem, 48dvh);
    padding: 0.6rem 0.7rem 0.7rem;
  }

  html.play-page[data-play-mode="lost"] .play-scoreboard,
  .play-page .play-stage[data-mode="lost"] ~ .play-world .play-scoreboard {
    max-height: none;
  }

  .play-page .play-stage[data-mode="ready"],
  .play-page .play-stage[data-mode="paused"],
  .play-page .play-stage[data-mode="lost"] {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    aspect-ratio: 480 / 329;
    min-height: 0;
    max-height: calc(100dvh - 15rem - var(--play-keyboard, 0px));
  }

  html.play-page.is-scores-open .terminal,
  html.play-page.is-scores-open .terminal-body {
    overflow: auto;
    justify-content: flex-start;
  }

  .play-page .play-claim:not([hidden]) {
    position: relative;
    width: min(20rem, 100%);
    margin: 0.15rem auto 0.35rem;
    z-index: 4;
    padding: 0.6rem 0.7rem;
  }

  .play-page .play-initials-boxes {
    grid-template-columns: repeat(3, 48px);
  }

  .play-page .play-initials-boxes span {
    width: 48px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    min-height: 48px;
    max-height: 48px;
    font-size: 20px;
  }

  .play-page .play-initials-board input[data-play-initials] {
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    max-height: none;
  }

  .play-page .play-claim-actions button {
    height: 2.6rem;
    min-height: 2.6rem;
  }

  .play-page .play-score-table th,
  .play-page .play-score-table td {
    padding: 0.22rem 0.28rem;
    font-size: 0.9rem;
  }

  .play-page.is-playing .play-stage {
    height: auto;
    aspect-ratio: 480 / 329;
    min-height: 0;
    max-height: calc(100dvh - 15rem - var(--play-keyboard, 0px));
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 1.45rem;
  }

  .terminal-body {
    padding: 1rem 0.85rem 1.15rem;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .play-page .site-header,
  .play-page .site-footer {
    padding: 0.35rem 0;
  }

  .play-page .kicker,
  .play-page #play-help {
    display: none;
  }

  .play-page h1 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
  }

  .play-page .play-lede {
    display: none;
  }

  .play-page .play-stage {
    flex: 1 1 auto;
    aspect-ratio: auto;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .play-page .play-controls {
    flex: 0 0 auto;
  }

  .play-deck-face,
  .play-round,
  .play-round:hover,
  .play-round:focus,
  .play-round:active {
    min-height: 3.4rem;
  }

  .play-round-face {
    width: 3.15rem;
    height: 3.15rem;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
  }

  .play-pill,
  .play-pill:hover,
  .play-pill:focus,
  .play-pill:active {
    min-height: 2.6rem;
    padding-bottom: 0.35rem;
  }
}

@media (max-width: 720px), (pointer: coarse) {
  html.play-page.is-kit-open {
    height: 100dvh;
    overflow: hidden;
  }

  html.play-page.is-kit-open body {
    display: block;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: auto;
  }

  html.play-page.is-kit-open .wrap,
  html.play-page.is-kit-open .terminal,
  html.play-page.is-kit-open .terminal-body,
  html.play-page.is-kit-open .play-block {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  html.play-page.is-kit-open .play-controls {
    display: none;
  }

  html.play-page.is-kit-open .play-world {
    padding-bottom: 1rem;
  }

  html.play-page.is-kit-open .play-stage,
  html.play-page.is-kit-open .play-stage[data-mode="ready"],
  html.play-page.is-kit-open .play-stage[data-mode="paused"],
  html.play-page.is-kit-open .play-stage[data-mode="lost"] {
    flex: 0 0 auto;
    width: min(100%, calc(42dvh * 480 / 329));
    max-width: 100%;
    height: auto;
    margin-inline: auto;
    aspect-ratio: 480 / 329;
    max-height: 42dvh;
    min-height: 0;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .play-page .kit-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  html.play-page.is-kit-open .play-stage,
  html.play-page.is-kit-open .play-stage[data-mode="ready"],
  html.play-page.is-kit-open .play-stage[data-mode="paused"],
  html.play-page.is-kit-open .play-stage[data-mode="lost"] {
    width: 100%;
    max-width: none;
    height: 7.5rem;
    aspect-ratio: auto;
    margin-inline: 0;
  }
}

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

.ask-dock {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(22rem, calc(100% - 2rem));
  gap: 0.5rem;
}

body:has(.ask-dock) {
  padding-bottom: 5.5rem;
}

.ask-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0.85rem 0.9rem 1rem;
}

.ask-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.ask-bar h2,
[data-ask-mode="page"] h1 {
  margin-bottom: 0.35rem;
}

.ask-close {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.ask-close:hover,
.ask-close:focus-visible {
  background: var(--bg);
  color: var(--cyan);
}

.ask-log {
  max-height: min(16rem, 40vh);
  overflow: auto;
  margin: 0.6rem 0;
  padding: 0.15rem 0.1rem;
  display: grid;
  gap: 0.55rem;
}

.ask-log p {
  margin: 0;
  overflow-wrap: anywhere;
}

.ask-who {
  display: block;
  color: var(--violet);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

[data-ask] textarea {
  min-height: 5.5rem;
}

[data-ask-turnstile] {
  min-height: 0;
}

[data-ask-turnstile]:not([hidden]) {
  min-height: 65px;
}

