/* ==========================================================================
   ANTISLOP & TACTICAL OPS UI THEME
   Strict adherence to antislop & antislop-ui guidelines:
   - Purposeful palette (2-3 core colors + 1 accent, no generic purple-blue glow)
   - High contrast (WCAG AA >= 4.5:1 for body, >= 3:1 for headers)
   - Clean hierarchy & whitespace as structure
   - Sharp 6-8px border radius (not all pill-shaped)
   - No excessive glassmorphism or floating shadows
   - Minimum 44px tap targets for mobile
   - Visible keyboard focus rings for accessibility
   - Mobile-first responsive layout (zero horizontal overflow)
   ========================================================================== */

/* Root variables when Antislop theme is active */
body.theme-antislop {
  --bg-primary: #090d16;
  --bg-surface: #0f172a;
  --bg-card: #131d31;
  --bg-elevated: #1e293b;
  --bg-glass: #0f172a;

  --border-cyan: #2563eb;
  --border-subtle: #233047;
  --border-focus: #3b82f6;

  --neon-cyan: #38bdf8;
  --neon-green: #10b981;
  --neon-red: #f43f5e;
  --neon-purple: #818cf8;
  --neon-orange: #f59e0b;
  --neon-blue: #2563eb;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-cyber: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-cyber);
}

/* Hide retro scanlines and matrix particles in antislop mode */
body.theme-antislop .scanlines {
  display: none !important;
}

body.theme-antislop #bg-canvas {
  opacity: 0.15;
}

/* App container */
body.theme-antislop #cyber-app-frame {
  background: var(--bg-primary);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* Header HUD */
body.theme-antislop .cyber-header {
  background: var(--bg-surface);
  backdrop-filter: none;
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 12px;
}

body.theme-antislop .header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

body.theme-antislop .hacker-avatar {
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  color: var(--neon-cyan);
  border-radius: 6px;
}

body.theme-antislop .hacker-details h4 {
  color: var(--text-main);
  font-family: var(--font-cyber);
  font-weight: 600;
  font-size: 13px;
}

body.theme-antislop .rank-badge {
  background: #1e293b;
  border: 1px solid #334155;
  color: #93c5fd;
  border-radius: 4px;
  font-family: var(--font-cyber);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
}

body.theme-antislop .premium-badge {
  background: #78350f;
  border: 1px solid #d97706;
  color: #fef3c7;
  border-radius: 4px;
  font-family: var(--font-cyber);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
}

/* Stat pills in header */
body.theme-antislop .stat-pill {
  background: #131d31;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: var(--font-cyber);
  font-size: 11px;
  font-weight: 500;
}

body.theme-antislop .stat-pill.credits .val {
  color: #fbbf24;
}

body.theme-antislop .stat-pill.energy .val {
  color: #34d399;
}

/* UI Theme Switcher Button */
.theme-switch-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s ease, border-color 0.15s ease;
  min-height: 32px;
}

.theme-switch-btn:hover {
  background: #334155;
  border-color: #475569;
}

.theme-switch-btn:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 1px;
}

/* Google Login Chip & Profile Button */
.google-auth-chip {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  min-height: 32px;
}

.google-auth-chip:hover {
  background: #28374d;
  border-color: #475569;
}

.google-auth-chip img.google-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.google-auth-chip .g-icon {
  width: 14px;
  height: 14px;
}

.google-sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

/* Level & Progress Bar */
body.theme-antislop .level-bar-container {
  font-family: var(--font-cyber);
  font-size: 11px;
}

body.theme-antislop .level-tag {
  color: var(--text-main);
  font-weight: 600;
}

body.theme-antislop .xp-bar-bg {
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
}

body.theme-antislop .xp-bar-fill {
  background: #2563eb;
  border-radius: 3px;
}

/* Cards & Content Sections */
body.theme-antislop .territory-card,
body.theme-antislop .upgrade-card,
body.theme-antislop .shop-card,
body.theme-antislop .ach-card,
body.theme-antislop .mission-card,
body.theme-antislop .pvp-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  backdrop-filter: none;
}

body.theme-antislop .network-map-wrapper {
  background: #0d1424;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: none;
}

body.theme-antislop .map-overlay-info {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 4px;
  font-family: var(--font-cyber);
}

body.theme-antislop .detail-item {
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-family: var(--font-cyber);
}

body.theme-antislop .detail-item .lbl {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 10px;
}

