/* ==========================================================================
   TRAPDOOR — CSS Styling & Complete Visual Theme
   ========================================================================== */

:root {
  --bg-0: #06050b;
  --bg-1: #0e0a18;
  --bg-2: #161224;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.28);
  --ink: #f7f5ff;
  --ink-dim: #b2a8d4;
  --ink-dimmer: #786e9e;
  --accent: #ff384c;
  --accent-orange: #ff7324;
  --accent-yellow: #ffb833;
  --safe-green: #48e59b;
  --purple-glow: #9366ff;
  --radius: 18px;
  --font-retro: "Bungee", "Creepster", cursive, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(147, 102, 255, 0.18), transparent 65%),
    radial-gradient(1000px 700px at 80% 10%, rgba(255, 56, 76, 0.14), transparent 60%),
    radial-gradient(1400px 900px at 50% 110%, rgba(255, 115, 36, 0.08), transparent 70%),
    var(--bg-0);
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
}
.screen[data-active="true"] {
  display: flex;
}
.scene-screen[data-active="true"] {
  display: block;
  position: relative;
}

/* ---------- global floating controls ---------- */
.global-bar {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 50;
  display: flex;
  gap: 10px;
}
.sound-toggle-btn {
  background: rgba(22, 18, 36, 0.85);
  border: 2px solid var(--line-strong);
  color: var(--ink);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  transition: transform 0.12s ease, border-color 0.15s;
}
.sound-toggle-btn:hover {
  border-color: var(--accent-yellow);
  transform: scale(1.08);
}
.sound-toggle-btn:active {
  transform: scale(0.94);
}

/* ---------- decorative webs ---------- */
.web-corner {
  position: fixed;
  width: 280px;
  height: 280px;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    repeating-conic-gradient(from 0deg, rgba(255,255,255,0.9) 0deg 1.2deg, transparent 1.2deg 30deg),
    radial-gradient(circle, transparent 0 22px, rgba(255,255,255,0.6) 22.5px 23px, transparent 23.5px 40px,
      rgba(255,255,255,0.55) 40.5px 41px, transparent 41.5px 60px, rgba(255,255,255,0.5) 60.5px 61px, transparent 61.5px 85px);
  z-index: 0;
}
.web-corner--tl { top: -75px; left: -75px; }
.web-corner--tr { top: -75px; right: -75px; transform: scaleX(-1); }

/* ---------- HOME SCREEN ---------- */
.home-wrap {
  margin: auto;
  width: min(480px, 92vw);
  padding: 40px 0 60px;
  text-align: center;
  z-index: 1;
}
.logo-3d-box {
  position: relative;
  display: inline-block;
  margin: 0 auto 12px;
}
.logo-3d {
  font-family: "Bungee", cursive, sans-serif;
  font-size: clamp(3.0rem, 11vw, 4.6rem);
  letter-spacing: 0.05em;
  margin: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}
.logo-trap {
  color: #fff6e5;
  text-shadow:
    0 2px 0 #d9cbaf,
    0 4px 0 #b3a286,
    0 6px 0 #73644d,
    0 8px 0 #3b3020,
    0 12px 24px rgba(0, 0, 0, 0.9);
  transform: rotate(-3deg);
}
.logo-door {
  color: #ff3348;
  text-shadow:
    0 2px 0 #d4172c,
    0 4px 0 #9c0b1b,
    0 6px 0 #61030e,
    0 8px 0 #330006,
    0 12px 24px rgba(255, 51, 72, 0.5);
  transform: rotate(2deg);
}
.logo-spider-dangle {
  position: absolute;
  right: -24px;
  top: -30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: spider-sway 4s ease-in-out infinite;
  transform-origin: top center;
}
.spider-thread {
  width: 2px;
  height: 38px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}
.spider-body {
  font-size: 1.8rem;
  filter: drop-shadow(0 4px 10px rgba(255, 56, 76, 0.7));
}
@keyframes spider-sway {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}
.tagline {
  color: var(--ink-dim);
  font-size: 1.05rem;
  margin: 0 0 30px;
  font-weight: 500;
}

.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.field { display: block; text-align: left; margin-bottom: 18px; }
.field span {
  display: block;
  font-size: 0.84rem;
  color: var(--ink-dimmer);
  margin-bottom: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--ink);
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
input:focus {
  border-color: var(--purple-glow);
  background: rgba(147, 102, 255, 0.1);
}
input::placeholder { color: var(--ink-dimmer); font-weight: 500; }

.btn {
  border: none;
  border-radius: 12px;
  padding: 14px 22px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent-orange));
  color: #120306;
  font-weight: 900;
  font-size: 1.05rem;
  box-shadow: 0 10px 30px rgba(255, 56, 76, 0.4);
}
.btn-primary:hover {
  box-shadow: 0 12px 36px rgba(255, 56, 76, 0.55);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border: 2px solid var(--line);
}
.btn-big { padding: 16px 24px; font-size: 1.1rem; margin-top: 20px; }

.home-actions { display: flex; flex-direction: column; gap: 4px; }
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-dimmer); font-size: 0.8rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em;
  margin: 16px 0;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.join-row { display: flex; gap: 10px; }
.join-row input { text-transform: uppercase; letter-spacing: 0.22em; text-align: center; font-weight: 900; font-size: 1.15rem; }
.join-row .btn { flex-shrink: 0; padding: 14px 24px; }

.error { color: var(--accent); font-size: 0.88rem; min-height: 1.2em; margin: 12px 0 0; font-weight: 700; }
.hint { color: var(--ink-dimmer); font-size: 0.84rem; margin-top: 24px; }

.home-links { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.link-btn {
  background: rgba(255, 255, 255, 0.06); border: 2px solid var(--line); color: var(--ink-dim);
  border-radius: 999px; padding: 9px 18px; font-size: 0.85rem; font-weight: 700; cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}
.link-btn:hover { border-color: var(--purple-glow); color: var(--ink); }
.link-btn:active { transform: scale(0.96); }
.btn-back { width: auto; }

/* ---------- TOP BAR (Gallery, Custom) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 6, 15, 0.7);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* ==========================================================================
   LOBBY SCREEN (Matching Reference Screenshots 1 & 4)
   ========================================================================== */
#screen-lobby {
  background:
    radial-gradient(circle at 50% 50%, rgba(25, 18, 40, 0.4), rgba(4, 3, 8, 0.95) 75%),
    url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22100%22 height=%22100%22 opacity=%220.03%22%3E%3Cfilter id=%22noise%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.8%22 numOctaves=%223%22 stitchTiles=%22stitch%22/%3E%3C/filter%3E%3Crect width=%22100%22 height=%22100%22 filter=%22url(%23noise)%22/%3E%3C/svg%3E");
  position: relative;
  overflow: hidden;
}

