/* ===============================================
   HYDROPUMP - CONSOLIDATED MAIN STYLESHEET
   All core styles in one optimized file
   Version: 2.0
   Generated: 2026-01-18
   
   Contains:
   - Base theme & design tokens (hph-modern.css)
   - Mobile styles (hph-mobile.css)
   - Desktop styles (hph-desktop.css)
   - Floating Action Button (fab.css)
   - Menu/Submenu (menu-submenu.css)
   - Notifications (notifications.css)
   - Pull-to-refresh (pull-to-refresh.css)
   - Game Queue (game-queue.css)
   - Modals (close_game_modal.css)
   =============================================== */

/* ============ FONTS - Single Import ============ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Orbitron:wght@600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

/* ===============================================
   SECTION 1: BASE THEME (hph-modern.css)
   Foundation styles and design system
   =============================================== */
/* ===============================================
   HYDRO PUMP HOLD'EM - COMPLETE UNIFIED THEME
   All styles consolidated into ONE file
   Pokemon Poker Stats & Ledger
   =============================================== */


/* ============ BASE RESET ============ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
}

html {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--text);
  font-weight: 500;
  line-height: 1.6;
  overflow-x: hidden;
  padding-top: 72px; /* Space for fixed topbar */
}

img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4, h5, h6, .brand {
  font-family: 'Orbitron', 'Inter', sans-serif;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

/* ============ DESIGN TOKENS ============ */
:root {
  /* Pokemon Water Theme - Light Mode */
  --bg: #f0f4f8;
  --bg-gradient: linear-gradient(135deg, #e3f2fd 0%, #f0f4f8 50%, #e8eaf6 100%);
  --panel: rgba(255, 255, 255, 0.95);
  --panel-hover: rgba(255, 255, 255, 0.98);
  --glass: rgba(255, 255, 255, 0.75);
  --border: rgba(33, 150, 243, 0.15);
  --border-strong: rgba(33, 150, 243, 0.3);
  
  /* Text */
  --text: #0d1b2a;
  --text-light: #1b263b;
  --muted: #64748b;
  --muted-light: #94a3b8;
  
  /* Pokemon Water Blue - Primary Accent */
  --accent: #2196F3;
  --accent-hover: #1976D2;
  --accent-light: #64B5F6;
  --accent-glow: rgba(33, 150, 243, 0.3);
  --accent-bg: rgba(33, 150, 243, 0.08);
  --accent-contrast: #ffffff;
  
  /* Secondary - Hydro Pump Aqua */
  --secondary: #00BCD4;
  --secondary-hover: #00ACC1;
  --secondary-light: #4DD0E1;
  
  /* Status Colors */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);
  
  /* Shadows & Effects */
  --shadow-sm: 0 2px 8px rgba(33, 150, 243, 0.08);
  --shadow: 0 4px 16px rgba(33, 150, 243, 0.12);
  --shadow-lg: 0 12px 32px rgba(33, 150, 243, 0.2);
  --shadow-xl: 0 20px 48px rgba(33, 150, 243, 0.25);
  --glow: 0 0 20px var(--accent-glow);
  
  /* Spacing & Layout */
  --radius: 20px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --header-h: 72px;
  --sidebar-w: 280px;
  
  /* Backdrop */
  --backdrop-blur: blur(16px);
  --backdrop-saturate: saturate(180%);
  
  /* Logo */
  --logo-opacity: 0.06;
  --logo-blend: multiply;
  
  /* Icon filter */
  --icon-filter: none;
}

/* ============ DARK MODE ============ */
:root.theme-dark {
  /* Dark Ocean Theme */
  --bg: #0a0e1a;
  --bg-gradient: linear-gradient(135deg, #0a0e1a 0%, #0d1321 50%, #11172a 100%);
  --panel: rgba(17, 25, 40, 0.92);
  --panel-hover: rgba(17, 25, 40, 0.98);
  --glass: rgba(17, 25, 40, 0.75);
  --border: rgba(96, 165, 250, 0.15);
  --border-strong: rgba(96, 165, 250, 0.3);
  
  /* Text */
  --text: #e2e8f0;
  --text-light: #cbd5e1;
  --muted: #94a3b8;
  --muted-light: #64748b;
  
  /* Brighter blues for dark mode */
  --accent: #60A5FA;
  --accent-hover: #93C5FD;
  --accent-light: #BFDBFE;
  --accent-glow: rgba(96, 165, 250, 0.4);
  --accent-bg: rgba(96, 165, 250, 0.12);
  --accent-contrast: #0a0e1a;
  
  --secondary: #22D3EE;
  --secondary-hover: #67E8F9;
  --secondary-light: #A5F3FC;
  
  /* Shadows in dark mode */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.6);
  
  --logo-opacity: 0.04;
  --logo-blend: screen;
  
  /* Icon filter */
  --icon-filter: invert(1);
}

/* ============ BACKGROUND ============ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg-gradient);
  z-index: -2;
  pointer-events: none;
}

/* Watermark Logo */
.background-image {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/static/logos/hph_logo.png') center center / 40% no-repeat;
  opacity: var(--logo-opacity);
  mix-blend-mode: var(--logo-blend);
  pointer-events: none;
}

/* ============ LAYOUT UTILITIES ============ */
.page {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  margin-bottom: 48px;
}

/* ============ TOPBAR (FIXED) ============ */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: var(--header-h);
  background: var(--panel);
  border-bottom: 2px solid var(--border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--backdrop-blur) var(--backdrop-saturate);
  z-index: 1030;
}

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

.topbar .brand img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text);
}

.icon-btn:hover {
  background: var(--panel-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.icon-btn img,
.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn img {
  filter: var(--icon-filter);
}

#notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

/* ============ HAMBURGER MENU ============ */
.hamburger {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--glass);
  cursor: pointer;
  transition: all 0.3s ease;
}

.hamburger:hover {
  background: var(--panel-hover);
  border-color: var(--accent);
}

.hb-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ============ NOTIFICATION PANEL ============ */
#notif-panel {
  position: fixed;
  z-index: 10000;
  top: 80px;
  right: 20px;
  width: 420px;
  max-width: calc(100vw - 40px);
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  backdrop-filter: var(--backdrop-blur) var(--backdrop-saturate);
  overflow: hidden;
}

#notif-panel[hidden] {
  display: none;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 2px solid var(--border);
  background: var(--glass);
}

.notif-panel-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

#notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 450px;
  overflow-y: auto;
}

.notif-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
}

.notif-item:hover {
  background: var(--glass);
}

.notif-item.unread {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
}

.notif-item:last-child {
  border-bottom: none;
}

/* ============ PANELS & CARDS ============ */
.panel {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--backdrop-blur) var(--backdrop-saturate);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.panel:hover {
  background: var(--panel-hover);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.panel:hover::before {
  opacity: 1;
}

.card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: var(--backdrop-blur) var(--backdrop-saturate);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

/* Glass effect */
.glass {
  background: var(--glass);
  backdrop-filter: var(--backdrop-blur) var(--backdrop-saturate);
  border: 1px solid var(--border);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  user-select: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--accent-contrast);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn:hover::before {
  opacity: 1;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow), var(--glow);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-hover));
  color: var(--accent-contrast);
  box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 188, 212, 0.4);
}

.btn.ghost, .btn-ghost {
  background: var(--glass);
  color: var(--text);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn.ghost:hover, .btn-ghost:hover {
  background: var(--panel);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 18px 32px;
  font-size: 1.1rem;
}

.icon-btn {
  padding: 10px;
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--glass);
  border: 2px solid var(--border);
  color: var(--text);
  transition: all 0.3s ease;
}

