:root {
  --paper: #f8f9fa;
  --ink: #202122;
  --muted: #54595d;
  --rule: #a2a9b1;
  --link: #0645ad;
  --visited: #0b0080;
  --hud: rgba(255, 255, 255, 0.88);
  --game-ui-bg: rgba(5, 5, 5, 0.92);
  --game-ui-ink: #fff;
  --game-ui-muted: rgba(255, 255, 255, 0.72);
  --game-ui-rule: rgba(255, 255, 255, 0.74);
  --shadow: rgba(32, 33, 34, 0.18);
  --surfer-size: 19.2px;
  --pixel-font: "Silkscreen", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --pixel-weight: 400;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--pixel-font);
  font-weight: var(--pixel-weight);
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; font-weight: var(--pixel-weight); line-height: 1.25; text-transform: uppercase; }
button { -webkit-tap-highlight-color: transparent; }
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}
body :where(strong, b) { font-weight: var(--pixel-weight); }

.game-shell {
  position: fixed;
  inset: 0;
  height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(162, 169, 177, 0.22) 1px, transparent 1px),
    linear-gradient(180deg, rgba(162, 169, 177, 0.12) 1px, transparent 1px),
    #eaecf0;
  background-size: 32px 32px;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.game-shell.is-shaking {
  animation: whitespaceShake 240ms steps(2, end);
}

.viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: crosshair;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.world {
  position: absolute;
  top: 0;
  left: 0;
  width: 760px;
  min-height: 3200px;
  contain: layout paint style;
  transform-origin: 0 0;
  will-change: transform;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.wiki-article {
  position: relative;
  width: 760px;
  min-height: 3200px;
  padding: 54px 66px 120px;
  background: #fff;
  contain: layout paint style;
  box-shadow: 0 0 0 1px rgba(162, 169, 177, 0.35), 0 30px 80px var(--shadow);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  text-transform: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.wiki-article * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.wiki-article h1, .wiki-article h2, .wiki-article h3 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}
.wiki-article h1 {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  font-size: 34px;
  line-height: 1.2;
}
.wiki-article h2 {
  clear: both;
  margin-top: 30px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--rule);
  font-size: 24px;
}
.wiki-article h3 { margin-top: 22px; font-size: 19px; font-weight: 700; }
.wiki-article p, .wiki-article li { margin: 12px 0; }
.wiki-article :where(strong, b) { font-weight: 700; }
.wiki-article ul { margin: 8px 0 18px 22px; padding: 0; }
.wiki-article a { color: var(--link); text-decoration: none; }
.wiki-article a:hover { text-decoration: none; }
.wiki-article .collected { color: var(--visited); background: rgba(20, 134, 109, 0.14); border-radius: 2px; }
.wiki-article .portal-charging {
  border-radius: 2px;
  background: rgba(51, 102, 204, 0.18);
  box-shadow: 0 0 0 1px rgba(51, 102, 204, 0.16);
}
.wiki-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  text-transform: none;
}
.infobox {
  float: left;
  width: 220px;
  margin: 0 22px 20px 0;
  border: 1px solid var(--rule);
  background: #f8f9fa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  text-transform: none;
}
.infobox-title { padding: 8px; background: #eaecf0; font-weight: 800; text-align: center; }
.infobox-row { display: grid; grid-template-columns: 68px 1fr; gap: 7px; padding: 7px 8px; border-top: 1px solid #c8ccd1; }

.wiki-word {
  white-space: nowrap;
}

.wiki-char {
  display: inline-block;
  white-space: pre;
  transform: translate3d(var(--wake-x, 0px), var(--wake-y, 0px), 0) rotate(var(--wake-r, 0deg));
}
.wiki-char.is-waking { will-change: transform; }
.wiki-link .wiki-char {
  position: relative;
  color: var(--link);
}
.wiki-link .wiki-char::after {
  content: none;
}

.surfer {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--surfer-size);
  height: var(--surfer-size);
  transform-origin: 50% 50%;
  will-change: transform;
  z-index: 10;
  --lift: 0px;
  --shadow-scale: 1;
  --shadow-opacity: 0.55;
}
.surfer-lift {
  position: absolute;
  inset: 0;
  transform: translateY(calc(-1 * var(--lift)));
  transform-origin: 50% 70%;
  will-change: transform;
}
.surfer img,
.surfer-sprite {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.23));
  overflow: visible;
}
.sprite-board {
  fill: #fff;
  stroke: #050505;
  stroke-width: 2.4;
  stroke-linejoin: round;
}
.sprite-stringer {
  fill: none;
  stroke: #8a8a8a;
  stroke-width: 1.3;
  stroke-linecap: round;
}
.sprite-head {
  fill: #050505;
}
.sprite-figure {
  transform-box: view-box;
  transform-origin: 50% 50%;
}
.sprite-body,
.sprite-leg,
.sprite-arm {
  fill: none;
  stroke: #050505;
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sprite-arm {
  stroke-width: 3.35;
  transform-box: fill-box;
  transform-origin: 100% 50%;
}
.surfer.is-paddling .sprite-arm-top {
  animation: paddleTop 340ms steps(2, end) infinite;
}
.surfer.is-paddling .sprite-arm-bottom {
  animation: paddleBottom 340ms steps(2, end) infinite;
}
.surfer.is-link-diving .sprite-figure {
  animation: linkDiveFigure 440ms steps(5, end) forwards;
}
.surfer.is-link-diving .sprite-board,
.surfer.is-link-diving .sprite-stringer {
  animation: linkDiveBoard 440ms steps(4, end) forwards;
}
.surfer.is-link-diving .surfer-shadow {
  animation: linkDiveShadow 440ms steps(4, end) forwards;
}
.surfer.is-carried {
  opacity: 0;
}
.game-shell.is-tutorial .surfer.is-link-diving .sprite-figure {
  animation-duration: 820ms;
}
.game-shell.is-tutorial .surfer.is-link-diving .sprite-board,
.game-shell.is-tutorial .surfer.is-link-diving .sprite-stringer,
.game-shell.is-tutorial .surfer.is-link-diving .surfer-shadow {
  animation-duration: 820ms;
}
.surfer-shadow {
  position: absolute;
  left: 20%;
  top: 58%;
  width: 60%;
  height: 25%;
  border-radius: 999px;
  background: rgba(32, 33, 34, 0.25);
  transform: scale(var(--shadow-scale));
  transform-origin: 50% 50%;
  opacity: var(--shadow-opacity);
}

@keyframes paddleTop {
  0%, 100% { transform: rotate(-18deg) translateX(0); }
  50% { transform: rotate(24deg) translateX(-1px); }
}

@keyframes paddleBottom {
  0%, 100% { transform: rotate(18deg) translateX(0); }
  50% { transform: rotate(-24deg) translateX(-1px); }
}

@keyframes linkDiveFigure {
  0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
  40% { opacity: 1; transform: translate(5px, -7px) scale(0.92) rotate(-8deg); }
  100% { opacity: 0; transform: translate(18px, -18px) scale(0.34) rotate(-20deg); }
}

@keyframes linkDiveBoard {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-1px, 1px); }
}

