/* Copyright (c) 2025-2026 Let's Automate. All rights reserved.
   Unauthorized copying, modification, or distribution is strictly prohibited. */

/* ============================================
   MOBILE HOST - SHARED STYLES
   Common CSS for all mobile host game views:
   Bingo, Quiz, Racing, Music Bingo, Top Percent

   Each game page sets --game-color to its
   theme colour (cyan, purple, red, pink).
   ============================================ */

/* ── CSS Variables (shared palette) ── */
:root {
  --neon-pink: #ff00ff;
  --neon-cyan: #00ffff;
  --neon-yellow: #ffff00;
  --neon-green: #00ff88;
  --neon-orange: #ff6600;
  --neon-purple: #bf00ff;
  --neon-red: #ff0040;
  --dark-bg: #0a0a12;
  --panel-bg: rgba(15, 15, 30, 0.95);
  --game-color: var(--neon-cyan);
}

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

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--dark-bg);
  color: white;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255, 0, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 255, 255, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Header ── */
.header {
  background: var(--panel-bg);
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--game-color);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.back-btn {
  background: none;
  border: none;
  color: var(--neon-cyan);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s;
}
.back-btn:active {
  background: rgba(0, 255, 255, 0.1);
}
.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--game-color);
  text-shadow: 0 0 15px var(--game-color);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s;
  flex-shrink: 0;
  /* Touch target: visual 36px but tappable area 44px via padding */
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.help-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
}
.help-btn:hover,
.help-btn:active {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  background: rgba(0, 255, 255, 0.1);
}
.session-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  color: var(--neon-cyan);
  background: rgba(0, 255, 255, 0.1);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 255, 255, 0.3);
  min-height: 32px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}
.session-badge:active {
  background: rgba(0, 255, 255, 0.2);
  border-color: rgba(0, 255, 255, 0.5);
}
.player-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  color: var(--neon-yellow);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Login Screen ── */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--dark-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.login-screen.hidden {
  display: none;
}
.login-logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--game-color);
  text-shadow:
    0 0 20px var(--game-color),
    0 0 40px var(--neon-pink);
  margin-bottom: 10px;
}
.login-subtitle {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  color: var(--neon-orange);
  margin-bottom: 40px;
}
.login-form {
  width: 100%;
  max-width: 320px;
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  color: #bbb;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.form-input {
  width: 100%;
  padding: 15px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid var(--game-color);
  border-radius: 10px;
  color: var(--game-color);
  text-transform: uppercase;
  letter-spacing: 2px;
}
.form-input:focus {
  outline: 2px solid var(--game-color);
  outline-offset: 2px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}
.login-btn {
  width: 100%;
  padding: 18px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
  min-height: 56px;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.login-btn:active:not(:disabled) {
  transform: scale(0.98);
  box-shadow: 0 0 12px rgba(255, 0, 255, 0.3);
}
.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.error-message {
  color: #ff4444;
  font-size: 0.85rem;
  margin-top: 15px;
  text-align: center;
  min-height: 20px;
}

/* ── Main Content ── */
.main-content {
  padding: 14px;
  position: relative;
  z-index: 1;
}

/* ── Bottom Navigation (persistent across all games) ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel-bg);
  border-top: 2px solid var(--game-color);
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bottom-nav-row {
  display: flex;
  gap: 6px;
}
.bottom-nav-btn {
  flex: 1;
  padding: 12px 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 46px;
  transition: all 0.15s;
}
.bottom-nav-btn:active {
  transform: scale(0.95);
}
.bottom-nav-btn.new-game {
  background: rgba(50, 50, 70, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ccc;
}
.bottom-nav-btn.end-game {
  background: rgba(255, 50, 50, 0.15);
  border: 1px solid rgba(255, 50, 50, 0.4);
  color: #ff6666;
}
.bottom-nav-btn.home {
  background: linear-gradient(135deg, var(--neon-green), #00cc66);
  color: #000;
}
.bottom-nav-btn.more {
  background: rgba(0, 255, 255, 0.12);
  border: 1px solid rgba(0, 255, 255, 0.3);
  color: var(--neon-cyan);
}

/* ── More Menu Popup ── */
.more-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9995;
  backdrop-filter: blur(4px);
}
.more-menu-overlay.show {
  display: block;
}
.more-menu {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom));
  right: 12px;
  background: var(--panel-bg);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 14px;
  padding: 8px;
  z-index: 9996;
  display: none;
  min-width: 200px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}
