/* UrFit – zwart & volt */
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-display: swap; src: url(fonts/barlow-condensed-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url(fonts/inter-latin-700-normal.woff2) format('woff2'); }

:root {
  --bg: #050505;
  --surface: #121212;
  --surface-2: #1B1B1B;
  --line: #262626;
  --text: #F5F5F2;
  --muted: #8C8C88;
  --volt: #D4FF00;
  --volt-dim: rgba(212, 255, 0, 0.12);
  --green: #22C55E;
  --orange: #F97316;
  --red: #EF4444;
  --radius: 18px;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.45; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
a { color: var(--volt); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, .display { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.01em; margin: 0; line-height: 0.95; }
h1 { font-size: 44px; font-weight: 800; }
h2 { font-size: 28px; font-weight: 800; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.volt { color: var(--volt); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- Topbalk & menu ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 14px 10px; background: rgba(5,5,5,0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar .logo { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: 0.02em; font-style: italic; }
.topbar .logo svg { width: 28px; height: 28px; }
.topbar .spacer { flex: 1; }
.iconbtn { width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.iconbtn:hover { background: var(--surface-2); }
.iconbtn svg { width: 24px; height: 24px; }

.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 84vw); background: #0C0C0C; border-right: 1px solid var(--line); z-index: 41; transform: translateX(-102%); transition: transform .25s cubic-bezier(.2,.8,.2,1); padding: calc(18px + var(--safe-t)) 14px 20px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
body.menu-open .drawer { transform: none; }
body.menu-open .drawer-bg { opacity: 1; pointer-events: auto; }
.drawer .who { padding: 6px 10px 18px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.drawer .who .name { font-family: var(--display); font-size: 26px; font-weight: 800; text-transform: uppercase; }
.drawer a { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 500; }
.drawer a svg { width: 20px; height: 20px; opacity: .85; }
.drawer a.active { background: var(--volt); color: #000; font-weight: 700; }
.drawer a:not(.active):hover { background: var(--surface-2); }
.drawer .sep { height: 1px; background: var(--line); margin: 8px 0; }

/* ---------- Ondernavigatie ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(8,8,8,0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.active { color: var(--volt); }

main { padding: 18px 16px calc(96px + var(--safe-b)); max-width: 720px; margin: 0 auto; }
.page-head { margin: 6px 0 18px; }
.page-head .kicker { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--volt); margin-bottom: 6px; }

/* ---------- Kaarten ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card.volt { background: var(--volt); color: #000; border-color: var(--volt); }
.card.volt .muted { color: rgba(0,0,0,.6); }
.card.volt .btn { background: #000; color: var(--volt); }
.card h3 { margin-bottom: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h3 { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .v { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1; }
.stat .v small { font-size: 16px; color: var(--muted); font-weight: 700; }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }

/* ---------- Knoppen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 13px 22px; background: var(--volt); color: #000; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; transition: transform .08s, opacity .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border: 1.5px solid #3A3A3A; }
.btn.dark { background: var(--surface-2); color: var(--text); }
.btn.danger { background: transparent; color: var(--red); border: 1.5px solid #4a1b1b; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1.5px solid #333; background: transparent; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); }
.chip.on { background: var(--volt); color: #000; border-color: var(--volt); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.tag.volt { background: var(--volt-dim); color: var(--volt); }

/* ---------- Formulieren ---------- */
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; background: var(--surface-2); border: 1.5px solid #2C2C2C; border-radius: 12px; padding: 12px 14px; outline: none; font-size: 16px; }
input:focus, select:focus, textarea:focus { border-color: var(--volt); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px 6px; border-radius: 9px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--volt); color: #000; }
.rpe { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.rpe button { border: 0; border-radius: 8px; padding: 10px 0; background: var(--surface-2); font-weight: 700; cursor: pointer; }
.rpe button.on { background: var(--volt); color: #000; }
.err { color: var(--red); font-size: 14px; margin: 6px 0; min-height: 1em; }

/* ---------- Ring ---------- */
.ringwrap { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 128px; height: 128px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .c .v { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1; }
.ring .c .l { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--volt); border-radius: 99px; transition: width .4s; }
.bar.over > i { background: var(--orange); }

/* ---------- Lijsten ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .main { flex: 1; min-width: 0; }
.li .t { font-weight: 600; }
.li .s { font-size: 13px; color: var(--muted); }
.li .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex: none; font-size: 20px; }
.li .ic.volt { background: var(--volt); color: #000; }
.li .ic svg { width: 22px; height: 22px; }
.li .x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 6px; font-size: 18px; }

/* ---------- Week ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week .d { background: var(--surface-2); border-radius: 12px; padding: 8px 2px; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); border: 1.5px solid transparent; }
.week .d .n { font-family: var(--display); font-size: 20px; color: var(--text); }
.week .d .dot { width: 8px; height: 8px; border-radius: 50%; background: #333; margin: 5px auto 0; }
.week .d.plan .dot { background: transparent; border: 2px solid var(--volt); }
.week .d.done .dot { background: var(--volt); }
.week .d.today { border-color: var(--volt); }

/* ---------- Segmenten cardio ---------- */
.segs { display: flex; height: 54px; gap: 2px; align-items: flex-end; margin: 6px 0 12px; }
.segs i { display: block; border-radius: 4px 4px 0 0; min-width: 3px; }
.seglist .li .ic { font-family: var(--display); font-weight: 800; font-size: 18px; }

/* ---------- Speler ---------- */
.player { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; padding: calc(16px + var(--safe-t)) 18px calc(18px + var(--safe-b)); }
.player .top { display: flex; align-items: center; justify-content: space-between; }
.player .body { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 10px; }
.player .big { font-family: var(--display); font-size: 110px; font-weight: 800; line-height: .9; font-variant-numeric: tabular-nums; }
.player .label { font-family: var(--display); font-size: 34px; font-weight: 800; text-transform: uppercase; line-height: 1; }
.player .zonebadge { padding: 8px 16px; border-radius: 999px; font-weight: 800; font-family: var(--display); font-size: 22px; text-transform: uppercase; color: #000; }
.player .tip { color: var(--muted); max-width: 420px; }
.player .next { color: var(--muted); font-size: 14px; }
.player .progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 14px 0; }
.player .progress i { display: block; height: 100%; background: var(--volt); }
.player .controls { display: flex; gap: 10px; }
.player .controls .btn { flex: 1; padding: 16px; font-size: 17px; }
.player.rest { background: #0A0F00; }
.steps { text-align: left; color: var(--muted); max-width: 440px; padding-left: 20px; margin: 4px 0; }

/* ---------- Grafiek ---------- */
.chart { width: 100%; height: 200px; display: block; }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--body); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }

/* ---------- Auth ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 28px 22px calc(28px + var(--safe-b)); max-width: 440px; margin: 0 auto; }
.auth .hero { margin-bottom: 30px; }
.auth .hero h1 { font-size: 72px; font-style: italic; }
.auth .hero h1 span { color: var(--volt); }
.auth .hero p { color: var(--muted); font-size: 17px; margin-top: 10px; }
.auth .switch { margin-top: 16px; text-align: center; color: var(--muted); }
.auth .switch button { background: none; border: 0; color: var(--volt); font-weight: 700; cursor: pointer; }

/* ---------- Sheet ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: #101010; border: 1px solid var(--line); border-bottom: 0; width: 100%; max-width: 640px; max-height: 88dvh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 10px 18px calc(22px + var(--safe-b)); animation: up .22s cubic-bezier(.2,.8,.2,1); }
.sheet .grab { width: 40px; height: 4px; background: #333; border-radius: 9px; margin: 0 auto 14px; }
.sheet h2 { margin-bottom: 14px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); background: var(--volt); color: #000; font-weight: 700; padding: 12px 20px; border-radius: 999px; z-index: 80; animation: up .2s; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 90vw; text-align: center; }
.coach { border-left: 4px solid var(--volt); }
.coach p { margin-bottom: 6px; }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 8px; text-align: center; }
.badge .i { font-size: 30px; filter: grayscale(1); opacity: .35; }
.badge.on .i { filter: none; opacity: 1; }
.badge.on { border-color: var(--volt); }
.badge .n { font-weight: 700; font-size: 13px; margin-top: 6px; }
.badge .t { font-size: 11px; color: var(--muted); }
details.acc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; padding: 0 14px; }
details.acc summary { padding: 14px 0; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
details.acc summary::after { content: '+'; color: var(--volt); font-size: 20px; line-height: 1; }
details.acc[open] summary::after { content: '–'; }
details.acc > div { padding-bottom: 14px; color: #cfcfcb; }
.hand { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hand button { background: var(--surface-2); border: 1.5px solid transparent; border-radius: 12px; padding: 10px 4px; cursor: pointer; text-align: center; font-size: 12px; font-weight: 600; }
.hand button .e { font-size: 22px; display: block; margin-bottom: 3px; }
.hand button.on { border-color: var(--volt); background: var(--volt-dim); color: var(--volt); }
.water { display: flex; flex-wrap: wrap; gap: 6px; }
.water button { width: 34px; height: 42px; border-radius: 6px 6px 10px 10px; border: 1.5px solid #334; background: transparent; cursor: pointer; }
.water button.on { background: #38bdf8; border-color: #38bdf8; }
.empty { text-align: center; color: var(--muted); padding: 22px 10px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--surface-2); border-top-color: var(--volt); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 30vh auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 900px) {
  .tabbar { display: none; }
  body { padding-left: 280px; }
  .drawer { transform: none; width: 280px; }
  .drawer-bg { display: none; }
  .topbar .menu-btn { display: none; }
  main { padding-bottom: 40px; }
  .toast { bottom: 30px; }
  .auth-page body, body.auth-mode { padding-left: 0; }
}
