/**
 * Casual Maze Game - Shared Base Styles & Design Tokens
 */

:root {
  --bg: #090d16;
  --bg-deep: #060910;
  --bg-subtle: #111827;
  --bg-surface: #0f172a;
  --card-bg: #111827;
  --card-hover: #1f293d;
  --card-border: #1e293b;
  --border-focus: #38bdf8;
  
  /* Game Glass & Translucent Surface Layers */
  --bg-glass: rgba(15, 23, 42, 0.78);
  --bg-glass-elevated: rgba(20, 29, 48, 0.92);
  --bg-glass-card: rgba(15, 23, 42, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-bright: rgba(255, 255, 255, 0.18);
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  
  /* Luminescent Game Accents */
  --accent: #38bdf8;
  --accent-hover: #0284c7;
  --accent-glow: rgba(56, 189, 248, 0.3);
  
  --gold: #fbbf24;
  --gold-glow: rgba(251, 191, 36, 0.35);
  
  --emerald: #34d399;
  --emerald-glow: rgba(52, 211, 153, 0.3);
  
  --rose: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.3);
  
  --purple: #c084fc;
  --purple-glow: rgba(192, 132, 252, 0.3);

  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #475569;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px var(--accent-glow);

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Background grid pattern */
.bg-grid {
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.08) 0%, transparent 60%),
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
}

p {
  line-height: 1.6;
  color: var(--text-muted);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
}

kbd {
  box-shadow: 0 2px 0 var(--card-border);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
  transition: all 0.2s ease;
}

.badge-emerald {
  color: var(--emerald);
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.15);
}

.badge-gold {
  color: var(--gold);
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.15);
}

/* Glass Panels & Game Cards */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border-glass-bright);
  box-shadow: var(--inset-highlight), var(--shadow-lg);
}

.game-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--inset-highlight), var(--shadow-md);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease,
              box-shadow 0.2s ease;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: var(--inset-highlight), 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.15);
}

/* Tactile Game Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.15s ease,
              background 0.15s ease,
              border-color 0.15s ease;
  user-select: none;
  position: relative;
  overflow: hidden;
  box-shadow: var(--inset-highlight), 0 3px 0 rgba(0, 0, 0, 0.45), 0 6px 14px rgba(0, 0, 0, 0.3);
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  transition: left 0.5s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:hover::after {
  left: 140%;
}

.btn:active {
  transform: translateY(2px) scale(0.985);
  box-shadow: var(--inset-highlight), 0 1px 0 rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.25);
}

.btn-primary {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #04101e;
  border-color: #38bdf8;
  box-shadow: var(--inset-highlight), 0 3px 0 #0369a1, 0 6px 16px rgba(56, 189, 248, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #7dd3fc 0%, #0284c7 100%);
  border-color: #7dd3fc;
  box-shadow: var(--inset-highlight), 0 4px 0 #0369a1, 0 8px 20px rgba(56, 189, 248, 0.45);
}

.btn-primary:active {
  box-shadow: var(--inset-highlight), 0 1px 0 #0369a1, 0 2px 8px rgba(56, 189, 248, 0.3);
}

.btn-secondary {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--inset-highlight), 0 3px 0 #090d16, 0 6px 14px rgba(0, 0, 0, 0.35);
}

.btn-secondary:hover {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: var(--inset-highlight), 0 4px 0 #090d16, 0 6px 18px rgba(56, 189, 248, 0.2);
}

.btn-accent {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  color: #022014;
  border-color: #34d399;
  box-shadow: var(--inset-highlight), 0 3px 0 #047857, 0 6px 16px rgba(52, 211, 153, 0.35);
}

.btn-accent:hover {
  background: linear-gradient(180deg, #6ee7b7 0%, #059669 100%);
  box-shadow: var(--inset-highlight), 0 4px 0 #047857, 0 8px 20px rgba(52, 211, 153, 0.45);
}

.btn-gold {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  color: #261601;
  border-color: #fbbf24;
  box-shadow: var(--inset-highlight), 0 3px 0 #b45309, 0 6px 16px rgba(251, 191, 36, 0.35);
}

.btn-gold:hover {
  background: linear-gradient(180deg, #fcd34d 0%, #d97706 100%);
  box-shadow: var(--inset-highlight), 0 4px 0 #b45309, 0 8px 20px rgba(251, 191, 36, 0.45);
}

.btn-danger {
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.25) 0%, rgba(225, 29, 72, 0.4) 100%);
  color: #fca5a5;
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: var(--inset-highlight), 0 3px 0 rgba(159, 18, 57, 0.6), 0 6px 14px rgba(244, 63, 94, 0.25);
}

.btn-danger:hover {
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.4) 0%, rgba(225, 29, 72, 0.55) 100%);
  border-color: #f43f5e;
  box-shadow: var(--inset-highlight), 0 4px 0 rgba(159, 18, 57, 0.7), 0 8px 18px rgba(244, 63, 94, 0.35);
}

.btn-sm {
  padding: 0.32rem 0.7rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-md);
  min-width: 2.5rem;
  height: 2.5rem;
}

.btn-sm.btn-icon {
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  min-width: 1.85rem;
  height: 1.85rem;
  font-size: 0.78rem;
}

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

/* Form inputs */
.input-field, .select-field {
  background: var(--bg-deep);
  border: 1px solid var(--border-glass-bright);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-field:focus, .select-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

/* Toggle Switch Component (Issue #91, BL-124) */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  margin: 0;
  pointer-events: none;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.switch .slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.switch input:checked + .slider {
  background-color: var(--accent, #38bdf8) !important;
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.switch input:focus-visible + .slider {
  outline: 2px solid var(--accent, #38bdf8);
  outline-offset: 2px;
}

.switch:hover .slider {
  filter: brightness(1.12);
}

/* Modal System */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  padding: 1.25rem;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-glass-elevated);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--inset-highlight), 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.15);
  transform: scale(0.92) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  overflow: hidden;
}

