:root {
  --bg-dark: #0a0e1a;
  --panel-bg: #141c2e;
  --border-color: rgba(255, 255, 255, 0.1);
  --accent-cyan: #00f2fe;
  --accent-green: #10b981;
  --accent-gold: #f59e0b;
  --accent-red: #ef4444;
  --text-white: #ffffff;
  --text-dim: #94a3b8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg-dark);
  color: var(--text-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.host-header {
  background: #111827;
  border-bottom: 1px solid var(--border-color);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-badge-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.host-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

.host-brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.host-brand-trivia-icon,
.host-brand-bolt {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.host-brand-title {
  font-family: 'Outfit', 'Montserrat', sans-serif;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.host-brand-title .brand-white {
  color: #ffffff;
}

.host-brand-title .brand-cyan {
  color: var(--accent-cyan);
}

.by-prefix {
  font-size: 0.62rem;
  color: #64748b;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.vcharge-brand {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: 'Segoe UI', Roboto, 'Inter', Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
}

.vcharge-text {
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.05em;
  line-height: 1;
}

.vcharge-bolt {
  display: inline-block;
  vertical-align: middle;
}

.vcharge-gold {
  color: #f59e0b;
}

.vcharge-white {
  color: #f8fafc;
}

.room-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
}

.room-title span {
  color: var(--accent-cyan);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.phase-indicator, .timer-indicator {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  display: flex;
  gap: 8px;
  align-items: center;
}

.phase-indicator .label, .timer-indicator .label {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 700;
}

.phase-indicator strong {
  color: var(--accent-cyan);
  font-family: 'Outfit', sans-serif;
}

.timer-indicator strong {
  color: var(--accent-gold);
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
}

.autopilot-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.autopilot-btn.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

/* MAIN */
.host-main {
  flex: 1;
  padding: 24px 32px;
}

.host-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  height: 100%;
}

.control-card, .roster-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.control-card h2, .roster-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.cmd-btn {
  padding: 14px 20px;
  border-radius: 12px;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: filter 0.15s, transform 0.15s;
}

.cmd-btn:hover {
  filter: brightness(1.15);
}

.cmd-btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #051429;
}

.btn-accent {
  background: #10b981;
  color: #022013;
}

.btn-warning {
  background: #f59e0b;
  color: #211300;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--accent-red);
  color: #fca5a5;
}

/* CHEAT SHEET */
.cheat-sheet-box {
  background: #0d1322;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  flex: 1;
}

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

.box-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dim);
}

.q-tag {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.25) 0%, rgba(59, 130, 246, 0.25) 100%);
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(0, 242, 254, 0.2);
}

.cheat-prompt {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 14px;
  line-height: 1.4;
}

.cheat-answer {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-green);
  padding: 10px 14px;
  border-radius: 10px;
  color: #34d399;
  font-weight: 800;
  margin-bottom: 10px;
}

.cheat-notes {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.placeholder-text {
  color: var(--text-dim);
  font-style: italic;
}

/* ROSTER TABLE */
.roster-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.lock-indicator {
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.roster-table-wrapper {
  overflow-y: auto;
  flex: 1;
}

.roster-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.roster-table th {
  padding: 12px 16px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-color);
}

.roster-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 1rem;
  font-weight: 600;
}

.badge-answered {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 800;
}

.badge-waiting {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.empty-cell {
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
  padding: 40px !important;
}

.btn-remove-team {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 5px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-remove-team:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #ffffff;
}

/* HOST PACK INDICATOR */
.pack-indicator {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 360px;
}

.pack-indicator .label {
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 700;
}

.pack-indicator strong {
  color: #c4b5fd;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.btn-change-pack {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-change-pack:hover {
  background: rgba(139, 92, 246, 0.35);
  border-color: #8b5cf6;
  color: #ffffff;
}

/* PACK SELECTOR MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  background: #0d1322;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 90%;
  max-width: 620px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
}

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

.modal-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #ffffff;
}

.modal-body {
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}

.modal-pack-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-pack-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  transition: all 0.2s ease;
}

.modal-pack-item:hover {
  border-color: rgba(0, 242, 254, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

.modal-pack-item.active {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.08);
}

.modal-pack-info h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-pack-info p {
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.35;
}

.modal-pack-meta {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.btn-select-pack {
  background: linear-gradient(135deg, #00f2fe 0%, #0284c7 100%);
  color: #031326;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-select-pack:hover {
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

.current-badge {
  color: var(--accent-green);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

/* ==========================================
   HOST AUTHORIZATION & PIN UNLOCK
   ========================================== */
.auth-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dim);
}

.auth-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
  transition: all 0.2s ease;
}

.auth-indicator.authorized {
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.auth-indicator.authorized .auth-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}

.auth-indicator.unauthorized {
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

.auth-indicator.unauthorized .auth-dot {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
}

/* HOST PIN MODAL */
.host-pin-card {
  max-width: 380px !important;
  background: #111827;
  border: 1px solid rgba(0, 242, 254, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 24px rgba(0, 242, 254, 0.15);
}

.pin-icon-wrap {
  width: 56px;
  height: 56px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.host-pin-input {
  width: 100%;
  text-align: center;
  font-family: 'Outfit', monospace;
  font-size: 2rem;
  letter-spacing: 0.35em;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(0, 242, 254, 0.4);
  border-radius: 12px;
  color: #00f2fe;
  outline: none;
  transition: all 0.2s ease;
}

.host-pin-input:focus {
  border-color: #00f2fe;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.35);
}

.pin-error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 10px;
}

/* TOUCH KEYPAD */
.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.key-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 14px 0;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: all 0.12s ease;
}

.key-btn:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: rgba(0, 242, 254, 0.4);
  color: #00f2fe;
}

.key-btn:active {
  transform: scale(0.95);
  background: rgba(0, 242, 254, 0.25);
}

.key-action {
  font-size: 0.95rem;
  color: var(--text-dim);
}

.key-action:hover {
  color: #ffffff;
}

.pin-hint-note {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 16px;
  line-height: 1.4;
}

.pin-hint-note code {
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.08);
  padding: 2px 4px;
  border-radius: 4px;
}

/* ==========================================
   MOBILE RESPONSIVE RULES FOR HOST CONSOLE
   ========================================== */
@media (max-width: 900px) {
  .host-header {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .header-left {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand-badge-group {
    margin-bottom: 0;
    gap: 8px;
  }

  .room-title {
    font-size: 1.25rem;
  }

  .header-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
  }

  .phase-indicator, .timer-indicator {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .timer-indicator strong {
    font-size: 1.05rem;
  }

  .pack-indicator {
    padding: 6px 10px;
    font-size: 0.82rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .autopilot-btn {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .host-main {
    padding: 14px 12px;
  }

  .host-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .control-card, .roster-card {
    padding: 16px;
    border-radius: 16px;
  }

  .cmd-btn {
    padding: 15px 18px;
    font-size: 1.05rem;
    min-height: 52px;
    justify-content: center;
    text-align: center;
  }

  .cheat-sheet-box {
    padding: 14px;
  }

  .cheat-prompt {
    font-size: 1.05rem;
  }

  .roster-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .roster-table {
    min-width: 320px;
  }

  .roster-table th, .roster-table td {
    padding: 10px 8px;
    font-size: 0.85rem;
  }

  .modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 20px 16px !important;
  }
}

