@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: block;
  src: url("fonts/Jersey10-400.woff2") format("woff2");
  size-adjust: 128%;
}
@font-face {
  font-family: "Silkscreen";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("fonts/Silkscreen-400.woff2") format("woff2");
}
@font-face {
  font-family: "Silkscreen";
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url("fonts/Silkscreen-700.woff2") format("woff2");
}
@font-face {
  font-family: "Impact Num";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("fonts/Jersey10-400.woff2") format("woff2");
}

:root {
  --p1: #6cff5a;
  --p2: #ff4fd8;
  --p3: #ffe45c;
  --p4: #3ec8ff;
  --ink: #0e0b14;
  --cream: #f4e6d4;
  --hud-h: 96px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  font-family: "Pixelify Sans", sans-serif;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--ink);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#app.selecting { touch-action: pan-y; }

#game {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ------------------------------------------------------------------ HUD */

#hud {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  gap: clamp(5px, 1vw, 12px);
  padding:
    max(5px, env(safe-area-inset-top))
    max(8px, env(safe-area-inset-right))
    14px
    max(8px, env(safe-area-inset-left));
  background: linear-gradient(180deg,
    rgba(10, 7, 16, 0.95) 0%,
    rgba(10, 7, 16, 0.78) 58%,
    rgba(10, 7, 16, 0) 100%);
  pointer-events: none;
}

#badge {
  flex: 0 0 auto;
  width: clamp(84px, 15vw, 196px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.badge-hex {
  position: relative;
  width: 100%;
  aspect-ratio: 4.5 / 1;
  display: grid;
  place-items: center;
  clip-path: polygon(7% 0, 93% 0, 100% 50%, 93% 100%, 7% 100%, 0 50%);
  background: var(--cream);
  filter: drop-shadow(0 0 10px rgba(255, 201, 60, 0.22));
}

.badge-hex::before {
  content: "";
  position: absolute;
  inset: clamp(2px, 0.32vw, 4px);
  clip-path: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.18)),
    linear-gradient(100deg, #3b1233, #1b0f24 55%, #2c1230);
}

.badge-icon {
  position: relative;
  z-index: 1;
  width: 54%;
  height: 74%;
  display: grid;
  place-items: center;
  color: #ffc93c;
}

.badge-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 6px currentColor);
}

#modeName {
  max-width: 100%;
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(6px, 0.9vw, 11px);
  letter-spacing: 0.08em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(10, 7, 16, 0.95), 0 0 8px rgba(10, 7, 16, 0.8);
}

.mode-tag {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(5px, 0.7vw, 8px);
  letter-spacing: 0.14em;
  color: color-mix(in srgb, var(--cream, #F4E6D4) 70%, transparent);
  text-shadow: 0 1px 0 rgba(10, 7, 16, 0.95);
  white-space: nowrap;
}

#bars {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(2px, 0.5vh, 5px);
}

.row {
  display: flex;
  align-items: center;
  gap: clamp(4px, 0.7vw, 9px);
  min-width: 0;
}

.plabel {
  flex: 0 0 auto;
  width: clamp(30px, 4.4vw, 62px);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(8px, 1.05vw, 13px);
  line-height: 1.02;
  letter-spacing: 0.04em;
  color: var(--c);
  text-shadow: 0 1px 0 rgba(10, 7, 16, 0.95), 0 0 9px color-mix(in srgb, var(--c) 45%, transparent);
}

.plabel em {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-size: 0.68em;
  letter-spacing: 0.09em;
  color: #fff;
  opacity: 0.52;
  text-shadow: 0 1px 0 rgba(10, 7, 16, 0.9);
}

.trackwrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: clamp(12px, 1.9vh, 17px);
}

.track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.26)),
    color-mix(in srgb, var(--c) 16%, #120d19);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px color-mix(in srgb, var(--c) 26%, transparent);
}

.fill {
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--c) 72%, #120d19) 0%,
    var(--c) 58%,
    color-mix(in srgb, var(--c) 65%, #ffffff) 100%);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}

.ticks {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg,
    rgba(10, 7, 16, 0.6) 0 1.5px,
    transparent 1.5px calc(100% / var(--seg, 20)));
  mix-blend-mode: multiply;
  opacity: 0.8;
}

.picon {
  position: absolute;
  top: 50%;
  left: 6%;
  width: clamp(17px, 2.4vw, 30px);
  height: auto;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 85%, transparent));
  pointer-events: none;
}

.pscore {
  flex: 0 0 auto;
  width: clamp(20px, 2.6vw, 36px);
  text-align: right;
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(10px, 1.35vw, 17px);
  color: #fff;
  text-shadow: 0 2px 0 rgba(10, 7, 16, 0.95);
  font-variant-numeric: tabular-nums;
}

.pstars {
  flex: 0 0 auto;
  width: clamp(24px, 3.4vw, 44px);
  text-align: right;
  font-family: "Silkscreen", monospace;
  font-size: clamp(8px, 1.2vw, 14px);
  letter-spacing: -0.1em;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 0 rgba(10, 7, 16, 0.95);
}

#card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(54px, 8.6vw, 116px);
  min-height: clamp(58px, 9.4vh, 84px);
  margin-top: 2px;
  border-radius: clamp(8px, 1vw, 14px);
  border: clamp(2px, 0.28vw, 4px) solid var(--c, var(--p1));
  background: #fbf7ef;
  display: grid;
  place-items: center;
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.3),
    0 0 20px color-mix(in srgb, var(--c, var(--p1)) 34%, transparent);
  transition: border-color 140ms linear;
}

#card .cnum {
  font-family: "Impact Num", "Jersey 10", sans-serif;
  font-weight: 400;
  font-size: clamp(36px, 6.8vw, 76px);
  line-height: 0.78;
  color: #151019;
  padding-top: 0.1em;
  font-variant-numeric: tabular-nums;
}

#card .ctag {
  position: absolute;
  top: -7px;
  right: clamp(4px, 0.8vw, 9px);
  padding: 1px clamp(4px, 0.6vw, 7px);
  border-radius: 5px;
  background: var(--c, var(--p1));
  color: #151019;
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 0.9vw, 11px);
  letter-spacing: 0.05em;
  line-height: 1.25;
  transition: background-color 140ms linear;
}

/* -------------------------------------------------------------- clock */

#clock {
  position: absolute;
  z-index: 7;
  top: calc(var(--hud-h) + 3px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px clamp(9px, 1.2vw, 16px) 2px;
  border-radius: 999px;
  background: rgba(14, 11, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 18px rgba(255, 228, 92, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(9px, 1.25vw, 15px);
  letter-spacing: 0.08em;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(10, 7, 16, 0.95);
}

/* -------------------------------------------------------------- controls */

#controls {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

#stick {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: clamp(94px, 15.5vh, 142px);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
  background:
    radial-gradient(circle at 50% 46%, rgba(108, 255, 90, 0.13), rgba(14, 11, 20, 0.55) 68%),
    rgba(14, 11, 20, 0.38);
  border: 2px solid rgba(108, 255, 90, 0.42);
  box-shadow:
    0 0 0 3px rgba(14, 11, 20, 0.45),
    0 0 24px rgba(108, 255, 90, 0.22),
    inset 0 0 22px rgba(108, 255, 90, 0.06);
  opacity: 0.82;
}

#stick-ring {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1px dashed rgba(108, 255, 90, 0.32);
}

#stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 42% 36%, rgba(255, 255, 255, 0.55), rgba(108, 255, 90, 0.85) 42%, rgba(40, 100, 32, 0.9) 100%);
  box-shadow:
    0 0 0 3px rgba(14, 11, 20, 0.55),
    0 0 18px rgba(108, 255, 90, 0.6);
  transition: transform 40ms linear;
}

#stick.active { opacity: 1; }
#stick.active #stick-knob { box-shadow: 0 0 0 3px rgba(14, 11, 20, 0.55), 0 0 26px rgba(108, 255, 90, 0.9); }

.ctl-cap {
  position: absolute;
  left: 50%;
  bottom: -17px;
  transform: translateX(-50%);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 0.9vw, 10px);
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(10, 7, 16, 0.9);
}

#dash {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  width: clamp(82px, 13.5vh, 124px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 0;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  color: #17111f;
  background:
    radial-gradient(circle at 42% 34%, rgba(255, 255, 255, 0.72), #ffe45c 38%, #d8a400 100%);
  border: 3px solid rgba(14, 11, 20, 0.7);
  box-shadow:
    0 0 0 3px rgba(255, 228, 92, 0.28),
    0 0 28px rgba(255, 228, 92, 0.34),
    inset 0 -4px 0 rgba(126, 88, 0, 0.35);
  opacity: 0.9;
  transition: transform 80ms ease, opacity 120ms ease, box-shadow 120ms ease;
}

#dash.ready {
  box-shadow:
    0 0 0 3px rgba(255, 228, 92, 0.38),
    0 0 34px rgba(255, 228, 92, 0.55),
    inset 0 -4px 0 rgba(126, 88, 0, 0.35);
}

#dash.active, #dash:active { transform: scale(0.93); }
#dash.cooling { opacity: 0.68; }
#dash.dashing {
  transform: scale(0.93);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.42),
    0 0 46px rgba(255, 228, 92, 0.85),
    inset 0 -4px 0 rgba(126, 88, 0, 0.35);
}

.dash-cap {
  position: relative;
  z-index: 2;
  display: block;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(17px, 2.5vh, 27px);
  letter-spacing: 0.04em;
  color: #17111f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.dash-sub {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: -2px;
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(6px, 0.8vh, 9px);
  letter-spacing: 0.14em;
  color: rgba(23, 17, 31, 0.68);
}

.dash-cd {
  position: absolute;
  z-index: 1;
  inset: 2px;
  border-radius: 50%;
  background: conic-gradient(rgba(14, 11, 20, 0.62) calc(var(--cd, 0) * 360deg), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
  pointer-events: none;
}

#hint {
  position: absolute;
  left: 50%;
  bottom: calc(max(8px, env(safe-area-inset-bottom)) + 14px);
  transform: translateX(-50%);
  max-width: min(70vw, 520px);
  text-align: center;
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 1vw, 11px);
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  text-shadow: 0 1px 0 rgba(10, 7, 16, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

#modesBtn {
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  top: calc(var(--hud-h) + 4px);
  pointer-events: auto;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 5px clamp(12px, 1.8vw, 20px) 4px;
  background: rgba(14, 11, 20, 0.82);
  box-shadow: 0 0 16px rgba(62, 200, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 0.95vw, 10px);
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.78);
}
#modesBtn:active { transform: scale(0.94); }
#modesBtn .modes-sub {
  display: block;
  margin-top: -1px;
  font-size: 0.68em;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.46);
}

/* --------------------------------------------------------------- overlay */

#overlay {
  position: absolute;
  z-index: 4;
  top: var(--hud-h);
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

#countdown {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(76px, 15vw, 170px);
  line-height: 1;
  color: #fff;
  text-shadow:
    0 4px 0 #151019,
    0 0 20px rgba(255, 255, 255, 0.55),
    0 0 46px rgba(255, 201, 60, 0.35);
  opacity: 0;
}

#countdown.show {
  opacity: 1;
  animation: cdpop 0.38s ease-out;
}

#modeIntro {
  position: absolute;
  left: 50%;
  top: 63%;
  transform: translate(-50%, 0);
  width: min(84vw, 560px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 20px 12px;
  border-radius: 16px;
  background: rgba(10, 7, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  text-align: center;
  animation: miIn 0.42s ease-out;
}

@keyframes miIn {
  0% { opacity: 0; transform: translate(-50%, 10px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}

.mi-kicker {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(6px, 0.85vw, 9px);
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.5);
}

.mi-title {
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(19px, 3vw, 32px);
  line-height: 1;
  color: var(--mi-c, #FFC93C);
  text-shadow: 0 2px 0 #151019, 0 0 18px color-mix(in srgb, var(--mi-c, #FFC93C) 45%, transparent);
}

.mi-desc {
  font-family: "Silkscreen", monospace;
  font-size: clamp(7px, 1vw, 11px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  max-width: 46ch;
}

@keyframes cdpop {
  0% { transform: translate(-50%, -50%) scale(1.38); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

#panel {
  position: relative;
  width: min(88vw, 430px);
  padding: 20px 20px 16px;
  border-radius: 24px;
  background: #161020;
  border: 7px solid var(--cream);
  box-shadow:
    0 0 0 3px rgba(10, 7, 16, 0.65),
    0 18px 50px rgba(0, 0, 0, 0.55),
    0 0 42px color-mix(in srgb, var(--c, var(--p1)) 42%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
}

#panel img {
  width: clamp(46px, 9vh, 74px);
  height: auto;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--c, var(--p1)) 70%, transparent));
}

#winLabel {
  font-family: "Impact Num", "Jersey 10", sans-serif;
  font-size: clamp(56px, 10vh, 92px);
  line-height: 0.8;
  color: var(--c, var(--p1));
  text-shadow: 0 3px 0 #0e0b14, 0 0 20px color-mix(in srgb, var(--c, var(--p1)) 55%, transparent);
}

#winSub {
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(15px, 2.2vh, 25px);
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 0 #0e0b14;
}

#winScore {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(9px, 1.3vh, 13px);
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}

#again {
  pointer-events: auto;
  border: 0;
  border-radius: 13px;
  padding: clamp(10px, 1.7vh, 16px) clamp(24px, 5vw, 42px);
  background: var(--c, var(--p1));
  color: #17111f;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(17px, 2.4vh, 24px);
  letter-spacing: 0.03em;
  box-shadow: 0 0 22px color-mix(in srgb, var(--c, var(--p1)) 60%, transparent);
  cursor: pointer;
}
#again:active { transform: scale(0.96); }

#changeMode {
  pointer-events: auto;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 13px;
  padding: clamp(8px, 1.3vh, 12px) clamp(18px, 3.6vw, 30px);
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(13px, 1.9vh, 18px);
  letter-spacing: 0.03em;
  cursor: pointer;
}
#changeMode:active { transform: scale(0.96); }

/* ---------------------------------------------------------- mode select */

#select {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 201, 60, 0.1), transparent 46%),
    radial-gradient(circle at 15% 90%, rgba(62, 200, 255, 0.08), transparent 42%),
    #08050e;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.sel-wrap {
  width: min(100%, 940px);
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, 1.4vh, 15px);
  text-align: center;
}

.sel-kicker {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(8px, 1.1vw, 12px);
  letter-spacing: 0.3em;
  color: rgba(255, 228, 92, 0.78);
}

#select h1 {
  margin: 0;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(27px, 5.2vw, 56px);
  line-height: 1;
  color: #fff;
  text-shadow: 0 3px 0 #151019, 0 0 24px rgba(255, 228, 92, 0.28);
}

.sel-sub {
  margin: 0;
  max-width: 46ch;
  font-family: "Silkscreen", monospace;
  font-size: clamp(8px, 1.15vw, 12px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.58);
}

.sel-players {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(6px, 1vw, 12px);
  padding: 6px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sel-label {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(8px, 1vw, 11px);
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.6);
}

.pbtns { display: flex; gap: 5px; }

.pbtns button {
  width: clamp(30px, 4vh, 38px);
  height: clamp(30px, 4vh, 38px);
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(14, 11, 20, 0.72);
  color: rgba(255, 255, 255, 0.72);
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(14px, 2vh, 18px);
  cursor: pointer;
}

.pbtns button.on {
  background: #ffe45c;
  border-color: #ffe45c;
  color: #17111f;
  box-shadow: 0 0 18px rgba(255, 228, 92, 0.45);
}

.player-hint {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 0.95vw, 10px);
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.54);
}

.sel-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.5vw, 16px);
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(2px, 0.5vh, 5px);
  padding: clamp(10px, 1.7vh, 18px) clamp(12px, 1.8vw, 20px);
  border-radius: 17px;
  border: 2px solid color-mix(in srgb, var(--c) 48%, transparent);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--c) 12%, transparent), transparent 58%),
    rgba(22, 16, 32, 0.92);
  color: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 90ms ease, box-shadow 140ms ease, border-color 140ms ease;
  font-family: inherit;
}

.mode-card:active { transform: scale(0.98); }
.mode-card.current {
  border-color: var(--c);
  box-shadow:
    0 0 0 1px var(--c),
    0 0 30px color-mix(in srgb, var(--c) 34%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mc-icon {
  display: block;
  width: clamp(28px, 4.6vh, 48px);
  height: clamp(28px, 4.6vh, 48px);
  color: var(--c);
}
.mc-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px currentColor);
}

.mc-name {
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(15px, 2.1vh, 24px);
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.mc-desc {
  font-family: "Silkscreen", monospace;
  font-size: clamp(7px, 1vh, 10px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.58);
}

.mc-tag {
  position: absolute;
  top: clamp(8px, 1.2vh, 12px);
  right: clamp(8px, 1.2vw, 12px);
  padding: 2px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--c) 26%, transparent);
  color: color-mix(in srgb, var(--c) 88%, #ffffff);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(6px, 0.85vh, 9px);
  letter-spacing: 0.08em;
}

.mode-card.locked {
  opacity: 0.52;
  cursor: default;
  filter: saturate(0.7);
}
.mode-card.locked:active { transform: none; }
.mode-card.locked .mc-tag {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

.control-hint {
  max-width: 72ch;
  font-family: "Silkscreen", monospace;
  font-size: clamp(7px, 1vh, 10px);
  line-height: 1.65;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.46);
}

.sel-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

#selClose {
  pointer-events: auto;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 11px;
  padding: 8px 18px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(13px, 1.8vh, 17px);
}

.sel-key {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 0.95vw, 10px);
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.34);
}

#panel .tiny {
  margin-top: 7px;
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 1vw, 10px);
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.5);
}

.hidden { display: none !important; }

/* --------------------------------------------------------- small screens */

@media (max-width: 680px) {
  .sel-grid { grid-template-columns: 1fr; }
  #select h1 { font-size: clamp(25px, 7.4vw, 38px); }
  .sel-wrap { justify-content: flex-start; padding-top: 6px; }
  .mode-card { padding: 10px 14px; }
  .mc-icon { width: 30px; height: 30px; }
}

@media (max-height: 540px) and (min-width: 681px) {
  .sel-wrap { gap: 5px; }
  #select h1 { font-size: clamp(24px, 4.6vw, 40px); }
  .sel-sub { display: none; }
  .mc-icon { width: 26px; height: 26px; }
  .mc-desc { font-size: 7px; line-height: 1.4; }
  .mode-card { padding: 8px 14px; }
}

@media (max-width: 560px) {
  #badge { width: clamp(64px, 17vw, 92px); }
  #modeName { letter-spacing: 0.04em; }
  .pstars { display: none; }
  #hint { max-width: 46vw; font-size: 7px; }
}

