:root {
  --red: #ed1d24;
  --red-glow: rgba(237, 29, 36, 0.45);
  --red-strong: #ff2d39;
  --ink: #070709;
  --ink-2: #0e0f17;
  --panel: rgba(17, 18, 24, 0.62);
  --panel-strong: rgba(21, 23, 31, 0.8);
  --panel-soft: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.14);
  --muted: #a9acb6;
  --gold: #f5c518;
  --gold-glow: rgba(245, 197, 24, 0.45);
  --gold-soft: rgba(245, 197, 24, 0.14);
  --green: #36bc70;
  --shadow-soft: 0 24px 60px rgba(0, 0, 0, 0.42);
  --glass-highlight: rgba(255, 255, 255, 0.16);
  --glass-edge: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(237, 29, 36, 0.28), transparent 16%),
    radial-gradient(circle at 82% 6%, rgba(245, 197, 24, 0.18), transparent 18%),
    radial-gradient(circle at 60% 100%, rgba(255, 96, 104, 0.09), transparent 22%),
    linear-gradient(140deg, #020408 0%, #0a0c14 30%, #111827 100%);
  color: #fff;
  font-family: 'Outfit', 'DM Sans', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.08), rgba(255,255,255,0) 30%),
    radial-gradient(circle at center, rgba(255,255,255,0.12), transparent 55%);
  z-index: -2;
}

/* Cinema Overlay Backdrop */
.cinema-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.cinema-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Glass panel utility */
.glass-panel {
  background: linear-gradient(180deg, rgba(31, 35, 46, 0.8), rgba(8, 10, 16, 0.86));
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 18px rgba(237, 29, 36, 0.08), 0 0 25px rgba(245, 197, 24, 0.05);
}

/* Header & Topbar */
.topbar {
  height: 84px;
  padding: 0 clamp(16px, 4vw, 60px);
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 10, 14, 0.7);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.22), 0 0 0 1px rgba(255,255,255,0.02);
}

.brand {
  display: flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 1px;
}

.brand span {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: var(--red);
  padding: 3px 7px 2px;
  margin-right: 8px;
  border-radius: 3px;
  box-shadow: 0 0 15px var(--red-glow);
}

.brand b {
  font-weight: 400;
  color: #fff;
}

.logo-img {
  height: 56px;
  width: auto;
  margin-right: 12px;
  filter: drop-shadow(0 0 8px rgba(255, 50, 50, 0.4));
  transition: filter 0.3s ease;
}

.brand:hover .logo-img {
  filter: drop-shadow(0 0 16px rgba(255, 50, 50, 0.6));
}

nav {
  display: flex;
  gap: 16px;
}

nav a {
  color: #a9a9ad;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.2s ease;
  padding: 6px 4px;
}

nav a:hover {
  color: #fff;
}

.topbar-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.topbar-icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.topbar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.topbar-icon-btn.active {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 15px var(--red-glow);
}

/* User Profile Chip Styling */
.user-chip-btn {
  background: rgba(245, 197, 24, 0.1);
  border-color: rgba(245, 197, 24, 0.3);
  color: var(--gold);
}

.user-chip-btn:hover {
  background: rgba(245, 197, 24, 0.2);
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(245, 197, 24, 0.3);
}

.user-chip-btn.has-user {
  background: rgba(237, 29, 36, 0.15);
  border-color: var(--red);
  color: #ffffff;
  font-weight: 800;
}

.user-chip-btn.has-user #topbar-username-text {
  color: var(--gold);
}

/* GitHub Card / Button Styling */
.github-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.github-btn:hover {
  background: #24292e;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
  color: #fff;
}

.github-icon {
  flex-shrink: 0;
}

/* Header Countdown Widget */
.countdown-widget {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.countdown-header-info {
  display: flex;
  flex-direction: column;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--red);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.countdown-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--red);
}

.countdown-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: #fff;
  white-space: nowrap;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.countdown-numbers {
  display: flex;
  gap: 5px;
}

.time {
  min-width: 32px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 4px 4px;
  color: #fff;
}

.time small {
  display: block;
  color: #88888c;
  font-size: 8px;
  margin-top: 1px;
}