.modal-backdrop.active .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.15);
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass-bright);
  color: var(--text);
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-md);
  box-shadow: var(--inset-highlight), 0 10px 28px rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
  animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.3s ease 2.7s forwards;
  max-width: 380px;
}

.toast-success {
  border-color: var(--emerald);
  box-shadow: var(--inset-highlight), 0 0 16px rgba(52, 211, 153, 0.25);
}

.toast-error {
  border-color: var(--rose);
  box-shadow: var(--inset-highlight), 0 0 16px rgba(244, 63, 94, 0.25);
}

.toast-info {
  border-color: var(--accent);
  box-shadow: var(--inset-highlight), 0 0 16px rgba(56, 189, 248, 0.25);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
}

/* In-Game HUD Breadcrumbs (BL-54) */
.hud-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  white-space: nowrap;
}

.hud-crumb-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.15s ease;
}

.hud-crumb-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.hud-crumb-sep {
  color: var(--text-dim);
  font-size: 0.6rem;
  user-select: none;
}

.hud-crumb-current {
  color: var(--text-muted);
  font-weight: 600;
}

/* =========================================================
 * UNIVERSAL GLOBAL APP HEADER & FOOTER (GLASSMORPHIC)
 * ========================================================= */

.app-nav-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  height: var(--top-bar-height, 42px);
  background: rgba(11, 19, 38, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass-bright, rgba(56, 189, 248, 0.2));
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.app-nav-inner {
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.app-nav-inner::-webkit-scrollbar {
  display: none;
}

.app-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.app-brand-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 0.95rem;
  transition: transform 0.15s ease, color 0.15s ease;
}

.app-brand-link:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.app-brand-icon {
  font-size: 1.15rem;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.4));
}

.app-brand-name {
  background: linear-gradient(135deg, #ffffff 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.app-version-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent);
}

.app-nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.app-nav-links::-webkit-scrollbar {
  display: none;
}

.app-nav-links .nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.app-nav-links .nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.app-nav-links .nav-item.active {
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.app-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.app-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass-bright, rgba(255, 255, 255, 0.12));
  color: var(--text);
  border-radius: var(--radius-sm, 6px);
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.app-action-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.app-action-btn.icon-btn {
  padding: 0.45rem 0.6rem;
  font-size: 1rem;
}

.profile-pill-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.12);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
}

.profile-pill-btn:hover {
  border-color: var(--gold);
  background: rgba(251, 191, 36, 0.15);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.3);
}

