:root {
  color-scheme: dark;
  --bg-primary: #0a0e17;
  --bg-secondary: #131a29;
  --bg-glass: rgba(19, 26, 41, 0.9);
  --border-glass: rgba(148, 163, 184, 0.42);
  --border-glass-strong: #475569;
  --accent-blue: #0ea5e9;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-gold: #f59e0b;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --accent-gradient: linear-gradient(135deg, #0ea5e9, #6366f1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

select, option {
  background-color: #1e293b !important;
  color: #f8fafc !important;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(14, 165, 233, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(239, 68, 68, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.05) 0%, transparent 60%);
}

/* App Header */
.app-header {
  height: 60px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

/* Nav & Action Buttons */
.btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #38bdf8, #0369a1);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.55);
  transform: translateY(-2px);
}

.btn-accent {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #f87171, #b91c1c);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

/* STRICT SCREEN MANAGEMENT: ONLY ONE ACTIVE SCREEN AT A TIME */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
}

.screen {
  display: none !important;
}

/* First paint, before app.js routes: the screen the route will open (js/boot-screen.js). */
.screen.active,
html[data-boot-screen="host-home"] #screen-host-home,
html[data-boot-screen="player-browser"] #screen-player-browser {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  width: 100%;
}

/* Form Styles */
.form-group {
  margin-bottom: 14px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-text {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-text:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Avatar Selector */
.avatar-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 380px;
  margin: 8px auto 0 auto;
}

.avatar-option {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.avatar-option:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.16);
}

.avatar-option.selected {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

/* ========================================================= */
/* 1. HOST SCREEN 1: WELCOME & SETUP (TV / TABLET / DESKTOP) */
/* ========================================================= */

.host-home-container {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.host-home-card {
  max-width: 840px;
  width: 100%;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  margin: auto;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #38bdf8, #facc15, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 24px;
}

/* Game Selection Grid on Home Screen */
.game-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  text-align: left;
}

.game-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  position: relative;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.game-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.game-card.active {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
}

.game-card.coming-soon {
  opacity: 0.6;
  cursor: default;
}
.game-card.coming-soon:hover {
  transform: none;
  border-color: var(--border-glass);
}

.game-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  text-transform: uppercase;
}

.game-card-badge.playable {
  background: rgba(34, 197, 94, 0.25);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.game-card-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.game-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: #fff;
}

.game-card-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 12px;
}

.game-card-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: #facc15;
}

/* Pause Overlay Styles */
.pause-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 15, 26, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pause-card {
  background: var(--bg-glass);
  border: 2px solid var(--accent-gold);
  border-radius: 28px;
  padding: 40px 48px;
  text-align: center;
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.4);
  animation: banner-pulse 2s infinite alternate;
}

/* Remote / Gamepad Focus Styles for TV */
body.gamepad-mode :focus,
:focus-visible,
.remote-focused {
  outline: 3px solid #facc15 !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.95) !important;
}

/* Connection Status Indicator Pill */
.conn-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  cursor: pointer;
  user-select: none;
}

.conn-status-pill:hover {
  filter: brightness(1.2);
  transform: scale(1.04);
}

.conn-status-pill .conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.conn-status-pill.conn-standing {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.conn-status-pill.conn-standing .conn-dot {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.conn-status-pill.conn-dropped {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.6);
}

.conn-status-pill.conn-dropped .conn-dot {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulse-badge 0.8s infinite alternate;
}

.host-setup-box {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 24px;
  text-align: left;
}

/* ========================================================= */
/* 2. HOST SCREEN 2: LOBBY WITH QR CODE (TV DISPLAY)        */
/* ========================================================= */

.host-lobby-container {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.host-lobby-card {
  max-width: 760px;
  width: 100%;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: 28px;
  padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  text-align: center;
  margin: auto;
}

.host-lobby-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #38bdf8, #facc15);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.host-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

.qr-frame {
  background: #ffffff;
  padding: 16px;
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  display: inline-block;
  margin-bottom: 14px;
}

.qr-image {
  display: block;
  width: 220px;
  height: 220px;
  border-radius: 6px;
}

.host-join-link {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(0, 0, 0, 0.45);
  padding: 8px 20px;
  border-radius: 30px;
  border: 1px dashed rgba(245, 158, 11, 0.5);
  display: inline-block;
  user-select: all;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 480px) {
  .roster-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }
}

.blufftrivia-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 540px) {
  .blufftrivia-roster-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.roster-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.roster-avatar {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.roster-name {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
  max-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-align: center;
  margin: 3px 0;
  width: 100%;
}

.badge-tag {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 4px;
  text-transform: uppercase;
  margin-top: 4px;
}

.badge-host {
  background: rgba(245, 158, 11, 0.25);
  color: #facc15;
}

.badge-bot {
  background: rgba(14, 165, 233, 0.25);
  color: #38bdf8;
}

.badge-you {
  background: rgba(96, 165, 250, 0.25);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.4);
}

.host-status-notice {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #38bdf8;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 20px;
  display: inline-block;
}

/* ========================================================= */
/* 3. HOST SCREEN 3: GAME TABLETOP ARENA (TV DISPLAY ONLY)   */
/* (NO CARDS IN HAND, NO DRAW BUTTON!)                       */
/* ========================================================= */

.host-arena-container {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.host-table-top-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border-glass);
  padding: 12px 20px;
}

.host-direction-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: #38bdf8;
  transition: all 0.3s ease;
}

.host-direction-badge.clockwise {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.host-direction-badge.counter-clockwise {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.15);
  color: #facc15;
}

.host-direction-badge .dir-icon {
  font-size: 1.15rem;
  display: inline-block;
  animation: rotate-dir 3.5s linear infinite;
}

.host-direction-badge.counter-clockwise .dir-icon {
  animation: rotate-dir-reverse 3.5s linear infinite;
}

@keyframes rotate-dir {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes rotate-dir-reverse {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.dir-flow-arrow {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.25);
  font-weight: 900;
  transition: all 0.3s ease;
  user-select: none;
}

.dir-flow-arrow.active {
  color: var(--accent-gold);
  transform: scale(1.2);
}

.host-players-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.host-player-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: 40px;
  padding: 8px 18px 8px 10px;
  transition: all 0.25s ease;
}

.host-player-pill.is-turn {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
  transform: scale(1.08);
}

.host-arena-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px;
}

.host-turn-banner {
  font-size: 2rem;
  font-weight: 900;
  padding: 12px 36px;
  border-radius: 40px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid var(--accent-gold);
  color: #fff;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
  margin-bottom: 24px;
  animation: banner-pulse 1.8s infinite alternate;
}

@keyframes banner-pulse {
  0% { transform: scale(1); box-shadow: 0 0 15px rgba(245, 158, 11, 0.3); }
  100% { transform: scale(1.04); box-shadow: 0 0 35px rgba(245, 158, 11, 0.8); }
}

.host-stack-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  margin: 16px 0;
}