.lobby-header-title {
  font-family: "Creepster", cursive;
  font-weight: 400;
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  text-align: center;
  margin: 24px 0 0;
  letter-spacing: 0.08em;
  color: #f7ede2;
  text-shadow:
    0 0 28px rgba(255, 255, 255, 0.3),
    0 6px 0 rgba(0, 0, 0, 0.8);
  z-index: 5;
  pointer-events: none;
}

/* Spider Web Canvas & Dangling Monster Avatars */
.lobby-web-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#lobbyWebCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.lobby-avatars-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Dangling Monster Sprite in Lobby */
.lobby-monster {
  position: absolute;
  pointer-events: auto;
  transform-origin: top center;
  animation: monster-sway 4.5s ease-in-out infinite alternate;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.65));
  transition: transform 0.2s ease;
  cursor: pointer;
}
.lobby-monster:hover {
  transform: scale(1.1) rotate(4deg);
}

@keyframes monster-sway {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}

/* Right-side Player List (matching Screenshot 1) */
.lobby-player-panel {
  position: absolute;
  top: 40%;
  right: 5vw;
  transform: translateY(-50%);
  z-index: 6;
}
.lobby-player-names {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}
.lobby-player-names li {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  gap: 10px;
}
.lobby-player-names li.host {
  color: #f7a833;
}
.lobby-player-names li .crown-icon {
  font-size: 1.2em;
  filter: drop-shadow(0 2px 6px rgba(247, 168, 51, 0.5));
}
.lobby-player-names li.empty-slot {
  color: rgba(255, 255, 255, 0.22);
}

/* Bottom Bar Buttons (Matching Screenshot 1) */
.lobby-bottom-bar {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 0 40px;
  z-index: 8;
  flex-wrap: wrap;
}

.lobby-btn-group {
  display: flex;
  gap: 16px;
}

/* Retro Bold Black Box Button with Thick White Border */
.lobby-block-btn {
  background: #000000;
  border: 3.5px solid #ffffff;
  color: #ffffff;
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  letter-spacing: 0.06em;
  padding: 12px 32px;
  cursor: pointer;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.7);
  transition: transform 0.1s ease, background 0.15s, border-color 0.15s;
}
.lobby-block-btn:hover {
  background: #181818;
  border-color: #ffd24d;
  color: #ffd24d;
}
.lobby-block-btn:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.7);
}
.lobby-block-btn.start {
  background: #000000;
}
.lobby-block-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: #666666;
  color: #666666;
}

/* Bottom-Right Room Code Badge (Matching Screenshot 1) */
.lobby-room-badge {
  position: absolute;
  right: 40px;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.lrb-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
}
.lrb-box {
  display: flex;
  align-items: center;
  background: #000000;
  border: 2.5px solid #ffffff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.6);
}
.lrb-copy-btn, .lrb-toggle-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.1rem;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.12s;
}
.lrb-copy-btn:hover, .lrb-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}
.lrb-code {
  font-family: "Manrope", system-ui, monospace;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 0.22em;
  color: #ffffff;
  padding: 4px 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.3);
  border-right: 2px solid rgba(255, 255, 255, 0.3);
}

/* Scare Picker Drawer */
.lobby-scare-drawer {
  position: absolute;
  top: 18px;
  left: 24px;
  z-index: 10;
}
.lobby-scare-drawer details {
  background: rgba(14, 10, 24, 0.88);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  backdrop-filter: blur(10px);
}
.lobby-scare-drawer summary {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
  outline: none;
}
.lobby-scare-drawer .scare-grid {
  margin-top: 12px;
  max-height: 240px;
  overflow-y: auto;
  width: 280px;
}

/* ==========================================================================
   3D GAMEPLAY SCENE & 4-CORNER HUD (Matching Screenshot 2)
   ========================================================================== */
.scene-screen { flex: 1; height: 100dvh; }
#boardCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* 4 Corner Player HUDs */
.corner-hud {
  position: absolute;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  font-family: "Manrope", system-ui, sans-serif;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}
.corner-hud.active-turn {
  animation: corner-pulse 1.8s ease-in-out infinite;
}
@keyframes corner-pulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 184, 51, 0.5)); }
  50% { filter: drop-shadow(0 0 24px rgba(255, 184, 51, 0.95)); }
}

.corner-top-left     { top: 22px; left: 24px; text-align: left; }
.corner-top-right    { top: 22px; right: 24px; text-align: right; }
.corner-bottom-left  { bottom: 24px; left: 24px; text-align: left; }
.corner-bottom-right { bottom: 24px; right: 24px; text-align: right; }

.corner-player-name {
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #48e59b; /* default bright green/player color */
}
.corner-player-name.me { color: #ffd24d; }
.corner-player-name.out { color: rgba(255, 255, 255, 0.35); text-decoration: line-through; }

.corner-hearts-row {
  display: flex;
  gap: 4px;
}
.corner-top-right .corner-hearts-row,
.corner-bottom-right .corner-hearts-row {
  justify-content: flex-end;
}
.corner-heart {
  font-size: 1.4rem;
  color: #ff3348;
  filter: drop-shadow(0 0 6px rgba(255, 51, 72, 0.6));
}
.corner-heart.lost {
  color: rgba(255, 255, 255, 0.18);
  filter: none;
}
.corner-shield {
  font-size: 1.1rem;
  margin-left: 4px;
}

/* In-Game HUD Elements */
.hud {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.hud-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 20px;
}
.hide-spiders-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 10, 24, 0.82);
  border: 2px solid var(--line);
  color: var(--ink-dim);
  padding: 5px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 0.15s, color 0.15s;
}
.hide-spiders-btn:hover { border-color: var(--purple-glow); color: var(--ink); }
.hide-spiders-btn.active {
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
  box-shadow: 0 0 16px rgba(255, 184, 51, 0.3);
}

.round-badge {
  background: rgba(14, 10, 24, 0.82);
  border: 2px solid var(--line);
  padding: 6px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--accent-yellow);
  backdrop-filter: blur(8px);
}

