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

/* ── CSS Variables ──────────────────────────────────────────────────────── */
:root {
  --bg-dark:    #080c14;
  --bg-card:    rgba(255,255,255,0.04);
  --bg-card-h:  rgba(255,255,255,0.08);
  --border:     rgba(255,255,255,0.08);
  --border-h:   rgba(255,255,255,0.18);
  --text-1:     #f0f4ff;
  --text-2:     #8b9ab7;
  --text-3:     #4a5568;

  /* Milionario palette */
  --mil-gold:   #f5c518;
  --mil-amber:  #ff8c00;
  --mil-glow:   rgba(245,197,24,0.18);

  /* SuperGolo palette */
  --golo-green: #00e676;
  --golo-teal:  #00bcd4;
  --golo-glow:  rgba(0,230,118,0.18);

  /* UI palette */
  --success:    #22c55e;
  --error:      #ef4444;
  --warning:    #f59e0b;
  --info:       #3b82f6;

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  22px;
  --radius-xl:  32px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:  0 8px 32px rgba(0,0,0,0.45);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.6);

  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);

  /* App Shell – heights used by layout system */
  --nav-h:      64px;    /* top navbar */
  --tab-h:      64px;    /* bottom tab bar (mobile only) */
  --tab-safe:   calc(var(--tab-h) + env(safe-area-inset-bottom));
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  overscroll-behavior: none;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-dark);
  color: var(--text-1);
  min-height: 100dvh; /* dynamic viewport – fixes mobile browser bar */
  overflow-x: hidden;
  /* iOS PWA optimizations */
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Safe area insets for notch / Dynamic Island / Home Indicator */
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  /* Bottom handled per-element to account for tab bar */
}

/* ── Background gradient mesh ───────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 10%, rgba(245,197,24,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 80%, rgba(0,188,212,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(59,130,246,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ── Glass Card ─────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  border-color: var(--border-h);
  box-shadow: var(--shadow-md);
}

/* ── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }

p { line-height: 1.7; color: var(--text-2); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}
.btn:hover::after { background: rgba(255,255,255,0.08); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, #f5c518, #ff8c00);
  color: #000;
  box-shadow: 0 4px 20px rgba(245,197,24,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 30px rgba(245,197,24,0.5); transform: translateY(-1px); }

.btn-green {
  background: linear-gradient(135deg, #00e676, #00bcd4);
  color: #000;
  box-shadow: 0 4px 20px rgba(0,230,118,0.3);
}
.btn-green:hover { box-shadow: 0 6px 30px rgba(0,230,118,0.5); transform: translateY(-1px); }

.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-1);
}
.btn-ghost:hover { border-color: var(--border-h); background: var(--bg-card-h); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 20px rgba(239,68,68,0.3);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}
.btn-sm { padding: 8px 18px; font-size: 0.875rem; }
.btn-lg { padding: 16px 40px; font-size: 1.1rem; }
.btn-full { width: 100%; }

/* ── Form elements ──────────────────────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.input-group input, .input-group select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-1);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-group input:focus, .input-group select:focus {
  border-color: rgba(245,197,24,0.5);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.1);
}
.input-group select option {
  background: var(--bg-dark);
  color: var(--text-1);
}

/* ── Header / Navbar ────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(8,12,20,0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}
.logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #f5c518, #00e676);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  font-size: 0.9rem;
}
.nav-link:hover { color: var(--text-1); background: var(--bg-card-h); }

/* ── Bottom Tab Bar (mobile app navigation) ────────────────────────────── */
.bottom-tab-bar {
  display: none; /* visible only on mobile */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  height: var(--tab-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(8,12,20,0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  flex-direction: row;
  align-items: stretch;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-2);
  font-size: 0.68rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.03em;
  transition: color var(--transition);
  position: relative;
  padding-top: 6px;
  -webkit-tap-highlight-color: transparent;
}
.tab-item:active { transform: scale(0.93); }
.tab-icon {
  font-size: 1.35rem;
  line-height: 1;
  transition: transform var(--transition);
}
.tab-item.active { color: var(--text-1); }
.tab-item.active .tab-icon { transform: scale(1.1); }
/* Active indicator pill */
.tab-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 32px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--mil-gold);
  transition: transform 0.2s ease;
}
.tab-item.active::before { transform: translateX(-50%) scaleX(1); }
.tab-item.tab-green::before { background: var(--golo-green); }

