/* Modern Discord Dark Responsive Stylesheet */

:root {
  --bg-primary: #1E1F22;
  --bg-secondary: #2B2D31;
  --bg-tertiary: #111214;
  --accent-blurple: #5865F2;
  --accent-green: #23A55A;
  --accent-gold: #FEE75C;
  --accent-red: #ED4245;
  --text-normal: #F2F3F5;
  --text-muted: #949BA4;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #111214 !important;
  font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--text-normal);
}

.hidden {
  display: none !important;
}

/* UI Icon Utility Classes for Clean Vector Icons */
.ui-icon {
  display: inline-block;
  vertical-align: middle;
  width: 16px;
  height: 16px;
  object-fit: contain;
  margin-right: 6px;
  filter: brightness(0) invert(1); /* Pure bright white for vector icons */
  opacity: 0.92;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

button:hover .ui-icon, .btn:hover .ui-icon {
  opacity: 1;
  transform: scale(1.08);
}

svg.ui-icon {
  mix-blend-mode: normal;
  fill: currentColor;
  filter: none;
  vertical-align: middle;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  pointer-events: none;
}

.ui-icon.sm, svg.ui-icon.sm {
  width: 14px;
  height: 14px;
}

.ui-icon.lg, svg.ui-icon.lg {
  width: 20px;
  height: 20px;
}

.ui-icon.gold, svg.ui-icon.gold {
  filter: brightness(0) invert(86%) sepia(80%) saturate(1000%) hue-rotate(350deg);
  color: var(--accent-gold);
}

#app {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: #111214 radial-gradient(circle at center, #23252B 0%, #141518 70%, #0B0C0E 100%) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Floating Glassmorphism Header & Player Status Cards */
header {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: calc(100% - 20px);
  max-width: 1320px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(22, 23, 26, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 4px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Solo Practice Mode Centered Header */
header.header-solo-mode {
  justify-content: center;
  max-width: 420px;
}

header.header-solo-mode .match-status,
header.header-solo-mode #player2Card {
  display: none !important;
}

header.header-solo-mode .timer-ring-svg {
  display: none !important;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 10px;
  border-radius: 8px;
  background-color: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  min-width: 200px;
}

.player-card.active-turn {
  outline: 2.5px solid var(--accent-gold);
  box-shadow: 0 0 16px rgba(254, 231, 92, 0.5);
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.player-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.balls-rack {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}

.mini-ball-slot {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mini-ball-slot.unpocketed {
  opacity: 0.32;
  filter: saturate(0.6);
  border: 1px dashed rgba(255, 255, 255, 0.22);
}

.mini-ball-slot.pocketed {
  opacity: 1;
  filter: none;
  border: 1px solid rgba(255, 255, 255, 0.7);
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.45), inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.mini-ball-slot .ball-num {
  position: relative;
  z-index: 2;
  width: 13px;
  height: 13px;
  background: #FFFFFF;
  border-radius: 50%;
  color: #0F172A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.mini-ball-slot.stripe {
  background: #FFFFFF !important;
  overflow: hidden;
}

.mini-ball-slot.stripe::before {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  right: 0;
  background: var(--stripe-color);
  z-index: 1;
}

.avatar-wrapper {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-ring-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  transform: rotate(-90deg);
  pointer-events: none;
}

.timer-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 3;
}

.timer-ring-fill {
  fill: none;
  stroke: #23A55A;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 119.38;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.4s linear, stroke 0.3s ease;
}

.timer-ring-fill.warning {
  stroke: #ED4245;
  animation: pulse-ring 0.6s infinite alternate;
}

@keyframes pulse-ring {
  0% { stroke-width: 3.5; }
  100% { stroke-width: 5; }
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blurple), #4752C4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 13px;
  color: white;
  border: 1.5px solid rgba(255,255,255,0.25);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.username {
  font-weight: 800;
  font-size: 13px;
}

.group-tag {
  font-size: 11px;
  color: var(--text-muted);
}

/* Turn Status Indicator */
.match-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.turn-badge {
  background: var(--accent-blurple);
  color: white;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Main Fullscreen Table Workspace */
.game-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 48px 22px 6px; /* Optimized workspace padding for maximum pool table scale */
  box-sizing: border-box;
  overflow: hidden;
}

canvas#poolCanvas {
  width: 100%;
  height: 100%;
  background-color: transparent;
  cursor: crosshair;
  touch-action: none;
  object-fit: contain;
}

/* Iconic 8 Ball Pool Cue Power Slider Gauge Widget */
.cue-power-slider-container {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 58px;
  height: auto;
  max-height: calc(100vh - 100px);
  background: rgba(17, 18, 20, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 8px 3px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.cue-slider-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 1px;
}

.cue-power-percent {
  font-size: 12px;
  font-weight: 800;
  color: #F8FAFC;
}

.cue-power-gauge {
  position: relative;
  width: 44px;
  height: 320px;
  max-height: 68vh;
  background: linear-gradient(to bottom, #1E1B18, #3B200E, #5C2D17, #78350F);
  border: 3px solid #94A3B8;
  border-radius: 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 2px 6px rgba(0, 0, 0, 0.8);
  cursor: grab;
  touch-action: none;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.cue-power-gauge:active {
  cursor: grabbing;
}

/* Power Fill Indicator */
.cue-power-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(to bottom, rgba(234, 179, 8, 0.2), rgba(249, 115, 22, 0.6), rgba(220, 38, 38, 0.85));
  pointer-events: none;
  transition: height 0.04s ease-out;
}

/* Power Tick Lines */
.cue-power-ticks {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 4px;
  pointer-events: none;
}

.tick-line {
  width: 100%;
  height: 1.5px;
  background-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Sliding Cue Stick Graphic Inside Gauge */
.cue-power-stick {
  position: absolute;
  top: 8px;
  width: 12px;
  height: 290px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transform: translateY(0px);
  transition: transform 0.04s ease-out;
}

.cue-stick-tip {
  width: 6px;
  height: 4px;
  background-color: #FFFFFF;
  border-radius: 2px 2px 0 0;
  border-top: 1.5px solid #1E293B;
}

.cue-stick-shaft {
  width: 7px;
  height: 160px;
  background: linear-gradient(to bottom, #FEF3C7, #FDE68A, #D97706);
  border-radius: 1px;
}

.cue-stick-joint {
  width: 9px;
  height: 12px;
  background: linear-gradient(to bottom, #0F172A, #F59E0B, #0F172A);
  margin: 1px 0;
}

.cue-stick-wrap {
  width: 10px;
  height: 80px;
  background: repeating-linear-gradient(to bottom, #1E1B18, #1E1B18 4px, #D97706 4px, #D97706 6px);
}

.cue-stick-butt {
  width: 11px;
  height: 28px;
  background: linear-gradient(to bottom, #78350F, #B45309, #451A03);
  border-radius: 0 0 5px 5px;
  border-bottom: 3px solid #E2E8F0;
}

/* Spin Button Widget */
.btn-spin-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
  outline: none;
  transition: transform 0.2s ease;
}

.btn-spin-control:hover {
  transform: scale(1.1);
}

.spin-preview-ball {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFFFFF, #E2E8F0 60%, #94A3B8);
  border: 2px solid #64748B;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spin-preview-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #EF4444;
  border: 1px solid #991B1B;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.8);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.spin-btn-label {
  font-size: 9px;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
}

.spin-status-text {
  font-size: 8px;
  font-weight: 700;
  color: #38BDF8;
  white-space: nowrap;
}

/* Spin Modal Overlay */
#spinModal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  user-select: none;
}

.spin-modal-content {
  background: var(--bg-secondary);
  border: 2px solid var(--bg-tertiary);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  min-width: 280px;
}

.spin-modal-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.spin-modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-gold);
}

.btn-close-spin {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}

.btn-close-spin:hover {
  color: white;
}

.spin-target-area {
  padding: 10px;
}

.spin-big-ball {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFFFFF, #E2E8F0 60%, #94A3B8);
  border: 4px solid #475569;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), inset 0 2px 6px rgba(255, 255, 255, 0.8);
  cursor: crosshair;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spin-guide-cross {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.spin-guide-cross::before, .spin-guide-cross::after {
  content: '';
  position: absolute;
  background: rgba(148, 163, 184, 0.35);
}

.spin-guide-cross::before {
  top: 50%; left: 10%; width: 80%; height: 1px;
}

.spin-guide-cross::after {
  left: 50%; top: 10%; height: 80%; width: 1px;
}

.spin-guide-ring {
  position: absolute;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  pointer-events: none;
}

.spin-big-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #EF4444;
  border: 2px solid #7F1D1D;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.9);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.spin-hints {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: var(--text-muted);
}

.key-hint {
  font-size: 9px;
  color: var(--text-muted);
}

/* Floating Glassmorphism Footer Controls */
footer {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: auto;
  max-width: calc(100% - 20px);
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(22, 23, 26, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 3px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  flex-wrap: nowrap;
}

.btn {
  background: linear-gradient(135deg, var(--accent-blurple), #4752C4);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 5px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-normal);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Toast Notifications */
#toast {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(237, 66, 69, 0.95);
  color: white;
  padding: 6px 18px;
  border-radius: 16px;
  font-weight: bold;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 100;
}

#toast.show {
  opacity: 1;
}

/* Victory Overlay */
#victoryModal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 200;
}

#victoryModal.hidden {
  display: none;
}

#victoryModal h2 {
  font-size: 26px;
  color: var(--accent-gold);
}

#victoryModal p {
  font-size: 14px;
  color: var(--text-normal);
}



/* Felt Color Swatch Selector */
.felt-color-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.color-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-dot:hover {
  transform: scale(1.2);
  border-color: rgba(255, 255, 255, 0.8);
}

.color-dot.active {
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
  transform: scale(1.15);
}

/* AI Commentator ON AIR Badge & Subtitles */
.commentator-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #ED4245, #C0392B);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 0 8px rgba(237, 66, 69, 0.6);
  animation: pulse-border 1.5s infinite alternate;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: white;
  animation: blink 1.0s infinite alternate;
}

@keyframes blink {
  from { opacity: 0.3; transform: scale(0.8); }
  to { opacity: 1.0; transform: scale(1.2); }
}

@keyframes pulse-border {
  from { box-shadow: 0 0 4px rgba(237, 66, 69, 0.4); }
  to { box-shadow: 0 0 12px rgba(237, 66, 69, 0.9); }
}

.commentator-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-gold);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  font-style: italic;
}