.hud-center {
  text-align: center;
  padding: 10px 20px;
}
.hud-center h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
}
.hud-center p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.95rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.hud-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 24px;
}
.turn-banner {
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  text-align: center;
  padding: 10px 24px;
  border-radius: 999px;
  background: rgba(22, 18, 36, 0.88);
  border: 2px solid var(--line);
  backdrop-filter: blur(8px);
}
.turn-banner.mine {
  background: linear-gradient(135deg, rgba(255, 56, 76, 0.4), rgba(255, 184, 51, 0.35));
  border-color: var(--accent-yellow);
  color: #ffffff;
}

.log-feed {
  width: max(200px, min(480px, calc(100vw - 260px)));
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--ink-dim);
  max-height: 90px;
  overflow: hidden;
}
.log-feed div {
  background: rgba(22, 18, 36, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  backdrop-filter: blur(6px);
}

/* ==========================================================================
   TURN CHOICE MODAL (CUP OR PACK) — Matching Screenshot 2
   ========================================================================== */
.choice-modal-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.choice-turn-header {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.9);
  margin: 0;
}

.choice-cards-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 36px);
}

.choice-option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.choice-option-card:hover {
  transform: translateY(-8px) scale(1.04);
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.6));
}
.choice-option-card:active {
  transform: translateY(-2px) scale(0.98);
}
.choice-option-card.remote-hover {
  transform: translateY(-8px) scale(1.04);
  filter: drop-shadow(0 0 26px rgba(255, 209, 102, 0.65));
}

/* 3D Red Solo Cup Visual Representation */
.cup-3d-visual {
  width: 140px;
  height: 180px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cup-solo-render {
  width: 100px;
  height: 140px;
  background: linear-gradient(135deg, #d3202f 0%, #a0101d 50%, #68050e 100%);
  clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
  border-radius: 4px;
  position: relative;
  box-shadow:
    inset 0 8px 12px rgba(255, 255, 255, 0.35),
    inset 0 -12px 16px rgba(0, 0, 0, 0.5),
    0 16px 30px rgba(0, 0, 0, 0.7);
}
.cup-solo-render::before {
  content: "";
  position: absolute;
  top: 35%;
  left: 0;
  right: 0;
  height: 25%;
  border-top: 3px solid rgba(255, 255, 255, 0.25);
  border-bottom: 3px solid rgba(0, 0, 0, 0.3);
}

/* Action Pack Foil Graphic (Matching Screenshot 2) */
.action-pack-visual {
  width: 140px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.action-pack-foil {
  width: 120px;
  height: 155px;
  background: linear-gradient(165deg, #1f42aa, #132463 80%);
  border: 3px solid #3c6bff;
  border-radius: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 24px rgba(60, 107, 255, 0.45),
    inset 0 0 16px rgba(255, 255, 255, 0.15),
    0 16px 30px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.action-pack-foil::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.25) 50%, transparent 60%);
  animation: foil-shimmer 3.5s infinite linear;
}
@keyframes foil-shimmer {
  0% { transform: translateY(-100%) rotate(25deg); }
  100% { transform: translateY(100%) rotate(25deg); }
}

.pack-spider-icon { font-size: 2.2rem; margin-bottom: 2px; }
.pack-title {
  font-family: "Bungee", cursive, sans-serif;
  font-size: 0.95rem;
  line-height: 1.1;
  color: #ff9d3b;
  text-shadow: 0 2px 0 #000000;
  text-align: center;
}
.pack-badge {
  font-size: 0.65rem;
  font-weight: 900;
  background: #ffffff;
  color: #000000;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 6px;
}

.choice-tag {
  margin-top: 10px;
  background: #000000;
  border: 2.5px solid #ffffff;
  color: #ffffff;
  font-weight: 900;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  padding: 4px 18px;
  border-radius: 4px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.6);
}

.choice-divider-or {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.pack-odds-meter {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #48e59b;
  margin-top: 6px;
}

/* ==========================================================================
   CARD DRAW OVERLAY (Matching Screenshot 3)
   ========================================================================== */
.card-draw-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.card-draw-header {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.9);
  margin: 0;
}

.action-card-face {
  width: min(320px, 85vw);
  background: #ffffff;
  border: 6px solid #ffffff;
  border-radius: 24px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.8),
    0 0 35px rgba(255, 56, 76, 0.35);
  overflow: hidden;
  position: relative;
  transition: transform 0.1s ease-out, box-shadow 0.15s ease-out;
  transform-style: preserve-3d;
  cursor: grab;
}
.card-holo-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.45) 0%, rgba(255,100,200,0.25) 35%, rgba(0,255,255,0.25) 65%, rgba(255,255,255,0.45) 100%);
  mix-blend-mode: color-dodge;
  opacity: 0.35;
  border-radius: 18px;
  z-index: 10;
}

.card-inner-frame {
  background: linear-gradient(180deg, #1b1626, #0e0a16);
  padding: 22px 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-radius: 16px;
}

.card-big-title {
  font-family: "Bungee", cursive, sans-serif;
  font-weight: 400;
  font-size: 2.1rem;
  margin: 0 0 12px;
  color: #ff3348;
  text-shadow:
    0 3px 0 #ffffff,
    0 4px 10px rgba(255, 51, 72, 0.5);
  letter-spacing: 0.02em;
}

.card-art-area {
  width: 190px;
  height: 145px;
  background: radial-gradient(circle, #382440, #181022);
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  overflow: hidden;
}
.card-art-area svg {
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6));
}
.art-icon {
  font-size: 4rem;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6));
}

.card-meta-ribbon {
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #ffb833;
  margin-bottom: 6px;
}

.card-body-desc {
  font-size: 0.95rem;
  color: var(--ink-dim);
  line-height: 1.35;
  margin: 0;
  font-weight: 600;
}

.btn-ok-card {
  background: #000000;
  border: 3.5px solid #ffffff;
  color: #ffffff;
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  padding: 10px 42px;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.7);
  transition: transform 0.1s ease, border-color 0.15s;
}
.btn-ok-card:hover {
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}
.btn-ok-card:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.7);
}

/* ---------- OVERLAYS ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 3, 8, 0.8);
  backdrop-filter: blur(6px);
}
.overlay.show { display: flex; }

/* When a spectator is watching another player's turn, they see the exact
   same overlay — just with interaction disabled and a "watching" cue. */
