:root {
  --bg: #eef4ff;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-2: #eaf1fe;
  --line: #d8e4f7;
  --text: #0b1733;
  --muted: #647393;
  --accent: #2b7fff;
  --accent-2: #00d0ff;
  --green: #16a34a;
  --shadow: 0 6px 22px rgba(43, 110, 230, .10);
  --shadow-soft: 0 2px 10px rgba(43, 110, 230, .07);
  /* dégradé holographique iridescent (bleu -> cyan -> violet) */
  --holo: linear-gradient(120deg, #00d0ff 0%, #2b7fff 28%, #7a6bff 52%, #00d0ff 76%, #2b7fff 100%);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, #d7e9ff 0%, rgba(215,233,255,0) 55%),
    radial-gradient(900px 500px at -10% 10%, #e6dcff 0%, rgba(230,220,255,0) 50%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text); min-height: 100vh;
  padding-bottom: calc(74px + var(--safe-bot)); -webkit-font-smoothing: antialiased;
}

@keyframes holoShift { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
.holo-text {
  background: var(--holo); background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: holoShift 6s linear infinite;
}

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 50; padding: calc(12px + var(--safe-top)) 18px 12px;
  background: rgba(255,255,255,.72); backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 700; }
.brand .logo { font-size: 22px; }
.brand b { background: var(--holo); background-size: 200% 200%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: holoShift 6s linear infinite; }

main { padding: 18px 16px 28px; max-width: 720px; margin: 0 auto; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1.title { font-size: 26px; font-weight: 800; margin-bottom: 4px; letter-spacing: -.5px; }
.subtitle { color: var(--muted); font-size: 14px; margin-bottom: 18px; line-height: 1.5; }
.section-label { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 26px 4px 12px; font-weight: 700; }

/* Hero */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 26px 24px; margin-bottom: 8px;
  color: #fff; background: var(--holo); background-size: 220% 220%; animation: holoShift 9s linear infinite;
  box-shadow: 0 14px 40px rgba(43,110,255,.32); }
.hero::after { content: ""; position: absolute; inset: 0; background:
  radial-gradient(600px 200px at 15% 0%, rgba(255,255,255,.45), transparent 60%),
  radial-gradient(400px 200px at 90% 100%, rgba(255,255,255,.25), transparent 55%); pointer-events: none; }
.hero h2 { font-size: 24px; font-weight: 800; line-height: 1.2; margin-bottom: 8px; position: relative; }
.hero p { color: rgba(255,255,255,.92); font-size: 14px; line-height: 1.55; margin-bottom: 18px; position: relative; }
.hero .emoji-bg { position: absolute; right: -10px; top: -6px; font-size: 96px; opacity: .28; }

.btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--holo); background-size: 200% 200%; animation: holoShift 6s linear infinite;
  color: #fff; font-weight: 800; font-size: 15px; border: none; border-radius: 14px; padding: 13px 20px; cursor: pointer; width: 100%;
  box-shadow: 0 8px 22px rgba(43,110,255,.30); position: relative; }
.hero .btn { background: #fff; color: var(--accent); animation: none; box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: var(--card); color: var(--accent); border: 1.5px solid var(--accent); box-shadow: none; animation: none; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; cursor: pointer;
  box-shadow: var(--shadow-soft); transition: transform .12s, box-shadow .12s, border-color .12s; }
.card:active { transform: scale(.985); border-color: var(--accent); box-shadow: var(--shadow); }
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.card .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card h3 { font-size: 16px; font-weight: 700; line-height: 1.25; }
.card .meta { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.5; }
.card .emoji { font-size: 26px; }

/* Exercise card with thumb */
.exo-card { display: flex; gap: 13px; align-items: center; }
.exo-card .thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--card-2); flex: 0 0 auto; }
.exo-card .body { flex: 1; min-width: 0; }
.exo-card h3 { font-size: 15.5px; }
.exo-card .arrow { color: var(--accent); font-size: 20px; }

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--card-2); color: #3f5680; border: 1px solid var(--line); }
.badge.lvl { color: #fff; border-color: transparent; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--card); border: 1px solid var(--line); color: var(--muted); cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-soft); }
.chip.active { background: var(--holo); background-size: 200% 200%; animation: holoShift 6s linear infinite; color: #fff; border-color: transparent; }

/* Search */
.search { width: 100%; background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 14px; padding: 12px 14px; font-size: 15px; margin-bottom: 6px; box-shadow: var(--shadow-soft); }
.search::placeholder { color: var(--muted); }
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,127,255,.15); }

/* Detail */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 700; font-size: 15px; background: none; border: none; cursor: pointer; margin-bottom: 14px; }
.detail-head h1 { font-size: 26px; font-weight: 800; line-height: 1.15; margin-bottom: 10px; }
.gif-wrap { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #fff; margin-bottom: 14px; aspect-ratio: 1/1; display: grid; place-items: center; box-shadow: var(--shadow); }
.gif-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gif-wrap .ph { color: var(--muted); font-size: 13px; }

.block { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-soft); }
.block h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--accent); margin-bottom: 12px; font-weight: 800; }
.block.warn h4 { color: #e0533d; }
.steps { list-style: none; counter-reset: s; }
.steps li { position: relative; padding: 0 0 12px 34px; font-size: 15px; line-height: 1.5; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--holo); background-size: 200% 200%; animation: holoShift 6s linear infinite; color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.bullets { list-style: none; }
.bullets li { position: relative; padding: 0 0 10px 24px; font-size: 15px; line-height: 1.5; }
.bullets li:last-child { padding-bottom: 0; }
.bullets li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.bullets.bad li::before { content: "✕"; color: #e0533d; }

.statline { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-soft); }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.stat .v { font-size: 16px; font-weight: 700; margin-top: 3px; }

/* exo line in séance */
.exo-line { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.exo-line:last-child { border-bottom: none; }
.exo-line .thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--card-2); flex: 0 0 auto; }
.exo-line .n { width: 24px; height: 24px; border-radius: 7px; background: var(--card-2); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--accent); flex: 0 0 auto; }
.exo-line .info { flex: 1; min-width: 0; }
.exo-line .info b { font-size: 15px; font-weight: 700; }
.exo-line .info span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.exo-line .arrow { color: var(--accent); }

/* Tabbar */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; display: grid; grid-template-columns: repeat(4,1fr);
  background: rgba(255,255,255,.82); backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid var(--line); padding-bottom: var(--safe-bot); }
.tab { background: none; border: none; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px; font-size: 21px; }
.tab span { font-size: 10.5px; font-weight: 600; }
.tab.active { color: var(--accent); }

/* Timer */
.timer-wrap { text-align: center; padding-top: 10px; }
.timer-display { font-size: 76px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -2px; margin: 18px 0; }
.timer-display.run { background: var(--holo); background-size: 200% 200%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: holoShift 4s linear infinite; }
.timer-presets { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.preset { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 11px 16px; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: var(--shadow-soft); }
.preset.active { background: var(--holo); background-size: 200% 200%; animation: holoShift 6s linear infinite; color: #fff; border-color: transparent; }
.timer-ctrls { display: flex; gap: 10px; }
.timer-ctrls .btn { flex: 1; }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; }
.note { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 24px; line-height: 1.6; }