.profile-name-text {
  font-weight: 700;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-stars-badge {
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(251, 191, 36, 0.15);
  padding: 0.15rem 0.4rem;
  border-radius: 9999px;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Breadcrumbs Bar */
.app-breadcrumbs-bar {
  width: 100%;
  background: rgba(10, 15, 26, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.35rem 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.breadcrumbs-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.crumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s ease;
}

.crumb-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.crumb-item.active {
  color: var(--text);
  font-weight: 700;
}

.crumb-separator {
  color: var(--text-dim);
  font-size: 0.65rem;
  user-select: none;
}

/* Bottom App Footer */
.app-nav-footer {
  width: 100%;
  margin-top: auto;
  background: rgba(10, 15, 26, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.app-footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-left, .footer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  font-weight: 700;
  color: var(--text);
}

.footer-dot {
  opacity: 0.4;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--accent);
}

.shortcuts-hint {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.76rem;
}

.desktop-shortcuts-strip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.shortcuts-hint kbd,
.footer-shortcuts-drawer kbd {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  color: var(--text);
  font-size: 0.76rem;
}

.footer-shortcuts-btn {
  display: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.footer-shortcuts-btn:hover,
.footer-shortcuts-btn.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #ffffff;
}

.footer-shortcuts-drawer {
  width: 100%;
  max-width: 1440px;
  margin: 0.65rem auto 0;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-glass-bright, rgba(56, 189, 248, 0.3));
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

.footer-shortcuts-drawer.hidden {
  display: none;
}

.shortcuts-drawer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.shortcuts-drawer-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.shortcuts-drawer-section strong {
  color: var(--text);
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
}

@media (max-width: 860px) {
  .desktop-shortcuts-strip {
    display: none;
  }
  .footer-shortcuts-btn {
    display: inline-flex;
  }
}

/* Mobile Navigation Drawer & Hamburger Toggle (BL-126) */
.mobile-menu-toggle-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .app-nav-links {
    display: none !important;
  }
  .mobile-menu-toggle-btn {
    display: inline-flex !important;
  }
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: 320px;
  max-width: 86vw;
  background: rgba(11, 19, 38, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-glass-bright, rgba(56, 189, 248, 0.3));
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.7);
  z-index: 1201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1.25rem 1rem;
  overflow-y: auto;
  gap: 1.25rem;
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

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

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

.mobile-drawer-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text, #fff);
  border-radius: var(--radius-sm, 6px);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-drawer-close-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--rose, #f43f5e);
}

.mobile-drawer-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.mobile-profile-avatar {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.mobile-profile-info {
  flex: 1;
  min-width: 0;
}

.mobile-profile-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-profile-stats {
  font-size: 0.75rem;
  color: var(--gold, #fbbf24);
  font-weight: 600;
}

.mobile-drawer-profile-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-drawer-profile-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent);
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md, 10px);
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-link:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateX(4px);
}

.mobile-nav-link.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent, #38bdf8);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}

.mobile-nav-link .nav-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.mobile-nav-link .nav-desc {
  display: flex;
  flex-direction: column;
}

.mobile-nav-link .nav-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text, #fff);
}

.mobile-nav-link .nav-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.mobile-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-action-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm, 6px);
  color: var(--text, #fff);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-action-card:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent);
}


/* Modals */
#settings-modal,
#profile-modal,
#feedback-modal,
#guide-modal {
  z-index: 1100;
}

.profile-card, .settings-card {
  max-width: 580px;
  width: 92%;
  border: 1px solid var(--border-glass-bright, rgba(56, 189, 248, 0.3));
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6), 0 0 24px rgba(56, 189, 248, 0.15);
}

/* Settings Modal Categorized Tab Bar (BL-107) */
.settings-tab-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1.25rem 0.2rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  scrollbar-width: none;
}

.settings-tab-bar::-webkit-scrollbar {
  display: none;
}

.settings-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.settings-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.settings-tab-btn.active {
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.15);
}

.settings-tab-panel {
  display: none !important;
  animation: fadeIn 0.18s ease-out;
}

.settings-tab-panel.active {
  display: block !important;
}

#settings-panel-diagnostics.settings-tab-panel.active {
  display: flex !important;
}

/* High Contrast Accessibility Mode */
body.high-contrast-mode {
  --bg: #000000;
  --card-bg: #0a0a0a;
  --card-border: #ffffff;
  --border-glass: #ffffff;
  --text: #ffffff;
  --text-muted: #e2e8f0;
}

body.high-contrast-mode .palette-btn,
body.high-contrast-mode .card,
body.high-contrast-mode .hud-card {
  border-color: #ffffff !important;
  background-color: #000000 !important;
}

@media (max-width: 768px) {
  .app-nav-links .nav-text {
    display: none;
  }
  .app-nav-links .nav-item {
    padding: 0.4rem 0.55rem;
  }
  .profile-name-text {
    display: none;
  }
  .shortcuts-hint {
    display: none;
  }
  .app-footer-inner {
    justify-content: center;
    text-align: center;
  }
}

/* ==========================================================================
   HIGH-POLISH GAME BRANDING, HERO BACKDROP & TACTILE UI (BL-80)
   ========================================================================== */

/* Hero Atmospheric Canvas Container */
.hero-backdrop-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto 2.25rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65), 0 0 32px rgba(56, 189, 248, 0.12);
  background: radial-gradient(circle at 50% 20%, rgba(20, 32, 54, 0.85) 0%, rgba(8, 12, 22, 0.98) 100%);
}

#hero-ambient-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem 1.5rem 2.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Stylized Brand Crest & Title Treatment */
.brand-crest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(56, 189, 248, 0.35) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 2px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.25);
  margin-bottom: 0.85rem;
  animation: crest-float 4s ease-in-out infinite;
}

.brand-crest-icon {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

@keyframes crest-float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(3deg); }
}