.overlay.spectating { cursor: default; }
.overlay.spectating .choice-option-card,
.overlay.spectating .btn-ok-card {
  pointer-events: none;
  filter: saturate(0.75);
}
.spectating-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--ink-dimmer);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  margin-top: 10px;
}

/* Live mirrored cursor showing exactly where the active player is pointing */
.remote-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  pointer-events: none;
  transform: translate(-4px, -4px);
  transition: left 0.06s linear, top 0.06s linear;
}
.remote-cursor.show { display: flex; }
.remote-cursor-dot {
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 4px;
  background: var(--remote-cursor-color, #ffd166);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.4), 0 0 18px 4px var(--remote-cursor-color, #ffd166);
  transform: rotate(-45deg);
}
.remote-cursor-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0b0912;
  background: var(--remote-cursor-color, #ffd166);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}

.overlay-card {
  width: min(440px, 92vw);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 2px solid var(--line);
  border-radius: 22px;
  padding: 34px 28px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}
.overlay-card h2 { margin: 0 0 10px; font-size: 1.6rem; }
.overlay-card p { color: var(--ink-dim); margin: 0 0 8px; font-size: 1.05rem; }
.overlay-sub { font-size: 0.85rem; color: var(--ink-dimmer); margin-top: 16px; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: #000000;
  border: 2px solid #ffffff;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- GALLERY & CUSTOM ---------- */
.gallery-wrap { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; }
.gallery-heading { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-dimmer); margin: 28px 0 14px; font-weight: 800; }
.gallery-heading.safe { color: var(--safe-green); }
.gallery-heading.risky { color: var(--accent); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.mini-card {
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mini-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-yellow);
}
.mini-card-illustration {
  width: 100%;
  height: 95px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0;
}
.mini-card-illustration svg {
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}
.mini-card .mini-label {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  margin: 6px 0 3px;
  color: #ffffff;
}
.mini-card .mini-desc {
  font-size: 0.78rem;
  color: var(--ink-dim);
  line-height: 1.35;
}

.scare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px; }
.scare-chip {
  background: var(--bg-2); border: 2px solid var(--line); border-radius: 12px;
  padding: 10px 6px; text-align: center; cursor: pointer; font-family: inherit;
  transition: border-color 0.12s;
}
.scare-chip .scare-icon { font-size: 1.6rem; display: block; margin-bottom: 4px; }
.scare-chip .scare-name { font-size: 0.68rem; color: var(--ink-dim); font-weight: 700; }
.scare-chip.selected { border-color: var(--accent-yellow); background: rgba(255, 184, 51, 0.1); }

.custom-wrap { max-width: 560px; margin: 0 auto; padding: 24px 20px 60px; }
.stepper { display: flex; align-items: center; gap: 18px; }
.step-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--bg-2); color: var(--ink); font-size: 1.3rem; font-weight: 900; cursor: pointer;
}
.step-value { font-size: 1.4rem; font-weight: 900; min-width: 28px; text-align: center; color: var(--accent-yellow); }
.mini-link { background: none; border: none; color: var(--purple-glow); font-size: 0.78rem; font-weight: 800; cursor: pointer; float: right; }
.custom-card-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-height: 320px; overflow-y: auto; }
.custom-card-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
}
.custom-card-row .cc-icon { font-size: 1.2rem; }
.custom-card-row .cc-label { flex: 1; font-weight: 700; font-size: 0.9rem; }
.custom-card-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }

@media (max-width: 600px) {
  .lobby-bottom-bar { padding: 0 16px; bottom: 20px; }
  .lobby-room-badge { position: static; margin-top: 10px; }
  .corner-top-left, .corner-bottom-left { left: 14px; }
  .corner-top-right, .corner-bottom-right { right: 14px; }
  .choice-cards-row { flex-direction: column; }
}

/* ---------- Home Card Box & Peeking Mascot ---------- */
.home-card-box {
  position: relative;
  overflow: visible;
  margin-top: 25px;
}
.menu-mascot-peek {
  position: absolute;
  top: -24px;
  left: 28px;
  width: 54px;
  height: 26px;
  background: #3898ec;
  border: 2px solid #110d18;
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s cubic-bezier(0.18, 1.4, 0.4, 1);
  z-index: 2;
}
.menu-mascot-peek:hover {
  transform: translateY(-8px) scale(1.1);
}
.peek-eyes {
  display: flex;
  gap: 8px;
}
.peek-eye {
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 1.5px solid #110d18;
  border-radius: 50%;
  position: relative;
  animation: peek-blink 4s infinite;
}
.peek-pupil {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #110d18;
  border-radius: 50%;
  top: 2px;
  left: 2px;
}
@keyframes peek-blink {
  0%, 96%, 100% { transform: scaleY(1); }
  98% { transform: scaleY(0.1); }
}

/* Avatar Select Row */
.avatar-select-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 6px;
}
.avatar-opt {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 8px 4px;
  font-size: 1.35rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.avatar-preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.avatar-opt:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}
.avatar-opt.active {
  background: rgba(147, 102, 255, 0.18);
  border-color: var(--accent-yellow);
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.4);
  transform: scale(1.06);
}

/* Input With Action Button */
.input-with-action {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dice-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--line);
  border-radius: 12px;
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.dice-btn:hover {
  background: rgba(255, 209, 102, 0.18);
  border-color: var(--accent-yellow);
  transform: rotate(25deg) scale(1.1);
}
.dice-btn:active {
  transform: rotate(180deg) scale(0.9);
}

/* 3D Arcade Buttons */
.btn-arcade {
  position: relative;
  border-bottom: 5px solid rgba(0, 0, 0, 0.35) !important;
  transition: transform 0.08s ease, filter 0.12s, box-shadow 0.12s;
}
.btn-arcade:active {
  transform: translateY(3px);
  border-bottom-width: 2px !important;
}

/* How To Play Overlay */
.how-to-card {
  max-width: 480px;
  text-align: left;
}
.how-to-header {
  font-family: "Bungee", cursive, sans-serif;
  color: var(--accent-yellow);
  font-size: 1.6rem;
  margin: 0 0 16px;
  text-align: center;
  letter-spacing: 0.03em;
}
.how-to-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}
.how-to-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.step-badge {
  background: var(--accent);
  color: #120306;
  font-weight: 900;
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-content h4 {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 800;
  color: #ffffff;
}
.step-content p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-dim);
  line-height: 1.4;
}

