/* ============================================================
   english.css — EnglishSlayer Canonical Design System
   Single source of truth. No !important wars.
   2026-05-18 — spec by FRIDAY, built by NEON
   Namespace: --es-* (EnglishSlayer)
   ============================================================ */

@import url('/lib/fonts.css');

/* RULE: --es-accent (orange) for user actions (tap, submit, achieve)
         --es-system (cyan) for system info (timers, data, dungeon status) */

:root {
  /* ── BRAND ACCENT (EnglishSlayer orange, fire energy) ─────── */
  --es-accent:         #ff6a00;
  --es-accent-light:   #ff9500;             /* AA text on dark bg (6.9:1) */
  --es-accent-glow:    rgba(255,106,0,0.55);
  --es-accent-dim:     rgba(255,106,0,0.35);
  --es-accent-bg:      rgba(255,106,0,0.06);
  --es-accent-border:  rgba(255,106,0,0.30);

  /* ── SYSTEM / DUNGEON (SL cyan — UI info, not brand) ─────── */
  --es-system:         #00f6ff;
  --es-system-glow:    rgba(0,246,255,0.60);
  --es-system-dim:     rgba(0,246,255,0.40);
  --es-system-line:    rgba(0,246,255,0.12);
  --es-system-bg:      rgba(0,246,255,0.06);

  /* ── PURPLE (power / rank up) ──────────────────────────────── */
  --es-purple:         #7b2dff;
  --es-purple-dim:     rgba(123,45,255,0.40);
  --es-purple-glow:    rgba(123,45,255,0.55);

  /* ── GOLD (achievements / rank S) ───────────────────────────── */
  --es-gold:           #ffd700;
  --es-gold-glow:      rgba(255,215,0,0.60);

  /* ── BACKGROUNDS ─────────────────────────────────────────────── */
  --es-bg:             #020611;
  --es-surface:        rgba(8,18,38,0.78);
  --es-surface-hover:  rgba(12,26,50,0.92);
  --es-surface-deep:   #050d1f;
  --es-glass-bg:       rgba(8,18,38,0.65);
  --es-glass-border:   1px solid rgba(0,246,255,0.18);

  /* ── TEXT ───────────────────────────────────────────────────── */
  --es-text:           #e8efff;
  --es-text-dim:       #7a8fb8;
  --es-text-muted:     #4a5f87;

  /* ── SEMANTIC STATE ──────────────────────────────────────────── */
  --es-success:        #00ffa3;
  --es-danger:         #ff3366;
  --es-warning:        #ffd700;
  --es-success-bg:     rgba(0,255,163,0.08);
  --es-danger-bg:      rgba(255,51,102,0.08);
  --es-warning-bg:     rgba(255,215,0,0.08);

  /* ── MASTERY SCALE ───────────────────────────────────────────── */
  --es-mastery-0:      #ff3366;
  --es-mastery-1:      #ffd700;
  --es-mastery-2:      #00ffa3;
  --es-mastery-3:      #00f6ff;

  /* ── SPACING (4-pt grid) ─────────────────────────────────────── */
  --es-s-1: 4px;   --es-s-2: 8px;   --es-s-3: 12px;
  --es-s-4: 16px;  --es-s-5: 20px;  --es-s-6: 24px;
  --es-s-8: 32px;  --es-s-10: 40px; --es-s-12: 48px;
  --es-s-16: 64px; --es-s-20: 80px;

  /* ── RADII ───────────────────────────────────────────────────── */
  --es-r-xs:   4px;
  --es-r-sm:   8px;
  --es-r-md:   12px;
  --es-r-lg:   18px;
  --es-r-xl:   24px;
  --es-r-full: 9999px;

  /* ── SHADOWS & GLOWS ─────────────────────────────────────────── */
  --es-shadow-card:   0 4px 16px rgba(0,0,0,0.45), 0 1px 4px rgba(0,0,0,0.25);
  --es-shadow-hover:  0 8px 28px rgba(0,0,0,0.55), 0 0 24px rgba(0,246,255,0.15);
  --es-shadow-modal:  0 24px 60px rgba(0,0,0,0.70);
  --es-glow-accent:   0 0 24px rgba(255,106,0,0.50);
  --es-glow-system:   0 0 24px rgba(0,246,255,0.45);
  --es-glow-system-strong: 0 0 36px rgba(0,246,255,0.70);
  --es-glow-gold:     0 0 24px rgba(255,215,0,0.55);
  --es-glow-purple:   0 0 24px rgba(123,45,255,0.50);

  /* ── MOTION ──────────────────────────────────────────────────── */
  --es-spring-snappy:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --es-spring-settle:  cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --es-spring-instant: cubic-bezier(0.16, 1, 0.3, 1);
  --es-dur-fast:  120ms;
  --es-dur-base:  220ms;
  --es-dur-slow:  360ms;
  --es-dur-arise: 1200ms;

  /* ── Z-INDEX ─────────────────────────────────────────────────── */
  --es-z-bg:     0;
  --es-z-app:    1;
  --es-z-nav:  100;
  --es-z-modal: 500;
  --es-z-arise: 100000;

  /* ── BACKWARD-COMPAT ALIASES (JS inline styles — 150+ usages) ── */
  /* Phase 1: keep until JS migrated to --es-*. Phase 3: remove.   */
  --primary:        var(--es-accent);
  --primary-light:  var(--es-accent-bg);
  --primary-50:     var(--es-accent-bg);
  --primary-dark:   var(--es-accent);
  --text:           var(--es-text);
  --text-secondary: var(--es-text-dim);
  --success:        var(--es-success);
  --danger:         var(--es-danger);
  --warning:        var(--es-warning);
  --success-bg:     var(--es-success-bg);
  --danger-bg:      var(--es-danger-bg);
  --warning-bg:     var(--es-warning-bg);
  --border:         var(--es-system-line);
  --radius:         var(--es-r-xl);
  --radius-sm:      var(--es-r-sm);
  --bg:             var(--es-bg);
  --card-bg:        var(--es-surface);
  --gray-50:        rgba(8,18,38,0.50);
  --gray-100:       rgba(8,18,38,0.70);
  --gray-200:       rgba(8,18,38,0.85);
  /* ── Extended compat: HTML inline styles use unprefixed --s-N, --r-*, --spring-* ── */
  --text-primary:      var(--es-text);
  --dur-fast:          var(--es-dur-fast);
  --dur-base:          var(--es-dur-base);
  --dur-slow:          var(--es-dur-slow);
  --spring-snappy:     var(--es-spring-snappy);
  --spring-settle:     var(--es-spring-settle);
  --spring-instant:    var(--es-spring-instant);
  --shadow-card-hover: var(--es-shadow-hover);
  --glow-cyan:         var(--es-glow-system);
  --glow-cyan-strong:  var(--es-glow-system-strong);
  --sl-glass-bg:       var(--es-glass-bg);
  --sl-glass-border:   var(--es-glass-border);
  --s-1:  var(--es-s-1);  --s-2:  var(--es-s-2);  --s-3:  var(--es-s-3);
  --s-4:  var(--es-s-4);  --s-5:  var(--es-s-5);  --s-6:  var(--es-s-6);
  --s-8:  var(--es-s-8);  --s-10: var(--es-s-10); --s-12: var(--es-s-12);
  --s-16: var(--es-s-16); --s-20: var(--es-s-20);
  --r-xs: var(--es-r-xs); --r-sm: var(--es-r-sm); --r-md: var(--es-r-md);
  --r-lg: var(--es-r-lg); --r-xl: var(--es-r-xl); --r-full: var(--es-r-full);
}

/* focus-visible — WCAG 2.2 §2.4.11 */
:focus-visible {
  outline: 2px solid var(--es-accent);
  outline-offset: 2px;
}



/* ======== BASE (from styles.css) ======== */

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


body.dark-mode {
  --bg: #000000;
  --card-bg: rgba(58, 58, 60, 0.6);
  --text: #FFFFFF;
  --text-secondary: #AEAEB2;
  --border: rgba(255,255,255,0.18);
  --primary: #ff8c00;
  --primary-dark: var(--es-accent);
  --primary-light: rgba(255,140,0,0.2);
  --primary-50: rgba(255,140,0,0.2);
  --success: #30D158;
  --danger: #FF453A;
  --warning: #FF9F0A;
  --gray-50: #1C1C1E;
  --gray-100: #38383A;
  --gray-200: #48484A;
  --gray-300: #636366;
  --gray-400: #8E8E93;
  --ios-shadow: 0 2px 10px rgba(0,0,0,0.5), 0 0 1px rgba(0,0,0,0.4);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  background: var(--es-bg);
  min-height: 100vh;
  color: var(--es-text);
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.003em;
}

body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: -1;
  background: url('/icons/bg-wallpaper.webp') center/cover no-repeat fixed;
  opacity: 0.1;
  filter: blur(1px);
}