/* ── Badge ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-gold  { background: rgba(245,197,24,0.15); color: #f5c518; border: 1px solid rgba(245,197,24,0.3); }
.badge-green { background: rgba(0,230,118,0.15); color: #00e676; border: 1px solid rgba(0,230,118,0.3); }
.badge-blue  { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.badge-red   { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }

/* ── Alert / Toast ──────────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}
.alert-success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); color: #4ade80; }
.alert-error   { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }
.alert-info    { background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.3); color: #60a5fa; }
.alert-warning { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); color: #fbbf24; }

/* ── Mode Toggle ────────────────────────────────────────────────────────── */
.mode-toggle {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}
.mode-btn {
  flex: 1;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.mode-btn.active {
  background: rgba(255,255,255,0.1);
  color: var(--text-1);
  box-shadow: var(--shadow-sm);
}

/* ── SSE Log ────────────────────────────────────────────────────────────── */
.sse-log {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  height: 300px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sse-log::-webkit-scrollbar { width: 6px; }
.sse-log::-webkit-scrollbar-track { background: transparent; }
.sse-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.log-line { margin-bottom: 4px; animation: fadeUp 0.3s ease; }
.log-line.start    { color: #60a5fa; }
.log-line.question { color: #f0f4ff; }
.log-line.thinking { color: #fbbf24; }
.log-line.correct  { color: #4ade80; }
.log-line.wrong    { color: #f87171; }
.log-line.info     { color: #a78bfa; }
.log-line.end      { color: #f5c518; font-weight: bold; }
.log-line.error    { color: #f87171; }
.log-line.rank     { color: #00e676; }

/* ── Stats Bar ──────────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.stat-item {
  flex: 1;
  min-width: 80px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
}
.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-2);
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Answer Options ─────────────────────────────────────────────────────── */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.option-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: var(--text-1);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.option-btn:hover:not(:disabled) {
  border-color: var(--border-h);
  background: var(--bg-card-h);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.option-btn:disabled { cursor: not-allowed; }
.option-btn.selected  { border-color: rgba(59,130,246,0.6);  background: rgba(59,130,246,0.12); }
.option-btn.correct   { border-color: rgba(34,197,94,0.6);   background: rgba(34,197,94,0.12); }
.option-btn.incorrect { border-color: rgba(239,68,68,0.6);   background: rgba(239,68,68,0.12); }

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* ── Timer ──────────────────────────────────────────────────────────────── */
.timer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}
.timer-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, #00e676, #f5c518, #ef4444);
  border-radius: 3px;
  transition: width 1s linear, background 1s linear;
}

/* ── Question card ──────────────────────────────────────────────────────── */
.question-card {
  padding: 28px;
}
.question-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.5;
}

/* ── Section ────────────────────────────────────────────────────────────── */
.section { padding: 40px 0; }
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

/* ── Divider ────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}

/* ── Loading spinner ────────────────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes pulse   { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes glow    { 0%, 100% { box-shadow: 0 0 20px rgba(245,197,24,0.2); } 50% { box-shadow: 0 0 40px rgba(245,197,24,0.5); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* ── Utility ────────────────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.text-center { text-align: center; }
.flex     { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-4  { gap: 16px; }
.gap-6  { gap: 24px; }
.mt-2   { margin-top: 8px; }
.mt-4   { margin-top: 16px; }
.mt-6   { margin-top: 24px; }
.mb-4   { margin-bottom: 16px; }
.w-full { width: 100%; }

/* ── Game Layout (desktop default – 2 columns) ──────────────────────────── */
.game-layout {
  display: grid;
  gap: 24px;
  padding: 24px 0;
  align-items: start;
}

/* ── Mobile Bottom Sheet (for sidebar stats) ───────────────────────────── */
.stats-sheet {
  display: none; /* only shown on mobile */
}

/* ── Page content bottom padding for tab bar ───────────────────────────── */
.page {
  min-height: 100dvh;
  padding-bottom: 80px; /* generous bottom padding for desktop */
}

/* ──────────────────────────────────────────────────────────────────────── */
/*  PWA STANDALONE adjustments                                              */
/* ──────────────────────────────────────────────────────────────────────── */
@media (display-mode: standalone) {
  .navbar {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--nav-h) + env(safe-area-inset-top));
  }
}

/* ──────────────────────────────────────────────────────────────────────── */
/*  TABLET breakpoint (≤ 900px) – hide desktop sidebar, stack layout       */
/* ──────────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr !important;
  }
  /* Sidebar hidden on tablet – shown as bottom sheet on mobile */
  .sidebar {
    display: none;
  }
}

/* ──────────────────────────────────────────────────────────────────────── */
/*  MOBILE breakpoint (≤ 900px) – full app-like experience                 */
/* ──────────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {

  /* Show bottom tab bar */
  .bottom-tab-bar { display: flex; }

  /* Hide desktop nav links */
  .nav-links { display: none; }

  /* Add extra padding so content is not hidden behind tab bar */
  .page {
    padding-bottom: calc(var(--tab-safe) + 80px) !important;
  }

  /* Compact the container */
  .container { padding: 0 16px; }

  /* ── Options: single column ── */
  .options-grid { grid-template-columns: 1fr; }

  /* ── Bigger touch targets for answer buttons ── */
  .mil-opt, .sg-opt, .option-btn {
    min-height: 56px;
    padding: 16px 14px;
  }

  /* ── Mode toggle stacks ── */
  .mode-toggle { flex-direction: row; } /* keep horizontal on mobile */

  /* ── Stats bar wraps ── */
  .stats-bar { gap: 8px; }
  .stat-item { min-width: 70px; }

  /* ── SSE Log shorter on mobile ── */
  .sse-log { height: 220px; }

  /* ── Auth screen centered with more breathing room ── */
  .auth-screen {
    margin: 24px auto !important;
    padding: 28px 20px !important;
    border-radius: var(--radius-lg) !important;
  }

  /* ── Show mobile bottom stats sheet ── */
  .stats-sheet {
    display: block;
    margin-top: 16px;
  }

  /* ── Stats sheet inner panel ── */
  .stats-sheet-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-2);
    width: 100%;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
  }
  .stats-sheet-toggle:active { transform: scale(0.98); }
  .stats-sheet-toggle.open { color: var(--text-1); border-color: var(--border-h); }
  .stats-sheet-toggle .toggle-arrow {
    transition: transform 0.3s ease;
    font-style: normal;
  }
  .stats-sheet-toggle.open .toggle-arrow { transform: rotate(180deg); }

  .stats-sheet-body {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease, opacity 0.3s ease;
    opacity: 0;
  }
  .stats-sheet-body.open {
    max-height: 600px;
    opacity: 1;
  }
  .stats-sheet-inner {
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* ── Game header on mobile ── */
  .game-header {
    padding: 12px 16px !important;
    margin-bottom: 16px !important;
    border-radius: var(--radius-md) !important;
  }

  /* ── Game mode toggle full width ── */
  .game-mode-toggle {
    gap: 8px;
    margin-bottom: 16px !important;
  }
  .gmt-btn { font-size: 0.85rem; padding: 10px 8px; }

  /* ── Sticky next-question button at bottom ── */
  .next-sticky {
    position: sticky;
    bottom: calc(var(--tab-safe) + 8px);
    z-index: 10;
    padding: 12px 0 4px;
    background: linear-gradient(to top, var(--bg-dark) 70%, transparent);
  }

  /* ── Compact section headers ── */
  h1 { font-size: clamp(1.7rem, 7vw, 2.5rem); }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.1rem; }
}

/* ──────────────────────────────────────────────────────────────────────── */
/*  SMALL PHONE (≤ 400px)                                                   */
/* ──────────────────────────────────────────────────────────────────────── */
@media (max-width: 400px) {
  .gmt-btn { font-size: 0.8rem; gap: 4px; }
  .btn-lg { padding: 14px 24px; font-size: 1rem; }
  .stat-item { padding: 10px 8px; }
}

/* ──────────────────────────────────────────────────────────────────────── */
/*  DESKTOP (> 900px) – restore sidebar                                     */
/* ──────────────────────────────────────────────────────────────────────── */
@media (min-width: 901px) {
  .sidebar { display: block; }
  .stats-sheet { display: none !important; }
  .bottom-tab-bar { display: none !important; }
}

/* ── Disable hover transforms on touch devices ──────────────────────────── */
@media (hover: none) {
  .card:hover { border-color: var(--border); box-shadow: none; }
  .btn:hover::after { background: transparent; }
  .btn-primary:hover { box-shadow: 0 4px 20px rgba(245,197,24,0.3); transform: none; }
  .btn-green:hover { box-shadow: 0 4px 20px rgba(0,230,118,0.3); transform: none; }
  .btn-ghost:hover { border-color: var(--border); background: var(--bg-card); }
  .option-btn:hover:not(:disabled) { border-color: var(--border); background: var(--bg-card); transform: none; box-shadow: none; }
  .game-card:hover { transform: none; }
  .game-card:hover .game-cta-arrow { transform: none; }
}

/* ── Smooth active states for touch ─────────────────────────────────────── */
.btn:active, .mil-opt:active, .sg-opt:active, .option-btn:active {
  transform: scale(0.96);
  transition-duration: 0.08s;
}

/* ── Touch-friendly minimum target sizes ────────────────────────────────── */
.btn, .mil-opt, .sg-opt, .option-btn, .mode-btn, .gmt-btn, .nav-link, .tab-item {
  min-height: 44px;
}

/* ── Offline indicator ──────────────────────────────────────────────────── */
.offline-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(239,68,68,0.97);
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 9999;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.offline-bar.visible { transform: translateY(0); }

/* ── Session loading overlay ────────────────────────────────────────────── */
.session-loading {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.session-loading.fade-out {
  opacity: 0;
  pointer-events: none;
}