@keyframes linkDiveShadow {
  0% { opacity: var(--shadow-opacity); }
  100% { opacity: 0.16; }
}

.rescue-helicopter {
  position: fixed;
  left: 0;
  top: 0;
  width: 54px;
  height: 54px;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-120px, -120px, 0) rotate(0deg) scale(1);
  transform-origin: 50% 50%;
  transition: opacity 90ms steps(2, end);
  image-rendering: pixelated;
  z-index: 29;
}
.rescue-helicopter.is-active {
  opacity: 1;
}
.rescue-helicopter-sprite {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 2px 0 rgba(32, 33, 34, 0.24));
  shape-rendering: crispEdges;
}
.heli-main-rotor {
  transform-box: view-box;
  transform-origin: 34px 32px;
  animation: heliRotor 180ms steps(4, end) infinite;
}
.heli-blade,
.heli-hub,
.heli-tail-blade {
  fill: #fff;
  stroke: #050505;
  stroke-width: 2.4;
  stroke-linejoin: miter;
}
.heli-hub {
  fill: #fff;
}
.heli-hub-dot {
  fill: #050505;
  stroke: none;
}
.heli-tail,
.heli-cabin {
  fill: #fff;
  stroke: #050505;
  stroke-width: 4;
  stroke-linejoin: miter;
}
.heli-window {
  fill: #050505;
  stroke: none;
}
.heli-detail {
  fill: none;
  stroke: #050505;
  stroke-width: 2.2;
  stroke-linecap: square;
}
.heli-mast {
  fill: none;
  stroke: #050505;
  stroke-width: 3;
  stroke-linecap: square;
}
.heli-tail-rotor {
  transform-box: view-box;
  transform-origin: 6px 32px;
  animation: heliTailRotor 120ms steps(4, end) infinite;
}
.heli-skids {
  fill: none;
  stroke: #050505;
  stroke-width: 3;
  stroke-linecap: square;
}