body.dark-mode::after {
  opacity: 0.05;
  filter: blur(2px);
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 110px;
}

/* ─── Header ─── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  margin-bottom: 16px;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--es-accent), var(--es-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark-mode header h1 {
  background: linear-gradient(135deg, #ff8c00, var(--es-gold));
  -webkit-background-clip: text;
  background-clip: text;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--es-surface);
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--es-accent);
  box-shadow: var(--es-shadow-card);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--es-system-line);
}

.icon-btn:hover { opacity: 0.8; }
.icon-btn:active { transform: scale(0.88); opacity: 0.6; }

body.dark-mode .icon-btn {
  background: rgba(58, 58, 60, 0.7);
  box-shadow: var(--es-shadow-card);
  border: 1px solid rgba(255,255,255,0.2);
}

/* ─── Bottom Navigation ─── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(242, 242, 247, 0.8);
  display: flex;
  justify-content: space-around;
  padding: 4px 0 max(20px, env(safe-area-inset-bottom));
  box-shadow: 0 -0.5px 0 rgba(0,0,0,0.04), 0 -4px 20px rgba(0,0,0,0.06);
  z-index: 100;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-top: 0.5px solid rgba(0,0,0,0.08);
}

body.dark-mode .bottom-nav {
  background: rgba(28,28,30,0.7);
  border-top: 0.5px solid rgba(255,255,255,0.2);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  box-shadow: 0 -1px 0 rgba(255,255,255,0.1), 0 -8px 32px rgba(0,0,0,0.6);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--es-text-muted);
  font-size: 10px;
  font-weight: 500;
  padding: 6px 12px;
  gap: 4px;
  border-radius: 0;
  transition: color 0.2s ease;
}

.nav-item:active { opacity: 0.6; }
.nav-item.active { color: var(--es-accent); }

body.dark-mode .nav-item {
  color: rgba(8,18,38,0.50);
}
body.dark-mode .nav-item.active {
  color: var(--es-accent);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
}

/* ─── Cards ─── */
.card {
  background: var(--es-surface);
  border-radius: var(--es-r-xl);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--es-shadow-card);
  border: 1px solid var(--es-system-line);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
}

body.dark-mode .card {
  background: rgba(58, 58, 60, 0.6);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: var(--es-shadow-card);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--es-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ─── Progress bar ─── */
.progress-bar-container {
  background: rgba(8,18,38,0.85);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--es-accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--es-text-dim);
  text-align: right;
  margin-top: 2px;
}

/* ─── Date header ─── */
.date-header {
  text-align: center;
  margin-bottom: 16px;
}

.date-header-day {
  font-size: 26px;
  font-weight: 700;
  color: var(--es-text);
}

.date-header-info {
  font-size: 13px;
  color: var(--es-text-dim);
  margin-top: 2px;
}

/* ─── Text input ─── */
.text-input {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--es-system-line);
  border-radius: var(--es-r-sm);
  font-size: 17px;
  background: var(--es-surface);
  color: var(--es-text);
  transition: all 0.2s ease;
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
}

.text-input:focus {
  outline: none;
  border-color: var(--es-accent);
  box-shadow: 0 0 0 3px rgba(255,106,0,0.1);
}

/* ─── Toggle switch ─── */
.toggle-switch {
  position: relative;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #E5E5EA;
  border-radius: 31px;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

body.dark-mode .toggle-slider {
  background: #39393D;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 27px;
  height: 27px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  box-shadow: 0 3px 8px rgba(0,0,0,0.15), 0 1px 1px rgba(0,0,0,0.16);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--es-success);
}

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

/* Translation toggle - red color */
.toggle-switch.translation-toggle input:checked + .toggle-slider {
  background: var(--es-danger);
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(28,28,30,0.9);
  color: white;
  padding: 12px 24px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 200;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid rgba(255,255,255,0.1);
}

body.dark-mode .toast {
  background: rgba(58,58,60,0.9);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Empty state ─── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--es-text-dim);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-text {
  font-size: 14px;
  margin-bottom: 16px;
}

.empty-btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--es-accent);
  color: white;
  border: none;
  border-radius: var(--es-r-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s var(--es-spring-snappy);
}

.empty-btn:active { transform: scale(0.97); }

/* ─── FLASHCARD ─── */
.flashcard {
  margin: 20px 0;
  perspective: 1000px;
  overflow: hidden;
}

.flashcard-inner {
  position: relative;
  min-height: 240px;
  background: var(--es-surface);
  border-radius: var(--es-r-xl);
  padding: 36px 28px;
  box-shadow: var(--es-shadow-card);
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--es-system-line);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
}

body.dark-mode .flashcard-inner {
  background: rgba(58, 58, 60, 0.6);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: var(--es-shadow-card);
}

.flashcard-inner:active { transform: scale(0.98); opacity: 0.9; }

.flashcard-level {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--es-accent-bg);
  color: var(--es-accent);
  margin-bottom: 12px;
}

.flashcard-word {
  font-size: 26px;
  font-weight: 700;
  color: var(--es-accent);
}

.flashcard-divider {
  width: 32px;
  height: 2px;
  background: var(--es-accent);
  opacity: 0.3;
  margin: 14px auto;
  border-radius: 1px;
}

.flashcard-translation {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.flashcard-example {
  font-size: 13px;
  color: var(--es-text-dim);
  font-style: italic;
  line-height: 1.5;
}

.flashcard-tap-hint {
  font-size: 12px;
  color: rgba(8,18,38,0.50);
  margin-top: 14px;
}

.flashcard-category {
  font-size: 11px;
  color: var(--es-text-dim);
  margin-top: 8px;
}

/* ─── Rating buttons ─── */
.rating-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.rating-btn {
  padding: 12px 8px;
  border: none;
  border-radius: var(--es-r-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.rating-btn:active { transform: scale(0.95); opacity: 0.8; }

.rating-again { background: #fef2f2; color: #E31837; }
.rating-hard { background: #fff7ed; color: #ea580c; }
.rating-good { background: #f0fdf4; color: #00B050; }
.rating-easy { background: #fff8f0; color: var(--es-accent); }

body.dark-mode .rating-again { background: rgba(227,24,55,0.12); }
body.dark-mode .rating-hard { background: rgba(234,88,12,0.12); }
body.dark-mode .rating-good { background: rgba(0,176,80,0.12); }
body.dark-mode .rating-easy { background: rgba(255,140,0,0.12); }

.rating-label {
  display: block;
  font-size: 10px;
  font-weight: 400;
  margin-top: 2px;
  opacity: 0.6;
}

/* ─── QUIZ ─── */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.quiz-score {
  font-size: 14px;
  font-weight: 600;
  color: var(--es-accent);
}

.quiz-question-num {
  font-size: 12px;
  color: var(--es-text-dim);
}

.quiz-prompt {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  padding: 20px 16px;
  color: var(--es-text);
}

.quiz-options {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.quiz-option {
  padding: 18px;
  background: var(--es-surface);
  border: 1.5px solid var(--es-system-line);
  border-radius: var(--es-r-sm);
  font-size: 17px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  color: var(--es-text);
  box-shadow: var(--es-shadow-card);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
}

.quiz-option:active { transform: scale(0.98); opacity: 0.8; }
.quiz-option.correct { border-color: var(--es-success); background: rgba(52,199,89,0.15); }
.quiz-option.wrong { border-color: var(--es-danger); background: rgba(255,59,48,0.15); }

body.dark-mode .quiz-option.correct { background: rgba(48,209,88,0.2); }
body.dark-mode .quiz-option.wrong { background: rgba(255,69,58,0.2); }

.quiz-fill-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--es-system-line);
  border-radius: var(--es-r-sm);
  font-size: 16px;
  text-align: center;
  background: var(--es-bg);
  color: var(--es-text);
  margin-top: 16px;
}

.quiz-fill-input:focus {
  outline: none;
  border-color: var(--es-accent);
}

.quiz-type-tabs {
  display: flex;
  gap: 0;
  background: rgba(8,18,38,0.70);
  border-radius: var(--es-r-sm);
  padding: 3px;
  margin-bottom: 16px;
}

.quiz-type-tab {
  flex: 1;
  padding: 7px 4px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--es-text-dim);
  transition: all 0.2s var(--es-spring-snappy);
  white-space: nowrap;
}

.quiz-type-tab.active {
  background: var(--es-surface);
  color: var(--es-accent);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.quiz-result {
  text-align: center;
  padding: 32px 16px;
}

.quiz-result-score {
  font-size: 44px;
  font-weight: 700;
  color: var(--es-accent);
}

.quiz-result-label {
  font-size: 14px;
  color: var(--es-text-dim);
  margin-top: 4px;
}

.quiz-result-pct {
  font-size: 18px;
  font-weight: 600;
  margin-top: 12px;
}

.quiz-btn {
  width: 100%;
  padding: 14px;
  background: var(--es-accent);
  color: white;
  border: none;
  border-radius: var(--es-r-sm);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 12px;
  box-shadow: 0 2px 8px rgba(255,106,0,0.25);
}

.quiz-btn:hover { opacity: 0.9; }
.quiz-btn:active { transform: scale(0.98); opacity: 0.8; }

/* ─── DICTIONARY ─── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--es-surface);
  border-radius: var(--es-r-sm);
  padding: 6px;
  margin-bottom: 14px;
  box-shadow: var(--es-shadow-card);
  border: 1px solid var(--es-system-line);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
}

body.dark-mode .search-bar {
  background: rgba(58, 58, 60, 0.6);
  border: 1px solid rgba(255,255,255,0.18);
}

.search-input {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--es-text);
  outline: none;
}

.search-input::placeholder { color: rgba(8,18,38,0.50); }

.filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(8,18,38,0.70);
  color: var(--es-text-dim);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.filter-pill.active {
  background: var(--es-accent);
  color: white;
  box-shadow: 0 2px 6px rgba(255,106,0,0.3);
}

.word-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--es-surface);
  border-radius: var(--es-r-sm);
  margin-bottom: 10px;
  box-shadow: var(--es-shadow-card);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--es-system-line);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
}

body.dark-mode .word-item {
  background: rgba(58, 58, 60, 0.6);
  border: 1px solid rgba(255,255,255,0.18);
}

.word-item:active { transform: scale(0.99); opacity: 0.8; }

.word-info { flex: 1; }

.word-english {
  font-size: 15px;
  font-weight: 600;
}

.word-russian {
  font-size: 13px;
  color: var(--es-text-dim);
  margin-top: 2px;
}

.word-tags {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.word-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(8,18,38,0.70);
  color: var(--es-text-dim);
}

.word-tag.level {
  background: var(--es-accent-bg);
  color: var(--es-accent);
  font-weight: 600;
}

.word-tag.learned { background: #ecfdf5; color: #00B050; }
.word-tag.learning { background: #fff7ed; color: #ed8936; }

body.dark-mode .word-tag.learned { background: rgba(0,200,83,0.12); }
body.dark-mode .word-tag.learning { background: rgba(237,137,54,0.12); }

.word-status {
  font-size: 18px;
  flex-shrink: 0;
  margin-left: 12px;
}

.word-count {
  font-size: 12px;
  color: var(--es-text-dim);
  text-align: center;
  margin-bottom: 12px;
}

/* ─── FAB button ─── */
.fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--es-accent);
  color: white;
  border: none;
  font-size: 26px;
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(255,106,0,0.35), 0 8px 32px rgba(255,106,0,0.2);
}

.fab:active { transform: scale(0.92); opacity: 0.9; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.show { opacity: 1; pointer-events: auto; }

.modal-content {
  background: var(--es-surface);
  border-radius: 20px 20px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.36, 0.66, 0.04, 1);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  backdrop-filter: blur(30px) saturate(200%);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.12);
  border: 1px solid var(--es-system-line);
}

body.dark-mode .modal-content {
  background: rgba(58, 58, 60, 0.7);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.6);
}

.modal-overlay.show .modal-content { transform: translateY(0); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--es-text-dim);
  padding: 4px;
}

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

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--es-text-dim);
  margin-bottom: 4px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--es-system-line);
  border-radius: var(--es-r-sm);
  font-size: 14px;
  background: var(--es-bg);
  color: var(--es-text);
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--es-accent);
}

