/* CSS Design System for Noboard */

:root {
  --bg-dark: #0d0f17;
  --bg-panel: rgba(22, 28, 45, 0.7);
  --bg-panel-solid: #161c2d;
  --border-color: rgba(255, 255, 255, 0.08);
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Neon Palette */
  --neon-pink: #FF3366;
  --neon-cyan: #33CCFF;
  --neon-emerald: #33FF99;
  --neon-orange: #FF9933;
  --neon-purple: #CC33FF;
  --neon-yellow: #FFFF33;
  
  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Game grid dimensions */
  --board-grid-gap: 2px;
}

/* Base resets & box sizing */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Playful floating background blobs */
.bg-blobs {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background-color: var(--neon-pink);
  top: -10%;
  left: -10%;
  animation-duration: 25s;
}

.blob-2 {
  width: 600px;
  height: 600px;
  background-color: var(--neon-purple);
  bottom: -15%;
  right: -10%;
  animation-duration: 30s;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background-color: var(--neon-cyan);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 20s;
}

@keyframes float {
  0% { transform: translateY(0px) rotate(0deg) scale(1); }
  50% { transform: translateY(50px) rotate(180deg) scale(1.1); }
  100% { transform: translateY(-30px) rotate(360deg) scale(0.9); }
}

/* App Container */
.app-container {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* View switching */
.view {
  display: none;
  width: 100%;
  height: 100%;
  padding: 20px;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.view.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
}

/* Glassmorphism panels */
.panel {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Typography Utilities */
.font-gradient {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.font-gradient-glow {
  background: linear-gradient(135deg, var(--neon-yellow), var(--neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 51, 102, 0.4);
}

.logo-text {
  font-size: 5rem;
  font-weight: 900;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #FFF 20%, #8b5cf6, var(--neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
  text-align: center;
  margin-bottom: 5px;
}

.logo-text-small {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #FFF, var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: 1.4rem;
  font-weight: 400;
  text-align: center;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  font-family: var(--font-family);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-pink), #e11d48);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--neon-cyan), #0284c7);
  color: white;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(51, 204, 255, 0.4);
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
  border-radius: 10px;
}

.btn-glow {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Input Fields */
input[type="text"] {
  font-family: var(--font-family);
  font-size: 1.1rem;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  color: white;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: var(--neon-cyan);
}

/* Error text styling */
.error-text {
  color: var(--neon-pink);
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 20px;
  text-align: center;
}

/* 1. LANDING PAGE STYLE */
#view-landing {
  justify-content: center;
  align-items: center;
  gap: 40px;
}

.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-options {
  display: flex;
  gap: 30px;
  width: 100%;
  max-width: 900px;
}

.option-card {
  flex: 1;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.option-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.option-card h2 {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.option-card p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 30px;
  line-height: 1.5;
  flex-grow: 1;
}

.join-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* 2. TV LOBBY VIEW */
#view-tv-lobby {
  padding: 20px 40px;
  gap: 20px;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
}

#view-tv-lobby .panel {
  padding: clamp(15px, 3vh, 30px);
}

#view-tv-lobby .lobby-instructions.panel {
  padding: 10px;
}

#view-tv-lobby .lobby-players.panel {
  padding: 8px 15px;
}

#view-tv-lobby .qr-container {
  padding: 6px;
  border-radius: 12px;
  margin-bottom: 6px;
}



.lobby-main-row {
  display: flex;
  flex-grow: 1;
  gap: 20px;
  min-height: 0;
  width: 100%;
}

.lobby-instructions {
  flex: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  min-width: 0;
}

.lobby-games {
  flex: 5;
  display: flex;
  flex-direction: column;
  padding: 20px;
  min-height: 0;
  min-width: 0;
}

.lobby-rules {
  flex: 4;
  display: flex;
  flex-direction: column;
  padding: 20px;
  min-height: 0;
  min-width: 0;
  box-sizing: border-box;
}

