@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/barlow-condensed-800.ttf") format("truetype");
}

:root {
  color-scheme: dark;
  --canvas: #0b0c0b;
  --surface: #151715;
  --chip: #20241e;
  --chip-line: #363b31;
  --line: #2a2e29;
  --ink: #f2f1e9;
  --muted: #a1a59d;
  --faint: #6b7067;
  --accent: #ff6236;
  --long: #ee5a30;
  --rest: #3f86c4;
  --display: "Barlow Condensed", Impact, "Arial Narrow", sans-serif;
  --body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-family: var(--body);
  color: var(--ink);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  border-top: 4px solid var(--accent);
  background: var(--canvas);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  opacity: 0.25;
  cursor: default;
}

a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

summary {
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

summary::-webkit-details-marker {
  display: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

i {
  font-style: normal;
}

#main {
  width: min(560px, 100% - 24px);
  margin: 0 auto;
  padding: 16px 0 56px;
}

.loading {
  color: var(--muted);
}

/* Cuenta regresiva */
.countdown {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 800;
  line-height: 0.9;
  text-transform: uppercase;
}

.countdown-n {
  font-size: 84px;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  color: var(--muted);
  font-size: 24px;
}

/* Navegación de semana */
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.nav-date {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 22px;
  line-height: 1;
}

.today-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

/* Tira de 7 días */
.strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.strip-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 86px;
  padding: 8px 0 6px;
  border-radius: 4px;
  background: var(--surface);
}

.sd-wd {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.sd-n {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.sd-icon {
  font-size: 18px;
  line-height: 1.3;
}

.sd-km {
  min-height: 15px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.strip-day.is-today:not(.is-selected) .sd-n {
  text-decoration: underline 2px var(--accent);
  text-underline-offset: 4px;
}

.strip-day.is-selected {
  background: var(--accent);
  color: #10130e;
}

.strip-day.is-selected .sd-wd {
  color: #10130e;
}

/* Tarjeta del día */
.card {
  margin-top: 12px;
  padding: 18px 16px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--faint);
  border-radius: 4px;
  background: linear-gradient(120deg, #191c17, var(--surface) 70%);
}

.card[data-tipo="run"] {
  border-left-color: var(--accent);
}

.card[data-tipo="gym"] {
  border-left-color: var(--ink);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-icon {
  font-size: 40px;
  line-height: 1;
}

.card h1 {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: 0.95;
  text-transform: uppercase;
}

.card-km {
  font-size: 64px;
  letter-spacing: -0.5px;
}

.card-name {
  font-size: 30px;
  text-wrap: balance;
}

.card-km + .card-name {
  color: var(--muted);
  font-size: 22px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--chip-line);
  border-radius: 8px;
  background: var(--chip);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Momentos exactos de agua y comida */
.workout {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.moments {
  margin: 16px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.mo {
  display: grid;
  grid-template-columns: 34px 62px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.mo-icon {
  font-size: 24px;
  line-height: 1;
  text-align: center;
}

.mo-when {
  display: grid;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.mo-when b {
  font-size: 18px;
}

.mo-when small {
  color: var(--muted);
  font-size: 13px;
}

.mo-what {
  display: grid;
  gap: 1px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
}

.mo-what small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.mo.is-water .mo-what,
.mo.is-water .mo-when b {
  color: var(--muted);
  font-weight: 600;
}

.mo.is-pre .mo-what {
  font-weight: 600;
}

.carry {
  margin: 16px 0 0;
  font-size: 16px;
  font-weight: 700;
}


/* Detalle plegado */
.more {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  color: var(--muted);
  font-size: 14px;
}

.more > summary::after {
  content: "+";
  color: var(--faint);
  font-size: 20px;
  line-height: 1;
}

.more[open] > summary::after {
  content: "−";
}

.more ul {
  margin: 0;
  padding: 0 0 4px 18px;
  font-size: 15px;
}

.more li {
  padding: 2px 0;
}

.more li::marker {
  color: var(--faint);
}

/* 13 semanas */
.season {
  margin-top: 28px;
}

.season h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
}

.key i {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  background: var(--long);
}

.bars {
  display: grid;
  gap: 4px;
}

.wk {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 3px 6px 3px 4px;
  border-radius: 4px;
  text-align: left;
}

.wk-n {
  color: var(--muted);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
}

.wk-track {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
}

.wk-long,
.wk-rest {
  flex: none;
  height: 100%;
  width: calc((100% - 58px) * var(--w));
}

.wk-long {
  display: flex;
  align-items: center;
  padding-left: 6px;
  background: var(--long);
  color: #10130e;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.wk-rest {
  border-radius: 0 4px 4px 0;
  background: var(--rest);
}

.wk-total {
  padding-left: 6px;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.wk.is-peak .wk-total {
  color: var(--accent);
}

.wk.is-today .wk-n {
  color: var(--ink);
  text-decoration: underline 2px var(--accent);
  text-underline-offset: 4px;
}

.wk.is-selected {
  background: var(--surface);
}

.wk.is-selected .wk-n {
  color: var(--accent);
}

@media (min-width: 560px) {
  #main {
    padding-top: 32px;
  }

  .countdown-n {
    font-size: 108px;
  }

  .countdown-label {
    font-size: 30px;
  }

  .card {
    padding: 24px 24px 16px;
  }

  .card-km {
    font-size: 80px;
  }
}

/* Ejercicios de gym, en orden */
.exercises {
  margin: 16px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.ex {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.ex-n {
  color: var(--accent);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  text-align: center;
}

.ex-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  line-height: 1.25;
}

.ex-text b {
  font-size: 16px;
}

.ex-text small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ex-steps {
  display: flex;
  gap: 4px;
}

.ex-steps img,
.ex-zoom img {
  display: block;
  border-radius: 6px;
  background: #dfeaf2;
  object-fit: contain;
}

.ex-steps img {
  width: 56px;
  height: 56px;
}

.ex-zoom {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 6px;
  padding-bottom: 4px;
}

.ex-zoom[hidden] {
  display: none;
}

.ex-zoom img {
  width: 100%;
  height: auto;
  max-height: 260px;
}

.ex-steps img.is-photo {
  object-fit: cover;
}

.ex-zoom img.is-photo {
  background: #000;
}

.credit {
  margin-top: 24px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

.credit a {
  color: var(--faint);
}