/* Hero Section */
.hero {
  min-height: 520px;
  position: relative;
  padding: 60px clamp(16px, 6vw, 80px);
  display: grid;
  grid-template-columns: 1fr 420px;
  align-items: center;
  gap: 40px;
  background:
    linear-gradient(135deg, rgba(10, 11, 17, 0.8), rgba(17, 20, 28, 0.76)),
    radial-gradient(circle at 80% 30%, rgba(237, 29, 36, 0.22), transparent 45%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-copy {
  max-width: 600px;
}

.eyebrow {
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(52px, 6.5vw, 96px);
  line-height: 0.9;
  margin: 0;
  font-weight: 400;
  letter-spacing: 1px;
}

.hero h1 em {
  font-style: normal;
  color: var(--red);
  text-shadow: 0 0 30px var(--red-glow);
}

.hero-text {
  color: #b0b0b8;
  font-size: 16px;
  margin: 20px 0 30px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-btn, .secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.2px;
  padding: 14px 22px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid rgba(255,255,255,0.14);
  min-height: 44px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.primary-btn {
  background: linear-gradient(135deg, rgba(237, 29, 36, 0.96), rgba(180, 0, 12, 0.88));
  color: #fff;
  box-shadow: 0 14px 32px rgba(237, 29, 36, 0.48), inset 0 1px 0 rgba(255,255,255,0.18), 0 0 18px rgba(237,29,36,0.25);
}

.primary-btn:hover {
  transform: translateY(-2px);
  background: #ff2b33;
  box-shadow: 0 12px 35px rgba(237, 29, 36, 0.6);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 14px rgba(255,255,255,0.02);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(245, 197, 24, 0.08), inset 0 1px 0 rgba(255,255,255,0.12);
}

.glow-gold {
  border-color: rgba(245, 197, 24, 0.4);
  color: var(--gold);
}

.glow-gold:hover {
  box-shadow: 0 0 20px var(--gold-glow);
  color: #fff;
}

.btn-sm-full {
  width: 100%;
  padding: 10px;
  font-size: 11px;
}

/* Hero Countdown Card */
.hero-countdown-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, rgba(27, 30, 39, 0.84), rgba(10, 12, 18, 0.9));
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 22px 40px rgba(0,0,0,0.25), 0 0 20px rgba(237,29,36,0.08);
}

.countdown-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.live-indicator {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-indicator .dot {
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--red);
}

.phase-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  background: rgba(245, 197, 24, 0.15);
  color: var(--gold);
  border: 1px solid rgba(245, 197, 24, 0.3);
  border-radius: 6px;
  letter-spacing: 0.8px;
}

.hero-countdown-card h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  margin: 0;
  letter-spacing: 0.5px;
  line-height: 1;
}

.countdown-subtext {
  font-size: 12px;
  color: var(--muted);
  margin: -6px 0 6px;
}

.big-timer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.time-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 0 12px rgba(255,255,255,0.02);
}

