/* =========================================================
   Mon Quart d'Heure — UI propre, mobile-first, sans zoom
   ========================================================= */

:root {
  --bg-deep: #070d0b;
  --bg: #0f1a17;
  --bg-elevated: #162622;
  --bg-panel: #1a2f2b;
  --border: #2c4540;
  --border-soft: #243833;
  --text: #f5ede6;
  --text-muted: #9aaca5;
  --cream: #f5ede6;
  --accent: #e07a5f;
  --accent-soft: rgba(224, 122, 95, 0.18);
  --sage: #6f9b8c;
  --work: #e07a5f;
  --rest: #6f9b8c;
  --warmup: #d4b896;
  --finisher: #6f9b8c;
  --danger: #d15656;
  --radius: 14px;
  --radius-sm: 10px;
  --font-brand: "Libre Baskerville", Georgia, serif;
  --font-ui: "DM Sans", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --touch: 52px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  background: var(--bg-deep);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
  overscroll-behavior: none;
}

body {
  position: relative;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 16px; /* évite le zoom iOS sur focus input */
  color: var(--text);
  /* Fond uni seulement : le halo reste fixe (pas d’étirement / boucle au scroll) */
  background: var(--bg-deep);
  line-height: 1.45;
  overflow-x: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Halo décoratif ancré au viewport — ne suit plus le slide */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 90% 45% at 50% -8%, #1a3a32 0%, transparent 55%);
}

body.session-active {
  overflow: hidden;
  user-select: none;
}

img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
a { color: inherit; }