/* ================================================== STEP 3 · SCREENS */

#app:not(.in-game) #hud,
#app:not(.in-game) #controls,
#app:not(.in-game) #clock,
#app:not(.in-game) #roundTag,
#app:not(.in-game) #overlay { display: none !important; }

#roundTag {
  position: absolute;
  z-index: 5;
  top: calc(var(--hud-h) + 30px);
  left: 50%;
  transform: translateX(-50%);
  padding: 2px clamp(8px, 1.1vw, 14px);
  border-radius: 999px;
  background: rgba(14, 11, 20, 0.72);
  border: 1px solid rgba(255, 201, 60, 0.28);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 1vw, 11px);
  letter-spacing: 0.14em;
  color: rgba(255, 228, 92, 0.85);
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(10, 7, 16, 0.95);
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 201, 60, 0.1), transparent 52%),
    radial-gradient(circle at 12% 90%, rgba(62, 200, 255, 0.1), transparent 44%),
    radial-gradient(circle at 88% 82%, rgba(255, 79, 216, 0.08), transparent 44%),
    #08050e;
}

.screen::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 210, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 210, 255, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 40%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 10%, transparent 72%);
}

.menu-screen {
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(8, 5, 14, 0.5) 0%, rgba(8, 5, 14, 0.9) 58%, #08050e 100%),
    radial-gradient(circle at 50% 42%, rgba(255, 79, 216, 0.16), transparent 46%),
    url("assets/bg_space.jpg") center / cover no-repeat,
    #08050e;
}

.menu-wrap {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6vh, 16px);
  text-align: center;
}

.brand-kicker,
.sheet-kicker {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 1vw, 11px);
  letter-spacing: 0.34em;
  color: rgba(255, 228, 92, 0.78);
}

.logo {
  margin: 0;
  display: flex;
  flex-direction: column;
  line-height: 0.82;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  transform: skewX(-5deg);
}

.logo-top {
  font-size: clamp(46px, 9vh, 82px);
  color: #fff;
  letter-spacing: 0.01em;
  text-shadow:
    0 4px 0 #151019,
    0 0 26px rgba(255, 255, 255, 0.35),
    0 0 54px rgba(62, 200, 255, 0.28);
}

.logo-bot {
  font-size: clamp(40px, 7.7vh, 70px);
  color: #ffc93c;
  letter-spacing: 0.05em;
  text-shadow:
    0 4px 0 #151019,
    0 0 22px rgba(255, 201, 60, 0.52),
    0 0 58px rgba(255, 79, 216, 0.24);
}

.gold-band {
  width: 100%;
  padding: clamp(5px, 0.9vh, 9px) 10px;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffe49a, #ffc93c 52%, #c58b0c);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 201, 60, 0.28);
  color: #17111f;
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 1vw, 11px);
  letter-spacing: 0.18em;
}

.menu-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.1vh, 11px);
  padding-top: clamp(2px, 0.8vh, 8px);
}

.menu-item {
  position: relative;
  width: 100%;
  padding: clamp(10px, 1.9vh, 17px) clamp(16px, 3vw, 26px);
  border-radius: 12px;
  border: 2px solid rgba(244, 230, 212, 0.28);
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.07), transparent 46%),
    rgba(22, 16, 32, 0.9);
  color: #fff;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 3.4vh, 31px);
  letter-spacing: 0.05em;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 90ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.menu-item .mi-arrow {
  display: inline-block;
  width: 1.05em;
  margin-right: 0.35em;
  color: #ffc93c;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.menu-item:hover,
.menu-item:focus-visible, .menu-item.kb-sel {
  outline: none;
  border-color: #ffc93c;
  box-shadow: 0 0 0 1px #ffc93c, 0 0 30px rgba(255, 201, 60, 0.32);
}

.menu-item:hover .mi-arrow,
.menu-item:focus-visible .mi-arrow, .menu-item.kb-sel .mi-arrow { opacity: 1; transform: none; }

.menu-item.primary {
  background:
    linear-gradient(180deg, #ffe49a, #ffc93c 55%, #d49a12);
  border-color: #ffe49a;
  color: #17111f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 0 #7a5405, 0 0 34px rgba(255, 201, 60, 0.42);
}

.menu-item.primary .mi-arrow { color: #17111f; }

.menu-item.locked {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.42;
  cursor: not-allowed;
  filter: saturate(0.5);
}

.menu-item.locked em {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  font-family: "Silkscreen", monospace;
  font-style: normal;
  font-size: 0.34em;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.7);
}

.menu-item:active { transform: scale(0.985); }
.menu-item:disabled:active { transform: none; }

.menu-tip {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 1vw, 10px);
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.42);
}

.menu-version {
  min-height: 1em;
  font-family: "Silkscreen", monospace;
  font-size: 8px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.26);
}

/* ------------------------------------------------------------- roster */

.roster-wrap {
  position: relative;
  z-index: 1;
  width: min(100%, 1160px);
  min-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.6vh, 18px);
  text-align: center;
}

.roster-head h2,
.sheet h2,
.podium-wrap h2 {
  margin: 0;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 4.6vw, 48px);
  line-height: 1;
  color: #fff;
  text-shadow: 0 3px 0 #151019, 0 0 24px rgba(255, 228, 92, 0.25);
}

.roster-head p {
  margin: 5px 0 0;
  font-family: "Silkscreen", monospace;
  font-size: clamp(7px, 1vw, 11px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.56);
}

.roster-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(7px, 1.3vw, 15px);
}

.roster-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-radius: 16px;
  border: 2px solid color-mix(in srgb, var(--c) 40%, transparent);
  background: rgba(20, 14, 29, 0.92);
  color: #fff;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 110ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.roster-card:active { transform: scale(0.985); }

.roster-card:focus-visible, .roster-card.kb-sel {
  outline: none;
  box-shadow: 0 0 0 2px var(--c), 0 0 32px color-mix(in srgb, var(--c) 40%, transparent);
}

.roster-card.joined {
  border-color: var(--c);
  box-shadow:
    0 0 0 1px var(--c),
    0 0 34px color-mix(in srgb, var(--c) 42%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.rc-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #120d19;
}

.rc-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  filter: saturate(0.85) brightness(0.82);
  transform: scale(1.02);
  transition: filter 140ms ease, transform 220ms ease;
}

.roster-card.joined .rc-photo img,
.roster-card:hover .rc-photo img {
  filter: saturate(1.05) brightness(1);
  transform: scale(1.06);
}

.rc-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(20, 14, 29, 0.94) 100%);
}

.rc-seat {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(8, 5, 14, 0.82);
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 0.95vw, 11px);
  letter-spacing: 0.06em;
  color: var(--c);
}

.rc-state {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--c);
  color: #17111f;
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(6px, 0.85vw, 10px);
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.roster-card.joined .rc-state { opacity: 1; transform: none; }
.roster-card:not(.joined) .rc-state { background: rgba(8, 5, 14, 0.8); color: rgba(255, 255, 255, 0.62); opacity: 1; transform: none; }

.rc-info {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 6px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rc-name {
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(15px, 2vw, 24px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 0 rgba(8, 5, 14, 0.9);
}

.rc-role {
  font-family: "Silkscreen", monospace;
  font-size: clamp(6px, 0.82vw, 9px);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
}

.rc-ship {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.rc-ship img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 0 5px var(--c));
}

.rc-ship span {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--c);
}

.roster-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 18px);
  flex-wrap: wrap;
}

.roster-count {
  min-width: 120px;
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(8px, 1vw, 11px);
  letter-spacing: 0.14em;
  color: rgba(255, 228, 92, 0.82);
}

.big-btn {
  border: 2px solid rgba(255, 255, 255, 0.26);
  border-radius: 12px;
  padding: clamp(9px, 1.5vh, 14px) clamp(20px, 3.6vw, 34px);
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(15px, 2.3vh, 21px);
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 90ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.big-btn.primary {
  border-color: #ffe49a;
  background: linear-gradient(180deg, #ffe49a, #ffc93c 55%, #d49a12);
  color: #17111f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  box-shadow: 0 3px 0 #7a5405, 0 0 28px rgba(255, 201, 60, 0.4);
}

.big-btn:active { transform: scale(0.965); }
.big-btn:focus-visible, .big-btn.kb-sel { outline: none; border-color: #ffc93c; box-shadow: 0 0 0 2px rgba(255, 201, 60, 0.5); }

.link-btn {
  border: 0;
  background: none;
  color: rgba(62, 200, 255, 0.78);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 1vw, 10px);
  letter-spacing: 0.12em;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 4px 6px;
}

/* --------------------------------------------------------- settings etc */

.sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.8vh, 18px);
  padding: clamp(18px, 3.4vh, 34px);
  border-radius: 22px;
  border: 2px solid rgba(244, 230, 212, 0.18);
  background:
    linear-gradient(150deg, rgba(255, 201, 60, 0.07), transparent 46%),
    rgba(20, 14, 29, 0.96);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sheet.wide { width: min(100%, 760px); }
.sheet.narrow { width: min(100%, 400px); align-items: stretch; text-align: center; }

.sheet h2 { font-size: clamp(28px, 4.2vw, 44px); }

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(16px, 2.2vh, 21px);
  color: #fff;
}

.set-row.column { flex-direction: column; align-items: stretch; gap: 8px; }

.toggle {
  min-width: 92px;
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 5, 14, 0.66);
  color: rgba(255, 255, 255, 0.6);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.toggle.on {
  background: #6cff5a;
  border-color: #6cff5a;
  color: #10220d;
  box-shadow: 0 0 18px rgba(108, 255, 90, 0.35);
}

#setVol {
  width: 100%;
  accent-color: #ffc93c;
  cursor: pointer;
}

.sheet-note {
  margin: 0;
  font-family: "Silkscreen", monospace;
  font-size: clamp(7px, 1vw, 10px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.44);
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 14px);
}

.how-item {
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.how-item p {
  margin: 5px 0 0;
  font-family: "Silkscreen", monospace;
  font-size: clamp(7px, 1vw, 10px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
}

.how-key {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 201, 60, 0.16);
  border: 1px solid rgba(255, 201, 60, 0.44);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #ffe49a;
}

/* ------------------------------------------------------------- podium */

.podium-wrap {
  position: relative;
  z-index: 1;
  width: min(100%, 1000px);
  min-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vh, 22px);
  text-align: center;
}

.podium-wrap h2 {
  font-family: "Impact Num", "Jersey 10", sans-serif;
  font-size: clamp(52px, 9vw, 96px);
  color: #ffc93c;
  text-shadow: 0 4px 0 #151019, 0 0 32px rgba(255, 201, 60, 0.55);
}

.podium-steps {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(6px, 1.2vw, 14px);
}

.podium-step {
  position: relative;
  flex: 1 1 0;
  max-width: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: clamp(8px, 1.2vh, 13px) 8px clamp(10px, 1.6vh, 16px);
  border-radius: 15px 15px 8px 8px;
  border: 2px solid color-mix(in srgb, var(--c) 50%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--c) 26%, transparent), transparent 62%),
    rgba(20, 14, 29, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 34px rgba(0, 0, 0, 0.4);
}

.podium-step.first {
  order: 2;
  transform: translateY(0);
  box-shadow:
    0 0 0 2px var(--c),
    0 0 44px color-mix(in srgb, var(--c) 50%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.podium-step.second { order: 1; }
.podium-step.third { order: 3; }
.podium-step.fourth { order: 4; }

.podium-step img.ps-photo {
  width: clamp(56px, 10vh, 104px);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 22%;
  border: 3px solid var(--c);
  box-shadow: 0 0 24px color-mix(in srgb, var(--c) 55%, transparent);
}

.podium-step.first img.ps-photo {
  width: clamp(70px, 13vh, 132px);
  border-color: #ffc93c;
  box-shadow: 0 0 34px rgba(255, 201, 60, 0.65);
}

.ps-crown {
  position: absolute;
  top: -14px;
  font-size: clamp(20px, 3.4vh, 30px);
  filter: drop-shadow(0 0 10px rgba(255, 201, 60, 0.9));
}

.ps-rank {
  font-family: "Impact Num", "Jersey 10", sans-serif;
  font-size: clamp(25px, 4.6vh, 40px);
  line-height: 0.9;
  color: var(--c);
}

.ps-name {
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(12px, 1.9vh, 19px);
  line-height: 1.05;
  color: #fff;
}

.ps-tag {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
}

.ps-stars {
  font-family: "Silkscreen", monospace;
  font-size: clamp(10px, 1.5vh, 14px);
  letter-spacing: 0.02em;
  color: #ffc93c;
  text-shadow: 0 0 10px rgba(255, 201, 60, 0.65);
}

.podium-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.podium-countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid rgba(255, 201, 60, 0.55);
  background: rgba(20, 14, 24, 0.72);
  color: #ffe49a;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: clamp(12px, 2vh, 18px);
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 201, 60, 0.6);
  box-shadow: 0 0 22px rgba(255, 201, 60, 0.18);
  animation: podiumCdPulse 1s ease-in-out infinite;
}

.podium-countdown span {
  color: #ffffff;
  font-size: 1.22em;
}

@keyframes podiumCdPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* -------------------------------------------------- round interstitial */

#roundCard {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 48%, rgba(14, 11, 20, 0.55), rgba(8, 5, 14, 0.84));
  backdrop-filter: blur(2px);
}

.rc-inner {
  width: min(88vw, 470px);
  padding: clamp(18px, 3vh, 30px) clamp(18px, 3vw, 32px);
  border-radius: 22px;
  border: 6px solid #f4e6d4;
  background: #161020;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 46px rgba(255, 201, 60, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.rc-kicker {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(8px, 1vw, 11px);
  letter-spacing: 0.2em;
  color: rgba(255, 228, 92, 0.78);
}

.rc-title {
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 4vh, 36px);
  line-height: 1.02;
  color: #fff;
  text-shadow: 0 3px 0 #0e0b14, 0 0 20px rgba(255, 255, 255, 0.22);
}

.rc-stars {
  font-family: "Silkscreen", monospace;
  font-size: clamp(20px, 3.2vh, 30px);
  letter-spacing: 0.06em;
  color: #ffc93c;
  text-shadow: 0 0 16px rgba(255, 201, 60, 0.7);
  min-height: 1.1em;
}

.rc-next {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(8px, 1.1vw, 12px);
  line-height: 1.5;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.62);
}

#rcSkip {
  margin-top: 6px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  padding: 7px 18px;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(14px, 2vh, 18px);
  cursor: pointer;
}

#pause {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  background: rgba(8, 5, 14, 0.8);
  backdrop-filter: blur(3px);
  padding: 16px;
}

#pause .big-btn { width: 100%; }

.menu-item[disabled] { pointer-events: none; }

/* ------------------------------------------------------ responsive */

@media (max-width: 760px) {
  .roster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roster-wrap { justify-content: flex-start; }
  .how-grid { grid-template-columns: 1fr; }
  .podium-step { max-width: none; }
  .podium-step img.ps-photo { width: clamp(48px, 12vw, 78px); }
  .podium-step.first img.ps-photo { width: clamp(60px, 16vw, 94px); }
}

@media (max-height: 620px) and (min-width: 761px) {
  .menu-wrap { gap: 7px; }
  .logo-top { font-size: clamp(38px, 9vh, 62px); }
  .logo-bot { font-size: clamp(32px, 7.8vh, 54px); }
  .menu-item { padding: 8px 18px; font-size: clamp(17px, 3vh, 24px); }
  .roster-wrap { gap: 7px; }
  .roster-head p { display: none; }
  .rc-photo { aspect-ratio: 1.18 / 1; }
  .rc-info { padding: 4px 9px 8px; }
}

@media (max-width: 420px) {
  .menu-wrap { gap: 7px; }
  .menu-item { padding: 10px 14px; }
  .roster-head p { font-size: 7px; }
  .roster-foot .big-btn { padding: 8px 14px; font-size: 14px; }
  .rc-role { display: none; }
}

/* championship stars in the HUD */
.pstars.won {
  color: #ffc93c;
  text-shadow: 0 1px 0 rgba(10, 7, 16, 0.95), 0 0 10px rgba(255, 201, 60, 0.72);
}
.pstars.champ {
  color: #fff6c8;
  text-shadow: 0 1px 0 rgba(10, 7, 16, 0.95), 0 0 16px rgba(255, 201, 60, 0.95);
}

.podium-step.winner {
  background:
    linear-gradient(180deg, rgba(255, 201, 60, 0.24), transparent 64%),
    rgba(28, 20, 38, 0.98);
}

.podium-step.winner .ps-name { color: #ffe49a; }

/* ============================================ 2026-11-05 · GAME FEEL PASS */

/* ---------------------------------------------------------- briefing */
#briefing {
  position: absolute;
  inset: 0;
  z-index: 26;
  display: grid;
  place-items: center;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: radial-gradient(circle at 50% 46%, rgba(10, 7, 16, 0.42), rgba(6, 4, 10, 0.86));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  touch-action: none;
}

.br-card {
  width: min(94vw, 540px);
  max-height: calc(100% - 8px);
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: clamp(13px, 2.3vh, 24px) clamp(15px, 3vw, 28px);
  border-radius: 22px;
  border: 3px solid rgba(244, 230, 212, 0.22);
  background:
    linear-gradient(160deg, rgba(255, 201, 60, 0.08), transparent 42%),
    rgba(18, 12, 27, 0.97);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.62), 0 0 46px color-mix(in srgb, var(--br-c, #FFC93C) 22%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(5px, 1vh, 10px);
  text-align: center;
  --br-c: #FFC93C;
}

.br-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.br-kicker {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 0.95vw, 10px);
  letter-spacing: 0.28em;
  color: rgba(255, 228, 92, 0.82);
}

.br-arena {
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--br-c) 45%, transparent);
  background: color-mix(in srgb, var(--br-c) 15%, transparent);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(6px, 0.85vw, 9px);
  letter-spacing: 0.12em;
  color: color-mix(in srgb, var(--br-c) 90%, #ffffff);
}

.br-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 14px);
}

.br-icon {
  display: block;
  width: clamp(30px, 5.4vh, 46px);
  height: clamp(30px, 5.4vh, 46px);
  color: var(--br-c);
  flex: 0 0 auto;
}
.br-icon svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 9px currentColor); }

#brTitle {
  margin: 0;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(25px, 4.6vh, 42px);
  line-height: 0.95;
  color: var(--br-c);
  text-shadow: 0 3px 0 #120c1b, 0 0 24px color-mix(in srgb, var(--br-c) 48%, transparent);
}

