/* Turbo-Hölle Carrera Club · Design „Rennplakat Creme“ (Dörthe, Vorschlag B) */

:root {
  --fb: 'Barlow Semi Condensed', system-ui, sans-serif;
  --fs: 'Alfa Slab One', Georgia, serif;
  --bg: #dcd8c6;
  --paper: #ebe7d8;
  --ink: #14120f;
  --mute: #5b564a;
  --red: #c0182b;
  --gold: #e59605;
  --yellow: #f3b61f;
  --orange: #e9a96a;
  --nav-mute: #b9b4a0;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  font: 500 16px/1.3 var(--fb);
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(rgba(20, 18, 15, .07) 1px, transparent 1.2px);
  background-size: 7px 7px;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
input, select { font-size: 16px; }
ul, ol { list-style: none; }
.wrap { max-width: 560px; margin: 0 auto; }

/* ---------- Kopf, Flagge, Reiter ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--ink);
  padding: calc(var(--top) + 10px) 16px 0;
}
.top-in { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; max-width: 560px; margin: 0 auto; }
.lg { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; border: 2px solid var(--bg); flex: none; }
.tt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tt b { font: 400 19px/1 var(--fs); text-transform: uppercase; color: var(--bg); letter-spacing: .01em; }
.tt span { font-size: 13px; color: var(--gold); margin-top: 3px; }
.ich {
  font: 700 14px var(--fb); padding: 0 12px; min-height: 44px; min-width: 56px;
  border-radius: 3px; background: var(--red); color: #fff;
}
.flag {
  display: block; height: 19px;
  border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  background: linear-gradient(#0f0f11 0 33%, var(--red) 33% 66%, var(--yellow) 66%);
}
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--ink); padding-bottom: var(--bottom);
}
.nav-in { display: grid; grid-template-columns: repeat(5, 1fr); max-width: 560px; margin: 0 auto; }
.nav a {
  min-height: 56px; display: grid; place-items: center;
  font: 700 13px var(--fb); letter-spacing: .02em; color: var(--nav-mute); text-decoration: none;
}
.nav a.on { background: var(--red); color: #fff; }

main { padding: 18px 16px calc(96px + var(--bottom)); }

/* ---------- Überschriften ---------- */
.kick {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font: 700 12px var(--fb); letter-spacing: .1em; text-transform: uppercase; color: var(--red); margin-bottom: 6px;
}
h2 {
  font: 400 32px/1.05 var(--fs); text-transform: uppercase;
  border-bottom: 4px solid var(--ink); padding-bottom: 8px; margin-bottom: 12px;
}
.sh {
  font: 400 16px/1.1 var(--fs); text-transform: uppercase;
  border-bottom: 3px solid var(--ink); padding-bottom: 4px; margin: 24px 0 10px;
}
.sh small { font: 500 12px var(--fb); color: var(--mute); text-transform: none; }
.hint { color: var(--mute); font-size: 14px; }
.note { color: var(--mute); font-size: 13px; margin-top: 14px; }
.leer {
  background: var(--paper); border: 3px dashed var(--ink); padding: 18px 14px; text-align: center; color: var(--mute);
}
.st { padding: 3px 8px; border-radius: 3px; background: var(--red); color: #fff; font-weight: 700; white-space: nowrap; }
.st.zu { background: var(--ink); color: var(--yellow); }
.geaendert {
  background: var(--yellow); border: 3px solid var(--ink); padding: 8px 12px; font-size: 14px; font-weight: 600; margin-bottom: 14px;
}

/* ---------- Anmeldung, Wer bist du ---------- */
.login { padding: calc(var(--top) + 24px) 16px 40px; }
.hero { display: grid; place-items: center; padding: 8px 0; }
.hero img { width: 180px; height: 180px; object-fit: cover; border-radius: 4px; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--red); }
.login h1 { font: 400 30px/1.1 var(--fs); text-transform: uppercase; text-align: center; margin: 22px 0 6px; }
.login .hint { text-align: center; margin-bottom: 18px; }
.feld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.feld label { font-weight: 700; font-size: 14px; }
.feld input, .feld select {
  min-height: 52px; padding: 0 14px; background: var(--paper);
  border: 3px solid var(--ink); border-radius: 4px; outline: none;
}
.feld input:focus { box-shadow: 3px 3px 0 var(--red); }
.fehler { color: var(--red); font-weight: 700; font-size: 14px; min-height: 20px; margin-bottom: 8px; }
.foot { text-align: center; color: var(--mute); font-size: 13px; margin-top: 20px; }

/* ---------- Kacheln (Fahrer) ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile {
  min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  position: relative; background: var(--paper); border: 3px solid var(--ink); border-radius: 4px; box-shadow: 4px 4px 0 var(--ink);
}
.tile .k { font: 400 22px/1 var(--fs); color: var(--red); }
.tile .nm { font-size: 14px; font-weight: 600; }
.tile .gast { position: absolute; top: 3px; left: 5px; font-size: 10px; font-weight: 700; color: var(--mute); text-transform: uppercase; }
.tile.on { background: var(--yellow); box-shadow: 4px 4px 0 var(--red); }
.tile.on .k { color: var(--ink); }
.tile.neu { border-style: dashed; box-shadow: none; background: transparent; }
.tile.neu .k { color: var(--ink); }
.tile:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.badge {
  position: absolute; top: -12px; right: -10px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font: 400 15px var(--fs);
  background: var(--ink); color: var(--yellow); border: 2px solid var(--bg);
}

/* ---------- Tabelle ---------- */
.cols, .row { display: grid; grid-template-columns: 36px 1fr 44px 56px; gap: 6px; align-items: center; }
.cols { padding: 0 10px 6px; font: 600 11px var(--fb); letter-spacing: .1em; text-transform: uppercase; }
.cols span:nth-child(n+3) { text-align: right; }
.list { border: 3px solid var(--ink); background: var(--paper); box-shadow: 5px 5px 0 var(--ink); }
.row { min-height: 56px; padding: 6px 10px; border-bottom: 2px solid var(--ink); }
.row:last-child { border-bottom: 0; }
.row .pos { font: 400 24px/1 var(--fs); }
.row .who { display: flex; flex-direction: column; min-width: 0; }
.row .who b { font-size: 18px; font-weight: 700; }
.row .who small { font-size: 12px; color: var(--mute); }
.row .av { text-align: right; font: 400 15px var(--fs); color: var(--mute); }
.row .pt { text-align: right; font: 400 26px/1 var(--fs); }
.row.p1 { background: var(--red); color: #f6f1e0; }
.row.p1 small, .row.p1 .av { color: #f1d4cf; }
.row.p2 { background: var(--yellow); }
.row.p3 { background: var(--orange); }
.row.me .who b::after { content: " (du)"; font-weight: 600; font-size: 13px; }
.saison-wahl { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- Renntag ---------- */
.rennen-karte {
  display: flex; gap: 10px; align-items: center; justify-content: space-between; width: 100%; text-align: left;
  padding: 12px 14px; min-height: 56px; margin-bottom: 12px;
  background: var(--paper); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
}
.rennen-karte .t { font-weight: 700; }
.rennen-karte .m { flex: 1; color: var(--mute); font-size: 14px; }
.rennen-karte b { font: 400 17px var(--fs); color: var(--red); white-space: nowrap; }
.step { margin-bottom: 22px; }
.step h3 { font: 400 16px/1.1 var(--fs); text-transform: uppercase; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.step h3 i {
  font: 400 13px var(--fs); font-style: normal; width: 24px; height: 24px; flex: none;
  display: inline-grid; place-items: center; background: var(--red); color: #fff; border-radius: 3px;
}
.step .hint { margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: 48px; min-width: 76px; padding: 0 14px; display: inline-flex; gap: 6px; align-items: center; justify-content: center;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 4px; box-shadow: 3px 3px 0 var(--ink); font-size: 15px;
}
.chip b { font: 400 18px var(--fs); }
.chip.sel { background: var(--yellow); box-shadow: 3px 3px 0 var(--red); }
.plist { border: 3px solid var(--ink); background: var(--paper); }
.plist li { display: grid; grid-template-columns: 30px 1fr auto 44px; gap: 8px; align-items: center; min-height: 46px; padding: 4px 10px; border-bottom: 2px solid var(--ink); }
.plist li:last-child { border-bottom: 0; }
.plist .pos { font: 400 18px var(--fs); }
.plist .who { font-weight: 700; font-size: 17px; }
.plist .who small { color: var(--mute); font-size: 12px; font-weight: 600; }
.plist .calc { font-size: 13px; color: var(--mute); }
.plist .pt { text-align: right; font: 400 22px var(--fs); color: var(--red); }
.plist.zwei li { grid-template-columns: 30px 1fr 44px; }

.btns { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.btn {
  min-height: 54px; padding: 0 16px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 18px var(--fb); letter-spacing: .04em; text-transform: uppercase;
  border: 3px solid var(--ink); border-radius: 4px; box-shadow: 5px 5px 0 var(--ink);
  background: var(--paper);
}
.btn.main { background: var(--red); color: #fff; }
.btn.wa { background: #1f9d55; color: #fff; }
.btn.klein { min-height: 44px; font-size: 15px; box-shadow: 3px 3px 0 var(--ink); }
.btn:disabled { opacity: .45; }
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.link { color: var(--red); font-weight: 700; text-decoration: underline; min-height: 44px; padding: 0 4px; }
.zeile { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- Rückblick ---------- */
.kal { background: var(--paper); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); padding: 10px; }
.kal-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kal-kopf b { font: 400 18px var(--fs); text-transform: uppercase; }
.kal-kopf button { min-width: 44px; min-height: 44px; font: 400 22px var(--fs); }
.kal-kopf button:disabled { opacity: .25; }
.kal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.kal-grid .wt { font: 700 11px var(--fb); color: var(--mute); padding: 4px 0; }
.kal-grid .tag { min-height: 44px; display: grid; place-items: center; font-weight: 600; border-radius: 3px; }
.kal-grid .tag.do { color: var(--ink); }
.kal-grid .tag.fremd { color: transparent; }
.kal-grid .tag.renn { background: var(--red); color: #fff; font: 400 16px var(--fs); border: 2px solid var(--ink); }
.kal-grid .tag.heute { outline: 2px dashed var(--ink); }

/* ---------- Statistik ---------- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { padding: 12px; display: flex; flex-direction: column; gap: 2px; min-height: 92px; background: var(--paper); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.card:first-child { background: var(--yellow); }
.card small { font-size: 12px; color: var(--mute); font-weight: 600; }
.card b { font: 400 36px/1 var(--fs); color: var(--red); }
.card span { font-size: 14px; font-weight: 600; }
.bars li { display: grid; grid-template-columns: 48px 1fr 44px; align-items: center; gap: 8px; min-height: 32px; }
.bars .k { font: 400 15px var(--fs); }
.bars .bar { height: 18px; background: var(--paper); border: 2px solid var(--ink); display: block; }
.bars .bar i { display: block; height: 100%; background: var(--red); }
.bars li:first-child .bar i { background: var(--ink); }
.bars .v { text-align: right; font: 400 14px var(--fs); }
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: var(--ink); stroke-width: 1; opacity: .35; }
.chart .ax { fill: var(--mute); font: 600 10px var(--fb); }
.chart .ln { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.lgd { display: flex; gap: 16px; flex-wrap: wrap; font: 600 13px var(--fb); margin-top: 6px; }
.lgd span { display: flex; align-items: center; gap: 6px; }
.lgd i { width: 16px; height: 4px; border-radius: 2px; }
.tab-wrap { overflow-x: auto; border: 3px solid var(--ink); background: var(--paper); }
.tab { width: 100%; border-collapse: collapse; font-size: 14px; }
.tab th, .tab td { padding: 8px 6px; text-align: right; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.tab th { font: 700 11px var(--fb); letter-spacing: .06em; text-transform: uppercase; }
.tab th:first-child, .tab td:first-child { text-align: left; }
.tab tr:last-child td { border-bottom: 0; }
.tab td b { font: 400 15px var(--fs); }

/* ---------- Menü, Dialog, Hinweis ---------- */
.dlg-hg { position: fixed; inset: 0; background: rgba(20, 18, 15, .55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.dlg {
  width: 100%; max-width: 560px; background: var(--bg); border-top: 4px solid var(--ink);
  padding: 20px 16px calc(20px + var(--bottom)); max-height: 90vh; overflow-y: auto;
}
.dlg h3 { font: 400 22px var(--fs); text-transform: uppercase; margin-bottom: 10px; }
.dlg p { margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; margin-bottom: 8px; }
.check input { width: 24px; height: 24px; accent-color: var(--red); }
.fahrer-liste li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; border-bottom: 2px solid var(--ink); }
.fahrer-liste li.aus { opacity: .5; }
#hinweis {
  position: fixed; left: 16px; right: 16px; bottom: calc(72px + var(--bottom)); z-index: 60;
  max-width: 528px; margin: 0 auto; background: var(--ink); color: var(--yellow);
  padding: 12px 14px; font-weight: 700; border-radius: 4px; text-align: center;
  opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none;
}
#hinweis.zeigen { opacity: 1; transform: none; }
#hinweis.fehler { background: var(--red); color: #fff; }
.laden { text-align: center; padding: 60px 0; font: 400 20px var(--fs); text-transform: uppercase; }

/* ---------- Hilfe ---------- */
.hilfe-block {
  background: var(--paper); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  padding: 14px; margin-top: 18px; font-size: 17px; line-height: 1.45;
}
.hilfe-block h3 { font: 400 18px/1.15 var(--fs); text-transform: uppercase; margin-bottom: 8px; }
.hilfe-block p + p { margin-top: 8px; }
.punkte-liste li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 2px solid var(--ink); }
.punkte-liste li:last-child { border-bottom: 0; }
.punkte-liste span { font: 400 16px var(--fs); color: var(--red); white-space: nowrap; }
.punkte-liste + p { margin-top: 10px; }
.schritte { padding-left: 22px; }
.schritte li { margin-bottom: 8px; }
.beispiel-knopf {
  display: inline-block; padding: 2px 12px; margin-left: 4px; font-weight: 700;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 4px; box-shadow: 3px 3px 0 var(--ink);
}

/* ---------- App-Tour ---------- */
.tour-hg { position: fixed; inset: 0; z-index: 80; }
.tour-hg.dunkel { background: rgba(20, 18, 15, .6); }
.tour-ziel:not(.nav) { position: relative; }
.tour-ziel {
  z-index: 85 !important;
  box-shadow: 0 0 0 4px var(--yellow), 0 0 0 8px var(--ink), 0 0 0 100vmax rgba(20, 18, 15, .6) !important;
  animation: tour-puls 1.4s ease-in-out infinite;
}
.tour-ebene { z-index: 85 !important; }
@keyframes tour-puls { 50% { box-shadow: 0 0 0 7px var(--yellow), 0 0 0 11px var(--ink), 0 0 0 100vmax rgba(20, 18, 15, .6); } }
.tour-karte {
  position: fixed; left: 12px; right: 12px; z-index: 90; max-width: 536px; margin: 0 auto;
  background: var(--bg); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--red);
  padding: 14px 16px 16px; font-size: 17px; line-height: 1.4;
}
.tour-karte.unten { bottom: calc(76px + var(--bottom)); }
.tour-karte.oben { top: calc(var(--top) + 12px); }
.tour-karte small { font-weight: 700; color: var(--red); letter-spacing: .06em; text-transform: uppercase; font-size: 12px; }
.tour-karte h3 { font: 400 20px/1.15 var(--fs); text-transform: uppercase; margin: 4px 0 8px; }
.tour-x { min-width: 44px; min-height: 44px; font-size: 22px; font-weight: 700; margin: -10px -8px -10px 0; }
.tour-knoepfe { display: flex; gap: 12px; margin-top: 14px; }
.tour-knoepfe .btn { flex: 1; min-height: 50px; }