.icon-btn:hover {
  background: var(--panel-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.ico {
  width: 20px;
  height: 20px;
  filter: var(--icon-filter);
}

/* ============ FORMS ============ */
input, textarea, select {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.25s ease;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-bg);
}

input:hover, textarea:hover, select:hover {
  border-color: var(--border-strong);
}

input::placeholder, textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

/* ============ TABLES ============ */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table thead {
  background: var(--glass);
  border-bottom: 2px solid var(--border-strong);
}

.table th {
  padding: 16px 20px;
  text-align: left;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
}

.table tbody tr:hover {
  background: var(--glass);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ============ NOTIFICATION BELL ============ */
#notif-bell {
  position: relative;
  padding: 10px;
  border-radius: 12px;
  background: var(--glass);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
}

#notif-bell:hover {
  background: var(--panel-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}

#notif-bell svg,
.icon-btn svg {
  width: 20px;
  height: 20px;
  color: var(--text);
}

#notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ============ USER PILL ============ */
.user-pill {
  background: var(--glass);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.user-pill:hover {
  background: var(--panel-hover);
  border-color: var(--accent);
}

#user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
}

.user-name {
  color: var(--text);
  font-weight: 600;
}

/* ============ HAMBURGER MENU (Mobile) ============ */
.hamburger {
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.hamburger:hover {
  background: var(--glass);
}

.hb-line {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ============ Z-INDEX HIERARCHY ============ */
/* Topbar: 1030, Sidebar/Menu: 1020, Content: 1 */

.sidebar, .sidepanel, .drawer, .nav-drawer, .menu, .menu-panel, #mobile-menu, #sidebar {
  position: fixed;
  left: 0;
  top: var(--header-h);
  bottom: 0;
  width: 280px;
  max-width: 88vw;
  z-index: 1020;
  background: var(--panel);
  border-right: 2px solid var(--border-strong);
  box-shadow: var(--shadow-xl);
  overflow-y: auto;
  backdrop-filter: var(--backdrop-blur) var(--backdrop-saturate);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.sidebar.open, .menu.open, #mobile-menu.open, #sidebar.open {
  transform: translateX(0);
}

/* Backdrop */
.sidebar-backdrop, .drawer-backdrop, .menu-backdrop {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--header-h);
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1015;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.show, .drawer-backdrop.show, .menu-backdrop.show {
  opacity: 1;
}

/* Ensure content doesn't overlap */
.card, .panel, .content, .page, .sheet, .sheet-content, main {
  position: relative;
  z-index: 1;
}

/* ============ NAVIGATION LIST ============ */
.nav-list {
  list-style: none;
  padding: 20px 16px;
  margin: 0;
}

.nav-list li {
  margin-bottom: 6px;
}

/* UPDATED: include .submenu-toggle */
.nav-list li a,
.nav-list li .submenu-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.25s ease;
}

/* UPDATED: include .submenu-toggle:hover */
.nav-list li a:hover,
.nav-list li .submenu-toggle:hover {
  background: var(--glass);
  color: var(--accent);
}

/* UPDATED: icons in links and submenu buttons */
.nav-list li a .ico,
.nav-list li .submenu-toggle .ico {
  width: 24px;
  height: 24px;
  min-width: 24px;
  flex-shrink: 0;
  opacity: 0.8;
  filter: var(--icon-filter);
}

.nav-list li a:hover .ico,
.nav-list li .submenu-toggle:hover .ico {
  opacity: 1;
  transform: scale(1.1);
}

.nav-list li a.signout {
  color: var(--danger);
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--border);
}

.nav-list li a.signout:hover {
  background: var(--danger-bg);
}

/* ============ MOBILE RESPONSIVE ============ */
@media (max-width: 768px) {
  body {
    padding-top: 60px;
  }
  
  .topbar {
    height: 60px;
    padding: 0 12px;
  }
  
  .topbar .brand {
    font-size: 1rem;
  }
  
  .topbar .brand img {
    height: 32px;
  }
  
  #hph-theme-toggle span.desktop-only {
    display: none;
  }
  
  #hph-theme-toggle {
    padding: 8px;
    width: 40px;
    justify-content: center;
  }
  
  .user-pill {
    display: none;
  }
  
  .user-name {
    display: none;
  }
  
  .page {
    padding: 16px;
  }
  
  .panel, .card {
    padding: 16px;
  }
}

.mobile-only {
  display: none;
}

.desktop-only {
  display: inline;
}

@media (max-width: 767px) {
  .mobile-only {
    display: flex;
  }
  
  .desktop-only {
    display: none;
  }
}

/* ============ UTILITY CLASSES ============ */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--muted);
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.break-words {
  word-break: break-word;
  overflow-wrap: break-word;
}

.w-100 {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ============ STATUS BADGES ============ */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  border: 2px solid;
}

.badge-success {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.badge-info {
  background: var(--info-bg);
  border-color: var(--info);
  color: var(--info);
}

/* ============ FEATURED CARD STYLE ============ */
.featured {
  background: var(--accent-bg);
  border-color: var(--accent);
  position: relative;
}

.featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
}

/* ============ DIVIDER ============ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ============ PENDING SHIPMENTS & TRACKING COMPONENTS ============ */
.ship-card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.ship-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.ship-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--accent-bg);
  color: var(--text);
  border: 2px solid var(--border);
}

.kv {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px 14px;
}

.kv dt {
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.85rem;
  color: var(--muted);
}

.kv dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

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

.hl {
  background: var(--warning-bg);
  border: 2px solid var(--warning);
  border-radius: 8px;
  padding: 6px 10px;
  display: inline-block;
  color: var(--text);
  font-weight: 600;
}

/* ===============================================
   SECTION 2: MOBILE STYLES (hph-mobile.css)
   Mobile-specific overrides and hamburger menu
   =============================================== */
/* ===============================================
   MOBILE ONLY - Hamburger Menu
   Target: max-width: 767px
   =============================================== */

/* Show/Hide Elements */
html.is-mobile .mobile-only {
  display: block !important;
}

html.is-mobile .desktop-only {
  display: none !important;
}

html.is-mobile #desktop-sidebar {
  display: none !important;
}

/* Mobile menu exists on mobile, but hidden off-screen by default */
html.is-mobile #mobile-menu {
  display: block !important;
}

/* Hide mobile menu on desktop completely */
html.is-desktop #mobile-menu {
  display: none !important;
}

/* Hamburger Button */
.hamburger {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 8px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
}

.hamburger:hover {
  background: var(--panel-hover);
  border-color: var(--accent);
}

.hamburger .hb-line {
  display: block;
  width: 22px;
  height: 3px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger[aria-expanded="true"] .hb-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger[aria-expanded="true"] .hb-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger[aria-expanded="true"] .hb-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Menu */
#mobile-menu {
  position: fixed;
  top: 60px; /* Adjusted for mobile topbar height */
  left: 0;
  bottom: 0;
  z-index: 1020;
  width: 300px;
  max-width: 85vw;
  background: var(--panel);
  backdrop-filter: var(--backdrop-blur) var(--backdrop-saturate);
  border-right: 2px solid var(--border-strong);
  box-shadow: var(--shadow-xl);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

#mobile-menu.open {
  transform: translateX(0);
}

#mobile-menu::after {
  content: '';
  position: fixed;
  top: 60px;
  left: 300px;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#mobile-menu.open::after {
  opacity: 1;
  pointer-events: auto;
}

#mobile-menu .nav-list {
  list-style: none;
  padding: 20px 16px;
  margin: 0;
}

#mobile-menu .nav-list li {
  margin-bottom: 6px;
}

/* UPDATED: style links and submenu buttons */
#mobile-menu .nav-list li a,
#mobile-menu .nav-list li .submenu-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.25s ease;
}

/* UPDATED: tap state for both */
#mobile-menu .nav-list li a:active,
#mobile-menu .nav-list li .submenu-toggle:active {
  background: var(--glass);
  color: var(--accent);
}

