/* Rueckenplan im Fox-Medien-CI: Open Sans, Fox-Rot #990000, gruener Aktionsknopf #3AA800 (wie Dashboard und AutoLead).
   Aufbau: roter Kopf, dunkle Buehne mit Hantelfoto, darunter Wochenleiste und der Tag als Abhakliste. */
@font-face { font-family: "Open Sans"; font-weight: 300 800; font-display: swap;
  src: url("/static/fonts/open-sans-latin-var.woff2") format("woff2"); }
:root {
  color-scheme: light;
  --rot: #990000; --rot-tief: #7a0000; --rot-hell: #fce8e8;
  --gruen: #3AA800; --gruen-tief: #2d8400; --gruen-hell: #edf8e4; --punkt: #53B101;
  --gelb: #D98A00; --gelb-hell: #fff6dd;
  --text: #333; --mittel: #555; --grau: #888; --linie: #e3e3e3; --feld: #fafafa;
  --bg: #f5f5f5; --karte: #fff; --nacht: #140a07;
  --schatten: 0 6px 24px rgba(0, 0, 0, .08);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { margin: 0; background: #e9e9e9; color: var(--text); font-family: "Open Sans", Arial, sans-serif; font-size: 15px; line-height: 1.45; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(153, 0, 0, .35); outline-offset: 2px; }
.rahmen { max-width: 560px; margin: 0 auto; background: var(--bg); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* Kopf */
.kopf { background: var(--rot); color: #fff; display: flex; align-items: center; gap: 12px;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18); position: relative; z-index: 2; }
.kopf img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .35); }
.marke { font-weight: 800; font-size: 17px; letter-spacing: 1px; text-transform: uppercase; flex: 1; }
.marke span { color: #9be35a; }
.status { font-size: 12px; font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 6px; opacity: .95; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ffd27a; }
.status[data-z="ok"]::before { background: #9be35a; }
.status[data-z="fehl"]::before { background: #fff; box-shadow: 0 0 0 2px #ff8a8a; }

/* Buehne */
.buehne { background: var(--nacht); color: #fff; position: relative; }
.buehne-bild { aspect-ratio: 16 / 9; background: var(--nacht) url("/static/img/hero.webp") center / cover no-repeat; position: relative; }
.buehne-bild::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 10, 7, 0) 38%, rgba(20, 10, 7, .78) 72%, var(--nacht) 100%); }
.buehne-text { position: relative; margin-top: -84px; display: flex; flex-direction: column; gap: 4px;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 46px max(16px, env(safe-area-inset-left, 0px)); }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: #ffb3a8; }
h1 { margin: 0; font-size: 27px; line-height: 1.12; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; text-wrap: balance; }
.stats { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .7); }
.meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.meter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.segs { display: flex; gap: 4px; }
.seg { flex: 1; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .2); }
.seg.an { background: var(--punkt); }
.meter-text { font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .88); }

