@font-face {
  font-family: Space;
  src: url("/fonts/display.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: optional;
}
@font-face {
  font-family: Manrope;
  src: url("/fonts/body.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: optional;
}
:root {
  color-scheme: dark;
  --page: #0b2029;
  --arena: #102b36;
  --raised: #1c3944;
  --line: #365662;
  --text: #f6f1e8;
  --muted: #b9cbc9;
  --coral: #ff714f;
  --peach: #ff916f;
  --shield: #b6e5c8;
  --radius: 12px;
  --display: Space, Arial, sans-serif;
  --body: Manrope, Arial, sans-serif;
  background: var(--page);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  font-size-adjust: 0.52;
  line-height: 1.6;
  scrollbar-color: var(--line) var(--page);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button,
a,
summary {
  touch-action: manipulation;
}
button {
  font: inherit;
  cursor: pointer;
}
button,
a {
  transition:
    background-color 0.15s,
    color 0.15s,
    border-color 0.15s;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
button {
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
}
button:hover {
  background: #294b56;
}
button:active {
  background: #365662;
}
a:hover {
  color: var(--peach);
}
:focus-visible {
  outline: 3px solid var(--peach);
  outline-offset: 4px;
}
::selection {
  background: var(--coral);
  color: var(--page);
}
svg {
  width: 20px;
  height: 20px;
  flex: none;
  vertical-align: middle;
  stroke: currentColor;
}
p,
h1,
h2 {
  margin: 0;
}
p {
  color: var(--muted);
}
h1,
h2,
.wordmark,
.footer-brand {
  font-family: var(--display);
  font-size-adjust: 0.53;
  font-weight: 600;
}
h1,
h2 {
  text-wrap: balance;
  letter-spacing: -0.035em;
}
h1 {
  font-size: clamp(44px, 6.3vw, 76px);
  line-height: 1.02;
}
h2 {
  font-size: 26px;
  line-height: 1.2;
}
.masthead,
main,
footer {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}
.masthead {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 26px;
  line-height: 1;
  text-decoration: none;
}
.wordmark img {
  display: block;
  width: 44px;
  height: 44px;
}
.masthead nav {
  display: flex;
  gap: 16px;
  align-items: center;
}
.masthead nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 700;
}
.skip {
  position: fixed;
  z-index: 20;
  left: 16px;
  top: -90px;
  padding: 12px;
  background: var(--text);
  color: var(--page);
  border-radius: 8px;
}
.skip:focus {
  top: 12px;
}
.game-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--arena);
}
.game-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  min-height: 65px;
}
.mode-switch {
  display: flex;
  gap: 2px;
  background: var(--page);
  padding: 3px;
  border-radius: 9px;
}
.mode-switch button {
  min-width: 72px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
}
.mode-switch button[aria-pressed="true"] {
  background: var(--raised);
  color: var(--text);
}
.mode-switch button:hover {
  color: var(--text);
  background: var(--raised);
}
.arena-label {
  color: var(--muted);
  font-size: 13px;
}
.sound-button {
  margin-left: auto;
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  white-space: nowrap;
}
.sound-button[aria-pressed="true"] {
  color: var(--peach);
}
.arena {
  height: 480px;
  position: relative;
  isolation: isolate;
  touch-action: none;
  overflow: hidden;
}
.arena:focus-visible {
  outline-offset: -5px;
}
.arena canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.arena-intro {
  position: absolute;
  left: 6%;
  top: 16%;
  max-width: 70%;
  pointer-events: none;
}
.arena-intro p {
  margin-top: 20px;
  font-size: 19px;
  line-height: 1.45;
  color: var(--text);
}
.arena-intro button {
  pointer-events: auto;
  margin-top: 24px;
  min-width: 150px;
  justify-content: space-between;
}
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--coral);
  color: var(--page);
  border-color: var(--coral);
  font-size: 16px;
  min-height: 48px;
  padding: 12px 22px;
}
.primary:hover {
  background: #ff916f;
  border-color: #ff916f;
}
.primary:active {
  background: #f6f1e8;
  border-color: #f6f1e8;
}
.arena-hint {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}
/* 375/390px Chromium + WebKit: HUD bottom = arena top 194px; Pause bottom 185.5px.
   Rendered moon half-width/radius at canvas DPR 2: Chromium 103.5–104/104px,
   WebKit 104/103px. HUD occupies no canvas pixels; scenery retains proportions. */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 6px 16px;
  background: var(--page);
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.hud > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.hud-label {
  font-size: 12px;
  color: var(--muted);
}
.hud strong {
  font-family: var(--display);
  font-size: 23px;
  line-height: 1.2;
}
.pause-button {
  margin-left: auto;
  background: var(--raised);
}
.key-pair {
  white-space: nowrap;
}
.run-overlay,
.pause-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 24px;
  background: rgba(11, 32, 41, 0.96);
  gap: 14px;
}
.run-overlay h2,
.pause-overlay h2 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
}
.standard-result > span {
  color: var(--peach);
  font-size: 14px;
}
.run-overlay p {
  font-size: 14px;
}
.result-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.result-score strong {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  font-size: 60px;
  line-height: 1.2;
}
.result-score span {
  color: var(--muted);
  font-size: 14px;
}
.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.text-button {
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--muted);
}
.game-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  min-height: 70px;
}
.best {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
}
.best strong {
  color: var(--text);
  font-family: var(--display);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}