/* UPDATED: icons in both */
#mobile-menu .nav-list li a .ico,
#mobile-menu .nav-list li .submenu-toggle .ico {
  width: 24px;
  height: 24px;
  min-width: 24px;
  flex-shrink: 0;
  opacity: 0.8;
  filter: var(--icon-filter);
}

#mobile-menu .nav-list li a:active .ico,
#mobile-menu .nav-list li .submenu-toggle:active .ico {
  opacity: 1;
  transform: scale(1.1);
}

#mobile-menu .nav-list li a.signout {
  color: var(--danger);
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--border);
}

#mobile-menu .nav-list li a.signout:active {
  background: var(--danger-bg);
}

/* ===============================================
   SECTION 3: DESKTOP STYLES (hph-desktop.css)
   Desktop sidebar and layout
   =============================================== */
/* ===============================================
   DESKTOP ONLY - Sidebar Layout
   Target: min-width: 768px
   =============================================== */

/* Show/Hide Elements */
html.is-desktop .desktop-only {
  display: block !important;
}

html.is-desktop .mobile-only {
  display: none !important;
}

html.is-desktop #desktop-sidebar {
  display: block !important;
}

html.is-desktop #mobile-menu {
  display: none !important;
}

/* Adjust Body for Sidebar */
html.is-desktop body {
  padding-left: 280px;
  transition: padding-left 0.3s ease;
}

/* Desktop Sidebar */
html.is-desktop #desktop-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: var(--panel);
  border-right: 2px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--backdrop-blur) var(--backdrop-saturate);
  z-index: 1020;
  overflow-y: auto;
  padding-top: 72px; /* Space for topbar */
  transition: transform 0.3s ease;
}

html.is-desktop #desktop-sidebar .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  border-bottom: 2px solid var(--border);
  background: var(--glass);
}

html.is-desktop #desktop-sidebar .logo img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  transition: all 0.3s ease;
}

html.is-desktop #desktop-sidebar .logo:hover img {
  transform: scale(1.05) rotate(5deg);
}

html.is-desktop #desktop-sidebar .nav-list {
  list-style: none;
  padding: 16px 12px;
  margin: 0;
}

html.is-desktop #desktop-sidebar .nav-list li {
  margin-bottom: 4px;
}

/* UPDATED: style links and submenu buttons identically */
html.is-desktop #desktop-sidebar .nav-list li a,
html.is-desktop #desktop-sidebar .nav-list li .submenu-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.25s ease;
}

/* UPDATED: hover state for both */
html.is-desktop #desktop-sidebar .nav-list li a:hover,
html.is-desktop #desktop-sidebar .nav-list li .submenu-toggle:hover {
  background: var(--glass);
  color: var(--accent);
}

/* UPDATED: icons in both */
html.is-desktop #desktop-sidebar .nav-list li a .ico,
html.is-desktop #desktop-sidebar .nav-list li .submenu-toggle .ico {
  width: 24px;
  height: 24px;
  min-width: 24px;
  flex-shrink: 0;
  opacity: 0.8;
  filter: var(--icon-filter);
}

html.is-desktop #desktop-sidebar .nav-list li a:hover .ico,
html.is-desktop #desktop-sidebar .nav-list li .submenu-toggle:hover .ico {
  opacity: 1;
  transform: scale(1.1);
}

html.is-desktop #desktop-sidebar .nav-list li a.signout {
  color: var(--danger);
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--border);
}

html.is-desktop #desktop-sidebar .nav-list li a.signout:hover {
  background: var(--danger-bg);
}

/* Scrollbar Styling */
html.is-desktop #desktop-sidebar::-webkit-scrollbar {
  width: 6px;
}

html.is-desktop #desktop-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

html.is-desktop #desktop-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

html.is-desktop #desktop-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ===============================================
   SIDEBAR TOGGLE FUNCTIONALITY
   =============================================== */

/* Collapsed Sidebar State */
html.is-desktop #desktop-sidebar.collapsed {
  transform: translateX(-280px);
}

/* Collapsed Body State */
html.is-desktop body.sidebar-collapsed {
  padding-left: 0;
}

/* Toggle Button */
#desktop-sidebar-toggle {
  position: fixed;
  top: 15px;
  left: 20px;
  z-index: 1030;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: var(--backdrop-blur);
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

#desktop-sidebar-toggle:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  transform: scale(1.05);
  box-shadow: var(--shadow-lg), 0 0 20px var(--accent-glow);
}

#desktop-sidebar-toggle:active {
  transform: scale(0.95);
}

#desktop-sidebar-toggle svg {
  transition: transform 0.3s ease;
  stroke: var(--text);
}

/* Rotate icon when sidebar is collapsed */
body.sidebar-collapsed #desktop-sidebar-toggle svg {
  transform: rotate(180deg);
}

/* ===============================================
   SECTION 4: FLOATING ACTION BUTTON (fab.css)
   FAB component styles
   =============================================== */
/* Floating Action Button (FAB) Styles */
:root {
  --fab-primary: #2ea6ff;
  --fab-primary-hover: #1e90ff;
  --fab-danger: #ef4444;
  --fab-danger-hover: #dc2626;
  --fab-success: #10b981;
  --fab-success-hover: #059669;
  --fab-bg: rgba(17, 17, 17, 0.98);
  --fab-border: rgba(255, 255, 255, 0.1);
  --fab-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --fab-text: #ffffff;
  --fab-text-muted: rgba(255, 255, 255, 0.7);
}

:root:not(.theme-dark) {
  --fab-bg: rgba(255, 255, 255, 0.98);
  --fab-border: rgba(0, 0, 0, 0.1);
  --fab-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  --fab-text: #1f2937;
  --fab-text-muted: #6b7280;
}

/* Main FAB Button */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}

.fab-main-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b00, #ff8c00, #ffa500);
  border: none;
  box-shadow: 0 4px 20px rgba(255, 107, 0, 0.5), 0 0 20px rgba(255, 140, 0, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  animation: neon-pulse 2s ease-in-out infinite;
}

.fab-main-btn:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, #ff8c00, #ffa500, #ffb732);
  box-shadow: 0 6px 30px rgba(255, 107, 0, 0.7), 0 0 30px rgba(255, 140, 0, 0.5);
}

.fab-main-btn.active {
  transform: rotate(45deg);
  background: linear-gradient(135deg, #ff6b00, #ff8c00, #ffa500);
  box-shadow: 0 6px 30px rgba(255, 107, 0, 0.8), 0 0 40px rgba(255, 140, 0, 0.6);
}

.fab-main-btn svg {
  width: 24px;
  height: 24px;
  color: white;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Balance Badge */
.fab-balance-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--fab-success);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  min-width: 45px;
  text-align: center;
}

/* FAB Menu */
.fab-menu {
  position: absolute;
  bottom: 75px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;  /* Allow items to show fully */
  min-width: 200px;  /* Ensure minimum menu width */
  pointer-events: none;  /* CRITICAL: Disable clicks when hidden! */
}

.fab-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;  /* Enable clicks when visible */
}

.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--fab-bg);
  border: 1px solid var(--fab-border);
  border-radius: 28px;
  padding: 12px 20px 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: var(--fab-shadow);
  backdrop-filter: blur(10px);
  text-decoration: none;
  color: var(--fab-text);
  overflow: visible;  /* Allow text to show */
  min-width: 180px;  /* Ensure minimum width */
}

.fab-menu-item:hover {
  transform: translateX(-4px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
  background: var(--glass);
}

.fab-menu-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fab-menu-item-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.fab-menu-item-icon.primary {
  background: var(--fab-primary);
}

.fab-menu-item-icon.danger {
  background: var(--fab-danger);
}

.fab-menu-item-icon.success {
  background: var(--fab-success);
}

.fab-menu-item-icon.warning {
  background: #f59e0b;
}

.fab-menu-item:hover .fab-menu-item-icon.primary {
  background: var(--fab-primary-hover);
}

.fab-menu-item:hover .fab-menu-item-icon.danger {
  background: var(--fab-danger-hover);
}

.fab-menu-item:hover .fab-menu-item-icon.success {
  background: var(--fab-success-hover);
}

.fab-menu-item-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.fab-menu-item-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--fab-text);
}