.br-how {
  margin: 0;
  max-width: 48ch;
  font-family: "Silkscreen", monospace;
  font-size: clamp(8px, 1.1vw, 11px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.br-players {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 8px;
  margin-top: 2px;
}

.brp {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 54px;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
  overflow: hidden;
}

.brp-tag {
  width: auto;
  min-width: 20px;
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 0.95vw, 10px);
  color: var(--brp-c, #fff);
  text-align: left;
}

.brp-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Silkscreen", monospace;
  font-size: clamp(6px, 0.82vw, 9px);
  color: rgba(255, 255, 255, 0.54);
  text-align: left;
}

.brp-key {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(5px, 0.72vw, 8px);
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
}
.brp-bar {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.brp-bar i {
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  transition: transform 0.26s ease-out;
  background: linear-gradient(90deg, color-mix(in srgb, var(--brp-c, #fff) 60%, #120c1b), var(--brp-c, #fff));
  border-radius: inherit;
}
.brp.done { border-color: color-mix(in srgb, var(--brp-c, #fff) 52%, transparent); background: color-mix(in srgb, var(--brp-c, #fff) 9%, transparent); }
.brp.done .brp-name { color: color-mix(in srgb, var(--brp-c, #fff) 84%, #ffffff); }
.brp.focus { border-color: color-mix(in srgb, var(--brp-c, #fff) 46%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--brp-c, #fff) 22%, transparent); background: color-mix(in srgb, var(--brp-c, #fff) 7%, transparent); }

#readyBtn {
  position: relative;
  width: 100%;
  min-height: clamp(52px, 8.4vh, 70px);
  margin-top: clamp(2px, 0.8vh, 6px);
  padding: 0 16px;
  border-radius: 14px;
  border: 2px solid #ffe49a;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
  background: linear-gradient(180deg, #ffe49a, #ffc93c 55%, #c58b0c);
  color: #17111f;
  box-shadow: 0 4px 0 #7a5405, 0 0 30px rgba(255, 201, 60, 0.4);
  transition: transform 80ms ease, filter 120ms ease;
}
#readyBtn:active { transform: scale(0.985); }
#readyBtn .rb-fill {
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, #6cff5a, #b8ff8e 60%, #ffffff);
  box-shadow: 0 0 24px rgba(108, 255, 90, 0.6);
  transition: transform 0.26s ease-out;
}
#readyBtn .rb-label,
#readyBtn .rb-sub {
  position: relative;
  z-index: 1;
  display: block;
}
#readyBtn .rb-label {
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(16px, 2.4vh, 23px);
  letter-spacing: 0.03em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
#readyBtn .rb-sub {
  margin-top: -1px;
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 0.95vw, 10px);
  letter-spacing: 0.11em;
  color: rgba(23, 17, 31, 0.64);
}
#readyBtn.done {
  filter: saturate(1.15);
  box-shadow: 0 4px 0 #2f6a1e, 0 0 36px rgba(108, 255, 90, 0.6);
  pointer-events: none;
}
#readyBtn.done .rb-label { opacity: 0; }
#readyBtn.done::after {
  content: "READY!";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 2.8vh, 26px);
  color: #10220d;
  letter-spacing: 0.06em;
}
#readyBtn .rb-fill { z-index: 0; }

#brQuit { margin-top: 1px; color: rgba(255, 255, 255, 0.5); }
#brQuit:hover { color: #fff; }

#app:not(.in-game) #briefing { display: none !important; }

/* ------------------------------------------------------ dash cooldown */
#dash.cooling {
  opacity: 0.62;
  filter: saturate(0.45);
  box-shadow:
    0 0 0 3px rgba(255, 228, 92, 0.18),
    0 0 18px rgba(255, 228, 92, 0.16),
    inset 0 -4px 0 rgba(126, 88, 0, 0.35);
}
#dash.ready {
  animation: dashReady 1.3s ease-in-out infinite;
}
@keyframes dashReady {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 228, 92, 0.42), 0 0 26px rgba(255, 228, 92, 0.4), inset 0 -4px 0 rgba(126, 88, 0, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(255, 228, 92, 0.6), 0 0 44px rgba(255, 228, 92, 0.72), inset 0 -4px 0 rgba(126, 88, 0, 0.35); }
}

/* ------------------------------------------------------- roster picks */
.roster-players {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(6px, 1vw, 12px);
  padding: 7px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.roster-card.pickable {
  border-color: color-mix(in srgb, var(--c) 62%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 38%, transparent), 0 0 26px color-mix(in srgb, var(--c) 18%, transparent);
}
.roster-card.pickable .rc-state { background: var(--c); color: #17111f; opacity: 1; transform: none; }
.roster-card.taken { cursor: pointer; }
.roster-card.locked-pick {
  opacity: 0.42;
  filter: saturate(0.35) brightness(0.8);
  cursor: not-allowed;
}
.roster-card.locked-pick .rc-photo img { filter: grayscale(0.8) brightness(0.7); }
.roster-card.joined .rc-state { background: var(--c); color: #17111f; opacity: 1; transform: none; }

/* ------------------------------------------------------------- menu */
.menu-screen { overflow: hidden; }
.menu-stars {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,0.8) 0 1px, transparent 1.6px),
    radial-gradient(circle at 74% 12%, rgba(143,212,255,0.9) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 38% 66%, rgba(255,79,216,0.75) 0 1px, transparent 1.6px),
    radial-gradient(circle at 86% 74%, rgba(255,228,92,0.85) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 55% 38%, rgba(255,255,255,0.6) 0 1px, transparent 1.5px);
  background-size: 240px 240px, 320px 320px, 280px 280px, 360px 360px, 200px 200px;
  opacity: 0.7;
  animation: starDrift 42s linear infinite;
}
@keyframes starDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-90px, 60px, 0); }
}

.menu-wrap.arcade {
  width: min(100%, 1080px);
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.94fr);
  align-items: center;
  gap: clamp(16px, 3vw, 44px);
  text-align: left;
}

.menu-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(7px, 1.2vh, 12px);
  min-width: 0;
}

.menu-brand .gold-band { max-width: 430px; }
.menu-brand .logo { align-self: flex-start; }

.menu-tagline {
  margin: 0;
  font-family: "Silkscreen", monospace;
  font-size: clamp(8px, 1.1vw, 12px);
  line-height: 1.55;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.56);
}

.menu-roster-strip {
  position: relative;
  width: min(100%, 430px);
  height: clamp(58px, 10vh, 90px);
  margin-top: clamp(16px, 3.2vh, 30px);
}
.mrs-ship {
  position: absolute;
  top: 54%;
  display: grid;
  place-items: center;
  width: clamp(38px, 5.4vw, 62px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.08), transparent 70%);
  animation: mrsFloat 3.4s ease-in-out infinite;
}
.mrs-ship img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 9px currentColor); }
.mrs-1 { left: 4%; color: #6cff5a; transform: translateY(-50%) rotate(-7deg); animation-delay: 0s; }
.mrs-2 { left: 29%; color: #ff4fd8; transform: translateY(-50%) rotate(5deg); animation-delay: 0.4s; }
.mrs-3 { left: 56%; color: #ffe45c; transform: translateY(-50%) rotate(-4deg); animation-delay: 0.8s; }
.mrs-4 { left: 82%; color: #3ec8ff; transform: translateY(-50%) rotate(8deg); animation-delay: 1.2s; }
@keyframes mrsFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}

.menu-panel {
  width: 100%;
  padding: clamp(12px, 2vh, 20px);
  border-radius: 22px;
  border: 2px solid rgba(244, 230, 212, 0.18);
  background:
    linear-gradient(150deg, rgba(255, 201, 60, 0.08), transparent 46%),
    rgba(16, 11, 24, 0.9);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 13px);
}

.menu-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mp-insert {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(7px, 0.95vw, 10px);
  letter-spacing: 0.26em;
  color: #ff4fd8;
  animation: insertBlink 1.6s steps(2, start) infinite;
}
@keyframes insertBlink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.25; } }
.mp-dots { display: flex; gap: 4px; }
.mp-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: #6cff5a; box-shadow: 0 0 7px #6cff5a;
  animation: dotBlink 1.2s ease-in-out infinite;
}
.mp-dots i:nth-child(2) { background: #ffe45c; box-shadow: 0 0 7px #ffe45c; animation-delay: 0.2s; }
.mp-dots i:nth-child(3) { background: #3ec8ff; box-shadow: 0 0 7px #3ec8ff; animation-delay: 0.4s; }
@keyframes dotBlink { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

.menu-wrap.arcade .menu-list { padding-top: 0; }

.play-big {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 18px);
  padding: clamp(12px, 2.2vh, 20px) clamp(14px, 2.4vw, 24px);
  overflow: hidden;
}
.play-big .play-tri {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: clamp(38px, 6.4vh, 54px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #17111f;
  color: #ffe49a;
  font-size: clamp(14px, 2.4vh, 20px);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35);
}
.play-copy { position: relative; z-index: 2; display: flex; flex-direction: column; line-height: 0.92; }
.play-word { font-family: "Pixelify Sans", sans-serif; font-weight: 700; font-size: clamp(32px, 6vh, 54px); letter-spacing: 0.02em; }
.play-sub { font-family: "Silkscreen", monospace; font-weight: 700; font-size: clamp(7px, 0.95vw, 10px); letter-spacing: 0.16em; color: rgba(23, 17, 31, 0.66); }
.play-shine {
  position: absolute;
  top: -60%;
  bottom: -60%;
  left: -35%;
  width: 34%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  transform: skewX(-18deg);
  animation: playShine 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes playShine {
  0%, 62% { left: -40%; opacity: 0; }
  68% { opacity: 0.9; }
  88%, 100% { left: 120%; opacity: 0; }
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, 1.1vh, 10px);
}
.menu-wrap.arcade .tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: clamp(48px, 7.4vh, 66px);
  padding: clamp(8px, 1.5vh, 14px) clamp(10px, 1.6vw, 16px);
  border-radius: 12px;
  border: 2px solid rgba(244, 230, 212, 0.22);
  background: linear-gradient(150deg, rgba(255,255,255,0.06), transparent 55%), rgba(22, 16, 32, 0.92);
  font-size: clamp(13px, 1.9vh, 19px);
  letter-spacing: 0.03em;
  text-align: left;
}
.menu-wrap.arcade .tile.wide { grid-column: 1 / -1; }
.tile-word { font-family: "Pixelify Sans", sans-serif; font-weight: 700; }
.tile-sub { font-family: "Silkscreen", monospace; font-weight: 700; font-size: clamp(6px, 0.8vw, 8px); letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.4); }
.menu-wrap.arcade .tile em {
  align-self: flex-start;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  font-family: "Silkscreen", monospace;
  font-style: normal;
  font-size: clamp(6px, 0.78vw, 8px);
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.66);
}
.menu-wrap.arcade .menu-tip { text-align: center; }
.menu-wrap.arcade .menu-version { text-align: center; }

@media (max-width: 900px) {
  .menu-wrap.arcade {
    grid-template-columns: 1fr;
    width: min(100%, 540px);
    text-align: center;
    gap: clamp(10px, 2vh, 18px);
  }
  .menu-brand { align-items: center; }
  .menu-brand .logo { align-self: center; }
  .menu-brand .gold-band { width: 100%; }
  .menu-roster-strip { width: min(100%, 360px); }
  .menu-panel { text-align: left; }
}

@media (max-width: 700px) and (orientation: portrait) {
  .menu-screen { align-content: start; }
  .menu-wrap.arcade { padding-top: 2vh; gap: 10px; }
  .brand-kicker { font-size: 7px; }
  .logo-top { font-size: clamp(42px, 13vw, 66px); }
  .logo-bot { font-size: clamp(36px, 11vw, 56px); }
  .menu-roster-strip { height: 58px; }
  .menu-tagline { font-size: 7.5px; }
  .play-word { font-size: clamp(30px, 10vw, 44px); }
  .menu-panel { padding: 10px; }
  .menu-grid { grid-template-columns: 1fr; }
  .menu-wrap.arcade .tile.wide { grid-column: auto; }
}

@media (max-height: 520px) and (min-width: 720px) {
  .menu-wrap.arcade { gap: 18px; }
  .menu-brand { gap: 5px; }
  .logo-top { font-size: clamp(34px, 8.4vh, 54px); }
  .logo-bot { font-size: clamp(29px, 7.2vh, 46px); }
  .menu-roster-strip { display: none; }
  .menu-panel { padding: 10px; gap: 7px; }
  .play-big { padding: 9px 14px; }
  .play-word { font-size: clamp(26px, 5.4vh, 40px); }
  .menu-wrap.arcade .tile { min-height: 40px; padding: 6px 10px; font-size: clamp(11px, 1.8vh, 16px); }
  .menu-tip { display: none; }
  .br-card { max-height: calc(100% - 2px); }
}

@media (max-height: 430px) {
  .br-players { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brp { grid-template-columns: auto auto minmax(0, 1fr); }
  .brp-name { display: none; }
  .br-how { font-size: 7px; line-height: 1.4; }
  #brTitle { font-size: clamp(20px, 4.4vh, 30px); }
  .br-icon { width: 26px; height: 26px; }
}


.player-hint.warn {
  color: #ff8bd8;
  text-shadow: 0 0 12px rgba(255, 79, 216, 0.7);
}

@media (max-width: 560px) and (orientation: portrait) {
  #hint {
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 118px);
    max-width: 82vw;
    font-size: 7px;
  }
  #roundTag { top: calc(var(--hud-h) + 26px); font-size: 6.5px; }
  #clock { top: calc(var(--hud-h) + 2px); }
  .br-card { width: min(96vw, 500px); }
  .br-players { grid-template-columns: 1fr; }
}

/* Portrait briefing: dock the card at the bottom so the ships stay in view
   while the camera showcases each pilot. */
@media (orientation: portrait) {
  #briefing {
    place-items: end center;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(6, 4, 10, 0.04) 0%, rgba(6, 4, 10, 0.18) 46%, rgba(6, 4, 10, 0.9) 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .br-card {
    width: min(calc(100% - 16px), 540px);
    max-height: 54vh;
    padding: 11px 13px;
    gap: 5px;
  }
  #brTitle { font-size: clamp(22px, 4.4vh, 36px); }
  .br-how { font-size: clamp(7.5px, 1.15vw, 10px); line-height: 1.5; }
  .br-players { grid-template-columns: 1fr; gap: 4px; }
}

/* Landscape briefing: a side panel, so the arena stays in view. */
@media (orientation: landscape) and (min-width: 600px) {
  #briefing {
    place-items: center start;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: 0;
    background: linear-gradient(90deg, rgba(6, 4, 10, 0.92) 0%, rgba(6, 4, 10, 0.74) 32%, rgba(6, 4, 10, 0.18) 52%, rgba(6, 4, 10, 0) 74%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .br-card {
    width: min(42vw, 430px);
    max-height: calc(100% - 10px);
    text-align: left;
    align-items: stretch;
    gap: 6px;
  }
  .br-title-row { justify-content: flex-start; }
  #brTitle { font-size: clamp(22px, 4.2vh, 34px); }
  .br-how { text-align: left; max-width: none; font-size: clamp(7px, 1vw, 10px); line-height: 1.45; }
  .br-players { grid-template-columns: 1fr; gap: 4px; }
  .brp { grid-template-columns: auto minmax(0, 1fr) auto 54px; }
  .brp-name { display: block; }
  #readyBtn { text-align: center; }
  .br-kicker, .br-arena { font-size: clamp(6px, 0.85vw, 9px); }
}

/* Briefing dock: once the player starts holding READY, the big panel
   gets out of the way and the live arena fills the screen. */
#briefing.collapsed {
  place-items: start center;
  padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
}
#app.briefing-dock #hud,
#app.briefing-dock #clock,
#app.briefing-dock #roundTag {
  opacity: 0;
  pointer-events: none;
}
#briefing.collapsed .br-card {
  width: min(96vw, 860px);
  max-height: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 240px);
  grid-template-areas: "players ready";
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-width: 2px;
  border-radius: 14px;
  background: rgba(18, 12, 27, 0.88);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  text-align: left;
}
#briefing.collapsed .br-top,
#briefing.collapsed .br-title-row,
#briefing.collapsed .br-how,
#briefing.collapsed #brQuit { display: none; }
#briefing.collapsed .br-players {
  grid-area: players;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 7px;
  margin: 0;
}
#briefing.collapsed .brp {
  grid-template-columns: auto minmax(0, 1fr) auto 54px;
  padding: 3px 6px;
}
#briefing.collapsed .brp-name { display: none; }
#briefing.collapsed #readyBtn {
  grid-area: ready;
  width: 100%;
  min-height: 48px;
  margin: 0;
  text-align: center;
}
#briefing.collapsed #readyBtn .rb-label { font-size: clamp(12px, 1.9vh, 18px); }
#briefing.collapsed #readyBtn .rb-sub { display: none; }
@media (max-width: 560px) {
  #briefing.collapsed .br-card {
    grid-template-columns: 1fr;
    grid-template-areas: "players" "ready";
    gap: 6px;
  }
  #briefing.collapsed .br-players { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------ ability B + multiplayer */
#ability {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + clamp(94px, 15.5vh, 142px) + 10px);
  width: clamp(62px, 10vh, 88px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 0;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  color: #0e0b14;
  background: radial-gradient(circle at 42% 34%, #ffffff, #b68cff 40%, #6b3fd1 100%);
  border: 3px solid rgba(14, 11, 20, 0.72);
  box-shadow: 0 0 0 3px rgba(182, 140, 255, 0.32), 0 0 28px rgba(182, 140, 255, 0.5), inset 0 -4px 0 rgba(60, 32, 110, 0.5);
  animation: abilityPulse 1.1s ease-in-out infinite;
}
#ability:active { transform: scale(0.92); }
.ab-cap { display: block; font-family: "Pixelify Sans", sans-serif; font-weight: 900; font-size: 28px; line-height: 1; }
.ab-sub { display: block; margin-top: 2px; font-family: "Silkscreen", monospace; font-size: 8px; letter-spacing: .08em; }
#ability.has-shield { background: radial-gradient(circle at 34% 30%, #ffffff, #8fd8ff 42%, #2475c8 100%); box-shadow: 0 0 0 3px rgba(143, 216, 255, .4), 0 0 32px rgba(143, 216, 255, .65); }
#ability.has-laser { background: radial-gradient(circle at 34% 30%, #ffffff, #ff9bd6 42%, #c4218b 100%); box-shadow: 0 0 0 3px rgba(255, 79, 216, .4), 0 0 32px rgba(255, 79, 216, .65); }
#ability.has-bomb { background: radial-gradient(circle at 34% 30%, #ffffff, #ffc48a 42%, #c45a1c 100%); box-shadow: 0 0 0 3px rgba(255, 155, 74, .4), 0 0 32px rgba(255, 155, 74, .65); }
@keyframes abilityPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.16); }
}