/* Responsive Scaling for Compact / Narrow Discord Views */
@media (max-width: 820px) {
  header {
    height: 40px;
    padding: 2px 8px;
    top: 6px;
    width: calc(100% - 12px);
  }

  .player-card {
    min-width: 130px;
    padding: 2px 6px;
  }

  .username {
    font-size: 11px;
  }

  .group-tag {
    display: none;
  }

  footer {
    height: 36px;
    padding: 2px 8px;
    bottom: 6px;
    width: calc(100% - 12px);
    font-size: 11px;
  }

  .btn {
    padding: 3px 8px;
    font-size: 11px;
  }

  .game-container {
    padding: 34px 44px 22px 6px;
  }

  .cue-power-slider-container {
    right: 6px;
    width: 60px;
  }
}

/* Main Menu Overlay & Game Mode Cards (Iconic 8 Ball Pool Styling) */
#mainMenuModal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(20, 30, 55, 0.95) 0%, rgba(8, 12, 22, 0.97) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#mainMenuModal.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.main-menu-card.pool-8-style {
  width: 90%;
  max-width: 860px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, rgba(26, 36, 62, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 2px solid rgba(245, 158, 11, 0.6);
  border-radius: 24px;
  padding: 24px 32px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(245, 158, 11, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: modalPopIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPopIn {
  0% { transform: scale(0.88) translateY(24px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* 8 Ball Pool Logo & Header */
.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-8-ball {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #475569 0%, #1E293B 50%, #0F172A 100%);
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo-8-num {
  width: 26px;
  height: 26px;
  background: #FFFFFF;
  border-radius: 50%;
  color: #000000;
  font-weight: 900;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.logo-title-group {
  display: flex;
  flex-direction: column;
}

.main-menu-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #FFFBEB 0%, #FEE75C 40%, #F59E0B 75%, #D97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.4));
}

.main-menu-subtitle {
  font-size: 12px;
  font-weight: 800;
  color: #94A3B8;
  letter-spacing: 2px;
  margin-top: 4px;
}

/* Mode Cards Grid (3D Metallic Blue Cards) */
.mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}

.mode-card {
  position: relative;
  background: linear-gradient(180deg, #24304F 0%, #151D33 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 24px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mode-card:hover {
  transform: translateY(-8px) scale(1.02);
  background: linear-gradient(180deg, #2E3D66 0%, #1A2542 100%);
  border-color: var(--accent-gold);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65), 0 0 25px rgba(254, 231, 92, 0.3);
}

.mode-card-badge {
  position: absolute;
  top: -11px;
  background: linear-gradient(180deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  padding: 3px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.mode-card-badge.cyan {
  background: linear-gradient(180deg, #00F2FE 0%, #4FACFE 100%);
  color: #0F172A;
}

.mode-card-badge.gold {
  background: linear-gradient(180deg, #FEE75C 0%, #F59E0B 100%);
  color: #0F172A;
}

.mode-icon-box {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.mode-emoji {
  font-size: 32px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

.mode-title {
  font-size: 18px;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: 0.5px;
}

.mode-desc {
  font-size: 12px;
  color: #94A3B8;
  line-height: 1.45;
  flex-grow: 1;
}

/* Iconic Chunky 3D 8-Ball Buttons */
.btn-mode {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.8px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-8ball-green {
  background: linear-gradient(180deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  border-bottom: 4px solid #047857;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-8ball-green:hover {
  background: linear-gradient(180deg, #34D399 0%, #059669 100%);
}

.btn-8ball-blue {
  background: linear-gradient(180deg, #3B82F6 0%, #1D4ED8 100%);
  color: #FFFFFF;
  border-bottom: 4px solid #1E40AF;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-8ball-blue:hover {
  background: linear-gradient(180deg, #60A5FA 0%, #1D4ED8 100%);
}

.btn-8ball-gold {
  background: linear-gradient(180deg, #FEE75C 0%, #F59E0B 100%);
  color: #0F172A;
  border-bottom: 4px solid #D97706;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-8ball-gold:hover {
  background: linear-gradient(180deg, #FEF08A 0%, #F59E0B 100%);
}

.btn-mode:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

/* Micro Fine Aim Controls */
.fine-aim-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 3px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.btn-fine-aim {
  background: linear-gradient(180deg, #334155 0%, #1E293B 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #F8FAFC;
  font-size: 11px;
  width: 26px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-fine-aim:hover {
  background: var(--accent-gold);
  color: #0F172A;
  transform: scale(1.1);
}

.btn-fine-aim:active {
  transform: scale(0.95);
}

.fine-aim-label {
  font-size: 9px;
  font-weight: 900;
  color: var(--accent-gold);
  letter-spacing: 1px;
  padding: 0 4px;
}

/* Quick Chat Emotes Floating Button & Popup */
#quickChatContainer {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 60;
}

.btn-quick-chat {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #FFFFFF;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-quick-chat:hover {
  transform: scale(1.1);
}

.quick-chat-menu {
  position: absolute;
  bottom: 54px;
  left: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 180px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  animation: modalPopIn 0.25s ease;
}

.chat-menu-title {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 2px;
}

.chat-phrase-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #F8FAFC;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-phrase-btn:hover {
  background: var(--accent-gold);
  color: #0F172A;
  transform: translateX(3px);
}

/* Floating Speech Bubble Over Avatar */
.chat-speech-bubble {
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFFFFF;
  color: #0F172A;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  z-index: 80;
  animation: bubblePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #FFFFFF transparent transparent transparent;
}

@keyframes bubblePop {
  0% { transform: translateX(-50%) scale(0.6); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.solo-floating-bar {
  position: absolute;
  top: 86px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 6px 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 158, 11, 0.2);
  animation: modalPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.solo-floating-bar.hidden {
  display: none !important;
}

.btn-solo-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 900;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-solo-action.gold {
  background: linear-gradient(180deg, #FEE75C 0%, #F59E0B 100%);
  color: #0F172A;
  border-bottom: 3px solid #D97706;
}

.btn-solo-action.green {
  background: linear-gradient(180deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  border-bottom: 3px solid #047857;
}

.btn-solo-action.blue {
  background: linear-gradient(180deg, #3B82F6 0%, #1D4ED8 100%);
  color: #FFFFFF;
  border-bottom: 3px solid #1E40AF;
}

.btn-solo-action.purple {
  background: linear-gradient(180deg, #9333EA 0%, #7E22CE 100%);
  color: #FFFFFF;
  border-bottom: 3px solid #6B21A8;
}

.btn-solo-action:hover {
  transform: scale(1.06);
}

.btn-solo-action:active {
  transform: scale(0.95);
  border-bottom-width: 1px;
}

/* Aim Assistance Mode Selector (Arcade vs Realistic) */
.aim-mode-selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.selector-title {
  font-size: 11px;
  font-weight: 800;
  color: #94A3B8;
  letter-spacing: 1.5px;
}

.pill-switch-group {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 4px;
  gap: 6px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}

.pill-option {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.pill-option:hover {
  color: #FFFFFF;
}

.pill-option.active {
  background: linear-gradient(180deg, #FEE75C 0%, #F59E0B 100%);
  color: #0F172A;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* Cue Skin Customization Shop Cards */
.shop-custom-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
}

.shop-title-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 1.5px;
}

.cue-skins-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
}

.cue-skin-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.cue-skin-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.4);
}

.cue-skin-card.active {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.15);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}

.cue-skin-card.gold.active {
  border-color: #F59E0B;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.5);
}

.cue-skin-card.cyan.active {
  border-color: #06B6D4;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.5);
}

.cue-skin-card.ice.active {
  border-color: #38BDF8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
}

.cue-skin-icon {
  font-size: 20px;
}

.cue-skin-name {
  font-size: 11px;
  font-weight: 800;
  color: #F1F5F9;
}

/* Fullscreen High-Priority Modal Overlay Engine */
#mainMenuModal, #victoryModal, #spinModal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(10, 12, 16, 0.88) !important;
  backdrop-filter: blur(16px) !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: auto !important;
}

#mainMenuModal.hidden, #victoryModal.hidden, #spinModal.hidden {
  display: none !important;
  pointer-events: none !important;
}

.main-menu-card {
  background: linear-gradient(145deg, #1E293B 0%, #0F172A 100%);
  border: 2px solid rgba(245, 158, 11, 0.5);
  border-radius: 20px;
  padding: 24px 32px;
  max-width: 860px;
  width: 90%;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(245, 158, 11, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 100000 !important;
  pointer-events: auto !important;
}

.mode-card, .cue-skin-card, .pill-option, .btn-mode, .btn-solo-action, .btn {
  cursor: pointer !important;
  pointer-events: auto !important;
  user-select: none !important;
}

/* Custom Scrollbar for Main Menu Card on Small Windows */
.main-menu-card::-webkit-scrollbar {
  width: 6px;
}
.main-menu-card::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 10px;
  margin: 10px 0;
}
.main-menu-card::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.6);
  border-radius: 10px;
}
.main-menu-card::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.9);
}

/* Compact Responsive Scaling for Discord Activity (Low Heights & Narrow Widths) */
@media (max-height: 760px) {
  .main-menu-card.pool-8-style, .main-menu-card {
    padding: 16px 20px !important;
    gap: 12px !important;
    max-width: 780px !important;
    border-radius: 18px !important;
  }

  .logo-wrapper {
    gap: 10px !important;
  }

  .logo-8-ball {
    width: 40px !important;
    height: 40px !important;
  }

  .logo-8-num {
    width: 20px !important;
    height: 20px !important;
    font-size: 13px !important;
  }

  .main-menu-title {
    font-size: 22px !important;
  }

  .main-menu-subtitle {
    font-size: 10px !important;
    letter-spacing: 1px !important;
  }

  .aim-mode-selector {
    gap: 4px !important;
    margin-bottom: 0 !important;
  }

  .selector-title {
    font-size: 10px !important;
  }

  .pill-option {
    padding: 4px 12px !important;
    font-size: 11px !important;
  }

  .mode-cards-grid {
    gap: 12px !important;
  }

  .mode-card {
    padding: 14px 10px 12px 10px !important;
    gap: 6px !important;
    border-radius: 12px !important;
  }

  .mode-card-badge {
    top: -9px !important;
    font-size: 9px !important;
    padding: 2px 8px !important;
  }

  .mode-icon-box {
    width: 42px !important;
    height: 42px !important;
  }

  .mode-emoji {
    font-size: 22px !important;
  }

  .mode-title {
    font-size: 15px !important;
  }

  .mode-desc {
    font-size: 10px !important;
    line-height: 1.3 !important;
  }

  .btn-mode {
    padding: 7px 10px !important;
    font-size: 11px !important;
    border-bottom-width: 3px !important;
  }

  .shop-custom-container {
    margin-top: 4px !important;
    gap: 6px !important;
  }

  .shop-title-badge {
    font-size: 10px !important;
  }

  .cue-skins-grid {
    gap: 8px !important;
  }

  .cue-skin-card {
    padding: 6px 8px !important;
    border-radius: 10px !important;
  }

  .cue-skin-icon {
    font-size: 16px !important;
  }

  .cue-skin-name {
    font-size: 10px !important;
  }
}

@media (max-height: 600px) {
  .main-menu-card.pool-8-style, .main-menu-card {
    padding: 12px 16px !important;
    gap: 8px !important;
    max-width: 720px !important;
  }

  .logo-8-ball {
    width: 32px !important;
    height: 32px !important;
  }

  .logo-8-num {
    width: 16px !important;
    height: 16px !important;
    font-size: 11px !important;
  }

  .main-menu-title {
    font-size: 18px !important;
  }

  .main-menu-subtitle {
    display: none !important;
  }

  .mode-desc {
    display: none !important;
  }

  .mode-card {
    padding: 10px 8px 8px 8px !important;
    gap: 4px !important;
  }

  .mode-icon-box {
    width: 34px !important;
    height: 34px !important;
  }

  .mode-emoji {
    font-size: 18px !important;
  }

  .mode-title {
    font-size: 13px !important;
  }

  .cue-skin-card {
    padding: 4px 6px !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 4px !important;
  }

  .cue-skin-icon {
    font-size: 14px !important;
  }
}

@media (max-width: 640px) {
  .mode-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .cue-skins-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* 4-Player Team Card Groups & Spectator Badge */
.team-card-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.match-status-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spectator-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-normal);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Pre-Game Lobby Modal Styles */
.mode-tab-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: 100%;
  margin-bottom: 4px;
}

.mode-tab-btn {
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-tab-btn.active {
  background: var(--accent-blurple);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 12px rgba(88, 101, 242, 0.5);
}

.lobby-slots-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 8px 0;
}

.team-slot-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.team-a-col {
  border-color: rgba(59, 130, 246, 0.4);
}

.team-b-col {
  border-color: rgba(239, 68, 68, 0.4);
}

.team-col-header {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
}

.team-a-col .team-col-header {
  color: #3B82F6;
}

.team-b-col .team-col-header {
  color: #EF4444;
}

.team-slots-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lobby-slot-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 10px;
  transition: all 0.2s ease;
}

.lobby-slot-card.occupied {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.slot-badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  width: 50px;
}

.slot-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.slot-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
}

.slot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slot-username {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-normal);
}

.slot-actions {
  display: flex;
  gap: 4px;
}

.btn-slot-join, .btn-slot-bot {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

.btn-slot-bot {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-normal);
}

.btn-slot-bot:hover {
  background: rgba(255, 255, 255, 0.22);
}

.vs-divider {
  font-size: 14px;
  font-weight: 900;
  color: var(--accent-gold);
  padding: 0 4px;
}

.lobby-spectator-section {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 6px 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.spectator-sec-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.lobby-spectator-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.no-spectators {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.lobby-footer-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  width: 100%;
}

.btn-start-game {
  padding: 8px 24px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
}

.hidden-in-1v1 {
  display: none !important;
}

/* Minimalist AI Commentator Overlay Banner (Right below "Ваш Хід" / Header) */
.tv-commentator-banner {
  position: absolute;
  top: 62px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: max-content;
  min-width: auto;
  max-width: 80%;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(245, 158, 11, 0.15);
  padding: 6px 14px;
  pointer-events: none;
  box-sizing: border-box;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tv-commentator-banner.hidden {
  display: flex !important;
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
  pointer-events: none;
}

.tv-banner-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  padding-bottom: 0;
  margin-bottom: 0;
}

.tv-banner-header.has-text {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 3px;
  margin-bottom: 4px;
  width: 100%;
}

/* Audio Equalizer Bars */
.tv-audio-eq {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 11px;
}

.eq-bar {
  width: 3px;
  height: 100%;
  background: var(--accent-gold);
  border-radius: 2px;
  animation: eqBounce 0.8s infinite ease-in-out alternate;
}

.eq-bar:nth-child(1) { animation-delay: 0.0s; }
.eq-bar:nth-child(2) { animation-delay: 0.2s; }
.eq-bar:nth-child(3) { animation-delay: 0.4s; }
.eq-bar:nth-child(4) { animation-delay: 0.1s; }

@keyframes eqBounce {
  0% { height: 25%; }
  100% { height: 100%; }
}

.tv-channel-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
}

.tv-speech-text {
  font-size: 12.5px;
  font-weight: 700;
  color: #F8FAFC;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.2px;
  text-align: center;
}

.tv-speech-text:empty {
  display: none;
}

.tv-speech-text .highlight-gold {
  color: var(--accent-gold);
  font-weight: 800;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.tv-speech-text .highlight-red {
  color: #EF4444;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.tv-speech-text .highlight-green {
  color: #10B981;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* ── Bjars Junta Branding ── */
#mainMenuModal {
  position: relative;
}

.bjars-junta-branding {
  position: absolute;
  bottom: 18px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  opacity: 0.75;
}

.bjars-junta-branding:hover {
  transform: scale(1.08);
  opacity: 1;
}

.bjars-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.bjars-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  font-style: italic;
  white-space: nowrap;
  text-align: center;
}