.host-color-banner {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 24px;
  border-radius: 30px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-top: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.color-banner-label {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.color-banner-content {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.color-card-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  transition: transform 0.25s ease;
}

.color-card-pill.color-red { color: #ef4444; }
.color-card-pill.color-blue { color: #0ea5e9; }
.color-card-pill.color-green { color: #22c55e; }
.color-card-pill.color-yellow { color: #eab308; }
.color-card-pill.color-wild { color: #a855f7; }

.color-banner-name {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.color-banner-name.color-red {
  color: #ef4444;
  text-shadow: 0 0 16px rgba(239, 68, 68, 0.6);
}
.color-banner-name.color-blue {
  color: #0ea5e9;
  text-shadow: 0 0 16px rgba(14, 165, 233, 0.6);
}
.color-banner-name.color-green {
  color: #22c55e;
  text-shadow: 0 0 16px rgba(34, 197, 94, 0.6);
}
.color-banner-name.color-yellow {
  color: #eab308;
  text-shadow: 0 0 16px rgba(234, 179, 8, 0.6);
}
.color-banner-name.color-wild {
  color: #a855f7;
  text-shadow: 0 0 16px rgba(168, 85, 247, 0.6);
}

/* Language Switcher */
.lang-picker {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 3px;
  gap: 4px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  color: #fff;
}

.lang-btn.active {
  background: var(--accent-gold);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.action-ticker {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-glass);
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 0.95rem;
  color: #f1f5f9;
  text-align: center;
  max-width: 90%;
  margin-top: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* Activity Log on Host Screen */
.host-action-log-box {
  max-width: 680px;
  width: 90%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 110px;
  overflow-y: auto;
}

.log-entry {
  font-size: 0.84rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.log-entry:last-child {
  color: #f8fafc;
  font-weight: 700;
}

/* ========================================================= */
/* 4. PLAYER SCREEN 1: LOBBY ON MOBILE (JOINED VIA QR/LINK)  */
/* ========================================================= */

.player-lobby-container {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.player-lobby-card {
  max-width: 480px;
  width: 100%;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  margin: auto;
}

/* ========================================================= */
/* 5. PLAYER SCREEN 2: PRIVATE HAND & CONTROLS (MOBILE GAME) */
/* ========================================================= */

.player-game-container {
  overflow: hidden;
}

.player-top-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border-glass);
}

.player-table-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.player-hand-container {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  padding: 14px 10px 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.player-action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.btn-uno {
  background: linear-gradient(135deg, #ef4444, #991b1b);
  color: #fff;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  padding: 10px 24px;
  border-radius: 30px;
  border: 2px solid #fff;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.75);
  animation: uno-glow 1.4s infinite alternate;
}

@keyframes uno-glow {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
  100% { transform: scale(1.08); box-shadow: 0 0 25px rgba(239, 68, 68, 0.95); }
}

.cards-carousel {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding: 24px 16px 6px 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.cards-carousel::-webkit-scrollbar {
  height: 6px;
}

.cards-carousel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  max-width: 480px;
  width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  text-align: center;
  animation: modal-pop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#modal-winner .modal-card {
  max-width: 520px;
}

#modal-settings .modal-card {
  width: min(95vw, 1440px);
  max-width: 95vw;
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  text-align: left;
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  #modal-settings .modal-card {
    width: 100%;
    max-width: 100%;
    padding: 18px 16px;
  }
}

.settings-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 16px;
  padding-bottom: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
  flex-shrink: 0;
}

.settings-tabs::-webkit-scrollbar {
  height: 5px;
}

.settings-tabs::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 4px;
}

.settings-tab-btn {
  flex: 1 0 auto;
  min-width: max-content;
  padding: 9px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.settings-tab-btn.active {
  background: var(--accent-gradient);
  border-color: var(--accent-gold);
  color: #fff;
}

.settings-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.settings-tab-content.active {
  display: block;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 14px;
  align-items: stretch;
}

.settings-grid .settings-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px 16px;
  gap: 14px;
  margin: 0 !important;
  height: 100%;
  box-sizing: border-box;
}

.settings-grid .settings-item.settings-item-full {
  grid-column: 1 / -1;
}

/* Active House Rules Banners */
.lobby-rules-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lobby-rule-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #facc15;
}

.btn-lobby-remove {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  width: 22px !important;
  height: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(239, 68, 68, 0.25) !important;
  border: 1px solid rgba(239, 68, 68, 0.7) !important;
  color: #fca5a5 !important;
  border-radius: 50% !important;
  padding: 0 !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  margin: 0 !important;
  z-index: 10 !important;
  line-height: 1 !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

.btn-lobby-remove:hover {
  background: #ef4444 !important;
  color: #fff !important;
  border-color: #ef4444 !important;
  transform: scale(1.1) !important;
}

.roster-player-badge {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-sizing: border-box;
}

.btn-promote-controller {
  background: rgba(234, 179, 8, 0.25);
  border: 1px solid #eab308;
  color: #fde047;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: banner-pulse 1.2s infinite alternate;
}

@keyframes modal-pop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Color Picker Grid */
.color-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 20px 0;
}

.color-choice-btn {
  height: 70px;
  border-radius: var(--radius-md);
  border: 3px solid #fff;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.color-choice-btn:hover {
  transform: scale(1.06);
  filter: brightness(1.15);
}

.color-choice-btn.pick-red { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.color-choice-btn.pick-blue { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.color-choice-btn.pick-green { background: linear-gradient(135deg, #22c55e, #15803d); }
.color-choice-btn.pick-yellow { background: linear-gradient(135deg, #fde047, #eab308); color: #0f172a; font-weight: 800; }

/* Settings screen & items */
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  gap: 12px;
}

.settings-item > :first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-label {
  font-size: 0.95rem;
  font-weight: 600;
}

.settings-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1.4rem;
  font-weight: 800;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  cursor: pointer;
  flex-shrink: 0;
}

.switch:focus,
.switch:focus-visible,
.switch.remote-focused,
.switch input:focus + .slider {
  outline: 2px solid var(--accent-gold);
  border-radius: 26px;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-blue);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .host-home-card, .host-lobby-card, .player-lobby-card {
    padding: 20px 16px;
  }
  .hero-title {
    font-size: 1.8rem;
  }
  .host-stack-wrap {
    gap: 16px;
  }
  .hand-card {
    margin-left: -38px;
  }
}

/* End-of-Round Fun Awards & Accolades */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
  text-align: left;
}

.award-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.award-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
}

.award-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.award-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.award-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}

.award-player {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.award-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Jump-In Badge on Hand Cards */
.jumpin-badge {
  position: absolute;
  top: -8px;
  right: -6px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.6);
  letter-spacing: 0.5px;
  animation: jumpinPulse 1.2s infinite alternate ease-in-out;
  pointer-events: none;
  z-index: 5;
}

@keyframes jumpinPulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.12); filter: brightness(1.25); }
}

/* Swap Target Picker List */
.swap-target-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.swap-target-item:hover, .swap-target-item:focus {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  outline: none;
}

/* Open Lobbies Browser in Player Mode */
.lobby-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.lobby-card-item:hover, .lobby-card-item:focus-within {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.lobby-card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.lobby-card-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lobby-card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}



/* ======================================================= */
/* BLUFFTRIVIA & BLUFFTRIVIA STYLING                           */
/* ======================================================= */

.host-blufftrivia-container, .player-blufftrivia-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  height: calc(100dvh - 60px);
  overflow-y: auto;
}

.blufftrivia-host-stage-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.blufftrivia-stage-card {
  width: 100%;
  max-width: 820px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeIn 0.3s ease;
}

.blufftrivia-category-badge {
  display: inline-block;
  padding: 6px 18px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid #a855f7;
  color: #c084fc;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.blufftrivia-prompt-display {
  margin: 10px 0 20px;
}

.blufftrivia-prompt-text {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.35;
  color: #fff;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.blufftrivia-announcer-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-align: left;
  margin: 14px auto 0;
  max-width: 650px;
}

.announcer-avatar {
  font-size: 1.8rem;
  line-height: 1;
}

.announcer-bubble {
  flex: 1;
}

.announcer-text {
  font-size: 0.98rem;
  color: #fef08a;
  font-style: italic;
  line-height: 1.45;
}

.blufftrivia-player-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 14px 0;
}

.blufftrivia-player-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.blufftrivia-pill-ready {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid #22c55e;
  color: #4ade80;
}

.blufftrivia-pill-waiting {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
}

.blufftrivia-choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.blufftrivia-choice-card {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  transition: all 0.2s ease;
}

.blufftrivia-reveal-spotlight {
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  margin: 16px 0;
  transition: all 0.3s ease;
}

.blufftrivia-reveal-spotlight.reveal-truth {
  border-color: #22c55e;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.25) 0%, rgba(0, 0, 0, 0.6) 80%);
}

.blufftrivia-reveal-spotlight.reveal-bluff {
  border-color: #f59e0b;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, rgba(0, 0, 0, 0.6) 80%);
}

.reveal-choice-heading {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 8px;
}

.reveal-author-banner {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.reveal-victims-box {
  font-size: 0.95rem;
  color: #e2e8f0;
}

.blufftrivia-scoreboard-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
}

.blufftrivia-score-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 1.05rem;
}