body.theme-antislop .detail-item .val {
  color: var(--text-main);
  font-weight: 600;
  font-size: 12px;
}

/* Clean Tactical Buttons */
body.theme-antislop .cyber-btn {
  background: #2563eb;
  border: 1px solid #3b82f6;
  color: #ffffff;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 6px;
  font-family: var(--font-cyber);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
  text-transform: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.theme-antislop .cyber-btn:hover {
  background: #1d4ed8;
  border-color: #2563eb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.theme-antislop .cyber-btn:active {
  background: #1e40af;
}

body.theme-antislop .cyber-btn:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

body.theme-antislop .cyber-btn.hack-btn {
  background: #059669;
  border-color: #10b981;
  color: #ffffff;
}

body.theme-antislop .cyber-btn.hack-btn:hover {
  background: #047857;
  border-color: #059669;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.theme-antislop .cyber-btn.danger {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
}

body.theme-antislop .cyber-btn.danger:hover {
  background: #b91c1c;
}

body.theme-antislop .cyber-btn.purple {
  background: #4f46e5;
  border-color: #6366f1;
  color: #ffffff;
}

body.theme-antislop .cyber-btn.purple:hover {
  background: #4338ca;
}

/* Optimized Bottom Navigation Bar */
body.theme-antislop .cyber-bottom-nav {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  backdrop-filter: none;
  min-height: 56px;
  padding: 4px 6px;
  gap: 4px;
}

body.theme-antislop .nav-item {
  color: var(--text-muted);
  border-radius: 6px;
  font-family: var(--font-cyber);
  font-size: 11px;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}

body.theme-antislop .nav-item:hover {
  color: var(--text-main);
  background: #1e293b;
}

body.theme-antislop .nav-item.active {
  color: #38bdf8;
  background: #1e293b;
}

body.theme-antislop .nav-item svg {
  stroke-width: 2;
}

body.theme-antislop .nav-item.active svg {
  stroke: #38bdf8;
  filter: none;
}

/* Modals */
body.theme-antislop .cyber-modal {
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(4px);
}

body.theme-antislop .modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
  padding: 16px;
}

body.theme-antislop .modal-title {
  font-family: var(--font-cyber);
  font-weight: 700;
  color: var(--text-main);
}

body.theme-antislop .modal-title.success {
  color: #34d399;
}

body.theme-antislop .modal-title.failed {
  color: #f87171;
}

/* Hacking overlay in antislop mode */
body.theme-antislop #hacking-modal {
  background: #090d16;
  backdrop-filter: none;
}

body.theme-antislop .minigame-container {
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

body.theme-antislop .tool-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: var(--text-main);
  border-radius: 6px;
  font-family: var(--font-cyber);
  font-weight: 500;
}

body.theme-antislop .tool-btn:hover {
  background: #334155;
  border-color: #475569;
}

body.theme-antislop .timer-box {
  background: #1e293b;
  border: 1px solid #334155;
  color: #34d399;
  border-radius: 6px;
  font-family: var(--font-cyber);
}

/* Calendar Day Boxes */
body.theme-antislop .calendar-day-box {
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

body.theme-antislop .calendar-day-box.current {
  border-color: #3b82f6;
  background: #1e293b;
}

body.theme-antislop .calendar-day-box.claimed {
  opacity: 0.6;
}

/* Global Focus visible state */
body.theme-antislop button:focus-visible,
body.theme-antislop input:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

/* Tactical Lobby Screen */
body.theme-antislop #lobby-screen {
  background: #090d16;
  backdrop-filter: none;
}

body.theme-antislop .lobby-actions-card {
  background: #0f172a;
  border-color: #334155;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

body.theme-antislop .lobby-logo-icon {
  background: #1e293b;
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: none;
}

body.theme-antislop .lobby-title {
  background: none;
  -webkit-text-fill-color: initial;
  color: #f8fafc;
  font-family: var(--font-cyber);
  font-weight: 800;
  text-shadow: none;
}

body.theme-antislop .btn-guest-login {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
  font-family: var(--font-cyber);
}

body.theme-antislop .btn-guest-login:hover {
  background: #334155;
  box-shadow: none;
}

body.theme-antislop .profile-hero-card {
  background: #0f172a;
  border-color: #334155;
}

body.theme-antislop .profile-avatar-large {
  background: #1e293b;
  border-color: #38bdf8;
  color: #38bdf8;
}