/* Inhalt */
.app { flex: 1; display: flex; flex-direction: column; gap: 20px;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) max(28px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.notice { background: var(--rot-hell); border: 1px solid #f5c2c2; color: var(--rot-tief); border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600; }

.week { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 6px; align-items: stretch; margin-top: -30px; position: relative; z-index: 1;
  background: var(--karte); border-radius: 14px; box-shadow: var(--schatten); padding: 8px; }
.nav { border: 0; background: var(--bg); border-radius: 10px; font-size: 22px; font-weight: 800; color: var(--rot); min-height: 62px; }
.strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.daycell { border: 2px solid transparent; background: none; border-radius: 10px; padding: 5px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 62px; }
.daycell .wd { font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--grau); }
.daycell .num { font-weight: 800; font-size: 19px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.daycell .dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid transparent; margin-top: 2px; }
.daycell.train .dot { border-color: #bdbdbd; }
.daycell.partial .dot { border-color: var(--gelb); background: var(--gelb-hell); }
.daycell.done .dot { border-color: var(--gruen); background: var(--gruen); }
.daycell.today { border-color: var(--rot); }
.daycell.sel { background: var(--rot); border-color: var(--rot); color: #fff; }
.daycell.sel .wd { color: rgba(255, 255, 255, .85); }
.daycell.sel.train .dot { border-color: #fff; background: transparent; }
.daycell.sel.partial .dot { background: #ffd27a; border-color: #ffd27a; }
.daycell.sel.done .dot { background: #9be35a; border-color: #9be35a; }

.day { display: flex; flex-direction: column; gap: 20px; }
body.loading .day, body.loading .phase { opacity: .5; pointer-events: none; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h2 { margin: 0; font-size: 19px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--text); }
.linkbtn { border: 0; background: none; padding: 6px 0; color: var(--rot); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }

.block { display: flex; flex-direction: column; gap: 8px; }
.label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.label h3 { margin: 0; font-size: 11.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--rot); }
.label span { font-size: 12.5px; color: var(--grau); text-align: right; }
.panel { background: var(--karte); border-radius: 14px; box-shadow: var(--schatten); overflow: hidden; }
.panel > * + * { border-top: 1px solid var(--linie); }
.rest { padding: 18px 16px; color: var(--mittel); }

/* Morgen-Check: Gruen bis 3, Gelb bis 6, Rot darueber */
.pain { padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.pain-grid { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 3px; }
.pain-grid button { height: 46px; border: 0; border-radius: 8px; padding: 0; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums;
  background: var(--feld); box-shadow: inset 0 -4px 0 var(--zone); color: var(--mittel); }
.pain-grid .z1 { --zone: #b9e39a; --voll: var(--gruen); }
.pain-grid .z2 { --zone: #f3d28a; --voll: var(--gelb); }
.pain-grid .z3 { --zone: #e9a3a3; --voll: var(--rot); }
.pain-grid button.on { background: var(--voll); box-shadow: 0 3px 10px rgba(0, 0, 0, .18); color: #fff; transform: translateY(-2px); }
.pain-note { margin: 0; font-size: 13.5px; color: var(--mittel); }
.pain-note.high { color: var(--rot); font-weight: 700; }

/* Rumpfbasis */
.basis { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; padding: 13px 16px; cursor: pointer; }
.basis input { width: 28px; height: 28px; margin: 1px 0 0; accent-color: var(--gruen); }
.basis .name { font-weight: 700; font-size: 16px; }
.basis .goal { font-weight: 800; color: var(--rot); margin-left: 8px; font-size: 14px; white-space: nowrap; }
.tip { color: var(--grau); font-size: 13px; }
.basis .tip { display: block; }

/* Uebungen */
.ex { padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: background .25s; }
.ex-head { display: grid; grid-template-columns: 36px minmax(0, 1fr) 26px; gap: 10px; align-items: center; }
.code { background: var(--rot); color: #fff; font-weight: 800; font-size: 13px; border-radius: 8px; height: 30px; display: flex; align-items: center; justify-content: center; letter-spacing: .3px; }
.ex .name { font-weight: 700; font-size: 16.5px; line-height: 1.25; }
.meta { font-weight: 700; font-size: 14.5px; color: var(--mittel); }
.meta .kg { color: var(--rot); font-weight: 800; }
.tick { width: 26px; height: 26px; border-radius: 50%; background: var(--gruen); color: #fff; font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; transform: scale(0); transition: transform .25s cubic-bezier(.2, 1.6, .4, 1); }
.ex.done { background: var(--gruen-hell); }
.ex.done .tick { transform: scale(1); }
.ex.done .code { background: var(--gruen); }
.sets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; }
.sets input { width: 100%; min-width: 0; height: 52px; border: 2px solid #e0e0e0; background: var(--feld); border-radius: 10px; text-align: center; font-weight: 800; font-size: 22px; color: var(--text);
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; outline: none; transition: border-color .15s, box-shadow .15s; }
.sets input::-webkit-outer-spin-button, .sets input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sets input::placeholder { color: #c4c4c4; font-weight: 700; }
.sets input:focus { border-color: var(--rot); background: #fff; box-shadow: 0 0 0 3px rgba(153, 0, 0, .1); }
.ex.done .sets input { border-color: #bfe3a3; background: #fff; }
.fill { height: 52px; padding: 0 12px; border: 2px solid var(--gruen); background: #fff; color: var(--gruen-tief); border-radius: 10px; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.fill:active { background: var(--gruen); color: #fff; }
.last { font-size: 12.5px; color: var(--grau); }
.fertig { background: var(--gruen); color: #fff; border-radius: 12px; padding: 13px 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; font-size: 13px; text-align: center;
  box-shadow: 0 6px 18px rgba(58, 168, 0, .3); animation: aufploppen .35s cubic-bezier(.2, 1.4, .4, 1); }

/* Phasen */
.phase { background: var(--karte); border-radius: 14px; box-shadow: var(--schatten); padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.phase p { margin: 0; color: var(--mittel); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); position: relative; }
.steps::before { content: ""; position: absolute; left: 16.66%; right: 16.66%; top: 15px; height: 3px; background: var(--linie); }
.step { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; position: relative; padding: 0 4px; color: var(--grau); font-size: 12px; line-height: 1.3; }
.step b { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; margin-top: 6px; }
.knopf { width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 3px solid var(--linie); color: var(--grau); font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.step.done .knopf { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.step.now { color: var(--text); }
.step.now b { color: var(--rot); }
.step.now .knopf { background: var(--rot); border-color: var(--rot); color: #fff; box-shadow: 0 0 0 5px rgba(153, 0, 0, .12); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.primary { min-height: 48px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--gruen); color: #fff; font-weight: 800; font-size: 13.5px; text-transform: uppercase; letter-spacing: .5px; transition: background .15s; }
.primary:hover { background: var(--gruen-tief); }
.ghost { min-height: 48px; padding: 0 16px; border: 2px solid var(--linie); border-radius: 8px; background: #fff; font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--mittel); }

details.rule { background: var(--karte); border-radius: 14px; box-shadow: var(--schatten); padding: 0 16px; }
details.rule summary { padding: 15px 0; font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .6px; cursor: pointer; color: var(--text); }
details.rule ul { margin: 0 0 16px; padding-left: 18px; display: grid; gap: 7px; color: var(--mittel); }
details.rule li.stop { color: var(--rot); font-weight: 700; }

.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 6px; font-size: 12px; color: var(--grau); }
.foot img { display: block; height: 17px; width: auto; }
.foot a { color: var(--grau); text-decoration: none; font-weight: 600; }
.foot a:hover { color: var(--rot); }
.foot-rechts { display: flex; align-items: center; gap: 16px; }

/* Anmeldung */
.login { flex: 1; display: flex; flex-direction: column; }
.login .buehne-bild::after { background: linear-gradient(180deg, rgba(20, 10, 7, 0) 30%, rgba(20, 10, 7, .7) 70%, var(--nacht) 100%); }
.login-dunkel { background: var(--nacht); padding-bottom: 96px; }
.login-box { position: relative; margin: -150px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); background: var(--karte); border-radius: 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
  padding: 30px 24px 26px; display: flex; flex-direction: column; gap: 16px; }
.login-box h1 { color: var(--text); font-size: 20px; text-align: center; }
.login-box > p { margin: -10px 0 4px; color: var(--grau); font-size: 13px; text-align: center; }
.login-box .notice { text-align: center; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 800; color: var(--grau); text-transform: uppercase; letter-spacing: .5px; }
.field input { width: 100%; height: 50px; padding: 0 14px; border: 2px solid #e0e0e0; border-radius: 8px; background: var(--feld); font-size: 16px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus { border-color: var(--rot); background: #fff; box-shadow: 0 0 0 3px rgba(153, 0, 0, .08); }
.login-box .primary { width: 100%; min-height: 50px; font-size: 14px; }
.login .foot { justify-content: center; padding: 26px 16px max(24px, env(safe-area-inset-bottom, 0px)); margin-top: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Einstieg: nur beim ersten Laden, und nur die festen Bloecke */
/* Nur Bewegung, keine Deckkraft: Bleibt eine Animation stehen (Hintergrund-Tab), ist trotzdem alles sichtbar. */
@keyframes hoch { from { transform: translateY(16px); } to { transform: none; } }
@keyframes aufploppen { from { transform: scale(.94); } to { transform: none; } }
@keyframes zoom { from { transform: scale(1.08); } to { transform: none; } }
body.start .buehne-bild, .login .buehne-bild { animation: zoom 1.4s cubic-bezier(.2, .7, .2, 1) both; }
.buehne, .login-dunkel { overflow: hidden; }
body.start .buehne-text > * { animation: hoch .5s ease-out both; }
body.start .buehne-text > :nth-child(2) { animation-delay: .06s; }
body.start .buehne-text > :nth-child(3) { animation-delay: .12s; }
body.start .buehne-text > :nth-child(4) { animation-delay: .18s; }
body.start .week { animation: hoch .5s .22s ease-out both; }
body.start .day { animation: hoch .5s .3s ease-out both; }
.login-box { animation: hoch .5s .15s ease-out both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