/* Gallery TCG Card Styling */
.gallery-tcg-card {
  background: linear-gradient(165deg, #251c32 0%, #120d1c 50%, #0a0610 100%);
  border: 4px solid #d4ccbf;
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  text-align: left;
}
.gallery-tcg-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 20px rgba(147, 102, 255, 0.35);
  border-color: #ffd166;
}
.gallery-tcg-card.pool-risky {
  border-color: #e63946;
}
.gallery-tcg-card.pool-risky:hover {
  border-color: #ff4d5e;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 56, 76, 0.45);
}
.gtcg-header {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px;
  border-radius: 8px;
}
.gtcg-icon { padding-top: 1px; }
.gtcg-icon { font-size: 1rem; }
.gtcg-title {
  flex: 1;
  min-width: 0;
  font-family: "Bungee", cursive, sans-serif;
  font-size: 0.8rem;
  line-height: 1.15;
  color: #fff;
  white-space: normal;
  word-break: break-word;
}
.gtcg-badge {
  font-size: 0.62rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  background: #27ae60;
  color: #fff;
}
.pool-risky .gtcg-badge {
  background: #c0392b;
}
.gtcg-art {
  height: 100px;
  background: radial-gradient(circle, #30203a, #0e0817);
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gtcg-art svg {
  max-width: 90%;
  max-height: 90%;
}
.gtcg-body {
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 8px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.gtcg-type {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #ffd166;
  letter-spacing: 0.05em;
}
.gtcg-desc {
  font-size: 0.78rem;
  font-weight: 600;
  color: #f1edfa;
  margin: 0;
  line-height: 1.25;
}
.gtcg-flavor {
  font-size: 0.7rem;
  font-style: italic;
  color: #8f80a8;
  margin: 0;
  line-height: 1.2;
}
.gtcg-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: 800;
  color: #7b6994;
  padding: 0 2px;
}
.gtcg-rarity {
  color: #ffd166;
}

/* Jumpscare Horror Flash Overlay — Perfect Terror Impact */
.jumpscare-flash-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.04s ease-out;
  --jumpscare-glow: #ff0033;
}
.jumpscare-flash-overlay.epic {
  --jumpscare-glow: #ffd166;
}
.jumpscare-flash-overlay.active {
  animation: jumpscare-strobe 1.05s cubic-bezier(0.05, 0.95, 0.15, 1) forwards;
}
.jumpscare-flash-overlay.active ~ .hud {
  animation: jumpscare-screen-shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes jumpscare-screen-shake {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-10px, 6px) rotate(-1deg); }
  20% { transform: translate(9px, -8px) rotate(1deg); }
  30% { transform: translate(-11px, 4px) rotate(-1.2deg); }
  40% { transform: translate(10px, -5px) rotate(1deg); }
  50% { transform: translate(-7px, 7px) rotate(-0.6deg); }
  60% { transform: translate(6px, -4px) rotate(0.6deg); }
  70% { transform: translate(-4px, 3px); }
  80% { transform: translate(3px, -2px); }
  90% { transform: translate(-2px, 1px); }
}
@keyframes jumpscare-strobe {
  0% { opacity: 0; transform: scale(1.45) rotate(4deg); filter: invert(100%) contrast(300%) brightness(200%); }
  8% { opacity: 1; transform: scale(1.02) rotate(-5deg); filter: invert(0%) contrast(250%) saturate(350%) drop-shadow(0 0 50px var(--jumpscare-glow)); }
  16% { opacity: 1; transform: scale(1.08) rotate(3deg); filter: contrast(220%) brightness(160%); }
  28% { opacity: 0.95; transform: scale(0.96) rotate(-2deg); }
  45% { opacity: 0.8; transform: scale(1.03) rotate(1deg); }
  70% { opacity: 0.45; transform: scale(1.0); }
  100% { opacity: 0; transform: scale(1); filter: none; }
}

.jumpscare-blood-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 25%, rgba(255, 0, 30, 0.45) 65%, rgba(120, 0, 15, 0.9) 100%);
  mix-blend-mode: hard-light;
}
.jumpscare-flash-overlay.epic .jumpscare-blood-vignette {
  background: radial-gradient(circle, transparent 20%, rgba(255, 209, 102, 0.5) 65%, rgba(120, 70, 0, 0.9) 100%);
}

/* Chromatic-aberration style RGB split for a violent horror-movie flash */
.jumpscare-rgb-split {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 30%, rgba(255,0,60,0.5) 70%);
  mix-blend-mode: screen;
  opacity: 0;
}
.jumpscare-flash-overlay.active .rgb-r { animation: jumpscare-rgb-r 1.05s ease-out forwards; }
.jumpscare-flash-overlay.active .rgb-b { animation: jumpscare-rgb-b 1.05s ease-out forwards; background: radial-gradient(circle, transparent 30%, rgba(0,140,255,0.4) 70%); }
@keyframes jumpscare-rgb-r {
  0% { opacity: 0; transform: translateX(0); }
  8% { opacity: 0.9; transform: translateX(-14px); }
  20% { opacity: 0.6; transform: translateX(-4px); }
  40% { opacity: 0.2; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(0); }
}
@keyframes jumpscare-rgb-b {
  0% { opacity: 0; transform: translateX(0); }
  8% { opacity: 0.9; transform: translateX(14px); }
  20% { opacity: 0.6; transform: translateX(4px); }
  40% { opacity: 0.2; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(0); }
}