.more-menu.show {
  display: block;
}
.more-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #ccc;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.more-menu-item:active {
  background: rgba(0, 255, 255, 0.1);
}
.more-menu-item .more-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

/* ── Hide floating circles on mobile host (moved to More menu) ── */
.ticket-fab {
  display: none !important;
}
#lgg-chat {
  display: none !important;
}
#qr-float-btn {
  display: none !important;
}
#lgg-cc-fab {
  display: none !important;
}
#voice-input-btn {
  display: none !important;
}

/* ── Hide header back button (HOME is in bottom nav) ── */
.back-btn {
  display: none !important;
}
.bottom-nav-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.7rem;
  color: #777;
  padding: 3px 0;
}
.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aaa;
}
.connection-dot.connected {
  background: var(--neon-green);
  box-shadow: 0 0 10px var(--neon-green);
}

/* ── Section Title ── */
.section-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ── Effects Grid ── */
.effects-section {
  background: var(--panel-bg);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 0, 255, 0.2);
}
.effects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 400px) {
  .effects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.effect-btn {
  padding: 10px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  letter-spacing: 0.5px;
}
.effect-btn:active {
  transform: scale(0.9);
}
.effect-btn .effect-icon {
  font-size: 1.3rem;
}
.effect-btn.confetti {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
}
.effect-btn.fireworks {
  background: linear-gradient(135deg, #ff6600, #ff0066);
}
.effect-btn.spotlight {
  background: linear-gradient(135deg, #ffff00, #ffaa00);
  color: #000;
}
.effect-btn.strobe {
  background: linear-gradient(135deg, #ffffff, #aaaaaa);
  color: #000;
}
.effect-btn.lasers {
  background: linear-gradient(135deg, #00ff00, #00aa00);
}
.effect-btn.blackout {
  background: linear-gradient(135deg, #333333, #000000);
}
.effect-btn.shake {
  background: linear-gradient(135deg, #ff0040, #aa0030);
}
.effect-btn.rave {
  background: linear-gradient(45deg, var(--neon-pink), var(--neon-purple), var(--neon-cyan));
  background-size: 200% 200%;
  animation: rave-bg 3s ease infinite;
}
@keyframes rave-bg {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ── Toast ── */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--game-color);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.85rem;
  color: #fff;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Help Banner ── */
.help-banner {
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  margin: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.help-text {
  flex: 1;
  line-height: 1.4;
}
.help-dismiss {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 36px;
  transition: background 0.2s;
}
.help-dismiss:active {
  background: rgba(255, 255, 255, 0.25);
}

/* ── Accessibility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--neon-cyan);
  color: #000;
  padding: 12px 24px;
  font-weight: 700;
  text-decoration: none;
  z-index: 99999;
  border-radius: 0 0 8px 8px;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}

/* ================================================
   DESKTOP HOST → MOBILE OVERRIDES
   When desktop host pages (app/games/*/
host.html)
   load mobile-host-common.css, these rules adapt
   the desktop sidebar+main layout for mobile.
   ================================================ */

/* Hide mini-game mobile nav on desktop (shown on mobile below) */
.mini-game-nav {
  display: none;
}

@media (max-width: 768px) {
  /* Hide desktop sidebar completely (overrides host-ui.css transform approach) */
  .host-sidebar {
    display: none !important;
    transform: none !important;
    width: 0 !important;
    min-width: 0 !important;
  }
  .host-sidebar-overlay {
    display: none !important;
  }

  /* Hide desktop header actions (Audience, Back) - moved to bottom nav */
  .host-header__actions {
    display: none !important;
  }
  .host-header__mobile-toggle {
    display: none !important;
  }

  /* Single column layout */
  .host-body {
    display: block !important;
  }
  .host-main {
    margin: 0 !important;
    padding: 10px !important;
    width: 100% !important;
  }
  .host-console {
    padding: 0 !important;
  }

  /* Hide panel sub-headers (duplicate Audience/Reset buttons) */
  .panel-header {
    display: none !important;
  }

  /* Show mini-game mobile bottom nav */
  .mini-game-nav {
    display: flex !important;
  }

  /* Room for bottom nav */
  body {
    padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important;
  }

  /* Hide sidebar toggle and desktop footer */
  .host-sidebar__toggle {
    display: none !important;
  }
  .host-footer {
    display: none !important;
  }
}