.blufftrivia-score-rank {
  font-weight: 900;
  color: var(--accent-gold);
  width: 32px;
}

.blufftrivia-score-name {
  flex: 1;
  text-align: left;
  font-weight: 700;
}

.blufftrivia-score-pts {
  font-weight: 900;
  color: #4ade80;
  font-size: 1.15rem;
}

/* Question Editor Cards & Hidden Answers */
.editor-q-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: all 0.2s ease;
}

.editor-q-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.editor-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.editor-q-prompt {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.4;
}

.editor-q-answer-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.editor-q-answer-hidden {
  color: var(--text-muted);
  font-family: monospace;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-q-answer-revealed {
  color: #4ade80;
  font-weight: 700;
}

/* Midgame Host Buttons hidden on Host TV display (clean spectator presentation screen) */
#btn-blufftrivia-host-goto-lies,
#btn-blufftrivia-host-goto-voting,
#btn-blufftrivia-host-goto-reveal,
#btn-blufftrivia-host-next-reveal,
#btn-blufftrivia-host-next-round {
  display: none !important;
}

/* ========================================================= */
/* Statistics, Hall of Fame & Career Profile Styles          */
/* ========================================================= */

.stats-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.stats-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.stats-tab-btn.active {
  background: var(--accent-gold);
  color: #0f172a;
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.4);
}

.stats-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stats-metric-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
}

.stats-metric-card.highlight {
  background: rgba(250, 204, 21, 0.08);
  border-color: rgba(250, 204, 21, 0.25);
}

.stats-metric-card.colorcards-theme {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.25);
}

.stats-metric-card.bluff-theme {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.25);
}

.stats-metric-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
}

.stats-metric-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.stats-section-title {
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-gold);
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stats-trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stats-trophy-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.stats-trophy-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.stats-trophy-info {
  flex: 1;
  min-width: 0;
}

.stats-trophy-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-trophy-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.stats-trophy-count {
  font-size: 0.8rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--accent-gold);
  color: #0f172a;
  flex-shrink: 0;
}

.leaderboard-table, .admin-player-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.leaderboard-table th, .admin-player-table th {
  text-align: left;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-glass);
}

.leaderboard-table td, .admin-player-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.leaderboard-table tr:hover, .admin-player-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.history-match-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