.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--es-system-line);
  border-radius: var(--es-r-sm);
  font-size: 14px;
  background: var(--es-bg);
  color: var(--es-text);
  appearance: none;
  cursor: pointer;
}

.form-btn {
  width: 100%;
  padding: 14px;
  background: var(--es-accent);
  color: white;
  border: none;
  border-radius: var(--es-r-sm);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(255,106,0,0.25);
}

.form-btn:hover { opacity: 0.9; }
.form-btn:active { transform: scale(0.98); opacity: 0.8; }

.form-btn-danger {
  background: var(--es-danger);
  margin-top: 8px;
}

/* ─── STATS ─── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--es-surface);
  border-radius: var(--es-r-xl);
  padding: 18px;
  text-align: center;
  box-shadow: var(--es-shadow-card);
  border: 1px solid var(--es-system-line);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}

body.dark-mode .stat-card {
  background: rgba(58, 58, 60, 0.6);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: var(--es-shadow-card);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--es-accent);
}

.stat-label {
  font-size: 11px;
  color: var(--es-text-dim);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--es-system-line);
}

.progress-row:last-child { border-bottom: none; }

.progress-row-label {
  font-size: 13px;
  width: 80px;
  flex-shrink: 0;
}

.progress-row-bar {
  flex: 1;
  height: 6px;
  background: rgba(8,18,38,0.85);
  border-radius: 3px;
  overflow: hidden;
}

.progress-row-fill {
  height: 100%;
  background: var(--es-accent);
  border-radius: 3px;
  transition: width 0.4s;
}

.progress-row-pct {
  font-size: 12px;
  font-weight: 600;
  width: 40px;
  text-align: right;
  color: var(--es-accent);
}

/* ─── CARD CONTENT (Claude-generated) ─── */
.card-content {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.6;
  color: var(--es-text);
  text-align: left;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px 0;
}

