/* ==========================================================================
   GLOSSY WORD GAME & TV GAME SHOW HUB - DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@400;600;800&display=swap');

:root {
  /* Color Palette - Obsidian Glass & Iridescent Glows */
  --bg-dark: #070913;
  --bg-card: rgba(22, 27, 46, 0.65);
  --bg-card-hover: rgba(33, 41, 69, 0.85);
  --border-gloss: rgba(255, 255, 255, 0.16);
  --border-gloss-bright: rgba(255, 255, 255, 0.35);

  --accent-gold: #F59E0B;
  --accent-gold-glow: rgba(245, 158, 11, 0.4);
  --accent-cyan: #06B6D4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.4);
  --accent-purple: #8B5CF6;
  --accent-purple-glow: rgba(139, 92, 246, 0.4);
  --accent-emerald: #10B981;
  --accent-ruby: #F43F5E;

  /* Team Colors */
  --team-alpha: #EC4899;   /* Ruby Pink */
  --team-alpha-glow: rgba(236, 72, 153, 0.4);
  --team-beta: #3B82F6;    /* Sapphire Blue */
  --team-beta-glow: rgba(59, 130, 246, 0.4);

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --shadow-gloss: 0 16px 40px -10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --font-heading: 'Cinzel', serif;
  --font-subheading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Hide scrollbars across all elements */
*::-webkit-scrollbar {
  display: none;
  width: 0 !important;
  height: 0 !important;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* View Screen Switcher System */
.view-screen {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: 100%;
}

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

/* Glassmorphism Panel Class */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-gloss);
  box-shadow: var(--shadow-gloss);
  border-radius: var(--radius-lg);
}

/* Navbar & Header */
header.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  margin-bottom: 0.85rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.4rem;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.gold-icon {
  background: linear-gradient(135deg, #F59E0B, #D97706) !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5) !important;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 40%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-session-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-user-action {
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.25s ease;
}

.btn-login-glow {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.3));
  border: 1px solid var(--accent-purple);
  color: white;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.btn-login-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.6);
}

.user-pill {
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-gloss);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.room-pin-pill {
  padding: 0.45rem 1.1rem;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.9rem;
  color: var(--accent-gold);
  font-weight: 700;
  letter-spacing: 1px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-gloss);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  border-color: var(--border-gloss-bright);
}

/* ==========================================================================
   GAME SELECTION HUB LANDING SCREEN
   ========================================================================== */
.hub-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hub-hero {
  text-align: center;
  margin-bottom: 3rem;
}

.hub-hero-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 50%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

.hub-hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
}

.game-tiles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  perspective: 1000px;
}

@media (max-width: 768px) {
  .game-tiles-grid {
    grid-template-columns: 1fr;
  }
}

.game-launcher-card {
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-launcher-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--border-gloss-bright);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(139, 92, 246, 0.4);
}

.highlight-launcher:hover {
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(245, 158, 11, 0.4) !important;
}

.launcher-badge {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  background: rgba(139, 92, 246, 0.2);
  color: #A78BFA;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.gold-badge {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #FBBF24 !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
}

.launcher-icon-box {
  font-size: 4rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.5));
}

.launcher-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: white;
}

.launcher-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.launcher-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  color: var(--accent-cyan);
}

.launcher-features span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(6, 182, 212, 0.1);
  padding: 0.3rem 0.75rem;
  border-radius: 15px;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.gold-btn {
  background: linear-gradient(135deg, #F59E0B, #D97706) !important;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4) !important;
}

.gold-btn:hover {
  box-shadow: 0 15px 35px rgba(245, 158, 11, 0.6) !important;
}

/* ==========================================================================
   TV GAME SHOW ARENA & LOBBY VIEW
   ========================================================================== */
.tv-show-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.quiz-view-panel {
  display: none;
  flex: 1;
  padding: 2rem;
  border-radius: var(--radius-lg);
}

.quiz-view-panel.active {
  display: flex;
  flex-direction: column;
}

.lobby-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  flex: 1;
}

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