/* Custom Avatar Image & Settings Picker */
.avatar-custom-img {
  width: 1em;
  height: 1em;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.avatar-option.custom-avatar-option {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(250, 204, 21, 0.5);
}

.avatar-option.custom-avatar-option.selected {
  border: 2px solid var(--accent-gold);
}

/* ========================================================= */
/* Cinematic Host Display & Ambient Glow (ColorCards & BluffTrivia) */
/* ========================================================= */

.host-arena-container {
  transition: background 0.8s ease, box-shadow 0.8s ease;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Dynamic Ambient Tabletop Lighting based on Active Card Color */
.host-arena-container[data-active-color="red"] {
  background: radial-gradient(circle at 50% 45%, rgba(239, 68, 68, 0.22) 0%, rgba(15, 23, 42, 0.98) 72%), var(--bg-primary);
  box-shadow: inset 0 0 120px rgba(239, 68, 68, 0.3);
}

.host-arena-container[data-active-color="blue"] {
  background: radial-gradient(circle at 50% 45%, rgba(14, 165, 233, 0.22) 0%, rgba(15, 23, 42, 0.98) 72%), var(--bg-primary);
  box-shadow: inset 0 0 120px rgba(14, 165, 233, 0.3);
}

.host-arena-container[data-active-color="green"] {
  background: radial-gradient(circle at 50% 45%, rgba(34, 197, 94, 0.22) 0%, rgba(15, 23, 42, 0.98) 72%), var(--bg-primary);
  box-shadow: inset 0 0 120px rgba(34, 197, 94, 0.3);
}

.host-arena-container[data-active-color="yellow"] {
  background: radial-gradient(circle at 50% 45%, rgba(234, 179, 8, 0.22) 0%, rgba(15, 23, 42, 0.98) 72%), var(--bg-primary);
  box-shadow: inset 0 0 120px rgba(234, 179, 8, 0.3);
}

.host-arena-container[data-active-color="wild"] {
  background: radial-gradient(circle at 50% 45%, rgba(168, 85, 247, 0.25) 0%, rgba(15, 23, 42, 0.98) 72%), var(--bg-primary);
  box-shadow: inset 0 0 120px rgba(168, 85, 247, 0.35);
}

/* Turn Spotlight Beam over Active Player Pill */
.host-player-pill {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
}

.host-player-pill.is-turn {
  border-color: #facc15 !important;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(234, 179, 8, 0.12) 100%) !important;
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.75), inset 0 0 14px rgba(245, 158, 11, 0.25) !important;
  transform: scale(1.08) translateY(-3px);
  z-index: 5;
}

/* Fill-in-the-blank Glowing Placeholder for BluffTrivia Host */
.bluff-blank-pill {
  display: inline-block;
  padding: 0 12px;
  margin: 0 4px;
  color: #facc15;
  border-bottom: 3px solid #facc15;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
  animation: blank-pulse 2s ease-in-out infinite alternate;
}

@keyframes blank-pulse {
  0% { border-bottom-color: #facc15; text-shadow: 0 0 8px rgba(250, 204, 21, 0.4); }
  100% { border-bottom-color: #f59e0b; text-shadow: 0 0 22px rgba(245, 158, 11, 0.9); }
}

/* Widescreen Scaling & Enhanced TV Layout */
@media (min-width: 900px) {
  .host-arena-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 36px;
  }
  .host-table-top-bar {
    padding: 16px 28px;
    border-radius: 20px;
    margin-bottom: 20px;
  }
  .host-player-pill {
    padding: 10px 20px;
    font-size: 1.05rem;
    gap: 12px;
  }
  .host-turn-banner {
    font-size: 2.4rem;
    padding: 16px 50px;
  }
  .host-stack-wrap {
    gap: 72px;
    margin: 28px 0;
  }
  .host-color-banner {
    padding: 12px 32px;
  }
  .color-banner-name {
    font-size: 1.8rem;
  }
  .action-ticker {
    font-size: 1.15rem;
    padding: 12px 28px;
  }

  /* BluffTrivia host widescreen enhancements */
  .blufftrivia-host-stage-wrap {
    max-width: 1260px;
    margin: 0 auto;
    padding: 24px 32px;
  }
  .blufftrivia-stage-card {
    max-width: 1140px;
    padding: 40px 48px;
    border-radius: 24px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45), inset 0 0 1px rgba(255, 255, 255, 0.2);
  }
  .blufftrivia-prompt-text {
    font-size: 2.3rem;
    line-height: 1.45;
  }
  .reveal-choice-heading {
    font-size: 2.7rem;
  }
  .blufftrivia-choices-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* ========================================================= */
/* Cinematic Award Spotlight Ceremony (Host Screen)          */
/* ========================================================= */

.award-spotlight-overlay {
  background: radial-gradient(circle at 50% 28%, rgba(26, 20, 64, 0.98) 0%, rgba(3, 7, 18, 0.99) 85%) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2500;
  overflow: hidden;
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.award-spotlight-overlay.active {
  display: flex !important;
}

.award-spotlight-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.spotlight-beam-left {
  position: absolute;
  top: -120px;
  left: 12%;
  width: 340px;
  height: 980px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.35) 0%, rgba(250, 204, 21, 0.06) 50%, transparent 80%);
  transform-origin: top center;
  transform: rotate(22deg);
  filter: blur(24px);
  pointer-events: none;
  animation: beam-sway-left 6s ease-in-out infinite alternate;
}

.spotlight-beam-right {
  position: absolute;
  top: -120px;
  right: 12%;
  width: 340px;
  height: 980px;
  background: linear-gradient(225deg, rgba(168, 85, 247, 0.4) 0%, rgba(168, 85, 247, 0.06) 50%, transparent 80%);
  transform-origin: top center;
  transform: rotate(-22deg);
  filter: blur(24px);
  pointer-events: none;
  animation: beam-sway-right 6s ease-in-out infinite alternate;
}

.spotlight-stage-glow {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 580px;
  height: 160px;
  background: radial-gradient(ellipse at center, rgba(250, 204, 21, 0.5) 0%, rgba(245, 158, 11, 0.18) 50%, transparent 75%);
  border-radius: 50%;
  filter: blur(20px);
  pointer-events: none;
  animation: floor-glow-pulse 3.5s ease-in-out infinite alternate;
}

.spotlight-stars-layer {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(2px 2px at 20px 30px, #ffffff, rgba(0,0,0,0)),
                    radial-gradient(2px 2px at 140px 70px, #facc15, rgba(0,0,0,0)),
                    radial-gradient(1.5px 1.5px at 260px 180px, #c084fc, rgba(0,0,0,0)),
                    radial-gradient(2px 2px at 380px 240px, #ffffff, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 420px 320px;
  opacity: 0.25;
  animation: stars-drift 30s linear infinite;
  pointer-events: none;
}

@keyframes beam-sway-left {
  0% { transform: rotate(18deg) scaleX(1); opacity: 0.7; }
  100% { transform: rotate(26deg) scaleX(1.25); opacity: 0.95; }
}

@keyframes beam-sway-right {
  0% { transform: rotate(-18deg) scaleX(1); opacity: 0.7; }
  100% { transform: rotate(-26deg) scaleX(1.25); opacity: 0.95; }
}

@keyframes floor-glow-pulse {
  0% { transform: translateX(-50%) scale(0.9); opacity: 0.55; }
  100% { transform: translateX(-50%) scale(1.15); opacity: 0.95; }
}

@keyframes stars-drift {
  from { transform: translateY(0); }
  to { transform: translateY(-320px); }
}

.award-spotlight-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: min(94vw, 1360px);
  width: 100%;
  padding: 20px 24px;
  text-align: center;
}

.spotlight-pinned-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 1240px;
  margin-bottom: 14px;
  min-height: 0;
  transition: all 0.4s ease;
}

.spotlight-pinned-grid:empty {
  display: none;
}

.spotlight-pinned-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(250, 204, 21, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 0 12px rgba(250, 204, 21, 0.12);
  text-align: left;
  animation: pinned-card-land 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes pinned-card-land {
  0% { transform: scale(1.35) translateY(40px); opacity: 0.2; }
  70% { transform: scale(0.96) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.spotlight-pinned-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #facc15;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.7rem;
  overflow: hidden;
}

.spotlight-pinned-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spotlight-pinned-icon {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #facc15, #d97706);
  border: 1.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
}

.spotlight-pinned-info {
  min-width: 0;
  flex: 1;
}

.spotlight-pinned-title {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #facc15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotlight-pinned-winner {
  font-size: 1.02rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotlight-pinned-desc {
  font-size: 0.72rem;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotlight-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.spotlight-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #facc15;
  color: #facc15;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.35);
}

.spotlight-step-badge {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e2e8f0;
}

.award-pedestal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 10px;
  width: 100%;
}

.award-pedestal.animating {
  animation: pedestal-pop 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.award-pedestal.pinning-to-grid {
  animation: pedestal-pin-to-grid 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pedestal-pop {
  0% { transform: scale(0.75) translateY(30px); opacity: 0; }
  60% { transform: scale(1.06) translateY(-4px); opacity: 1; }
  100% { transform: scale(1.02) translateY(0); opacity: 1; }
}

@keyframes pedestal-pin-to-grid {
  0% { transform: scale(1.02) translateY(0); opacity: 1; }
  100% { transform: scale(0.38) translateY(-210px); opacity: 0.15; }
}

.spotlight-avatar-halo {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 10px 0 20px;
}

.spotlight-avatar-halo::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #facc15, #f59e0b, #ec4899, #8b5cf6, #3b82f6, #10b981, #facc15);
  animation: spin-halo 7s linear infinite;
  filter: blur(5px);
  opacity: 0.88;
}

@keyframes spin-halo {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spotlight-avatar-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #0f172a;
  border: 4px solid #facc15;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(250, 204, 21, 0.7);
}

.spotlight-avatar-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spotlight-avatar-container .avatar-emoji {
  font-size: 5rem;
  line-height: 1;
}

.spotlight-trophy-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #facc15 0%, #d97706 100%);
  border: 3.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
  animation: trophy-bounce 1.1s ease-in-out infinite alternate;
}

@keyframes trophy-bounce {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-7px) scale(1.1); }
}

.spotlight-award-title {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #facc15;
  text-shadow: 0 0 24px rgba(250, 204, 21, 0.75);
  margin-bottom: 6px;
}

.spotlight-winner-name {
  font-size: 3rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
  margin-bottom: 10px;
}

.spotlight-award-desc {
  font-size: 1.3rem;
  font-weight: 600;
  color: #cbd5e1;
  max-width: 640px;
  line-height: 1.45;
  margin-bottom: 22px;
}

.spotlight-announcer-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(250, 204, 21, 0.45);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(250, 204, 21, 0.12);
  border-radius: 20px;
  padding: 16px 28px;
  max-width: 780px;
  width: 100%;
  margin: 0 auto 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.spotlight-announcer-mic {
  font-size: 2.3rem;
  flex-shrink: 0;
}

.spotlight-announcer-quote {
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 700;
  color: #fef08a;
  line-height: 1.45;
  text-align: left;
}

.spotlight-progress-track {
  width: 100%;
  max-width: 500px;
  height: 6px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  margin: 10px auto 22px;
  overflow: hidden;
}

.spotlight-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #facc15, #f59e0b, #ec4899);
  border-radius: 9999px;
}

@keyframes spotlight-timer-progress {
  from { width: 0%; }
  to { width: 100%; }
}

.spotlight-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.spotlight-controls .btn {
  border-radius: 30px;
  padding: 10px 24px;
  font-size: 1rem;
}

/* Rules & Game Hub Modal Tabs */
.rules-game-tab-btn {
  transition: all 0.2s ease;
  user-select: none;
}
.rules-game-tab-btn:hover {
  filter: brightness(1.15);
}

.rules-view-btn {
  transition: all 0.2s ease;
  user-select: none;
}
.rules-view-btn:hover {
  filter: brightness(1.15);
}
.rules-view-btn.active {
  background: linear-gradient(135deg, #06b6d4, #0284c7) !important;
  border-color: #22d3ee !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.45) !important;
}






/* ===== BluffTrivia roster / scoreboard / podium ===== */
.blufftrivia-player-badge,
.blufftrivia-roster-player {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  box-sizing: border-box;
  min-width: 0;
}
.blufftrivia-player-badge.me {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.1);
}
.blufftrivia-roster-player { flex-direction: column; text-align: center; gap: 4px; }
.blufftrivia-roster-player.correct { border-color: #22c55e; background: rgba(34, 197, 94, 0.12); }
.blufftrivia-roster-player .roster-stat { font-size: 0.9rem; }
.player-avatar-mini { font-size: 1.8rem; line-height: 1; flex-shrink: 0; }
.player-name-text {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blufftrivia-scoreboard-grid { display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin: 0 auto; }
.blufftrivia-score-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  font-size: 1.1rem;
}
.blufftrivia-score-row.leader { border-color: #facc15; background: rgba(250, 204, 21, 0.12); }
.blufftrivia-score-row.me { border-color: #38bdf8; background: rgba(56, 189, 248, 0.12); }
.blufftrivia-score-row .score-rank { font-weight: 900; color: var(--accent-gold); min-width: 36px; }
.blufftrivia-score-row .score-avatar { font-size: 1.7rem; line-height: 1; }
.blufftrivia-score-row .score-name { flex: 1; min-width: 0; text-align: left; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blufftrivia-score-row .score-gain { color: #4ade80; font-weight: 800; }
.blufftrivia-score-row .score-total { font-weight: 900; color: #fff; }

.blufftrivia-podium-container { display: flex; justify-content: center; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 130px;
  padding: 14px 14px 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px 16px 0 0;
}
.podium-step.podium-1 { border-color: #facc15; background: rgba(250, 204, 21, 0.12); padding-top: 26px; }
.podium-medal { font-size: 2rem; }
.podium-avatar { font-size: 2.6rem; line-height: 1; }
.podium-name { font-weight: 800; color: #fff; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { color: #facc15; font-weight: 800; }
.podium-stand {
  width: calc(100% + 28px);
  margin: 8px -14px 0;
  padding: 8px 0;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
  text-align: center;
}
.podium-1 .podium-stand { padding: 20px 0; }
.podium-2 .podium-stand { padding: 12px 0; }

/* ==========================================================================
   PHASE 4c: SAMSUNG PHONE & HIGH-CONTRAST BORDER REINFORCEMENT
   Ensures borders never blend into the dark background on AMOLED / Force-Dark
   ========================================================================== */
html, body {
  color-scheme: dark;
  forced-color-adjust: none;
}

.card-panel,
.player-lobby-card,
.modal-card,
.lobby-card-item,
.game-card,
.blufftrivia-stage-card,
.blufftrivia-choice-card,
.blufftrivia-status-pill,
.blufftrivia-player-badge,
.blufftrivia-roster-player,
.blufftrivia-score-row,
.roster-item,
.roster-player-badge,
.host-player-pill,
.award-card,
.stats-metric-card,
.stats-trophy-card,
.btn-secondary,
.btn-icon,
.input-text {
  border-color: var(--border-glass) !important;
}

.card-panel,
.player-lobby-card,
.modal-card,
.blufftrivia-stage-card {
  border-width: 1.5px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(148, 163, 184, 0.22);
}

.btn-secondary,
.input-text,
.lobby-card-item,
.roster-item,
.roster-player-badge,
.blufftrivia-player-badge,
.blufftrivia-status-pill,
.blufftrivia-score-row {
  border-width: 1.5px !important;
}

.game-card.active {
  border-color: var(--accent-gold) !important;
  border-width: 2px !important;
}

/* ==========================================================================
   PHASE 4a: 10-FOOT TV / HOST READABILITY & PROMINENT STAGE TIMERS
   ========================================================================== */
#screen-host-home,
#screen-host-lobby,
#screen-host-game,
#screen-host-blufftrivia {
  --text-muted: #cbd5e1;
}

#screen-host-blufftrivia {
  padding: 1.5vh 2.5vw;
}

/* Prominent TV Countdown Timers (64px - 90px equivalent scaling) */
.host-stage-timer,
#blufftrivia-host-cat-timer,
#blufftrivia-host-lies-timer,
#blufftrivia-host-voting-timer {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: clamp(2.1rem, 3.4vw, 3.8rem) !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  padding: 10px 26px !important;
  border-radius: 9999px !important;
  background: rgba(15, 23, 42, 0.92) !important;
  border: 3px solid #facc15 !important;
  color: #fef08a !important;
  box-shadow: 0 6px 24px rgba(250, 204, 21, 0.32), inset 0 0 14px rgba(250, 204, 21, 0.18) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.host-stage-timer.timer-urgent,
#blufftrivia-host-cat-timer.timer-urgent,
#blufftrivia-host-lies-timer.timer-urgent,
#blufftrivia-host-voting-timer.timer-urgent {
  border-color: #ef4444 !important;
  background: rgba(127, 29, 29, 0.85) !important;
  color: #fecaca !important;
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.65), inset 0 0 16px rgba(239, 68, 68, 0.35) !important;
  animation: hostTimerUrgentPulse 0.65s infinite alternate ease-in-out;
}

@keyframes hostTimerUrgentPulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* Host Screen 10-Foot Text Scaling */
#screen-host-blufftrivia .blufftrivia-category-badge {
  font-size: clamp(1.1rem, 1.5vw, 1.5rem) !important;
  padding: 8px 18px !important;
  font-weight: 800 !important;
}

#screen-host-blufftrivia .blufftrivia-prompt-text {
  font-size: clamp(1.75rem, 2.6vw, 2.85rem) !important;
  line-height: 1.35 !important;
}

#screen-host-blufftrivia .blufftrivia-choice-card {
  font-size: clamp(1.35rem, 1.85vw, 2rem) !important;
  padding: 18px 24px !important;
}

#screen-host-blufftrivia .announcer-text {
  font-size: clamp(1.2rem, 1.6vw, 1.65rem) !important;
  line-height: 1.45 !important;
  color: #f8fafc !important;
}

#screen-host-blufftrivia .blufftrivia-status-pill {
  font-size: clamp(1.1rem, 1.4vw, 1.4rem) !important;
  padding: 12px 18px !important;
}

#screen-host-blufftrivia .blufftrivia-score-row {
  font-size: clamp(1.3rem, 1.8vw, 1.85rem) !important;
  padding: 16px 24px !important;
}

