:root {
  color-scheme: dark;
  --bg: #111318;
  --panel: #1b1e25;
  --ink: #f7f5ef;
  --muted: #aeb3be;
  --orange: #ffab32;
  --line: #363a43;
  --green: #a4f5b0;
  --violet: #ad96fa;
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
header,
footer,
main {
  width: min(1120px, calc(100% - 64px));
  margin-inline: auto;
}
header,
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header {
  height: 80px;
  border-bottom: 1px solid var(--line);
}
header img {
  width: 142px;
  display: block;
  filter: grayscale(1) brightness(0) invert(1);
}
header span,
.kicker,
.stat,
.chip,
.mono,
.meta,
footer {
  font:
    600 12px/1.5 ui-monospace,
    Consolas,
    monospace;
  letter-spacing: 0.07em;
}
header span,
.meta,
.kicker,
footer,
.muted {
  color: var(--muted);
}
main {
  flex: 1;
  padding: clamp(28px, 5vw, 68px) 0;
}
footer {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: 'Nunito Sans', 'Arial Black', 'Segoe UI', sans-serif;
  line-height: 1.04;
  letter-spacing: -0.045em;
}
h1 {
  font-size: clamp(48px, 7vw, 100px);
  font-weight: 900;
}
h2 {
  font-size: clamp(32px, 5vw, 62px);
}
h3 {
  font-size: 23px;
}
p {
  line-height: 1.55;
}
.hero {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--panel);
}
.intro {
  padding: clamp(24px, 4vw, 54px);
  align-self: center;
}
.intro h1 em {
  display: block;
  color: var(--orange);
  font-style: normal;
}
.intro p {
  max-width: 37ch;
  margin: 18px 0 24px;
  color: #c3c6ce;
}
.kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}
.kicker:before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--orange);
  border-radius: 2px;
}
.visual {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  min-height: 280px;
  background-color: #20232b;
  background-image:
    linear-gradient(#ffffff09 1px, transparent 1px), linear-gradient(90deg, #ffffff09 1px, transparent 1px);
  background-size: 27px 27px;
  display: grid;
  place-items: center;
}
.visual:before,
.visual:after {
  content: '';
  position: absolute;
  width: 72%;
  aspect-ratio: 1;
  border: 1px solid #ffffff24;
  border-radius: 50%;
  z-index: -1;
}
.visual:after {
  width: 51%;
  border-style: dashed;
}
.pixel {
  width: 51%;
  max-width: 265px;
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  aspect-ratio: 1;
  transform: rotate(-9deg);
  filter: drop-shadow(7px 10px 0 #111318);
}
.pixel i.on {
  background: var(--orange);
  border: 1px solid #f59a24;
}
.visual small {
  position: absolute;
  bottom: 16px;
  right: 17px;
  font: 11px monospace;
  color: #c1b29d;
}
.cta,
button,
input,
select {
  font: inherit;
}
button,
.cta {
  cursor: pointer;
  touch-action: manipulation;
}
.cta,
button.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-height: 48px;
  padding: 12px 21px;
  border: 0;
  border-radius: 9px;
  color: #201a13;
  background: var(--orange);
  font-weight: 750;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #9edbff;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
.alt {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 15px;
  min-height: 44px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.overview {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 22px;
  margin-top: 24px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(20px, 3vw, 34px);
}
.card h3 {
  margin-bottom: 16px;
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.row span:last-child {
  margin-left: auto;
}
.tag {
  color: var(--orange);
  font:
    600 13px ui-monospace,
    monospace;
}
.sub {
  color: var(--muted);
  font-size: 14px;
}
.stage,
.form {
  max-width: 680px;
  margin: auto;
}
.stage > *,
.form > * {
  margin-bottom: 17px;
}
.stage article {
  margin-top: 24px;
}
.stage .card > * + *,
.form .card > * + * {
  margin-top: 16px;
}
.progress {
  display: flex;
  gap: 5px;
  margin: 12px 0;
}
.progress i {
  height: 4px;
  border-radius: 3px;
  flex: 1;
  background: var(--line);
}
.progress .lit {
  background: var(--orange);
}
label {
  display: block;
}
.field {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #535863;
  background: #13161c;
  color: var(--ink);
  border-radius: 8px;
  padding: 12px;
  font-size: 16px;
}
.notice {
  color: #ffcb83;
  line-height: 1.4;
}
.gamebar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font:
    600 14px/1.5 ui-monospace,
    monospace;
}
.arena {
  margin: 15px 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.arena button {
  border: 1px solid #515563;
  background: #292d36;
  color: var(--ink);
  border-radius: 8px;
  font-weight: 750;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.arena button:disabled {
  opacity: 0.35;
}
.grid {
  display: grid;
  gap: 6px;
}
.grid button {
  min-height: clamp(45px, 8vh, 64px);
  font-size: 19px;
}
.g3 {
  grid-template-columns: repeat(3, 1fr);
}
.g4 {
  grid-template-columns: repeat(4, 1fr);
}
.g5 {
  grid-template-columns: repeat(5, 1fr);
}
.arena .pad {
  width: 100%;
  height: clamp(170px, 32vh, 290px);
  font-size: 30px;
}
.arena .go,
.arena button.hit {
  color: #102018;
  background: var(--green);
}
.arena .warn {
  background: #ffcb48;
  color: #302410;
}
.arena .target {
  background: var(--violet);
  color: #251645;
}
.arena .bomb {
  background: #f6978e;
  color: #321b1c;
}
.arena .legal {
  background: #544873;
  color: #fff;
  border-color: #aaa0c8;
}
.arena .used {
  color: var(--orange);
  opacity: 0.65;
}
.arena .readout {
  font:
    700 clamp(24px, 5vw, 42px) / 1.2 ui-monospace,
    monospace;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}
.arena .hint {
  margin: 12px 0;
  color: var(--muted);
}
.track {
  height: 24px;
  background: linear-gradient(to right, #353944 58%, #7baa79 58% 82%, #353944 82%);
  margin: 18px 0;
  position: relative;
  border-radius: 5px;
}
.track i {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 4px;
  background: white;
}
.chip {
  display: inline-block;
  padding: 6px 9px;
  border: 1px solid #65616c;
  border-radius: 5px;
  margin: 0 6px 5px 0;
}
.chip.ok {
  background: #2c4735;
  color: var(--green);
}
.score {
  font-size: clamp(52px, 10vw, 100px);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 1;
  color: var(--orange);
}
.secret {
  display: inline-block;
  overflow-wrap: anywhere;
  letter-spacing: 0.09em;
  font:
    700 20px/1.5 ui-monospace,
    monospace;
}
.board {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
}
.qr {
  width: min(100%, 270px);
  background: white;
  border-radius: 8px;
  margin: 18px 0;
}
.board h2 {
  margin-bottom: 24px;
}
.board .row {
  font-size: clamp(18px, 2.1vw, 30px);
}
.empty {
  color: var(--muted);
  padding: 16px 0;
}
.sr {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
@media (max-width: 720px) {
  header,
  footer,
  main {
    width: calc(100% - 32px);
  }
  header {
    height: 58px;
  }
  header img {
    width: 110px;
  }
  header span {
    font-size: 10px;
  }
  .hero,
  .overview,
  .board {
    grid-template-columns: 1fr;
  }
  .visual {
    grid-row: 1;
    min-height: 128px;
    height: 19vh;
    max-height: 172px;
  }
  .pixel {
    height: 88%;
    width: auto;
  }
  .visual:before {
    width: 60%;
  }
  .visual:after {
    width: 42%;
  }
  .intro {
    padding: 22px;
  }
  .intro h1 em {
    display: inline;
  }
  .intro p {
    margin: 12px 0 18px;
  }
  .intro h1 {
    font-size: clamp(43px, 10.8vw, 60px);
  }
  .overview {
    gap: 12px;
    margin-top: 12px;
  }
  main {
    padding: 18px 0 32px;
  }
  .stage h2 {
    font-size: 36px;
  }
  .grid {
    gap: 5px;
  }
  .grid button {
    font-size: 17px;
  }
  .board .card {
    padding: 22px;
  }
}

.hero > *,
.overview > *,
.board > *,
.row > strong {
  min-width: 0;
}
.row > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row > .mono,
.row > .tag {
  flex-shrink: 0;
}
.arena .g5 .protocol-cell:disabled {
  opacity: 1;
  color: #c1c3ca;
  background: #252831;
  border-color: #393d47;
}
.arena .g5 .protocol-cell.used:disabled {
  color: var(--orange);
  background: #33302c;
}
@media (min-width: 721px) {
  main:has(.board) {
    padding: clamp(16px, 2.4vh, 30px) 0;
  }
  .board .card {
    padding: clamp(18px, 2.5vh, 30px);
  }
  .board .row {
    padding: clamp(4px, 0.75vh, 10px) 0;
    font-size: clamp(18px, 2.5vh, 27px);
  }
}