.lobby-players {
  height: 110px;
  flex-shrink: 0;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

.lobby-players h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.player-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 10px;
  overflow-y: auto;
  align-content: start;
  flex-grow: 1;
}

.no-players-msg {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 25px;
  animation: pulse 1.5s infinite;
}

.player-lobby-badge {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 0;
  flex-shrink: 0;
}

.player-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
  flex-shrink: 0;
}

.player-lobby-name {
  font-size: 0.95rem;
  font-weight: 700;
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.host-badge {
  font-size: 0.75rem;
  background: #f59e0b;
  color: black;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}


.lobby-players h3 {
  font-size: 1rem;
  margin: 0 0 10px 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lobby-players .player-count-badge {
  font-weight: 800;
  color: var(--neon-cyan);
}

#tv-player-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  flex-grow: 1;
  align-items: center;
  padding-bottom: 4px;
  white-space: nowrap;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

#tv-player-list::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* 4. CONTROLLER LOBBY VIEW (Mobile) */
#view-controller-lobby {
  padding: 20px;
  justify-content: flex-start;
  align-items: center;
  gap: 15px;
}

.mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.mobile-header h2 {
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, white, var(--neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.room-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--neon-emerald);
}

.controller-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.avatar-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.color-badge {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

#player-color-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.status-box {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 12px 20px;
  text-align: center;
  width: 100%;
  border: 1px solid var(--border-color);
}

#lobby-status-msg {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.host-controls-box {
  width: 100%;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 16px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.host-title {
  color: #f59e0b;
  font-weight: 800;
  font-size: 1rem;
}

.lobby-member-list {
  width: 100%;
  text-align: left;
}

.lobby-member-list h4 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

#controller-player-list {
  list-style: none;
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#controller-player-list li {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#controller-player-list li span.name {
  font-weight: 600;
}

/* Controller game and TV gameover sections nuked */

/* Responsive Scaling for TVs vs Phones */
@media (max-width: 1024px) and (orientation: portrait) {
  .lobby-main-row {
    flex-direction: column;
    overflow-y: auto;
    flex-grow: 1;
  }
  .lobby-main-row > div {
    flex: none !important;
    height: auto;
    min-height: 280px;
  }
  .carousel-card {
    height: 320px;
  }
}

/* Compact TV Header */
.tv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 10px 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 10px;
}

.tv-header .logo-text-small {
  font-size: clamp(0.9rem, 4vh, 2rem);
}

.room-info-badge {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: clamp(3px, 1.5vh, 12px) clamp(10px, 3vw, 24px);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(4px, 1.5vw, 15px);
}

.badge-label {
  font-size: clamp(0.5rem, 2vh, 1.2rem);
  color: var(--text-secondary);
  font-weight: 800;
  letter-spacing: 1px;
}

.badge-value {
  font-size: clamp(0.9rem, 3.5vh, 2.5rem);
  font-weight: 900;
  color: var(--neon-emerald);
  letter-spacing: 3px;
}

.mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  /* Phone optimizations */
  .view {
    padding: 10px;
  }
  
  #view-landing {
    padding: 20px;
    gap: 20px;
  }

  .landing-stats-hud {
    display: none !important;
  }
  
  .landing-options {
    flex-direction: column;
    gap: 15px;
  }
  
  .option-card {
    padding: 20px;
  }
  
  .card-host {
    display: none; /* Hide hosting from mobile devices by default */
  }
  
  .mobile-only {
    display: flex !important;
  }
  
  .desktop-only {
    display: none !important;
  }
  
  .logo-text {
    font-size: 3.5rem;
  }
  
  .tagline {
    font-size: 1rem;
  }
}

/* Landscape orientation warning overlay for mobile users */
.orientation-warning-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
}

.warning-content {
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.phone-rotate-icon {
  font-size: 5rem;
  animation: rotateDevice 2.5s infinite ease-in-out;
}

@keyframes rotateDevice {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-90deg); }
  75% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

