/* ==========================================================================
   D&D MULTIPLAYER - DARK FANTASY DESIGN SYSTEM
   Headers: Cinzel
   Body / Narrative: Cormorant Garamond
   UI Elements / Controls: Inter
   Palette: Deep Charcoal, Obsidian, Gold Glow, Crimson
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;800;900&family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Color Palette */
  --bg-deep: #0c0c0e;
  --bg-panel: rgba(18, 18, 22, 0.92);
  --bg-card: rgba(26, 26, 32, 0.85);
  --bg-inset: rgba(10, 10, 13, 0.8);

  /* Gold Accents */
  --gold-primary: #d4af37;
  --gold-light: #f3e5ab;
  --gold-dark: #8b6508;
  --gold-glow: rgba(212, 175, 55, 0.35);

  /* Crimson & Health */
  --crimson-base: #8b0000;
  --crimson-bright: #dc2626;
  --crimson-glow: rgba(220, 38, 38, 0.45);
  --green-heal: #15803d;

  /* Typography Colors */
  --text-parchment: #eae0c8;
  --text-muted: #a39985;
  --text-dim: #6d6657;

  /* Fonts */
  --font-header: 'Cinzel', serif;
  --font-story: 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Borders & Shadows */
  --border-gold: 1px solid rgba(212, 175, 55, 0.4);
  --border-gold-glow: 1px solid rgba(212, 175, 55, 0.85);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.75), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  --shadow-glow: 0 0 20px var(--gold-glow);
  --shadow-inset: inset 0 2px 8px rgba(0, 0, 0, 0.85);

  --transition-smooth: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-bounce: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(139, 0, 0, 0.12) 0%, transparent 65%),
    linear-gradient(180deg, #09090b 0%, #121216 100%);
  color: var(--text-parchment);
  font-family: var(--font-story);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography Classes */
.cinzel, h1, h2, h3, h4 {
  font-family: var(--font-header);
  color: var(--gold-light);
  letter-spacing: 0.05em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 16px var(--gold-glow);
}

.story-text {
  font-family: var(--font-story);
  font-size: 1.35rem;
  line-height: 1.65;
  color: var(--text-parchment);
}

.ui-font, button, input, select, label {
  font-family: var(--font-ui);
}

/* Dark Fantasy Card Frames */
.fantasy-card {
  background: var(--bg-panel);
  border: var(--border-gold);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.fantasy-card::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: 9px;
  pointer-events: none;
}

/* 3D Glossy Health Bar */
.health-bar-container {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 6px;
  height: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-inset);
}

.health-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #5c0606 0%, var(--crimson-base) 50%, var(--crimson-bright) 100%);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.25), 0 0 14px var(--crimson-glow);
  border-right: 2px solid rgba(255, 255, 255, 0.5);
}

.health-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 1);
  z-index: 2;
}

/* Embossed Gold Button */
.gold-btn {
  background: linear-gradient(180deg, #e5c358 0%, #b88e23 50%, #8b6508 100%);
  color: #111114;
  font-family: var(--font-header);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 10px 20px;
  border: 1px solid #fff5c3;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: var(--transition-bounce);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gold-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.75), 0 0 18px var(--gold-glow);
  color: #000;
}

.gold-btn:active {
  transform: translateY(1px) scale(0.98);
}

.gold-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Badges */
.badge-gold {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ==========================================================================
   TV HOST SCREEN (index.html) SPECIFIC LAYOUT
   ========================================================================== */
.host-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 14px 24px;
  max-width: 1680px;
  margin: 0 auto;
  gap: 14px;
}

/* Top Navigation / Host Header */
.host-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: var(--bg-panel);
  border: var(--border-gold);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  gap: 12px;
  flex-wrap: wrap;
}

.brand-section h1 {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-section .subtitle {
  font-family: var(--font-story);
  font-size: 1rem;
  color: var(--text-muted);
}

.room-code-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-inset);
  padding: 6px 18px;
  border-radius: 8px;
  border: 1.5px solid var(--gold-primary);
  box-shadow: var(--shadow-glow);
}

.room-code-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.room-code-value {
  font-family: var(--font-header);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--gold-light);
  line-height: 1;
}

.qr-join-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-inset);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.qr-code-display {
  background: #ffffff;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code-display canvas, .qr-code-display img {
  width: 52px !important;
  height: 52px !important;
  display: block;
}

