:root {
  --red: #c81e2c;
  --red-deep: #7a0d18;
  --red-hot: #ff3b4e;
  --gold: #e8c36a;
  --gold-deep: #9a6d22;
  --brass: #d7a441;
  --cream: #f4e4c1;
  --sand: #c9a66b;
  --ink: #140306;
  --ink-2: #1e0a0c;
  --glass: rgba(20, 6, 8, 0.72);
  --glass-2: rgba(42, 12, 16, 0.82);
  --line: rgba(232, 195, 106, 0.45);
  --display: "Cinzel", "Times New Roman", serif;
  --sans: "Sora", "Trebuchet MS", sans-serif;
  --mono: "Oxanium", ui-monospace, monospace;
  --topbar-h: 92px;
  --rail-h: 86px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 400;
  min-height: 100%;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}
body { position: relative; isolation: isolate; }
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

#world-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #0c0304;
}
#world { width: 100%; height: 100%; display: block; }

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 4;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.08) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.28;
}

.hud-corners { position: fixed; inset: 10px; z-index: 5; pointer-events: none; }
.hud-corners .c {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(232, 195, 106, 0.55);
}
.c-tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.c-tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.c-bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.c-br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* ===== LOADER ===== */
#loader {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: radial-gradient(ellipse at 50% 40%, #3a0a10 0%, #100204 62%, #070102 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
#loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-floods { position: absolute; inset: 0; pointer-events: none; }
.flood {
  position: absolute;
  width: 28vw;
  height: 140%;
  top: -20%;
  background: linear-gradient(to bottom, rgba(255, 230, 160, 0.0), rgba(255, 210, 110, 0.22), rgba(255, 180, 80, 0));
  filter: blur(18px);
  opacity: 0;
  transform: translateY(-12%) scaleX(0.2);
  mix-blend-mode: screen;
}
.f1 { left: 8%; }
.f2 { left: 32%; }
.f3 { left: 56%; }
.f4 { left: 78%; }
#loader[data-state="floods"] .flood,
#loader[data-state="charge"] .flood,
#loader[data-state="ring"] .flood,
#loader[data-state="enter"] .flood {
  animation: flood-on 0.8s ease forwards;
}
#loader[data-state="floods"] .f2 { animation-delay: 0.18s; }
#loader[data-state="floods"] .f3 { animation-delay: 0.32s; }
#loader[data-state="floods"] .f4 { animation-delay: 0.46s; }
#loader[data-state="charge"] .flood,
#loader[data-state="ring"] .flood,
#loader[data-state="enter"] .flood { opacity: 0.85; transform: none; animation: none; }
@keyframes flood-on {
  to { opacity: 0.9; transform: none; }
}

.loader-core {
  position: relative;
  z-index: 2;
  text-align: center;
  width: min(560px, 92vw);
  padding: 12px;
}
.bell-rig {
  width: 168px;
  height: 168px;
  margin: 0 auto 18px;
  position: relative;
  display: grid;
  place-items: center;
}
.charge-ring, .brass-bell { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-track { fill: none; stroke: rgba(232, 195, 106, 0.2); stroke-width: 3; }
.ring-fill {
  fill: none;
  stroke: #f3d789;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transform-origin: 60px 60px;
  transform: rotate(-90deg);
}
#loader[data-state="charge"] .ring-fill,
#loader[data-state="ring"] .ring-fill,
#loader[data-state="enter"] .ring-fill {
  animation: charge 1.25s ease-out forwards;
}
#loader[data-state="ring"] .ring-fill,
#loader[data-state="enter"] .ring-fill { stroke-dashoffset: 0; animation: none; }
@keyframes charge { to { stroke-dashoffset: 0; } }