.fab-menu-item-subtitle {
  font-size: 12px;
  color: var(--fab-text-muted);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  /* Mobile FAB - Optimized for touch */
  .fab-container {
    bottom: 20px;
    right: 20px;
    z-index: 9999;
  }
  
  .fab-main-btn {
    width: 60px;
    height: 60px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  
  /* Larger touch target */
  .fab-main-btn::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
  }
  
  .fab-menu {
    bottom: 80px;
    right: 20px;  /* Give it space from edge */
    max-width: calc(100vw - 100px);  /* Ensure it fits on screen */
    min-width: 250px;  /* Ensure minimum width for text */
    width: auto;  /* Allow it to size based on content */
  }
  
  /* Larger touch targets for menu items */
  .fab-menu-item {
    padding: 14px 20px 14px 16px;
    min-height: 56px;
    display: flex;
    align-items: center;
    white-space: normal !important;  /* Allow text to wrap! */
    min-width: 220px !important;  /* Ensure menu items are wide enough */
    width: 100%;  /* Fill the menu width */
    overflow: visible !important;  /* Don't cut off text */
  }
  
  /* Force visible text on tablets in light mode */
  :root:not(.theme-dark) .fab-menu-item {
    background: rgba(255, 255, 255, 0.98) !important;
    color: #000000 !important;
  }
  
  :root:not(.theme-dark) .fab-menu-item-title {
    color: #000000 !important;  /* Pure black */
    font-weight: 700 !important;
    text-shadow: none !important;
  }
  
  :root:not(.theme-dark) .fab-menu-item-subtitle {
    color: #374151 !important;  /* Darker gray */
    text-shadow: none !important;
  }
  
  /* Force visible text on tablets in dark mode */
  :root.theme-dark .fab-menu-item {
    background: rgba(17, 25, 40, 0.98) !important;
    color: #ffffff !important;
  }
  
  :root.theme-dark .fab-menu-item-title {
    color: #ffffff !important;  /* Pure white! */
    font-weight: 700 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
  }
  
  :root.theme-dark .fab-menu-item-subtitle {
    color: #e5e7eb !important;  /* Very light gray */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
  }
  
  .fab-menu-item-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
  
  .fab-menu-item-text {
    flex: 1;
    margin-left: 12px;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    min-width: 120px;
    max-width: 200px;
  }
  
  .fab-menu-item-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    display: block !important;
    visibility: visible !important;
    width: 100%;
  }
  
  .fab-menu-item-subtitle {
    font-size: 12px;
    margin-top: 2px;
    line-height: 1.3;
    display: block !important;
    visibility: visible !important;
    width: 100%;
  }
  
  .fab-balance-badge {
    font-size: 11px;
    padding: 4px 8px;
    min-width: 44px;
    font-weight: 700;
  }
  
  /* Better backdrop on mobile */
  .fab-backdrop.active {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
  }
}

/* Animation delays for menu items */
.fab-menu.active .fab-menu-item:nth-child(1) {
  transition-delay: 0.05s;
}

.fab-menu.active .fab-menu-item:nth-child(2) {
  transition-delay: 0.1s;
}

.fab-menu.active .fab-menu-item:nth-child(3) {
  transition-delay: 0.15s;
}

.fab-menu.active .fab-menu-item:nth-child(4) {
  transition-delay: 0.2s;
}

.fab-menu.active .fab-menu-item:nth-child(5) {
  transition-delay: 0.25s;
}

.fab-menu.active .fab-menu-item:nth-child(6) {
  transition-delay: 0.3s;
}

/* Backdrop when FAB menu is open */
.fab-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;  /* CRITICAL: Disable clicks when hidden! */
}

.fab-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;  /* Enable clicks when visible */
}

/* Extra small screens (phones in portrait) - Full width menu */
@media (max-width: 480px) {
  .fab-menu {
    right: 20px;
    left: auto;  /* Don't constrain from left */
    width: auto;
    max-width: calc(100vw - 100px);  /* Leave space for FAB button */
    min-width: 250px !important;  /* Ensure minimum width */
  }
  
  .fab-menu-item {
    padding: 16px 20px;
    min-height: 60px;
    background: rgba(255, 255, 255, 0.98) !important;
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
    white-space: normal !important;  /* Allow text to wrap! */
    position: relative !important;
    z-index: 10000 !important;  /* Make sure text is on top */
    min-width: 240px !important;  /* Ensure items are wide enough */
    width: 100%;  /* Fill menu width */
    overflow: visible !important;  /* Don't cut off text */
    justify-content: flex-start !important;  /* Align items to start */
  }
  
  /* Force visible text in light mode */
  :root:not(.theme-dark) .fab-menu-item {
    background: rgba(255, 255, 255, 0.98) !important;
    color: #1f2937 !important;
  }
  
  :root:not(.theme-dark) .fab-menu-item-title {
    color: #000000 !important;  /* Pure black */
    font-weight: 700 !important;
    text-shadow: none !important;
  }
  
  :root:not(.theme-dark) .fab-menu-item-subtitle {
    color: #374151 !important;  /* Darker gray */
    text-shadow: none !important;
  }
  
  /* Force visible text in dark mode */
  :root.theme-dark .fab-menu-item {
    background: rgba(17, 25, 40, 0.98) !important;
    color: #ffffff !important;
  }
  
  :root.theme-dark .fab-menu-item-title {
    color: #ffffff !important;  /* Pure white! */
    font-weight: 700 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;  /* Add shadow for contrast */
  }
  
  :root.theme-dark .fab-menu-item-subtitle {
    color: #e5e7eb !important;  /* Very light gray */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
  }
  
  .fab-menu-item-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    display: block !important;
    visibility: visible !important;
    width: 100%;
    position: relative !important;
    z-index: 10001 !important;
  }
  
  .fab-menu-item-subtitle {
    font-size: 13px;
    line-height: 1.3;
    margin-top: 2px;
    display: block !important;
    visibility: visible !important;
    width: 100%;
    position: relative !important;
    z-index: 10001 !important;
  }
  
  .fab-menu-item-text {
    flex: 1;
    min-width: 150px;
    max-width: calc(100vw - 180px);
    display: flex !important;
    flex-direction: column !important;
    margin-left: 12px;
    position: relative !important;
    z-index: 10001 !important;
  }
  
  .fab-container {
    bottom: 16px;
    right: 16px;
  }
}

/* Landscape phones - Smaller FAB */
@media (max-width: 768px) and (max-height: 480px) {
  .fab-container {
    bottom: 12px;
    right: 12px;
  }
  
  .fab-main-btn {
    width: 52px;
    height: 52px;
  }
  
  .fab-menu {
    bottom: 68px;
  }
  
  .fab-menu-item {
    padding: 10px 16px;
    min-height: 48px;
  }
}

/* ===============================================
   SECTION 5: MENU & SUBMENU (menu-submenu.css)
   Hierarchical navigation system
   =============================================== */
/* ===============================================
   SUBMENU STYLES - Desktop & Mobile
   Hierarchical menu system with expand/collapse
   =============================================== */

/* Base submenu styles */
.has-submenu {
  position: relative;
}

.submenu-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
}

.submenu-toggle:hover {
  background: var(--glass);
  color: var(--accent);
}

.submenu-toggle .ico {
  width: 24px;
  height: 24px;
  min-width: 24px;
  flex-shrink: 0;
  opacity: 0.8;
  filter: var(--icon-filter);
}

.submenu-toggle:hover .ico {
  opacity: 1;
  transform: scale(1.1);
}