@keyframes heliRotor {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(180deg); }
}

@keyframes heliTailRotor {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(180deg); }
}

.steer-dot {
  position: fixed;
  left: -11px;
  top: -11px;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(51, 102, 204, 0.82);
  border-radius: 50%;
  background: rgba(51, 102, 204, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-100px, -100px, 0) scale(0.84);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 25;
}
.steer-dot.is-visible { opacity: 1; }

.hud {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  top: max(12px, env(safe-area-inset-top));
  display: grid;
  gap: 8px;
  width: 178px;
  z-index: 24;
}
.hud-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--game-ui-rule);
  border-radius: 7px;
  background: var(--game-ui-bg);
  color: var(--game-ui-ink);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.72),
    0 8px 24px rgba(32, 33, 34, 0.18);
  backdrop-filter: blur(12px);
}
.hud-label {
  display: block;
  flex: none;
  margin-bottom: 0;
  color: var(--game-ui-muted);
  font-size: 10px;
  font-weight: var(--pixel-weight);
  letter-spacing: 0;
  text-transform: uppercase;
}
.hud strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.2;
}
.hud-timer strong { font-size: 15px; }
.hud-airtime strong { font-size: 15px; }
.hud-airtime.is-airtime-active {
  animation: airtimeShake 140ms steps(2, end) infinite;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.9),
    0 0 0 5px rgba(5, 5, 5, 0.55),
    0 8px 24px rgba(32, 33, 34, 0.18);
}
.hud-target {
  display: grid;
  align-items: start;
  gap: 3px;
  min-height: 58px;
  transform-origin: 0 0;
}
.hud-target .hud-label {
  color: var(--game-ui-ink);
}
.hud-target strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.12;
}
.hud-target.is-target-pulse {
  animation: targetPulse 3000ms cubic-bezier(0.2, 0.72, 0.24, 1) both;
  z-index: 2;
}

.icon-button {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  top: max(12px, env(safe-area-inset-top));
  width: 42px;
  height: 42px;
  border: 1px solid var(--game-ui-rule);
  border-radius: 7px;
  background: var(--game-ui-bg);
  color: var(--game-ui-ink);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.72),
    0 8px 24px rgba(32, 33, 34, 0.18);
  cursor: pointer;
  z-index: 24;
  display: grid;
  grid-template-columns: 5px 5px;
  place-content: center;
  gap: 6px;
}
.icon-button span { width: 5px; height: 17px; border-radius: 2px; background: var(--game-ui-ink); }
.icon-button.is-paused { grid-template-columns: 0; gap: 0; }
.icon-button.is-paused span:first-child { width: 0; height: 0; border-top: 9px solid transparent; border-bottom: 9px solid transparent; border-left: 15px solid var(--game-ui-ink); border-radius: 0; background: transparent; }
.icon-button.is-paused span:last-child { display: none; }

.hud-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.live-players {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--game-ui-rule);
  border-radius: 7px;
  background: var(--game-ui-bg);
  color: var(--game-ui-ink);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.72),
    0 8px 24px rgba(32, 33, 34, 0.18);
  font-size: 10px;
  line-height: 1.25;
  backdrop-filter: blur(12px);
}
.live-players[hidden] { display: none; }
.live-player-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.live-player-row span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-player-result {
  border-bottom: 1px solid rgba(255, 255, 255, 0.34);
  padding-bottom: 4px;
  margin-bottom: 2px;
}
.action-button, .primary-button {
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--game-ui-rule);
  border-radius: 7px;
  background: var(--game-ui-bg);
  color: var(--game-ui-ink);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.72),
    0 8px 24px rgba(32, 33, 34, 0.18);
  font-size: 13px;
  font-weight: var(--pixel-weight);
  cursor: pointer;
}
.action-button:disabled,
.action-button[aria-disabled="true"] {
  color: rgba(255, 255, 255, 0.42);
  cursor: not-allowed;
  opacity: 0.72;
}
.primary-button { min-width: 148px; min-height: 46px; padding: 11px 18px; border-color: #36c; background: #36c; color: #fff; }
.action-button:hover:not(:disabled):not([aria-disabled="true"]),
.primary-button:hover:not(:disabled):not([aria-disabled="true"]),
.secondary-button:hover:not(:disabled):not([aria-disabled="true"]),
.mode-button:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: #050505;
  background: #050505;
  color: #fff;
}
.overlay .primary-button:hover:not(:disabled):not([aria-disabled="true"]),
.overlay .secondary-button:hover:not(:disabled):not([aria-disabled="true"]),
.mode-button:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: #202122;
  background: #fff;
  color: var(--ink);
}
.hud .action-button:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: #fff;
  background: #fff;
  color: var(--ink);
  box-shadow:
    0 0 0 2px #050505,
    0 8px 24px rgba(32, 33, 34, 0.18);
}
.primary-button.is-selected:not(:disabled):not([aria-disabled="true"]),
.secondary-button.is-selected:not(:disabled):not([aria-disabled="true"]),
.mode-button.is-selected:not(:disabled):not([aria-disabled="true"]) {
  animation: selectedBlink 900ms steps(2, end) infinite;
}