/* Huge spider silhouette that lunges toward the camera behind the eye cluster */
.jumpscare-silhouette {
  position: absolute;
  font-size: 46vh;
  line-height: 1;
  filter: brightness(0) drop-shadow(0 0 60px #ff0033) drop-shadow(0 0 120px #ff0033);
  opacity: 0;
  transform: scale(0.3);
}
.jumpscare-flash-overlay.active .jumpscare-silhouette {
  animation: jumpscare-silhouette-lunge 1.05s cubic-bezier(.2,.9,.25,1) forwards;
}
@keyframes jumpscare-silhouette-lunge {
  0% { opacity: 0; transform: scale(0.2) rotate(-8deg); }
  10% { opacity: 0.95; transform: scale(1.15) rotate(4deg); }
  22% { opacity: 0.85; transform: scale(0.95) rotate(-2deg); }
  40% { opacity: 0.55; transform: scale(1.02) rotate(0deg); }
  100% { opacity: 0; transform: scale(1.05) rotate(0deg); }
}

.jumpscare-spider-face {
  position: relative;
  display: flex;
  gap: 12px;
  filter: drop-shadow(0 0 28px #ff0033);
}
.j-eye {
  width: 22px;
  height: 22px;
  background: #ff0033;
  border-radius: 50%;
  box-shadow: 0 0 20px #ff0055, 0 0 40px #ff0033, inset 0 0 6px #ffffff;
  animation: jumpscare-eye-throb 0.4s ease-in-out infinite alternate;
}
@keyframes jumpscare-eye-throb {
  from { transform: scale(1); }
  to { transform: scale(1.35); }
}

/* ==========================================================================
   HORROR ATMOSPHERE & VISUALS
   ========================================================================== */
.creepy-fog-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(45, 15, 60, 0.25) 0%, transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(70, 10, 25, 0.22) 0%, transparent 55%),
    linear-gradient(180deg, rgba(4,3,8,0.7) 0%, rgba(10,5,18,0.4) 50%, rgba(4,3,8,0.85) 100%);
  animation: fog-creep 22s ease-in-out infinite alternate;
}
@keyframes fog-creep {
  0% { transform: scale(1) translateY(0); opacity: 0.75; }
  50% { transform: scale(1.08) translateY(-15px); opacity: 0.95; }
  100% { transform: scale(1.04) translateY(10px); opacity: 0.8; }
}

/* Lurking Spider Eyes in Dark Corners */
.creepy-corner-eyes {
  position: fixed;
  display: flex;
  gap: 8px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}
.creepy-corner-eyes.tl { top: 28px; left: 32px; transform: rotate(-15deg); }
.creepy-corner-eyes.br { bottom: 28px; right: 32px; transform: rotate(15deg); }
.ce-eye {
  width: 9px;
  height: 9px;
  background: #ff1a35;
  border-radius: 50%;
  box-shadow: 0 0 10px #ff002b, 0 0 20px rgba(255, 26, 53, 0.6);
  animation: spider-eyes-blink 6s infinite;
}
.ce-eye:nth-child(2) { animation-delay: 0.1s; }
.ce-eye:nth-child(3) { animation-delay: 0.2s; width: 6px; height: 6px; }
.ce-eye:nth-child(4) { animation-delay: 0.3s; width: 6px; height: 6px; }

@keyframes spider-eyes-blink {
  0%, 94%, 100% { transform: scaleY(1); opacity: 0.85; }
  96% { transform: scaleY(0.05); opacity: 0.1; }
  98% { transform: scaleY(1); opacity: 0.95; }
}

/* Dripping Crimson Blood from Logo */
.blood-drips-container {
  position: absolute;
  bottom: -16px;
  left: 20%;
  right: 20%;
  height: 24px;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
}
.drip {
  width: 5px;
  height: 18px;
  background: linear-gradient(180deg, #9c0b1b, #61030e);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.8);
  animation: blood-drip-stretch 3.5s ease-in-out infinite;
  transform-origin: top center;
}
.drip.d1 { height: 14px; animation-delay: 0s; }
.drip.d2 { height: 22px; animation-delay: 1.2s; }
.drip.d3 { height: 16px; animation-delay: 0.7s; }
.drip.d4 { height: 19px; animation-delay: 2.1s; }

@keyframes blood-drip-stretch {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.4); }
}

/* ==========================================================================
   COMPREHENSIVE RULEBOOK MODAL
   ========================================================================== */
.how-to-rulebook-card {
  width: min(580px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  text-align: left;
  padding: 24px 20px;
  background: linear-gradient(180deg, #1f162e 0%, #120b1c 60%, #0a0610 100%);
  border: 3px solid #6b528a;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.9), 0 0 35px rgba(147, 102, 255, 0.25);
}

.rulebook-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.rulebook-close-x {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  color: #fff;
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.rulebook-close-x:hover {
  background: rgba(255, 56, 76, 0.4);
  border-color: #ff384c;
  transform: scale(1.1);
}

.rulebook-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.rulebook-tab {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.rulebook-tab:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.rulebook-tab.active {
  background: rgba(255, 209, 102, 0.18);
  border-color: #ffd166;
  color: #ffd166;
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.3);
}

.rulebook-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.rulebook-pane.active {
  display: flex;
}

.rulebook-section h3 {
  font-family: "Bungee", cursive, sans-serif;
  font-size: 1.05rem;
  color: #ffd166;
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}
.rulebook-section p {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-dim);
  margin: 0;
}

.rulebook-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 480px) {
  .rulebook-grid-2 { grid-template-columns: 1fr; }
}

.rule-box-mini {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px;
}
.rb-icon { font-size: 1.3rem; display: block; margin-bottom: 4px; }
.rule-box-mini h4 {
  margin: 0 0 4px;
  font-size: 0.92rem;
  color: #fff;
}
.rule-box-mini p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-dim);
  line-height: 1.35;
}

.rule-callout {
  background: rgba(255, 56, 76, 0.12);
  border-left: 4px solid #ff384c;
  border-radius: 8px;
  padding: 10px 14px;
}
.rule-callout h4 {
  margin: 0 0 4px;
  color: #ff7a36;
  font-size: 0.92rem;
}
.rule-callout p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-dim);
  line-height: 1.4;
}

.powerup-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.powerup-list li {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.84rem;
  color: var(--ink-dim);
  line-height: 1.35;
}
.powerup-list li strong { color: #fff; }

.tactics-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tactic-item {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 12px;
}
.tactic-item h4 {
  margin: 0 0 4px;
  color: #57e0a8;
  font-size: 0.92rem;
}
.tactic-item p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-dim);
  line-height: 1.35;
}

/* In-Lobby Drawers & Avatar Toolbar (Positioned cleanly at Top-Left) */
.lobby-drawers-row {
  position: absolute;
  top: 86px;
  left: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 30;
  max-width: 320px;
}
.lobby-avatar-picker {
  margin-top: 10px;
  padding: 6px;
  background: rgba(0,0,0,0.4);
  border-radius: 12px;
}
.corner-avatar-icon {
  font-size: 1.15rem;
  margin-right: 4px;
  vertical-align: middle;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

/* ==========================================================================
   AUTHENTIC TCG TRADING CARD SYSTEM & MODAL
   ========================================================================== */
.card-draw-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 96vw;
}
.card-draw-header {
  font-family: "Bungee", cursive, sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  letter-spacing: 0.05em;
  color: #ffffff;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.95);
  margin: 0;
}

.tcg-card-wrapper {
  perspective: 1000px;
  display: flex;
  justify-content: center;
}

.tcg-card {
  width: min(340px, 88vw);
  background: linear-gradient(165deg, #241a33 0%, #130c20 40%, #0a0612 100%);
  border: 7px solid #ece4d8;
  border-radius: 24px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.95),
    0 0 0 2px #3c2a52,
    0 0 35px rgba(147, 102, 255, 0.35);
  overflow: hidden;
  position: relative;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.1s ease-out, box-shadow 0.15s ease-out;
  transform-style: preserve-3d;
  cursor: grab;
  box-sizing: border-box;
}

.tcg-card.risky-card {
  border-color: #ffd166;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.95),
    0 0 0 2px #5c1824,
    0 0 45px rgba(255, 77, 94, 0.6);
}

.card-holo-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.45) 0%, rgba(255,100,200,0.25) 35%, rgba(0,255,255,0.25) 65%, rgba(255,255,255,0.45) 100%);
  mix-blend-mode: color-dodge;
  opacity: 0.35;
  border-radius: 16px;
  z-index: 10;
}

/* 1. Header Bar */
.tcg-header {
  background: linear-gradient(180deg, #281d39, #150d22);
  border: 2px solid #5d467a;
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}
.tcg-cost-jewel {
  font-size: 1.35rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}
.tcg-title-wrap {
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
}
.tcg-card-title {
  font-family: "Bungee", cursive, sans-serif;
  font-size: 1.12rem;
  color: #fff6e5;
  margin: 0;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9);
  line-height: 1.1;
}
.tcg-card-type {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a48cc7;
}
.tcg-pool-badge {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  background: #27ae60;
  color: #ffffff;
  border: 1px solid #2ecc71;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.tcg-card.risky-card .tcg-pool-badge {
  background: #e63946;
  border-color: #ff4d5e;
}

/* 2. Art Frame Window */
.tcg-art-frame {
  position: relative;
  background: radial-gradient(circle, #382440, #130b1c);
  border: 3px solid #6b528a;
  border-radius: 16px;
  padding: 6px;
  box-shadow:
    inset 0 4px 12px rgba(0,0,0,0.85),
    0 2px 6px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tcg-art-rivet {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #ffd700;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.9);
  z-index: 5;
}
.tcg-art-rivet.top-left { top: 5px; left: 5px; }
.tcg-art-rivet.top-right { top: 5px; right: 5px; }
.tcg-art-rivet.bottom-left { bottom: 5px; left: 5px; }
.tcg-art-rivet.bottom-right { bottom: 5px; right: 5px; }

.card-art-area {
  width: 100%;
  height: 135px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-art-area svg {
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6));
}

/* 3. Text & Ability Plate */
.tcg-text-plate {
  background: linear-gradient(180deg, #1f162c, #110b1a);
  border: 2px solid #543f6e;
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.7);
}
.tcg-rule-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tcg-keyword {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ffd166;
  text-transform: uppercase;
}
.tcg-rule-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f1edfa;
  margin: 0;
  line-height: 1.35;
}
.tcg-flavor-box {
  border-top: 1px dashed rgba(255,255,255,0.14);
  padding-top: 5px;
}
.tcg-flavor-text {
  font-size: 0.76rem;
  font-style: italic;
  color: #9c8db5;
  margin: 0;
  line-height: 1.3;
}

/* 4. Footer Collector Bar */
.tcg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}
.tcg-card-number {
  font-size: 0.7rem;
  font-weight: 800;
  color: #8874a6;
  letter-spacing: 0.05em;
}
.tcg-holo-seal {
  width: 15px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd700, #ff69b4, #00ffff, #ffd700);
  box-shadow: 0 0 6px rgba(255,215,0,0.6);
  border: 1px solid #ffffff;
}
.tcg-rarity {
  font-size: 0.7rem;
  font-weight: 900;
  color: #ffd166;
  letter-spacing: 0.06em;
}

.btn-ok-card {
  font-family: "Bungee", cursive, sans-serif;
  font-size: 1.1rem;
  padding: 14px 28px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ff384c, #c9182b);
  border: 3px solid #ffffff;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(255, 56, 76, 0.5), 0 4px 0 #8b0a18;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  margin-top: 6px;
}
.btn-ok-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 56, 76, 0.65), 0 4px 0 #8b0a18;
}
.btn-ok-card:active {
  transform: translateY(2px);
  box-shadow: 0 4px 12px rgba(255, 56, 76, 0.4), 0 2px 0 #8b0a18;
}

/* ==========================================================================
   3D CARD DECK SHUFFLE & FLIP CHOREOGRAPHY
   ========================================================================== */
.shuffle-deck-fan {
  position: relative;
  width: min(340px, 88vw);
  height: 480px;
  perspective: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Decoy cards behind main card during shuffle */
.shuffle-decoy-card {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 24px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  z-index: 1;
}

.shuffle-decoy-card.s-left-2 {
  transform: translateX(-42px) translateY(12px) rotate(-8deg) scale(0.92);
  opacity: 0.6;
}
.shuffle-decoy-card.s-left-1 {
  transform: translateX(-20px) translateY(6px) rotate(-4deg) scale(0.96);
  opacity: 0.8;
}
.shuffle-decoy-card.s-right-1 {
  transform: translateX(20px) translateY(6px) rotate(4deg) scale(0.96);
  opacity: 0.8;
}
.shuffle-decoy-card.s-right-2 {
  transform: translateX(42px) translateY(12px) rotate(8deg) scale(0.92);
  opacity: 0.6;
}

/* Active Shuffling Motion */
.shuffle-deck-fan.shuffling .shuffle-decoy-card.s-left-2 {
  animation: shuffle-riffle-left 0.45s ease-in-out infinite alternate;
}
.shuffle-deck-fan.shuffling .shuffle-decoy-card.s-right-2 {
  animation: shuffle-riffle-right 0.45s ease-in-out infinite alternate;
}
@keyframes shuffle-riffle-left {
  0% { transform: translateX(-65px) translateY(20px) rotate(-14deg) scale(0.88); }
  100% { transform: translateX(50px) translateY(-10px) rotate(8deg) scale(0.95); }
}
@keyframes shuffle-riffle-right {
  0% { transform: translateX(65px) translateY(20px) rotate(14deg) scale(0.88); }
  100% { transform: translateX(-50px) translateY(-10px) rotate(-8deg) scale(0.95); }
}

/* Authentic TCG Card Back */
.tcg-card-back {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, #201432 0%, #0d0816 80%, #050308 100%);
  border: 7px solid #ece4d8;
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  box-sizing: border-box;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-back-border {
  width: 100%;
  height: 100%;
  border: 2px solid #a48cc7;
  border-radius: 14px;
  background: radial-gradient(circle, #2d1b46 0%, #11091e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}
.card-back-seal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: radial-gradient(circle, #ff384c, #800b18);
  border: 3px solid #ffd700;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  justify-content: center;
  box-shadow: 0 0 24px rgba(255, 56, 76, 0.6);
}
.seal-icon { font-size: 2.2rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8)); }
.seal-text { font-family: "Bungee", cursive; font-size: 0.55rem; color: #fff; letter-spacing: 0.08em; }

/* 3D Flippable Main Card */
.tcg-flippable-container {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 5;
  perspective: 1200px;
}

.tcg-flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.75s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  transform: rotateY(0deg);
}

.tcg-flip-card-inner.flipped {
  transform: rotateY(180deg) scale(1.03);
}

.tcg-card-face-side {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
}

.tcg-card-back-side {
  transform: rotateY(0deg);
}

.tcg-card-front-side {
  transform: rotateY(180deg);
}

/* ==========================================================================
   FLOATING QUICK REACTION BAR
   ========================================================================== */
.reaction-bar {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  gap: 8px;
  background: rgba(18, 12, 30, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.16);
  padding: 6px 12px;
  border-radius: 30px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65), 0 0 15px rgba(147, 102, 255, 0.25);
  z-index: 40;
}

.rxn-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
}

.rxn-btn:hover {
  transform: scale(1.35) translateY(-4px);
  filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.6));
}

.rxn-btn:active {
  transform: scale(0.95);
}

@media (max-width: 600px) {
  .reaction-bar {
    bottom: 74px;
    right: 50%;
    transform: translateX(50%);
    gap: 4px;
    padding: 4px 8px;
  }
  .rxn-btn {
    font-size: 1.25rem;
  }
}

/* Screen-space reaction fly-ups — the actual "did this button do anything"
   feedback: a big emoji launches from the reaction bar and drifts up the
   whole screen, so it reads clearly no matter where the camera is pointed. */
.reaction-flyup-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 45;
}

.reaction-flyup {
  position: absolute;
  bottom: 70px;
  right: 40px;
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
  animation: reaction-flyup-rise 2.4s cubic-bezier(0.15, 0.6, 0.35, 1) forwards;
  will-change: transform, opacity;
}

@keyframes reaction-flyup-rise {
  0% {
    transform: translate(0, 0) scale(0.4) rotate(0deg);
    opacity: 0;
  }
  10% {
    transform: translate(var(--rxn-dx0, -6px), -60px) scale(1.25) rotate(var(--rxn-rot0, -6deg));
    opacity: 1;
  }
  40% {
    transform: translate(var(--rxn-dx1, 10px), -220px) scale(1.05) rotate(var(--rxn-rot1, 5deg));
    opacity: 1;
  }
  75% {
    transform: translate(var(--rxn-dx2, -14px), -430px) scale(1) rotate(var(--rxn-rot2, -4deg));
    opacity: 0.85;
  }
  100% {
    transform: translate(var(--rxn-dx3, 6px), -600px) scale(0.9) rotate(var(--rxn-rot3, 3deg));
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .reaction-flyup {
    right: 50%;
    bottom: 120px;
    font-size: 2.1rem;
  }
}

/* ==========================================================================
   MATCH END PODIUM & MVP OVERLAY
   ========================================================================== */
.match-end-card {
  max-width: 480px;
  background: radial-gradient(circle at 50% 10%, #2e1a47 0%, #12091f 70%, #08040d 100%);
  border: 3px solid #ffd700;
  box-shadow: 0 24px 60px rgba(0,0,0,0.9), 0 0 45px rgba(255, 215, 0, 0.4);
  text-align: center;
  padding: 28px 24px;
}

.match-end-trophy {
  font-size: 3.8rem;
  animation: bounce-trophy 1.2s ease infinite alternate;
  filter: drop-shadow(0 8px 16px rgba(255, 215, 0, 0.6));
}

@keyframes bounce-trophy {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-8px) scale(1.08); }
}

.match-end-title {
  font-family: "Bungee", cursive;
  font-size: 2.2rem;
  color: #ffd700;
  margin: 6px 0 0;
  text-shadow: 0 3px 12px rgba(0,0,0,0.9);
}

.match-end-subtitle {
  color: var(--ink-dim);
  font-size: 0.95rem;
  margin-top: 4px;
  margin-bottom: 18px;
}

.match-podium-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  max-height: 240px;
  overflow-y: auto;
}

.podium-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 14px;
  border-radius: 12px;
}

.podium-row.winner {
  background: rgba(255, 215, 0, 0.15);
  border-color: #ffd700;
}

.podium-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.podium-rank {
  font-family: "Bungee", cursive;
  font-size: 1.1rem;
  color: #ffd700;
  width: 24px;
}

.podium-name {
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
}

.podium-stats {
  font-size: 0.8rem;
  color: #9f8fb8;
}

.match-actions-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ==========================================================================
   SPECTATOR LIVE OPPONENT CARD BANNER
   ========================================================================== */
.spectator-card-banner {
  display: none;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(34, 20, 52, 0.95), rgba(16, 9, 28, 0.95));
  border: 2px solid #ffd166;
  border-radius: 14px;
  padding: 6px 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 209, 102, 0.35);
  animation: slide-in-top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spectator-card-banner.show {
  display: flex;
}

@keyframes slide-in-top {
  0% { transform: translateY(-24px) scale(0.92); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.scb-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.8));
}

.scb-info {
  text-align: left;
  display: flex;
  flex-direction: column;
}

.scb-player {
  font-size: 0.70rem;
  font-weight: 800;
  color: #a48cc7;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.scb-name {
  font-family: "Bungee", cursive;
  font-size: 0.98rem;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.scb-type {
  font-size: 0.65rem;
  font-weight: 900;
  color: #ffd166;
  text-transform: uppercase;
}