#screen-host-game #host-turn-banner {
  font-size: clamp(1.45rem, 2.1vw, 2.25rem) !important;
}

#screen-host-game #host-ticker {
  font-size: clamp(1.15rem, 1.55vw, 1.6rem) !important;
}

/* Optional "Large TV Text" Host Escape Hatch Setting */
body.tv-large-text #screen-host-blufftrivia .blufftrivia-prompt-text {
  font-size: clamp(2.1rem, 3.1vw, 3.3rem) !important;
}
body.tv-large-text #screen-host-blufftrivia .blufftrivia-choice-card,
body.tv-large-text #screen-host-blufftrivia .blufftrivia-score-row {
  font-size: clamp(1.55rem, 2.2vw, 2.35rem) !important;
}
body.tv-large-text .host-stage-timer,
body.tv-large-text #blufftrivia-host-cat-timer,
body.tv-large-text #blufftrivia-host-lies-timer,
body.tv-large-text #blufftrivia-host-voting-timer {
  font-size: clamp(2.6rem, 4.2vw, 4.6rem) !important;
}

/* ==========================================================================
   PHASE 5: BATCHED UNPICKED LIES, LIVE REVEAL SCOREBOARD & REACTION EMOTES
   ========================================================================== */
#blufftrivia-host-reveal-card.unpicked-batch-mode {
  padding: 14px 18px !important;
  margin-bottom: 10px !important;
}