/* ─── GROUP TABS ─── */
.group-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.group-tab {
  padding: 7px 16px;
  border-radius: 20px;
  background: rgba(8,18,38,0.70);
  color: var(--es-text-dim);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.group-tab.active {
  background: var(--es-accent);
  color: white;
  box-shadow: 0 2px 6px rgba(255,106,0,0.3);
}

.group-tab.new-group {
  background: var(--es-accent-bg);
  color: var(--es-accent);
}

.group-tab.new-group.active {
  background: var(--es-accent);
  color: white;
  box-shadow: 0 2px 6px rgba(255,106,0,0.3);
}

/* ─── NAV BUTTONS ─── */
.nav-buttons {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.nav-btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: var(--es-r-sm);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:active { transform: scale(0.97); opacity: 0.8; }
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.nav-btn:disabled:active { transform: none; opacity: 0.3; }

.nav-btn-prev {
  background: rgba(8,18,38,0.70);
  color: var(--es-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.nav-btn-next {
  background: var(--es-accent);
  color: white;
  box-shadow: 0 2px 8px rgba(255,106,0,0.3);
}

body.dark-mode .nav-btn-next {
  box-shadow: 0 2px 8px rgba(255,106,0,0.4);
}

/* ─── FLASHCARD PROGRESS ─── */
.flashcard-progress {
  font-size: 12px;
  color: var(--es-text-dim);
  text-align: center;
  margin-bottom: 8px;
}

/* ─── GENERATE BUTTON ─── */
.generate-btn {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 14px;
  background: var(--es-accent);
  color: white;
  border: none;
  border-radius: var(--es-r-sm);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(255,106,0,0.25);
}

.generate-btn:hover { opacity: 0.9; }
.generate-btn:active { transform: scale(0.98); opacity: 0.8; }
.generate-btn:disabled { opacity: 0.4; cursor: default; }

/* ─── LOADING & SPINNER ─── */
.loading-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--es-text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(8,18,38,0.85);
  border-top-color: var(--es-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

/* ─── WORD META ─── */
.word-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  margin-left: 12px;
}

/* ─── MASTERY BADGES ─── */
.mastery-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.mastery-0 { background: rgba(8,18,38,0.70); color: rgba(8,18,38,0.50); }
.mastery-1 { background: #fff3e0; color: var(--es-accent); }
.mastery-2 { background: #fff7ed; color: #ed8936; }
.mastery-3 { background: #fef3c7; color: #b45309; }
.mastery-4 { background: #ecfdf5; color: #00B050; }
.mastery-5 { background: #f0fdf4; color: #15803d; }

body.dark-mode .mastery-0 { background: rgba(158,158,158,0.12); }
body.dark-mode .mastery-1 { background: rgba(255,140,0,0.12); }
body.dark-mode .mastery-2 { background: rgba(237,137,54,0.12); }
body.dark-mode .mastery-3 { background: rgba(180,83,9,0.12); }
body.dark-mode .mastery-4 { background: rgba(0,200,83,0.12); }
body.dark-mode .mastery-5 { background: rgba(21,128,61,0.15); }

/* ─── SPELL CHECK (flashcard) ─── */
.spell-check-area {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  width: 100%;
}

.spell-input {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid var(--es-system-line);
  border-radius: var(--es-r-sm);
  font-size: 16px;
  background: var(--es-surface);
  color: var(--es-text);
  text-align: center;
  transition: border-color 0.2s;
}

.spell-input:focus {
  outline: none;
  border-color: var(--es-accent);
}

.spell-btn {
  padding: 10px 16px;
  border: none;
  border-radius: var(--es-r-sm);
  background: var(--es-accent);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s var(--es-spring-snappy);
}

.spell-btn:active { transform: scale(0.93); }

.spell-result {
  text-align: center;
  padding: 8px;
  border-radius: var(--es-r-sm);
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
}

.spell-correct { background: #ecfdf5; color: #00B050; }
.spell-close { background: #fff7ed; color: #ed8936; }
.spell-wrong { background: #fef2f2; color: #E31837; }

body.dark-mode .spell-correct { background: rgba(0,200,83,0.12); }
body.dark-mode .spell-close { background: rgba(237,137,54,0.12); }
body.dark-mode .spell-wrong { background: rgba(255,68,68,0.12); }

/* ─── HEATMAP CALENDAR ─── */
.heatmap-grid {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 4px 0;
}

.heatmap-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.heatmap-cell {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: rgba(8,18,38,0.70);
}

.heatmap-cell.l1 { background: #ffcc80; }
.heatmap-cell.l2 { background: #ff9800; }
.heatmap-cell.l3 { background: var(--es-accent); }

body.dark-mode .heatmap-cell { background: rgba(8,18,38,0.85); }
body.dark-mode .heatmap-cell.l1 { background: rgba(255,140,0,0.2); }
body.dark-mode .heatmap-cell.l2 { background: rgba(255,140,0,0.4); }
body.dark-mode .heatmap-cell.l3 { background: rgba(255,140,0,0.7); }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 10px;
  color: var(--es-text-dim);
  justify-content: flex-end;
}

.heatmap-legend-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* ─── REVIEW QUEUE ─── */
.review-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--es-surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  border-radius: var(--es-r-sm);
}

body.dark-mode .review-item {
  border: 1px solid rgba(255,255,255,0.06);
}

.review-item-word {
  font-size: 14px;
  font-weight: 600;
}

.review-item-due {
  font-size: 11px;
  color: var(--es-danger);
  font-weight: 500;
}

/* ─── DIFFICULT WORDS ─── */
.difficult-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--es-system-line);
}

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

.difficult-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--es-danger);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.difficult-word {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}

.difficult-rate {
  font-size: 12px;
  color: var(--es-danger);
  font-weight: 500;
}

/* ─── QUIZ HISTORY ─── */
.quiz-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--es-system-line);
}

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

.quiz-history-date {
  font-size: 12px;
  color: var(--es-text-dim);
}

.quiz-history-mode {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--es-accent-bg);
  color: var(--es-accent);
  font-weight: 500;
}

.quiz-history-score {
  font-size: 14px;
  font-weight: 700;
  color: var(--es-success);
}

/* ─── SORT DROPDOWN ─── */
.sort-select {
  padding: 7px 10px;
  border: 1px solid var(--es-system-line);
  border-radius: var(--es-r-sm);
  font-size: 13px;
  background: var(--es-surface);
  color: var(--es-text);
  cursor: pointer;
  margin-bottom: 12px;
}

.sort-select:focus {
  outline: none;
  border-color: var(--es-accent);
}

/* ─── MASTERY CHART BAR ─── */
.mastery-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.mastery-bar-label {
  font-size: 11px;
  width: 70px;
  flex-shrink: 0;
  color: var(--es-text-dim);
}

.mastery-bar-track {
  flex: 1;
  height: 18px;
  background: rgba(8,18,38,0.70);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.mastery-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.mastery-bar-count {
  font-size: 11px;
  font-weight: 600;
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

/* ─── STREAK CARD ─── */
.streak-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--es-accent);
  text-align: center;
}

.streak-label {
  font-size: 12px;
  color: var(--es-text-dim);
  text-align: center;
  margin-top: 2px;
}

/* ─── AI QUIZ RESULT BREAKDOWN ─── */
.result-breakdown {
  margin-top: 16px;
  text-align: left;
}

.result-word-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--es-system-line);
  font-size: 14px;
}

.result-word-row:last-child { border-bottom: none; }

.result-word-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.result-word-text {
  flex: 1;
  font-weight: 500;
}

/* ─── Translation Toggle ─── */
.translation {
  color: var(--es-text-dim);
  transition: opacity 0.2s ease, max-height 0.2s ease;
}

body.hide-translation .translation {
  display: none;
}

/* ─── Responsive ─── */
@media (max-width: 400px) {
  .container { padding: 12px; padding-bottom: 90px; }
  .card { padding: 14px; }
}

/* ════════════════════════════════════════════════════════════════════════
   GAMIFICATION SYSTEM
   ════════════════════════════════════════════════════════════════════════ */

/* ─── Celebration Modal ─── */
.celebration-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.3s var(--es-spring-snappy);
}

.celebration-modal.active {
  background: rgba(0, 0, 0, 0.4);
  pointer-events: all;
}

body.dark-mode .celebration-modal.active {
  background: rgba(0, 0, 0, 0.7);
}

.celebration-content {
  width: 100%;
  max-width: 480px;
  background: var(--es-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px 24px 0 0;
  padding: 32px 24px 40px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.4s var(--es-spring-snappy);
  text-align: center;
  border: 1px solid var(--es-system-line);
  border-bottom: none;
}

.celebration-modal.active .celebration-content {
  transform: translateY(0);
}

.celebration-emoji {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 16px;
  animation: celebrationBounce 0.6s var(--es-spring-snappy);
}

@keyframes celebrationBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.celebration-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--es-accent) 0%, var(--es-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.celebration-subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.xp-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--es-accent), var(--es-gold));
  color: white;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(255, 106, 0, 0.3);
}

.group-badge {
  display: inline-block;
  background: rgba(8,18,38,0.70);
  color: var(--es-text);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
}

/* ─── Progress Ring ─── */
.progress-ring-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: rgba(8,18,38,0.70);
  stroke-width: 8;
}

.progress-ring-fill {
  fill: none;
  stroke: url(#progressGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 0.6s var(--es-spring-snappy);
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  font-weight: 700;
  color: var(--es-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.progress-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--es-text-dim);
  margin-top: -4px;
}

/* ─── Achievement Unlocked Banner ─── */
.achievement-unlocked {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--es-accent-bg);
  border: 2px dashed var(--es-accent);
  border-radius: var(--es-r-xl);
  animation: achievementReveal 0.5s var(--es-spring-snappy) 0.3s backwards;
}

@keyframes achievementReveal {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

.achievement-badge-unlocked {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: white;
  border-radius: var(--es-r-sm);
  box-shadow: var(--es-shadow-card);
}

body.dark-mode .achievement-badge-unlocked {
  background: rgba(8,18,38,0.70);
}

.achievement-icon-large {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
}

.achievement-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--es-text);
  text-align: left;
}

/* ─── Celebration Button ─── */
.celebration-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--es-accent) 0%, var(--es-gold) 100%);
  border: none;
  border-radius: var(--es-r-sm);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.3);
  transition: transform 0.15s var(--es-spring-snappy), box-shadow 0.15s;
}

.celebration-btn:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(255, 106, 0, 0.3);
}

/* ─── Achievement Grid (Stats Page) ─── */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

@media (min-width: 400px) {
  .achievement-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.achievement-item {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background: var(--es-surface);
  border: 2px solid var(--es-system-line);
  border-radius: var(--es-r-sm);
  cursor: pointer;
  transition: all 0.2s var(--es-spring-snappy);
  position: relative;
}

.achievement-item.unlocked {
  border-color: var(--es-accent);
  background: var(--es-accent-bg);
  box-shadow: 0 2px 8px rgba(255, 106, 0, 0.15);
}

.achievement-item.locked {
  opacity: 0.5;
}

.achievement-item:active {
  transform: scale(0.95);
}

.achievement-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 6px;
}

.achievement-item.locked .achievement-icon {
  filter: grayscale(100%);
  opacity: 0.4;
}

.achievement-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--es-text);
  text-align: center;
  line-height: 1.2;
  margin-bottom: 4px;
}

.achievement-date {
  font-size: 9px;
  color: var(--es-text-dim);
  text-align: center;
}

.achievement-progress {
  font-size: 9px;
  color: var(--es-text-dim);
  text-align: center;
  background: rgba(8,18,38,0.70);
  padding: 2px 6px;
  border-radius: 8px;
  margin-top: 4px;
}

/* ─── XP Progress Bar ─── */
.xp-progress-container {
  margin: 16px 0;
}

.xp-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.xp-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--es-accent), var(--es-gold));
  color: white;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(255, 106, 0, 0.3);
}

.xp-text {
  font-size: 13px;
  color: var(--es-text-dim);
  font-weight: 500;
}

.xp-progress-bar {
  height: 8px;
  background: rgba(8,18,38,0.70);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.xp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--es-accent) 0%, var(--es-gold) 100%);
  border-radius: 4px;
  transition: width 0.6s var(--es-spring-snappy);
  box-shadow: 0 0 8px rgba(255, 106, 0, 0.4);
}

/* ─── Confetti Container ─── */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}