.submenu-toggle .chevron {
  margin-left: auto;
  transition: transform 0.3s ease;
  opacity: 0.7;
}

.submenu-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

/* Submenu container */
.submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.has-submenu.expanded .submenu {
  max-height: 1000px; /* Large enough for content */
  opacity: 1;
}

/* First level submenu items */
.submenu > li {
  margin: 0;
  padding-left: 16px;
}

.submenu > li > a,
.submenu > li > button.submenu-toggle {
  padding: 12px 16px;
  font-size: 0.95em;
  font-weight: 500;
}

/* Second level submenu (Database) */
.submenu .has-submenu {
  margin-top: 4px;
}

.submenu .has-submenu .submenu-toggle {
  padding: 10px 14px;
  font-size: 0.9em;
}

.submenu .has-submenu .submenu-toggle .ico {
  width: 20px;
  height: 20px;
  min-width: 20px;
}

.submenu .has-submenu .submenu-toggle .chevron {
  width: 14px;
  height: 14px;
}

/* Third level submenu items (Database tables) */
.submenu .submenu {
  padding-left: 12px;
  background: var(--panel-darker, rgba(0, 0, 0, 0.2));
  border-left: 2px solid var(--border);
  margin-left: 8px;
  margin-top: 4px;
  border-radius: 8px;
}

.submenu .submenu > li {
  padding-left: 8px;
}

.submenu .submenu > li > a {
  padding: 10px 12px;
  font-size: 0.85em;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 10px;
}

.submenu .submenu > li > a:hover {
  background: var(--glass);
  color: var(--accent);
  padding-left: 16px;
}

/* Active state for current page */
.submenu a.active,
.submenu .submenu a.active {
  background: var(--accent-bg, rgba(59, 130, 246, 0.1));
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}

/* Desktop specific adjustments */
html.is-desktop .nav-list .has-submenu {
  margin-bottom: 8px;
}

html.is-desktop .submenu {
  margin-top: 4px;
  padding: 4px 0;
}

/* Mobile specific adjustments */
html.is-mobile #mobile-menu .has-submenu {
  margin-bottom: 6px;
}

html.is-mobile #mobile-menu .submenu {
  margin-top: 4px;
  padding: 6px 0;
}

/* Animation for smooth expand/collapse */
@keyframes expandMenu {
  from {
    max-height: 0;
    opacity: 0;
  }
  to {
    max-height: 1000px;
    opacity: 1;
  }
}

@keyframes collapseMenu {
  from {
    max-height: 1000px;
    opacity: 1;
  }
  to {
    max-height: 0;
    opacity: 0;
  }
}

/* Ensure proper z-index stacking */
.has-submenu {
  z-index: 1;
}

.has-submenu.expanded {
  z-index: 2;
}

/* Improve touch targets on mobile */
@media (max-width: 767px) {
  .submenu-toggle {
    min-height: 48px;
  }
  
  .submenu a {
    min-height: 44px;
  }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .submenu .submenu {
    background: rgba(0, 0, 0, 0.4);
  }
}

/* Light mode adjustments */
@media (prefers-color-scheme: light) {
  .submenu .submenu {
    background: rgba(0, 0, 0, 0.05);
  }
}

/* ===============================================
   SECTION 6: NOTIFICATIONS (notifications.css)
   Notification system styles
   =============================================== */
/* Notification Bell & Inbox Styles */

/* Bell Icon & Badge */
#notif-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
}

#notif-bell:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

#notif-bell svg {
  width: 22px;
  height: 22px;
  color: var(--text-secondary, #d1d5db);
}

#notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  animation: badge-pop 0.3s ease;
}

@keyframes badge-pop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes neon-pulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(255, 107, 0, 0.5), 0 0 20px rgba(255, 140, 0, 0.3);
  }
  50% {
    box-shadow: 0 4px 25px rgba(255, 107, 0, 0.7), 0 0 30px rgba(255, 140, 0, 0.5);
  }
}

/* Notification Panel (Dropdown) */
#notif-panel {
  position: fixed;
  background: rgba(18, 18, 18, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  overflow: hidden;
  z-index: 9999;
  max-width: 400px;
  min-height: 200px;
  animation: panel-slide-in 0.3s ease;
  color: #f3f4f6; /* CRITICAL: Force light text color */
}

@keyframes panel-slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#notif-panel[hidden] {
  display: none;
}

/* Panel Header */
#notif-panel > div:first-child {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

#notif-panel strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #f3f4f6);
}

/* Panel Buttons */
#notif-markall,
#notif-more {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--text-secondary, #d1d5db);
  cursor: pointer;
  transition: all 0.2s ease;
}

#notif-markall:hover,
#notif-more:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Notification List */
#notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 400px;
  overflow-y: auto;
}

#notif-list::-webkit-scrollbar {
  width: 6px;
}

#notif-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

#notif-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

#notif-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Notification Item */
.notif-item {
  display: block; /* CRITICAL: Override list-item default */
  position: relative;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.2s ease;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.notif-item.unread {
  background: rgba(59, 130, 246, 0.08);
}

.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #3b82f6;
}

/* Notification Header */
.notif-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 12px;
}

.notif-header strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #f3f4f6);
  flex: 1;
  line-height: 1.4;
}