.toast {
  position: fixed;
  left: 50%;
  top: calc(max(18px, env(safe-area-inset-top)) + 17vh + 52px);
  max-width: min(380px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 2px solid #fff;
  border-radius: 0;
  background: var(--game-ui-bg);
  box-shadow:
    0 0 0 4px #050505,
    0 10px 30px rgba(32, 33, 34, 0.14);
  color: var(--game-ui-ink);
  font-family: var(--pixel-font);
  font-size: 12px;
  font-weight: var(--pixel-weight);
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-50%, -14px, 0);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 35;
}
.toast.is-visible { opacity: 1; transform: translate3d(-50%, 0, 0); }
.toast.is-tutorial {
  left: var(--toast-x, 50%);
  top: var(--toast-y, calc(max(18px, env(safe-area-inset-top)) + 17vh + 52px));
  max-width: min(760px, calc(100vw - 36px));
  padding: 22px 28px;
  border-width: 4px;
  font-size: 30px;
  line-height: 1.28;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 90ms ease;
}
.toast.is-tutorial.is-visible { transform: translate3d(-50%, -50%, 0); }
.toast.is-tutorial.is-typing {
  min-width: min(560px, calc(100vw - 36px));
}
.toast-kicker,
.toast-message {
  display: block;
}
.toast-kicker {
  margin-bottom: 8px;
  color: var(--game-ui-muted);
  font-size: 0.36em;
  line-height: 1.1;
}
.toast-message {
  line-height: inherit;
}

@media (min-width: 761px) and (pointer: fine) {
  .toast:not(.is-tutorial) {
    max-width: min(494px, calc(100vw - 42px));
    padding: 13px 18px;
    font-size: 16px;
    line-height: 1.32;
  }
}

.live-name-overlay {
  position: fixed;
  inset: 0;
  z-index: 42;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(248, 249, 250, 0.72);
  backdrop-filter: blur(3px);
}
.live-name-overlay[hidden] { display: none; }
.live-name-panel {
  width: min(390px, calc(100vw - 36px));
  padding: 28px 26px;
  border: 4px solid #202122;
  outline: 2px solid #202122;
  outline-offset: 7px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(32, 33, 34, 0.16);
  text-align: center;
}
.live-name-panel label {
  display: block;
  margin: 0 0 10px;
  font-size: 15px;
}
.live-name-panel input {
  width: 100%;
  min-height: 48px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 2px solid #202122;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  text-align: center;
}
.live-name-panel .secondary-button {
  width: 100%;
  min-height: 48px;
  margin: 0;
}

