/**
 * HuntHub — Fullscreen Winner Celebration Overlay Styles
 * 100% Transparent when idle (Zero CPU in OBS), Dual-Tier Animations:
 * - tier-partial: Fast, punchy celebration for single round/match wins
 * - tier-grand: Special extended celebration with golden god-rays, shockwave rings,
 *   crown drop, and champion aura for 1v1 !cashout, $20 Max Streak, & 8-Bracket Champion
 */

@font-face {
  font-family: 'Rye';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../site/fonts/Rye-latin.woff2') format('woff2'), url('/site/fonts/Rye-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Sancreek';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../site/fonts/Sancreek-latin.woff2') format('woff2'), url('/site/fonts/Sancreek-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Special Elite';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../site/fonts/SpecialElite-latin.woff2') format('woff2'), url('/site/fonts/SpecialElite-latin.woff2') format('woff2');
}

:root {
  --bg-dark: #07090e;
  --gold-primary: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.55);
  --gold-dark: #d4af37;
  --kick-green: #53fc18;
  --kick-green-glow: rgba(83, 252, 24, 0.45);
  --cyan-accent: #00e5ff;
  --cyan-glow: rgba(0, 229, 255, 0.45);
  --magenta-accent: #ff2a5f;
  --font-display: 'Rye', 'Sancreek', 'Chakra Petch', serif;
  --font-western-sub: 'Special Elite', 'Chakra Petch', monospace;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: var(--font-sans);
  color: #ffffff;
  user-select: none;
  background: transparent !important;
}

/* Preview mode (only when ?preview=1 is explicitly passed) */
body.preview-mode {
  background: radial-gradient(circle at 50% 35%, #131b2e 0%, #07090e 70%, #030407 100%) !important;
}

/* OBS Studio Mode — strictly 100% transparent */
body.obs-mode, body.transparent-mode {
  background: transparent !important;
}

/* Fullscreen Particle Canvas (Background Layer: Coins Falling from the Sky) */
#fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 20;
  pointer-events: none;
}

/* Grand Champion 3D Throne Cutscene Stage */
.grand-throne-stage {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(1520px, 96vw);
  height: min(855px, 91vh);
  transform: translate(-50%, -50%) scale(0.96);
  border-radius: 22px;
  overflow: hidden;
  border: 2.5px solid #d97706;
  box-shadow:
    0 32px 110px rgba(0, 0, 0, 0.96),
    0 0 65px rgba(217, 119, 6, 0.38),
    inset 0 0 0 2px rgba(251, 191, 36, 0.25);
  background: #080604;
  z-index: 15;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.35s ease;
}

.grand-throne-stage.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.grand-throne-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grand-throne-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(10, 7, 4, 0.08) 0%, rgba(10, 7, 4, 0.45) 68%, rgba(6, 4, 2, 0.88) 100%),
    linear-gradient(180deg, rgba(6, 4, 2, 0.86) 0%, transparent 18%, transparent 78%, rgba(6, 4, 2, 0.92) 100%);
  pointer-events: none;
}

.grand-throne-top-badge {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 24px;
  border-radius: 8px;
  background: rgba(16, 11, 7, 0.95);
  border: 1.5px solid #fbbf24;
  color: #fde68a;
  font-family: var(--font-western-sub);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.92);
  white-space: nowrap;
}

/* Audio Gate Prompt (Preview Mode Only) */
.audio-gate {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  pointer-events: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.audio-gate.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -20px);
}

.audio-gate-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 22, 38, 0.95);
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.35);
  border-radius: 30px;
  padding: 10px 24px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.gate-btn {
  background: var(--gold-primary);
  border: none;
  color: #000000;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
}

/* =========================================================================
 * FOREGROUND CENTER STAGE (#winner-billboard)
 * ========================================================================= */
.billboard-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -44%) scale(0.82);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s ease,
    visibility 0.32s ease;
  will-change: transform, opacity;
}

.billboard-container.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.billboard-container.tier-grand {
  transition:
    transform 0.62s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    opacity 0.45s ease,
    visibility 0.45s ease;
}

/* Pause all child animations when idle so OBS Browser Source consumes 0% CPU */
.billboard-container:not(.active) *,
.billboard-container:not(.active) *::before,
.billboard-container:not(.active) *::after {
  animation-play-state: paused !important;
}

