/*
 * Bad Answers Only: V-ChargeNow theme (#85).
 * Tokens and components ported from the V-TriviaNow look (navy + cyan, gold winners)
 * so every V-ChargeNow game feels like one family.
 *
 * Colorblind rule (Vichhay is red/green colorblind): never convey meaning by red vs green alone.
 * Cyan = good / selected / you. Amber/gold = warnings and winners.
 * Destructive actions = danger-outline (outline + label + confirm), not a red fill.
 */
:root {
  --bg-dark: #090d16;
  --bg-tv: #070a13;
  --card-bg: #131b2e;
  --card-bg-2: #1a2440;
  --input-bg: #0b111d;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent-cyan: #00f2fe;
  --accent-cyan-2: #4facfe;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-gold: #f59e0b;
  --accent-gold-soft: #fbbf24;
  --accent-danger: #fb7185;
  --text-white: #ffffff;
  --text-light: #cbd5e1;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --on-cyan: #051429;
  --grad-primary: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --glow-cyan: 0 6px 25px rgba(0, 242, 254, 0.35);
  --glow-cyan-soft: 0 0 16px rgba(0, 242, 254, 0.3);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --font-display: 'Outfit', 'Montserrat', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: dark;
}

/* ---------- Base ---------- */
html { background: var(--bg-dark); }
:where(body.vc-theme) {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 10% 0%, rgba(59, 130, 246, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 90% 100%, rgba(139, 92, 246, 0.14) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-white);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
body.vc-phone {
  margin: 0 auto;
  padding: 0.85rem 1rem 1rem;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
:where(body.vc-theme) h1, :where(body.vc-theme) h2, :where(body.vc-theme) h3 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text-white);
}
:where(body.vc-theme) h2 { font-size: 1.45rem; margin: 0 0 0.85rem; }
:where(body.vc-theme) a { color: var(--accent-cyan); }

/* Small uppercase micro-labels (trivia "ROOM CODE", "PLAYING AS") */
.vc-label, :where(body.vc-theme) label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

/* ---------- Brand lockup ---------- */
.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.15rem 0 0.85rem;
  flex-shrink: 0;
}
.brand-title-wrap { display: inline-flex; align-items: center; gap: 6px; }
.brand-icon { flex-shrink: 0; filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.35)); }
:where(body.vc-theme) .brand-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.15;
  margin: 0;
  color: var(--text-white);
}
.brand-title .text-cyan { color: var(--accent-cyan); }
.brand-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.by-text { color: var(--text-muted); font-size: 0.62rem; letter-spacing: 0.1em; }
.vcharge-brand {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: 'Segoe UI', Roboto, 'Inter', system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.vcharge-gold { color: var(--accent-gold); }
.vcharge-white { color: #f8fafc; }
.brand-venue {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
}

/* ---------- Footer ---------- */
.vc-footer {
  margin-top: auto;
  padding-top: 1rem;
  text-align: center;
  flex-shrink: 0;
}
.vc-promo {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 0.5rem;
}
.vc-promo small { display: block; margin-top: 2px; font-size: 0.72rem; font-weight: 600; color: var(--text-light); }
.vc-legal { font-size: 0.68rem; color: var(--text-muted); line-height: 1.5; }
.vc-legal a { color: var(--accent-cyan); text-decoration: none; }

/* ---------- Cards ---------- */
:where(body.vc-theme) .card, .vc-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

/* ---------- Inputs ---------- */
:where(body.vc-theme) input[type="text"],
:where(body.vc-theme) input[type="password"],
:where(body.vc-theme) input[type="number"],
:where(body.vc-theme) input:not([type]),
:where(body.vc-theme) select {
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  background: var(--input-bg);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-white);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
:where(body.vc-theme) input::placeholder { color: var(--text-muted); font-weight: 500; }
:where(body.vc-theme) input:focus, :where(body.vc-theme) select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.18);
}

/* ---------- Buttons ----------
 * Default <button> and .btn / .btn-primary = cyan gradient CTA.
 * .btn-secondary = ghost pill. .btn-danger = danger-outline (destructive, always paired with a confirm).
 */
:where(body.vc-theme) button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 1.1rem;
  box-sizing: border-box;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  color: var(--on-cyan);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--glow-cyan);
  touch-action: manipulation;
  transition: transform 0.1s ease, filter 0.15s ease, background 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
:where(body.vc-theme) button:hover:not(:disabled), .btn:hover { filter: brightness(1.08); }
:where(body.vc-theme) button:active:not(:disabled), .btn:active { transform: scale(0.97); }
:where(body.vc-theme) button:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
:where(body.vc-theme) button:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}
:where(body.vc-theme) button.btn-secondary, .btn.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-white);
  border: 1.5px solid var(--border-strong);
  box-shadow: none;
}
:where(body.vc-theme) button.btn-secondary:hover:not(:disabled), .btn.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); filter: none; }
:where(body.vc-theme) button.btn-danger, .btn.btn-danger {
  background: transparent;
  color: var(--accent-danger);
  border: 1.5px solid rgba(251, 113, 133, 0.65);
  box-shadow: none;
}
:where(body.vc-theme) button.btn-danger:hover:not(:disabled), .btn.btn-danger:hover { background: rgba(251, 113, 133, 0.1); filter: none; }
:where(body.vc-theme) button.btn-small, .btn.btn-small {
  width: auto;
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  border-radius: var(--radius-pill);
}

/* ---------- Pill badges ---------- */
.pill, :where(body.vc-theme) .badge, :where(body.vc-theme) .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-light);
}
/* good / selected / you = cyan */
.pill-cyan { background: rgba(0, 242, 254, 0.12); border-color: rgba(0, 242, 254, 0.45); color: var(--accent-cyan); }
/* warnings + winners = amber/gold */
.pill-gold { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.55); color: var(--accent-gold-soft); }
.pill-purple { background: rgba(139, 92, 246, 0.16); border-color: rgba(139, 92, 246, 0.5); color: #c4b5fd; }

/* ---------- Alerts ---------- */
:where(body.vc-theme) .alert-error {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-left: 4px solid var(--accent-gold);
  color: #fde68a;
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}
:where(body.vc-theme) .alert-error::before { content: '⚠ '; }

@keyframes vcFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.vc-fade-in { animation: vcFadeIn 0.3s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