.live-ready-button {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 28;
  width: min(620px, calc(100vw - 48px));
  min-height: 72px;
  padding: 12px 18px;
  border: 4px solid #fff;
  border-radius: 0;
  background: #050505;
  color: #fff;
  box-shadow:
    0 0 0 6px #050505,
    0 16px 36px rgba(32, 33, 34, 0.18);
  font-family: var(--pixel-font);
  font-size: clamp(18px, 5vw, 28px);
  font-weight: var(--pixel-weight);
  line-height: 1.25;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.live-ready-button[hidden] { display: none; }
.live-ready-button:disabled {
  cursor: default;
}
.live-ready-button:hover:not(:disabled),
.live-ready-button.is-ready {
  border-color: #050505;
  background: #fff;
  color: var(--ink);
  box-shadow:
    0 0 0 6px #fff,
    0 16px 36px rgba(32, 33, 34, 0.18);
}
.ghost-surfer {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--surfer-size);
  height: var(--surfer-size);
  z-index: 11;
  opacity: 0.86;
  pointer-events: none;
  transform-origin: 50% 50%;
  will-change: transform;
}
.ghost-surfer .surfer-sprite {
  filter: drop-shadow(0 1px 0 rgba(6, 69, 173, 0.28));
}
.ghost-surfer .sprite-board {
  fill: #fff;
  stroke: var(--link);
}
.ghost-surfer .sprite-stringer {
  stroke: rgba(6, 69, 173, 0.55);
}
.ghost-surfer .sprite-head {
  fill: var(--link);
}
.ghost-surfer .sprite-body,
.ghost-surfer .sprite-leg,
.ghost-surfer .sprite-arm {
  stroke: var(--link);
}
.ghost-label {
  position: absolute;
  left: 50%;
  bottom: 100%;
  max-width: 90px;
  transform: translateX(-50%) rotate(var(--ghost-label-rotation, 0rad));
  transform-origin: 50% calc(100% + 10px);
  margin-bottom: 4px;
  padding: 2px 4px;
  border: 1px solid #202122;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-family: var(--pixel-font);
  font-size: 8px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tutorial-skip {
  position: fixed;
  left: 50%;
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 18px);
  z-index: 27;
  transform: translateX(-50%);
  padding: 8px 12px;
  border: 2px solid #fff;
  background: var(--game-ui-bg);
  color: var(--game-ui-ink);
  box-shadow:
    0 0 0 4px #050505,
    0 10px 28px rgba(32, 33, 34, 0.12);
  font-family: var(--pixel-font);
  font-size: 11px;
  font-weight: var(--pixel-weight);
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
}
.game-shell.is-tutorial .hud,
.game-shell.is-tutorial .icon-button,
.game-shell.is-tutorial .portal-charge {
  opacity: 0;
  pointer-events: none;
}
.wiki-article.is-tutorial {
  font-size: 18px;
}
.wiki-article.is-tutorial .wiki-link.is-tutorial-target {
  background: rgba(51, 102, 204, 0.08);
  box-shadow: inset 0 -3px 0 rgba(51, 102, 204, 0.3);
  animation: tutorialLinkPulse 900ms steps(2, end) infinite;
}
.tutorial-whitespace {
  height: 58px;
}
.skid-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  overflow: visible;
}
.skid-mark {
  position: absolute;
  height: 11px;
  background: transparent;
  image-rendering: pixelated;
  opacity: var(--skid-opacity, 0.86);
  transform-origin: 0 50%;
  animation: skidFade 2000ms steps(8, end) forwards;
}
.skid-mark::before,
.skid-mark::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--skid-thickness, 2px);
  background:
    repeating-linear-gradient(90deg, #050505 0 7px, transparent 7px 11px);
}
.skid-mark::before {
  top: 2px;
}
.skid-mark::after {
  bottom: 2px;
  opacity: 0.72;
  transform: translateX(3px);
}

@keyframes targetPulse {
  0% { transform: scale(1); }
  22% { transform: scale(2.4); }
  72% { transform: scale(2.4); }
  100% { transform: scale(1); }
}

@keyframes airtimeShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-1px, 0, 0); }
  50% { transform: translate3d(1px, -1px, 0); }
  75% { transform: translate3d(0, 1px, 0); }
}

@keyframes tutorialLinkPulse {
  0%, 100% {
    background: rgba(51, 102, 204, 0.08);
    box-shadow: inset 0 -3px 0 rgba(51, 102, 204, 0.3);
  }
  50% {
    background: rgba(51, 102, 204, 0.18);
    box-shadow: inset 0 -5px 0 rgba(51, 102, 204, 0.44);
  }
}