#blufftrivia-host-reveal-card.unpicked-batch-mode #blufftrivia-host-reveal-text {
  font-size: 1rem !important;
  margin-bottom: 6px !important;
}

.unpicked-lies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin: 4px auto;
  max-width: 920px;
  max-height: 155px;
  overflow-y: auto;
  width: 100%;
}

.unpicked-lie-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.38);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  text-align: left;
}

.unpicked-lie-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  flex: 1;
}

.unpicked-lie-author {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Live Round Standings Bar & Animated Points Transfer during Reveal */
.reveal-live-scores-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  max-width: 940px;
  margin: 12px auto 4px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.68);
  border: 1.5px solid rgba(148, 163, 184, 0.28);
  position: relative;
}

.reveal-score-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.88);
  border: 1.5px solid rgba(148, 163, 184, 0.35);
  color: #f8fafc;
  font-weight: 800;
  font-size: 0.96rem;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}

.reveal-score-pill .pill-rank {
  font-size: 0.78rem;
  font-weight: 900;
  color: #facc15;
  background: rgba(250, 204, 21, 0.16);
  padding: 2px 7px;
  border-radius: 999px;
}

.reveal-score-pill .pill-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reveal-score-pill .pill-pts {
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
  font-weight: 900;
}

.reveal-score-pill.scoring-now {
  border-color: #4ade80 !important;
  background: rgba(20, 83, 45, 0.72) !important;
  box-shadow: 0 0 22px rgba(74, 222, 128, 0.5) !important;
  transform: translateY(-4px) scale(1.07);
}

.reveal-score-pill.scoring-now .pill-pts {
  color: #4ade80;
}

.flying-pts-badge {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.55);
  white-space: nowrap;
  pointer-events: none;
  animation: flyPointsDropIn 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  z-index: 20;
}

@keyframes flyPointsDropIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -32px) scale(0.6);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -8px) scale(1.15);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, 0px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.85);
  }
}

.host-reactions-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9500;
  overflow: hidden;
}

.floating-reaction-badge {
  position: absolute;
  bottom: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(250, 204, 21, 0.55);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  animation: floatReactionUp 3.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.floating-reaction-emoji {
  font-size: 1.9rem;
  line-height: 1;
}

@keyframes floatReactionUp {
  0% { transform: translateY(30px) scale(0.7); opacity: 0; }
  15% { transform: translateY(0) scale(1.08); opacity: 1; }
  80% { transform: translateY(-220px) scale(1); opacity: 0.95; }
  100% { transform: translateY(-310px) scale(0.88); opacity: 0; }
}

.player-reactions-bar {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid var(--border-glass);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
}

.reaction-emote-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  touch-action: manipulation;
}

.reaction-emote-btn:hover,
.reaction-emote-btn:active {
  transform: scale(1.22);
  background: rgba(250, 204, 21, 0.22);
  border-color: var(--accent-gold);
}

/* ========================================================= */
/* UNIFIED FULLSCREEN HOST GAME VIEW & VIDEO GAME HUD        */
/* ========================================================= */

body.host-game-active header.app-header {
  display: none !important;
}