.brass-bell { padding: 18%; filter: drop-shadow(0 8px 16px rgba(0,0,0,.55)); }
#loader[data-state="ring"] .brass-bell,
#loader[data-state="enter"] .brass-bell {
  animation: bell-ring 0.7s cubic-bezier(.2,.8,.2,1);
}
@keyframes bell-ring {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-18deg); }
  40% { transform: rotate(16deg); }
  60% { transform: rotate(-10deg); }
  80% { transform: rotate(6deg); }
}
#loader[data-state="ring"] .clapper,
#loader[data-state="enter"] .clapper {
  animation: clap 0.7s ease;
}
@keyframes clap {
  20% { transform: translateX(-4px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-2px); }
}

.loader-log {
  font-family: var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold);
  margin: 0 0 14px;
  min-height: 1.2em;
}
.loader-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 7vw, 54px);
  line-height: 0.95;
  letter-spacing: 0.04em;
  margin: 0;
  color: #fff6df;
  text-shadow: 0 0 30px rgba(255, 200, 80, 0.35), 0 2px 0 #6a1a14;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
}
#loader[data-state="enter"] .loader-title,
#loader[data-state="ring"] .loader-title {
  animation: title-in 0.55s 0.05s ease forwards;
}
@keyframes title-in { to { opacity: 1; transform: none; } }
.loader-sub {
  margin: 12px 0 0;
  font-family: var(--mono);
  letter-spacing: 0.16em;
  font-size: 11px;
  color: rgba(244, 228, 193, 0.7);
  opacity: 0;
}
#loader[data-state="enter"] .loader-sub { animation: title-in 0.5s 0.2s ease forwards; }

/* ===== TOP BAR ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  min-height: calc(var(--topbar-h) + var(--safe-t));
  background: linear-gradient(to bottom, rgba(12, 2, 4, 0.82), rgba(12, 2, 4, 0.2) 86%, transparent);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.75), 0 0 20px rgba(200, 30, 44, 0.55);
  flex: 0 0 auto;
}
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.brand-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--gold);
  white-space: nowrap;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
  flex-wrap: wrap;
}
.pit-clock {
  font-family: var(--mono);
  text-align: right;
  flex: 0 0 auto;
}
.clock-kicker {
  display: block;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--gold);
  opacity: 0.8;
}
#pit-clock {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff6df;
  font-variant-numeric: tabular-nums;
}

/* ===== BUTTONS ===== */
.btn {
  border: 0;
  position: relative;
  isolation: isolate;
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.94) translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.btn-buy {
  --w: 86px;
  width: var(--w);
  height: 64px;
  background:
    linear-gradient(180deg, #ff5a63 0%, #c81e2c 42%, #7a0d18 100%);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 13px;
  clip-path: polygon(
    50% 0%,
    68% 10%,
    62% 28%,
    86% 92%,
    50% 78%,
    14% 92%,
    38% 28%,
    32% 10%
  );
  box-shadow: 0 8px 18px rgba(160, 0, 20, 0.45);
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
.btn-buy::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.35) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}
.btn-buy:hover::after { transform: translateX(120%); }
.btn-face { position: relative; top: 2px; }