/* =========================================================================
 * SPECIAL GRAND WIN EFFECTS (Rotating Sunburst + Expanding Shockwaves)
 * ========================================================================= */
.grand-sunburst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(920px, 115vmin);
  height: min(920px, 115vmin);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 215, 0, 0.22) 0deg 10deg,
    transparent 10deg 24deg,
    rgba(83, 252, 24, 0.12) 24deg 30deg,
    transparent 30deg 45deg
  );
  -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,1) 18%, rgba(0,0,0,0.45) 52%, transparent 72%);
  mask-image: radial-gradient(circle, rgba(0,0,0,1) 18%, rgba(0,0,0,0.45) 52%, transparent 72%);
  z-index: -2;
  opacity: 0;
  pointer-events: none;
  animation: rotate-sunburst 16s linear infinite;
}

.billboard-container.active.tier-grand .grand-sunburst {
  opacity: 1;
}

@keyframes rotate-sunburst {
  from { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  50%  { transform: translate(-50%, -50%) rotate(180deg) scale(1.08); }
  to   { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}

.grand-shockwave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 280px;
  height: 280px;
  transform: translate(-50%, -50%) scale(0.4);
  border-radius: 50%;
  border: 3px solid rgba(255, 215, 0, 0.85);
  box-shadow: 0 0 35px rgba(255, 215, 0, 0.6), inset 0 0 25px rgba(83, 252, 24, 0.4);
  opacity: 0;
  z-index: -1;
  pointer-events: none;
}

.billboard-container.active.tier-grand .grand-shockwave.ring-1 {
  animation: shockwave-burst 2.1s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.billboard-container.active.tier-grand .grand-shockwave.ring-2 {
  border-color: rgba(83, 252, 24, 0.8);
  animation: shockwave-burst 2.1s cubic-bezier(0.16, 1, 0.3, 1) 0.65s infinite;
}

@keyframes shockwave-burst {
  0% {
    transform: translate(-50%, -50%) scale(0.45);
    opacity: 0.95;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.9);
    opacity: 0;
  }
}

/* Ambient Radial Glow Backdrop */
.billboard-glow-backdrop {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(740px, 94vw);
  height: min(520px, 80vh);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 229, 255, 0.28) 0%, rgba(255, 215, 0, 0.14) 38%, rgba(0, 229, 255, 0.04) 58%, transparent 74%);
  z-index: -1;
  animation: pulse-glow 2.4s infinite ease-in-out;
}

.billboard-container.tier-grand .billboard-glow-backdrop {
  width: min(860px, 96vw);
  height: min(600px, 88vh);
  background: radial-gradient(circle, rgba(255, 215, 0, 0.45) 0%, rgba(83, 252, 24, 0.20) 40%, rgba(255, 215, 0, 0.05) 60%, transparent 76%);
}