body.host-game-active .main-content {
  padding: 0 !important;
  margin: 0 !important;
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.screen.host-game-screen:not(.active) {
  display: none !important;
}

.screen.active.host-game-screen {
  width: 100vw !important;
  width: 100dvw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
}

/* Unified Host Top HUD */
.host-game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  z-index: 100;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-game-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-game-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.hud-game-emoji-icon {
  font-size: 1.85rem;
  line-height: 1;
}

.hud-game-title {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  text-transform: uppercase;
  font-family: system-ui, -apple-system, sans-serif;
}

.hud-badge {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hud-badge-room {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #facc15;
}

.hud-badge-round {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-hud-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  padding: 0;
  user-select: none;
  touch-action: manipulation;
}

.btn-hud-icon:hover {
  transform: scale(1.1);
}

.btn-hud-icon:active {
  transform: scale(0.95);
}

/* Host top-bar icons: plain white shapes (SVG, currentColor). */
.hud-btn-sym {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 55%;
  height: 55%;
  line-height: 0;
}

.hud-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hud-btn-sym .hud-strike {
  position: absolute;
  inset: 0;
  display: none;
}

.btn-hud-icon.is-off .hud-strike { display: block; }
.btn-hud-icon.is-off { opacity: 0.6; }

/* Pause shows the pause bars; while paused it shows the play triangle. */
.btn-hud-pause .hud-svg[data-icon="play"] { display: none; }
.btn-hud-pause.is-paused .hud-svg[data-icon="pause"] { display: none; }
.btn-hud-pause.is-paused .hud-svg[data-icon="play"] { display: block; }

.btn-hud-pause.is-paused {
  background: rgba(255, 255, 255, 0.28);
  border-color: #fff;
  animation: hud-pause-pulse 1.2s infinite alternate;
}

@keyframes hud-pause-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

/* Red Circular Exit Button */
.btn-hud-exit {
  background: #ef4444;
  border-color: #f87171;
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
}

.btn-hud-exit:hover {
  background: #dc2626;
  border-color: #fca5a5;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.85);
}

/* Top Player Roster Bar (Positioned consistently across all games directly under HUD) */
.host-table-top-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.host-table-top-bar::-webkit-scrollbar {
  display: none;
}

.blufftrivia-players-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.blufftrivia-roster-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  color: #fff;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}

.blufftrivia-roster-pill .roster-avatar {
  font-size: 1.4rem;
  line-height: 1;
}

.blufftrivia-roster-pill .roster-name {
  font-weight: 800;
  font-size: 0.92rem;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blufftrivia-roster-pill .roster-score {
  font-weight: 900;
  font-size: 0.85rem;
  color: #facc15;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 8px;
  border-radius: 8px;
}

.blufftrivia-roster-pill.detached-to-card {
  opacity: 0.25;
  filter: grayscale(0.85);
  transform: translateY(3px) scale(0.95);
  border-style: dashed;
}

.blufftrivia-roster-pill.author-pulse-gain {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.25) !important;
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.9) !important;
  transform: scale(1.15) translateY(-3px) !important;
  animation: authorGlowPulse 0.8s ease-out;
}

@keyframes authorGlowPulse {
  0% { transform: scale(1); box-shadow: 0 0 8px #22c55e; }
  50% { transform: scale(1.22); box-shadow: 0 0 32px #4ade80; }
  100% { transform: scale(1.15); box-shadow: 0 0 20px #22c55e; }
}

/* Action Stages Full-Height Fit */
.host-arena-center,
.blufftrivia-host-stage-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 12px 24px;
  box-sizing: border-box;
}

/* BluffTrivia Physical Detachment & Flying Voter Token */
.flying-voter-token {
  position: fixed;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(30, 41, 59, 0.95);
  border: 2px solid #facc15;
  border-radius: 9999px;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 20px rgba(250, 204, 21, 0.5);
  pointer-events: none;
  transition: all 0.75s cubic-bezier(0.18, 0.89, 0.32, 1.15);
}

/* Fooled Voter Damage Shake Animation (Game Damage Taken Style) */
.shake-damage {
  animation: damageShake 0.65s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
}

@keyframes damageShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  10%, 30%, 50%, 70%, 90% { transform: translate3d(-10px, 0, 0) rotate(-4deg); filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.95)); }
  20%, 40%, 60%, 80% { transform: translate3d(10px, 0, 0) rotate(4deg); filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.95)); }
}

.truth-triumph {
  animation: truthGlow 0.9s cubic-bezier(0.18, 0.89, 0.32, 1.15) both !important;
  border-color: #4ade80 !important;
  background: rgba(34, 197, 94, 0.28) !important;
  color: #86efac !important;
}

@keyframes truthGlow {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 24px rgba(74, 222, 128, 0.9)); }
  100% { transform: scale(1.05); filter: drop-shadow(0 0 14px rgba(74, 222, 128, 0.7)); }
}

/* Green Floating Points Flying from Answer Card to Bluffer */
.flying-points-particle {
  position: fixed;
  z-index: 1050;
  font-size: 1.4rem;
  font-weight: 900;
  color: #4ade80;
  text-shadow: 0 0 16px rgba(34, 197, 94, 0.9), 0 2px 4px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  transition: all 0.85s cubic-bezier(0.15, 0.85, 0.35, 1.1);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Scoreboard Dramatic 2-Step Ranking Animation */
.blufftrivia-scoreboard-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

.blufftrivia-scoreboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  transition: transform 0.85s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
  will-change: transform;
}

.blufftrivia-scoreboard-item.rank-overtake-glow {
  border-color: #facc15 !important;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.22) 0%, rgba(245, 158, 11, 0.08) 100%) !important;
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.65) !important;
  animation: overtakePulse 0.9s ease-out;
}

@keyframes overtakePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.scoreboard-score-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.scoreboard-gain-badge {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 8px;
  margin-left: 8px;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.25);
  display: inline-block;
}

.scoreboard-gain-badge.gain-pop {
  opacity: 1;
  transform: scale(1);
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid #22c55e;
  color: #4ade80;
}





/* ==========================================================================
   PHASE 6a: HOST LOBBY SPLIT LAYOUT (QR + room code left, roster right)
   ========================================================================== */
#screen-host-lobby { padding: 0; align-items: stretch; justify-content: stretch; }
.host-lobby-split {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: clamp(16px, 2.5vw, 40px);
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: clamp(14px, 2.5vh, 32px) clamp(16px, 2vw, 32px);
  text-align: left;
}
.blufftrivia-stage-card.host-lobby-split { max-width: none; background: transparent; border: none; box-shadow: none; }
.lobby-join-panel {
  flex: 0 0 clamp(260px, 26vw, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: clamp(16px, 2.5vh, 32px) 18px;
  text-align: center;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
}
.lobby-join-title { font-size: clamp(1.4rem, 2.2vw, 2.2rem) !important; margin-bottom: 4px !important; }
.lobby-join-sub { color: var(--text-muted); font-size: 0.95rem; margin: 0; }
.lobby-join-panel .qr-image { width: clamp(150px, 18vw, 280px); height: clamp(150px, 18vw, 280px); }
.lobby-join-panel .host-join-link { font-size: clamp(0.85rem, 1.1vw, 1.15rem); word-break: break-all; }
.lobby-room-code-wrap { margin-top: 6px; }
.lobby-room-code-label { font-size: 0.75rem; font-weight: 800; letter-spacing: 2px; color: var(--text-muted); }
.lobby-room-code { font-size: clamp(2rem, 3.4vw, 3.6rem); font-weight: 900; letter-spacing: 6px; color: var(--accent-gold); line-height: 1.1; }
.lobby-roster-panel {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  overflow-y: auto;
}
.lobby-roster-heading { font-size: clamp(1rem, 1.4vw, 1.5rem); font-weight: 800; text-transform: uppercase; color: var(--accent-gold); }
.lobby-roster-grid { grid-template-columns: repeat(auto-fill, minmax(clamp(180px, 16vw, 260px), 1fr)) !important; margin-top: 0 !important; }
.lobby-roster-panel .host-status-notice { max-width: none; margin: 0; }
@media (max-width: 800px) {
  .host-lobby-split { flex-direction: column; overflow-y: auto; }
  .lobby-join-panel { flex: 0 0 auto; }
}

/* ==========================================================================
   PHASE 6d: SETTINGS GROUPS (Edge TTS tweaks as individual rows)
   ========================================================================== */
.settings-group-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 4px 0;
  border-bottom: 2px solid rgba(245, 158, 11, 0.4);
}
.settings-group-title { font-weight: 800; font-size: 0.9rem; color: var(--accent-gold); text-transform: uppercase; letter-spacing: 0.5px; }
.settings-group-hint { font-size: 0.74rem; color: var(--text-muted); }
.settings-item-stacked { flex-direction: column; align-items: stretch !important; justify-content: flex-start; }
.settings-item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; }
.settings-value-badge { font-weight: 800; color: var(--accent-gold); font-size: 0.9rem; white-space: nowrap; }
.settings-range { width: 100%; accent-color: var(--accent-gold); cursor: pointer; }