.time-box span {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  line-height: 1;
  display: block;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.time-box small {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #7c7c85;
  display: block;
  margin-top: 4px;
}

.upcoming-selector-wrap {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upcoming-selector-wrap label {
  font-size: 11px;
  color: #999;
  font-weight: 600;
}

.custom-select {
  background: rgba(10, 12, 18, 0.7);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  padding: 10px 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  min-height: 42px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.custom-select:focus {
  border-color: var(--red);
}

/* Tracker Section */
.custom-entry-panel {
  padding: 28px;
  margin: 0 clamp(16px, 5vw, 70px) 30px;
}

.custom-entry-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.custom-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.custom-entry-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #dfe3eb;
  font-size: 12px;
  font-weight: 700;
}

.custom-entry-grid input {
  background: rgba(8, 10, 16, 0.72);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 10px;
  min-height: 42px;
  padding: 10px 12px;
  font: inherit;
}

.custom-entry-grid input:focus {
  outline: none;
  border-color: rgba(237, 29, 36, 0.7);
  box-shadow: 0 0 0 3px rgba(237, 29, 36, 0.12);
}

.custom-entry-actions {
  display: flex;
  justify-content: flex-end;
}

.tracker-section {
  padding: 60px clamp(16px, 5vw, 70px) 100px;
  background: rgba(8, 10, 14, 0.35);
}

/* Progress Dashboard */
.progress-dashboard {
  padding: 30px;
  margin-bottom: 30px;
  background: linear-gradient(180deg, rgba(19, 22, 31, 0.78), rgba(11, 13, 19, 0.82));
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.dashboard-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 52px;
  margin: 0;
  line-height: 0.9;
  letter-spacing: 1px;
  color: #fff;
}

.progress-stats-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 12px;
  color: #d0d0d5;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.stat-pill b {
  color: #fff;
}

/* Large Progress Bar */
.large-progress-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.large-progress-bar {
  height: 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.progress-fill-glow {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b70d19 0%, #ed1d24 50%, #ff5252 100%);
  box-shadow: 0 0 20px rgba(237, 29, 36, 0.7);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 10px;
}

.progress-quick-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.text-action-btn {
  background: none;
  border: 0;
  color: #aaa;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px 0;
}

.text-action-btn:hover {
  color: #fff;
}

.text-action-btn.text-danger:hover {
  color: #ff5252;
}

.text-action-btn.text-gold {
  color: var(--gold);
}

.text-action-btn.text-gold:hover {
  color: #fff;
  text-shadow: 0 0 8px var(--gold);
}

/* 🎬 Rutas Guiadas Section */
.guided-routes-section {
  padding: 24px 28px;
  margin-bottom: 30px;
  background: linear-gradient(180deg, rgba(20, 22, 29, 0.72), rgba(12, 14, 20, 0.8));
}

.routes-buttons-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.route-btn {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #b0b0b8;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  min-height: 42px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.route-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.route-btn.active {
  background: linear-gradient(135deg, rgba(237,29,36,0.98), rgba(155, 6, 17, 0.9));
  color: #fff;
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 6px 18px rgba(237, 29, 36, 0.38), inset 0 1px 0 rgba(255,255,255,0.1);
}

/* 🏆 Achievements Section */
.achievements-section {
  padding: 28px;
  margin-bottom: 30px;
  background: linear-gradient(180deg, rgba(19, 22, 31, 0.7), rgba(11, 13, 18, 0.8));
}

.section-title-wrap {
  margin-bottom: 20px;
}

.section-title-wrap h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  margin: 0;
  line-height: 1;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.achievement-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  opacity: 0.6;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.achievement-card.unlocked {
  opacity: 1;
  background: linear-gradient(180deg, rgba(245, 197, 24, 0.12), rgba(255,255,255,0.04));
  border-color: rgba(245, 197, 24, 0.35);
  box-shadow: 0 8px 20px rgba(245, 197, 24, 0.15), inset 0 1px 0 rgba(255,255,255,0.08);
}

.ach-icon {
  font-size: 32px;
  line-height: 1;
}

.ach-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ach-info h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.achievement-card.unlocked h4 {
  color: var(--gold);
}

.ach-info p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.ach-progress-bar {
  height: 5px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.ach-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
  transition: width 0.3s;
}

.ach-count {
  font-size: 10px;
  color: #888;
  font-weight: 600;
}

/* 🍿 Marathon Calculator Card */
.marathon-calculator-card {
  padding: 28px;
  margin-bottom: 35px;
  background: linear-gradient(180deg, rgba(20, 22, 29, 0.72), rgba(14, 16, 22, 0.82));
}

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

.marathon-header h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  margin: 0;
  line-height: 1;
}

.marathon-icon {
  font-size: 36px;
}

.marathon-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.marathon-result-box {
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.marathon-result-box.success {
  background: rgba(54, 188, 112, 0.12);
  border-color: rgba(54, 188, 112, 0.4);
  color: #e0f7ea;
}

.marathon-result-box.warning {
  background: rgba(237, 29, 36, 0.12);
  border-color: rgba(237, 29, 36, 0.4);
  color: #ffe6e7;
}

/* Controls Panel */
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 35px;
}

.sort-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.sort-label {
  font-size: 13px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toggle-switch-group {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
  flex-wrap: wrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.sort-btn {
  border: 0;
  background: transparent;
  color: #999;
  padding: 8px 16px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 38px;
}

.sort-btn:hover {
  color: #fff;
}

.sort-btn.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 15px var(--red-glow);
}

.filters-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #a5a5aa;
  padding: 8px 16px;
  border-radius: 30px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.filter span {
  font-size: 10px;
  opacity: 0.7;
  margin-left: 4px;
}

.filter:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.filter.active {
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(245, 212, 123, 0.76));
  color: #07070a;
  border-color: rgba(255,255,255,0.8);
  box-shadow: 0 10px 18px rgba(255,255,255,0.08), inset 0 1px 0 rgba(255,255,255,0.5), 0 0 18px rgba(245,197,24,0.12);
}

.phase-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 30px;
  width: 240px;
  transition: border-color 0.2s;
  min-height: 40px;
}

