:root {
  color-scheme: dark;
  font-family: Arial, sans-serif;
  --ink: #ecf3ef;
  --muted: #a5b7c7;
  --line: #354658;
  --accent: #ffc28a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #101b2a;
  color: var(--ink);
}
button,
select,
input {
  font: inherit;
}
button,
select {
  background: #223347;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 9px;
  font-size: 11px;
}
button {
  cursor: pointer;
  white-space: nowrap;
}
button:hover {
  background: #374b61;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
:focus-visible {
  outline: 2px solid #97f0d7;
  outline-offset: 3px;
}
.shell {
  max-width: 1160px;
  height: 100vh;
  height: 100dvh;
  margin: auto;
  padding: 6px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  flex: 0 0 29px;
}
a {
  color: inherit;
  text-decoration: none;
}
.brand {
  color: #97f0d7;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 2px;
}
.brand small {
  margin-left: 15px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 1px;
}
.intro {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  flex: 0 0 44px;
  gap: 8px;
}
h1 {
  margin: 0;
  font-size: clamp(23px, 3vw, 34px);
  letter-spacing: -1.5px;
}
h1 span {
  color: var(--accent);
}
.eyebrow {
  font-size: 8px;
  letter-spacing: 0.7px;
  color: var(--accent);
  font-weight: bold;
  margin: 0 0 5px;
}
.subtitle {
  font-size: 10px;
  color: var(--muted);
  margin: 0;
}
.edition {
  font: 8px/1.7 monospace;
  color: var(--muted);
  text-align: right;
}
.edition strong {
  color: #97f0d7;
  font-weight: normal;
}
.game-panel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: #192b3c;
}
.scoreboard {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  flex: 0 0 49px;
  background: #182738;
}
.scoreboard > div {
  padding: 7px 14px;
  border-right: 1px solid var(--line);
}
.scoreboard span {
  display: block;
  color: var(--muted);
  font: 8px monospace;
  margin-bottom: 3px;
}
.scoreboard strong {
  font: bold 25px monospace;
  color: #97f0d7;
}
.scoreboard small {
  font-size: 11px;
  color: var(--muted);
}
.arena-stage {
  flex: 1 1 0;
  min-height: 0;
  container-type: size;
  display: grid;
  place-items: center;
  background: #172334;
}
.arena-wrap {
  width: min(100cqw, calc(100cqh * 4 / 3));
  height: min(100cqh, calc(100cqw * 3 / 4));
  position: relative;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}
.scene-top,
.scene-bottom {
  position: absolute;
  left: 2.5%;
  right: 2.5%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
  font: 9px monospace;
}
.scene-top {
  top: 3%;
  color: #f6debd;
}
.scene-bottom {
  bottom: 3%;
  color: #bff6e5;
}
.scene-bottom strong,
.scene-bottom span {
  background: #293b49;
  padding: 2px 4px;
}
.scene-bottom span {
  color: #dacbbc;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  flex: 0 0 auto;
}
.toolbar label {
  flex: 1;
  min-width: 0;
  font: 8px monospace;
  color: var(--muted);
}
output {
  color: var(--accent);
  float: right;
  font-size: 11px;
}
input[type='range'] {
  display: block;
  width: 100%;
  margin: 6px 0 0;
  accent-color: #f6b782;
  cursor: pointer;
}
select {
  display: block;
  width: 100%;
  margin-top: 4px;
}
.primary {
  color: #182738;
  background: #97f0d7;
  font-weight: bold;
  min-width: 104px;
}
.primary:hover {
  background: #c6ffe9;
}
#guidance {
  flex: 0 0 auto;
  min-height: 30px;
  margin: 0;
  border-top: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 7px 12px;
  background: #182738;
  color: #ffe0bc;
  font-size: 11px;
  font-style: italic;
  line-height: 1.4;
}
kbd {
  font: 8px monospace;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px;
}
footer {
  display: flex;
  justify-content: space-between;
  flex: 0 0 16px;
  font-size: 8px;
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.game-panel:fullscreen {
  border-radius: 0;
  width: 100vw;
  height: 100dvh;
}
@media (max-width: 900px), (max-height: 650px) {
  .shell {
    gap: 4px;
  }
  h1 {
    font-size: 25px;
  }
  .eyebrow {
    font-size: 7px;
    letter-spacing: 0;
  }
  .subtitle {
    font-size: 8px;
  }
  .edition {
    font-size: 7px;
  }
  .toolbar {
    gap: 7px;
    padding: 6px 9px;
  }
  .toolbar button {
    padding: 7px 6px;
    font-size: 10px;
  }
  .toolbar label {
    font-size: 7px;
  }
  .scene-top,
  .scene-bottom {
    font-size: 6px;
  }
  footer {
    font-size: 7px;
  }
}

/* A fixed two-row toolbar keeps every control available in fullscreen and small windows. */
.toolbar {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr 1fr;
}
.actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.actions #sound {
  margin-right: auto;
}
@media (max-width: 900px), (max-height: 650px) {
  .scoreboard > div {
    padding: 6px 9px;
  }
  .scoreboard strong {
    font-size: 22px;
  }
  .scoreboard span {
    font-size: 7px;
  }
}
:root {
  --accent: #f4da7d;
}
.arena-wrap {
  width: min(100cqw, calc(100cqh * 16 / 9));
  height: min(100cqh, calc(100cqw * 9 / 16));
}
.scoreboard strong {
  font-size: 22px;
}
#best {
  margin-right: auto;
  font: 9px monospace;
  color: var(--muted);
  align-self: center;
}
.actions #sound {
  margin-right: 0;
}
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #1026319c;
}
.overlay[hidden] {
  display: none;
}
.briefing {
  width: min(88%, 440px);
  padding: 22px 26px;
  border: 1px solid #668690;
  border-top: 3px solid var(--accent);
  background: #122934f2;
  box-shadow: 0 14px 35px #10202866;
}
.briefing h2 {
  margin: 8px 0 12px;
  font-size: clamp(18px, 2.2vw, 27px);
  letter-spacing: -1px;
}
.briefing > p:not(.eyebrow) {
  color: #c5d8dc;
  font-size: 12px;
  line-height: 1.6;
}
.briefing .hint {
  font: 8px/1.5 monospace !important;
  margin-bottom: 0;
}
.briefing .primary {
  margin-top: 5px;
  padding: 10px 15px;
}
.controls {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-size: 9px;
  color: var(--muted);
}
#guidance {
  min-height: 30px;
}
.scene-top {
  color: #142c3c;
}
.scene-bottom strong,
.scene-bottom span {
  background: #142c3c;
  color: #f5e7b0;
}
@media (max-width: 900px), (max-height: 650px) {
  .scoreboard strong {
    font-size: 19px;
  }
  .controls {
    font-size: 7px;
    padding: 6px 9px;
  }
  .briefing {
    padding: 10px 18px;
  }
  .briefing h2 {
    margin: 5px 0;
    font-size: 19px;
  }
  .briefing > p:not(.eyebrow) {
    font-size: 10px;
    margin: 6px 0;
  }
  .briefing .primary {
    padding: 7px 11px;
  }
  .briefing .hint {
    display: none;
  }
  #guidance {
    font-size: 10px;
  }
}
