:root {
  /* Dunkel genug fuers Abends, aber bunt statt grau. */
  --bg: #141031;
  --bg-2: #1B1540;
  --surface: #221C4D;
  --surface-2: #2C2560;
  --surface-3: #392F7A;

  --pink: #FF5FA2;
  --purple: #8B5CF6;
  --mint: #2EE6C5;
  --gold: #FFC93C;
  --orange: #FF9F43;

  --text: #F8F5FF;
  --muted: #A79FD1;
  --danger: #FF6B7A;
  --success: #4ADE80;

  --border: #362D6E;
  --border-strong: #4A3F92;

  --felt: #16694F;
  --felt-2: #12563F;
  --wood: #7A4E2A;
}

/* touch-action: manipulation schaltet den Doppeltipp-Zoom ab. Ohne das
   zoomt das Handy rein, wenn man zweimal schnell hintereinander tippt. */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button { user-select: none; -webkit-user-select: none; }

html, body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% -5%, rgba(139, 92, 246, .35), transparent 45%),
    radial-gradient(circle at 92% 8%, rgba(255, 95, 162, .28), transparent 42%);
  background-attachment: fixed;
}

.app {
  max-width: 620px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.7px; margin: 0 0 6px; }
h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; margin: 0 0 6px; }
.sub { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 12px; }
.msg {
  font-size: 14px; line-height: 1.45; margin: 8px 0; padding: 10px 12px;
  background: var(--surface); border-radius: 14px; border-left: 4px solid var(--gold);
}
.label {
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.9px; font-weight: 800; margin: 18px 0 8px;
}

/* --- Buttons --- */
button {
  font: inherit; font-weight: 800; font-size: 17px;
  color: #fff; border: 0; border-radius: 17px; padding: 17px 22px;
  cursor: pointer; transition: transform .09s, filter .09s;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 6px 18px rgba(139, 92, 246, .32);
}
button:active:not(:disabled) { transform: scale(.97); filter: brightness(1.1); }
button:disabled { opacity: .35; cursor: default; box-shadow: none; }

button.secondary {
  background: var(--surface-2); border: 1.5px solid var(--border-strong); box-shadow: none;
}
button.accent {
  background: linear-gradient(135deg, var(--mint), #17B79B); color: #04261F;
  box-shadow: 0 6px 18px rgba(46, 230, 197, .28);
}
button.ghost { background: none; color: var(--muted); font-weight: 600; box-shadow: none; }
button.small { font-size: 15px; padding: 12px 16px; border-radius: 13px; }
button.wide { width: 100%; }

/* Grosse Auswahl-Kacheln, z.B. zum Schlucke verteilen */
button.tile {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 62px; padding: 12px 16px;
  font-size: 18px; text-align: left;
  background: var(--surface-2); border: 1.5px solid var(--border-strong); box-shadow: none;
}
button.tile:active { border-color: var(--mint); }

/* Der Aktionsbereich klebt unten fest - man muss nie scrollen, um zu tippen. */
.actions {
  position: sticky; bottom: 0; z-index: 20;
  margin-top: 10px;
  padding: 14px 0 calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 0%, var(--bg) 68%, rgba(20,16,49,0));
}
.actions > *:first-child { margin-top: 0; }
/* Kleine Luecke zwischen Auswahlfeld und dem Knopf darunter - sonst kleben
   die beiden aneinander und man tippt leicht daneben. */
.actions .panel, .actions .banner { margin-top: 0; margin-bottom: 12px; }
.actions > *:last-child { margin-bottom: 0; }