.brand-title {
  font-size: 2.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.4rem;
  background: linear-gradient(135deg, #ffffff 0%, #e0f2fe 30%, #7dd3fc 65%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.7));
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
  margin-bottom: 1rem;
}

.hero-description {
  max-width: 620px;
  font-size: 1.02rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 1.75rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Pulsing Primary CTA */
.btn-glow-primary {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.45), 0 4px 14px rgba(0, 0, 0, 0.4);
  font-weight: 800;
  animation: pulse-glow 2.8s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.35), 0 4px 14px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 32px rgba(56, 189, 248, 0.65), 0 6px 18px rgba(0, 0, 0, 0.5);
    transform: translateY(-1px);
  }
}

/* Gameplay Feature Spotlight Strip */
.spotlight-strip {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 860px;
  margin-bottom: 2.25rem;
  flex-wrap: wrap;
}

.spotlight-card {
  flex: 1 1 180px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.spotlight-card:hover {
  background: rgba(20, 30, 52, 0.85);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 0 14px rgba(56, 189, 248, 0.15);
}

.spotlight-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  flex-shrink: 0;
}

.spotlight-icon-wrap img {
  width: 22px;
  height: 22px;
}

.spotlight-info {
  display: flex;
  flex-direction: column;
}

.spotlight-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.2;
}

.spotlight-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Biome Visual Themes for Campaign Chapters */
.chapter-theme-dungeon {
  border-color: rgba(56, 189, 248, 0.35) !important;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.05) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
}

.chapter-theme-jungle {
  border-color: rgba(52, 211, 153, 0.35) !important;
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.05) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
}

.chapter-theme-magma {
  border-color: rgba(244, 63, 94, 0.35) !important;
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.05) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
}

.chapter-theme-glacial {
  border-color: rgba(147, 197, 253, 0.35) !important;
  background: linear-gradient(180deg, rgba(147, 197, 253, 0.05) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
}

.chapter-theme-gilded {
  border-color: rgba(251, 191, 36, 0.35) !important;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.05) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
}

.chapter-theme-void {
  border-color: rgba(192, 132, 252, 0.35) !important;
  background: linear-gradient(180deg, rgba(192, 132, 252, 0.05) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
}

.chapter-theme-clockwork {
  border-color: rgba(251, 146, 60, 0.35) !important;
  background: linear-gradient(180deg, rgba(251, 146, 60, 0.05) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
}

.chapter-theme-celestial {
  border-color: rgba(244, 114, 182, 0.35) !important;
  background: linear-gradient(180deg, rgba(244, 114, 182, 0.05) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
}

.chapter-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.chapter-asset-preview {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* ==========================================================================
   CLICK-AND-DRAG SCROLL & DYNAMIC MENU PAGINATION (BL-123, ADR-0033)
   ========================================================================== */

.drag-scroll-x {
  overflow-x: auto !important;
  cursor: grab;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.drag-scroll-x::-webkit-scrollbar {
  display: none;
}

.drag-scroll-y {
  overflow-y: auto !important;
  cursor: grab;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.drag-scroll-both {
  overflow: auto !important;
  cursor: grab;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.drag-scroll-x.is-dragging,
.drag-scroll-y.is-dragging,
.drag-scroll-both.is-dragging {
  cursor: grabbing !important;
  user-select: none !important;
}

.drag-scroll-x.is-dragging *,
.drag-scroll-y.is-dragging *,
.drag-scroll-both.is-dragging * {
  pointer-events: none !important;
  user-select: none !important;
}

/* Dynamic Menu Pager Controls */
.dynamic-menu-pager {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(11, 19, 38, 0.92);
  border: 1px solid var(--border-glass-bright, rgba(56, 189, 248, 0.25));
  border-radius: var(--radius-sm, 6px);
  padding: 0.15rem 0.35rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  user-select: none;
  z-index: 20;
}

.dynamic-pager-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text, #fff);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  line-height: 1;
}

.dynamic-pager-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--accent, #38bdf8);
  color: #fff;
  transform: scale(1.06);
}

.dynamic-pager-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.dynamic-pager-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.dynamic-pager-indicator {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent, #38bdf8);
  padding: 0 0.3rem;
  letter-spacing: -0.02em;
}

/* Edge Overflow Glow Indicators */
.can-scroll-left {
  position: relative;
}

.can-scroll-left::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(11, 19, 38, 0.95) 0%, transparent 100%);
  z-index: 5;
}

.can-scroll-right {
  position: relative;
}

.can-scroll-right::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
  background: linear-gradient(270deg, rgba(11, 19, 38, 0.95) 0%, transparent 100%);
  z-index: 5;
}

.can-scroll-up {
  box-shadow: inset 0 8px 8px -6px rgba(56, 189, 248, 0.3);
}

.can-scroll-down {
  box-shadow: inset 0 -8px 8px -6px rgba(56, 189, 248, 0.3);
}