/* ─── SVG Gradient Definitions ─── */
svg defs {
  position: absolute;
  width: 0;
  height: 0;
}

/* ─── Achievement Toast Enhancement ─── */
.toast.achievement {
  background: linear-gradient(135deg, var(--es-accent), var(--es-gold));
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(255, 106, 0, 0.4);
}

/* ─── Level Up Animation ─── */
@keyframes levelUpPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 6px rgba(255, 106, 0, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 106, 0, 0.6);
  }
}

.level-up-animation {
  animation: levelUpPulse 0.6s var(--es-spring-snappy) infinite;
}


/* === Zam-Vision Hub Bar (nav back to hub) === */
#zvHubBar {
  position: sticky;
  top: 0;
  z-index: 9999;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(4, 4, 8, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  box-sizing: border-box;
  flex-shrink: 0;
}
.zv-hub-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: color 0.15s;
  user-select: none;
}
.zv-hub-link:hover { color: rgba(255,255,255,0.88); }
.zv-hub-mark {
  display: inline-flex;
  width: 20px; height: 20px;
  border-radius: 4px;
  background: #dc2626;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 900;
  color: white;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* WCAG 2.2 SC 2.3.3 — universal reduced-motion fallback */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }
}


/* ======== SL SYSTEM (from solo-leveling.css) ======== */

/* ============================================================
   HUNTER SYSTEM × SOLO LEVELING THEME
   Loaded AFTER styles.css + workout.css — overrides all visuals.
   v1 — 2026-05-07
   ============================================================ */


/* ============ CORE TOKENS ============ */
body.dark-mode,
body:not(.dark-mode) {
  --sl-bg-deep: var(--es-bg);
  --sl-bg: var(--es-surface-deep);
  --sl-bg-card: rgba(8, 18, 38, 0.78);
  --sl-bg-card-hover: rgba(12, 26, 50, 0.92);
  --sl-cyan: var(--es-system);
  --sl-cyan-dim: rgba(0, 246, 255, 0.4);
  --sl-cyan-glow: rgba(0, 246, 255, 0.6);
  --sl-purple: var(--es-purple);
  --sl-purple-dim: rgba(123, 45, 255, 0.4);
  --sl-purple-glow: rgba(123, 45, 255, 0.55);
  --sl-gold: var(--es-gold);
  --sl-gold-glow: rgba(255, 215, 0, 0.6);
  --sl-danger: var(--es-danger);
  --sl-success: #00ffa3;
  --sl-text: var(--es-text);
  --sl-text-dim: var(--es-text-dim);
  --sl-text-muted: #4a5f87;
  --sl-line: rgba(0, 246, 255, 0.12);
  --primary: var(--es-system);
  --bg: var(--es-surface-deep);
  --card-bg: var(--es-surface);
  --text: var(--es-text);
  --text-secondary: var(--es-text-dim);
  --success: var(--es-success);
  --danger: var(--es-danger);
}

/* ============ BACKGROUND — dungeon vibe ============ */
html, body {
  background: var(--es-bg);
  color: var(--es-text);
  font-family: 'Rajdhani', 'Inter', sans-serif;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

/* Dungeon void gradient + radial nebulae */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(123, 45, 255, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 35% at 80% 100%, rgba(0, 246, 255, 0.12), transparent 60%),
    linear-gradient(180deg, var(--es-bg) 0%, var(--es-surface-deep) 60%, #02060f 100%);
}

/* Scanline overlay */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 999; pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 2px,
    rgba(0, 246, 255, 0.025) 2px,
    rgba(0, 246, 255, 0.025) 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.5;
}

.container {
  position: relative;
  z-index: 1;
}

/* Hex-grid faint background pattern — only on home screen */
#homeView::before {
  content: '';
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 246, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 246, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 30%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 30%, black, transparent 80%);
}

/* ============ HEADER — system online ============ */
header {
  position: relative;
  padding: 18px 0 22px;
  margin-bottom: 8px;
}
header::before {
  content: '[ SYSTEM · ONLINE ]';
  position: absolute;
  top: -2px; left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--es-system);
  opacity: 0.7;
  text-shadow: 0 0 8px var(--es-system-glow);
}
header h1 img {
  filter: drop-shadow(0 0 12px var(--es-system-glow)) brightness(1.2);
  transition: filter 0.3s;
}
header h1 img:hover { filter: drop-shadow(0 0 18px var(--es-system-glow)) brightness(1.4); }

/* ============ HEADER TIMER ============ */
.header-timer {
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.06), rgba(123, 45, 255, 0.04));
  border: 1px solid var(--es-system-dim);
  border-radius: 4px;
  padding: 6px 12px;
  font-family: 'Orbitron', monospace;
  color: var(--es-system);
  text-shadow: 0 0 8px var(--es-system-glow);
  transition: all 0.2s;
}
.header-timer:hover {
  border-color: var(--es-system);
  box-shadow: 0 0 20px var(--es-system-glow);
}

.theme-toggle .toggle-track {
  background: rgba(0, 246, 255, 0.1);
  border: 1px solid var(--es-system-dim);
}
.theme-toggle .toggle-thumb {
  background: var(--es-system);
  box-shadow: 0 0 12px var(--es-system-glow);
}
.icon-btn {
  background: rgba(8, 18, 38, 0.6);
  border: 1px solid var(--es-system-dim);
  border-radius: 4px;
  color: var(--es-system);
}
.icon-btn:hover {
  border-color: var(--es-system);
  box-shadow: 0 0 14px var(--es-system-glow);
}

/* ============ BOTTOM NAV — hex hunter dock ============ */
.bottom-nav {
  background: linear-gradient(180deg, rgba(2, 6, 17, 0) 0%, rgba(2, 6, 17, 0.95) 50%);
  border-top: 1px solid var(--es-system-dim);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 -4px 30px rgba(0, 246, 255, 0.08);
}
.nav-item {
  color: var(--es-text-muted);
  font-family: 'Orbitron', monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.25s;
}
.nav-item.active {
  color: var(--es-system);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background: var(--es-system);
  box-shadow: 0 0 10px var(--es-system-glow);
}
.nav-item.active .nav-icon {
  filter: drop-shadow(0 0 6px var(--es-system-glow));
}

/* ============ CARDS — system frame ============ */
.card,
.body-weight-card,
.workout-banner,
.summary-card,
.workout-notes-card,
.modal-sheet,
#weeklySchedule > *,
#recentWorkouts > * {
  background: var(--es-surface);
  border: 1px solid var(--es-system-line);
  border-radius: 0;
  box-shadow:
    0 0 0 1px rgba(0, 246, 255, 0.04) inset,
    0 8px 30px rgba(0, 0, 0, 0.45);
  position: relative;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  clip-path: polygon(
    12px 0, calc(100% - 12px) 0, 100% 12px,
    100% calc(100% - 12px), calc(100% - 12px) 100%,
    12px 100%, 0 calc(100% - 12px), 0 12px
  );
}

/* Hex bracket corners on key cards */
.body-weight-card::before,
.workout-banner::before,
.summary-card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 16px; height: 16px;
  border-top: 2px solid var(--es-system);
  border-left: 2px solid var(--es-system);
  pointer-events: none;
}
.body-weight-card::after,
.workout-banner::after,
.summary-card::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 16px; height: 16px;
  border-bottom: 2px solid var(--es-purple);
  border-right: 2px solid var(--es-purple);
  pointer-events: none;
}

/* ============ TODAY HEADER — keep as transparent passthrough ============ */
/* Inner .today-header div already has its own styling from workout.css.
   We just give it Solo Leveling treatment via the generic .today-header rule below. */
#todayHeader {
  margin-bottom: 14px;
}
.today-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.08), rgba(123, 45, 255, 0.05));
  border: 1px solid var(--es-system-dim);
  border-left: 3px solid var(--es-system);
  border-radius: 0;
  padding: 36px 16px 18px;
  clip-path: none;
  overflow: visible;
}
.today-header::after {
  content: '▾ DUNGEON';
  position: absolute;
  top: 14px; right: 16px; left: auto;
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--es-system);
  opacity: 0.85;
  text-shadow: 0 0 6px var(--es-system-glow);
  pointer-events: none;
  padding: 3px 10px;
  white-space: nowrap;
  background: rgba(0, 246, 255, 0.1);
  border: 1px solid rgba(0, 246, 255, 0.4);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}
.today-header.recovery::after {
  content: '◆ REST · DAY';
  color: var(--es-purple);
  text-shadow: 0 0 6px var(--es-purple-glow);
}
.today-header-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.2), rgba(123, 45, 255, 0.12));
  border: 1px solid rgba(0, 246, 255, 0.5);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  box-shadow: 0 0 12px rgba(0, 246, 255, 0.35), inset 0 0 8px rgba(0, 246, 255, 0.12);
  flex-shrink: 0;
  filter: drop-shadow(0 0 5px rgba(0, 246, 255, 0.5));
}
.today-header-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 0 12px var(--es-system-glow);
  margin-bottom: 6px;
}
.today-header-sub {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--es-text-dim);
  text-transform: uppercase;
}

