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

:root {
  --bg-page:       #0a0f0a;
  --bg-hero:       #0c1a0e;
  --bg-card:       #111811;
  --bg-card-hover: #161e16;
  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.13);
  --text-primary:  #e8e4dc;
  --text-secondary:#8a8f85;
  --text-muted:    rgba(232,228,220,0.4);
  --green-accent:  #5cc45c;
  --green-light:   #a0dfa0;
  --green-tag:     #3a9a3a;
  --blue-accent:   #6ab0f5;
  --blue-tag:      #3a80c8;
  --moon:          #d4c9a0;
  --badge-bg:      rgba(92,196,92,0.12);
  --badge-text:    #7acf7a;
  --z2:            #6ab0f5;
  --z3:            #c8a84a;
  --z4:            #c07050;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-page);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.page {
  width: 100%;
  max-width: 720px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 32px 100px rgba(0,0,0,0.6);
  animation: fadeUp 0.6s ease both;
  margin-top: auto;
  margin-bottom: auto;
}

.trail-page {
  width: 100%;
  max-width: 100%;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 32px 100px rgba(0,0,0,0.6);
}

@media (min-width: 768px) {
  .trail-page {
    max-width: 900px;
  }
}

@media (min-width: 1024px) {
  .trail-page {
    max-width: 1000px;
  }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── HERO ── */
.hero {
  background: var(--bg-hero);
  position: relative;
  overflow: hidden;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2.5rem 2.5rem 3rem;
}

.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle {
  0%,100% { opacity: var(--op); }
  50%      { opacity: calc(var(--op) * 0.25); }
}

.moon-wrap { position: absolute; top: 28px; right: 88px; width: 52px; height: 52px; }
.moon-body { width: 52px; height: 52px; background: var(--moon); border-radius: 50%; }
.moon-cut  { position: absolute; top: -5px; right: -10px; width: 46px; height: 46px; background: var(--bg-hero); border-radius: 50%; }

.mountains { position: absolute; bottom: 0; left: 0; right: 0; height: 170px; z-index: 1; }
.m-layer   { position: absolute; bottom: 0; left: 0; right: 0; }
.m-far     { height: 150px; background: #1e3822; clip-path: polygon(0% 100%, 0% 52%, 6% 28%, 12% 50%, 20% 8%, 28% 38%, 36% 18%, 44% 42%, 52% 5%, 60% 35%, 68% 16%, 76% 36%, 84% 20%, 92% 38%, 100% 22%, 100% 100%); }
.m-snow-1  { height: 150px; background: rgba(255,255,255,0.18); clip-path: polygon(18% 16%, 20% 8%, 22% 16%); }
.m-snow-2  { height: 150px; background: rgba(255,255,255,0.20); clip-path: polygon(50% 13%, 52% 5%, 54% 13%); }
.m-snow-3  { height: 150px; background: rgba(255,255,255,0.14); clip-path: polygon(82% 28%, 84% 20%, 86% 28%); }
.m-mid     { height: 110px; background: #152a18; clip-path: polygon(0% 100%, 0% 65%, 8% 42%, 18% 62%, 28% 28%, 38% 52%, 50% 32%, 62% 55%, 72% 38%, 82% 58%, 90% 44%, 100% 52%, 100% 100%); }
.m-forest  { height: 52px; background: #0c1c0e; clip-path: polygon(0% 100%, 0% 42%, 3% 18%, 6% 35%, 10% 12%, 14% 30%, 18% 8%, 22% 26%, 26% 15%, 30% 32%, 35% 10%, 40% 24%, 45% 6%, 50% 20%, 55% 12%, 60% 28%, 65% 8%, 70% 22%, 75% 14%, 80% 30%, 85% 16%, 90% 28%, 95% 18%, 100% 24%, 100% 100%); }
.trail-path { position: absolute; bottom: 14px; left: 0; right: 0; height: 1px; z-index: 2; background: repeating-linear-gradient(90deg, rgba(255,255,255,0.15) 0, rgba(255,255,255,0.15) 6px, transparent 6px, transparent 14px); }

.hero-content { position: relative; z-index: 3; }
.hero-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.hero-title {
  font-family: 'Raleway', sans-serif;
  font-size: 44px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

/* ── CARDS ── */
.cards {
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-strong);
}

.card {
  display: grid;
  grid-template-columns: 200px 1fr;
  text-decoration: none;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
  animation: fadeUp 0.5s ease both;
}
.card:first-child { animation-delay: 0.15s; }
.card:last-child  { animation-delay: 0.28s; border-bottom: none; }
.card:hover { background: var(--bg-card-hover); }

.card-vis {
  height: 160px;
  overflow: hidden;
  border-right: 1px solid var(--border);
}
.card-vis svg { display: block; width: 100%; height: 100%; }

.card-body {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.tag-green { color: var(--green-tag); }
.tag-blue  { color: var(--blue-tag); }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; }

.card-title {
  font-family: 'Raleway', sans-serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 4px;
}
.card-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 300;
  color: var(--text-secondary);
}

.card-arrow {
  font-size: 18px;
  color: var(--text-muted);
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
  padding-left: 12px;
}
.card:hover .card-arrow { transform: translateX(4px); color: var(--text-secondary); }

.stats {
  display: flex;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.stat-val {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.stat-lbl {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ── FOOTER ── */
.foot {
  background: var(--bg-card);
  border-top: 1px solid var(--border-strong);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.foot-txt {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
}
.badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--badge-bg);
  color: var(--badge-text);
}

/* ── TRAIL PAGE ── */

/* HEADER */
.header {
  padding: 0 16px;
  border-bottom: 1px solid var(--border-strong);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  height: 52px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--text-primary);
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.back-link:hover {
  background: var(--bg-card-hover);
  border-color: rgba(92,196,92,0.45);
  transform: translateX(-1px);
}
.logo {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(12px, 3vw, 14px);
  font-weight: 500;
  color: var(--green-accent);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.logo-link {
  text-decoration: none;
}

@media (min-width: 768px) {
  .header {
    padding: 0 24px;
  }
  .logo {
    font-size: 14px;
  }
}
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.garmin-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(106,176,245,0.08);
  border: 1px solid rgba(106,176,245,0.2);
  padding: 5px 12px;
  border-radius: 99px;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: var(--blue-accent);
}
.garmin-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-accent); box-shadow: 0 0 6px var(--blue-accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.header-status { font-size: 10px; color: var(--text-muted); }

/* TRAIL HERO */
.trail-hero {
  padding: clamp(24px, 5vw, 36px) clamp(16px, 5vw, 24px) clamp(24px, 5vw, 32px);
  border-bottom: 1px solid var(--border-strong);
  position: relative;
  overflow: hidden;
  background: var(--bg-hero);
}
.trail-hero::before {
  content: '12KM';
  position: absolute;
  right: -10px;
  top: -8px;
  font-family: 'Raleway', sans-serif;
  font-size: 130px;
  font-weight: 800;
  color: rgba(255,255,255,0.025);
  line-height: 1;
  pointer-events: none;
  letter-spacing: -4px;
}
.trail-hero .hero-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.trail-hero h1 {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(40px, 12vw, 68px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--text-primary);
}
.trail-hero h1 .a1 { color: var(--green-accent); }
.trail-hero h1 .a2 { color: var(--text-secondary); }
.trail-hero .hero-desc {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 300;
  color: var(--text-secondary);
}
.hero-tags {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.hero-tag.hl { border-color: rgba(192,112,80,0.4); color: var(--z4); background: rgba(192,112,80,0.06); }

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  border-bottom: 1px solid var(--border-strong);
}
.stat-cell {
  padding: clamp(14px, 2vw, 18px) clamp(12px, 2vw, 16px);
  border-right: 1px solid var(--border);
}
.stat-cell:last-child { border-right: none; }
.stat-val {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 500;
  color: var(--green-accent);
  line-height: 1;
}
.stat-label {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(8px, 1.5vw, 9px);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin-top: 5px;
  text-transform: uppercase;
}

/* HR ZONES PANEL */
.zones-panel {
  border-bottom: 1px solid var(--border-strong);
  padding: clamp(12px, 3vw, 16px) clamp(16px, 5vw, 24px);
  background: var(--bg-card);
}
.zones-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 500;
  color: var(--blue-accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.zones-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: clamp(8px, 2vw, 10px);
}
.zone-chip {
  padding: clamp(10px, 2vw, 12px) clamp(12px, 2vw, 14px);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background: var(--bg-page);
}
.zone-chip::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
}
.zone-chip.z2::before { background: var(--z2); }
.zone-chip.z3::before { background: var(--z3); }
.zone-chip.z4::before { background: var(--z4); }
.zone-chip-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.zone-chip.z2 .zone-chip-label { color: var(--z2); }
.zone-chip.z3 .zone-chip-label { color: var(--z3); }
.zone-chip.z4 .zone-chip-label { color: var(--z4); }
.zone-chip-bpm {
  font-family: 'Raleway', sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1;
}
.zone-chip-name {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ALERT */
.alert {
  margin: 16px 24px;
  padding: 14px 16px;
  border: 1px solid rgba(192,112,80,0.25);
  border-left: 3px solid var(--z4);
  border-radius: 0 8px 8px 0;
  background: rgba(192,112,80,0.05);
  display: flex;
  gap: 12px;
}
.alert-icon { color: var(--z4); font-size: 14px; flex-shrink: 0; margin-top: 2px; }
.alert-text { font-size: 12px; font-weight: 300; color: var(--text-secondary); line-height: 1.7; }
.alert-text strong { color: var(--z4); font-weight: 500; display: block; margin-bottom: 4px; font-family: 'DM Sans', sans-serif; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; }

/* WEEKS */
.week-block { border-bottom: 1px solid var(--border); }
.week-header {
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  background: var(--bg-card);
  transition: background 0.2s;
  border-left: 2px solid transparent;
}
.week-header:hover { background: var(--bg-card-hover); }
.week-header.active { background: var(--bg-card-hover); border-left-color: var(--green-accent); }
.week-num-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-page);
  border: 1px solid var(--border-strong);
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}
.week-header.active .week-num-badge { background: rgba(92,196,92,0.1); border-color: rgba(92,196,92,0.3); color: var(--green-accent); }
.week-info { flex: 1; }
.week-name {
  font-family: 'Raleway', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}
.week-theme-txt { font-size: 12px; font-weight: 300; color: var(--text-secondary); margin-top: 2px; }
.week-prog { width: 52px; height: 2px; background: var(--border-strong); border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.week-prog-fill { height: 100%; background: var(--green-accent); border-radius: 2px; transition: width 0.4s; }
.week-chevron { color: var(--text-muted); font-size: 11px; transition: transform 0.3s; flex-shrink: 0; }
.week-header.active .week-chevron { transform: rotate(180deg); color: var(--green-accent); }
.week-content { display: none; background: var(--bg-page); }
.week-content.open { display: block; }

/* SESSION */
.session-card {
  padding: clamp(12px, 2vw, 16px) clamp(16px, 4vw, 24px);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(60px, 80px) 1fr;
  gap: clamp(12px, 3vw, 16px);
}
.session-card:last-child { border-bottom: none; }
.t-endurance { border-left: 2px solid rgba(106,176,245,0.3); }
.t-seuil     { border-left: 2px solid rgba(192,112,80,0.3); }
.t-trail     { border-left: 2px solid rgba(92,196,92,0.3); }
.t-muscu     { border-left: 2px solid rgba(160,128,208,0.3); }
.t-sortie    { border-left: 2px solid rgba(200,168,74,0.3); }
.s-day {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.s-zone-badge {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid;
  margin-bottom: 5px;
}
.s-zone-badge.z2 { color: var(--z2); border-color: rgba(106,176,245,0.35); background: rgba(106,176,245,0.07); }
.s-zone-badge.z3 { color: var(--z3); border-color: rgba(200,168,74,0.35); background: rgba(200,168,74,0.07); }
.s-zone-badge.z4 { color: var(--z4); border-color: rgba(192,112,80,0.35); background: rgba(192,112,80,0.07); }
.s-zone-badge.zm { color: #a080d0; border-color: rgba(160,128,208,0.35); background: rgba(160,128,208,0.07); }
.s-bpm {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
}
.s-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.s-type {
  font-family: 'Raleway', sans-serif;
  font-size: 17px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.15;
}
.s-dur {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--green-accent);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}
.s-desc { font-size: 12px; font-weight: 300; color: var(--text-secondary); line-height: 1.7; }
.s-tip {
  margin-top: 7px;
  font-size: 11px;
  color: var(--blue-accent);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.5;
  opacity: 0.75;
}

/* TIPS */
.tips { border-top: 1px solid var(--border-strong); }
.tips-header {
  padding: 16px 24px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 500;
  color: var(--green-accent);
  letter-spacing: 2.5px;
  text-transform: uppercase;
}
.tip-row {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 14px;
  font-size: 12px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
}
.tip-idx { font-family: 'DM Sans', sans-serif; font-size: 10px; color: var(--text-muted); min-width: 20px; margin-top: 2px; }
.tip-row strong { color: var(--text-primary); font-weight: 500; }

footer {
  padding: clamp(16px, 3vw, 20px) clamp(16px, 4vw, 24px);
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(8px, 1.5vw, 10px);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  border-top: 1px solid var(--border-strong);
  text-transform: uppercase;
}

/* COURSE 5KM PAGE */
.course-page {
  --bg-hero: #0b1624;
  --bg-card: #101722;
  --bg-card-hover: #152031;
  --green-accent: #6ab0f5;
  --green-tag: #6ab0f5;
  --blue-accent: #9dd0ff;
  --text-secondary: #90a4ba;
  --z2: #6ab0f5;
  --z3: #8fc4f7;
  --z4: #bddfff;
}

.course-page .trail-hero::before {
  content: '5KM';
}

.course-page .hero-tag.hl {
  border-color: rgba(106,176,245,0.45);
  color: var(--blue-accent);
  background: rgba(106,176,245,0.12);
}

.coming-block {
  margin: 16px 24px 24px;
  padding: 20px;
  border: 1px solid rgba(106,176,245,0.3);
  border-left: 3px solid var(--blue-accent);
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(106,176,245,0.09), rgba(106,176,245,0.02));
}

.coming-kicker {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue-accent);
  margin-bottom: 8px;
}

.coming-block h2 {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(24px, 6vw, 38px);
  font-weight: 500;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.coming-block p {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 300;
  color: var(--text-secondary);
}