.btn-ca {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 16px 6px 14px;
  background:
    repeating-linear-gradient(
      -12deg,
      #f3e2b8 0 8px,
      #ead6a2 8px 16px
    );
  color: #3a140c;
  clip-path: polygon(
    8px 0,
    calc(100% - 14px) 0,
    100% 8px,
    100% calc(100% - 8px),
    calc(100% - 14px) 100%,
    8px 100%,
    0 calc(100% - 10px),
    0 10px
  );
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  max-width: 100%;
}
.ca-kicker {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  opacity: 0.7;
}
.ca-val {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.ca-copy {
  font-family: var(--display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 4px 6px;
  background: rgba(60, 20, 12, 0.12);
}

.btn-x {
  width: 56px;
  height: 56px;
  border-radius: 46% 46% 40% 40% / 42% 42% 50% 50%;
  background: radial-gradient(circle at 35% 30%, #5a3a28, #2a160e 62%, #140804);
  color: var(--cream);
  display: grid;
  place-items: center;
  grid-template-rows: 18px 14px;
  box-shadow: 0 0 0 2px #e8c36a, 0 8px 16px rgba(0,0,0,0.45);
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
}
.btn-x .fist { font-size: 14px; line-height: 1; }

.btn-text {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--gold);
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.btn-tg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  background: radial-gradient(circle at 30% 20%, #3a2a16, #1a1008);
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--brass), inset 0 0 0 3px rgba(0,0,0,0.35);
  font-family: var(--mono);
  letter-spacing: 0.1em;
  font-size: 11px;
}
.badge-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: conic-gradient(from 20deg, #7a4e12, #f3d789, #7a4e12);
  color: #1a0c08;
}

.btn-go {
  min-height: 64px;
  padding: 0 22px;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.12em;
  background: linear-gradient(180deg, #5cff8a, #148a3a 60%, #0b4a1e);
  color: #04210c;
  clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
  box-shadow: 0 0 24px rgba(40, 200, 90, 0.35);
  font-size: 15px;
}
.btn-go:disabled {
  filter: grayscale(0.7) brightness(0.6);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-grab {
  width: auto;
  min-width: 168px;
  height: 52px;
  font-size: 13px;
  letter-spacing: 0.12em;
  clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
  padding: 0 22px;
}
.btn-hold {
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, #5a3dff, #2a157a 70%);
  color: #efe8ff;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
  box-shadow: 0 8px 20px rgba(40, 20, 120, 0.45);
}

/* ===== PANELS ===== */
#stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  perspective: 1400px;
  perspective-origin: 50% 40%;
}
.panel {
  position: absolute;
  width: min(460px, 42vw);
  max-height: calc(100dvh - var(--topbar-h) - var(--rail-h) - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: none;
  padding: 18px 18px 16px;
  background:
    linear-gradient(160deg, rgba(48, 14, 18, 0.82), rgba(16, 4, 6, 0.78));
  border: 1px solid rgba(232, 195, 106, 0.28);
  box-shadow:
    0 20px 50px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255, 230, 180, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 4px 18px 18px 4px;
  opacity: 0;
  transform: translate3d(0, 24px, -220px) rotateX(10deg);
  filter: blur(14px);
  transition:
    opacity 0.7s ease,
    transform 0.8s cubic-bezier(.16,1,.3,1),
    filter 0.7s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-deep) transparent;
}
.panel.is-on {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) rotateX(0);
  filter: blur(0);
}
.dock-left { top: calc(var(--topbar-h) + var(--safe-t) + 8px); left: 22px; }
.dock-right {
  top: calc(var(--topbar-h) + var(--safe-t) + 8px);
  right: 22px;
  left: auto;
  border-radius: 18px 4px 4px 18px;
}
.dock-bottom {
  left: 50%;
  right: auto;
  top: auto;
  bottom: calc(var(--rail-h) + var(--safe-b) + 10px);
  width: min(860px, 86vw);
  transform: translate3d(-50%, 30px, -180px) rotateX(8deg);
  border-radius: 18px;
}
.dock-bottom.is-on { transform: translate3d(-50%, 0, 0) rotateX(0); }

.kicker {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.headline {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 0.95;
  letter-spacing: 0.03em;
  margin: 0 0 10px;
  color: #fff6df;
  text-wrap: balance;
}
.headline.sm { font-size: clamp(22px, 3vw, 34px); }
.headline .word { display: inline-block; white-space: nowrap; }
.headline .ch {
  display: inline-block;
  transform-origin: 50% 70%;
  animation: flip-in 0.6s calc(var(--i) * 28ms) cubic-bezier(.2,.8,.2,1) both;
}
@keyframes flip-in {
  from { transform: rotateX(85deg); opacity: 0; filter: blur(6px); }
  to { transform: none; opacity: 1; filter: none; }
}
.subhead {
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin: 0 0 12px;
}
.lede {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(244, 228, 193, 0.88);
}
.hint-line {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(232, 195, 106, 0.8);
}

.jumbo-board {
  min-height: 180px;
  max-height: 280px;
  overflow: auto;
  padding: 14px 14px 16px;
  margin: 0 0 12px;
  background:
    linear-gradient(180deg, #1a0c08 0%, #0c0706 100%);
  border: 1px solid rgba(232, 195, 106, 0.3);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.6);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: #f3d789;
  white-space: pre-wrap;
  word-break: break-word;
}
.jumbo-board .cursor-block::after {
  content: "█";
  display: inline-block;
  margin-left: 1px;
  animation: blink 1s steps(1) infinite;
  color: #fff1b0;
}
@keyframes blink { 50% { opacity: 0; } }

.art-frame {
  margin: 14px 0 0;
  padding: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(232, 195, 106, 0.3);
}
.art-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  animation: ken 18s ease-in-out infinite alternate;
  transform-origin: 50% 40%;
}
@keyframes ken {
  from { transform: scale(1.04) translate3d(0,0,0); }
  to { transform: scale(1.12) translate3d(-1%, 1%, 0); }
}
.art-frame figcaption {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #fff6df;
  text-shadow: 0 1px 4px #000;
}


.kicker.tight { margin-top: 14px; }

/* ===== ARENA TAPE PLAYER ===== */
.arena-player { margin: 4px 0 0; }
.player-stage {
  position: relative;
  background: #0a0406;
  border: 1px solid rgba(232, 195, 106, 0.35);
  overflow: hidden;
  aspect-ratio: 1280 / 536;
}
.player-stage video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
}
.player-big {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 2, 4, 0.28);
  color: #fff6df;
  font-size: 42px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.player-stage.is-playing .player-big { opacity: 0; pointer-events: none; }
.player-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 7px;
  background: linear-gradient(to top, rgba(10,2,3,0.92), rgba(10,2,3,0.2));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.player-stage:hover .player-bar,
.player-stage:focus-within .player-bar,
.player-stage:not(.is-playing) .player-bar { opacity: 1; }
.player-ctrl {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(232, 195, 106, 0.4);
  background: rgba(40, 10, 12, 0.8);
  color: #fff6df;
  font-size: 12px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.player-seek {
  flex: 1 1 auto;
  min-width: 0;
  appearance: none;
  height: 4px;
  background: rgba(232, 195, 106, 0.25);
  outline: none;
  cursor: pointer;
  accent-color: #c81e2c;
}
.player-seek::-webkit-slider-thumb {
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #c81e2c;
  box-shadow: 0 0 0 2px #f3d789;
}
.player-time {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--gold);
  white-space: nowrap;
}
.player-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 8px 0 0;
}
.player-thumbs .thumb {
  border: 1px solid rgba(232, 195, 106, 0.28);
  background: #100406;
  padding: 0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 9;
}
.player-thumbs .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.player-thumbs .thumb span {
  position: absolute;
  left: 4px;
  bottom: 3px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: #fff6df;
  text-shadow: 0 1px 3px #000;
}
.player-thumbs .thumb:hover,
.player-thumbs .thumb:focus-visible { outline: 1px solid var(--gold); }
.player-credit {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.45;
  color: rgba(244, 228, 193, 0.7);
}
.player-credit cite { font-style: normal; color: #fff6df; }
.player-credit a { color: var(--gold); }

/* games */
.tie-track {
  position: relative;
  height: 28px;
  margin: 14px 0;
  background: linear-gradient(180deg, #8b1018, #c81e2c 40%, #5a0a10);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 200, 200, 0.2), 0 6px 16px rgba(0,0,0,0.35);
  overflow: hidden;
}
.tie-blade {
  position: absolute;
  right: 0; top: 0; bottom: 0; width: 22px;
  background: linear-gradient(180deg, #e34, #800);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.tie-knot {
  position: absolute;
  left: 4px; top: 3px; bottom: 3px; width: 22px;
  background: radial-gradient(circle at 40% 30%, #ff6a6a, #7a0d18);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.tie-zone {
  position: absolute;
  top: 0; bottom: 0;
  left: 58%;
  width: 16%;
  background: rgba(255, 230, 120, 0.45);
  box-shadow: 0 0 16px rgba(255, 220, 80, 0.6);
  mix-blend-mode: screen;
}
.tie-spark {
  position: absolute;
  top: 3px; bottom: 3px;
  width: 10px;
  left: 8%;
  background: #fff6df;
  border-radius: 2px;
  box-shadow: 0 0 12px #fff, 0 0 22px var(--gold);
  transform: translateX(-50%);
}
.game-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.scores {
  display: flex;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--gold);
}
.scores b { color: #fff6df; font-size: 16px; margin-left: 4px; }

.hold-meter {
  height: 22px;
  background: #1a0c10;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hold-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, #3a1570, #7a4dff 50%, #ffe27a);
  box-shadow: 0 0 16px rgba(140, 80, 255, 0.6);
  transition: width 0.06s linear;
}
.hold-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #fff6df;
  text-shadow: 0 1px 2px #000;
}

.go-switch {
  position: relative;
  width: min(280px, 100%);
  min-height: 86px;
  background: #1a100c;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 10px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.6);
}
.go-switch .cover {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #c9a45a, #6a4a18 60%, #3a280c);
  color: #1a1008;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.12em;
  border: 0;
  transform-origin: top center;
  transform: rotateX(0);
  transition: transform 0.55s cubic-bezier(.2,.8,.2,1), opacity 0.3s ease;
  box-shadow: 0 8px 16px rgba(0,0,0,0.45);
  z-index: 2;
  display: grid;
  place-items: center;
  backface-visibility: hidden;
}
.go-switch.is-open .cover {
  transform: rotateX(112deg);
  opacity: 0.15;
  pointer-events: none;
}
.bell-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin: 8px 0 16px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.shot {
  border: 1px solid rgba(232, 195, 106, 0.3);
  padding: 0;
  background: #100406;
  overflow: hidden;
  aspect-ratio: 4/3;
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.shot:hover img { transform: scale(1.08); }

.disclaimer {
  margin: 16px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(244, 228, 193, 0.62);
}

/* ===== TIE RAIL ===== */
.tie-rail {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 22;
  height: calc(var(--rail-h) + var(--safe-b));
  padding: 8px 12px calc(8px + var(--safe-b));
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(to top, rgba(10, 2, 3, 0.92), rgba(10, 2, 3, 0.4) 70%, transparent);
}
.btn-auto {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(40, 10, 12, 0.85);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 10px 10px;
  min-width: 88px;
}
.btn-auto[aria-pressed="true"] {
  background: var(--red);
  color: #fff6df;
  border-color: var(--red-hot);
  box-shadow: 0 0 16px rgba(200, 30, 44, 0.5);
}
.tie-drag {
  flex: 1 1 auto;
  position: relative;
  height: 64px;
  min-width: 0;
  cursor: grab;
  touch-action: none;
}
.tie-drag:active { cursor: grabbing; }
.tie-svg { width: 100%; height: 100%; overflow: visible; }
.tie-body {
  fill: none;
  stroke: #c81e2c;
  stroke-width: 14;
  stroke-linecap: round;
  filter: drop-shadow(0 4px 0 #5a0a10);
}
.tie-shadow { fill: none; stroke: #3a0508; stroke-width: 18; stroke-linecap: round; }
.tie-tip { fill: #c81e2c; }
.tie-knot-shape { fill: #ff4d55; stroke: #7a0d18; stroke-width: 1; }
.knots {
  position: absolute;
  inset: 0 18px 0 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.knot {
  pointer-events: auto;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--cream);
  min-width: 44px;
  padding: 0;
}
.knot .bead {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3a1010;
  box-shadow: 0 0 0 3px #c81e2c, 0 0 0 5px #f3d789;
  transition: transform 0.2s ease, background 0.2s ease;
}
.knot.is-on .bead {
  background: #fff6df;
  transform: scale(1.2);
  box-shadow: 0 0 0 3px #ff4d55, 0 0 16px #f3d789;
}
.knot span.lbl {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ===== TOASTS / FX / LIGHTBOX ===== */
#toasts {
  position: fixed;
  top: calc(var(--topbar-h) + var(--safe-t) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, 92vw);
  pointer-events: none;
}
.toast {
  background: linear-gradient(180deg, #3a1a10, #1a0808);
  border: 1px solid var(--gold);
  color: #fff6df;
  padding: 12px 16px;
  font-family: var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 12px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  animation: toast-in 0.35s ease;
}
@keyframes toast-in {
  from { transform: translateY(-10px) scale(0.96); opacity: 0; }
  to { transform: none; opacity: 1; }
}

#fx { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.fx-banner {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) scale(0.8);
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(40px, 10vw, 110px);
  letter-spacing: 0.04em;
  color: #fff6df;
  text-shadow: 0 0 24px rgba(200,30,44,0.8), 0 4px 0 #5a0a10;
  opacity: 0;
  text-align: center;
  width: 90%;
}
.fx-banner.is-on {
  animation: banner-pop 1.15s cubic-bezier(.2,.8,.2,1);
}
.fx-banner.is-fail { color: #ff6a6a; }
@keyframes banner-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotateX(40deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -46%) scale(1.1); }
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(6, 1, 2, 0.88);
  display: grid;
  place-items: center;
  padding: 24px;
}
#lightbox[hidden] { display: none !important; }
#lb-img { max-width: min(1200px, 94vw); max-height: 82dvh; object-fit: contain; box-shadow: 0 20px 60px #000; }
.lb-close {
  position: absolute;
  top: 14px; right: 16px;
  background: transparent;
  border: 0;
  color: #fff6df;
  font-size: 40px;
  line-height: 1;
}
.lb-cap {
  position: absolute;
  bottom: 16px;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--display);
  letter-spacing: 0.12em;
  color: var(--gold);
}

/* ===== MOBILE ===== */
@media (max-width: 900px) {
  :root { --topbar-h: 118px; --rail-h: 78px; }
  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 10px;
    padding-bottom: 8px;
  }
  .brand { width: auto; }
  .pit-clock { margin-left: auto; }
  .cta-row {
    flex: 1 1 100%;
    justify-content: flex-start;
    order: 3;
  }
  .brand-name { font-size: 13px; }
  .brand-logo { width: 42px; height: 42px; }
  .btn-buy { --w: 72px; height: 54px; font-size: 11px; }
  .btn-x { width: 48px; height: 48px; }
  .btn-ca { min-height: 44px; padding: 4px 12px 4px 10px; }
  .ca-kicker { display: none; }

  .panel,
  .dock-left, .dock-right, .dock-bottom {
    top: auto;
    left: 0;
    right: 0;
    bottom: calc(var(--rail-h) + var(--safe-b));
    width: 100%;
    max-width: 100%;
    max-height: 46dvh;
    border-radius: 18px 18px 0 0;
    transform: translate3d(0, 40px, 0);
  }
  .panel.is-on,
  .dock-bottom.is-on { transform: translate3d(0, 0, 0); }

  .gallery { grid-template-columns: repeat(3, 1fr); }
  .headline { font-size: clamp(22px, 8vw, 36px); }
  .knot span.lbl { font-size: 8px; }
  .knot { min-width: 0; }
  .btn-auto { min-width: 72px; font-size: 9px; padding: 8px 6px; }
}

@media (max-width: 400px) {
  .brand-meta { font-size: 9px; }
  #pit-clock { font-size: 13px; }
  .cta-row { gap: 6px; }
}

@media (max-width: 900px) {
  #panel-save { max-height: 58dvh; }
  #panel-save .tie-track { margin: 8px 0; }
  #panel-save .kicker.tight { margin-top: 10px; }
  .player-credit { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .art-frame img { animation: none; }
  .scanlines { display: none; }
}

body.is-shake { animation: shake 0.45s linear; }
@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 1px, 0); }
  30%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, -1px, 0); }
  50% { transform: translate3d(-3px, 0, 0); }
}