@keyframes skidFade {
  0% { opacity: 0.78; filter: none; }
  70% { opacity: 0.45; }
  100% { opacity: 0; }
}
@keyframes selectedBlink {
  0%, 49% {
    border-color: #050505;
    background: #050505;
    color: #fff;
  }
  50%, 100% {
    border-color: #202122;
    background: #fff;
    color: var(--ink);
  }
}
.portal-charge {
  position: fixed;
  left: 50%;
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 92px);
  width: min(240px, calc(100vw - 48px));
  height: 10px;
  border: 1px solid #fff;
  background: #050505;
  box-shadow:
    0 0 0 3px #050505,
    0 8px 20px rgba(32, 33, 34, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-50%, 8px, 0);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 23;
}
.portal-charge.is-visible { opacity: 1; transform: translate3d(-50%, 0, 0); }
.portal-charge span {
  display: block;
  width: calc(var(--portal-progress, 0) * 100%);
  height: 100%;
  background: #fff;
}
.screen-pulse {
  position: fixed;
  inset: 0;
  display: none;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
  z-index: 18;
}
.screen-pulse.is-active { opacity: 0; transition-duration: 40ms; }

@keyframes whitespaceShake {
  0% { transform: translate3d(0, 0, 0); }
  15% { transform: translate3d(-5px, 3px, 0); }
  30% { transform: translate3d(5px, -2px, 0); }
  45% { transform: translate3d(-4px, -3px, 0); }
  60% { transform: translate3d(4px, 2px, 0); }
  75% { transform: translate3d(-2px, 1px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vmin, 42px);
  background:
    linear-gradient(90deg, rgba(162, 169, 177, 0.16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(162, 169, 177, 0.12) 1px, transparent 1px),
    #f8f9fa;
  background-size: 28px 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 40;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }
.overlay-panel {
  width: min(500px, 100%);
  max-height: calc(100dvh - clamp(32px, 8vmin, 84px));
  overflow-y: auto;
  padding: clamp(20px, 5vmin, 38px) clamp(20px, 5vmin, 38px);
  border: 2px solid #202122;
  border-radius: 0;
  background: #fff;
  font-family: var(--pixel-font);
  box-shadow:
    0 0 0 8px #fff,
    0 0 0 10px #202122;
  text-align: center;
}
.overlay-panel h1, .overlay-panel h2 {
  margin: 0 0 22px;
  color: var(--ink);
  font-family: var(--pixel-font);
  font-size: clamp(42px, 12vw, 72px);
  font-weight: var(--pixel-weight);
  line-height: 0.95;
}
.overlay-panel h2 { font-size: clamp(32px, 10vw, 44px); }
.game-title {
  margin-bottom: 12px;
}
.game-logo {
  display: block;
  width: min(100%, 360px, 52dvh);
  height: auto;
  margin: 0 auto;
}
.control-card {
  margin: 0 auto 16px;
  max-width: 390px;
  color: var(--ink);
  font-family: var(--pixel-font);
  text-align: center;
}
.control-card p {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: var(--pixel-weight);
  line-height: 1.55;
}
.control-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border-top: 2px solid #202122;
  padding: 9px 0;
  text-align: center;
}
.control-title,
.control-copy {
  font-size: 10px;
  line-height: 1.45;
}
.control-title {
  font-weight: var(--pixel-weight);
  text-transform: uppercase;
}
.control-copy {
  flex-direction: column;
  align-items: center;
  font-weight: var(--pixel-weight);
  gap: 2px;
  max-width: 100%;
  white-space: nowrap;
}
.control-mobile {
  display: none;
}
.control-desktop {
  display: flex;
}
.challenge-card {
  margin: -8px auto 14px;
  max-width: 390px;
  border-top: 2px solid #202122;
  border-bottom: 2px solid #202122;
  padding: 9px 0;
  color: var(--ink);
  font-family: var(--pixel-font);
  text-align: left;
}
.challenge-card[hidden] { display: none; }
.challenge-card p {
  margin: 0;
  font-size: 11px;
  font-weight: var(--pixel-weight);
  line-height: 1.5;
}
.challenge-card .challenge-label {
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: var(--pixel-weight);
  text-transform: uppercase;
}
.challenge-timers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 9px;
  margin: -4px auto 14px;
  max-width: 390px;
  color: var(--ink);
  font-family: var(--pixel-font);
  font-size: 10px;
  font-weight: var(--pixel-weight);
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
}
.challenge-timers span {
  white-space: nowrap;
}
.challenge-timers:empty {
  display: none;
}
.leaderboard-submit {
  margin: -2px auto 18px;
  max-width: 300px;
  color: var(--ink);
  font-family: var(--pixel-font);
}
.leaderboard-submit[hidden] { display: none; }
.leaderboard-submit label {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: var(--pixel-weight);
  text-transform: uppercase;
}
.leaderboard-submit input {
  width: 100%;
  min-height: 42px;
  margin-bottom: 10px;
  border: 2px solid #202122;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--pixel-font);
  font-size: 13px;
  font-weight: var(--pixel-weight);
  padding: 8px 10px;
  text-align: center;
}
.leaderboard-panel {
  margin: -2px auto 18px;
  max-width: 360px;
  border-top: 2px solid #202122;
  border-bottom: 2px solid #202122;
  padding: 12px 0 8px;
  color: var(--ink);
  font-family: var(--pixel-font);
  text-align: left;
}
.leaderboard-panel[hidden] { display: none; }
.leaderboard-panel .challenge-label {
  margin: 0 0 9px;
  font-size: 10px;
  font-weight: var(--pixel-weight);
  text-align: center;
  text-transform: uppercase;
}
.leaderboard-panel ol {
  margin: 0;
  padding-left: 28px;
}
.leaderboard-panel li {
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: var(--pixel-weight);
  line-height: 1.35;
}
.eyebrow { margin: 0 0 9px; color: var(--muted); font-size: 12px; font-weight: var(--pixel-weight); letter-spacing: 0; text-transform: uppercase; }
.finish-stats { min-height: 20px; margin: -8px 0 18px; color: var(--muted); font-size: 14px; }
.challenge-result {
  min-height: 20px;
  margin: -6px auto 18px;
  max-width: 400px;
  color: var(--ink);
  font-size: 12px;
  font-weight: var(--pixel-weight);
  line-height: 1.5;
}
.challenge-result[hidden] { display: none; }
.mode-heading {
  margin: -4px 0 18px;
  color: var(--ink);
  font-family: var(--pixel-font);
  font-size: 13px;
  font-weight: var(--pixel-weight);
  letter-spacing: 0;
  text-transform: uppercase;
}
.mode-heading[hidden] { display: none; }
.mode-buttons {
  display: grid;
  gap: 10px;
  margin: 0 auto;
  width: min(250px, 100%);
}
.mode-buttons[hidden] { display: none; }
.mode-button {
  min-height: 42px;
  border: 2px solid #202122;
  border-radius: 0;
  background: #050505;
  color: #fff;
  box-shadow: none;
  font-family: var(--pixel-font);
  font-size: 13px;
  font-weight: var(--pixel-weight);
  text-transform: uppercase;
  cursor: pointer;
}