.join-url-info {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.join-url-info strong {
  color: var(--gold-light);
  font-size: 0.9rem;
}

/* Header Controls: TTS & Gemini status */
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tts-toggle-btn {
  background: var(--bg-inset);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.tts-toggle-btn.speaking {
  border-color: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

/* Main Grid */
.host-grid {
  display: grid;
  grid-template-columns: 310px 1fr 340px;
  gap: 14px;
  flex: 1;
}

/* Left Panel: Enemy Profile */
.enemy-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.enemy-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px double var(--gold-primary);
  background: radial-gradient(circle, #381a1a 0%, #151518 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: 0 0 20px rgba(139, 0, 0, 0.5);
  animation: pulseEnemy 4s ease-in-out infinite;
}

@keyframes pulseEnemy {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.enemy-name {
  font-size: 1.45rem;
  line-height: 1.2;
}

.enemy-subtitle {
  font-family: var(--font-story);
  font-size: 1.05rem;
  color: var(--text-muted);
  font-style: italic;
}

.enemy-stats-row {
  display: flex;
  gap: 10px;
}

.stat-shield {
  background: var(--bg-inset);
  border: 1px solid var(--gold-primary);
  padding: 4px 12px;
  border-radius: 16px;
  font-family: var(--font-header);
  font-size: 0.85rem;
  color: var(--gold-light);
}

/* Center Panel: DM Story Narrative & Gemini Resolutions */
.narrative-panel {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.narrative-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.narrative-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: left;
  padding: 14px 20px;
  overflow-y: auto;
  max-height: 660px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dark) rgba(0, 0, 0, 0.4);
}

.narrative-body::-webkit-scrollbar {
  width: 6px;
}
.narrative-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
}
.narrative-body::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: 4px;
}
.narrative-body::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

.dm-story-ornament {
  width: 100%;
  text-align: center;
  font-family: var(--font-header);
  font-size: 0.82rem;
  letter-spacing: 0.25em;
  color: var(--gold-light);
  opacity: 0.8;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  padding-bottom: 8px;
}

.dm-speech-bubble {
  font-family: var(--font-story);
  font-size: 1.45rem;
  line-height: 1.75;
  color: var(--text-parchment);
  width: 100%;
  max-width: 860px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  transition: opacity 0.3s ease;
  overflow-wrap: break-word;
  word-break: break-word;
}

.dm-speech-bubble p {
  margin-bottom: 1.25rem;
  text-indent: 1.5rem;
  text-align: justify;
}

.dm-speech-bubble p:first-of-type {
  text-indent: 0;
}

.tts-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #22c55e;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 10px;
}

.host-action-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

/* Right Panel: Combat Log Feed */
.combat-log-panel {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  max-height: 420px;
}

.combat-log-header {
  font-size: 1.15rem;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.combat-log-feed {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.combat-log-feed::-webkit-scrollbar { width: 5px; }
.combat-log-feed::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 4px; }

.log-entry {
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--bg-inset);
  border-left: 3px solid var(--gold-primary);
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text-parchment);
  animation: fadeIn 0.3s ease-out;
}

.log-entry.damage {
  border-left-color: var(--crimson-bright);
  background: rgba(139, 0, 0, 0.2);
}

.log-entry.heal {
  border-left-color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
}

.log-entry.gemini {
  border-left-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

/* Bottom Party Roster */
.party-roster-panel {
  padding: 12px 18px;
}

.roster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.player-card {
  background: var(--bg-inset);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-card.has-acted {
  border-color: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.25);
}

.player-card.is-dead {
  opacity: 0.5;
  filter: grayscale(80%);
}

.player-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-status-tag {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #333;
  color: #fff;
}

.player-status-tag.ready { background: #16a34a; }
.player-status-tag.waiting { background: #b45309; }

/* Responsive Adjustments for 13-inch Laptops */
@media (max-width: 1100px), (max-height: 850px) {
  .host-container { padding: 8px 12px; gap: 8px; }
  .host-grid { grid-template-columns: 260px 1fr 280px; gap: 8px; }
  .enemy-avatar { width: 70px; height: 70px; font-size: 2.2rem; }
  .dm-speech-bubble { font-size: 1.25rem; line-height: 1.45; }
  .combat-log-panel { max-height: 300px; }
}

@media (max-width: 820px) {
  .host-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   MOBILE CONTROLLER (controller.html) SPECIFIC LAYOUT
   ========================================================================== */
.controller-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 14px;
  position: relative;
  gap: 12px;
}

.join-card {
  margin: auto 0;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-family: var(--font-header);
  font-size: 0.85rem;
  color: var(--gold-light);
  letter-spacing: 0.05em;
}

.room-input {
  font-family: var(--font-header);
  font-size: 2rem;
  text-align: center;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  background: var(--bg-inset);
  color: var(--gold-light);
  border: 1px solid var(--gold-primary);
  border-radius: 8px;
  padding: 10px;
  outline: none;
  box-shadow: var(--shadow-inset);
}

.room-input:focus {
  border-color: #fff5c3;
  box-shadow: 0 0 12px var(--gold-glow), var(--shadow-inset);
}

.text-input {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  background: var(--bg-inset);
  color: var(--text-parchment);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  padding: 10px 14px;
  outline: none;
}

.text-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

/* Class Grid */
.class-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.class-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  background: var(--bg-inset);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-bounce);
  user-select: none;
}

.class-option .class-icon { font-size: 1.6rem; margin-bottom: 2px; }
.class-option .class-name { font-family: var(--font-header); font-size: 0.85rem; color: var(--gold-light); }

.class-option.selected {
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.2);
  box-shadow: 0 0 12px var(--gold-glow);
  transform: scale(1.02);
}