/* ============ SECTION LABEL — quest log header ============ */
.section-label {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--es-system);
  opacity: 0.85;
  margin: 22px 0 10px;
  padding-left: 14px;
  position: relative;
}
.section-label::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 8px; height: 8px;
  background: var(--es-system);
  transform: translateY(-50%) rotate(45deg);
  box-shadow: 0 0 10px var(--es-system-glow);
}

/* ============ BUTTONS — angular system buttons ============ */
.btn,
button.btn,
.warmup-start-btn,
.finish-btn,
.wizard-nav-btn,
.timer-preset {
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.05), rgba(123, 45, 255, 0.03));
  border: 1px solid var(--es-system-dim);
  color: var(--es-system);
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 0;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.btn:hover, button.btn:hover, .timer-preset:hover {
  border-color: var(--es-system);
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.15), rgba(123, 45, 255, 0.08));
  color: #fff;
  text-shadow: 0 0 8px var(--es-system-glow);
  box-shadow: 0 0 20px var(--es-system-glow);
  transform: translateY(-1px);
}
.btn-primary, .finish-btn {
  background: linear-gradient(135deg, var(--es-system), #0099cc);
  color: #02060f;
  border-color: var(--es-system);
  font-weight: 800;
  text-shadow: none;
  box-shadow: 0 0 28px var(--es-system-glow), inset 0 0 20px rgba(255, 255, 255, 0.15);
}
.btn-primary:hover, .finish-btn:hover {
  background: linear-gradient(135deg, #4dffff, var(--es-system));
  box-shadow: 0 0 38px var(--es-system-glow);
}
.btn-secondary {
  background: linear-gradient(135deg, rgba(123, 45, 255, 0.15), rgba(0, 246, 255, 0.05));
  border-color: var(--es-purple-dim);
  color: #c4a5ff;
}
.btn-secondary:hover {
  border-color: var(--es-purple);
  box-shadow: 0 0 24px var(--es-purple-glow);
  color: #fff;
}
.btn-outline, .btn-ghost {
  background: rgba(8, 18, 38, 0.4);
  border-color: var(--es-text-muted);
  color: var(--es-text-dim);
}
.btn-outline:hover, .btn-ghost:hover {
  border-color: var(--es-system);
  color: var(--es-system);
}

/* ============ WARMUP START BUTTON — quest entry point ============ */
.warmup-start-btn {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(0, 246, 255, 0.05));
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: var(--es-gold);
  padding: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.warmup-start-btn::before {
  content: '▣ NEW QUEST AVAILABLE ▣';
  display: block;
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--es-gold);
  opacity: 0.75;
  margin-bottom: 6px;
}
.warmup-start-btn:hover {
  border-color: var(--es-gold);
  box-shadow: 0 0 35px var(--es-gold-glow);
  text-shadow: 0 0 8px var(--es-gold-glow);
}
.warmup-start-text {
  font-size: 17px;
  letter-spacing: 0.15em;
}
.warmup-start-sub {
  font-size: 11px;
  opacity: 0.7;
}

/* ============ INPUTS ============ */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select {
  background: rgba(2, 6, 17, 0.8);
  border: 1px solid var(--es-system-dim);
  color: var(--es-text);
  border-radius: 0;
  padding: 10px 14px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  letter-spacing: 0.02em;
  transition: all 0.2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--es-system);
  box-shadow: 0 0 18px var(--es-system-glow), inset 0 0 12px rgba(0, 246, 255, 0.06);
  background: rgba(8, 18, 38, 0.95);
}

/* Body weight card big number — wide enough for 3 digits at 36px */
.body-weight-input-wrap {
  flex-shrink: 0;
  min-width: 0;
}
.body-weight-input-wrap input {
  font-family: 'Orbitron', monospace;
  font-weight: 800;
  font-size: 32px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--es-system);
  text-shadow: 0 0 14px var(--es-system-glow);
  width: 130px;          /* fits 3 digits + spinner */
  padding: 4px 6px;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.body-weight-label {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--es-system);
  text-transform: uppercase;
  opacity: 0.8;
}
.body-weight-unit {
  color: var(--es-system);
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0, 246, 255, 0.6);
  margin-left: 8px;
  opacity: 0.95;
}

/* ============ WORKOUT BANNER — active dungeon HUD ============ */
.workout-banner {
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.1), rgba(123, 45, 255, 0.06));
  border: 1px solid var(--es-system);
  padding: 38px 18px 16px;
  position: relative;
  text-align: center;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px));
  overflow: visible;
}
.workout-banner::before {
  content: '◆ DUNGEON';
  position: absolute;
  top: 14px;
  left: 50%;
  right: auto;
  bottom: auto;
  width: auto;
  height: auto;
  transform: translateX(-50%);
  background: rgba(0, 246, 255, 0.1);
  border: 1px solid rgba(0, 246, 255, 0.4);
  padding: 4px 14px;
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--es-system);
  text-shadow: 0 0 8px var(--es-system-glow);
  white-space: nowrap;
  text-align: center;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 100%, 0 100%);
  box-shadow: 0 0 12px rgba(0, 246, 255, 0.2);
  z-index: 5;
}
/* Disable the inherited corner bracket on workout-banner — we use ::before for the pill */
.workout-banner::after {
  content: '';
  border-bottom: 2px solid var(--es-purple);
  border-right: 2px solid var(--es-purple);
  width: 16px;
  height: 16px;
  bottom: -1px;
  right: -1px;
  top: auto;
  left: auto;
  background: none;
  padding: 0;
}
.workout-banner-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.workout-banner-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: 0 0 16px var(--es-system-glow), 0 0 30px rgba(0, 246, 255, 0.4);
  line-height: 1;
  text-transform: uppercase;
}
.workout-banner-timer {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.1em;
  color: var(--es-system);
  text-shadow: 0 0 12px var(--es-system-glow);
  padding: 3px 14px;
  background: rgba(0, 246, 255, 0.06);
  border: 1px solid rgba(0, 246, 255, 0.35);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 100%, 0 100%);
}
.workout-banner-meta {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--es-text-dim);
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  gap: 18px;
}
.workout-banner-meta span { position: relative; }
.workout-banner-meta span + span::before {
  content: '·';
  position: absolute;
  left: -12px;
  color: var(--es-system);
  opacity: 0.6;
}

/* ============ EXERCISE CARDS / BATTLE LOG ============ */
.exercise-card,
#workoutExercises > div {
  background: var(--es-surface);
  border: 1px solid var(--es-system-line);
  border-left: 2px solid var(--es-purple-dim);
  border-radius: 0;
  margin-bottom: 10px;
}
.exercise-card .exercise-name,
#workoutExercises h3 {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--es-text);
  text-shadow: 0 0 6px rgba(0, 246, 255, 0.15);
}

/* Set rows */
.set-row {
  font-family: 'Orbitron', monospace;
  border: 1px solid var(--es-system-line);
  background: rgba(2, 6, 17, 0.5);
}
.set-row.completed {
  border-color: var(--es-success);
  background: rgba(0, 255, 163, 0.05);
  box-shadow: 0 0 12px rgba(0, 255, 163, 0.2);
}

/* ============ WIZARD (warmup) — quest progression ============ */
.wizard-top-bar {
  border-bottom: 1px solid var(--es-system-dim);
  background: rgba(2, 6, 17, 0.85);
}
.wizard-cancel-btn {
  background: rgba(255, 51, 102, 0.1);
  border: 1px solid rgba(255, 51, 102, 0.4);
  border-radius: 0;
  color: var(--es-danger);
}
.wizard-timer {
  font-family: 'Orbitron', monospace;
  color: var(--es-system);
  text-shadow: 0 0 8px var(--es-system-glow);
  font-weight: 700;
}
.wizard-step-counter {
  font-family: 'Orbitron', monospace;
  color: var(--es-text-dim);
  letter-spacing: 0.15em;
}
.wizard-progress {
  background: rgba(0, 246, 255, 0.06);
  border: 1px solid var(--es-system-dim);
  height: 4px;
}
.wizard-progress-bar {
  background: linear-gradient(90deg, var(--es-system), var(--es-purple));
  box-shadow: 0 0 12px var(--es-system-glow);
}
.wizard-card {
  background: var(--es-surface);
  border: 1px solid var(--es-system-dim);
  border-radius: 0;
  position: relative;
  clip-path: polygon(
    16px 0, calc(100% - 16px) 0, 100% 16px,
    100% calc(100% - 16px), calc(100% - 16px) 100%,
    16px 100%, 0 calc(100% - 16px), 0 16px
  );
}