.qr-join-station {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-gloss);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.qr-title {
  font-family: var(--font-subheading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 0.3rem;
}

.qr-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.qr-canvas-box {
  background: white;
  padding: 1rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  margin-bottom: 1.25rem;
}

.qr-canvas-box canvas {
  display: block;
}

.join-url-pill {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  border: 1px solid rgba(6, 182, 212, 0.3);
  word-break: break-all;
}

.host-setup-station {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.connected-players-section {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-gloss);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.25rem 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.players-count-header {
  font-family: var(--font-subheading);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.players-badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-content: flex-start;
  flex: 1;
  max-height: 220px;
  overflow-y: auto;
}

.no-players-msg {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-style: italic;
  width: 100%;
  text-align: center;
  margin-top: 2rem;
}

.player-badge-pill {
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(236, 72, 153, 0.25));
  border: 1px solid var(--accent-purple);
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* TV GAME SHOW STAGE (ACTIVE QUESTION) */
.stage-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.stage-question-pill {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.stage-answered-pill {
  font-size: 0.85rem;
  color: var(--accent-cyan);
}

.quiz-question-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-gloss-bright);
  padding: 2.5rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: inset 0 2px 15px rgba(0, 0, 0, 0.5);
}

.tv-question-title {
  font-family: var(--font-subheading);
  font-size: 2.2rem;
  font-weight: 800;
  color: white;
  line-height: 1.35;
}

.tv-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 700px) {
  .tv-options-grid {
    grid-template-columns: 1fr;
  }
}

.tv-option-card {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-gloss);
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  transition: all 0.25s ease;
}

.option-prefix-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  color: var(--accent-gold);
}

.tv-option-card.option-correct {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(16, 185, 129, 0.1));
  border-color: var(--accent-emerald);
  color: #6EE7B7;
}

.tv-timer-box {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

/* Animated Leaderboard Score Bar Chart */
.podium-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-gloss);
  margin-bottom: 0.6rem;
}

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