.multi-sheet { max-width: 560px; }
.mp-status {
  margin: 6px 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(143, 212, 255, 0.3);
  color: #d9f4ff;
  font-family: "Silkscreen", monospace;
  font-size: clamp(10px, 1.8vw, 13px);
  letter-spacing: .06em;
  text-align: center;
}
.mp-status.bad { border-color: rgba(255, 79, 216, .55); color: #ffd0f2; }
.mp-actions { display: grid; gap: 8px; }
.mp-linkbox {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 228, 92, 0.3);
}
.mp-linkbox span { font-family: "Silkscreen", monospace; font-size: 9px; letter-spacing: .1em; color: rgba(255,255,255,.6); white-space: nowrap; }
.mp-linkbox input { flex: 1 1 auto; min-width: 0; padding: 6px 8px; border-radius: 5px; border: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.35); color: #fff; font-family: "Silkscreen", monospace; font-size: 10px; }
.mp-linkbox button { flex: 0 0 auto; padding: 6px 10px; border-radius: 5px; border: 0; background: #FFE45C; color: #17111f; font-family: "Pixelify Sans", sans-serif; font-weight: 700; cursor: pointer; }
.mp-identity {
  margin: 2px 0 8px;
  font-family: "Silkscreen", monospace;
  font-size: clamp(9px, 1.6vw, 12px);
  letter-spacing: .08em;
  text-align: center;
  color: #9fe6ff;
  text-shadow: 0 0 12px rgba(143, 212, 255, .4);
}
#mpWarn {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 4, 10, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
#mpWarn.hidden { display: none !important; }
.warn-note { color: #ffd86b; }
.mp-size {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 2px 0 8px;
}
.mp-size > span {
  font-family: "Silkscreen", monospace;
  font-size: 10px;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .65);
}
.mp-size-btns { display: inline-flex; gap: 6px; }
.mp-size-btns button {
  min-width: 42px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(143, 212, 255, .35);
  background: rgba(0, 0, 0, .32);
  color: #d9f4ff;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.mp-size-btns button.on {
  border-color: #ffe45c;
  color: #17111f;
  background: #ffe45c;
  box-shadow: 0 0 16px rgba(255, 228, 92, .4);
}
@media (max-width: 560px) {
  #ability { bottom: calc(max(22px, env(safe-area-inset-bottom)) + clamp(94px, 15.5vh, 142px) + 6px); }
  .mp-linkbox { flex-wrap: wrap; }
}

#app.mp-game #hud,
#app.mp-game #clock,
#app.mp-game #roundTag,
#app.mp-game #badge { display: none !important; }
#app.mp-game #modesBtn,
#app.mp-game #ability { display: none !important; }
#app.mp-game #hint { bottom: max(10px, env(safe-area-inset-bottom)); }
#mpResult {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(6, 4, 10, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 18px;
}
.mp-result-box {
  width: min(92vw, 420px);
  padding: 20px 18px;
  border-radius: 16px;
  text-align: center;
  background: linear-gradient(180deg, rgba(30, 22, 44, .98), rgba(14, 11, 20, .98));
  border: 1px solid rgba(255, 228, 92, .4);
  box-shadow: 0 0 40px rgba(255, 228, 92, .18);
}
.mp-result-kicker { font-family: "Silkscreen", monospace; font-size: 10px; letter-spacing: .16em; color: rgba(255,255,255,.55); }
.mp-result-title { margin: 6px 0 2px; font-family: "Pixelify Sans", sans-serif; font-size: clamp(30px, 8vw, 46px); color: #FFE45C; text-shadow: 0 0 24px rgba(255,228,92,.5); }
.mp-result-sub { margin-bottom: 14px; font-family: "Silkscreen", monospace; font-size: 11px; color: rgba(255,255,255,.72); }

/* ------------------------------------------------------- roulette draw */
#roulette {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 38%, rgba(44, 22, 62, 0.96) 0%, rgba(12, 8, 20, 0.98) 58%, rgba(5, 4, 9, 1) 100%);
}
#roulette.hidden { display: none !important; }
.rl-box {
  width: min(800px, 94vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.2vh, 14px);
  text-align: center;
}
.rl-kicker {
  font-family: "Silkscreen", monospace;
  font-size: clamp(7px, 1.5vw, 11px);
  letter-spacing: 0.24em;
  color: #ff8bd8;
  text-shadow: 0 0 14px rgba(255, 79, 216, 0.55);
}
.rl-title {
  margin: 0;
  font-family: "Jersey10", "Pixelify Sans", sans-serif;
  font-size: clamp(28px, 6vw, 56px);
  line-height: 0.95;
  letter-spacing: 0.03em;
  color: #fff;
  text-shadow: 0 0 22px rgba(143, 212, 255, 0.55);
}
.rl-die {
  width: clamp(40px, 7vh, 58px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 2px solid rgba(244, 230, 212, 0.5);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(315deg, #2a1735, #120d1b);
  box-shadow: 0 0 0 1px rgba(255, 201, 60, 0.18), 0 8px 22px rgba(0, 0, 0, 0.45);
  font-family: "Jersey10", "Pixelify Sans", sans-serif;
  font-size: clamp(24px, 4.4vh, 38px);
  line-height: 1;
  color: #ffe49a;
  text-shadow: 0 0 16px rgba(255, 201, 60, 0.75);
  transform-origin: 50% 55%;
}
.rl-die.rolling { animation: rlDieRoll 0.16s linear infinite; }
.rl-die.won {
  color: #fff;
  border-color: #ffe49a;
  box-shadow: 0 0 0 2px rgba(255, 228, 92, 0.4), 0 0 34px rgba(255, 201, 60, 0.55);
  animation: rlDieWin 0.55s ease both;
}
@keyframes rlDieRoll {
  0% { transform: rotate(-9deg) scale(1); }
  50% { transform: rotate(9deg) scale(1.08); }
  100% { transform: rotate(-9deg) scale(1); }
}
@keyframes rlDieWin {
  0% { transform: scale(1.25) rotate(-6deg); filter: brightness(1.6); }
  55% { transform: scale(0.96) rotate(3deg); }
  100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
}
@media (max-height: 460px) {
  .rl-die { display: none; }
}

.rl-tiles {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1.3vw, 16px);
}
.rl-tile {
  position: relative;
  min-height: clamp(88px, 20vh, 156px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(26, 18, 38, 0.94), rgba(11, 8, 18, 0.94));
  opacity: 0.4;
  transform: scale(0.96);
  transition: opacity 0.1s linear, transform 0.1s linear, box-shadow 0.1s linear, border-color 0.1s linear;
}
.rl-tile .rl-glyph {
  font-family: "Jersey10", "Pixelify Sans", sans-serif;
  font-size: clamp(22px, 4.6vw, 42px);
  line-height: 1;
  color: var(--c);
  text-shadow: 0 0 18px var(--c);
}
.rl-tile .rl-name {
  font-family: "Silkscreen", monospace;
  font-size: clamp(6.5px, 1.25vw, 11px);
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: #f4e6d4;
}
.rl-tile .rl-tag {
  font-family: "Pixelify Sans", sans-serif;
  font-size: clamp(8px, 1.4vw, 13px);
  color: var(--c);
  letter-spacing: 0.05em;
}
.rl-tile.active {
  opacity: 1;
  transform: scale(1.05);
  border-color: var(--c);
  box-shadow: 0 0 0 1px var(--c), 0 0 30px var(--c);
}
.rl-tile.won {
  opacity: 1;
  transform: scale(1.08);
  border-color: var(--c);
  box-shadow: 0 0 0 2px var(--c), 0 0 48px var(--c);
  animation: rl-win 0.55s ease both;
}
@keyframes rl-win {
  0% { transform: scale(1.16); filter: brightness(1.5); }
  100% { transform: scale(1.08); filter: brightness(1); }
}
.rl-result {
  min-height: 1.4em;
  font-family: "Pixelify Sans", sans-serif;
  font-size: clamp(12px, 2.2vw, 20px);
  color: rgba(244, 230, 212, 0.72);
  letter-spacing: 0.05em;
}
.rl-result strong {
  color: #ffe49a;
  font-weight: 700;
  text-shadow: 0 0 18px rgba(255, 201, 60, 0.7);
}
@media (max-width: 560px), (max-height: 500px) {
  .rl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rl-tile { min-height: clamp(66px, 13vh, 104px); }
  .rl-title { font-size: clamp(24px, 7vw, 38px); }
}
@media (orientation: landscape) and (max-height: 460px) {
  .rl-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rl-tile { min-height: 64px; }
  .rl-title { font-size: clamp(22px, 5.4vh, 34px); }
  .rl-result { font-size: 12px; }
}

/* ============================================================ VHS / CRT */
#app::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.16) 0px,
      rgba(0, 0, 0, 0.16) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(circle at 50% 50%, transparent 52%, rgba(0, 0, 0, 0.38) 100%);
  mix-blend-mode: multiply;
  opacity: 0.55;
}
#app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 94;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 0, 80, 0.025), transparent 18%, transparent 82%, rgba(0, 220, 255, 0.025)),
    radial-gradient(ellipse at 50% -20%, rgba(255, 255, 255, 0.06), transparent 55%);
  animation: crtFlicker 7s steps(24, end) infinite;
}
@keyframes crtFlicker {
  0%, 92%, 100% { opacity: 0.9; }
  93% { opacity: 0.55; }
  94% { opacity: 1; }
  95% { opacity: 0.7; }
  96% { opacity: 0.95; }
}
.screen { animation: screenIn 280ms ease both; }
.screen.hidden { animation: none; }
@keyframes screenIn {
  0% { opacity: 0; transform: scale(1.015) translateY(5px); filter: brightness(1.5) saturate(1.2); }
  55% { opacity: 1; filter: brightness(1.08) saturate(1.05); }
  100% { opacity: 1; transform: none; filter: none; }
}