.best-scope {
  font-size: 12px;
}
.touch-controls {
  display: flex;
  gap: 8px;
}
.touch-controls button {
  width: 56px;
  padding: 8px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.left-arrow {
  transform: rotate(180deg);
}
.token-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.token-identity {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.token-identity strong {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.2;
  color: var(--peach);
}
#token-status {
  font-size: 13px;
  color: var(--muted);
}
#token-pending {
  margin-left: auto;
  font-size: 14px;
}
#mint {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  min-width: 0;
  flex: 1 1 320px;
  color: var(--text);
}
.token-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.token-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 60px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 14px;
}
.token-actions button {
  display: flex;
  gap: 8px;
  align-items: center;
}
.token-actions svg {
  width: 16px;
  height: 16px;
}
#token-buy {
  background: var(--coral);
  color: var(--page);
  border-color: var(--coral);
}
#token-buy:hover {
  background: var(--peach);
}
.field-notes {
  padding: 36px 0 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}
.field-notes h2 {
  font-size: 21px;
  margin-bottom: 16px;
}
.field-notes p {
  font-size: 14px;
  line-height: 1.8;
  max-width: 60ch;
}
.field-notes p + p {
  margin-top: 12px;
}
.field-notes svg {
  color: var(--shield);
  width: 18px;
  height: 18px;
}
kbd {
  font-family: inherit;
  font-size: 12px;
  border: 1px solid var(--line);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--text);
  white-space: nowrap;
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 20px 0 28px;
}
footer a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  color: var(--muted);
}
.footer-brand {
  text-decoration: none;
  font-size: 18px;
  color: var(--text);
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: var(--text);
  color: var(--page);
  border-radius: 8px;
  padding: 12px 18px;
  max-width: calc(100% - 32px);
  font-size: 14px;
  text-align: center;
}
.noscript {
  padding: 24px;
  color: var(--text);
  text-align: center;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.not-found {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}
.not-found h1 {
  font-size: clamp(40px, 8vw, 76px);
}
.not-found a {
  min-height: 44px;
  color: var(--peach);
}
@media (min-width: 1440px) {
  .masthead {
    height: 96px;
  }
  .arena {
    height: 520px;
  }
  .arena-intro {
    top: 17%;
  }
}
@media (max-width: 767px) {
  .masthead,
  main,
  footer {
    width: calc(100% - 32px);
  }
  .masthead {
    height: 68px;
  }
  .wordmark {
    font-size: 23px;
  }
  .masthead nav {
    gap: 12px;
  }
  .masthead nav a {
    font-size: 12px;
  }
  .game-toolbar {
    padding: 7px 8px;
    gap: 8px;
    min-height: 60px;
  }
  .mode-switch button {
    min-width: 62px;
    padding: 8px 12px;
  }
  .arena-label {
    font-size: 12px;
  }
  .sound-button {
    padding: 8px;
    font-size: 12px;
  }
  .arena {
    height: 380px;
  }
  .arena-intro {
    left: 22px;
    top: 60px;
    max-width: 74%;
  }
  .arena-intro h1 {
    font-size: clamp(42px, 8vw, 58px);
  }
  .arena-intro p {
    font-size: 16px;
    margin-top: 16px;
  }
  .arena-intro button {
    margin-top: 20px;
    min-width: 130px;
  }
  .arena-hint {
    font-size: 12px;
  }
  .game-bottom {
    padding: 8px 10px;
    min-height: 64px;
    gap: 8px;
  }
  .best {
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.2;
    max-width: 180px;
  }
  .best-scope {
    flex-basis: 100%;
  }
  .touch-controls button {
    width: 50px;
  }
  .token-info {
    gap: 8px 16px;
    padding: 18px 0;
  }
  .token-identity {
    gap: 12px;
  }
  .token-identity strong {
    font-size: 22px;
  }
  #token-pending {
    margin-left: 0;
    flex-basis: 100%;
    font-size: 13px;
  }
  .field-notes {
    padding: 28px 0;
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .field-notes h2 {
    margin-bottom: 10px;
  }
  .field-notes p {
    font-size: 14px;
  }
  .hud {
    padding: 6px 10px;
    gap: 10px;
  }
  .hud > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    min-width: 47px;
  }
  .hud strong {
    font-size: 20px;
  }
  .pause-button {
    padding: 8px 12px;
  }
  .run-overlay,
  .pause-overlay {
    padding: 20px;
    gap: 10px;
  }
  .result-score strong {
    font-size: 50px;
  }
  .result-actions {
    gap: 8px;
  }
  .run-overlay .primary {
    padding: 10px 16px;
  }
  .run-overlay p {
    font-size: 13px;
  }
  .token-actions {
    width: 100%;
  }
  .token-actions button {
    flex: 1;
  }
  footer {
    padding: 16px 0 22px;
  }
  footer a {
    font-size: 12px;
  }
}
@media (max-width: 390px) {
  .arena-label {
    display: none;
  }
  .masthead nav {
    gap: 8px;
  }
  .wordmark {
    gap: 4px;
  }
  .arena-intro {
    left: 18px;
  }
  .arena-intro h1 {
    font-size: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

.skip:hover {
  color: var(--page);
}

/* Survival card: 44px brand row + compact result, leaving retry/watch reachable
   inside the existing 380px phone arena; no new motion or scroll container. */
.standard-result { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.survival-certificate { width: min(100%, 390px); padding: 18px 24px 14px; border: 1px solid var(--peach); border-radius: 12px; background: var(--arena); text-align: left; }
.certificate-brand { display: flex; align-items: center; gap: 10px; font: 600 18px/1.2 var(--display); }
.certificate-brand small { display: block; margin-top: 3px; font: 12px/1.4 var(--body); color: var(--muted); }
.survival-certificate h2 { margin-top: 12px; font-size: 32px; }
.survival-certificate > p { margin-top: 4px; }
.certificate-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; padding-block: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.certificate-stats strong { display: block; font: 600 24px/1.1 var(--display); color: var(--peach); }
.certificate-stats span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.survival-certificate .certificate-id { margin-top: 10px; font-size: 11px; }
.certificate-id span { font-variant-numeric: tabular-nums; color: var(--text); }
.run-overlay.survived { gap: 10px; padding: 16px; }
@media (max-width: 767px) {
  .survival-certificate { padding: 12px 18px; }
  .survival-certificate h2 { font-size: 30px; margin-top: 8px; }
  .certificate-stats { margin-top: 10px; padding-block: 8px; }
  .survival-certificate .certificate-id { margin-top: 8px; }
  .run-overlay.survived { gap: 8px; padding: 12px; }
}