.podium-bar-player {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.podium-rank-tag {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.podium-rank-tag.gold-rank {
  background: rgba(245, 158, 11, 0.25);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.podium-player-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
}

.podium-score-val {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--accent-gold);
}

.podium-bar-track {
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.podium-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

/* ==========================================================================
   MOBILE CONTROLLER VIEW (SCANNED VIA QR)
   ========================================================================== */
.mobile-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mobile-header {
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.mobile-card {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mobile-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.mobile-option-btn {
  padding: 1.25rem 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(59, 130, 246, 0.25));
  border: 1px solid var(--accent-purple);
  color: white;
  font-family: var(--font-subheading);
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all 0.2s ease;
}

.mobile-option-btn:active {
  transform: scale(0.96);
  background: var(--accent-purple);
}

.mobile-feedback {
  text-align: center;
  padding: 2rem 1rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-emerald);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

#mobile-feedback-text {
  font-family: var(--font-subheading);
  font-weight: 800;
  font-size: 1.3rem;
  color: #6EE7B7;
}

.mobile-speed-val {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* Word Game Tile Layout preserved */
#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.scoreboard-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.75rem;
  margin-bottom: 1.25rem;
}

.team-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.team-card.team-active {
  border-color: var(--accent-gold);
  box-shadow: 0 0 25px var(--accent-gold-glow);
  background: rgba(255, 255, 255, 0.05);
}

.team-color-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
}

.team-info {
  display: flex;
  flex-direction: column;
}

.team-name {
  font-family: var(--font-subheading);
  font-weight: 700;
  font-size: 1.1rem;
}

.team-score {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
}

.turn-badge {
  text-align: center;
  padding: 0.5rem 1.25rem;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid var(--border-gloss);
}

.turn-text {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.turn-team-name {
  font-family: var(--font-subheading);
  font-weight: 800;
  font-size: 1rem;
  color: var(--accent-gold);
}

.tiles-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.15rem;
  perspective: 1000px;
}

@media (max-width: 900px) {
  .tiles-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 600px) {
  .tiles-grid { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
}

.tile-card {
  position: relative;
  height: 125px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid var(--border-gloss);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.tile-card:hover {
  transform: translateY(-6px) scale(1.03) rotateX(4deg);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(139, 92, 246, 0.35);
}

.tile-number {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(180deg, #FFFFFF 30%, #CBD5E1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tile-label {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.tile-card.tile-solved {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.08) 100%);
  border-color: rgba(16, 185, 129, 0.5);
}

.tile-card.tile-solved .tile-number {
  background: linear-gradient(180deg, #6EE7B7 0%, #10B981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tile-card.tile-passed {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.25) 0%, rgba(245, 158, 11, 0.08) 100%);
  border-color: rgba(245, 158, 11, 0.5);
}

.tile-card.tile-passed .tile-number {
  background: linear-gradient(180deg, #FDE68A 0%, #F59E0B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tile-status-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.badge-solved {
  background: rgba(16, 185, 129, 0.3);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.badge-passed {
  background: rgba(245, 158, 11, 0.3);
  color: #FDE68A;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

footer.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.difficulty-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-gloss);
  font-weight: 600;
  color: var(--accent-gold);
}

/* Modals & System Overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 15, 0.88);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

#auth-modal { z-index: 1200 !important; }

.reveal-card, .setup-modal-content {
  width: 92%;
  max-width: 680px;
  padding: 2.25rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, rgba(30, 38, 66, 0.94) 0%, rgba(15, 20, 36, 0.97) 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8), 0 0 50px rgba(139, 92, 246, 0.3);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.btn-close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-gloss);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-modal:hover { background: rgba(255, 255, 255, 0.2); }

.auth-card { max-width: 460px; overflow: hidden; padding: 2rem 2.25rem; }

.auth-tabs { display: flex; border-bottom: 1px solid var(--border-gloss); margin-bottom: 1.25rem; }
.auth-tab { flex: 1; padding: 0.75rem; background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); font-family: var(--font-subheading); font-weight: 700; font-size: 0.95rem; cursor: pointer; }
.auth-tab.active { color: white; border-bottom-color: var(--accent-purple); }

.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-form-title { font-family: var(--font-heading); font-size: 1.3rem; margin-bottom: 1rem; text-align: center; }
.auth-error-msg { color: var(--accent-ruby); font-size: 0.85rem; margin-top: 0.4rem; text-align: center; min-height: 18px; }

.auth-modal-link { color: #C084FC !important; font-weight: 800 !important; text-decoration: underline !important; cursor: pointer !important; }
.auth-modal-link:hover { color: #E9D5FF !important; }

.custom-checkbox-container { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-gloss); padding: 0.75rem 1rem; border-radius: var(--radius-sm); }
.custom-checkbox-container input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent-purple); cursor: pointer; }
.checkbox-label-text { font-size: 0.85rem; color: var(--text-main); }

.pack-hub-card { max-width: 820px; }
.hub-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border-gloss); padding-bottom: 0.75rem; overflow-x: auto; }
.hub-tab { padding: 0.5rem 1rem; border-radius: 20px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-gloss); color: var(--text-muted); font-size: 0.85rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.hub-tab.active { background: rgba(139, 92, 246, 0.25); border-color: var(--accent-purple); color: white; }

.btn-highlight-tab { background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(139, 92, 246, 0.3)); color: white; border-color: var(--accent-ruby); }

.packs-list-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; max-height: 420px; overflow-y: auto; padding-right: 0.5rem; }
@media (max-width: 650px) { .packs-list-grid { grid-template-columns: 1fr; } }

.pack-card { background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border-gloss); border-radius: var(--radius-md); padding: 1.25rem; display: flex; flex-direction: column; justify-content: space-between; }
.pack-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.pack-title { font-family: var(--font-subheading); font-size: 1.1rem; font-weight: 800; color: white; }
.pack-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.pack-meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.75rem; color: var(--text-dim); }

.pack-badge-official { background: rgba(245, 158, 11, 0.2); color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.4); padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: 800; }
.pack-badge-public { background: rgba(6, 182, 212, 0.2); color: #67E8F9; border: 1px solid rgba(6, 182, 212, 0.4); padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: 800; }

.admin-card { max-width: 850px; }
.panel-subtitle { font-family: var(--font-subheading); font-size: 1.2rem; font-weight: 800; margin-bottom: 1rem; color: var(--accent-cyan); }

.table-responsive { width: 100%; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; text-align: left; }
.admin-table th, .admin-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-gloss); }
.admin-table th { color: var(--text-muted); font-family: var(--font-subheading); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px; }

.reveal-tile-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 1.25rem; }
.tile-badge-large { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; padding: 0.4rem 1.1rem; border-radius: 30px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border-gloss); color: var(--accent-gold); }
.phase-badge-main { font-size: 0.75rem; font-weight: 800; letter-spacing: 1.5px; padding: 0.4rem 0.85rem; border-radius: 20px; background: rgba(139, 92, 246, 0.2); color: #A78BFA; border: 1px solid rgba(139, 92, 246, 0.4); }
.phase-badge-bonus { font-size: 0.75rem; font-weight: 800; letter-spacing: 1.5px; padding: 0.4rem 0.85rem; border-radius: 20px; background: rgba(245, 158, 11, 0.25); color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.5); }
.category-tag { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent-cyan); background: rgba(6, 182, 212, 0.12); padding: 0.4rem 0.85rem; border-radius: 20px; border: 1px solid rgba(6, 182, 212, 0.3); }

.turn-notice-banner { padding: 0.6rem 1.25rem; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-gloss); font-family: var(--font-subheading); font-weight: 700; font-size: 1rem; color: var(--accent-gold); margin-bottom: 1.5rem; text-align: center; }

.revealed-word-box { margin: 1rem 0 1.75rem 0; padding: 2.25rem 1.5rem; background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%); border-radius: var(--radius-md); border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: inset 0 2px 15px rgba(0, 0, 0, 0.5); position: relative; overflow: hidden; text-align: center; }
.word-text { font-family: var(--font-subheading); font-weight: 800; font-size: 3rem; letter-spacing: 2px; background: linear-gradient(135deg, #FFFFFF 0%, #F1F5F9 50%, #94A3B8 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.timer-container { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-bottom: 1.75rem; }
.timer-svg-box { position: relative; width: 85px; height: 85px; }
.timer-svg-box svg { transform: rotate(-90deg); }
.timer-bg-circle { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 6; }
.timer-progress-circle { fill: none; stroke: var(--accent-gold); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 251.2; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke 0.3s ease; }
.timer-text-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-size: 1.5rem; font-weight: 800; }
.timer-controls { display: flex; flex-direction: column; gap: 0.5rem; }

.btn-small-gloss { padding: 0.4rem 0.85rem; border-radius: 20px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border-gloss); color: var(--text-main); font-size: 0.8rem; cursor: pointer; transition: all 0.2s ease; }
.btn-small-gloss:hover { background: rgba(255, 255, 255, 0.18); }

.reveal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.btn-action { padding: 1rem 1.25rem; border-radius: var(--radius-md); font-family: var(--font-subheading); font-weight: 800; font-size: 1.05rem; letter-spacing: 0.5px; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem; transition: all 0.25s ease; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); }

.btn-correct { background: linear-gradient(135deg, #10B981, #059669); color: white; border: 1px solid rgba(255, 255, 255, 0.3); }
.btn-correct:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(16, 185, 129, 0.5); }

.btn-pass { background: linear-gradient(135deg, #F59E0B, #D97706); color: white; border: 1px solid rgba(255, 255, 255, 0.3); }
.btn-pass:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(245, 158, 11, 0.5); }

.btn-bonus-steal { background: linear-gradient(135deg, #8B5CF6, #6366F1); color: white; border: 1px solid rgba(255, 255, 255, 0.4); box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4); }
.btn-bonus-steal:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(139, 92, 246, 0.6); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 600px) { .settings-grid { grid-template-columns: 1fr; } }

.modal-title { font-family: var(--font-heading); font-size: 1.7rem; margin-bottom: 1.25rem; text-align: center; background: linear-gradient(135deg, #FFF, #94A3B8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.form-group { margin-bottom: 0.85rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.form-input, .form-select, .form-textarea { width: 100%; padding: 0.75rem 1rem; border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.4); border: 1px solid var(--border-gloss); color: var(--text-main); font-family: var(--font-body); font-size: 0.95rem; outline: none; transition: border-color 0.25s ease; }
.form-textarea { resize: vertical; min-height: 70px; }

.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent-purple); box-shadow: 0 0 15px var(--accent-purple-glow); }

.btn-primary-gloss { width: 100%; padding: 1rem; border-radius: var(--radius-md); background: linear-gradient(135deg, #8B5CF6, #EC4899); color: white; font-family: var(--font-subheading); font-weight: 800; font-size: 1.1rem; letter-spacing: 1px; border: 1px solid rgba(255, 255, 255, 0.4); cursor: pointer; transition: all 0.25s ease; box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4); }
.btn-primary-gloss:hover { transform: translateY(-2px); box-shadow: 0 15px 35px rgba(139, 92, 246, 0.6); }

.victory-card { text-align: center; padding: 3rem 2rem; }
.victory-title { font-family: var(--font-heading); font-size: 2.8rem; color: var(--accent-gold); margin-bottom: 0.5rem; }
.victory-sub { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 2rem; }
.victory-stats { display: flex; justify-content: center; gap: 2rem; margin-bottom: 2rem; }
.stat-box { background: rgba(255, 255, 255, 0.05); padding: 1.25rem 2rem; border-radius: var(--radius-md); border: 1px solid var(--border-gloss); }
.stat-val { font-family: var(--font-heading); font-size: 2.2rem; font-weight: 800; }

/* ==========================================================================
   SNAPPUZZLE RUSH — PICTURE SCATTER SHOWDOWN STYLES
   ========================================================================== */

.master-image-box {
  width: 100%;
  height: 280px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #06b6d4;
  box-shadow: 0 10px 30px rgba(6, 182, 212, 0.3);
}

.master-image-box svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage-preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(12px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border-radius: var(--radius-md);
}

.puzzle-grid-touch {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 360px;
  margin: 1rem auto;
  aspect-ratio: 1;
  background: linear-gradient(145deg, #451a03, #1c0a00);
  padding: 10px;
  border-radius: 16px;
  border: 4px solid #78350f;
  box-shadow: inset 0 8px 16px rgba(0, 0, 0, 0.8), 0 15px 35px rgba(0, 0, 0, 0.6);
}

.puzzle-tile {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: default;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: #090d16;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  touch-action: manipulation;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.puzzle-tile.tile-empty {
  background: rgba(10, 5, 0, 0.85);
  border: 2px dashed rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.9);
}

.puzzle-tile.tile-slidable {
  cursor: pointer;
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
  animation: pulseSlidable 1.5s infinite alternate;
}

@keyframes pulseSlidable {
  0% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
  100% { box-shadow: 0 0 18px rgba(245, 158, 11, 0.8); }
}

.puzzle-tile.tile-slidable:active {
  transform: scale(0.94);
}

.puzzle-tile.tile-correct {
  border-color: #10B981;
}

.tile-number-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.75);
  color: var(--accent-gold);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  pointer-events: none;
}

.tile-content {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.tile-content svg {
  width: 100%;
  height: 100%;
}

.round-winner-banner {
  padding: 1.5rem 2rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--accent-gold);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05));
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-gold);
  text-align: center;
  box-shadow: 0 15px 35px rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   WORDSEARCH BLITZ — MULTIPLAYER WORD FIND RACE STYLES
   ========================================================================== */

.ws-grid-matrix {
  display: grid;
  gap: 4px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  aspect-ratio: 1;
  background: #090d16;
  padding: 8px;
  border-radius: 16px;
  border: 3px solid var(--accent-gold);
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.8), 0 15px 35px rgba(245, 158, 11, 0.2);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
  box-sizing: border-box;
}

.ws-letter-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ws-letter-cell:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ws-letter-cell.cell-selecting {
  border-color: #ffffff;
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.6);
  z-index: 2;
  color: #000000 !important;
  font-weight: 900;
}

.ws-letter-cell.cell-claimed {
  border-color: transparent;
  color: #000000 !important;
  font-weight: 900;
}

.words-target-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 280px;
  overflow-y: auto;
}

.word-target-pill {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.25s ease;
}

.word-target-pill.pill-claimed {
  transform: scale(1.02);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}