@media (min-width: 761px) {
  .overlay-panel {
    width: min(540px, 100%);
  }
  .control-card {
    max-width: 420px;
  }
  .control-card p {
    font-size: 11px;
    line-height: 1.55;
  }
  .control-title,
  .control-copy {
    font-size: 11px;
    line-height: 1.45;
  }
  .challenge-card {
    max-width: 420px;
  }
  .challenge-card p,
  .challenge-result {
    font-size: 13px;
    line-height: 1.45;
  }
  .challenge-card .challenge-label,
  .challenge-timers,
  .leaderboard-submit label,
  .leaderboard-panel .challenge-label,
  .leaderboard-panel li,
  .eyebrow {
    font-size: 11px;
  }
  .mode-heading,
  .mode-button,
  .overlay .primary-button,
  .overlay .secondary-button,
  .leaderboard-submit input {
    font-size: 15px;
  }
  .mode-buttons {
    width: min(300px, 100%);
    gap: 12px;
  }
  .mode-button {
    min-height: 46px;
  }
}

.overlay .primary-button {
  min-width: 190px;
  border: 2px solid #202122;
  border-radius: 0;
  background: #050505;
  color: #fff;
  box-shadow: none;
  font-family: var(--pixel-font);
  text-transform: uppercase;
}
.overlay .secondary-button {
  display: block;
  min-width: 190px;
  margin: 0 auto 12px;
  border: 2px solid #202122;
  border-radius: 0;
  background: #050505;
  color: #fff;
  box-shadow: none;
  font-family: var(--pixel-font);
  font-size: 12px;
  font-weight: var(--pixel-weight);
  line-height: 1.2;
  padding: 11px 16px;
  text-transform: uppercase;
  cursor: pointer;
}
.overlay .secondary-button[hidden] { display: none; }
@media (min-width: 761px) {
  .overlay .secondary-button {
    font-size: 15px;
    line-height: 1.25;
  }
}
.overlay .primary-button:active,
.overlay .secondary-button:active,
.mode-button:active {
  transform: translate3d(2px, 2px, 0);
  background: #eaecf0;
}
.pixel-transition {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  grid-template-rows: repeat(12, 1fr);
  overflow: hidden;
  pointer-events: none;
  z-index: 60;
}
.pixel-cell {
  background: #000;
  opacity: 0;
  transform: scale(1.025);
}
.pixel-transition.is-out .pixel-cell {
  animation: pixelIn 360ms steps(1, end) forwards;
  animation-delay: calc(var(--pixel-order) * 13ms);
}
.pixel-transition.is-covered .pixel-cell {
  animation: none;
  opacity: 1;
}
.pixel-transition.is-in .pixel-cell {
  opacity: 1;
  animation: pixelOut 360ms steps(1, end) forwards;
  animation-delay: calc(var(--pixel-order) * 10ms);
}
@keyframes pixelIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pixelOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (max-width: 760px), (pointer: coarse) {
  .world, .wiki-article { width: 630px; }
  .wiki-article { padding: 48px 49px 110px; font-size: 15px; }
  .infobox { width: 171px; margin: 0 15px 18px 0; }
  .hud { width: 158px; gap: 6px; }
  .hud-item { min-height: 38px; padding: 7px 8px; }
  .hud-target { min-height: 54px; }
  .hud-actions { gap: 6px; }
  .live-players { padding: 7px 8px; font-size: 9px; }
}