/* ============ SUMMARY CARD — quest cleared ============ */
.summary-card {
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.08), rgba(123, 45, 255, 0.05));
  border: 1px solid var(--es-system);
  padding: 28px 22px;
  text-align: center;
}
.summary-icon { animation: pulse-cyan 2s ease-in-out infinite; }
.summary-icon svg {
  width: 64px; height: 64px;
  stroke: var(--es-system);
  filter: drop-shadow(0 0 18px var(--es-system-glow));
}
.summary-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 0.15em;
  color: var(--es-system);
  text-shadow: 0 0 14px var(--es-system-glow);
  text-transform: uppercase;
}
.summary-title::before {
  content: '⚔ ';
}
.summary-stat-value {
  font-family: 'Orbitron', monospace;
  font-weight: 800;
  color: var(--es-system);
  text-shadow: 0 0 12px var(--es-system-glow);
}
.summary-stat-label {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--es-text-dim);
  text-transform: uppercase;
}

/* ============ MODALS — system dialog ============ */
.modal-overlay {
  background: rgba(2, 6, 17, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-sheet {
  background: var(--es-surface);
  border: 1px solid var(--es-system-dim);
  border-top: 2px solid var(--es-system);
  border-radius: 0;
  box-shadow: 0 -10px 40px rgba(0, 246, 255, 0.18);
}
.modal-handle {
  background: var(--es-system);
  box-shadow: 0 0 8px var(--es-system-glow);
}
.modal-title {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--es-system);
  text-shadow: 0 0 10px var(--es-system-glow);
}
.modal-title::before { content: '◆ '; }

/* ============ REST TIMER OVERLAY ============ */
.rest-timer-overlay {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.06), rgba(0, 246, 255, 0.04));
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 0;
  position: relative;
}
.rest-timer-overlay::before {
  content: '⏱ COOLDOWN ⏱';
  position: absolute;
  top: -8px; left: 12px;
  background: var(--es-bg);
  padding: 0 8px;
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--es-gold);
  text-shadow: 0 0 6px var(--es-gold-glow);
}
.rest-timer-time {
  font-family: 'Orbitron', monospace;
  font-weight: 800;
  color: var(--es-gold);
  text-shadow: 0 0 14px var(--es-gold-glow);
  font-size: 36px;
}
.rest-timer-label {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--es-gold);
  text-transform: uppercase;
}
.rest-timer-btn {
  background: rgba(255, 215, 0, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: var(--es-gold);
  font-family: 'Orbitron', monospace;
  border-radius: 0;
}
.rest-timer-btn:hover {
  border-color: var(--es-gold);
  background: rgba(255, 215, 0, 0.15);
  box-shadow: 0 0 14px var(--es-gold-glow);
}

/* ============ EMPTY STATES ============ */
.empty-state {
  background: rgba(8, 18, 38, 0.4);
  border: 1px dashed var(--es-system-line);
  color: var(--es-text-dim);
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.empty-state::before { content: '▤ '; opacity: 0.5; }

/* ============ TOAST — system notification ============ */
.toast {
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.95), rgba(123, 45, 255, 0.85));
  border: 1px solid var(--es-system);
  border-radius: 0;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #02060f;
  font-weight: 700;
  box-shadow: 0 0 30px var(--es-system-glow);
}
.toast::before {
  content: '[SYSTEM] ';
  font-weight: 800;
}

/* ============ HISTORY / STATS pages ============ */
table {
  background: var(--es-surface);
  border: 1px solid var(--es-system-line);
}
th {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--es-system);
  text-transform: uppercase;
  border-bottom: 1px solid var(--es-system-dim);
}
td { color: var(--es-text); border-color: var(--es-system-line); }

/* Stat values everywhere */
.stat-value, .stat-num, [class*="value"] {
  font-family: 'Orbitron', monospace;
  font-weight: 800;
  color: var(--es-system);
  text-shadow: 0 0 10px var(--es-system-glow);
}
.stat-label, [class*="label"] {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--es-text-dim);
}

/* Progress bars */
.progress-row-bar, [class*="progress-bar"] {
  background: rgba(0, 246, 255, 0.06);
  border: 1px solid var(--es-system-line);
  border-radius: 0;
}
.progress-row-fill, [class*="progress-fill"] {
  background: linear-gradient(90deg, var(--es-system), var(--es-purple));
  box-shadow: 0 0 12px var(--es-system-glow);
}

/* ============ ANIMATIONS ============ */
@keyframes pulse-cyan {
  0%, 100% { filter: drop-shadow(0 0 12px var(--es-system-glow)); }
  50%      { filter: drop-shadow(0 0 22px var(--es-system-glow)) brightness(1.2); }
}

@keyframes scan-line {
  0%   { transform: translateY(-100%); opacity: 0; }
  10%, 90% { opacity: 0.4; }
  100% { transform: translateY(100vh); opacity: 0; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 12px var(--es-system-glow); }
  50%      { box-shadow: 0 0 28px var(--es-system-glow); }
}

/* Active workout glow */
#activeView .workout-banner { animation: glow-pulse 3s ease-in-out infinite; }

/* ============ SYSTEM NOTIFICATION — standalone class ============ */
.sys-notif {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%) translateY(-200%);
  z-index: 9999;
  background: linear-gradient(135deg, rgba(8, 18, 38, 0.98), rgba(15, 25, 50, 0.98));
  border: 1px solid var(--es-system);
  border-left: 3px solid var(--es-system);
  padding: 14px 22px;
  min-width: 280px;
  max-width: 90vw;
  box-shadow: 0 0 40px var(--es-system-glow), 0 12px 40px rgba(0, 0, 0, 0.6);
  font-family: 'Orbitron', monospace;
  color: var(--es-text);
  letter-spacing: 0.05em;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
}
.sys-notif.visible { transform: translateX(-50%) translateY(0); }
.sys-notif-tag {
  font-size: 10px; letter-spacing: 0.3em; color: var(--es-system);
  text-shadow: 0 0 6px var(--es-system-glow);
  margin-bottom: 4px; font-weight: 700;
}
.sys-notif-msg { font-size: 14px; font-weight: 600; color: #fff; line-height: 1.3; }
.sys-notif-reward {
  margin-top: 6px; font-size: 11px; color: var(--es-gold);
  text-shadow: 0 0 6px var(--es-gold-glow); letter-spacing: 0.15em;
}

/* Disable any leftover light backgrounds */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--es-system-dim) transparent;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb {
  background: var(--es-system-dim);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover { background: var(--es-system); }

/* WCAG 2.2 SC 2.3.3 — universal reduced-motion fallback */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }
}


/* ======== SL EXTENSIONS (from sl-system.css) ======== */

/* ============================================================
   SL SYSTEM — ARISE overlay + enhanced background + runic patterns
   ============================================================
   v2 2026-05-17 — Premium tokens added per FRIDAY DESIGN_SYSTEM.md
   (NEON Phase 4a). Existing solo-leveling.css colors untouched.
   ============================================================ */

/* ============ PREMIUM TOKENS (extend solo-leveling.css :root) ============ */

/* ============ Component archetypes (extend, not replace) ============ */

.card-glass {
  background: var(--es-glass-bg);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
          backdrop-filter: blur(20px) saturate(140%);
  border: var(--es-glass-border);
  border-radius: var(--es-r-xl);
  padding: var(--es-s-8);
  box-shadow: var(--es-shadow-card);
}

.btn-primary,
.btn-ghost,
.btn-danger,
.btn-reward {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--es-s-2);
  min-height: 44px;
  padding: var(--es-s-3) var(--es-s-5);
  border-radius: var(--es-r-sm);
  font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--es-dur-fast) var(--es-spring-snappy);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: var(--sl-cyan, var(--es-system));
  color: var(--es-bg);
  border-color: var(--sl-cyan, var(--es-system));
}
.btn-primary:hover  { box-shadow: var(--es-glow-system); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(0.97); }
.btn-primary:focus-visible { outline: 2px solid var(--sl-cyan, var(--es-system)); outline-offset: 2px; }

.btn-ghost {
  background: transparent;
  color: var(--sl-text-dim, var(--es-text-dim));
  border-color: var(--sl-line, rgba(0, 246, 255, 0.12));
}
.btn-ghost:hover { border-color: rgba(0, 246, 255, 0.45); color: var(--sl-text, var(--es-text)); }
.btn-ghost:active { transform: scale(0.97); }

.btn-danger {
  background: transparent;
  color: var(--sl-danger, var(--es-danger));
  border-color: var(--sl-danger, var(--es-danger));
}
.btn-danger:hover { background: rgba(255, 51, 102, 0.10); }

.btn-reward {
  background: linear-gradient(135deg, var(--sl-gold, var(--es-gold)), var(--es-accent));
  color: var(--es-bg);
  box-shadow: var(--es-glow-gold);
}
.btn-reward:hover { box-shadow: var(--es-glow-gold), 0 6px 16px rgba(255, 215, 0, 0.3); transform: translateY(-1px); }