/* Action Cards */
.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-card-btn {
  background: linear-gradient(145deg, #1e1e24 0%, #131317 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 10px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  color: var(--text-parchment);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  transition: var(--transition-smooth);
}

.action-card-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.action-card-btn:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px var(--gold-glow);
}

.action-card-btn .act-icon { font-size: 1.8rem; }
.action-card-btn .act-title { font-family: var(--font-header); font-size: 0.95rem; font-weight: 700; color: var(--gold-light); }
.action-card-btn .act-desc { font-family: var(--font-ui); font-size: 0.75rem; color: var(--text-muted); }

/* Custom Action Box */
.custom-action-box {
  background: var(--bg-inset);
  border: 1px dashed rgba(212, 175, 55, 0.45);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-action-box textarea {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text-parchment);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 50px;
  outline: none;
}

.custom-action-box textarea:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

/* Roll Screen */
.roll-card {
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.d20-visual {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--gold-primary);
  background: radial-gradient(circle, #4a1515 0%, #151518 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-family: var(--font-header);
  color: var(--gold-light);
  box-shadow: 0 0 20px var(--crimson-glow);
  animation: floatDice 3s ease-in-out infinite;
}

@keyframes floatDice {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.d20-input {
  font-family: var(--font-header);
  font-size: 3rem;
  font-weight: 900;
  width: 120px;
  height: 70px;
  text-align: center;
  background: var(--bg-inset);
  color: var(--gold-light);
  border: 2px solid var(--gold-primary);
  border-radius: 10px;
  outline: none;
  box-shadow: var(--shadow-inset);
}

.d20-input:focus {
  border-color: #fff5c3;
  box-shadow: 0 0 18px var(--gold-glow);
}

.error-banner {
  background: rgba(139, 0, 0, 0.4);
  border: 1px solid var(--crimson-bright);
  color: #fca5a5;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  display: none;
}

.waiting-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 12px 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   CAMPAIGN THEME & PRE-GAME LOBBY STYLES
   ========================================================================== */
.campaign-theme-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-panel);
  border: var(--border-gold);
  border-radius: 10px;
  padding: 10px 18px;
  box-shadow: var(--shadow-card);
}

.campaign-theme-bar .theme-label {
  font-family: var(--font-header);
  font-size: 0.95rem;
  color: var(--gold-light);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.campaign-theme-bar .theme-input {
  flex: 1;
  background: var(--bg-inset);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--gold-light);
  padding: 8px 14px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  border-radius: 6px;
  outline: none;
  transition: var(--transition-smooth);
}

.campaign-theme-bar .theme-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px var(--gold-glow);
}

/* Visual Pre-game Lobby on TV Host */
.lobby-section {
  padding: 18px 22px;
  background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.08) 0%, var(--bg-panel) 75%);
  border: var(--border-gold-glow);
  box-shadow: var(--shadow-glow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  padding-bottom: 10px;
}

.lobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.lobby-player-card {
  background: var(--bg-inset);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease-out;
}

.lobby-player-card .lobby-icon {
  font-size: 1.8rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.15);
  border: 1.5px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobby-player-card .lobby-details {
  display: flex;
  flex-direction: column;
}

.lobby-player-card .lobby-pname {
  font-family: var(--font-header);
  font-size: 1rem;
  color: var(--gold-light);
  font-weight: 700;
}

.lobby-player-card .lobby-pclass {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Controller Select Styling */
.select-input {
  width: 100%;
  background: var(--bg-inset);
  color: var(--text-parchment);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-ui);
  font-size: 1rem;
  cursor: pointer;
  outline: none;
  transition: var(--transition-smooth);
}

.select-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

.select-input option {
  background: #18181f;
  color: #eae0c8;
  padding: 8px;
}

/* Selfie Camera & Visual Description Styles */
.selfie-btn {
  background: rgba(212, 175, 55, 0.12);
  border: 1.5px dashed var(--gold-primary);
  color: var(--gold-light);
  font-family: var(--font-header);
  font-size: 0.9rem;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  transition: var(--transition-smooth);
}

.selfie-btn:hover {
  background: rgba(212, 175, 55, 0.22);
  box-shadow: 0 0 10px var(--gold-glow);
}

.selfie-preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding: 8px;
  background: var(--bg-inset);
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.selfie-preview-img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

.lobby-avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--gold-primary);
  flex-shrink: 0;
}

.lobby-description {
  font-family: var(--font-story);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-parchment);
  line-height: 1.35;
  margin-top: 4px;
}

/* Voice Settings Modal Styles */

/* Voice Settings Modal Styles */
.voice-modal-content {
  background: var(--bg-panel);
  border: var(--border-gold);
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.9), 0 0 15px var(--gold-glow);
}

.voice-form-group {
  margin-bottom: 16px;
}

.voice-form-group label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 6px;
}

.voice-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  color: var(--text-parchment);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.voice-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.voice-slider {
  flex: 1;
  accent-color: var(--gold-primary);
}

.voice-slider-val {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 45px;
}

.voice-preset-chips {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.voice-chip {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-light);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.75rem;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.voice-chip:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--gold-primary);
}