/* ============================================================ TAPE MENU */
.menu-screen {
  display: block;
  overflow: hidden;
  padding: 0;
  background: #100d0c;
}
.menu-art {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 6, 8, 0.12), rgba(9, 6, 8, 0.18) 48%, rgba(9, 6, 8, 0.62) 100%),
    url("assets/menu_art.webp") center / cover no-repeat;
  filter: saturate(0.92) contrast(1.03);
  transform: scale(1.02);
  animation: menuArtDrift 22s ease-in-out infinite alternate;
}
@keyframes menuArtDrift {
  from { transform: scale(1.02) translate3d(-0.5%, 0, 0); }
  to { transform: scale(1.06) translate3d(0.8%, -0.6%, 0); }
}
.menu-vhs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(255, 0, 90, 0.05), transparent 16%, transparent 84%, rgba(0, 220, 255, 0.05));
  mix-blend-mode: multiply;
  opacity: 0.7;
}
.menu-vhs::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  height: 18%;
  top: -25%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  animation: tapeScan 6.5s linear infinite;
}
@keyframes tapeScan {
  0% { top: -30%; opacity: 0; }
  8% { opacity: 1; }
  50% { opacity: 0.6; }
  92%, 100% { top: 110%; opacity: 0; }
}
.tape-menu {
  position: relative;
  z-index: 2;
  width: min(100%, 1180px);
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(18px, 3vh, 34px) clamp(16px, 4vw, 52px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.82fr);
  align-items: end;
  gap: clamp(18px, 4vw, 56px);
  text-align: left;
}
.tape-menu .menu-brand { align-self: center; gap: clamp(6px, 1.2vh, 12px); }
.tape-menu .logo-top { font-size: clamp(46px, 8.6vh, 96px); }
.tape-menu .logo-bot { font-size: clamp(38px, 7.2vh, 82px); }
.tape-menu .gold-band { max-width: 470px; }
.tape-menu .menu-roster-strip { width: min(100%, 440px); height: clamp(48px, 9vh, 86px); margin-top: clamp(10px, 2vh, 22px); }
.tape-panel {
  width: 100%;
  padding: clamp(10px, 1.8vh, 18px) clamp(10px, 1.6vw, 20px) clamp(14px, 2.2vh, 22px);
  border-radius: 6px;
  border: 1px solid rgba(244, 230, 212, 0.12);
  background:
    linear-gradient(180deg, rgba(30, 24, 22, 0.42), rgba(12, 9, 10, 0.66)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 7px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(2px);
  transform: rotate(-0.35deg);
}
.tape-list {
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 0.9vh, 10px);
  margin: clamp(8px, 1.4vh, 14px) 0 clamp(10px, 1.6vh, 16px);
  padding: 0;
}
.tape {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 15px);
  width: 100%;
  min-height: clamp(46px, 6.6vh, 64px);
  padding: clamp(7px, 1.2vh, 11px) clamp(11px, 1.6vw, 18px);
  border: 0;
  background:
    linear-gradient(96deg, rgba(255, 255, 255, 0.09), transparent 24%, rgba(0, 0, 0, 0.26) 82%),
    linear-gradient(180deg, #201c1b, #111010 55%, #181414);
  color: #f4efe4;
  text-align: left;
  cursor: pointer;
  clip-path: polygon(0.6% 8%, 4% 0, 47% 3%, 98.8% 0, 100% 34%, 99.2% 88%, 96% 100%, 52% 96%, 1.4% 100%, 0 62%);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.11);
  transform: rotate(var(--tape-tilt, 0deg));
  transition: transform 110ms ease, filter 120ms ease, background-color 140ms ease;
}
.tape:nth-child(1) { --tape-tilt: -0.7deg; }
.tape:nth-child(2) { --tape-tilt: 0.45deg; }
.tape:nth-child(3) { --tape-tilt: -0.32deg; }
.tape:nth-child(4) { --tape-tilt: 0.6deg; }
.tape:nth-child(5) { --tape-tilt: -0.45deg; }
.tape::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.07) 0 1px, transparent 1.6px),
    radial-gradient(circle at 74% 72%, rgba(255, 255, 255, 0.05) 0 1px, transparent 1.6px),
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(255, 255, 255, 0.02) 14px 15px);
  mix-blend-mode: screen;
  opacity: 0.9;
}
.tape:hover, .tape:focus-visible, .tape.kb-sel {
  outline: none;
  transform: rotate(0deg) scale(1.012);
  background:
    linear-gradient(96deg, rgba(255, 255, 255, 0.14), transparent 24%, rgba(0, 0, 0, 0.18) 82%),
    linear-gradient(180deg, #b62d31, #7d1218 58%, #921d23);
  filter: saturate(1.1);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 0 26px rgba(182, 45, 49, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.tape.primary {
  background:
    linear-gradient(96deg, rgba(255, 255, 255, 0.13), transparent 22%, rgba(0, 0, 0, 0.2) 82%),
    linear-gradient(180deg, #b62d31, #791016 58%, #921d23);
}
.tape.locked {
  cursor: not-allowed;
  filter: grayscale(0.85) brightness(0.72);
  opacity: 0.6;
}
.tape.locked:hover { transform: rotate(var(--tape-tilt, 0deg)); background: linear-gradient(180deg, #201c1b, #111010 55%, #181414); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.38); }
.tape-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.55em;
  height: 1.55em;
  border-radius: 50%;
  border: 1px solid rgba(244, 239, 228, 0.26);
  color: #f4e6d4;
  font-family: "Jersey10", "Pixelify Sans", sans-serif;
  font-size: clamp(13px, 2.2vh, 20px);
  line-height: 1;
  background: rgba(0, 0, 0, 0.25);
}
.tape-copy { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.tape-text {
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(16px, 2.6vh, 26px);
  letter-spacing: 0.02em;
  line-height: 0.95;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.62), 0 0 12px rgba(255, 255, 255, 0.08);
}
.tape-sub {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(5.5px, 0.8vw, 8px);
  letter-spacing: 0.18em;
  color: rgba(244, 239, 228, 0.46);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tape-badge {
  flex: 0 0 auto;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: clamp(24px, 3.6vh, 34px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f4e6d4;
  color: #8b1118;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 900;
  font-size: clamp(13px, 2.2vh, 20px);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25), 0 0 18px rgba(244, 230, 212, 0.28);
}
.tape-lock {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid rgba(244, 230, 212, 0.3);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(5.5px, 0.75vw, 8px);
  letter-spacing: 0.14em;
  color: rgba(244, 230, 212, 0.72);
}
.menu-barcode {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 2px;
  height: 26px;
  margin-top: 3px;
  opacity: 0.42;
}
.menu-barcode i { display: block; width: 2px; height: 16px; background: #f4efe4; }
.menu-barcode i:nth-child(3n) { width: 4px; height: 22px; }
.menu-barcode i:nth-child(4n) { width: 1px; height: 12px; }
.menu-barcode span {
  margin-left: 7px;
  font-family: "Silkscreen", monospace;
  font-size: 6px;
  letter-spacing: 0.24em;
  color: #f4efe4;
}
@media (max-width: 900px) {
  .tape-menu { grid-template-columns: 1fr; align-items: center; width: min(100%, 620px); text-align: center; gap: clamp(12px, 2.4vh, 22px); }
  .tape-menu .menu-brand { align-items: center; }
  .tape-menu .menu-brand .logo { align-self: center; }
  .tape-menu .menu-brand .gold-band { width: 100%; }
  .tape-menu .menu-roster-strip { width: min(100%, 360px); }
  .tape-panel { transform: none; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .tape-menu { padding-top: max(12px, env(safe-area-inset-top)); justify-content: center; gap: 10px; }
  .tape-menu .logo-top { font-size: clamp(38px, 12vw, 62px); }
  .tape-menu .logo-bot { font-size: clamp(32px, 10vw, 52px); }
  .tape-menu .menu-tagline { font-size: 7px; }
  .tape-menu .menu-roster-strip { height: 48px; }
  .tape-panel { padding: 8px 8px 12px; }
  .tape { min-height: 44px; padding: 6px 10px; }
  .tape-text { font-size: clamp(14px, 4.2vw, 20px); }
  .tape-sub { font-size: 5.5px; }
  .menu-barcode { display: none; }
}
@media (max-height: 520px) and (min-width: 720px) {
  .tape-menu { align-items: center; }
  .tape-menu .logo-top { font-size: clamp(32px, 7.8vh, 56px); }
  .tape-menu .logo-bot { font-size: clamp(27px, 6.4vh, 48px); }
  .tape-menu .menu-roster-strip { display: none; }
  .tape { min-height: 38px; padding: 5px 10px; }
  .tape-text { font-size: clamp(13px, 2.2vh, 19px); }
  .tape-sub { display: none; }
  .tape-list { gap: 4px; margin: 6px 0; }
}
@media (max-height: 520px) and (max-width: 899px) and (min-width: 540px) {
  .tape-menu {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
    align-items: center;
    width: min(100%, 1100px);
    text-align: left;
    gap: clamp(10px, 2vw, 24px);
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .tape-menu .menu-brand { align-items: flex-start; }
  .tape-menu .menu-brand .logo { align-self: flex-start; }
  .tape-menu .menu-brand .gold-band { width: auto; max-width: 100%; }
  .tape-menu .menu-roster-strip { display: none; }
  .tape-menu .menu-tagline { display: none; }
  .tape-panel { padding: 7px 9px 9px; }
  .tape-list { gap: 4px; margin: 4px 0 6px; }
  .tape { min-height: 34px; padding: 4px 9px; }
  .tape-text { font-size: clamp(12px, 2.15vh, 18px); }
  .tape-sub, .menu-tip, .menu-barcode { display: none; }
}

/* =========================================================== CREDITS */
.credits-list { display: grid; gap: 8px; margin: 14px 0 18px; }
.credits-list > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 2px 12px;
  padding: 9px 12px;
  border-left: 3px solid rgba(255, 201, 60, 0.6);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}
.credits-list span { grid-row: span 2; font-family: "Silkscreen", monospace; font-weight: 700; font-size: 8px; letter-spacing: 0.14em; color: rgba(255, 228, 92, 0.8); align-self: center; }
.credits-list b { font-family: "Pixelify Sans", sans-serif; font-size: clamp(15px, 2.2vw, 21px); color: #fff; }
.credits-list em { font-family: "Silkscreen", monospace; font-style: normal; font-size: 7px; line-height: 1.45; color: rgba(255, 255, 255, 0.5); }

/* ===================================================== ROSTER SLOTS (H) */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(5px, 1.2vw, 14px);
  width: 100%;
  align-items: stretch;
}
.slot-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 0 0 7px;
  overflow: hidden;
  border-radius: 12px;
  border: 2px solid color-mix(in srgb, var(--c) 52%, transparent);
  background: linear-gradient(180deg, rgba(28, 20, 38, 0.96), rgba(10, 7, 15, 0.98));
  color: #fff;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.slot-card.on {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent), 0 14px 36px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.07);
}
.slot-card.on:hover, .slot-card.on:focus-visible, .slot-card.on.kb-sel {
  outline: none;
  transform: translateY(-3px);
  box-shadow: 0 0 0 2px var(--c), 0 0 30px color-mix(in srgb, var(--c) 38%, transparent);
}
.slot-card.off {
  opacity: 0.42;
  filter: saturate(0.25) brightness(0.7);
  border-color: rgba(244, 230, 212, 0.18);
  cursor: default;
}
.slot-card.off.next {
  opacity: 0.72;
  filter: saturate(0.65) brightness(0.85);
  cursor: pointer;
}
.slot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 5px 6px;
  background: rgba(0, 0, 0, 0.32);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.slot-seat {
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 900;
  font-size: clamp(13px, 2.2vw, 22px);
  line-height: 1;
  color: var(--c);
  text-shadow: 0 0 10px color-mix(in srgb, var(--c) 55%, transparent);
}
.slot-state {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(5px, 0.72vw, 8px);
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}
.slot-portrait {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.02;
  overflow: hidden;
  background: #120d19;
}
.slot-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  filter: saturate(0.95) brightness(0.9);
  transition: transform 220ms ease, filter 160ms ease;
}
.slot-card.on:hover .slot-portrait img { transform: scale(1.06); filter: saturate(1.08) brightness(1.02); }
.slot-card.off .slot-portrait img { filter: grayscale(1) brightness(0.4); }
.slot-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(12, 8, 18, 0.94) 100%);
}
.slot-empty {
  position: absolute;
  inset: auto 4px 8px;
  z-index: 2;
  font-family: "Silkscreen", monospace;
  font-size: clamp(5px, 0.7vw, 8px);
  letter-spacing: 0.08em;
  color: rgba(244, 230, 212, 0.8);
}
.slot-card.on .slot-empty { display: none; }
.slot-name {
  display: block;
  padding: 5px 4px 0;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(10px, 1.7vw, 19px);
  line-height: 1;
  color: var(--c);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot-role {
  display: block;
  padding: 3px 5px 0;
  min-height: 2.2em;
  font-family: "Silkscreen", monospace;
  font-size: clamp(5px, 0.68vw, 7.5px);
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.5);
}
.slot-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 4px 5px 0;
  padding: 3px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.slot-arrow {
  display: grid;
  place-items: center;
  width: clamp(20px, 3.4vw, 30px);
  height: clamp(17px, 2.8vw, 24px);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.34);
  color: var(--c);
  font-size: clamp(9px, 1.4vw, 13px);
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
.slot-arrow:hover { background: color-mix(in srgb, var(--c) 35%, transparent); color: #17111f; }
.slot-card.off .slot-controls { display: none; }
.slot-index {
  min-width: 2.1em;
  font-family: "Silkscreen", monospace;
  font-size: clamp(5px, 0.7vw, 8px);
  color: rgba(255, 255, 255, 0.6);
}
.slot-join {
  display: none;
  margin: 5px 6px 0;
  padding: 5px 4px;
  border-radius: 6px;
  background: var(--c);
  color: #17111f;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(7px, 1.05vw, 11px);
  letter-spacing: 0.03em;
}
.slot-join.show { display: block; }
.slot-card.off:not(.next) .slot-join { display: none; }
@media (max-width: 700px) and (orientation: portrait) {
  .roster-wrap { justify-content: flex-start; gap: 7px; padding-top: 2vh; }
  .roster-head h2 { font-size: clamp(22px, 7vw, 34px); }
  .roster-head p { display: none; }
  .roster-players { padding: 5px 8px; }
  .roster-grid { gap: 4px; }
  .slot-card { border-radius: 9px; }
  .slot-top { padding: 4px 4px; }
  .slot-state { display: none; }
  .slot-role { display: none; }
  .slot-join { font-size: 7px; padding: 4px 2px; }
  .slot-controls { margin: 3px 3px 0; gap: 2px; }
  .slot-arrow { width: 20px; height: 17px; }
  .roster-foot { gap: 6px; }
  .roster-foot .big-btn { padding: 8px 12px; font-size: 14px; }
}
@media (max-height: 460px) and (orientation: landscape) {
  .roster-head p { display: none; }
  .roster-head h2 { font-size: clamp(20px, 5vh, 32px); }
  .slot-portrait { aspect-ratio: 1.2 / 1; }
  .slot-role { display: none; }
}
#ability.has-frost { background: radial-gradient(circle at 34% 30%, #ffffff, #b9feff 42%, #1493a8 100%); box-shadow: 0 0 0 3px rgba(127,247,255,.42), 0 0 32px rgba(127,247,255,.7); }
#ability.has-shock { background: radial-gradient(circle at 34% 30%, #ffffff, #ffe29a 42%, #b57b0c 100%); box-shadow: 0 0 0 3px rgba(255,209,102,.42), 0 0 32px rgba(255,209,102,.7); }
#ability.has-mine { background: radial-gradient(circle at 34% 30%, #ffffff, #ffc48a 42%, #b84a12 100%); box-shadow: 0 0 0 3px rgba(255,155,74,.42), 0 0 32px rgba(255,155,74,.7); }

/* ================================================ layout fit / no bars */
html, body { max-width: 100%; overflow-x: hidden; }
.screen, #select, #app { scrollbar-width: none; -ms-overflow-style: none; }
.screen::-webkit-scrollbar, #select::-webkit-scrollbar, #app::-webkit-scrollbar { width: 0; height: 0; display: none; }
.slot-card { width: 100%; }
@media (max-width: 700px) and (orientation: portrait) {
  .roster-wrap { justify-content: center; padding-top: 0; }
}
#countdown { font-size: clamp(64px, 11vw, 118px); }

/* ======================================================== SCREEN FADE */
#sceneFade {
  position: fixed;
  inset: 0;
  z-index: 140;
  pointer-events: none;
  opacity: 0;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 4px),
    #07050b;
}
#sceneFade.run { animation: sceneFade 340ms ease both; }
@keyframes sceneFade {
  0% { opacity: 0.94; }
  52% { opacity: 0.55; }
  100% { opacity: 0; }
}

/* ------------------------------------------- compact play on short screens */
@media (max-height: 460px) and (orientation: landscape) {
  #hud {
    padding: max(2px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) 4px max(6px, env(safe-area-inset-left));
    gap: 4px;
  }
  #badge { width: clamp(78px, 15vw, 100px); }
  #modeName { font-size: 6px; }
  .mode-tag { font-size: 4.5px; letter-spacing: 0.08em; }
  .plabel { width: 22px; font-size: 7px; }
  .plabel em { display: none; }
  .trackwrap { height: 10px; }
  .row { gap: 3px; }
  .pscore { width: 16px; font-size: 9px; }
  .pstars { width: 18px; font-size: 6px; }
  .picon { width: 12px; }
  #card { width: 42px; min-height: 42px; border-width: 2px; border-radius: 7px; margin-top: 1px; }
  #card .cnum { font-size: 28px; }
  #card .ctag { display: none; }
  #clock { top: calc(var(--hud-h) + 1px); font-size: 8px; padding: 1px 7px 1px; }
  #roundTag { display: none; }
  #modesBtn { top: calc(var(--hud-h) + 1px); padding: 3px 8px 2px; font-size: 6px; }
  #modesBtn .modes-sub { display: none; }
  #stick { width: 72px; left: 10px; bottom: 8px; }
  #stick .ctl-cap { display: none; }
  #dash { width: 66px; right: 10px; bottom: 8px; }
  #dash .dash-sub { font-size: 5px; letter-spacing: 0.04em; }
  #dash .dash-cap { font-size: 18px; }
  #ability { width: 52px; right: 10px; bottom: calc(8px + 70px); }
  #ability .ab-cap { font-size: 20px; }
  #ability .ab-sub { font-size: 5px; }
  #hint { display: none; }
  #modesToggleNotice { display: none; }
}
@media (orientation: portrait) {
  #badge { width: clamp(96px, 27vw, 124px); }
}

@media (max-height: 460px) and (orientation: landscape) {
  #modeIntro {
    top: 49%;
    padding: 5px 12px 6px;
    border-radius: 10px;
  }
  #modeIntro .mi-kicker { font-size: 5.5px; }
  #modeIntro .mi-title { font-size: 18px; }
  #modeIntro .mi-desc { display: block; font-size: 6.5px; line-height: 1.35; }
}

.rl-result-tag {
  font-style: normal;
  font-family: "Silkscreen", monospace;
  font-size: 0.72em;
  letter-spacing: 0.12em;
  color: rgba(244, 230, 212, 0.58);
}

/* ===================================================== BOOT / PLATFORM */
.boot-screen {
  position: fixed; inset: 0; z-index: 320;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(62,200,255,0.12), transparent 55%),
    #050409;
  transition: opacity 420ms ease;
}
.boot-screen.fading { opacity: 0; pointer-events: none; }
.boot-screen.hidden { display: none; }
.boot-grid {
  position: absolute; inset: -20%;
  background-image:
    linear-gradient(rgba(143,212,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143,212,255,0.06) 1px, transparent 1px);
  background-size: 72px 72px;
  transform: perspective(520px) rotateX(62deg) translateY(18%);
  mask-image: radial-gradient(circle at 50% 55%, #000 5%, transparent 68%);
  -webkit-mask-image: radial-gradient(circle at 50% 55%, #000 5%, transparent 68%);
  animation: bootGrid 9s linear infinite;
}
@keyframes bootGrid { from { background-position: 0 0; } to { background-position: 0 144px; } }
.boot-core {
  position: relative; z-index: 2; width: min(92vw, 620px);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; padding: 28px;
}
.boot-kicker { font-family: "Silkscreen", monospace; font-size: clamp(7px,1vw,10px); letter-spacing: .38em; color: rgba(255,255,255,.45); }
.boot-logo {
  font-family: "Jersey 10", sans-serif;
  font-size: clamp(64px, 14vw, 138px); line-height: .8; color: #F4E6D4;
  text-shadow: 0 0 14px rgba(143,212,255,.55), 0 0 44px rgba(255,79,216,.32), 4px 6px 0 #120d18;
  transform: skewY(-2deg);
}
.boot-logo span { display: block; color: #FFC93C; text-shadow: 0 0 18px rgba(255,201,60,.6), 4px 6px 0 #120d18; }
.boot-line { font-family: "Silkscreen", monospace; font-size: clamp(8px,1.6vw,12px); letter-spacing: .16em; color: rgba(244,230,212,.68); }
.boot-progress {
  width: min(74vw, 380px); height: 8px; margin-top: 6px; padding: 1px;
  border: 1px solid rgba(143,212,255,.32); border-radius: 999px;
  background: rgba(0,0,0,.5); overflow: hidden;
}
.boot-progress i { display: block; height: 100%; width: 8%; border-radius: 999px; background: linear-gradient(90deg,#3EC8FF,#8FD4FF,#fff); box-shadow: 0 0 12px rgba(143,212,255,.8); transition: width 420ms ease; }
.boot-status { min-height: 14px; font-family: "Silkscreen", monospace; font-size: clamp(7px,1.1vw,10px); letter-spacing: .18em; color: rgba(255,255,255,.48); }
.boot-press {
  font-family: "Pixelify Sans", sans-serif; font-weight: 700;
  font-size: clamp(16px, 2.8vw, 26px); color: #FFE49A;
  text-shadow: 0 0 16px rgba(255,201,60,.55);
  animation: bootBlink 1.1s steps(2, end) infinite;
  margin-top: 6px;
}
.boot-press.hidden { display: none; }
@keyframes bootBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.28; } }
.boot-foot { position: fixed; bottom: 18px; font-family: "Silkscreen", monospace; font-size: 8px; letter-spacing: .28em; color: rgba(255,255,255,0.25); }

.submenu-screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.submenu-screen .subGrid { position: relative; }
.submenu-screen .submenu-wrap { position: relative; z-index: 2; width: min(100%, 760px); margin: auto; display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 2vh, 18px); text-align: center; }
.submenu-screen h1 { margin: 0; font-family: 'Rubik Mono One', Impact, system-ui, sans-serif; text-transform: uppercase; font-size: clamp(30px, 6.5vw, 62px); letter-spacing: .02em; color: #F4E6D4; text-shadow: 0 0 18px rgba(255,79,216,.35), 3px 4px 0 #0b0812; }
.submenu-kicker { font-family: "Silkscreen", monospace; font-size: clamp(7px,1.2vw,11px); letter-spacing: .26em; color: #8FD4FF; }
.subtitle, .platform-sub { margin: 0; max-width: 560px; font-family: "Silkscreen", monospace; font-size: clamp(8px,1.3vw,11px); line-height: 1.6; color: rgba(255,255,255,.5); }
.subGrid {
  width: min(100%, 700px); display: grid; gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(74px, auto);
}
.subCard {
  position: relative; display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(244,230,212,.16);
  background: linear-gradient(150deg, rgba(255,255,255,.06), rgba(0,0,0,.55));
  color: #F4E6D4; text-align: left; cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 150ms ease;
}
.subCard:hover, .subCard:focus-visible, .subCard.kb-sel { transform: translateY(-2px); border-color: rgba(255,201,60,.6); box-shadow: 0 0 22px rgba(255,201,60,.16); outline: none; }
.subCard.locked { opacity: .48; cursor: not-allowed; filter: grayscale(.5); }
.subCard.locked:hover { transform: none; box-shadow: none; border-color: rgba(244,230,212,.16); }
.subCard .sc-icon { font-family: "Jersey 10", sans-serif; font-size: 34px; line-height: 1; color: #FFC93C; text-align: center; text-shadow: 0 0 12px rgba(255,201,60,.4); }
.subCard .sc-name { display: block; font-family: "Pixelify Sans", sans-serif; font-weight: 700; font-size: clamp(15px,2.2vh,20px); line-height: 1.05; }
.subCard .sc-desc { display: block; margin-top: 3px; font-family: "Silkscreen", monospace; font-size: clamp(7px,.95vw,9px); line-height: 1.45; color: rgba(255,255,255,.5); }
.subGrid.sub-full { grid-template-columns: 1fr; }
.subGrid.sub-full .subCard { grid-template-columns: 58px 1fr; }
.submenu-foot { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.sub-key { font-family: "Silkscreen", monospace; font-size: 8px; letter-spacing: .14em; color: rgba(255,255,255,.35); }

.platform-screen { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.platform-wrap { position: relative; z-index: 2; width: min(100%, 760px); margin: auto; display: flex; flex-direction: column; align-items: center; gap: clamp(10px,2vh,18px); text-align: center; }
.platform-wrap h1 { margin: 0; font-family: 'Rubik Mono One', Impact, system-ui, sans-serif; text-transform: uppercase; font-size: clamp(30px, 6.4vw, 58px); color: #F4E6D4; text-shadow: 0 0 18px rgba(62,200,255,.35), 3px 4px 0 #0b0812; }
.platform-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px,2vw,18px); width: min(100%, 640px); }
.platform-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: clamp(16px,3vh,26px) 16px; border-radius: 16px; cursor: pointer;
  border: 1px solid rgba(244,230,212,.18); color: #F4E6D4;
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(0,0,0,.6));
  transition: transform 130ms ease, border-color 130ms ease, box-shadow 150ms ease;
}
.platform-card:hover, .platform-card:focus-visible, .platform-card.recommended, .platform-card.kb-sel {
  transform: translateY(-3px); border-color: #FFC93C; box-shadow: 0 0 30px rgba(255,201,60,.2); outline: none;
}
.platform-card .pc-icon { font-size: clamp(30px,5vw,44px); line-height: 1; }
.platform-card .pc-name { font-family: "Pixelify Sans", sans-serif; font-weight: 700; font-size: clamp(22px,3.4vh,32px); }
.platform-card .pc-desc { font-family: "Silkscreen", monospace; font-size: clamp(7px,.95vw,9px); line-height: 1.55; color: rgba(255,255,255,.52); }
.platform-card .pc-tag { margin-top: 2px; font-family: "Silkscreen", monospace; font-size: 8px; letter-spacing: .18em; color: #FFC93C; }
.platform-note { font-family: "Silkscreen", monospace; font-size: 8px; letter-spacing: .1em; color: rgba(255,255,255,.34); }

/* =================================================== ARENA LOAD / INFO */
.arena-loader {
  position: fixed; inset: 0; z-index: 130; display: grid; place-items: center;
  background: #050409; opacity: 1; transition: opacity 300ms ease;
}
.arena-loader.hidden { display: none; }
.arena-loader.out { opacity: 0; pointer-events: none; }
.al-core { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 20px; }
.al-kicker { font-family: "Silkscreen", monospace; font-size: clamp(7px,1.1vw,10px); letter-spacing: .3em; color: #8FD4FF; }
.al-title { font-family: "Pixelify Sans", sans-serif; font-weight: 700; font-size: clamp(28px,5.2vw,54px); color: #F4E6D4; text-shadow: 0 0 22px rgba(255,201,60,.3); }
.al-bar { width: min(64vw, 300px); height: 6px; border: 1px solid rgba(143,212,255,.3); border-radius: 999px; overflow: hidden; }
.al-bar i { display: block; height: 100%; width: 30%; background: linear-gradient(90deg,#3EC8FF,#FF4FD8); animation: alFill 900ms ease-in-out infinite; }
@keyframes alFill { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }

#arenaInfo {
  position: fixed; inset: 0; z-index: 125; display: grid; place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(5,4,9,.82); backdrop-filter: blur(3px);
}
#arenaInfo.hidden { display: none; }
.ai-card {
  width: min(100%, 520px); max-height: 94vh; overflow: auto;
  display: flex; flex-direction: column; gap: 10px; padding: clamp(16px,3vh,26px);
  border-radius: 18px; border: 1px solid rgba(244,230,212,.2);
  background: linear-gradient(155deg, rgba(255,201,60,.06), transparent 45%), #12101a;
  box-shadow: 0 24px 70px rgba(0,0,0,.7);
  scrollbar-width: none;
}
.ai-card::-webkit-scrollbar { display: none; }
.ai-top { display: flex; align-items: center; gap: 12px; }
.ai-icon { width: 54px; height: 54px; display: grid; place-items: center; color: #FFC93C; }
.ai-icon svg { width: 100%; height: 100%; }
.ai-kicker { font-family: "Silkscreen", sans-serif; font-size: 8px; letter-spacing: .22em; color: #8FD4FF; }
.ai-top h2 { margin: 2px 0 0; font-family: "Pixelify Sans", sans-serif; font-size: clamp(22px,3.4vh,32px); color: #F4E6D4; }
.ai-arena { align-self: flex-start; padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(255,201,60,.4); font-family: "Silkscreen", sans-serif; font-size: 8px; letter-spacing: .16em; color: #FFC93C; }
.ai-desc { margin: 0; font-family: "Silkscreen", sans-serif; font-size: clamp(8px,1.1vw,10px); line-height: 1.6; color: rgba(255,255,255,.72); }
.ai-how { margin: 0; font-family: "Silkscreen", sans-serif; font-size: clamp(7px,.95vw,9px); line-height: 1.6; color: rgba(255,255,255,.45); }
.ai-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-stats span { padding: 5px 9px; border-radius: 6px; background: rgba(255,255,255,.06); font-family: "Silkscreen", sans-serif; font-size: 8px; color: rgba(255,255,255,.62); }
.ai-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 2px; }

/* ============================================== STANDINGS + ROUND STATS */
.br-standings, .rc-stats { width: 100%; display: flex; flex-direction: column; gap: 3px; }
.br-standings .st-head, .rc-stats .st-head {
  font-family: "Silkscreen", monospace; font-size: 7px; letter-spacing: .18em;
  color: rgba(255,255,255,.4); text-align: left;
}
.st-row {
  display: grid; grid-template-columns: 28px 1fr auto auto; align-items: center; gap: 6px;
  padding: 4px 7px; border-radius: 5px; background: rgba(255,255,255,.04);
  font-family: "Silkscreen", monospace; font-size: clamp(7px,.9vw,9px); color: rgba(255,255,255,.72);
}
.st-row.lead { background: rgba(255,201,60,.12); color: #fff; }
.st-row .st-pos { color: #FFC93C; }
.st-row .st-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-row .st-score { color: #fff; }
.st-row .st-stars { color: #FFC93C; letter-spacing: .06em; }
.rc-stats { max-width: 460px; margin: 2px auto 4px; }

/* ================================================= PLATFORM-SPECIFIC UI */
body[data-platform="desktop"] #controls { display: none !important; }
body[data-platform="desktop"] #desktopHint { display: block; }
body:not([data-platform="desktop"]) #desktopHint { display: none; }
.desktop-hint {
  position: fixed; left: 50%; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 14px);
  transform: translateX(-50%); z-index: 24;
  padding: 4px 12px; border-radius: 6px;
  font-family: "Silkscreen", monospace; font-size: 8px; letter-spacing: .08em;
  color: rgba(255,255,255,.42); background: rgba(5,4,10,.4);
  pointer-events: none; white-space: nowrap;
}
#app:not(.in-game) .desktop-hint, #app:not(.in-game) ~ #desktopHint { display: none !important; }
@media (pointer: coarse) {
  body[data-platform="desktop"] #controls { display: none !important; }
}

/* ================================================ narrow + short layouts */
@media (max-width: 640px) {
  .subGrid { grid-template-columns: 1fr; }
  .platform-cards { grid-template-columns: 1fr; }
  .boot-foot { display: none; }
}
@media (max-height: 430px) and (orientation: landscape) {
  .boot-logo { font-size: clamp(46px, 16vh, 96px); }
  .boot-line, .boot-foot { display: none; }
  .boot-core { gap: 8px; padding: 10px; }
  .submenu-wrap, .platform-wrap { gap: 6px; }
  .submenu-screen h1, .platform-wrap h1 { font-size: clamp(24px, 7vh, 42px); }
  .subGrid { grid-auto-rows: minmax(58px, auto); }
  .subCard .sc-icon { font-size: 26px; }
  .subCard .sc-name { font-size: 15px; }
}
@media (orientation: portrait) {
  .subGrid { grid-template-columns: 1fr; }
  .platform-cards { grid-template-columns: 1fr; }
  .submenu-wrap, .platform-wrap { width: min(100%, 460px); }
}
@media (max-height: 520px) and (orientation: portrait) {
  .boot-logo { font-size: 58px; }
}


/* info badge on mode cards */
.mode-card .mc-info {
  position: absolute; top: 8px; right: 8px;
  font-family: "Silkscreen", monospace; font-size: 7px; letter-spacing: .12em;
  color: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px; padding: 2px 6px; pointer-events: none;
}

/* ========================================= short landscape menus compact */
@media (max-height: 560px) and (orientation: landscape) {
  .submenu-wrap { width: min(100%, 900px); gap: 6px; }
  .submenu-screen h1 { font-size: clamp(26px, 7.6vh, 40px); }
  .submenu-kicker { font-size: 7px; letter-spacing: .2em; }
  .subtitle { display: none; }
  .subGrid, .subGrid.sub-full { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 6px; grid-auto-rows: minmax(58px, auto); }
  .subGrid.sub-full .subCard { grid-template-columns: 40px 1fr; }
  .subCard { grid-template-columns: 40px 1fr; padding: 8px 11px; gap: 8px; }
  .subCard .sc-icon { font-size: 25px; }
  .subCard .sc-name { font-size: clamp(14px, 2.4vh, 18px); }
  .subCard .sc-desc { font-size: 6.5px; line-height: 1.35; }
  .submenu-foot { margin-top: 0; }
  .submenu-foot .big-btn { padding: 6px 16px; font-size: 15px; }

  .platform-wrap { gap: 6px; width: min(100%, 860px); }
  .platform-wrap h1 { font-size: clamp(26px, 7.6vh, 40px); }
  .platform-sub { display: none; }
  .platform-cards { width: min(100%, 760px); gap: 10px; }
  .platform-card { padding: 10px 12px; gap: 4px; }
  .platform-card .pc-icon { font-size: 26px; }
  .platform-card .pc-name { font-size: 20px; }
  .platform-card .pc-desc { font-size: 6.5px; }
  .platform-note { font-size: 7px; }
}

/* Briefing on short landscape phones: everything must fit without scrolling,
   and READY must stay on screen. */
@media (orientation: landscape) and (max-height: 560px) {
  .br-card {
    width: min(54vw, 480px);
    max-height: calc(100% - 8px);
    overflow: hidden;
    padding: 8px 12px;
    gap: 4px;
  }
  .br-kicker, .br-arena { font-size: 6.5px; }
  #brTitle { font-size: clamp(20px, 4.2vh, 28px); }
  .br-icon { width: 26px; height: 26px; }
  .br-how {
    display: block;
    max-height: 34vh;
    overflow-y: auto;
    font-size: 8px;
    line-height: 1.35;
  }
  .br-standings { display: none; }
  .br-players {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 6px;
    margin-top: 0;
  }
  .brp { padding: 2px 5px; }
  .brp-name { display: none; }
  .brp-bar { height: 5px; }
  #readyBtn { min-height: 38px; margin-top: 1px; }
  #readyBtn .rb-sub { display: none; }
  #brQuit { display: none; }
}

/* ------------------------------------------------------------ FPS meter */
#fpsMeter {
  position: fixed; left: 50%; bottom: max(2px, env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 60;
  padding: 1px 7px; border-radius: 3px; background: rgba(5, 4, 10, 0.6);
  font-family: "Silkscreen", monospace; font-weight: 700; font-size: 10px; letter-spacing: .12em;
  color: rgba(255, 228, 92, 0.9); text-shadow: 0 1px 0 rgba(5, 4, 10, 0.95);
  pointer-events: none; white-space: nowrap;
}

/* =================================================================
   UNIFIED MENU SKIN: every screen shares the Main Menu look
   (arcade art backdrop, VHS lines, dark tape panel, tape strips)
   ================================================================= */
.screen:not(.menu-screen),
#select {
  background:
    linear-gradient(180deg, rgba(9, 6, 8, 0.72), rgba(9, 6, 8, 0.8) 48%, rgba(9, 6, 8, 0.9) 100%),
    url("assets/menu_art.webp") center / cover no-repeat,
    #100d0c;
}
.screen:not(.menu-screen)::before,
#select::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(255, 0, 90, 0.05), transparent 16%, transparent 84%, rgba(0, 220, 255, 0.05));
  background-size: auto;
  mask-image: none;
  -webkit-mask-image: none;
  opacity: 0.8;
}
.screen:not(.menu-screen) .screen-deco { display: none; }

.sheet,
.submenu-screen .submenu-wrap,
.roster-wrap,
.sel-wrap,
.platform-wrap,
.podium-wrap,
.ai-card {
  position: relative;
  z-index: 1;
  border-radius: 6px;
  border: 1px solid rgba(244, 230, 212, 0.12);
  background:
    linear-gradient(180deg, rgba(30, 24, 22, 0.62), rgba(12, 9, 10, 0.84)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 7px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.submenu-screen .submenu-wrap,
.platform-wrap,
.sel-wrap,
.podium-wrap {
  padding: clamp(12px, 2.2vh, 24px) clamp(12px, 2vw, 26px);
  min-height: 0;
  margin: auto;
  transform: rotate(-0.25deg);
}
.roster-wrap {
  min-height: 0;
  margin: auto;
  padding: clamp(10px, 1.8vh, 20px) clamp(10px, 1.6vw, 22px);
}
.sheet::after,
.submenu-screen .submenu-wrap::after,
.roster-wrap::after,
.sel-wrap::after,
.platform-wrap::after,
.podium-wrap::after,
.ai-card::after {
  content: "";
  position: absolute;
  top: clamp(10px, 1.8vh, 18px);
  right: clamp(12px, 1.6vw, 20px);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6cff5a;
  box-shadow: 9px 0 0 #ffe45c, 18px 0 0 #3ec8ff, 0 0 7px #6cff5a;
  transform: translateX(-18px);
  animation: dotBlink 1.2s ease-in-out infinite;
  pointer-events: none;
}

.sheet-kicker,
.sel-kicker,
.submenu-kicker,
.ai-kicker,
.platform-kicker {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  letter-spacing: 0.26em;
  color: #ff4fd8;
  animation: insertBlink 1.6s steps(2, start) infinite;
}

.submenu-screen h1,
.platform-wrap h1,
#select h1,
.roster-head h2,
.sheet h2,
.podium-wrap h2,
.ai-card h2 {
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.01em;
  transform: skewX(-5deg);
  text-shadow: 0 4px 0 #151019, 0 0 26px rgba(255, 255, 255, 0.3), 0 0 54px rgba(62, 200, 255, 0.24);
}
.submenu-screen h1::after,
.platform-wrap h1::after,
#select h1::after,
.roster-head h2::after,
.sheet h2::after,
.podium-wrap h2::after {
  content: "";
  display: block;
  width: min(100%, 260px);
  height: clamp(5px, 0.8vh, 8px);
  margin: clamp(5px, 1vh, 9px) auto 0;
  border-radius: 2px;
  background: linear-gradient(180deg, #ffe49a, #ffc93c 52%, #c58b0c);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), 0 0 18px rgba(255, 201, 60, 0.28);
}
.sheet:not(.narrow) h2::after { margin-left: 0; }

.subtitle, .platform-sub, .sel-sub, .roster-head p, .sheet-note, .platform-note, .sub-key {
  font-family: "Silkscreen", monospace;
  letter-spacing: 0.12em;
  color: rgba(244, 239, 228, 0.55);
}

/* tape strips */
.subCard,
.platform-card,
.mode-card,
.set-row,
.how-item,
.credits-list > div,
.big-btn {
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(96deg, rgba(255, 255, 255, 0.09), transparent 24%, rgba(0, 0, 0, 0.26) 82%),
    linear-gradient(180deg, #201c1b, #111010 55%, #181414);
  color: #f4efe4;
  clip-path: polygon(0.6% 8%, 4% 0, 47% 3%, 98.8% 0, 100% 34%, 99.2% 88%, 96% 100%, 52% 96%, 1.4% 100%, 0 62%);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.11);
  transform: rotate(var(--tape-tilt, 0deg));
  transition: transform 110ms ease, filter 120ms ease;
}
.subCard:nth-child(4n+1), .set-row:nth-child(4n+1), .how-item:nth-child(4n+1), .mode-card:nth-child(4n+1), .platform-card:nth-child(2n+1), .credits-list > div:nth-child(4n+1) { --tape-tilt: -0.6deg; }
.subCard:nth-child(4n+2), .set-row:nth-child(4n+2), .how-item:nth-child(4n+2), .mode-card:nth-child(4n+2), .platform-card:nth-child(2n+2), .credits-list > div:nth-child(4n+2) { --tape-tilt: 0.45deg; }
.subCard:nth-child(4n+3), .set-row:nth-child(4n+3), .how-item:nth-child(4n+3), .mode-card:nth-child(4n+3), .credits-list > div:nth-child(4n+3) { --tape-tilt: -0.3deg; }
.subCard:nth-child(4n+4), .set-row:nth-child(4n+4), .how-item:nth-child(4n+4), .mode-card:nth-child(4n+4), .credits-list > div:nth-child(4n+4) { --tape-tilt: 0.55deg; }

.subCard:hover, .subCard:focus-visible,
.platform-card:hover, .platform-card:focus-visible,
.mode-card:hover, .mode-card:focus-visible,
.big-btn:hover, .big-btn:focus-visible, .subCard.kb-sel, .platform-card.kb-sel, .mode-card.kb-sel, .big-btn.kb-sel {
  outline: none;
  border-color: transparent;
  transform: rotate(0deg) scale(1.012);
  background:
    linear-gradient(96deg, rgba(255, 255, 255, 0.14), transparent 24%, rgba(0, 0, 0, 0.18) 82%),
    linear-gradient(180deg, #b62d31, #7d1218 58%, #921d23);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 0 26px rgba(182, 45, 49, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.big-btn.primary,
.platform-card.recommended {
  border: 0;
  color: #f4efe4;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
  background:
    linear-gradient(96deg, rgba(255, 255, 255, 0.13), transparent 22%, rgba(0, 0, 0, 0.2) 82%),
    linear-gradient(180deg, #b62d31, #791016 58%, #921d23);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.38), 0 0 22px rgba(182, 45, 49, 0.32);
}
.big-btn.ghost { color: rgba(244, 239, 228, 0.88); }
.big-btn:focus-visible, .big-btn.kb-sel { box-shadow: 0 0 0 2px rgba(244, 230, 212, 0.6); }
.subCard.locked, .subCard.locked:hover, .mode-card.locked, .mode-card.locked:hover {
  transform: rotate(var(--tape-tilt, 0deg));
  filter: grayscale(0.85) brightness(0.72);
  opacity: 0.6;
  background: linear-gradient(180deg, #201c1b, #111010 55%, #181414);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.38);
}

.subCard .sc-icon {
  display: grid;
  place-items: center;
  width: clamp(30px, 5vh, 42px);
  height: clamp(30px, 5vh, 42px);
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(244, 239, 228, 0.26);
  background: rgba(0, 0, 0, 0.25);
  color: #f4e6d4;
  font-size: clamp(14px, 2.4vh, 20px);
  letter-spacing: -0.1em;
  text-shadow: none;
}
.subCard .sc-name, .platform-card .pc-name { text-shadow: 0 2px 0 rgba(0, 0, 0, 0.62); }
.subCard .sc-desc, .platform-card .pc-desc, .how-item p, .credits-list em {
  letter-spacing: 0.1em;
  color: rgba(244, 239, 228, 0.5);
}
.platform-card .pc-tag { color: #f4e6d4; }
.how-key, .credits-list span { color: #ffc93c; }

.slot-card { border-radius: 6px; }
.roster-count { color: #ffc93c; }
.player-hint { border-radius: 3px; }
.slot-card.locked-slot { cursor: not-allowed; }

/* pause sheet and arena info get the same panel */
#pause .sheet, #arenaInfo .ai-card { transform: rotate(-0.25deg); }

/* ---------------------------------------------------- arcade wipe */
#arcadeWipe {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9000;
  pointer-events: none;
  display: none;
}
#arcadeWipe.on { display: block; }
#sceneFade { display: none !important; }

/* ----------------------------------------------- pause confirmations */
.pause-step { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.pause-step.hidden { display: none !important; }
.confirm-q {
  margin: 0 0 4px;
  font-family: "Pixelify Sans", sans-serif;
  font-size: clamp(13px, 1.8vw, 18px);
  line-height: 1.3;
  color: #fff;
  text-align: center;
}
.confirm-q.warn { color: #ffb3b3; text-shadow: 0 0 10px rgba(255, 60, 60, 0.6); }
.big-btn.danger {
  background: linear-gradient(180deg, #ff5a5a, #b81d3a) !important;
  color: #fff !important;
  border-color: rgba(255, 180, 180, 0.6) !important;
}
.big-btn.ghost.danger { background: rgba(120, 20, 30, 0.35) !important; color: #ffb3b3 !important; }

/* ------------------------------------------- race portrait score card */
#card {
  display: flex !important;
  align-items: center;
  gap: clamp(4px, 0.6vw, 8px);
  width: auto !important;
  padding: 3px clamp(6px, 0.8vw, 10px) 3px 3px;
}
#card .cportrait {
  width: clamp(40px, 7.2vh, 70px);
  height: clamp(40px, 7.2vh, 70px);
  object-fit: cover;
  border-radius: clamp(6px, 0.8vw, 10px);
  border: 2px solid var(--c, var(--p1));
  background: #151019;
}
#card .ctag { display: block !important; white-space: nowrap; max-width: 150%; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------- podium stats */
.podium-stats { width: 100%; margin-top: clamp(6px, 1.4vh, 14px); }
.pst-head {
  font-family: "Silkscreen", monospace;
  font-size: clamp(8px, 1vw, 11px);
  letter-spacing: 0.14em;
  color: #ffe45c;
  margin-bottom: 6px;
}
.pst-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.podium-stats table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Silkscreen", monospace;
  font-size: clamp(8px, 1.05vw, 12px);
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
}
.podium-stats th { padding: 4px 6px; color: rgba(255, 255, 255, 0.55); font-weight: 400; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.podium-stats th small { display: block; font-size: 0.78em; color: rgba(255, 228, 92, 0.7); }
.podium-stats td { padding: 4px 6px; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.podium-stats td.pn { text-align: left; color: var(--c); font-family: "Pixelify Sans", sans-serif; font-weight: 700; }
.podium-stats tr.champ td { background: rgba(255, 201, 60, 0.12); }
.podium-stats td.won { color: #ffe45c; }

/* ------------------------------- bigger thumb controls on landscape phones */
@media (orientation: landscape) and (pointer: coarse) {
  #app #controls #stick { width: clamp(128px, 34vh, 176px) !important; left: max(14px, env(safe-area-inset-left)) !important; bottom: max(14px, env(safe-area-inset-bottom)) !important; }
  #app #controls #dash { width: clamp(106px, 28vh, 150px) !important; right: max(14px, env(safe-area-inset-right)) !important; bottom: max(14px, env(safe-area-inset-bottom)) !important; }
  #app #controls #ability { width: clamp(78px, 21vh, 112px) !important; right: calc(max(14px, env(safe-area-inset-right)) + clamp(106px, 28vh, 150px) + 10px) !important; bottom: max(18px, env(safe-area-inset-bottom)) !important; }
}
/* the race tag sits under the card so it never runs off the top edge */
#card .ctag { top: auto !important; bottom: -8px !important; right: 50% !important; transform: translateX(50%); }
#card .ctag { right: 0 !important; transform: none !important; max-width: none !important; }

/* =================================================================
   CHUNKY TOY-LIKE RETRO MENUS: centred, large, fat cream outlines,
   high-contrast white/player-colour labels. No blur (cheap on weak GPUs).
   ================================================================= */
*, *::before, *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
#fpsMeter { display: none !important; }
#app.in-game ~ #fpsMeter, body.in-match #fpsMeter { display: block !important; }
.screen:not(.menu-screen):not(.hidden) { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.screen:not(.menu-screen) > .sheet,
.screen:not(.menu-screen) > .submenu-wrap,
.screen:not(.menu-screen) > .platform-wrap,
.screen:not(.menu-screen) > .roster-wrap,
.screen:not(.menu-screen) > .podium-wrap {
  margin: auto !important;
  transform: none !important;
}
.sheet,
.submenu-screen .submenu-wrap,
.platform-wrap,
.roster-wrap,
.podium-wrap,
.ai-card,
#roundCard .rc-inner,
.br-card {
  border: 4px solid #F4E6D4 !important;
  border-radius: 20px !important;
  background:
    linear-gradient(160deg, rgba(255, 201, 60, 0.08), transparent 40%),
    #17101f !important;
  box-shadow: 0 7px 0 #07050b, 0 0 0 3px #07050b, 0 0 34px rgba(244, 230, 212, 0.22) !important;
}
.sheet { width: min(94vw, 680px) !important; padding: clamp(16px, 3.4vh, 34px) clamp(16px, 3vw, 36px) !important; }
.sheet.wide { width: min(94vw, 980px) !important; }
.sheet.narrow { width: min(94vw, 560px) !important; }
.submenu-screen .submenu-wrap, .platform-wrap { width: min(94vw, 900px) !important; }
.sheet h2, .submenu-wrap h1, .platform-wrap h1, .podium-wrap h2, .roster-head h2 {
  font-family: "Pixelify Sans", sans-serif !important;
  font-weight: 700 !important;
  font-size: clamp(30px, 6vh, 56px) !important;
  color: #fff !important;
  text-shadow: 0 4px 0 #07050b, -2px -2px 0 #07050b, 2px -2px 0 #07050b, -2px 2px 0 #07050b, 2px 2px 0 #07050b !important;
  letter-spacing: 0.02em;
}
.sheet-kicker, .submenu-kicker, .sel-kicker, .brand-kicker {
  font-size: clamp(10px, 1.7vh, 14px) !important;
  color: #FFE45C !important;
  letter-spacing: 0.2em !important;
}
.sheet-note, .subtitle, .platform-sub, .roster-head p, .platform-note, .sc-desc, .pc-desc, .how-item p, .credits-list em, .confirm-q {
  font-family: "Pixelify Sans", sans-serif !important;
  font-size: clamp(13px, 2.3vh, 18px) !important;
  line-height: 1.35 !important;
  color: rgba(255, 255, 255, 0.92) !important;
  letter-spacing: 0 !important;
}
.set-row {
  border: 3px solid rgba(244, 230, 212, 0.55) !important;
  background: #241a30 !important;
  font-size: clamp(18px, 3vh, 26px) !important;
  padding: clamp(10px, 1.8vh, 16px) clamp(12px, 2vw, 20px) !important;
  border-radius: 14px !important;
}
.toggle {
  min-width: 130px !important;
  padding: 10px 16px !important;
  border: 3px solid #F4E6D4 !important;
  border-radius: 12px !important;
  font-family: "Pixelify Sans", sans-serif !important;
  font-size: clamp(15px, 2.4vh, 20px) !important;
  color: #fff !important;
  box-shadow: 0 4px 0 #07050b;
}
.toggle.on { color: #10220d !important; }
.big-btn {
  border-width: 4px !important;
  border-color: #F4E6D4 !important;
  border-radius: 16px !important;
  font-size: clamp(18px, 3.2vh, 26px) !important;
  color: #fff !important;
  background: #2a1d38 !important;
  box-shadow: 0 5px 0 #07050b !important;
  padding: clamp(10px, 1.8vh, 16px) clamp(22px, 4vw, 40px) !important;
}
.big-btn.primary { background: linear-gradient(180deg, #ffe49a, #ffc93c 55%, #d49a12) !important; color: #17111f !important; }
.big-btn:hover, .big-btn:focus-visible, .big-btn.kb-sel { filter: brightness(1.15); transform: translateY(-2px); }
.big-btn:active { transform: translateY(3px) scale(0.98) !important; box-shadow: 0 2px 0 #07050b !important; }
.subCard {
  border: 4px solid rgba(244, 230, 212, 0.8) !important;
  border-radius: 16px !important;
  background: #241a30 !important;
  box-shadow: 0 5px 0 #07050b;
  padding: clamp(12px, 2.2vh, 20px) clamp(14px, 2vw, 22px) !important;
  color: #fff !important;
}
.subCard .sc-name { font-size: clamp(20px, 3.6vh, 30px) !important; color: #fff !important; }
.subCard:hover, .subCard:focus-visible, .subCard.kb-sel { border-color: #FFC93C !important; transform: translateY(-3px) scale(1.01); }
.subCard:active { transform: translateY(2px) scale(0.98); }
.platform-card {
  border: 4px solid rgba(244, 230, 212, 0.8) !important;
  background: #241a30 !important;
  box-shadow: 0 6px 0 #07050b;
}
.platform-card .pc-name { font-size: clamp(26px, 5vh, 42px) !important; color: #fff !important; }
.platform-card .pc-tag { font-size: clamp(11px, 1.8vh, 14px) !important; }
.platform-card .pc-icon { font-size: clamp(40px, 8vh, 64px) !important; }
.platform-card.recommended { border-color: #6CFF5A !important; box-shadow: 0 6px 0 #07050b, 0 0 26px rgba(108, 255, 90, 0.35) !important; }
.platform-cards { width: 100% !important; }
.how-item { border: 3px solid rgba(244, 230, 212, 0.45) !important; border-radius: 14px !important; background: #241a30 !important; }
.how-key { font-size: clamp(13px, 2.2vh, 17px) !important; color: #FFE45C !important; }
.credits-list span { color: #FFE45C !important; font-size: 12px !important; }
.credits-list b { color: #fff !important; font-size: clamp(16px, 2.6vh, 22px) !important; }
/* main menu: bigger, readable tapes */
.menu-panel { border: 4px solid #F4E6D4 !important; border-radius: 18px !important; box-shadow: 0 7px 0 #07050b, 0 0 30px rgba(244, 230, 212, 0.2) !important; background: #17101f !important; }
.tape-text { font-size: clamp(20px, 4vh, 34px) !important; color: #fff !important; }
.tape-sub { font-family: "Pixelify Sans", sans-serif !important; font-size: clamp(11px, 1.9vh, 15px) !important; color: rgba(255, 255, 255, 0.85) !important; letter-spacing: 0.02em !important; }
.menu-tip, .menu-version, .mp-insert { font-size: clamp(10px, 1.7vh, 13px) !important; color: rgba(255, 255, 255, 0.8) !important; }
@media (orientation: portrait) {
  .platform-cards { grid-template-columns: 1fr !important; }
}
.tape.primary { min-height: clamp(70px, 14vh, 110px) !important; }
.tape.primary .tape-text { font-size: clamp(28px, 6vh, 48px) !important; }
.tape-menu { grid-template-columns: minmax(0, 0.85fr) minmax(330px, 1fr) !important; align-items: center !important; width: min(100%, 1040px) !important; }
.tape-panel { transform: none !important; }
@media (max-width: 900px) and (orientation: portrait) {
  .tape-menu { grid-template-columns: 1fr !important; }
}
/* roster always fits: the art shrinks, the footer stays on screen */
#roster.screen { justify-content: flex-start !important; }
#roster .roster-wrap { max-height: calc(100dvh - 20px); display: flex !important; flex-direction: column; overflow: hidden; }
#roster .roster-grid { flex: 1 1 auto; min-height: 0; overflow: hidden; }
#roster .roster-grid > * { min-height: 0; }
#roster .roster-grid img { max-height: 100%; min-height: 0; object-fit: contain; }
#roster .roster-foot { flex: 0 0 auto; position: relative; z-index: 3; }
#roster .roster-players { flex: 0 0 auto; }
@media (orientation: landscape) and (max-height: 520px) {
  #roster .roster-head p, #roster .roster-players { display: none !important; }
  #roster .roster-head h2 { font-size: clamp(22px, 7vh, 34px) !important; }
}
.set-music-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#setMusic { width: 100%; accent-color: #FF4FD8; cursor: pointer; }
/* OPTIONS fits a landscape phone: rows in two columns, compact */
#settings .sheet { width: min(96vw, 980px) !important; display: grid !important; grid-template-columns: 1fr 1fr; gap: clamp(6px, 1.4vh, 12px) clamp(8px, 1.4vw, 14px) !important; align-items: stretch; }
#settings .sheet > .sheet-kicker, #settings .sheet > h2, #settings .sheet > .sheet-note, #settings .sheet > .big-btn { grid-column: 1 / -1; justify-self: center; }
#settings .set-row { padding: clamp(6px, 1.4vh, 12px) clamp(10px, 1.4vw, 16px) !important; font-size: clamp(14px, 3.4vh, 22px) !important; }
#settings .toggle { min-width: 104px !important; padding: 6px 12px !important; }
@media (orientation: landscape) and (max-height: 520px) {
  #settings .sheet { padding: 10px 14px !important; }
  #settings .sheet h2 { font-size: clamp(22px, 7vh, 32px) !important; margin: 0; }
  #settings .sheet > .sheet-note { display: none; }
}
@media (orientation: portrait) {
  #settings .sheet { grid-template-columns: 1fr; }
}
/* painted title logo */
.logo.logo-art { display: block; margin: 0; line-height: 0; }
.logo.logo-art img { display: block; width: min(100%, 460px); max-height: 34vh; object-fit: contain; filter: drop-shadow(0 6px 0 rgba(7, 5, 11, 0.85)); }
.boot-logo.boot-logo-art { line-height: 0; }
.boot-logo.boot-logo-art img { width: min(78vw, 520px); max-height: 46vh; object-fit: contain; }
@media (max-width: 900px) and (orientation: portrait) { .logo.logo-art img { margin: 0 auto; max-height: 24vh; } }
/* restored minigame list + roulette: readable names, fits without scrolling */
.rl-tile .rl-name, .mode-card .mc-name { font-family: "Pixelify Sans", sans-serif !important; font-weight: 700 !important; letter-spacing: 0.02em !important; }
.rl-tile .rl-name { font-size: clamp(14px, 2.4vw, 20px) !important; color: #fff !important; }
.mode-card .mc-desc { font-family: "Pixelify Sans", sans-serif !important; font-size: clamp(11px, 1.5vw, 14px) !important; color: rgba(255,255,255,0.86) !important; letter-spacing: 0 !important; }
#select { overflow: hidden !important; }
@media (orientation: landscape) and (max-height: 520px) {
  #select .sel-sub { display: none !important; }
  #select .sel-wrap { gap: 6px !important; padding-top: 8px !important; padding-bottom: 8px !important; }
  #select h1 { font-size: clamp(22px, 7vh, 34px) !important; }
}
@media (orientation: landscape) and (max-height: 520px) {
  #select .mode-card .mc-desc { display: none !important; }
  #select .mode-card { padding: 8px 14px !important; min-height: 0 !important; }
}

/* =====================================================================
   REFERENCE MENU SKIN (the "ABANDONAR?" popup) applied to every menu:
   dark rounded window, thick cream rim, hard drop shadow, tiny spaced
   dull-gold kicker, big white pixel title with black shadow, yellow bar,
   centred pixel body text, wide slightly-tilted buttons (red = main,
   dark purple = back/other), scanlines + light VHS over the window.
   ===================================================================== */
:root {
  --rf-win: #1b1522;
  --rf-rim: #F1E4D2;
  --rf-red-1: #f4555f; --rf-red-2: #c9233f;
  --rf-pur-1: #2c2238; --rf-pur-2: #211a2b;
  --rf-gold: #8a7a3a;
}
/* the window */
.sheet,
.submenu-screen .submenu-wrap,
.platform-wrap,
.roster-wrap,
.podium-wrap,
.ai-card,
.sel-wrap,
#roundCard .rc-inner,
.br-card,
.menu-panel,
.rl-box,
.mp-result-box {
  position: relative !important;
  background: var(--rf-win) !important;
  border: 5px solid var(--rf-rim) !important;
  border-radius: 26px !important;
  box-shadow: 0 9px 0 #050308, 0 0 0 2px #050308, 0 18px 40px rgba(0, 0, 0, 0.6) !important;
  transform: none !important;
  overflow: hidden;
  text-align: center;
}
.rl-box { padding: clamp(12px, 2.6vh, 24px) clamp(14px, 2.4vw, 28px) !important; }
/* scanlines + soft VHS sheen on every window */
.sheet::before,
.submenu-screen .submenu-wrap::before,
.platform-wrap::before,
.roster-wrap::before,
.podium-wrap::before,
.ai-card::before,
.sel-wrap::before,
#roundCard .rc-inner::before,
.br-card::before,
.menu-panel::before,
.rl-box::before,
.mp-result-box::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 5 !important;
  pointer-events: none !important;
  border-radius: inherit;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 1px, rgba(0, 0, 0, 0.16) 1px 3px),
    linear-gradient(90deg, rgba(255, 40, 90, 0.035), transparent 18%, transparent 82%, rgba(40, 220, 255, 0.035)),
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.05), transparent 60%) !important;
  mix-blend-mode: normal;
  opacity: 1 !important;
  animation: none !important;
  transform: none !important;
  display: block !important;
  width: auto !important; height: auto !important;
}
/* the three dots, top right */
.sheet::after,
.submenu-screen .submenu-wrap::after,
.platform-wrap::after,
.roster-wrap::after,
.podium-wrap::after,
.ai-card::after,
.sel-wrap::after,
.menu-panel::after,
.rl-box::after {
  content: "" !important;
  position: absolute !important;
  top: 16px !important; right: 46px !important;
  width: 7px !important; height: 7px !important;
  border-radius: 50% !important;
  background: #4f9a46 !important;
  box-shadow: 13px 0 0 #9a8a3a, 26px 0 0 #2f6f9a !important;
  transform: none !important;
  animation: none !important;
  z-index: 6 !important;
}
/* kicker: tiny, widely spaced, dull gold */
.sheet-kicker, .submenu-kicker, .sel-kicker, .brand-kicker, .rl-kicker, .mp-insert, .ai-kicker, .rc-kicker, .br-kicker, .mp-result-kicker {
  font-family: "Silkscreen", monospace !important;
  font-weight: 700 !important;
  font-size: clamp(9px, 1.6vh, 13px) !important;
  letter-spacing: 0.42em !important;
  color: var(--rf-gold) !important;
  text-shadow: none !important;
  text-transform: uppercase;
}
/* the big title + yellow bar */
.sheet h2, .submenu-wrap h1, .platform-wrap h1, .podium-wrap h2, .roster-head h2, #select h1, .rl-title, .ai-card h2, .rc-title, .mp-result-title, #brTitle {
  font-family: "Pixelify Sans", sans-serif !important;
  font-weight: 700 !important;
  font-size: clamp(28px, 7.4vh, 60px) !important;
  line-height: 1 !important;
  color: #fff !important;
  letter-spacing: 0.02em !important;
  transform: none !important;
  text-shadow: 3px 3px 0 #000, -2px 0 0 #000, 0 -2px 0 #000, 2px 0 0 #000, 0 2px 0 #000, 4px 5px 0 #000 !important;
  margin: 2px 0 0 !important;
  text-align: center !important;
}
.submenu-screen h1::after, .platform-wrap h1::after, #select h1::after, .roster-head h2::after, .sheet h2::after, .podium-wrap h2::after, .rl-title::after, .ai-card h2::after {
  content: "" !important;
  display: block !important;
  width: min(80%, 460px) !important;
  height: clamp(6px, 1vh, 9px) !important;
  margin: clamp(8px, 1.6vh, 14px) auto 0 !important;
  border-radius: 6px !important;
  background: linear-gradient(180deg, #ffe066, #f2bd1a) !important;
  box-shadow: 0 2px 0 #6a4d05 !important;
}
.sheet:not(.narrow) h2::after { margin-left: auto !important; }
/* body text: centred pixel face, near white */
.sheet-note, .subtitle, .platform-sub, .sel-sub, .roster-head p, .platform-note, .confirm-q, .ai-desc, .ai-how, .rl-result, .rc-next, .mp-result-sub, .br-how, .menu-tagline, .menu-tip {
  font-family: "Pixelify Sans", sans-serif !important;
  font-weight: 700 !important;
  font-size: clamp(13px, 2.5vh, 19px) !important;
  line-height: 1.4 !important;
  letter-spacing: 0 !important;
  color: rgba(255, 255, 255, 0.92) !important;
  text-align: center !important;
  text-shadow: none !important;
}
/* buttons: wide, slightly tilted, red main / dark purple other */
.big-btn, #readyBtn, #rcSkip, .subCard, .tape, .platform-card, .mode-card, .toggle, #aiPlay, #aiClose {
  font-family: "Pixelify Sans", sans-serif !important;
  font-weight: 700 !important;
  color: #fff !important;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35) !important;
  border: 0 !important;
  border-radius: 14px !important;
  clip-path: none !important;
  box-shadow: 0 6px 0 #0a070e !important;
  filter: none !important;
  position: relative;
  overflow: hidden;
}
.big-btn, #rcSkip {
  font-size: clamp(17px, 3.4vh, 28px) !important;
  padding: clamp(10px, 2vh, 18px) clamp(20px, 4vw, 44px) !important;
  background: linear-gradient(180deg, var(--rf-pur-1), var(--rf-pur-2)) !important;
  transform: rotate(-0.6deg) !important;
}
.big-btn.primary, .big-btn.danger, #rcSkip, #aiPlay, .tape.primary, #readyBtn {
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, var(--rf-red-1), var(--rf-red-2)) !important;
  color: #fff !important;
  transform: rotate(-0.8deg) !important;
}
.big-btn.ghost.danger { background: linear-gradient(180deg, var(--rf-pur-1), var(--rf-pur-2)) !important; color: #ffb7c2 !important; }
.big-btn:nth-of-type(2n), .subCard:nth-child(2n), .tape:nth-child(2n), .mode-card:nth-child(2n), .platform-card:nth-child(2n) { transform: rotate(0.5deg) !important; }
.big-btn:hover, .big-btn:focus-visible, #rcSkip:hover, #rcSkip:focus-visible, .big-btn.kb-sel, #rcSkip.kb-sel {
  outline: none !important;
  transform: rotate(0deg) translateY(-2px) scale(1.02) !important;
  box-shadow: 0 8px 0 #0a070e, 0 0 0 3px #F1E4D2 !important;
}
.big-btn:active, #rcSkip:active, .subCard:active, .tape:active, .mode-card:active, .platform-card:active {
  transform: rotate(0deg) translateY(4px) scale(0.98) !important;
  box-shadow: 0 2px 0 #0a070e !important;
}
/* list rows (main menu tapes, submenu cards, minigames, version cards): dark purple strips */
.subCard, .tape, .mode-card, .platform-card {
  background: linear-gradient(180deg, var(--rf-pur-1), var(--rf-pur-2)) !important;
  transform: rotate(-0.4deg) !important;
}
.subCard:hover, .subCard:focus-visible, .tape:hover, .tape:focus-visible, .mode-card:hover, .mode-card:focus-visible,
.mode-card.current, .platform-card:hover, .platform-card:focus-visible, .platform-card.recommended, .subCard.kb-sel, .tape.kb-sel, .mode-card.kb-sel, .platform-card.kb-sel {
  outline: none !important;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, var(--rf-red-1), var(--rf-red-2)) !important;
  transform: rotate(0deg) scale(1.015) !important;
  box-shadow: 0 6px 0 #0a070e, 0 0 0 3px #F1E4D2 !important;
}
.tape::after, .subCard::after { display: none !important; }
.tape-mark, .tape-badge, .sc-icon { border-color: rgba(255, 255, 255, 0.35) !important; color: #fff !important; text-shadow: none !important; }
.subCard .sc-desc, .tape-sub, .mode-card .mc-desc, .platform-card .pc-desc { color: rgba(255, 255, 255, 0.82) !important; font-family: "Pixelify Sans", sans-serif !important; }
.subCard .sc-name, .tape-text, .mode-card .mc-name, .platform-card .pc-name { color: #fff !important; text-shadow: 2px 2px 0 #000 !important; }
/* settings rows and toggles */
.set-row, .how-item, .credits-list > div {
  background: #251d30 !important;
  border: 0 !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 0 #0a070e !important;
  clip-path: none !important;
}
.toggle { background: linear-gradient(180deg, var(--rf-pur-1), var(--rf-pur-2)) !important; box-shadow: 0 4px 0 #0a070e !important; }
.toggle.on { background: linear-gradient(180deg, var(--rf-red-1), var(--rf-red-2)) !important; color: #fff !important; }
/* roster slots and roulette tiles share the rim language */
.slot-card, .rl-tile {
  border: 3px solid rgba(241, 228, 210, 0.55) !important;
  border-radius: 16px !important;
  background: #251d30 !important;
  box-shadow: 0 5px 0 #0a070e !important;
}
.rl-tile.active, .rl-tile.won { border-color: #F1E4D2 !important; background: linear-gradient(180deg, var(--rf-red-1), var(--rf-red-2)) !important; }
/* screen backdrop behind the windows: dim + scanlines, as behind the popup */
.screen:not(.menu-screen), #select, #roulette, #pause, #roundCard, #arenaInfo, #mpResult {
  background-color: rgba(8, 6, 12, 0.86) !important;
}
#roulette { background: rgba(8, 6, 12, 0.94) !important; }
.screen:not(.menu-screen)::before, #select::before {
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px) !important;
  opacity: 1 !important;
}
.menu-panel .mp-dots { display: none !important; }

/* Landscape tip on phones held upright. It explains and offers full screen
   landscape; the game still works upright if the player keeps it that way. */
#rotateTip {
  position: fixed; inset: 0; z-index: 9500;
  display: grid; place-items: center;
  background: rgba(8, 5, 14, 0.86);
  backdrop-filter: blur(3px);
  padding: 16px;
}
#rotateTip.hidden { display: none; }
#rotateTip .sheet { text-align: center; max-width: 360px; }
#rotateTip .big-btn { width: 100%; margin-top: 10px; }
.rotate-phone { width: 44px; height: 72px; margin: 6px auto 10px; border: 3px solid #3ec8ff; border-radius: 9px;
  box-shadow: 0 0 14px rgba(62, 200, 255, 0.6); position: relative; animation: rotPhone 2.2s ease-in-out infinite; }
.rotate-phone span { position: absolute; left: 50%; bottom: 5px; width: 8px; height: 3px; margin-left: -4px; background: #3ec8ff; border-radius: 2px; }
@keyframes rotPhone { 0%, 25% { transform: rotate(0deg); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0deg); } }
@media (prefers-reduced-motion: reduce) { .rotate-phone { animation: none; transform: rotate(-90deg); } }

/* ========================= co-op control help under each slot (desktop only) */
.slot-keys { display: none; }
body[data-platform="desktop"] #roster.coop-keys .slot-keys {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 5px 0;
  padding: 5px 5px 4px;
  border-radius: 7px;
  border: 1px dashed color-mix(in srgb, var(--c) 45%, rgba(255,255,255,0.15));
  background: rgba(0, 0, 0, 0.36);
  text-align: left;
}
.slot-keys .sk-row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.slot-keys b {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: clamp(6px, 0.72vw, 9px);
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--c) 80%, #fff);
  white-space: nowrap;
}
.slot-keys i {
  font-style: normal;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(8px, 0.95vw, 12px);
  color: #f4e6d4;
  text-align: right;
}
.slot-card.off .slot-keys { opacity: 1; }
/* keep the control help readable on CPU slots: dim the card parts, not the whole card */
body[data-platform="desktop"] #roster.coop-keys .slot-card.off { opacity: 1; filter: none; }
body[data-platform="desktop"] #roster.coop-keys .slot-card.off > :not(.slot-keys) { opacity: 0.42; filter: saturate(0.25) brightness(0.7); }
body[data-platform="desktop"] #roster.coop-keys .slot-card.off.next > :not(.slot-keys) { opacity: 0.72; filter: saturate(0.65) brightness(0.85); }
body[data-platform="desktop"] #roster.coop-keys .slot-card.off .slot-keys { border-color: rgba(244, 230, 212, 0.28); }
body[data-platform="desktop"] #roster.coop-keys .slot-card.off .slot-keys b { color: rgba(244, 230, 212, 0.75); }

/* ========================= menu footer keys: BACK (ESC) / START (ENTER), desktop only */
.menu-keys { display: none; }
body[data-platform="desktop"] #app:not(.in-game) ~ #menuKeys.on {
  display: flex;
  position: fixed; left: 50%; bottom: calc(max(4px, env(safe-area-inset-bottom)) + 4px);
  transform: translateX(-50%); z-index: 24;
  gap: 14px; align-items: baseline;
  padding: 4px 10px; border-radius: 7px;
  border: 1px dashed rgba(244, 230, 212, 0.28);
  background: rgba(0, 0, 0, 0.36);
  pointer-events: none; white-space: nowrap;
}
.menu-keys .mk { display: inline-flex; align-items: baseline; gap: 6px; }
.menu-keys b {
  font-family: "Silkscreen", monospace; font-weight: 700;
  font-size: clamp(8px, 0.8vw, 10px); letter-spacing: 0.06em;
  color: #FFC93C;
}
.menu-keys i {
  font-style: normal; font-family: "Pixelify Sans", sans-serif; font-weight: 700;
  font-size: clamp(10px, 1vw, 13px); color: #f4e6d4;
}
/* the new footer replaces the older per-screen ESC labels on desktop */
body[data-platform="desktop"] .sub-key, body[data-platform="desktop"] .sel-key { display: none; }

/* ---- READY per slot: the confirmed crew lights up with READY across its centre ---- */
.slot-ready {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  transform: translate(-50%, -50%) rotate(-8deg) scale(0.6);
  opacity: 0;
  pointer-events: none;
  padding: 0.18em 0.5em 0.12em;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 900;
  font-size: clamp(14px, 2.6vw, 30px);
  letter-spacing: 0.08em;
  line-height: 1;
  color: #17111f;
  background: var(--c);
  border: 2px solid #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 3px #17111f, 0 0 22px var(--c), 0 0 46px color-mix(in srgb, var(--c) 55%, transparent);
  text-shadow: none;
  white-space: nowrap;
  visibility: hidden;
  transition: opacity 140ms ease, transform 180ms cubic-bezier(.2,1.6,.4,1);
}
.slot-card:not(.ready) .slot-ready { display: none; }
.slot-card.ready .slot-ready { visibility: visible; opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); }
.slot-card.ready {
  border-color: var(--c);
  box-shadow: 0 0 0 2px var(--c), 0 0 34px color-mix(in srgb, var(--c) 55%, transparent), inset 0 0 26px color-mix(in srgb, var(--c) 22%, transparent);
}
.slot-card.ready .slot-state { color: var(--c); }
.slot-card.ready-pop .slot-ready { animation: slotReadyPop 320ms cubic-bezier(.2,1.6,.4,1); }
@keyframes slotReadyPop {
  0% { transform: translate(-50%, -50%) rotate(-8deg) scale(1.7); opacity: 0; }
  100% { transform: translate(-50%, -50%) rotate(-8deg) scale(1); opacity: 1; }
}
#rosterStart.locked {
  filter: grayscale(0.9) brightness(0.55);
  opacity: 0.6;
  cursor: not-allowed;
}
#rosterStart.nope { animation: startNope 300ms ease; }
@keyframes startNope {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ============================================ CREW slot: tap/select prompt */
.slot-tap {
  position: absolute;
  left: 50%;
  bottom: 7px;
  z-index: 3;
  transform: translateX(-50%);
  display: none;
  padding: 0.28em 0.62em 0.22em;
  border-radius: 999px;
  background: rgba(10, 7, 16, 0.84);
  border: 2px solid var(--c);
  color: #fff;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(8px, 1.15vw, 13px);
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 0 #07050b;
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 55%, transparent);
  animation: slotTapPulse 1.4s ease-in-out infinite;
}
.slot-tap.show { display: block; }
@keyframes slotTapPulse {
  0%, 100% { opacity: 0.72; transform: translateX(-50%) scale(0.97); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

/* ========================= mobile: BACK pinned to the top-left of the box */
body[data-platform="mobile"] #settings .sheet,
body[data-platform="mobile"] #howto .sheet,
body[data-platform="mobile"] .submenu-screen .submenu-wrap {
  position: relative !important;
}
body[data-platform="mobile"] #settings .sheet > .big-btn[data-back="menu"],
body[data-platform="mobile"] #howto .sheet > .big-btn[data-back="menu"] {
  position: absolute !important;
  top: clamp(10px, 2vh, 16px) !important;
  left: clamp(10px, 2.4vw, 20px) !important;
  right: auto !important;
  bottom: auto !important;
  grid-column: auto !important;
  justify-self: start !important;
  align-self: start !important;
  margin: 0 !important;
  width: auto !important;
  min-width: 0 !important;
  padding: clamp(6px, 1.4vh, 11px) clamp(12px, 3vw, 20px) !important;
  font-size: clamp(13px, 2.3vh, 20px) !important;
  line-height: 1 !important;
  z-index: 7;
}
body[data-platform="mobile"] #howto .sheet,
body[data-platform="mobile"] #settings .sheet {
  padding-top: clamp(56px, 8.6vh, 72px) !important;
}
body[data-platform="mobile"] .submenu-screen .submenu-wrap > .submenu-foot {
  position: absolute !important;
  top: clamp(10px, 2vh, 16px) !important;
  left: clamp(10px, 2.4vw, 20px) !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  gap: 0 !important;
  z-index: 7;
}
body[data-platform="mobile"] .submenu-screen .submenu-wrap > .submenu-foot .sub-key { display: none !important; }
body[data-platform="mobile"] .submenu-screen .submenu-wrap > .submenu-foot .big-btn {
  padding: clamp(6px, 1.4vh, 11px) clamp(12px, 3vw, 20px) !important;
  font-size: clamp(13px, 2.3vh, 20px) !important;
  line-height: 1 !important;
}
body[data-platform="mobile"] .submenu-screen .submenu-kicker {
  align-self: stretch !important;
  text-align: left !important;
  padding-left: clamp(92px, 24vw, 112px) !important;
  padding-right: 8px !important;
}

/* =====================================================================
   HOW TO PLAY + MINIGAMES boxes: BACK pinned to the top-left of the box,
   an inner scroll area for the long content, and bobbing arrows that say
   whether there is more to read above or below.
   ===================================================================== */
.box-back {
  position: absolute !important;
  top: clamp(12px, 2.2vh, 20px) !important;
  left: clamp(12px, 2.6vw, 24px) !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  width: auto !important;
  min-width: 0 !important;
  padding: clamp(7px, 1.6vh, 12px) clamp(14px, 3vw, 24px) !important;
  font-size: clamp(14px, 2.6vh, 22px) !important;
  line-height: 1 !important;
  transform: none !important;
  z-index: 8 !important;
}
.box-back:hover, .box-back:focus-visible { transform: translateY(-2px) !important; }

#howto .sheet { max-height: min(94vh, 780px) !important; }
#howto .sheet.wide,
#select .sel-wrap {
  width: min(94vw, 980px) !important;
  padding-top: clamp(60px, 9vh, 82px) !important;
}
#select .sel-wrap {
  max-height: min(94vh, 780px) !important;
  min-height: 0 !important;
  justify-content: flex-start !important;
}

.box-scroll {
  position: relative;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 2px 10px 26px 2px !important;
  scrollbar-width: thin;
  scrollbar-color: #F1E4D2 #2a1d38;
}
.box-scroll::-webkit-scrollbar { width: 12px; }
.box-scroll::-webkit-scrollbar-track { background: rgba(244, 230, 212, 0.14); border-radius: 6px; margin: 6px 0; }
.box-scroll::-webkit-scrollbar-thumb { background: #F1E4D2; border-radius: 6px; border: 3px solid #17101f; }

.box-cue {
  position: absolute;
  left: 50%;
  z-index: 8;
  pointer-events: none;
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 3.4vh, 30px);
  line-height: 1;
  color: #FFE45C;
  text-shadow: 0 2px 0 #07050b, 0 0 14px rgba(255, 228, 92, 0.75);
  opacity: 0;
  transition: opacity 180ms ease;
}
.box-cue.on { opacity: 0.95; }
.box-cue-up { top: clamp(70px, 12vh, 104px); animation: boxCueUp 1.25s ease-in-out infinite; }
.box-cue-down { bottom: clamp(48px, 8vh, 72px); animation: boxCueDown 1.25s ease-in-out infinite; }
@keyframes boxCueUp {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}
@keyframes boxCueDown {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}
/* On phone portrait the boxes are tall; keep the arrows inside the rim. */
@media (max-width: 680px) {
  #howto .sheet.wide, #select .sel-wrap { width: min(96vw, 980px) !important; }
  .box-cue-up { top: clamp(64px, 10vh, 90px); }
  .box-cue-down { bottom: clamp(42px, 7vh, 64px); }
}

/* A visible scroll rail inside the box, so the long content reads as scrollable
   on every platform (native overlay scrollbars hide themselves). */
.box-rail {
  position: absolute;
  right: clamp(5px, 0.9vw, 12px);
  width: 9px;
  border-radius: 6px;
  background: rgba(244, 230, 212, 0.14);
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}
.box-rail.on { opacity: 1; }
.box-rail-thumb {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 24px;
  border-radius: 6px;
  background: #F1E4D2;
  box-shadow: 0 0 8px rgba(255, 228, 92, 0.55);
}

/* BACK pinned to the top-left of every menu box (Select Mode, Select Crew,
   Options, Mechanics, Minigames, Controls), landscape and portrait. */
.submenu-screen .submenu-wrap,
.roster-wrap { padding-top: clamp(46px, 7.5vh, 66px) !important; }
#settings .sheet { padding-top: clamp(58px, 9vh, 82px) !important; }

/* ---- online queue (MULTIPLAYER) ---- */
#hud .row.off-seat { display: none !important; }
#roster.online .slot-card.online-other .slot-controls { visibility: hidden; }
#roster.online .slot-card.online-other { cursor: default; }
#roster.online .slot-keys { display: none !important; }
#roster.online .slot-card.off .slot-empty { animation: mpBlink 1.4s ease-in-out infinite; }
@keyframes mpBlink { 50% { opacity: .35; } }
.mp-codebox { margin: 10px 0 6px; }
.mp-codebox input {
  font-family: "Pixelify Sans", monospace; font-size: 20px; letter-spacing: .45em;
  text-align: center; padding: 8px 10px;
}
#mpWarn .mp-status { margin-bottom: 10px; }
#multi .multi-sheet { position: relative; }
#multi #mpWaiting:empty { display: none; }
#multi .multi-sheet > .sheet-kicker { padding: 0 96px; }