/* Show overlay in landscape mode on screens with small heights (phones), EXCEPT when horizontal controller mode is active */
@media (orientation: landscape) and (max-height: 500px) {
  body:not(.controller-horizontal) .orientation-warning-overlay {
    display: flex;
  }
}

/* Horizontal controller layout optimizations (e.g. Card Games like WildColors) */
body.controller-horizontal #view-controller-game {
  padding: 6px 12px !important;
  overflow: hidden !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

body.controller-horizontal .mobile-header {
  padding: 4px 8px !important;
  margin-bottom: 4px !important;
  flex-shrink: 0 !important;
}

body.controller-horizontal .mobile-header h2 {
  font-size: 1rem !important;
}

body.controller-horizontal #controller-game-container {
  max-width: 100% !important;
  width: 100% !important;
  flex: 1 !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  border-radius: 16px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* TV Game Selection List */
.lobby-games h2 {
  font-size: 1.8rem;
  margin-bottom: clamp(10px, 2vh, 20px);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-width: 0;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  gap: 20px;
}

.carousel-card {
  flex: 0 0 100%;
  background: var(--bg-panel-solid);
  border: 2px solid var(--border-color);
  border-radius: 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0.2;
  transform: scale(0.92);
}

.carousel-card.active {
  opacity: 1;
  transform: scale(1);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 30px rgba(51, 204, 255, 0.25);
}

.carousel-card.locked {
  filter: grayscale(0.5);
  opacity: 0.15;
}

.carousel-card.locked.active {
  opacity: 0.6;
  filter: grayscale(0.2);
  border-color: var(--text-muted);
  box-shadow: none;
}

.card-icon-banner {
  flex: 0 0 35%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2.5rem, 6vh, 4.5rem);
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.card-content-wrapper {
  padding: clamp(12px, 2.5vh, 20px);
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1.2vh, 10px);
  text-align: left;
  flex-grow: 1;
  overflow-y: auto;
  min-height: 0;
}

.card-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--neon-cyan);
  color: black;
  letter-spacing: 0.5px;
}

.card-badge.locked {
  background: #475569;
  color: white;
}

.carousel-card h3 {
  font-size: clamp(1rem, 5vh, 4rem);
  font-weight: 800;
  margin-bottom: 5px;
}

.carousel-card p {
  font-size: clamp(0.7rem, 2.5vh, 2rem);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Mobile Game Selector in Host Controls (Carousel Cards style) */
.host-game-selector {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.selector-heading {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.mobile-games-carousel {
  display: flex;
  gap: 10px;
  width: 100%;
  overflow-x: auto;
  padding: 5px 0;
  scrollbar-width: none;
}

.mobile-games-carousel::-webkit-scrollbar {
  display: none;
}

.mobile-game-card {
  flex: 0 0 100px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.mobile-game-card.active {
  background: rgba(51, 204, 255, 0.08);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(51, 204, 255, 0.2);
}

.mobile-game-card.active .game-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 0 5px var(--neon-cyan));
}

.mobile-game-card.locked {
  opacity: 0.4;
}

.game-icon {
  font-size: 1.8rem;
  transition: transform 0.2s;
}

.game-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.mobile-game-card.active .game-name {
  color: white;
}

.selected-game-indicator {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

.selected-game-indicator strong {
  color: var(--neon-cyan);
}

.player-lobby-badge.away {
  opacity: 0.45;
  filter: grayscale(0.6);
  border-style: dashed;
}

.away-label {
  font-size: 0.8rem;
  margin-left: 5px;
  animation: pulse 1.5s infinite;
}

/* Custom switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .2s ease-in-out;
  border-radius: 24px;
  border: 1px solid var(--border-color);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s ease-in-out;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.switch input:checked + .switch-slider {
  background-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(51, 204, 255, 0.4);
  border-color: rgba(51, 204, 255, 0.6);
}

.switch input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* Custom range slider */
.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
  transition: background 0.15s ease-in-out;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--neon-cyan);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(51, 204, 255, 0.6);
  transition: transform 0.1s ease-in-out;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Kick & Promote button styles */
.btn-kick, .btn-promote {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.15s, transform 0.15s;
}

.btn-kick:hover, .btn-promote:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* Minimized TV header during active gameplay to maximize vertical space */
/* Minimized TV header during active gameplay to maximize vertical space */
#view-tv-game {
  padding: 10px 20px;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
}

#view-tv-game .tv-header {
  padding: 0 10px 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 10px;
}