/* Lifetime totals box (profile stats) */
.stats-records { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-glass); }
.stats-records-title { font-weight: 800; color: var(--accent-gold); font-size: 0.95rem; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.stats-records-body { font-size: 0.82rem; background: rgba(255,255,255,0.03); border: 1px solid var(--border-glass); border-radius: 10px; padding: 10px; }
.stats-records-head { font-weight: 700; margin: 8px 0 4px; }
.stats-records-head:first-child { margin-top: 0; }
.stats-records-note { margin-top: 6px; font-size: 0.7rem; color: var(--text-muted); }
.host-arena-center > .host-direction-badge { margin-bottom: 10px; }

/* ==========================================================================
   PHASE 10 / 6a: PROPORTIONAL HOST SCALE + SHARED HOST SHELL
   --u is 1% of the viewport width or 1.78% of its height, whichever is smaller.
   At 1920x1080 it is 19.2px. Host displays size the root font from it, so every
   rem-based rule scales the same on PC, Android TV and other TVs.
   "Large TV text" is only a multiplier on top (--boost).
   ========================================================================== */
:root { --u: min(1vw, 1.78vh); --boost: 1; }
html.tv-large-text { --boost: 1.2; }
@media (min-width: 900px) {
  html.host-display { font-size: calc(var(--u) * 0.8333 * var(--boost)); }
}

/* Lobby inherits the game-screen frame (full viewport, never scrolls); the split fills what the HUD leaves. */
#screen-host-lobby .host-lobby-split { flex: 1 1 auto; min-height: 0; height: auto; }
.lobby-tag-player { background: rgba(255, 255, 255, 0.15); }
.lobby-tag-offline { background: rgba(239, 68, 68, 0.4); border: 1px solid #ef4444; color: #fca5a5; }
.roster-item .lobby-remove {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; padding: 0; margin: 0;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(239, 68, 68, 0.25); border: 1px solid rgba(239, 68, 68, 0.7);
  color: #fca5a5; font-size: 0.72rem; font-weight: 800; cursor: pointer; z-index: 10; line-height: 1;
}
.roster-item { position: relative; }
.lobby-promote { font-size: 0.68rem; padding: 2px 6px; margin-top: 4px; border-radius: 6px; border: 1px solid #eab308; color: #fef08a; }
.lobby-rules-banner { margin-top: 12px; }

/* 6a follow-up: px sizes of buttons, top bar and modals become rem on host displays,
   so boxes scale together with their text and icons (1px = 0.0625rem at the 16px design size). */
html.host-display .host-game-hud { padding: 0.5rem 1.5rem; }
html.host-display .hud-left, html.host-display .hud-right { gap: 0.75rem; }
html.host-display .hud-game-identity { gap: 0.625rem; }
html.host-display .hud-game-icon { width: 2.125rem; height: 2.125rem; border-radius: 0.5rem; }
html.host-display .hud-badge { padding: 0.25rem 0.625rem; border-radius: 0.5rem; }
html.host-display .btn-hud-icon { width: 2.75rem; height: 2.75rem; border-width: 0.125rem; }
html.host-display .btn-icon { width: 2.375rem; height: 2.375rem; }
html.host-display .btn { padding: 0.75rem 1.5rem; gap: 0.5rem; }
html.host-display .btn-lg { padding: 1rem 2rem; }
html.host-display .modal-overlay { padding: 1rem; }
html.host-display .modal-card { max-width: 30rem; max-height: calc(100dvh - 2rem); padding: 1.5rem; }
html.host-display #modal-winner .modal-card { max-width: 32.5rem; }
html.host-display #modal-settings .modal-card { max-width: 95vw; max-height: calc(100dvh - 1.75rem); }
html.host-display .settings-tab-btn { padding: 0.5625rem 0.875rem; }
html.host-display .roster-item .lobby-remove { width: 1.375rem; height: 1.375rem; top: 0.375rem; right: 0.375rem; }

/* Host home: the app header scales like the game top bar. */
html.host-display .app-header { height: 3.75rem; padding: 0 1.25rem; }
html.host-display .header-left, html.host-display .header-right { gap: 0.75rem; }
html.host-display .logo-link { gap: 0.625rem; }
html.host-display .logo-icon { width: 2rem; height: 2rem; border-radius: 0.5rem; }
html.host-display .app-header #btn-header-switch-mode { font-size: 0.82rem !important; padding: 0.3rem 0.875rem !important; border-radius: 1.25rem !important; }
html.host-display .app-header #nav-profile-btn { width: 2.375rem !important; height: 2.375rem !important; border-width: 0.125rem !important; }
html.host-display .app-header #nav-profile-avatar { font-size: 1.35rem !important; }

/* Settings switches and sliders scale with the host display. */
html.host-display .switch { width: 3rem; height: 1.625rem; }
html.host-display .switch:focus, html.host-display .switch:focus-visible,
html.host-display .switch.remote-focused, html.host-display .switch input:focus + .slider { outline-width: 0.125rem; border-radius: 1.625rem; }
html.host-display .slider { border-radius: 1.625rem; }
html.host-display .slider:before { height: 1.125rem; width: 1.125rem; left: 0.25rem; bottom: 0.25rem; }
html.host-display input:checked + .slider:before { transform: translateX(1.375rem); }
html.host-display .settings-range { height: 1.25rem; }

/* Game card opens its lobby directly */
.game-card-cta { margin-top: 0.75rem; padding: 0.5rem 0.75rem; border-radius: 0.5rem; text-align: center; font-weight: 800; font-size: 0.95rem; background: rgba(245, 158, 11, 0.18); border: 1px solid rgba(245, 158, 11, 0.5); color: var(--accent-gold); }
.game-card:hover .game-card-cta, .game-card:focus-visible .game-card-cta { background: var(--accent-gold); color: #1e293b; }

/* Text boxes: compact, scale with the host display */
html.host-display .input-text { padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 1rem; }
html.host-display .input-text:focus { box-shadow: 0 0 0 0.1875rem rgba(14, 165, 233, 0.25); }
html.host-display input[type="number"].input-text { width: 4.75rem !important; }
html.host-display select.input-text { padding: 0.375rem 0.75rem !important; }
html.host-display .form-group { margin-bottom: 0.75rem; }

.btn-hud-music { border-color: rgba(255, 255, 255, 0.3); }
.btn-hud-music.active { border-color: rgba(56, 189, 248, 0.7); background: rgba(56, 189, 248, 0.2); color: #fff; }

/* Host displays: blur layers stacked over each other made the first modal open slow on TV GPUs. */
html.host-display .modal-overlay,
html.host-display .pause-overlay { backdrop-filter: none; -webkit-backdrop-filter: none; }
html.host-display .pause-overlay { background: rgba(10, 15, 26, 0.94); }