.notif-time {
  font-size: 0.8rem;
  color: var(--text-tertiary, #9ca3af);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Notification Body */
.notif-body {
  font-size: 0.9rem;
  color: var(--text-secondary, #d1d5db);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Unread Dot */
.unread-dot {
  position: absolute;
  right: 16px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Empty State */
#notif-list li[style*="padding:20px"] {
  color: var(--text-tertiary, #9ca3af);
  text-align: center;
}

/* Inbox Modal */
#inbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modal-fade-in 0.3s ease;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#inbox-modal[hidden] {
  display: none;
}

.inbox-modal-content {
  background: rgba(18, 18, 18, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: modal-slide-up 0.3s ease;
}

@keyframes modal-slide-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Inbox Header */
.inbox-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.inbox-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #f3f4f6);
}

.inbox-header .actions {
  display: flex;
  gap: 8px;
}

.inbox-header button {
  padding: 8px 14px;
  font-size: 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--text-secondary, #d1d5db);
  cursor: pointer;
  transition: all 0.2s ease;
}

.inbox-header button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

#btn-close {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

#btn-close:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Inbox List */
#inbox-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

#inbox-list::-webkit-scrollbar {
  width: 8px;
}

#inbox-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

#inbox-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

#inbox-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Inbox Item */
.inbox-item {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 8px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.inbox-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.inbox-item.unread {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid #3b82f6;
}

.inbox-item-content {
  flex: 1;
  padding: 14px 16px;
  cursor: pointer;
  position: relative;
}

.inbox-item-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 12px;
}

.inbox-item-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #f3f4f6);
  flex: 1;
  line-height: 1.4;
}

.inbox-item-time {
  font-size: 0.85rem;
  color: var(--text-tertiary, #9ca3af);
  white-space: nowrap;
}

.inbox-item-body {
  font-size: 0.95rem;
  color: var(--text-secondary, #d1d5db);
  line-height: 1.6;
}

.unread-indicator {
  position: absolute;
  right: 16px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Inbox Item Actions */
.inbox-item-actions {
  display: flex;
  align-items: center;
  padding: 0 8px;
}

.btn-dismiss {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-tertiary, #9ca3af);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-dismiss:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #notif-panel {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
  }

  .inbox-modal-content {
    max-height: 95vh;
  }

  .inbox-header {
    padding: 16px;
  }

  .inbox-header h3 {
    font-size: 1.1rem;
  }

  .inbox-header .actions {
    flex-direction: column;
  }

  .inbox-header button {
    font-size: 0.85rem;
    padding: 6px 12px;
  }

  .inbox-item-title {
    font-size: 0.95rem;
  }

  .inbox-item-body {
    font-size: 0.9rem;
  }
}

/* Dark Mode Support (default) */
:root {
  --text-primary: #f3f4f6;
  --text-secondary: #d1d5db;
  --text-tertiary: #9ca3af;
  --bg-primary: rgba(18, 18, 18, 0.98);
  --bg-secondary: rgba(255, 255, 255, 0.03);
  --border-primary: rgba(255, 255, 255, 0.12);
  --border-secondary: rgba(255, 255, 255, 0.08);
}

/* Light Mode (if needed) */
[data-theme="light"] {
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-tertiary: #6b7280;
  --bg-primary: rgba(255, 255, 255, 0.98);
  --bg-secondary: rgba(0, 0, 0, 0.03);
  --border-primary: rgba(0, 0, 0, 0.12);
  --border-secondary: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] #notif-bell {
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] #notif-bell:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] #notif-panel {
  background: var(--bg-primary);
  border-color: var(--border-primary);
}

[data-theme="light"] .inbox-item {
  background: var(--bg-secondary);
  border-color: var(--border-secondary);
}

/* ===============================================
   SECTION 7: PULL TO REFRESH (pull-to-refresh.css)
   Mobile pull-to-refresh feature
   =============================================== */
/**
 * Pull-to-Refresh Styles
 * Mobile-first responsive design
 */

#ptr-indicator {
  position: fixed;
  top: -100px;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  padding: 20px;
}

.ptr-spinner {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.ptr-icon {
  width: 100%;
  height: 100%;
  stroke: var(--accent, #2196F3);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.ptr-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #333);
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: color 0.2s ease;
}

/* Ready state - when pulled enough to trigger */
#ptr-indicator.ptr-ready .ptr-text {
  color: var(--accent, #2196F3);
}

#ptr-indicator.ptr-ready .ptr-icon {
  stroke: var(--accent, #2196F3);
  filter: drop-shadow(0 2px 8px rgba(33, 150, 243, 0.3));
}

/* Refreshing state - spinning animation */
#ptr-indicator.ptr-refreshing .ptr-spinner {
  animation: ptr-spin 1s linear infinite;
}

#ptr-indicator.ptr-refreshing .ptr-icon {
  stroke: var(--accent, #2196F3);
  filter: drop-shadow(0 2px 8px rgba(33, 150, 243, 0.4));
}

#ptr-indicator.ptr-refreshing .ptr-text {
  color: var(--accent, #2196F3);
}

/* Spinning animation */
@keyframes ptr-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Pulse animation for text */
@keyframes ptr-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

#ptr-indicator.ptr-refreshing .ptr-text {
  animation: ptr-pulse 1.5s ease-in-out infinite;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .ptr-text {
    color: var(--text, #e5e7eb);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
  
  .ptr-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  }
  
  #ptr-indicator.ptr-ready .ptr-icon,
  #ptr-indicator.ptr-refreshing .ptr-icon {
    filter: drop-shadow(0 2px 8px rgba(33, 150, 243, 0.5));
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .ptr-icon {
    stroke-width: 3;
  }
  
  .ptr-text {
    font-weight: 700;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  #ptr-indicator,
  .ptr-spinner,
  .ptr-text {
    transition: none;
  }
  
  @keyframes ptr-spin {
    0%, 100% {
      transform: rotate(0deg);
    }
  }
  
  #ptr-indicator.ptr-refreshing .ptr-text {
    animation: none;
  }
}

/* Mobile-specific adjustments */
@media (max-width: 767px) {
  #ptr-indicator {
    height: 70px;
    padding: 15px;
  }
  
  .ptr-spinner {
    width: 36px;
    height: 36px;
  }
  
  .ptr-text {
    font-size: 13px;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  #ptr-indicator {
    height: 60px;
    padding: 10px;
  }
  
  .ptr-spinner {
    width: 32px;
    height: 32px;
  }
  
  .ptr-text {
    font-size: 12px;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 767px) and (orientation: landscape) {
  #ptr-indicator {
    height: 60px;
    padding: 10px;
    gap: 6px;
  }
  
  .ptr-spinner {
    width: 32px;
    height: 32px;
  }
  
  .ptr-text {
    font-size: 12px;
  }
}

/* iPad and tablet sizes */
@media (min-width: 768px) and (max-width: 1024px) and (pointer: coarse) {
  #ptr-indicator {
    height: 80px;
    padding: 20px;
  }
  
  .ptr-spinner {
    width: 44px;
    height: 44px;
  }
  
  .ptr-text {
    font-size: 15px;
  }
}

/* ===============================================
   SECTION 8: GAME QUEUE (game-queue.css)
   Game queue page styles
   =============================================== */

/* ============================================================
   OPTIMIZED GAME QUEUE CSS v4.1
   Maintains existing design + adds performance optimizations
   ============================================================ */

/* Game Queue uses site's theme variables from hph-modern.css */
.page-container,
.games-grid,
.stat-card,
.search-box,
.filter-select,
.sort-select,
.game-card,
.modal {
  --primary: var(--secondary, #00BCD4);
  --primary-2: var(--accent, #2196F3);
  --panel-2: var(--glass);
  --border-2: var(--border-strong);
  --radius: 14px;
  --radius-sm: 10px;
  --transition: 180ms ease;
}

/* Enhanced opacity for cards in both themes */
:root:not(.theme-dark) .stat-card,
:root:not(.theme-dark) .game-card {
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

:root.theme-dark .stat-card,
:root.theme-dark .game-card {
  background: rgba(17, 25, 40, 0.90) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

/* FIX 1: CLEAR THE TOPBAR */
.page-container {
  margin-top: 80px !important;
  padding: 30px 50px 40px 30px !important;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 767px) {
  .page-container {
    margin-top: 60px !important;
    padding: 20px 20px 100px 20px !important;
  }
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0 0 8px 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

/* STATS */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.stat-card--avg {
  background: var(--accent-bg);
}

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card--avg .stat-value {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* CONTROLS */
.controls-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-box input {
  width: 100%;
  padding: 12px 42px 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.12);
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1.2rem;
}

.search-clear:hover {
  background: var(--panel-2);
  color: var(--text);
}

.filter-sort-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  .filter-sort-row {
    width: 100%;
  }
  
  .filter-sort-row > * {
    flex: 1;
    min-width: 120px;
  }
}

.filter-select,
.sort-select {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Enhanced input/select visibility */
:root:not(.theme-dark) .filter-select,
:root:not(.theme-dark) .sort-select,
:root:not(.theme-dark) .search-box input {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(0, 0, 0, 0.15);
}

:root.theme-dark .filter-select,
:root.theme-dark .sort-select,
:root.theme-dark .search-box input {
  background: rgba(17, 25, 40, 0.95) !important;
  border-color: rgba(96, 165, 250, 0.25);
}

.filter-select:hover,
.sort-select:hover {
  border-color: var(--accent);
}

.btn {
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  border-color: transparent;
  color: white;
}

.btn.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: transparent;
  color: white;
}

.spinning {
  display: inline-block;
  animation: spin 0.6s linear;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============ OPTIMIZED: SKELETON LOADERS ============ */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

@media (max-width: 767px) {
  .skeleton-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.skeleton-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 420px;
}

.skeleton-image,
.skeleton-content,
.skeleton-line,
.skeleton-thumb {
  background: linear-gradient(
    90deg,
    var(--panel) 0%,
    var(--panel-2) 50%,
    var(--panel) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-image {
  width: 100%;
  height: 180px;
}

.skeleton-content {
  padding: 14px;
}

.skeleton-line {
  height: 16px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.skeleton-line.short {
  width: 60%;
}

.skeleton-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  margin-right: 8px;
  display: inline-block;
}

/* LOADING STATE */
.loading-container {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 20px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--text);
}

/* GAMES GRID */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
  container-type: inline-size;
}

@media (max-width: 767px) {
  .games-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 80px;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  animation: slideUp 0.4s ease-out backwards;
  cursor: pointer;
}

.game-card:nth-child(1) { animation-delay: 0.05s; }
.game-card:nth-child(2) { animation-delay: 0.1s; }
.game-card:nth-child(3) { animation-delay: 0.15s; }
.game-card:nth-child(4) { animation-delay: 0.2s; }
.game-card:nth-child(5) { animation-delay: 0.25s; }
.game-card:nth-child(6) { animation-delay: 0.3s; }
.game-card:nth-child(7) { animation-delay: 0.35s; }
.game-card:nth-child(8) { animation-delay: 0.4s; }
.game-card:nth-child(9) { animation-delay: 0.45s; }
.game-card:nth-child(10) { animation-delay: 0.5s; }
.game-card:nth-child(11) { animation-delay: 0.55s; }
.game-card:nth-child(12) { animation-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
  .game-card { animation: none; }
}

.game-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, rgba(0, 188, 212, 0.3), rgba(33, 150, 243, 0.3), rgba(139, 92, 246, 0.3), rgba(0, 188, 212, 0.3));
  background-size: 300% 300%;
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  animation: gradientFlow 4s ease infinite;
  filter: blur(8px);
}

@keyframes gradientFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.game-card:hover::before {
  opacity: 1;
}

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 188, 212, 0.25);
  z-index: 10;
}

/* ============ OPTIMIZED: LAZY LOADING IMAGES ============ */
.card-image-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  background: var(--panel);
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease, transform 0.4s ease;
  opacity: 0;
}