#view-tv-game .logo-text-small {
  font-size: 1.1rem;
}

#view-tv-game .room-info-badge {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

#view-tv-game .badge-label {
  font-size: 0.65rem;
  letter-spacing: 0.5px;
}

#view-tv-game .badge-value {
  font-size: 1.2rem;
  letter-spacing: 1px;
  color: var(--neon-cyan);
}

#tv-lobby-settings-hud {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: clamp(0.75rem, 1.5vh, 1rem);
  color: var(--text-primary);
  text-align: left;
  padding: 10px 15px;
  flex-grow: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Mobile padding/margin optimizations for small heights */
@media (max-height: 720px) {
  #view-controller-lobby {
    padding: 10px;
  }
  .controller-card {
    padding: 16px;
    gap: 10px;
  }
  .avatar-circle {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }
  .host-settings-section {
    padding-top: 10px !important;
    margin-top: 8px !important;
    gap: 8px !important;
  }
  .settings-row {
    margin-top: 2px !important;
  }
  #btn-start-game {
    margin-top: 10px !important;
  }
}

/* Landing Stats HUD */
.landing-stats-hud {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 30px;
  font-size: 0.8rem;
  color: var(--text-muted);
  backdrop-filter: blur(8px);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.stats-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats-label {
  color: var(--text-secondary);
}

.stats-val {
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(51, 204, 255, 0.3);
}

.stats-divider {
  color: rgba(255, 255, 255, 0.08);
  user-select: none;
}

.stats-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--neon-emerald);
  box-shadow: 0 0 8px var(--neon-emerald);
  display: inline-block;
  animation: statsPulse 2s infinite ease-in-out;
}

@keyframes statsPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Loading Overlay */
.loading-overlay-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  margin-top: 40px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  backdrop-filter: blur(16px);
}

.loading-spinner {
  width: 45px;
  height: 45px;
  border: 3.5px solid rgba(255, 255, 255, 0.05);
  border-top: 3.5px solid var(--neon-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
  box-shadow: 0 0 15px rgba(51, 204, 255, 0.2);
}

.loading-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 40%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.loading-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive adjustments for TV Lobby elements */
#view-tv-lobby .panel h2 {
  font-size: clamp(1rem, 4vh, 3.5rem);
  margin-bottom: clamp(5px, 2vh, 30px);
}

#view-tv-lobby .panel p {
  font-size: clamp(0.75rem, 2vh, 1.8rem);
}

#view-tv-lobby .btn {
  font-size: clamp(0.8rem, 2.5vh, 2.5rem);
  padding: clamp(8px, 2vh, 25px) clamp(16px, 3vw, 40px);
}

#view-tv-lobby .lobby-players h3 {
  font-size: clamp(0.8rem, 3vh, 2.5rem);
}

#view-tv-lobby .player-lobby-badge {
  font-size: clamp(0.6rem, 2vh, 1.5rem);
  padding: clamp(4px, 1.5vh, 12px) clamp(8px, 2vw, 20px);
}

#view-tv-lobby .player-color-dot {
  width: clamp(8px, 2vh, 20px);
  height: clamp(8px, 2vh, 20px);
}

#view-tv-lobby .panel {
  padding: clamp(10px, 3.5vh, 40px);
}

#view-tv-lobby .lobby-main-row {
  gap: clamp(10px, 2.5vw, 40px);
}

