/* DX4 Gym — spoločný základ pre web aj účet. Farby a písma sú v :root, všetko ostatné z nich vychádza. */

@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/Anton-Regular.ttf) format('truetype');
}

:root {
  --bg: #060509;
  --bg-2: #0c0b12;
  --panel: rgba(255, 255, 255, .035);
  --panel-2: rgba(255, 255, 255, .06);
  --glass: rgba(20, 18, 30, .62);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .15);
  --text: #f3f1fa;
  --muted: #a19eb0;
  --dim: #6c6979;
  --accent: #b8a6ff;
  --accent-2: #8f76ee;
  --accent-glow: rgba(160, 135, 255, .35);
  --on-accent: #150f2b;
  --good: #3fc896;
  --warn: #e8a53e;
  --bad: #ff7a7a;
  /* makrá — overené na tmavom pozadí (dataviz validator): bielkoviny, sacharidy, tuky */
  --c-p: #8f76ee;
  --c-c: #25a07e;
  --c-f: #c27f2a;
  --gutter: clamp(16px, 4.5vw, 72px);
  --radius: 22px;
  --display: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
  --sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html.lenis-stopped { overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--on-accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; }
.accent { color: var(--accent); }

/* ---------- Zrno a vinetácia ---------- */
.grain {
  position: fixed; inset: -50%;
  z-index: 90; pointer-events: none;
  opacity: .07;
  background-size: 180px 180px;
  animation: grain .6s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(5%, -7%); }
  60% { transform: translate(-3%, 8%); } 80% { transform: translate(7%, 2%); } 100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } }

/* ---------- Tlačidlá ---------- */
.btn {
  --h: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 24px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  font-weight: 600; font-size: 15px; letter-spacing: -.005em;
  white-space: nowrap;
  transition: transform .4s var(--ease), background .3s, border-color .3s, box-shadow .4s;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.btn:hover { border-color: rgba(255, 255, 255, .3); background: var(--panel-2); }
.btn:active { transform: scale(.97); }
.btn .ph { font-size: 18px; }
.btn--accent {
  border-color: transparent;
  color: var(--on-accent);
  background: linear-gradient(180deg, #cfc2ff 0%, var(--accent) 45%, var(--accent-2) 100%);
  box-shadow: 0 10px 40px -10px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.btn--accent:hover { background: linear-gradient(180deg, #ddd3ff 0%, #c4b5ff 45%, #9c85f5 100%); box-shadow: 0 14px 50px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .7); }
.btn--sm { --h: 40px; padding: 0 16px; font-size: 14px; }
.btn--lg { --h: 58px; padding: 0 30px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--ghost { border-color: transparent; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn--ghost:hover { background: var(--panel); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 18px;
  transition: background .25s, border-color .25s, transform .3s var(--ease);
}
.icon-btn:hover { background: var(--panel-2); border-color: var(--line-2); }
.icon-btn:active { transform: scale(.92); }

/* ---------- Sklo ---------- */
.glass {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 20px 60px -30px rgba(0, 0, 0, .8);
}

/* ---------- Štítky ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before { content: ''; width: 22px; height: 1px; background: currentColor; opacity: .6; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: rgba(184, 166, 255, .12);
  color: var(--accent);
  border: 1px solid rgba(184, 166, 255, .2);
  white-space: nowrap;
}
.tag--muted { background: var(--panel); color: var(--muted); border-color: var(--line); }
.tag--good { background: rgba(63, 200, 150, .12); color: var(--good); border-color: rgba(63, 200, 150, .25); }
.tag--warn { background: rgba(232, 165, 62, .12); color: var(--warn); border-color: rgba(232, 165, 62, .25); }
.tag--bad { background: rgba(255, 122, 122, .12); color: var(--bad); border-color: rgba(255, 122, 122, .25); }

/* ---------- Polia ---------- */
.field { display: grid; gap: 8px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field__hint { font-size: 12.5px; color: var(--dim); }
.input {
  height: 52px; width: 100%;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, .25);
  font-size: 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(184, 166, 255, .15); }
.input::placeholder { color: var(--dim); }
.input-unit { position: relative; }
.input-unit .input { padding-right: 52px; }
.input-unit span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 14px; pointer-events: none; }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* Výber možností (karty a čipy) */
.choices { display: grid; gap: 10px; }
.choices--2 { grid-template-columns: repeat(2, 1fr); }
.choices--3 { grid-template-columns: repeat(3, 1fr); }
.choice {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: left;
  transition: border-color .25s, background .25s, transform .3s var(--ease);
}
.choice:hover { border-color: var(--line-2); background: var(--panel-2); }
.choice:active { transform: scale(.985); }
.choice .ph { font-size: 22px; color: var(--muted); flex: none; transition: color .25s; }
.choice b { display: block; font-weight: 600; font-size: 15px; }
.choice small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 2px; }
.choice[aria-pressed=true], .choice[aria-checked=true] {
  border-color: rgba(184, 166, 255, .6);
  background: linear-gradient(180deg, rgba(184, 166, 255, .16), rgba(184, 166, 255, .06));
  box-shadow: 0 0 0 1px rgba(184, 166, 255, .25) inset, 0 10px 30px -18px var(--accent-glow);
}
.choice[aria-pressed=true] .ph, .choice[aria-checked=true] .ph { color: var(--accent); }
.choice--col { flex-direction: column; align-items: flex-start; justify-content: flex-start; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 40px; padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  transition: border-color .2s, background .2s;
}
.chip:hover { border-color: var(--line-2); }
.chip[aria-pressed=true] { border-color: rgba(184, 166, 255, .6); background: rgba(184, 166, 255, .14); color: var(--accent); }
.chip--day { width: 46px; padding: 0; justify-content: center; }

/* Číselný stepper */
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .input { text-align: center; font-size: 22px; font-weight: 600; }

/* ---------- Mapa tela ---------- */
.bm { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 420px; margin: 0 auto; }
.bm__view { display: grid; gap: 6px; justify-items: center; }
.bm__view figcaption { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.bm__svg { width: 100%; height: auto; overflow: visible; }
.bm__base { fill: #141220; stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.bm__m { fill: #3a3552; stroke: rgba(255, 255, 255, .1); stroke-width: .8; cursor: pointer; transition: fill .25s, filter .25s; outline: none; }
.bm__m.is-hover, .bm__m:focus-visible { fill: #4a4466; }
.bm__m.is-on { fill: var(--accent); stroke: #e5deff; filter: drop-shadow(0 0 6px rgba(184, 166, 255, .7)); }

/* ---------- Grafy ---------- */
.chart { display: block; overflow: visible; touch-action: pan-y; }
.chart__wrap { position: relative; }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__tick { fill: var(--dim); font-size: 11px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart__line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__area { fill: rgba(184, 166, 255, .08); }
.chart__end { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.chart__dot { fill: var(--dim); stroke: var(--bg); stroke-width: 2; }
.chart__target { stroke: var(--good); stroke-width: 1.5; stroke-dasharray: 4 5; }
.chart__tlabel { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart__cross { stroke: var(--line-2); stroke-width: 1; }
.chart__tip {
  position: absolute; top: 0; transform: translate(-50%, -8px) translateY(-100%);
  pointer-events: none;
  min-width: 140px; padding: 10px 12px;
  border-radius: 12px;
  background: rgba(16, 14, 24, .94); border: 1px solid var(--line-2);
  font-size: 12.5px; display: grid; gap: 4px; white-space: nowrap;
  z-index: 3;
}
.chart__tip b { font-weight: 600; }
.chart__tip span { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.chart__tip em { margin-left: auto; font-style: normal; color: var(--text); font-variant-numeric: tabular-nums; padding-left: 12px; }
.chart__legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.chart__legend span { display: inline-flex; align-items: center; gap: 8px; }
.chart__empty { color: var(--dim); font-size: 14px; padding: 30px 0; text-align: center; }
.key { display: inline-block; flex: none; }
.key--line { width: 16px; height: 2px; border-radius: 2px; background: var(--accent); }
.key--dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.key--band { width: 16px; height: 8px; border-radius: 3px; background: rgba(63, 200, 150, .22); border: 1px solid rgba(63, 200, 150, .5); }

.bars { list-style: none; display: grid; gap: 10px; }
.bars__row { display: grid; grid-template-columns: 112px 1fr 40px; align-items: center; gap: 12px; font-size: 13.5px; }
.bars__label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars__row.is-focus .bars__label { color: var(--text); }
.bars__label .ph { color: var(--accent); font-size: 12px; }
.bars__track { position: relative; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .04); }
.bars__band { position: absolute; top: -3px; bottom: -3px; border-radius: 4px; background: rgba(63, 200, 150, .14); border: 1px solid rgba(63, 200, 150, .35); }
.bars__fill { position: absolute; left: 0; top: 2px; bottom: 2px; border-radius: 0 4px 4px 0; background: var(--accent-2); }
.bars__row.is-focus .bars__fill { background: var(--accent); }
.bars__val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bars__legend { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dim); margin-top: 14px; }

.heat { display: flex; gap: 4px; }
.heat__col { display: grid; gap: 4px; flex: 1; }
.heat__cell { aspect-ratio: 1; border-radius: 4px; background: rgba(255, 255, 255, .05); max-width: 22px; width: 100%; }
.heat__cell[data-v="1"] { background: var(--accent-2); }
.heat__cell[data-v="2"] { background: var(--accent); }
.heat__cell[data-future] { background: transparent; border: 1px dashed var(--line); }

.ring__bg { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 7; }
.ring__fg { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.ring--p .ring__fg { stroke: var(--c-p); }
.ring--c .ring__fg { stroke: var(--c-c); }
.ring--f .ring__fg { stroke: var(--c-f); }
.ring--w .ring__fg { stroke: #6aa8ff; }

/* ---------- Oznámenie (úspech, uloženie) ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 120; display: grid; gap: 10px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(22, 19, 34, .92);
  border: 1px solid rgba(184, 166, 255, .35);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .9), 0 0 40px -10px var(--accent-glow);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  pointer-events: auto;
  animation: toast-in .6s var(--ease) both;
}
.toast.is-out { animation: toast-out .4s ease both; }
.toast__icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex: none; color: var(--on-accent); background: linear-gradient(160deg, #e3dbff, var(--accent) 50%, var(--accent-2)); }
.toast b { display: block; font-size: 14.5px; }
.toast small { color: var(--muted); font-size: 13px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }
