/*-----------------------------------------------------------
  DUELLCAST STAGE8 – ARENA CSS (stage8-arena.css)

  PURPOSE:
    - Arena shell + grid + seat styling
    - Hot seat winner badge
    - Hot seat stats overlay (clickable close button fix)

  NOTE:
    - Prior version had .hot-stats-overlay { pointer-events:none; }
      which made the X button impossible to click. Fixed here.

  SOURCE BASED ON:
    stage8-arena .txt (uploaded) :contentReference[oaicite:1]{index=1}
-----------------------------------------------------------*/

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050509;
  color: #f4f4f5;
  overflow: hidden;
}

.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 320px;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  gap: 1px;
  background: #111827;
}

header {
  grid-column: 1 / 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #020617;
  border-bottom: 1px solid #1f2937;
  z-index: 1000;
}

header .left {
  display: flex;
  align-items: center;
  gap: 12px;
}

header .logo {
  font-weight: 800;
  letter-spacing: 0.1em;
  font-size: 14px;
  text-transform: uppercase;
}

header .room {
  font-size: 13px;
  opacity: 0.8;
}

.controls-row {
  flex-wrap: nowrap;
  overflow-x: auto;
  align-items: center;
  gap: 6px;
}

.controls-row input {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #374151;
  background: #020617;
  color: #f9fafb;
  font-size: 12px;
  outline: none;
}

button {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  background: #4b5563;
  color: #f9fafb;
  white-space: nowrap;
}

button.primary {
  background: #22c55e;
  color: #022c22;
  font-weight: 600;
}

button.danger {
  background: #ef4444;
  color: #fee2e2;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}
/* =========================================================
   HOST CONTROL CONSOLES – Compact panel layout (SAFE SCOPED)
   Only affects the host-only console area (#player-console/#vote-console)
   ========================================================= */

/* Do NOT touch .controls-row here — that’s the HEADER bar. */

/* Parent wrapper for the two host consoles */
.host-control-row{
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  align-items: start;
}

/* Panels */
#player-console, #vote-console{
  padding: 12px;
}

/* PLAYER SEATS row layout */
#player-console .pc-row{
  display: grid;
  grid-template-columns: 42px 1fr 70px 44px;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}

#player-console .pc-name-input{
  height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}

/* CONTROL BUTTONS: compact, non-circular */
#player-console button,
#vote-console button{
  height: 28px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 26px;
  width: auto;
  min-width: 0;
  aspect-ratio: auto;
}

/* ROUND CONTROLS: make the groups flow into neat columns */
#vote-console .vote-console-controls{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  align-items: start;
}

/* Overlay buttons row */
#vote-console .overlay-row{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Voting buttons stack tight */
#vote-console .vote-controls-row{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Left rail */
.left-rail {
  grid-column: 1;
  grid-row: 2;
  background: #020617;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.left-rail h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
  margin: 4px 4px 0;
}

.sub-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.sub {
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  background: #020617;
  border: 1px solid #111827;
}

.sub-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
}

/* Center */
.center {
  grid-column: 2;
  grid-row: 2;
  background: #020617;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* OUTER arena box (border + status) */
.video-main {
  position: relative;
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #1f2937;
  background: #020617;

  /* vertical stack: [arena grid] + [status strip] */
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
}

/* 🔵 HOLOGRAM FLOOR UNDER EVERYTHING */
#arena-floor {
  position: absolute;
  inset: 0;
  background: url('/assets/arena/frames/floor.jpg') center/cover no-repeat;
  z-index: 0;
  opacity: 1;
  pointer-events: none;
}



/* INNER grid: host / hot / p3–p8 */
.arena-grid {
  position: relative;       /* sits above the floor */
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));

  /* top row = 1.5x bottom row */
  grid-template-rows: 3fr 2fr;
  grid-template-areas:
    "host host host hot  hot  hot"
    "p3   p4   p5   p6   p7   p8";
  gap: 4px;
}

/* Seats participate directly in the grid */
.video-grid {
  display: contents;
}

/* Seat base styling */
.seat {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(17, 24, 39, 0.3);
  aspect-ratio: 16 / 9;
}

/* 🔵 Seat frame art (behind the video) */
.seat::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--seat-frame-image) center/contain no-repeat;
  z-index: 2;
  opacity: 0.75;
  pointer-events: none;
}

/* Video sits ABOVE the frame */
.seat video {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

/* Hide non-admitted seats for viewers only. Host always sees the full grid. */
body:not(.host-mode) .seat.seat-hidden {
  display: none !important;
}

/* "WAITING" overlay badge */
.seat .waiting-label {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #facc15;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 20;
}
.seat.seat-waiting .waiting-label {
  display: flex;
}

/* Seat label */
.seat-label {
  position: absolute;
  left: 6px;
  bottom: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  z-index: 25;
}

/* Fighter Jock Name (bottom-center, Duelly orange) */
.seat-fighter-name{
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.5px;
  color: #ff7a00; /* Duelly orange */
  text-shadow: 0 2px 10px rgba(0,0,0,0.75);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  white-space: nowrap;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  z-index: 26; /* above seat-label */

  /* Optional strip look (SAFE) */
  background: rgba(0,0,0,0.25);
  padding: 3px 12px;
  border-radius: 999px;
}


/* Seat swap / admit controls */
.seat-controls {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  padding: 0 6px;
  display: flex;
  justify-content: flex-end; /* H stays top-right */
  gap: 4px;
  z-index: 30;
}

.seat-btn {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #374151;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  color: #e5e7eb;
}

.seat-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* Move A (admit) to the center top of the seat */
.seat-controls [data-admit-seat] {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* Base grid areas (MEDIA OFF) */
.seat[data-seat="1"] { grid-area: host; }
.seat[data-seat="2"] { grid-area: hot; }
.seat[data-seat="3"] { grid-area: p3; }
.seat[data-seat="4"] { grid-area: p4; }
.seat[data-seat="5"] { grid-area: p5; }
.seat[data-seat="6"] { grid-area: p6; }
.seat[data-seat="7"] { grid-area: p7; }
.seat[data-seat="8"] { grid-area: p8; }

/* MEDIA SLOT – VP1 cell (hidden by default) */
.media-slot { display: none; }

/* MEDIA-ON ARENA LAYOUT */
body.media-on .arena-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: 2fr 2fr 1fr 1fr;
  grid-template-areas:
    ".    vp1 vp1 vp1 vp1 ."
    ".    vp1 vp1 vp1 vp1 ."
    "host vp1 vp1 vp1 vp1 hot"
    "p3   p4  p5  p6  p7  p8";
}

body.media-on .media-slot {
  display: block;
  grid-area: vp1;
  padding: 4px;
  background: #020617;
}

/* VP1 frame fills its grid cell */
.media-inner {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #1f2937;
  background: #020617;

  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#vp1-video,
#vp1-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  background: #020617;
}

.media-meta {
  position: absolute;
  left: 8px;
  bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  z-index: 50;
}

/* Status strip */
.status-strip {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  border-top: 1px solid #111827;
  font-size: 11px;
  background: rgba(15, 23, 42, 0.9);
}

/* Right rail */
.right-rail {
  grid-column: 3;
  grid-row: 2;
  background: #020617;
  border-left: 1px solid #111827;
  display: flex;
  flex-direction: column;
}

/* -----------------------------------------------------------
   HOT SEAT – WINNER BADGE (placeholder banner)
----------------------------------------------------------- */

#hot-winner-badge {
  position: absolute;
  left: 50%;
  bottom: 16%;
  transform: translateX(-50%);
  z-index: 960;
  pointer-events: none;
}

/* 🔵 HOT SEAT WINNER – pill bar */
.winner-badge {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;

  padding: 6px 14px;
  border-radius: 999px;

  background: linear-gradient(90deg, #0ea5e9, #38bdf8, #0ea5e9);
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.8);

  z-index: 70;
}

.winner-badge .winner-prefix {
  font-size: 10px;
  opacity: 0.9;
}

#hot-winner-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.winner-badge.visible {
  display: flex;
  animation:
    winner-pop 0.22s ease-out,
    winner-pulse 1.1s ease-in-out infinite alternate;
}

@keyframes winner-pop {
  0% { transform: translateX(-50%) scale(0.9); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

@keyframes winner-pulse {
  0% { box-shadow: 0 4px 10px rgba(56, 189, 248, 0.55); }
  100% { box-shadow: 0 6px 18px rgba(56, 189, 248, 0.95); }
}

/* -----------------------------------------------------------
   HOT SEAT – STATS OVERLAY (REAL STATS PAYLOAD)
   FIXES:
     - Overlay can remain "non-click-through" EXCEPT close button
     - Close button is clickable again
----------------------------------------------------------- */
/* -------------------------------------------------
   PODIUM STATS – TEXT VISIBILITY FIX (ARENA)
   Keep panel transparent, add micro-plates
------------------------------------------------- */

/* Title row (Seat / Name / Total) */
.hot-stats-overlay .hs-title {
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 6px 10px;
  border-radius: 10px;
}

/* Main stat rows (Total / Votes) */
.hot-stats-overlay .hs-row {
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  padding: 4px 8px;
  border-radius: 8px;
}

/* Grid stat cells (Skill / Tech / Pres / Diff) */
.hot-stats-overlay .hs-kv {
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid rgba(255,255,255,0.10);
}

/* Boost readability without adding bulk */
.hot-stats-overlay {
  text-shadow:
    0 1px 2px rgba(0,0,0,0.85),
    0 0 6px rgba(0,0,0,0.35);
}

.hot-stats-overlay { position: absolute; z-index: 9999; }
.hot-stats-overlay.hidden { display: none !important; }

.hot-stats-overlay{
  left: 10px;
  right: 10px;
  bottom: 10px;

  padding: 10px 12px;
  border-radius: 14px;

  /* ✅ TRANSPARENT STATS PANEL */
  background: transparent;
  border: none;
  box-shadow: none;

  color: #ffffff;

  /* keep text readable over arena */
  text-shadow: 0 1px 2px rgba(0,0,0,0.75);

  pointer-events: none;
}


/* Close button */
.hot-stats-overlay .hs-close{
  display: none; /* no X close – toggle with Podium button */
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 18px;
  line-height: 26px;
  cursor: pointer;
  z-index: 10000;
}

.hot-stats-overlay .hs-title{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  margin-bottom: 8px;
}

.hot-stats-overlay .hs-pill{
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.35);
  font-size: 12px;
}

.hot-stats-overlay .hs-row{
  display: flex;
  justify-content: space-between;
  opacity: 0.95;
  font-size: 13px;
  margin: 2px 0;
}

.hot-stats-overlay .hs-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-top: 8px;
}

.hot-stats-overlay .hs-kv{
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.95;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.hot-stats-overlay .hs-foot{
  margin-top: 8px;
  font-size: 11px;
  opacity: 0.75;
}
/* =========================================================
   PODIUM / OVERLAY WRAPPER (moves the whole podium group)
   ========================================================= */

#winner-overlay{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;

  /* ↓ PODIUM UP/DOWN (lower = bigger number) */
  top: calc(8% + 10px);     /* <-- LOWER PODIUM by 10px */
}

/* =========================================================
   STATS WHEN PROMOTED INTO WINNER OVERLAY
   (moves ONLY the stats card, NOT the podium)
   ========================================================= */

#winner-overlay #hot-stats-overlay{
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  top: auto !important;
  margin: 0 auto;
  max-width: 880px;

  /* ↑ STATS UP/DOWN + SIZE */
  transform: translateY(-18px) scale(1.12) !important;
  transform-origin: top center !important;
}

/* Safety: stats card shouldn't capture clicks */
#winner-overlay .hot-stats-overlay{
  pointer-events: none;
}



/* --- FIX: Round timer always visible above overlays --- */
#round-overlay{position:fixed; left:0; right:0; top:0; bottom:0; z-index:9995; pointer-events:none;}
#round-timer{position:fixed; z-index:9996; pointer-events:none;}
/* --- FIX: remove X close for hot stats overlay (host button toggles) --- */
#hot-stats-overlay .hs-close{display:none !important;}


/* =========================================================
   HOST CONSOLE FIXES (override any pill/circle styles)
   + Podium mini-panel (host only)
   ========================================================= */
#vote-console, #player-console { max-width: 100%; overflow: hidden; }

#vote-console .vote-console-header{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

#vote-console .vote-console-round{ max-width: 100%; }
#vote-console .vc-round-buttons{ display:flex; flex-direction:column; gap:10px; max-width:100%; }
#vote-console .vc-round-buttons-group{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
#vote-console .round-row{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; }

#vote-console button,
#player-console button{
  border-radius: 10px !important;
  height: 30px !important;
  padding: 0 10px !important;
  line-height: 28px !important;
  width: auto !important;
  min-width: 0 !important;
}

#vote-console select,
#vote-console input{
  height: 30px;
  border-radius: 10px;
}

/* Podium mini-panel */
#podium-mini-panel{
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
}

#podium-mini-panel.hidden{ display:none; }

#podium-mini-panel .pmp-title{
  font-size: 12px;
  letter-spacing: .10em;
  text-transform: uppercase;
  opacity: .75;
  margin-bottom: 8px;
}

#podium-mini-panel .pmp-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom: 10px;
}

#podium-mini-panel .pmp-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#podium-mini-panel .pmp-cell{
  display:flex;
  flex-direction:column;
  gap:6px;
}

#podium-mini-panel .pmp-label{
  font-size: 11px;
  opacity: .8;
}

#podium-mini-panel .pmp-select{
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(2,6,23,0.85);
  color: #e5e7eb;
  outline: none;
}

#podium-mini-panel .pmp-btn{
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(2,6,23,0.55);
  color: #e5e7eb;
  cursor: pointer;
}
#podium-mini-panel .pmp-btn.primary{ background:#22c55e; color:#022c22; font-weight:700; border-color:rgba(34,197,94,0.45); }
#podium-mini-panel .pmp-btn.danger{ background:#ef4444; color:#fee2e2; border-color:rgba(239,68,68,0.45); }

@media (max-width: 1100px){
  .host-control-row{ grid-template-columns: 1fr; }
  #podium-mini-panel .pmp-grid{ grid-template-columns: 1fr; }
}
/* ================================
   ARENA STACK ORDER (LOCKED)
================================ */

/* Arena container must establish stacking context */
.arena-grid {
  position: relative;
}

/* Hologram floor — ALWAYS bottom */
#arena-floor {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* VP1 media — above floor, below seats */
#vp1-media-slot {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* Allow clicks inside media only */
#vp1-media-slot .media-inner {
  pointer-events: auto;
}

/* Arena seats — ABOVE media */
#video-grid {
  position: relative;
  z-index: 10;
}

/* Winner overlays — topmost visual layer */
.winner-overlay {
  z-index: 20;
}
/* =========================================================
   VP1 HARD SAFETY (PREVENT "BLANK VP1 SHEET" AFTER STOP)
   - If media-on is NOT active, VP1 must not render at all
   - If video/img has no src, force-hide it
========================================================= */

/* When media is OFF, VP1 cannot exist visually */
body:not(.media-on) #vp1-media-slot,
body:not(.media-on) .media-slot {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* When media is ON, VP1 may render */
body.media-on #vp1-media-slot,
body.media-on .media-slot {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* VP1 should NEVER block seat interaction */
#vp1-media-slot {
  pointer-events: none !important;
  background: transparent !important;
}

/* Only inner controls can be clickable */
#vp1-media-slot .media-inner {
  pointer-events: auto !important;
}

/* If STOP cleared the src (or left it blank), do not show a blank panel */
#vp1-video[src=""],
#vp1-image[src=""] {
  display: none !important;
  background: transparent !important;
}
/* KISS: disable the old winner-tag ellipses */
#winner-player-text,
#winner-chat-text {
  display: none !important;
}