.search:focus-within {
  border-color: var(--red);
}

.search-icon {
  color: #777;
  font-size: 16px;
}

.search input {
  background: none;
  border: 0;
  color: #fff;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
}

/* Timeline Grid & Cards */
.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 28px 18px;
}

.title-card {
  position: relative;
  background: linear-gradient(180deg, rgba(31, 35, 45, 0.84), rgba(9, 12, 18, 0.92));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 8px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 18px 30px rgba(0,0,0,0.22), 0 0 0 1px rgba(255,255,255,0.02);
}

.title-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42), 0 0 18px rgba(237, 29, 36, 0.07);
}

.card-badge-wrap {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  display: flex;
  gap: 6px;
}

.chrono-badge {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  color: #fff;
  font-weight: 800;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.card-phase-badge {
  background: rgba(245, 197, 24, 0.85);
  color: #000;
  font-weight: 800;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
}

.poster-button {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  border: 0;
  background: linear-gradient(180deg, rgba(28,30,38,0.9), rgba(11,13,20,1));
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.poster-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.poster-button:hover img {
  transform: scale(1.06);
}

.poster-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.poster-button:hover .poster-overlay {
  opacity: 1;
}

.play-icon {
  width: 46px;
  height: 46px;
  background: var(--red);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  padding-left: 3px;
  box-shadow: 0 0 20px var(--red-glow);
}

.play-text {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
}

.poster-fallback {
  position: absolute;
  inset: 0;
  display: none;
  padding: 16px;
  align-items: flex-end;
  background: linear-gradient(135deg, #3c090f, #07070a);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  line-height: 0.9;
  text-align: left;
}

.poster-button.error .poster-fallback {
  display: flex;
}

.card-bottom {
  padding: 12px 4px 4px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
}

.card-title-group {
  flex: 1;
}

.card-meta {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 2px;
  letter-spacing: 0.6px;
}

.card-bottom h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 21px;
  line-height: 1;
  margin: 0 0 4px;
  letter-spacing: 0.4px;
}

.card-user-stars {
  color: var(--gold);
  font-size: 12px;
  display: none;
  letter-spacing: 2px;
}

.card-user-stars.active {
  display: block;
}

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

.seen-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #aaa;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: all 0.2s ease;
}

.seen-toggle:hover {
  border-color: #fff;
  color: #fff;
}

.title-card.seen {
  border-color: rgba(54, 188, 112, 0.35);
  background: rgba(10, 25, 16, 0.5);
}

.title-card.seen .seen-toggle {
  background: var(--green);
  border-color: var(--green);
  color: #000;
  box-shadow: 0 0 12px rgba(54, 188, 112, 0.5);
}

.highlight-pulse {
  animation: highlight-pulse-anim 1.5s infinite alternate;
  border-color: var(--gold) !important;
  box-shadow: 0 0 30px var(--gold-glow) !important;
}

@keyframes highlight-pulse-anim {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* Up Next Section */
.up-next {
  padding: 80px clamp(20px, 8vw, 100px);
  background: linear-gradient(135deg, #b70814 0%, #52040a 100%);
  position: relative;
  overflow: hidden;
}

.up-next-content {
  max-width: 600px;
  position: relative;
  z-index: 2;
}

.up-next h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(48px, 6vw, 84px);
  line-height: 0.9;
  margin: 10px 0 16px;
}

.up-next p {
  color: #ffcccc;
  font-size: 15px;
  margin-bottom: 28px;
}

/* Footer Section */
.app-footer {
  background: linear-gradient(180deg, rgba(8, 9, 12, 0.84), rgba(4, 5, 8, 0.9));
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 50px clamp(16px, 5vw, 70px) 30px;
  color: var(--muted);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.footer-left {
  max-width: 420px;
}

.footer-desc {
  font-size: 13px;
  margin-top: 12px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fff;
  margin: 0 0 6px;
}

.footer-links a {
  color: #aaa;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 24px;
  font-size: 11px;
  line-height: 1.6;
}

.footer-bottom .copyright {
  color: #666;
  margin-top: 6px;
}

/* Modals */
.modal {
  width: min(850px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(18, 20, 28, 0.9), rgba(9, 11, 16, 0.96));
  color: #fff;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.modal.modal-sm {
  width: min(480px, calc(100vw - 32px));
}

.modal.modal-lg {
  width: min(1100px, calc(100vw - 32px));
  max-height: 90vh;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

.close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 10;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.store-modal-content {
  padding: 28px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(180deg, rgba(15, 18, 28, 0.96), rgba(10, 12, 18, 0.98));
}

.store-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 120, 212, 0.14);
  border: 1px solid rgba(0, 120, 212, 0.35);
  color: #63b3ff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.store-modal-content h3 {
  margin: 0;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.1rem, 3vw, 3rem);
  line-height: 0.98;
  letter-spacing: 0.03em;
}

.store-modal-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.store-cta-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.store-cta-box span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 120, 212, 0.22), rgba(0, 170, 130, 0.18));
  font-size: 1.2rem;
}