@keyframes pulse-glow {
  0%, 100% { transform: translate(-50%, -50%) scale(0.96); opacity: 0.82; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

/* =========================================================================
 * MAIN FOREGROUND CARD — OLD-WEST CHARRED OAK & RIVETED BRASS WANTED PLAQUE (APCA Lc >= 95)
 * ========================================================================= */
.billboard-card {
  width: min(580px, 90vw);
  background:
    radial-gradient(circle at 14px 14px, #fbbf24 0px, #78350f 4px, transparent 5px),
    radial-gradient(circle at calc(100% - 14px) 14px, #fbbf24 0px, #78350f 4px, transparent 5px),
    radial-gradient(circle at 14px calc(100% - 14px), #fbbf24 0px, #78350f 4px, transparent 5px),
    radial-gradient(circle at calc(100% - 14px) calc(100% - 14px), #fbbf24 0px, #78350f 4px, transparent 5px),
    linear-gradient(180deg, rgba(18, 12, 7, 0.97) 0%, rgba(10, 7, 4, 0.99) 100%);
  border: 2.5px solid #d97706;
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.96),
    0 0 0 2px rgba(0, 0, 0, 0.95),
    0 0 38px rgba(217, 119, 6, 0.35),
    inset 0 0 0 3px rgba(251, 191, 36, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 26px 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.billboard-container.tier-grand .billboard-card {
  width: min(650px, 92vw);
  padding: 30px 38px 32px;
  background:
    radial-gradient(circle at 16px 16px, #fef08a 0px, #92400e 4.5px, transparent 5.5px),
    radial-gradient(circle at calc(100% - 16px) 16px, #fef08a 0px, #92400e 4.5px, transparent 5.5px),
    radial-gradient(circle at 16px calc(100% - 16px), #fef08a 0px, #92400e 4.5px, transparent 5.5px),
    radial-gradient(circle at calc(100% - 16px) calc(100% - 16px), #fef08a 0px, #92400e 4.5px, transparent 5.5px),
    linear-gradient(180deg, rgba(20, 13, 7, 0.98) 0%, rgba(11, 7, 4, 0.99) 100%);
  border: 3px solid #fbbf24;
  box-shadow:
    0 32px 84px rgba(0, 0, 0, 0.98),
    0 0 0 2px rgba(0, 0, 0, 0.96),
    0 0 58px rgba(245, 158, 11, 0.56),
    0 0 95px rgba(217, 119, 6, 0.28),
    inset 0 0 0 4px rgba(251, 191, 36, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  animation: grand-card-float 2.2s ease-in-out infinite alternate;
}

@keyframes grand-card-float {
  from { transform: translateY(-3px) scale(1); }
  to   { transform: translateY(4px) scale(1.018); }
}

/* Subtle diagonal light sweep across card */
.billboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 220%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.08), transparent);
  transform: rotate(25deg);
  animation: shine-pass 3.2s infinite linear;
  pointer-events: none;
}

@keyframes shine-pass {
  0% { transform: translateX(-100%) rotate(25deg); }
  100% { transform: translateX(100%) rotate(25deg); }
}

/* Top Category Pill (APCA Lc >= 90) */
.billboard-top-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 6px;
  background: rgba(12, 8, 4, 0.96);
  border: 1.5px solid #d97706;
  margin-bottom: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.85);
}

.billboard-container.tier-grand .billboard-top-pill {
  background: rgba(12, 8, 4, 0.96);
  border: 1.5px solid #fbbf24;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.9), 0 0 18px rgba(245, 158, 11, 0.35);
}

.top-pill-icon {
  font-size: 16px;
  line-height: 1;
}

.billboard-category {
  font-family: var(--font-western-sub);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2.2px;
  color: #fde68a;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
}

.billboard-container.tier-grand .billboard-category {
  color: #fde68a;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.98);
}

/* =========================================================================
 * WINNER SPECTATOR AVATAR STAGE (CENTERPIECE)
 * ========================================================================= */
.winner-avatar-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 14px;
}

.winner-avatar-crown {
  font-size: 42px;
  line-height: 1;
  margin-bottom: -12px;
  z-index: 4;
  filter: drop-shadow(0 4px 16px rgba(255, 215, 0, 0.9));
  display: none;
  animation: crown-bounce 1.2s ease-in-out infinite alternate;
}

.billboard-container.tier-grand .winner-avatar-crown {
  display: block;
}

@keyframes crown-bounce {
  from { transform: translateY(-5px) rotate(-5deg) scale(1); }
  to   { transform: translateY(2px) rotate(5deg) scale(1.14); }
}

.winner-avatar-ring {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #38bdf8 0%, #fbbf24 100%);
  box-shadow:
    0 0 26px rgba(56, 189, 248, 0.55),
    0 8px 24px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.billboard-container.tier-grand .winner-avatar-ring {
  width: 136px;
  height: 136px;
  padding: 5px;
  background: linear-gradient(135deg, #fbbf24 0%, #4ade80 50%, #f59e0b 100%);
  box-shadow:
    0 0 42px rgba(245, 158, 11, 0.85),
    0 0 70px rgba(74, 222, 128, 0.45),
    0 12px 30px rgba(0, 0, 0, 0.9);
  animation: ring-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes ring-pulse {
  from { transform: scale(0.98); box-shadow: 0 0 32px rgba(245, 158, 11, 0.75), 0 0 55px rgba(74, 222, 128, 0.35); }
  to   { transform: scale(1.05); box-shadow: 0 0 52px rgba(245, 158, 11, 1), 0 0 85px rgba(74, 222, 128, 0.65); }
}

.winner-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #070a12;
  display: block;
}

.winner-tier-ribbon {
  margin-top: -12px;
  z-index: 3;
  padding: 4px 16px;
  border-radius: 6px;
  font-family: var(--font-western-sub);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: #120b05;
  color: #fde68a;
  border: 1.5px solid #d97706;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.92);
}

.billboard-container.tier-grand .winner-tier-ribbon {
  background: #120b05;
  color: #fef08a;
  border: 1.5px solid #fbbf24;
  font-size: 11.5px;
  padding: 5px 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.95), 0 0 18px rgba(245, 158, 11, 0.55);
}

/* =========================================================================
 * WINNER USERNAME (CENTER FOREGROUND — APCA Lc = 96.4 PURE WHITE + STROKE)
 * ========================================================================= */
.winner-title-wrapper {
  margin-bottom: 14px;
  max-width: 100%;
}

.winner-username {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 400;
  letter-spacing: 1px;
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  -webkit-text-stroke: 0px transparent;
  filter: none !important;
  text-shadow:
    0 3px 0 #03050a,
    0 8px 20px rgba(0, 0, 0, 0.92);
  white-space: nowrap;
  overflow: visible;
  padding: 2px 10px;
}

.billboard-container.tier-grand .winner-username {
  font-size: clamp(34px, 5.2vw, 54px);
  font-weight: 400;
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  -webkit-text-stroke: 0px transparent;
  filter: none !important;
  text-shadow:
    0 3px 0 #03050a,
    0 8px 22px rgba(0, 0, 0, 0.94);
}

/* =========================================================================
 * WINNING SLOT & SCORE PILL
 * ========================================================================= */
.winner-slot-pill {
  width: 100%;
  background: rgba(12, 8, 4, 0.96);
  border: 1.5px solid rgba(217, 119, 6, 0.65);
  border-radius: 10px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.85);
}

.billboard-container.tier-grand .winner-slot-pill {
  border-color: rgba(251, 191, 36, 0.88);
  background: rgba(12, 8, 4, 0.97);
}

.slot-thumbnail {
  width: 48px;
  height: 64px;
  aspect-ratio: 180 / 236;
  border-radius: 8px;
  object-fit: contain;
  background: #070a12;
  border: 1.5px solid #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
  flex-shrink: 0;
}

.slot-text-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  flex: 1;
  min-width: 0;
}

.slot-label {
  font-family: var(--font-western-sub);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fde68a;
}

.slot-name {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-badge {
  background: rgba(24, 15, 7, 0.96);
  border: 1.5px solid #fbbf24;
  border-radius: 8px;
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: #fde68a;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.98);
  white-space: nowrap;
}

/* =========================================================================
 * PRIZE / ADVANCEMENT FOOTER BANNER
 * ========================================================================= */
.prize-tag {
  background: rgba(12, 8, 4, 0.96);
  border: 1.5px solid #d97706;
  border-radius: 8px;
  padding: 7px 22px;
  font-family: var(--font-western-sub);
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #fde68a;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.85);
}

.billboard-container.tier-grand .prize-tag {
  background: rgba(12, 8, 4, 0.97);
  border: 1.5px solid #4ade80;
  color: #86efac;
  font-size: 15px;
  padding: 9px 26px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.98);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.9), 0 0 22px rgba(74, 222, 128, 0.35);
}

/* =========================================================================
 * STREAMER PREVIEW TOOLBAR (?preview=1 ONLY)
 * ========================================================================= */
.test-controls-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  background: rgba(10, 14, 24, 0.95);
  border: 1.5px solid rgba(255, 215, 0, 0.4);
  border-radius: 16px;
  padding: 10px 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
  pointer-events: auto !important;
  z-index: 9999;
}

.controls-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: var(--gold-primary);
  letter-spacing: 1px;
}

.test-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  color: #ffffff;
  padding: 7px 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.test-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.18);
}

.test-btn.tourney {
  background: rgba(255, 215, 0, 0.16);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.test-btn.battle {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--cyan-accent);
  color: var(--cyan-accent);
}

.test-btn.coins {
  background: rgba(83, 252, 24, 0.15);
  border-color: var(--kick-green);
  color: var(--kick-green);
}