/* ---------- Shell ---------- */
.app {
  width: min(100%, 440px);
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(12px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  display: flex;
  flex-direction: column;
}

.app--auth {
  justify-content: center;
}

.screen {
  display: none;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.screen.is-active {
  display: flex;
}

/* ---------- User ---------- */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
}

.user-bar__name {
  font-weight: 600;
  color: var(--cream);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-bar__links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.user-bar__link,
.user-bar__logout {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.user-bar__link {
  color: var(--cream);
  border-color: var(--border);
}

.user-bar__link:hover,
.user-bar__logout:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Brand compact ---------- */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.brand--compact {
  flex-direction: row;
  text-align: left;
  gap: 12px;
  align-items: center;
  padding: 4px 0;
}

.brand--auth {
  margin-bottom: 4px;
}

.brand__mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  flex-shrink: 0;
}

.brand__text {
  min-width: 0;
}

.brand__wordmark {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.15;
  margin: 0;
}

.brand__wordmark--inline .brand__line--forest,
.brand__wordmark--inline .brand__line--accent {
  display: inline;
}

.brand__line--forest { color: var(--cream); }
.brand__line--accent { color: var(--accent); }

.brand__tagline {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ---------- Stats ---------- */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stats-row--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.compte-screen {
  gap: 14px;
  padding-bottom: 8px;
}

.compte-title {
  font-family: var(--font-brand);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cream);
  margin-top: 4px;
}

.compte-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.compte-historique {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compte-historique__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.compte-screen .auth-panel .btn {
  width: 100%;
}

.niveau-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--cream);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.niveau-badge strong {
  color: var(--accent);
}

.niveau-badge span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.niveau-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
}

.niveau-card.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.niveau-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.niveau-card__title {
  font-weight: 700;
  color: var(--cream);
}

.niveau-card__hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.niveau-card__meta {
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 2px;
}

.mission__niveau {
  font-size: 0.78rem;
  color: var(--sage);
}

/* ---------- Modal niveau ---------- */
body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal[hidden] {
  display: none !important;
}

.modal.is-open[hidden] {
  display: flex !important;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: min(88dvh, 640px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(16px + var(--safe-b));
  transform: translateY(24px);
  transition: transform 0.22s ease;
}

.modal.is-open .modal__panel {
  transform: translateY(0);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.modal__title {
  font-family: var(--font-brand);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cream);
}

.modal__x {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--cream);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal__intro {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.modal__options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

@media (min-width: 480px) {
  .modal {
    align-items: center;
    padding: 24px;
  }

  .modal__panel {
    border-radius: var(--radius);
    transform: translateY(12px) scale(0.98);
  }

  .modal.is-open .modal__panel {
    transform: none;
  }
}

.stat-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.stat-pill__value {
  display: block;
  font-family: var(--font-brand);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-pill__label {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ---------- Week ---------- */
.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.week__day {
  text-align: center;
  padding: 8px 0;
  background: var(--bg-panel);
  border-radius: 8px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.week__day-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.week__day-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
}

.week__day.is-done .week__day-mark {
  background: var(--sage);
  border-color: var(--sage);
}

.week__day.is-today {
  outline: 1px solid var(--accent);
}

/* ---------- Flash (dans le flux, jamais sur les boutons) ---------- */
.flash {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--cream);
  font-size: 0.88rem;
  text-align: center;
}

.flash[hidden] {
  display: none !important;
}

.flash.is-error {
  border-color: var(--danger);
  color: #f0c4c4;
  background: rgba(209, 86, 86, 0.1);
}

/* ---------- Mission ---------- */
.mission {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  /* Pas d'ascenseur interne : un seul scroll = la page */
  overflow: visible;
  max-height: none;
}

.mission.is-visible {
  display: flex;
}

.mission__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.mission__title {
  font-family: var(--font-brand);
  font-size: 1rem;
  font-weight: 700;
}

.mission__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mission-item {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
}

.mission-item__demo {
  width: 56px;
  height: 56px;
  color: var(--accent);
  opacity: 0.9;
  overflow: hidden;
  border-radius: 8px;
}

.mission-item__demo .demo-frame {
  padding: 2px;
}

.mission-item__demo .demo-view,
.mission-item__demo .demo-cue {
  display: none;
}

.mission-item__demo .demo-svg {
  width: 100%;
  height: 100%;
}

.mission-item:first-child {
  border-top: none;
  padding-top: 0;
}

.mission-item__cat {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding-top: 3px;
}

.mission-item.is-finisher .mission-item__cat {
  color: var(--sage);
}

.mission-item__name {
  font-weight: 600;
  font-size: 0.95rem;
}

.mission-item__howto-label {
  display: block;
  margin-top: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.mission-item__hint {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.equip-badge {
  margin-left: 6px;
  font-size: 0.62rem;
  text-transform: uppercase;
  color: var(--warmup);
  border: 1px solid var(--warmup);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ---------- Music bar ---------- */
.music-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.music-bar.is-muted .music-bar__select {
  opacity: 0.45;
}

.music-bar.is-muted .music-bar__preview {
  opacity: 1;
}

.check--inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.check--inline input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.music-bar__select {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--cream);
  font: inherit;
  font-size: 0.9rem;
  appearance: none;
  -webkit-appearance: none;
}

.music-bar__preview {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--cream);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.music-bar__preview-icon {
  font-size: 0.72rem;
  line-height: 1;
}

.music-bar__preview[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.music-bar__preview:active {
  transform: scale(0.97);
}

/* ---------- Actions ---------- */
.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.actions--dock {
  margin-top: 8px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.actions__row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 12px 16px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn--primary {
  background: var(--accent);
  color: #1a1a1a;
}

.btn--primary:hover {
  background: #e88a72;
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--cream);
}

.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn.is-confirm {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Auth ---------- */
.auth-screen {
  width: 100%;
  gap: 16px;
  justify-content: center;
}

.auth-panel {
  width: 100%;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.field__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.field__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 16px; /* anti-zoom iOS */
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.field__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-form .btn {
  width: 100%;
  margin-top: 4px;
}

.auth-error {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--danger);
  background: rgba(209, 86, 86, 0.1);
  color: #f0c4c4;
  font-size: 0.88rem;
  text-align: center;
}

.auth-switch {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-switch a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}

/* ---------- Session ---------- */
.session {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  left: 50%;
  transform: translateX(-50%);
  padding: calc(10px + var(--safe-t)) 16px calc(12px + var(--safe-b));
  background: var(--bg-deep);
  background-image: radial-gradient(ellipse at 50% 0%, #1a3a32 0%, var(--bg-deep) 50%);
}

.session.is-active {
  display: flex;
}

.session__top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session__phase {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.session__phase[data-phase="warmup"] { color: var(--warmup); }
.session__phase[data-phase="work"] { color: var(--work); }
.session__phase[data-phase="rest"] { color: var(--rest); }
.session__phase[data-phase="finisher"] { color: var(--finisher); }
.session__phase[data-phase="paused"] { color: var(--text-muted); }

.session__round {
  flex: 1;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.session__remain {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cream);
}

.session__remain-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.progress {
  margin-top: 10px;
  height: 4px;
  background: var(--bg-panel);
  border-radius: 999px;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
}

.session__center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  text-align: center;
  gap: 8px;
  min-height: 0;
  padding: 8px 0 4px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* Stage : silhouette + chrono côte à côte (plus de chevauchement) */
.session__stage {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  flex-shrink: 0;
  min-height: 0;
}

.session--prep .session__stage {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 6px;
  overflow: visible;
  flex-shrink: 0;
}

.session--prep .session__stage .timer-ring {
  order: 2;
}

.session--prep .session__stage .session__demo {
  order: 1;
  width: min(70vw, 220px);
  max-width: 100%;
  height: auto;
  /* Portrait : la silhouette debout doit tenir entière (le 4/3 coupait pieds/tête) */
  aspect-ratio: 4 / 5;
  flex-shrink: 0;
  overflow: visible;
  background: transparent;
  border: none;
}

.session--prep .session__stage .session__demo[data-view="profil"] {
  aspect-ratio: 1 / 1;
  width: min(72vw, 240px);
}

.session--prep .demo-frame {
  padding: 18px 6px 10px;
}

.session--prep .demo-svg {
  overflow: visible;
}

/* Pendant la pause : l’étiquette ne mange plus les pieds */
.session--prep .demo-cue {
  left: auto;
  right: 6px;
  bottom: auto;
  top: 5px;
  transform: none;
}

.session--prep .timer-ring {
  width: 84px;
  height: 84px;
}

.session--prep .session__timer {
  font-size: 1.65rem;
}

.session__demo {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 4 / 5;
  height: auto;
  color: var(--accent);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  display: grid;
  place-items: center;
}

.session__demo[data-view="profil"] {
  aspect-ratio: 1 / 1;
  max-width: 180px;
}

.session__demo[hidden] {
  display: none !important;
}

.demo-frame {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 6px 4px 4px;
  box-sizing: border-box;
}

.demo-view {
  position: absolute;
  top: 5px;
  left: 6px;
  z-index: 1;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 6px;
  border-radius: 999px;
  pointer-events: none;
}

.demo-svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: block;
}

.demo-fig {
  color: inherit;
}

/* Bras et jambe du côté opposé : en retrait pour lire la profondeur */
.demo-far {
  opacity: 0.4;
}

.demo-spine {
  stroke-width: 6.5;
}

.demo-head {
  fill: currentColor;
  fill-opacity: 0.18;
  stroke: currentColor;
  stroke-width: 4;
}

.demo-ground {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  opacity: 0.25;
}

.demo-prop {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  opacity: 0.35;
}

.demo-prop--thin {
  stroke-width: 2;
  opacity: 0.22;
}

.demo-towel {
  stroke-width: 2;
  opacity: 0.7;
}

.demo-cue {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  z-index: 1;
  white-space: nowrap;
  font-size: 0.56rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--cream);
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 7px;
  border-radius: 999px;
  pointer-events: none;
}

.demo-cue[hidden] {
  display: none;
}

.timer-ring {
  position: relative;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  z-index: 1;
}

@media (min-width: 400px) {
  .timer-ring {
    width: 132px;
    height: 132px;
  }
  .session__demo {
    max-width: 176px;
  }
  .session__demo[data-view="profil"] {
    max-width: 200px;
  }
}

.timer-ring__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring__track {
  fill: none;
  stroke: var(--bg-panel);
  stroke-width: 8;
}

.timer-ring__arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 0;
}

.session__timer {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: clamp(2.2rem, 9vw, 2.8rem);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
  position: relative;
  z-index: 1;
}

.session__timer.is-countdown {
  color: var(--accent);
}

.session__exercise {
  font-family: var(--font-brand);
  font-size: clamp(1.15rem, 4.2vw, 1.4rem);
  font-weight: 700;
  color: var(--cream);
}

.session__howto {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  text-align: left;
}

.session__howto[hidden] {
  display: none !important;
}

.session__howto-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}

.session__cue {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--cream);
}

.session__next {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-panel);
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.session__next.is-visible {
  opacity: 1;
}

.session__next strong {
  color: var(--cream);
}

.session__footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.session__flash {
  margin: 0;
  padding: 8px 10px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--cream);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.session__flash[hidden] {
  display: none !important;
}

.session__controls {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 8px;
}

.session__controls .btn {
  min-height: 54px;
  font-size: 0.88rem;
}

/* ---------- Debrief ---------- */
.debrief {
  text-align: center;
  justify-content: center;
  gap: 18px;
}

.debrief__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 16px;
}

.debrief__badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
}

.debrief__title {
  font-family: var(--font-brand);
  font-size: clamp(1.7rem, 6vw, 2.1rem);
  font-weight: 700;
  line-height: 1.15;
}

.debrief__title span {
  color: var(--accent);
}

.debrief__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.debrief-stat {
  padding: 12px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.debrief-stat__value {
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
}

.debrief-stat__label {
  margin-top: 4px;
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.debrief__quote {
  font-family: var(--font-brand);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 18rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .session {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