@media (max-width: 430px) {
  .hud-label { font-size: 9px; }
  .hud strong { font-size: 11px; }
  .hud-target strong { font-size: 11px; line-height: 1.12; }
  .hud-timer strong { font-size: 13px; }
  .hud-airtime strong { font-size: 13px; }
  .action-button { min-height: 38px; padding: 8px 10px; font-size: 12px; }
  .toast {
    top: calc(max(12px, env(safe-area-inset-top)) + 17vh + 146px);
    max-width: min(310px, calc(100vw - 24px));
    font-size: 10px;
  }
  .toast.is-tutorial {
    max-width: min(221px, calc(100vw - 28px));
    padding: 7px 9px;
    border-width: 3px;
    font-size: 9px;
    line-height: 1.32;
  }
  .toast.is-tutorial.is-typing {
    min-width: min(221px, calc(100vw - 28px));
  }
  .tutorial-skip { max-width: calc(100vw - 28px); font-size: 9px; }
  .overlay { padding: 14px; }
  .overlay-panel { padding: 18px 18px; }
  .game-title { margin-bottom: 10px; }
  .control-card { margin-bottom: 14px; }
  .control-card p { font-size: 9px; line-height: 1.45; }
  .control-grid { gap: 6px; padding: 10px 0; }
  .mode-buttons { gap: 9px; }
  .mode-button { min-height: 40px; font-size: 12px; }
}

@media (max-height: 760px) {
  .overlay { padding: 14px; }
  .overlay-panel {
    max-height: calc(100dvh - 28px);
    padding-top: 18px;
    padding-bottom: 18px;
  }
  .overlay-panel h1,
  .overlay-panel h2 {
    margin-bottom: 14px;
  }
  .game-title { margin-bottom: 8px; }
  .game-logo { width: min(100%, 320px, 45dvh); }
  .control-card { margin-bottom: 12px; }
  .control-card p { font-size: 9px; line-height: 1.45; margin-bottom: 8px; }
  .control-title,
  .control-copy { font-size: 9px; line-height: 1.35; }
  .control-grid { gap: 4px; padding: 8px 0; }
  .challenge-timers { margin-bottom: 10px; font-size: 9px; }
  .mode-buttons { gap: 8px; }
  .mode-button { min-height: 38px; font-size: 12px; }
}

@media (max-height: 640px) {
  .overlay-panel {
    padding: 14px 16px;
    box-shadow:
      0 0 0 5px #fff,
      0 0 0 7px #202122;
  }
  .game-logo { width: min(100%, 270px, 40dvh); }
  .control-card { margin-bottom: 10px; }
  .control-grid { padding: 7px 0; }
  .challenge-timers { margin-bottom: 8px; }
  .mode-button { min-height: 34px; font-size: 11px; }
}

@media (max-width: 760px), (pointer: coarse) {
  .control-mobile {
    display: flex;
  }
  .control-desktop {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .world, .surfer, .surfer-lift, .wiki-char { transition: none; }
}