.card-image.loaded {
  opacity: 1;
}

.card-image.error {
  opacity: 0.3;
}

.game-card:hover .card-image.loaded {
  transform: scale(1.05);
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 3rem;
  opacity: 0.3;
  pointer-events: none;
}

/* 5-TIER SYSTEM */
.tier-badge {
  position: absolute;
  bottom: 48px;
  left: 0;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 900;
  border-radius: 0 10px 0 0;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  letter-spacing: 0.05em;
  z-index: 2;
  backdrop-filter: blur(10px);
}

.tier-badge.tier-hot {
  background: linear-gradient(135deg, #ef4444, #f97316);
  animation: tierPulse 2s ease-in-out infinite;
}

.tier-badge.tier-rare {
  background: linear-gradient(135deg, #10b981, #14b8a6);
}

.tier-badge.tier-epic {
  background: linear-gradient(135deg, #f59e0b, #eab308);
  animation: tierPulse 2s ease-in-out infinite;
}

.tier-badge.tier-legendary {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  animation: tierPulse 1.5s ease-in-out infinite;
}

.tier-badge.tier-black-label {
  background: linear-gradient(135deg, #000000, #1a1a1a);
  border: 2px solid #fbbf24;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 30px rgba(251, 191, 36, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: blackLabelPulse 2s ease-in-out infinite;
}

@keyframes tierPulse {
  0%, 100% { 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 0 currentColor, inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  50% { 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px currentColor, inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

@keyframes blackLabelPulse {
  0%, 100% { 
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 20px rgba(251, 191, 36, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  50% { 
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 40px rgba(251, 191, 36, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
}

/* CARD CONTENT */
.card-top {
  padding: 14px;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.game-number {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255,255,255,0.04);
}

.badge.listed {
  border-color: rgba(16,185,129,0.40);
  color: #10b981;
  background: rgba(16,185,129,0.15);
}

.badge.unlisted {
  border-color: rgba(148,163,184,0.40);
  color: #94a3b8;
  background: rgba(148,163,184,0.10);
}

.host-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.host-name,
.game-card-host {
  font-weight: 900 !important;
  font-size: 1.125rem !important;
  color: var(--text) !important;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 12px;
}

.value-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.value-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.prize-summary {
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
}

.prize-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.prize-lines {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.prize-more {
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
}

/* Card Admin Actions - Positioned in Card Body */
.card-admin-actions-body {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-admin-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  font-weight: 700;
  padding: 0;
}

.card-admin-btn:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.card-admin-btn.toggle-btn.listed {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #10b981;
}

.card-admin-btn.toggle-btn.unlisted {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: #ef4444;
}

.card-admin-btn.edit-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-color: #6366f1;
}

.card-admin-btn.delete-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: #ef4444;
}

.card-admin-btn:active {
  transform: scale(0.95);
}

@media (max-width: 767px) {
  .card-admin-actions-body {
    gap: 0.375rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
  }
  
  .card-admin-btn {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .card-admin-btn {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
    border-width: 1.5px;
  }
}

.thumb-strip {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.thumb-mini {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.06);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.thumb-mini:hover {
  transform: scale(1.1);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 188, 212, 0.3);
}

.thumb-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-mini.empty {
  background: rgba(0,0,0,0.02);
  cursor: default;
}

.thumb-mini.empty:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.btn-card {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-card:hover {
  border-color: var(--accent);
  background: var(--panel-2);
  transform: translateY(-2px);
}

/* PAGINATION */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 30px 0;
  padding: 20px;
}

.page-info {
  font-weight: 900;
  font-size: 0.95rem;
}

/* MODALS */
dialog {
  max-width: 560px;
  width: calc(100% - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

dialog::backdrop {
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 900;
}

.btn-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-close:hover {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
  transform: scale(1.1);
}

.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;  /* CRITICAL: iOS smooth scrolling */
  overscroll-behavior: contain;  /* Prevent scroll chaining */
  touch-action: pan-y;  /* Allow vertical scrolling only */
}

/* Mobile-specific modal body improvements */
@media (max-width: 768px) {
  .modal-body {
    max-height: 60vh;  /* More space on mobile */
    padding: 16px;
    -webkit-overflow-scrolling: touch;  /* iOS momentum scrolling */
    overscroll-behavior-y: contain;  /* Prevent body scroll */
    touch-action: pan-y;  /* Only allow vertical swipes */
  }
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

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

.metric-row {
  padding: 10px 12px;
  background: rgba(0,0,0,0.06);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.metric-label {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.85rem;
}

.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 900;
  color: var(--text);
}

.metric-value.plain {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 900;
}

.details-section { margin-top: 14px; }
.section-title { margin: 0 0 8px 0; font-size: 1.05rem; font-weight: 900; }

.prize-ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-weight: 700;
}

.prize-ul li { margin: 6px 0; }

.details-images {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.thumb {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.06);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.thumb:hover {
  transform: scale(1.05);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 188, 212, 0.25);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 767px) {
  .admin-actions {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--muted);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.12);
}

.entry-control {
  margin: 14px 0;
}

.entry-stepper {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.stepper-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-btn:hover {
  border-color: var(--primary);
  transform: scale(1.1);
}

.entry-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: rgba(0,0,0,0.06);
  color: var(--text);
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
  font-size: 1.1rem;
}

.entry-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.12);
}

/* LIGHTBOX */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 99999999;
  cursor: zoom-out;
  padding: 0;
}

.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px 20px 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-content { 
  position: relative; 
  max-width: 90vw; 
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox-image { 
  max-width: 100%; 
  max-height: calc(100vh - 180px);
  width: auto;
  height: auto;
  border-radius: 16px; 
  border: 3px solid rgba(0, 188, 212, 0.5);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.lightbox-close {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 28px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 99999999;
}

.lightbox-close:hover {
  background: rgba(239, 68, 68, 0.95);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.15) rotate(90deg);
}

@media (max-width: 767px) {
  .lightbox-close {
    top: 70px;
    right: 10px;
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
}

.lightbox-label {
  margin-top: 20px;
  text-align: center;
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* TOASTS */
.toast-container {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: 380px;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transform: translateX(420px);
  transition: transform 220ms ease;
  font-weight: 800;
  pointer-events: auto;
  border: 1px solid rgba(255,255,255,0.12);
}

.toast.show { transform: translateX(0); }
.toast-success { background: rgba(16,185,129,0.92); color: #062014; }
.toast-error { background: rgba(239,68,68,0.92); color: #2b0404; }
.toast-info { background: rgba(33,150,243,0.92); color: #061423; }

/* RESPONSIVE */
@media (max-width: 767px) {
  .hide-on-mobile { display: none !important; }
  
  .toast-container {
    right: 10px;
    left: 10px;
  }
  
  .toast {
    min-width: auto;
    max-width: 100%;
  }
}

/* PAGINATION VISIBILITY FIX */
.pagination .btn {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.pagination .btn:disabled {
  color: #cbd5e1 !important;
  text-shadow: none !important;
}

.page-info {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}

/* MOBILE: HIDE BOTTOM NAV */
@media (max-width: 767px) {
  #mobile-menu,
  .mobile-menu,
  .mobile-nav,
  .bottom-nav,
  nav[class*="bottom"] {
    display: none !important;
  }
  
  /* FAB is ENABLED on mobile - removed from hide list above */
  
  body {
    padding-bottom: 0 !important;
  }
  
  .pagination {
    margin-bottom: 40px !important;
  }
}

/* SUPER STRONG PAGINATION OVERRIDES */
:root.theme-dark .pagination .btn,
html.theme-dark .pagination .btn,
body.theme-dark .pagination .btn,
.theme-dark .pagination .btn {
  color: #ffffff !important;
  background: linear-gradient(135deg, #00BCD4, #2196F3) !important;
}

:root.theme-dark .pagination .page-info,
html.theme-dark .pagination .page-info,
body.theme-dark .pagination .page-info,
.theme-dark .pagination .page-info {
  color: #ffffff !important;
}

:root:not(.theme-dark) .pagination .btn,
html:not(.theme-dark) .pagination .btn,
body:not(.theme-dark) .pagination .btn {
  color: #ffffff !important;
  background: linear-gradient(135deg, #00BCD4, #2196F3) !important;
}

:root:not(.theme-dark) .pagination .page-info,
html:not(.theme-dark) .pagination .page-info,
body:not(.theme-dark) .pagination .page-info {
  color: #0d1b2a !important;
}

.pagination button,
.pagination .btn,
#prev-page,
#next-page {
  color: #ffffff !important;
  background: linear-gradient(135deg, #00BCD4, #2196F3) !important;
}

.pagination #current-page,
.pagination .page-info,
#current-page,
#total-pages {
  color: var(--text) !important;
  font-weight: 900 !important;
}

.pagination .btn span,
.pagination button span {
  color: #ffffff !important;
}

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

@media (prefers-contrast: high) {
  .btn,
  .game-card,
  .modal {
    border-width: 2px;
  }
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media print {
  .controls-row,
  .pagination,
  .btn,
  .lightbox,
  .toast-container {
    display: none !important;
  }
  
  .game-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ===============================================
   SECTION 9: MODAL SYSTEM (close_game_modal.css)
   Modal dialog styles
   =============================================== */
/* High z-index to beat any cards/headers */
.hph-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  background: rgba(0,0,0,0.45);
  align-items: center;
  justify-content: center;
}
.hph-modal[aria-hidden="false"] { display: flex; }

.hph-modal .hph-modal-panel {
  max-width: 640px;
  width: min(96vw, 640px);
  max-height: 90vh;
  overflow: auto;
  border-radius: 16px;
  background: var(--panel, #101214);
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  padding: 16px;
}

.hph-modal .hph-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.08);
}

.hph-modal .hph-modal-actions {
  display: flex; gap: 8px; justify-content: flex-end; padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Prevent page scroll when modal is open */
.hph-modal-open body { 
  overflow: hidden; 
}

/* Enhanced mobile scroll lock - iOS fix */
@media (max-width: 768px) {
  .hph-modal-open body {
    overflow: hidden !important;
    position: fixed;  /* iOS fix: prevents background scroll */
    width: 100%;
    height: 100%;
    touch-action: none;  /* Disable all touch scrolling on body */
  }
  
  .hph-modal-open .modal-body {
    touch-action: pan-y !important;  /* Re-enable scrolling inside modal */
  }
}

/* Ensure triggers are clickable even under stray overlays */
[data-modal-target] { pointer-events: auto; position: relative; z-index: 10000; }

/* ============================================================================
   HOST GAME MODAL - LIGHT MODE BUTTON VISIBILITY FIXES
   Give selected buttons DARK backgrounds so white text is visible
   ============================================================================ */

/* GAME TYPE BUTTONS - Orange background when selected in light mode */
:root:not(.theme-dark) #host-game-modal .toggle-btn.active,
html:not(.theme-dark) #host-game-modal .toggle-btn.active,
body:not(.theme-dark) #host-game-modal .toggle-btn.active {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #ffffff !important;
  border-color: #d97706 !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4) !important;
}

/* ADMIN FREEROLL BUTTON - Darker orange when selected in light mode */
:root:not(.theme-dark) #host-game-modal .admin-only-btn.active,
html:not(.theme-dark) #host-game-modal .admin-only-btn.active,
body:not(.theme-dark) #host-game-modal .admin-only-btn.active {
  background: linear-gradient(135deg, #ea580c, #c2410c) !important;
  color: #ffffff !important;
  border-color: #c2410c !important;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.4) !important;
}

/* SHIPPING COST BUTTONS - Blue/teal background when selected in light mode */
:root:not(.theme-dark) #host-game-modal .shipping-btn.active,
html:not(.theme-dark) #host-game-modal .shipping-btn.active,
body:not(.theme-dark) #host-game-modal .shipping-btn.active {
  background: linear-gradient(135deg, #0891b2, #0e7490) !important;
  border-color: #0e7490 !important;
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.4) !important;
}

:root:not(.theme-dark) #host-game-modal .shipping-btn.active .shipping-price,
html:not(.theme-dark) #host-game-modal .shipping-btn.active .shipping-price,
body:not(.theme-dark) #host-game-modal .shipping-btn.active .shipping-price {
  color: #ffffff !important;
}

:root:not(.theme-dark) #host-game-modal .shipping-btn.active .shipping-desc,
html:not(.theme-dark) #host-game-modal .shipping-btn.active .shipping-desc,
body:not(.theme-dark) #host-game-modal .shipping-btn.active .shipping-desc {
  color: rgba(255, 255, 255, 0.95) !important;
}

/* HOST GAME SUBMIT BUTTON - Bold gradient in light mode */
:root:not(.theme-dark) #host-game-modal .btn-primary,
html:not(.theme-dark) #host-game-modal .btn-primary,
body:not(.theme-dark) #host-game-modal .btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4) !important;
}

:root:not(.theme-dark) #host-game-modal .btn-primary span,
html:not(.theme-dark) #host-game-modal .btn-primary span,
body:not(.theme-dark) #host-game-modal .btn-primary span {
  color: #ffffff !important;
}

:root:not(.theme-dark) #host-game-modal .btn-primary:hover,
html:not(.theme-dark) #host-game-modal .btn-primary:hover,
body:not(.theme-dark) #host-game-modal .btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5) !important;
}

/* Dark mode - keep existing dark backgrounds */
:root.theme-dark #host-game-modal .toggle-btn.active,
:root.theme-dark #host-game-modal .admin-only-btn.active {
  color: #ffffff !important;
}

:root.theme-dark #host-game-modal .shipping-btn.active .shipping-price,
:root.theme-dark #host-game-modal .shipping-btn.active .shipping-desc {
  color: #ffffff !important;
}

:root.theme-dark #host-game-modal .btn-primary,
:root.theme-dark #host-game-modal .btn-primary span {
  color: #ffffff !important;
}