.row { display: flex; gap: 12px; }
.row > button { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.tiles { display: flex; flex-direction: column; gap: 10px; }

input {
  width: 100%; font: inherit; font-size: 17px;
  background: var(--surface); color: var(--text);
  border: 1.5px solid var(--border); border-radius: 15px;
  padding: 16px 16px;
}
input:focus { outline: none; border-color: var(--purple); }
input::placeholder { color: var(--muted); }
input.code {
  font-size: 34px; font-weight: 800; letter-spacing: 12px;
  text-align: center; text-transform: uppercase; padding-left: 12px;
}

/* --- Farbige Namenskreise --- */
.av {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: #1A1040; flex: none;
}
.av.sm { width: 26px; height: 26px; font-size: 12px; }
.av.emoji { background: var(--surface-3); font-size: 21px; }
.av.sm.emoji { font-size: 15px; }

/* --- Profilbild aussuchen ---
   Feste Hoehe statt aspect-ratio: aeltere iPhones kennen aspect-ratio nicht,
   dann faellt der Knopf auf null Hoehe zusammen und ist nicht antippbar. */
.avpick {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 4px;
}
.avopt {
  position: relative; padding: 0; flex: none;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; line-height: 1; border-radius: 14px;
  background: var(--surface); border: 2px solid var(--border); box-shadow: none;
}
.avopt.mine {
  border-color: var(--mint); background: var(--surface-2); opacity: 1;
  box-shadow: 0 0 0 3px rgba(46,230,197,.22);
}
.avopt.weg { opacity: .28; }
.avopt.weg i {
  position: absolute; right: -3px; bottom: -3px;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--danger); color: #fff;
  font-style: normal; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.avhint { font-size: 12px; color: var(--muted); margin: 6px 0 0; font-weight: 600; }

.panel {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 20px; padding: 16px; margin: 14px 0;
}
.panel.accent { border-color: var(--mint); }
.panel h3 { margin: 0; font-size: 17px; font-weight: 800; }

.ph { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ph h3 { flex: 1; min-width: 0; }

/* Eine Zeile je Person: links die grosse Flaeche zum Geben, rechts ein
   schmales Minus zum Zuruecknehmen. Das Minus sitzt weit genug weg, dass man
   es beim schnellen Tippen nicht aus Versehen erwischt. */
.tilerow { display: flex; gap: 8px; align-items: stretch; }
.tilerow .tile { flex: 1; min-width: 0; }
.tile .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .von {
  flex: none; font-size: 13px; font-weight: 800;
  background: var(--mint); color: #04261F;
  border-radius: 9px; padding: 3px 8px;
}
button.minus {
  flex: none; width: 54px; padding: 0;
  font-size: 26px; font-weight: 800; line-height: 1;
  background: var(--surface); color: var(--danger);
  border: 1.5px solid var(--danger); border-radius: 16px; box-shadow: none;
}
button.minus:active { background: var(--danger); color: #fff; }
.panel .hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

.banner {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 16px; padding: 15px; text-align: center;
  color: var(--muted); font-size: 15px; margin-top: 14px;
}
.error { color: var(--danger); font-size: 15px; margin-top: 12px; font-weight: 600; }
.crash {
  background: var(--surface); border: 1.5px solid var(--danger);
  border-radius: 14px; padding: 12px; margin: 12px 0;
  color: var(--danger); font-size: 12px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, monospace;
}
.success {
  color: var(--success); font-size: 19px; font-weight: 800;
  text-align: center; margin: 16px 0;
}

/* --- Spielkarten ---
   Schlicht gehalten: Wert und Symbol mittig untereinander, sonst nichts.
   Eine einzige zentrierte Spalte kann auf keinem Bildschirm verrutschen. */
.card {
  display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #FFFDF7;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 3px 8px rgba(0,0,0,.4);
  flex: none; line-height: 1;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
}
.card.red { color: #D8213C; }
.card.black { color: #16121F; }
.card .rk { font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.card .st { line-height: 1; }

/* Rueckseite */
.card.back {
  background: linear-gradient(135deg, #3B2E8C, #6D4BD8);
  padding: 4px; align-items: stretch; gap: 0;
}
.card.back::after {
  content: ""; flex: 1; border: 1.5px solid rgba(255,255,255,.35); border-radius: 4px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.22) 0 1.5px, transparent 1.5px 8px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.22) 0 1.5px, transparent 1.5px 8px);
}
.card.dim { opacity: .3; }
/* Auswaehlbar: nur ein Rahmen aus Schatten, damit sich die Groesse nicht aendert */
.card.pick {
  box-shadow: 0 0 0 3px var(--mint), 0 0 0 7px rgba(46,230,197,.25), 0 3px 8px rgba(0,0,0,.4);
  cursor: pointer;
}

/* Groessen im echten Kartenverhaeltnis 1 : 1.4 */
.card.xs { width: 34px; height: 48px; border-radius: 4px; gap: 1px; }
.card.xs .rk { font-size: 15px; }
.card.xs .st { font-size: 13px; }

.card.s  { width: 56px; height: 78px; border-radius: 6px; gap: 2px; }
.card.s .rk { font-size: 25px; }
.card.s .st { font-size: 21px; }

/* Nur fuer die Rennbahn: Streckenkarte und Pferd haben genau diese Groesse,
   damit sie nebeneinander auf einer Linie liegen. Die Zahlen muessen zu
   SCHRITT/KARTE_H in app.js passen - test-ui.js prueft das. */
.card.t  { width: 38px; height: 53px; border-radius: 5px; gap: 1px; }
.card.t .rk { font-size: 18px; }
.card.t .st { font-size: 15px; }

.card.m  { width: 76px; height: 106px; border-radius: 8px; gap: 3px; }
.card.m .rk { font-size: 34px; }
.card.m .st { font-size: 28px; }

.card.l  { width: 98px; height: 137px; border-radius: 10px; gap: 4px; }
.card.l .rk { font-size: 44px; }
.card.l .st { font-size: 36px; }

.card.xl { width: 128px; height: 179px; border-radius: 13px; gap: 5px; }
.card.xl .rk { font-size: 58px; }
.card.xl .st { font-size: 47px; }

/* --- Tisch --- */
.seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.seat {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 18px;
  padding: 9px 12px; min-width: 116px; text-align: center;
}
.seat.active {
  border-color: var(--gold); background: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(255,201,60,.16);
}
.seat .head { display: flex; align-items: center; justify-content: center; gap: 8px; }
.seat .name { font-size: 14px; font-weight: 800; color: var(--muted); }
.seat.active .name { color: var(--text); }
.seat .cards { display: flex; justify-content: center; margin-top: 6px; min-height: 48px; align-items: center; }
.seat .cards .card { margin: 0 -5px; }
.seat .off { color: var(--danger); font-size: 11px; margin-top: 3px; }

.badge {
  min-width: 30px; padding: 3px 9px; border-radius: 11px;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #3A2200; font-size: 14px; font-weight: 800;
}

/* Kein rotateX mehr: 3D-Kippen laesst das Handy alles unscharf rechnen. */
.felt {
  margin: 12px 0 6px; border-radius: 26px;
  background: linear-gradient(160deg, var(--felt), var(--felt-2));
  border: 5px solid var(--wood);
  padding: 14px 12px; min-height: 120px;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  box-shadow: 0 10px 22px rgba(0,0,0,.45), inset 0 0 50px rgba(0,0,0,.22);
}
.felt .line { gap: 8px; }
.felt .tag {
  font-size: 11px; font-weight: 800; letter-spacing: .9px;
  text-transform: uppercase; padding: 4px 11px; border-radius: 9px; margin: 5px 0 6px;
}
.tag.drink { background: #5A2233; color: #FFAFC0; }
.tag.give  { background: #0F4A3E; color: #6FF0D6; }
.felt .line { display: flex; justify-content: center; }
.felt .slot { display: flex; flex-direction: column; align-items: center; }
.felt .val { color: var(--gold); font-size: 13px; font-weight: 800; margin-top: 2px; }
.felt .note { color: #8FE8D0; font-size: 12px; margin-top: 6px; font-weight: 600; }

/* --- Eigene Hand, aufgefaechert --- */
.me { margin-top: 10px; text-align: center; }
.me .head { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
.me .name { font-size: 17px; font-weight: 800; }
.hand { display: flex; justify-content: center; align-items: flex-start; min-height: 150px; padding-top: 8px; }
.hand .card { margin: 0 -22px; transform-origin: bottom center; }

/* --- Ergebnis --- */
.result {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 18px; padding: 16px; margin-top: 10px;
}
.result.first { border-color: var(--gold); background: var(--surface-2); }
.result .rank { color: var(--muted); width: 26px; font-weight: 800; font-size: 17px; }
.result .name { flex: 1; font-size: 17px; font-weight: 800; }

.codebox {
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 2px solid var(--purple);
  border-radius: 22px; padding: 24px; text-align: center; margin: 14px 0;
  box-shadow: 0 8px 24px rgba(139,92,246,.22);
}
.codebox .code {
  font-size: 50px; font-weight: 800; letter-spacing: 14px;
  background: linear-gradient(135deg, var(--pink), var(--mint));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.player-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 16px; padding: 13px 15px; margin-bottom: 9px;
}
.player-row .name { flex: 1; font-weight: 800; font-size: 16px; }
.tag-host {
  color: #04261F; background: var(--mint); font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .6px; padding: 3px 9px; border-radius: 8px;
}

.version {
  text-align: center; color: var(--muted); opacity: .5;
  font-size: 12px; font-weight: 700; margin: 26px 0 0;
}

.greet { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.greet .who { flex: 1; }
.greet .who .hi { font-size: 13px; color: var(--muted); }
.greet .who .nm { font-size: 20px; font-weight: 800; }

/* Einblendungen, wenn man Schlucke bekommt - mehrere stapeln sich */
.toasts {
  position: fixed; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top));
  z-index: 100; display: flex; flex-direction: column; align-items: center;
  gap: 8px; pointer-events: none;
}
.toast {
  width: 100%; max-width: 420px;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 18px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff; font-size: 16px; font-weight: 700;
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
  animation: toastIn .28s cubic-bezier(.2,.9,.3,1.3);
}
.toast.bad { background: linear-gradient(135deg, #E5484D, #B02A2F); }
.toast.out { animation: toastOut .45s forwards; }
@keyframes toastIn  { from { transform: translateY(-90px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes toastOut { to { transform: translateY(-90px); opacity: 0 } }

/* --- Wer ist dran? --- */
.turn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin: 0 0 12px; border-radius: 16px;
  font-size: 17px; font-weight: 800;
  background: var(--surface-2); color: var(--muted);
  border: 1.5px solid var(--border-strong);
}
.turn .t { flex: 1; min-width: 0; }
.turn .x {
  flex: none; font-size: 13px; font-weight: 800; opacity: .8;
  background: rgba(0,0,0,.22); border-radius: 9px; padding: 4px 8px;
}
.turn.me {
  background: linear-gradient(135deg, var(--mint), #17B79B);
  color: #04261F; border-color: transparent;
  box-shadow: 0 6px 18px rgba(46, 230, 197, .28);
}
.turn.me .av { background: rgba(255,255,255,.55); }
.turn.me .x { background: rgba(0,0,0,.14); }

/* Beilaeufige Zusatzinfo in einer Ueberschrift */
.leicht {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--muted); letter-spacing: 0; margin-top: 2px;
}

/* --- Spielauswahl --- */
.games { display: flex; gap: 10px; margin-bottom: 4px; }
.gamecard {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 8px; text-align: center;
  background: var(--surface); border: 2px solid var(--border); border-radius: 18px;
  box-shadow: none; color: var(--text);
}
.gamecard.sel { border-color: var(--mint); background: var(--surface-2); }
.gamecard:disabled { opacity: 1; }
.gamecard:disabled:not(.sel) { opacity: .35; }
.gamecard .emo { font-size: 38px; line-height: 1.1; }
.gamecard .nm { font-size: 16px; font-weight: 800; }
.gamecard .kz { font-size: 12px; color: var(--muted); font-weight: 600; }
.gamecard.sel .nm::after { content: " ✓"; color: var(--mint); }

/* --- Regeln --- */
.rules {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 20px; padding: 4px 16px 16px;
}
.rules h3 {
  font-size: 16px; font-weight: 800; margin: 18px 0 6px;
  color: var(--mint); letter-spacing: -.2px;
}
.rules p { font-size: 15px; line-height: 1.6; color: var(--text); margin: 0 0 10px; }
.rules ol { margin: 0 0 10px; padding-left: 22px; }
.rules li { font-size: 15px; line-height: 1.6; margin-bottom: 5px; }
.rules strong { color: var(--gold); }
.rules em { color: var(--muted); font-style: normal; font-weight: 700; }

/* --- Pferderennen: Wetten --- */
.horses { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.horse {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px; background: var(--surface); box-shadow: none;
  border: 2px solid var(--border); border-radius: 18px; color: var(--text);
}
.horse.sel { border-color: var(--mint); background: var(--surface-2); }
.horse .nm { font-size: 15px; font-weight: 800; }

.bets { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.bet {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-3); border-radius: 999px; padding: 2px 8px 2px 2px;
  font-size: 11px; font-weight: 700; color: var(--muted);
}
.bet.mine { background: var(--purple); color: #fff; }
.bet b { color: var(--gold); font-size: 12px; }
.bet .av.sm { width: 20px; height: 20px; font-size: 10px; }

.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 6px 0 12px; }
.stepper .num { font-size: 40px; font-weight: 800; min-width: 62px; text-align: center; }
button.step {
  width: 54px; height: 54px; padding: 0; border-radius: 50%;
  font-size: 28px; line-height: 1; background: var(--surface-3);
  border: 1.5px solid var(--border-strong); box-shadow: none;
}

/* --- Pferderennen: die Bahn laeuft von oben nach unten --- */
.track {
  background: linear-gradient(170deg, #1B7A5C 0%, #13614A 55%, #0E4E3C 100%);
  border-radius: 22px;
  padding: 10px 10px 12px; margin: 8px 0;
  box-shadow:
    0 0 0 4px #6B4526, 0 0 0 5px rgba(0,0,0,.35),
    0 12px 26px rgba(0,0,0,.5), inset 0 0 60px rgba(0,0,0,.28);
}
/* Eine Farbe je Pferd - viel leichter zu verfolgen als zweimal rot,
   zweimal schwarz. Die Farben stehen ausgeschrieben da; color-mix() waere
   kuerzer, kennen aeltere Handys aber nicht. */
.lane.hearts,   .pf.hearts   { --bahn: #FF5C7A; }
.lane.diamonds, .pf.diamonds { --bahn: #FFA23C; }
.lane.clubs,    .pf.clubs    { --bahn: #4FC3F7; }
.lane.spades,   .pf.spades   { --bahn: #A78BFA; }

.lane.hearts   .trail { background: linear-gradient(180deg, rgba(255,92,122,.10), rgba(255,92,122,.45)); }
.lane.diamonds .trail { background: linear-gradient(180deg, rgba(255,162,60,.10), rgba(255,162,60,.45)); }
.lane.clubs    .trail { background: linear-gradient(180deg, rgba(79,195,247,.10), rgba(79,195,247,.45)); }
.lane.spades   .trail { background: linear-gradient(180deg, rgba(167,139,250,.10), rgba(167,139,250,.45)); }

.roundel.hearts   { background: #FF5C7A; }
.roundel.diamonds { background: #FFA23C; }
.roundel.clubs    { background: #4FC3F7; }
.roundel.spades   { background: #A78BFA; }

.rhead {
  display: grid; grid-template-columns: 42px repeat(4, 1fr);
  gap: 6px; align-items: end; padding-bottom: 8px;
}
.hcol { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.roundel {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #1A1030; line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.4), inset 0 -2px 6px rgba(0,0,0,.18);
}

/* Hintergrund und Stufen-Zeilen liegen uebereinander und benutzen dasselbe
   Spaltenraster. Dadurch sitzen Streckenkarte und Pferd zwangslaeufig auf
   derselben Hoehe - sie stehen im selben Zeilenelement. */
.lanes { position: relative; }
.lanes .bg, .lanes .step {
  position: absolute; left: 0; right: 0;
  display: grid; grid-template-columns: 42px repeat(4, 1fr); gap: 6px;
}
.lanes .bg { top: 0; bottom: 0; }
.lanes .step { z-index: 2; align-items: center; }

.step .mk, .step .pf {
  display: flex; align-items: center; justify-content: center; height: 100%;
}
.hw { position: relative; display: inline-flex; }

.mk-start {
  font-size: 9px; font-weight: 800; letter-spacing: 1.2px;
  color: rgba(255,255,255,.55);
}
.mk-ziel { font-size: 24px; }

/* Eine Bahn: dunkler Streifen, davor die farbige Spur bis zum Pferd. */
.lane {
  position: relative; border-radius: 14px;
  background: linear-gradient(180deg, rgba(0,0,0,.3), rgba(0,0,0,.12));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}
.lane .trail {
  position: absolute; left: 0; right: 0; top: 0;
  border-radius: 14px 14px 0 0;
  border-bottom: 2px solid var(--bahn);
  transition: height .35s cubic-bezier(.3,1.2,.5,1);
}
.lane .ziellinie {
  position: absolute; left: 0; right: 0; bottom: 0; height: 14px;
  border-radius: 0 0 14px 14px;
  background: #241C4A;
  background-image: repeating-conic-gradient(#F4F0FF 0 25%, #241C4A 0 50%);
  background-size: 14px 14px;
  opacity: .85;
}
.lane.win { box-shadow: inset 0 0 0 2px var(--gold), 0 0 22px rgba(255,201,60,.35); }

/* Die Stufenzahl direkt am Pferd - so muss niemand Felder abzaehlen. */
.stufe {
  position: absolute; top: -5px; right: -7px;
  min-width: 19px; height: 19px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--bahn); color: #1A1030;
  font-size: 12px; font-weight: 800; line-height: 1;
  box-shadow: 0 2px 5px rgba(0,0,0,.45);
}

/* Trennlinien zwischen den Stufen, quer ueber alle Bahnen */
.rowline {
  position: absolute; left: 0; right: 0; height: 1px; z-index: 1;
  background: rgba(255,255,255,.16); pointer-events: none;
}

/* Wer gesetzt hat: nur Gesichter, feste Hoehe, hoechstens drei.
   Sonst werden die vier Spalten unterschiedlich hoch. */
.bmini {
  display: flex; align-items: center; justify-content: center;
  height: 16px; font-size: 13px; line-height: 1; overflow: hidden;
}
.bmini b { font-size: 10px; font-weight: 800; color: rgba(255,255,255,.7); margin-left: 1px; }

/* Gezogene Karte und "wer ist dran" in einer Zeile */
.racehead {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2); border: 1.5px solid var(--border-strong);
  border-radius: 16px; padding: 8px 12px; margin: 0 0 8px;
}
.racehead.me { border-color: var(--mint); }
.racehead .txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.racehead .txt b { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 7px; }
.racehead.me .txt b { color: var(--mint); }
.racehead .txt i {
  font-style: normal; font-size: 13px; color: var(--muted); font-weight: 600; line-height: 1.35;
}
.winner { display: flex; justify-content: center; margin: 10px 0 16px; }

.offline-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--danger); color: #fff;
  text-align: center; padding: 11px; font-size: 14px; font-weight: 800;
}