.store-cta-box strong,
.store-cta-box small {
  display: block;
}

.store-cta-box small {
  color: var(--muted);
  margin-top: 2px;
}

.store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* Fan Card Modal Preview */
.fan-card-modal-content {
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fan-card-header h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 34px;
  margin: 0;
  line-height: 1;
}

.sub-note {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}

.canvas-preview-wrap {
  width: 100%;
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #050508;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.canvas-preview-wrap canvas {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.fan-card-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* 👥 Versus Comparator Modal */
.versus-modal-content {
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.versus-header h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 34px;
  margin: 0;
}

.versus-input-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.versus-inputs-flex {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.versus-inputs-flex textarea {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  padding: 10px;
  font-family: inherit;
  font-size: 12px;
  min-width: 260px;
}

.versus-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.versus-card {
  padding: 20px;
  text-align: center;
}

.versus-card h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.versus-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  line-height: 1;
  color: #fff;
}

.versus-diff-box {
  padding: 16px 20px;
  font-size: 13px;
}

.versus-diff-box h5 {
  margin: 0 0 10px;
  font-size: 13px;
}

.versus-diff-box ul {
  margin: 0;
  padding-left: 20px;
  max-height: 160px;
  overflow-y: auto;
  color: var(--muted);
}

/* User Review Box */
.video-wrap {
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-info {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.modal-main-info {
  flex: 1;
}

.modal-tags {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.modal-info h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 34px;
  margin: 0 0 10px;
  line-height: 1;
}

.modal-synopsis-text {
  font-size: 14px;
  color: #bbb;
  margin: 0 0 20px;
}

.user-review-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rating-picker {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-label {
  font-size: 12px;
  font-weight: 700;
  color: #aaa;
}

.star-rating {
  display: flex;
  gap: 4px;
  font-size: 22px;
  color: #444;
  cursor: pointer;
}

.star-rating .star {
  transition: color 0.2s;
}

.star-rating .star.active,
.star-rating .star:hover {
  color: var(--gold);
}

.rating-text {
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
}

.notes-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notes-picker textarea {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  padding: 10px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  outline: none;
}

.notes-picker textarea:focus {
  border-color: var(--red);
}

.btn-sm {
  align-self: flex-end;
  padding: 8px 16px;
  font-size: 11px;
}

.watch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  padding: 12px 20px;
  border-radius: 8px;
  white-space: nowrap;
}

/* Roulette Modal */
.roulette-box {
  padding: 30px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.roulette-box h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  margin: 0;
}

.roulette-display {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.roulette-display img {
  width: 170px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
}

.roulette-display h4 {
  font-size: 18px;
  margin: 0;
  color: var(--gold);
}

.roulette-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Responsive Tuning for Mobile & Tablet */
@media (max-width: 1024px) {
  .topbar nav {
    display: none;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 30px 16px;
  }
}

@media (max-width: 720px) {
  .topbar {
    height: auto;
    padding: 12px 14px;
    gap: 12px;
  }
  .topbar-controls {
    margin-left: auto;
  }
  .countdown-widget {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  .dashboard-header h2 {
    font-size: 38px;
  }
  .timeline {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 10px;
  }
  .modal-info {
    flex-direction: column;
  }
  .achievements-grid {
    grid-template-columns: 1fr;
  }
}