@media (pointer: coarse) {
  .btn-primary, .btn-ghost, .btn-danger, .btn-reward { min-height: 48px; }
}

.input-sl {
  width: 100%; min-height: 44px;
  padding: var(--es-s-3) var(--es-s-4);
  background: rgba(2, 6, 17, 0.6);
  border: 1px solid var(--sl-line, rgba(0, 246, 255, 0.12));
  border-radius: var(--es-r-sm);
  color: var(--sl-text, var(--es-text));
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color var(--es-dur-fast) ease, box-shadow var(--es-dur-fast) ease;
}
.input-sl:focus {
  border-color: rgba(0, 246, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 246, 255, 0.12), inset 0 0 12px rgba(0, 246, 255, 0.04);
}
.input-sl::placeholder { color: var(--sl-text-dim, var(--es-text-dim)); font-style: italic; }
@media (pointer: coarse) { .input-sl { min-height: 48px; } }

/* Chip — mastery / status tags */
.chip {
  display: inline-flex; align-items: center; gap: var(--es-s-1);
  padding: 2px var(--es-s-2);
  border-radius: var(--es-r-full);
  font: 700 10px/1 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.chip--low     { color: var(--es-mastery-0); }
.chip--mid     { color: var(--es-mastery-1); }
.chip--high    { color: var(--es-mastery-2); }
.chip--perfect { color: var(--es-mastery-3); background: rgba(0, 246, 255, 0.08); }

/* Rank letter (used on stats / dashboard) */
.rank-letter {
  font: 900 56px/1 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  text-shadow: 0 0 24px currentColor;
  font-variant-numeric: tabular-nums;
}
.rank-S { color: var(--sl-gold, var(--es-gold)); }
.rank-A { color: var(--sl-cyan, var(--es-system)); }
.rank-B { color: #a5b4fc; }
.rank-C { color: var(--sl-success, #00ffa3); }
.rank-D { color: var(--es-mastery-1); }
.rank-E { color: var(--es-accent); }
.rank-F { color: var(--sl-danger, var(--es-danger)); }

.xp-bar  { height: 6px; background: var(--sl-line, rgba(0, 246, 255, 0.12)); border-radius: var(--es-r-full); overflow: hidden; }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--sl-cyan, var(--es-system)), var(--sl-purple, var(--es-purple))); transition: width var(--es-dur-slow) var(--es-spring-settle); }



/* ============ ARISE FULL-SCREEN DRAMATIC OVERLAY ============ */
.arise-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0, 246, 255, 0.04), rgba(2, 6, 17, 0.95));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.arise-overlay.go { opacity: 1; }
.arise-overlay.out { opacity: 0; }

/* White flash on impact */
.arise-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.95), rgba(0, 246, 255, 0.4) 30%, transparent 70%);
  opacity: 0;
}
.arise-overlay.go .arise-flash {
  animation: arise-flash 0.5s ease-out 0.1s forwards;
}
@keyframes arise-flash {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Runic ring expanding behind text */
.arise-runes {
  position: absolute;
  width: 380px; height: 380px;
  border: 2px solid rgba(0, 246, 255, 0.7);
  border-radius: 50%;
  box-shadow:
    0 0 0 4px rgba(0, 246, 255, 0.15),
    0 0 80px rgba(0, 246, 255, 0.6),
    inset 0 0 60px rgba(0, 246, 255, 0.4);
  transform: scale(0);
  opacity: 0;
}
.arise-runes::before, .arise-runes::after {
  content: '';
  position: absolute;
  inset: 30px;
  border: 1px dashed rgba(123, 45, 255, 0.6);
  border-radius: 50%;
  animation: arise-rune-spin 16s linear infinite;
}
.arise-runes::after {
  inset: 80px;
  border-color: rgba(0, 246, 255, 0.4);
  animation-direction: reverse;
  animation-duration: 12s;
}
.arise-overlay.go .arise-runes {
  animation: arise-rune-grow 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}
@keyframes arise-rune-grow {
  0%   { transform: scale(0) rotate(-90deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg);  opacity: 1; }
}
@keyframes arise-rune-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Big ARISE text */
.arise-text {
  font-family: 'Orbitron', monospace;
  font-size: clamp(72px, 18vw, 180px);
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #fff;
  text-shadow:
    0 0 30px rgba(0, 246, 255, 1),
    0 0 60px rgba(0, 246, 255, 0.7),
    0 0 100px rgba(123, 45, 255, 0.6);
  position: relative;
  z-index: 2;
  transform: scale(0.4) translateY(40px);
  opacity: 0;
}
.arise-overlay.go .arise-text {
  animation: arise-text-pop 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards,
             arise-text-glitch 0.15s 1.7s 4;
}
@keyframes arise-text-pop {
  0%   { transform: scale(0.4) translateY(40px); opacity: 0; filter: blur(20px); }
  60%  { transform: scale(1.1) translateY(0);    opacity: 1; filter: blur(0); }
  100% { transform: scale(1) translateY(0);      opacity: 1; filter: blur(0); }
}
@keyframes arise-text-glitch {
  0%, 100% { text-shadow: 0 0 30px rgba(0, 246, 255, 1), 0 0 60px rgba(0, 246, 255, 0.7); }
  50%      { text-shadow: -4px 0 var(--es-danger), 4px 0 var(--es-system), 0 0 30px rgba(0, 246, 255, 1); }
}

.arise-sub {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4em;
  color: var(--es-gold);
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.8);
  margin-top: 12px;
  z-index: 2;
  opacity: 0;
}
.arise-overlay.go .arise-sub {
  animation: arise-sub 0.8s 1.4s forwards;
}
@keyframes arise-sub {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ ENHANCED BACKGROUND — Solo Leveling dungeon vibes ============ */

/* Animated runic grid drifting up — adds depth */
body::before {
  /* override the previous body::before — add runic SVG layer */
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(123, 45, 255, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 35% at 80% 100%, rgba(0, 246, 255, 0.12), transparent 60%),
    linear-gradient(180deg, var(--es-bg) 0%, var(--es-surface-deep) 60%, #02060f 100%);
}

/* Add slow-drifting hexagonal runic pattern as a separate layer */
body > .sl-bg-runes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='139' viewBox='0 0 120 139'><g fill='none' stroke='%2300f6ff' stroke-width='1'><path d='M30 0 l30 17.32 v34.64 l-30 17.32 -30 -17.32 v-34.64z'/><path d='M90 69.28 l30 17.32 v34.64 l-30 17.32 -30 -17.32 v-34.64z'/><circle cx='30' cy='34.64' r='5'/><circle cx='90' cy='103.92' r='5'/></g></svg>");
  background-size: 120px 139px;
  animation: sl-bg-drift 80s linear infinite;
}
@keyframes sl-bg-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 0 -139px; }
}

/* Subtle vignette */
body > .sl-vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 90% 70% at 50% 50%, transparent 40%, rgba(2, 6, 17, 0.7));
}

/* Center pulse (system core feel) */
body > .sl-pulse {
  position: fixed;
  top: 50%; left: 50%;
  width: 800px; height: 800px;
  margin: -400px 0 0 -400px;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(0, 246, 255, 0.05), transparent 70%);
  animation: sl-pulse 8s ease-in-out infinite;
}
@keyframes sl-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.1); opacity: 1; }
}

/* ============ HEX BORDER FRAME on container (subtle) ============ */
.container::before {
  content: '';
  position: fixed;
  top: 8px; left: 8px;
  width: 30px; height: 30px;
  border-top: 2px solid rgba(0, 246, 255, 0.45);
  border-left: 2px solid rgba(0, 246, 255, 0.45);
  pointer-events: none;
  z-index: 1000;
  filter: drop-shadow(0 0 4px rgba(0, 246, 255, 0.6));
}
.container::after {
  content: '';
  position: fixed;
  bottom: 80px; right: 8px;
  width: 30px; height: 30px;
  border-bottom: 2px solid rgba(123, 45, 255, 0.45);
  border-right: 2px solid rgba(123, 45, 255, 0.45);
  pointer-events: none;
  z-index: 1000;
  filter: drop-shadow(0 0 4px rgba(123, 45, 255, 0.6));
}

/* ============ Section labels with rune diamond ============ */
.section-label::after {
  content: '';
  display: inline-block;
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, var(--es-system), transparent);
  margin-left: 14px;
  vertical-align: middle;
  box-shadow: 0 0 6px rgba(0, 246, 255, 0.4);
}

/* ============ Active workout — pulsing aura ============ */
#activeView::before {
  content: '';
  position: fixed;
  inset: -40px;
  background: radial-gradient(ellipse at top, rgba(0, 246, 255, 0.08), transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: sl-pulse-aura 4s ease-in-out infinite;
}
@keyframes sl-pulse-aura {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* WCAG 2.2 SC 2.3.3 — universal reduced-motion fallback */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }
}
