/* Poker-Dashboard.
   Dunkel, weil abends bei gedaempftem Licht gespielt wird -- ein heller
   Bildschirm am Tischende blendet und macht die Karten schlechter lesbar.
   Filzgruen und Gold nehmen den Tisch auf, ohne Kasinokitsch. */

:root {
  --bg: #080b0f;
  --surface: #121820;
  --surface-2: #1a222c;
  --surface-3: #232d39;
  --line: #2b3742;
  --text: #eef3f8;
  --muted: #8a99a8;
  --dim: #5d6b7a;

  --gold: #e8b93f;
  --gold-dim: #8a6f22;
  --green: #35c46a;
  --green-dark: #0f3d2a;
  --red: #ff5a52;
  --blue: #4ea1ff;
  --violet: #a986ff;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Ziffern mit fester Breite. Ohne das springt die ganze Uhr bei jedem
     Sekundenwechsel seitlich -- bei einer Zahl, auf die den halben Abend
     jemand schaut, ist das unertraeglich. */
  --num: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  /* Der Doppeltipp-Zoom auf iOS macht Knoepfe, die eng beieinander liegen,
     unbenutzbar -- man zoomt, statt zu druecken. */
  touch-action: manipulation;
  overscroll-behavior-y: none;
}

body {
  display: flex;
  flex-direction: column;
  /* Wegen der Adressleiste auf dem Handy: 100vh ist dort zu hoch und schiebt
     die Navigation unter den Bildschirmrand. dvh folgt der echten Hoehe. */
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
input, select {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  width: 100%;
  /* Unter 16px zoomt iOS beim Antippen in das Feld hinein und die Seite
     bleibt danach verschoben. */
  font-size: 16px;
}
input:focus, select:focus { outline: 2px solid var(--gold-dim); outline-offset: -1px; border-color: transparent; }
input::placeholder { color: var(--dim); }

.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ------------------------------------------------------------- Kopfzeile */

header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.02em; }
.brand .chip {
  width: 24px; height: 24px; border-radius: 50%;
  background: conic-gradient(var(--red) 0 25%, #fff 0 50%, var(--red) 0 75%, #fff 0);
  border: 3px solid var(--red);
  flex: none;
}
.brand-name { font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 500; }
header .spacer { flex: 1; }

.hdr-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: .15s;
}
.hdr-btn:hover { background: var(--surface-3); color: var(--text); }
.hdr-btn.on { color: var(--gold); border-color: var(--gold-dim); background: rgba(232,185,63,.1); }

.livedot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.livedot.on { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* -------------------------------------------------------------- Grundriss */

main { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 16px; padding-bottom: 88px; }
@media (min-width: 900px) { main { padding: 24px; padding-bottom: 24px; } }

.view { display: none; animation: fade .18s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.card-title .right { margin-left: auto; text-transform: none; letter-spacing: 0; }
/* Auf schmalen Geraeten passt der Zusatz nicht mehr neben die Ueberschrift.
   Nebeneinander gequetscht brechen beide mehrzeilig um und der Kopf wird
   hoeher als der Inhalt darunter. */
@media (max-width: 480px) {
  .card-title { flex-wrap: wrap; }
  .card-title .right { margin-left: 0; width: 100%; margin-top: 5px; color: var(--dim); }
}

/* ------------------------------------------------------------ Live-Anzeige */

.clock-card {
  background: linear-gradient(165deg, #16202a 0%, #0d141b 60%, #0a1016 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px 20px 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
/* Ein schwacher Schimmer von oben. Nimmt der grossen dunklen Flaeche die
   Flachheit, ohne vom Timer abzulenken. */
.clock-card::before {
  content: ''; position: absolute; inset: -40% 20% auto;
  height: 200px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(232,185,63,.09), transparent 70%);
  pointer-events: none;
}
.clock-card.break { background: linear-gradient(165deg, #16232a 0%, #0b1a1a 60%, #081413 100%); }
.clock-card.warn::before { background: radial-gradient(ellipse, rgba(255,90,82,.16), transparent 70%); }

.level-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-3); border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px; position: relative;
}
.level-badge.break { color: var(--blue); border-color: rgba(78,161,255,.35); background: rgba(78,161,255,.1); }

.clock {
  font-family: var(--num); font-variant-numeric: tabular-nums;
  /* Waechst mit dem Fenster: auf dem Handy lesbar, auf dem Laptop am
     Tischende aus drei Metern Entfernung. */
  font-size: clamp(64px, 17vw, 190px);
  font-weight: 700; line-height: .92; letter-spacing: -.045em;
  margin: 2px 0 4px;
  text-shadow: 0 4px 40px rgba(0,0,0,.6);
  position: relative;
}
.clock.warn { color: var(--red); animation: heartbeat 1s ease-in-out infinite; }
.clock.paused { color: var(--dim); }
@keyframes heartbeat { 50% { opacity: .55; } }

.clock-sub { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .04em; position: relative; }

.blinds-row {
  display: flex; align-items: center; justify-content: center; gap: clamp(14px, 5vw, 48px);
  margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line);
  flex-wrap: wrap; position: relative;
}
.blind-block { text-align: center; }
.blind-label { font-size: 10px; text-transform: uppercase; letter-spacing: .13em; color: var(--dim); font-weight: 700; margin-bottom: 5px; }
.blind-value {
  font-family: var(--num); font-variant-numeric: tabular-nums;
  font-size: clamp(26px, 7vw, 56px); font-weight: 700; letter-spacing: -.03em;
  color: var(--gold); line-height: 1;
}
.blind-block.next .blind-value { font-size: clamp(17px, 4vw, 30px); color: var(--muted); }
.blind-block.ante .blind-value { color: var(--violet); }
.blind-sep { width: 1px; align-self: stretch; background: var(--line); }

/* Auf schmalen Schirmen bricht die Zeile um, und ein Trennstrich bleibt am
   Zeilenende haengen -- ein Strich, der nichts mehr trennt. Deshalb dort
   keine Striche, und "Als Naechstes" bekommt eine eigene Zeile. */
@media (max-width: 620px) {
  .blinds-row { gap: 16px 30px; }
  .blind-sep { display: none; }
  .blind-block.next {
    width: 100%; padding-top: 15px; margin-top: 2px;
    border-top: 1px solid var(--line);
  }
}

.progress { height: 4px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 20px; position: relative; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); border-radius: 999px; transition: width .9s linear; }
.progress-bar.warn { background: linear-gradient(90deg, #8a2a26, var(--red)); }

/* ------------------------------------------------------------- Kennzahlen */

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
@media (min-width: 620px) { .stats { grid-template-columns: repeat(4, 1fr); } }

.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 15px;
  position: relative; overflow: hidden;
}
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin-bottom: 7px; }
.stat-value { font-family: var(--num); font-variant-numeric: tabular-nums; font-size: clamp(21px, 5.5vw, 30px); font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.stat-hint { font-size: 11px; color: var(--dim); margin-top: 5px; font-weight: 500; }
.stat.money .stat-value { color: var(--green); }
.stat.chips .stat-value { color: var(--gold); }

/* -------------------------------------------------------------- Steuerung */

.controls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
@media (min-width: 620px) { .controls { grid-template-columns: repeat(4, 1fr); } }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 13px 14px;
  font-size: 14px; font-weight: 650; color: var(--text);
  transition: .14s; text-align: center;
  /* Fingerkuppen sind rund 9 mm breit. Alles darunter trifft man im Halbdunkel
     neben dem Ziel. */
  min-height: 46px;
}
.btn:hover { background: var(--surface-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(180deg, #2fa85c, #22874a); border-color: #2fa85c; color: #fff; }
.btn.primary:hover { background: linear-gradient(180deg, #37bd68, #269652); }
.btn.gold { background: linear-gradient(180deg, #e8b93f, #c99a25); border-color: var(--gold); color: #241a02; }
.btn.gold:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); border-color: rgba(255,90,82,.3); }
.btn.danger:hover { background: rgba(255,90,82,.12); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 8px 11px; font-size: 13px; min-height: 38px; }
.btn.wide { grid-column: 1 / -1; }

/* ---------------------------------------------------------------- Spieler */

.player-list { display: flex; flex-direction: column; gap: 9px; }

.player {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
  transition: .15s;
}
.player.out { opacity: .5; }
.player.out .player-name { text-decoration: line-through; text-decoration-color: var(--red); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-weight: 750; font-size: 15px; color: #0a0d10;
  letter-spacing: -.02em;
}
.player-main { flex: 1; min-width: 0; }
.player-name { font-weight: 650; font-size: 15px; display: flex; align-items: center; gap: 7px; }
.player-meta { font-size: 12px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.player-actions { display: flex; gap: 7px; flex: none; align-items: center; }

.tag {
  font-size: 10px; font-weight: 750; padding: 2px 7px; border-radius: 5px;
  text-transform: uppercase; letter-spacing: .05em;
}
.tag { background: var(--surface-3); color: var(--muted); }
.tag.gold { background: rgba(232,185,63,.16); color: var(--gold); }
.tag.red { background: rgba(255,90,82,.16); color: var(--red); }
.tag.blue { background: rgba(78,161,255,.16); color: var(--blue); }
.tag.green { background: rgba(53,196,106,.16); color: var(--green); }

.buyin-btn {
  background: linear-gradient(180deg, #2fa85c, #22874a);
  border-radius: var(--radius-sm); padding: 10px 13px;
  font-weight: 750; font-size: 14px; color: #fff; white-space: nowrap;
  min-height: 42px; display: flex; align-items: center; gap: 5px;
  transition: .14s;
}
.buyin-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.buyin-btn:active { transform: scale(.96); }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--surface-3); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 16px; color: var(--muted);
  transition: .14s; flex: none;
}
.icon-btn:hover { color: var(--text); background: var(--line); }
.icon-btn.danger:hover { color: var(--red); background: rgba(255,90,82,.14); }

.add-row { display: flex; gap: 9px; margin-top: 12px; }
.add-row input { flex: 1; }

/* ------------------------------------------------------------- Abrechnung */

.settle-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.settle-table th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); font-weight: 700; padding: 0 8px 10px; white-space: nowrap;
}
.settle-table td { padding: 11px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.settle-table td.n { text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.settle-table tr.out td { opacity: .5; }
.pos { color: var(--green); font-weight: 700; }
.neg { color: var(--red); font-weight: 700; }
.zero { color: var(--muted); }

.chip-input { width: 108px; text-align: right; padding: 8px 10px; font-family: var(--num); }

/* Auf dem Handy wird aus der Tabelle eine Liste von Karten.
   Als Tabelle passen fuenf Spalten nicht auf 375 Pixel -- sie laufen seitlich
   aus dem Bild, und ausgerechnet "Bekommt" und "Ergebnis" stehen aussen.
   Genau die will man sehen. Seitliches Schieben ist keine Loesung: Was man
   schieben muss, sieht die Haelfte der Runde nie. */
@media (max-width: 700px) {
  .settle-table thead { display: none; }
  .settle-table, .settle-table tbody, .settle-table tr, .settle-table td { display: block; width: 100%; }
  .settle-table tr {
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 12px 14px; margin-bottom: 9px;
  }
  .settle-table td { border-top: none; padding: 5px 0; text-align: left; }
  .settle-table td.n { text-align: left; }

  /* Name oben, abgesetzt wie eine Ueberschrift. */
  .settle-table td.who-cell { padding: 0 0 9px; margin-bottom: 7px; border-bottom: 1px solid var(--line); }

  /* Alle uebrigen Zellen: Beschriftung links, Wert rechts. */
  .settle-table td:not(.who-cell) { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .settle-table td:not(.who-cell)::before {
    content: attr(data-label);
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em;
    color: var(--muted); font-weight: 700; flex: none;
  }
  /* Das Ergebnis ist die Zahl, wegen der alle hinsehen. */
  .settle-table td.net { font-size: 18px; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line); }
  .settle-table .chip-input { width: 120px; }
}

.check {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 15px; border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.5;
  margin-bottom: 14px;
}
.check.ok { background: rgba(53,196,106,.1); border: 1px solid rgba(53,196,106,.3); color: #9fe8b8; }
.check.warn { background: rgba(232,185,63,.1); border: 1px solid rgba(232,185,63,.32); color: #f2d489; }
.check.err { background: rgba(255,90,82,.1); border: 1px solid rgba(255,90,82,.32); color: #ffb3ae; }
.check .ico { font-size: 17px; line-height: 1.2; flex: none; }
.check b { color: #fff; }

/* Auszahlung aus dem Topf. Die Karte, die am Ende des Abends vorgelesen wird
   -- deshalb grosse Betraege und viel Luft, damit man sie quer ueber den
   Tisch mitlesen kann, waehrend jemand das Geld verteilt. */
.payout-card { border-color: var(--gold-dim); background: linear-gradient(170deg, rgba(232,185,63,.055), var(--surface) 55%); }
.payout-list { display: flex; flex-direction: column; }
.payout-row { display: flex; align-items: center; gap: 13px; padding: 13px 2px; border-top: 1px solid var(--line); }
.payout-row:first-child { border-top: none; }
.payout-row.nil { opacity: .45; }
.payout-main { flex: 1; min-width: 0; }
.payout-name { font-weight: 650; font-size: 15.5px; }
.payout-sub { font-size: 12px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.payout-amt {
  font-family: var(--num); font-variant-numeric: tabular-nums;
  font-size: clamp(20px, 5vw, 26px); font-weight: 750; color: var(--gold);
  letter-spacing: -.03em; white-space: nowrap;
}
.payout-row.nil .payout-amt { color: var(--dim); }

.payout-sum {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 2px solid var(--line);
  font-size: 13.5px; color: var(--muted); font-weight: 600;
}
.payout-sum b { font-family: var(--num); font-size: 19px; color: var(--text); font-weight: 750; }
.payout-sum .chk { margin-left: auto; font-size: 12.5px; font-weight: 650; }
.payout-sum.ok .chk { color: var(--green); }
.payout-sum.bad .chk { color: var(--red); }

/* ---------------------------------------------------------------- Verlauf */

.hist-item {
  display: flex; align-items: center; gap: 13px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 15px; margin-bottom: 9px;
  transition: .15s; width: 100%; text-align: left;
}
.hist-item:hover { border-color: var(--gold-dim); transform: translateX(2px); }
.hist-date {
  flex: none; width: 48px; text-align: center;
  background: var(--surface-3); border-radius: var(--radius-sm); padding: 7px 4px;
}
.hist-day { font-size: 18px; font-weight: 750; line-height: 1; font-family: var(--num); }
.hist-mon { font-size: 9.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: .06em; margin-top: 3px; }
.hist-main { flex: 1; min-width: 0; }
.hist-name { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.hist-win { flex: none; text-align: right; }
.hist-win-name { font-size: 13px; font-weight: 650; }
.hist-win-amt { font-family: var(--num); font-size: 13px; color: var(--green); font-weight: 700; }

/* --------------------------------------------------------- Spielerprofil */

.profil-eigen { border-color: var(--gold-dim); background: linear-gradient(170deg, rgba(232,185,63,.05), var(--surface) 55%); }
.profil-eigen .card-title { align-items: center; }

.linkbtn { color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.linkbtn:hover { color: var(--text); }

.profil-bilanz {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px 8px; margin-bottom: 12px;
  position: relative; overflow: hidden;
}
.profil-bilanz-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.profil-bilanz-wert {
  font-size: clamp(30px, 8vw, 42px); font-weight: 750; letter-spacing: -.035em;
  line-height: 1.1; margin-top: 5px;
}
.profil-bilanz.pos .profil-bilanz-wert { color: var(--green); }
.profil-bilanz.neg .profil-bilanz-wert { color: var(--red); }

/* Die Kurve fuellt die Breite und wird in der Hoehe gestaucht -- sie soll die
   Richtung zeigen, nicht zum Ablesen einladen. Die genauen Zahlen stehen
   darunter. */
.spark { display: block; width: 100%; height: 68px; margin-top: 8px; }

.profil-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
@media (min-width: 560px) { .profil-grid { grid-template-columns: repeat(3, 1fr); } }
.profil-kachel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 13px; }
.profil-k-label { font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
.profil-k-wert { font-size: 20px; font-weight: 750; letter-spacing: -.02em; margin-top: 6px; line-height: 1; }
.profil-k-wert.pos { color: var(--green); }
.profil-k-wert.neg { color: var(--red); }
.profil-k-sub { font-size: 11px; color: var(--dim); margin-top: 5px; }

.profil-abende { display: flex; flex-direction: column; }
.profil-abend { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--line); }
.profil-abend:first-child { border-top: none; }
.profil-abend-datum { flex: none; width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.profil-abend-main { flex: 1; min-width: 0; }
.profil-abend-name { font-weight: 650; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.profil-abend-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.profil-abend-net { font-weight: 750; font-size: 15px; white-space: nowrap; }

.ich-wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.ich-wahl .btn { width: auto; gap: 8px; padding: 8px 14px; }

/* Die Zeilen der ewigen Tabelle sind jetzt Schaltflaechen. Ohne Ruecksetzen
   der Knopf-Voreinstellungen waeren sie zentriert und in Systemschrift. */
.rank {
  display: flex; align-items: center; gap: 12px; padding: 12px 6px;
  border-top: 1px solid var(--line); width: 100%; text-align: left;
  color: var(--text); font-family: inherit; transition: .13s;
}
button.rank:hover { background: var(--surface-2); }
.rank:first-of-type { border-top: none; }
.rank-pos {
  width: 27px; height: 27px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 750;
  background: var(--surface-3); color: var(--muted); font-family: var(--num);
}
.rank-pos.g1 { background: linear-gradient(145deg, #f5cf5c, #c79a1e); color: #241a02; }
.rank-pos.g2 { background: linear-gradient(145deg, #d8dee6, #9aa5b1); color: #1a1f24; }
.rank-pos.g3 { background: linear-gradient(145deg, #cf9463, #a06a3c); color: #241505; }
.rank-main { flex: 1; min-width: 0; }
.rank-name { font-weight: 650; font-size: 14.5px; }
.rank-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.rank-net { font-family: var(--num); font-weight: 750; font-size: 15px; white-space: nowrap; }

/* ------------------------------------------------------------------ Tipps */

.tip-nav { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 4px; scrollbar-width: none; }
.tip-nav::-webkit-scrollbar { display: none; }
.tip-nav button {
  flex: none; padding: 8px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13px; font-weight: 650; color: var(--muted); white-space: nowrap;
}
.tip-nav button.on { background: var(--gold); border-color: var(--gold); color: #241a02; }

.hand-rank { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--line); }
.hand-rank:first-child { border-top: none; }
.hand-num {
  width: 25px; height: 25px; border-radius: 6px; flex: none; display: grid; place-items: center;
  background: var(--surface-3); font-size: 12px; font-weight: 750; color: var(--gold); font-family: var(--num);
}
.hand-info { flex: 1; min-width: 0; }
.hand-name { font-weight: 650; font-size: 14.5px; }
.hand-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hand-cards { display: flex; gap: 3px; flex: none; }
.pcard {
  width: 25px; height: 34px; border-radius: 4px; background: #f2f5f8; color: #16202a;
  display: grid; place-items: center; font-size: 13px; font-weight: 750; line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.pcard.r { color: #d5322b; }
@media (max-width: 460px) { .hand-cards { display: none; } }

/* Startblatt-Tafel. 13x13, die uebliche Anordnung: oben rechts gleichfarbig,
   unten links verschiedenfarbig, Diagonale die Paare. */
.chart-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.chart { border-collapse: separate; border-spacing: 2px; margin: 0 auto; }
.chart td {
  width: 32px; height: 29px; text-align: center; font-size: 11px; font-weight: 700;
  border-radius: 3px; font-family: var(--num); color: #0a0d10; letter-spacing: -.03em;
}
@media (min-width: 760px) { .chart td { width: 42px; height: 36px; font-size: 12.5px; } }
.c-prem { background: #e8b93f; }
.c-strong { background: #35c46a; }
.c-good { background: #4ea1ff; }
.c-ok { background: #7b8896; }
/* Wegzuwerfende Blaetter sollen zuruecktreten, aber lesbar bleiben -- sonst
   sieht man nicht, ob eine Hand bewertet wurde oder die Tafel eine Luecke hat. */
.c-fold { background: #1d252e; color: #66747f; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
/* Rand, damit auch das dunkelste Feld der Legende auf dunklem Grund sichtbar ist. */
.chart-legend i { width: 12px; height: 12px; border-radius: 3px; display: block; border: 1px solid var(--line); }

.tip { padding: 13px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.62; color: #cfd9e3; }
.tip:first-child { border-top: none; }
.tip b { color: var(--gold); font-weight: 700; }
.tip .lead { display: block; font-weight: 700; color: var(--text); margin-bottom: 4px; font-size: 14.5px; }

.odds-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.odds-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 0 8px 9px; }
.odds-table td { padding: 9px 8px; border-top: 1px solid var(--line); }
.odds-table td.n { text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- Navigation */

nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; background: rgba(18,24,32,.93);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 8px; font-size: 10px; font-weight: 650; color: var(--dim);
  transition: .14s; position: relative;
}
nav button .ico { font-size: 19px; line-height: 1; }
nav button.on { color: var(--gold); }
nav button.on::before {
  content: ''; position: absolute; top: 0; left: 26%; right: 26%; height: 2px;
  background: var(--gold); border-radius: 0 0 3px 3px;
}
@media (min-width: 900px) {
  nav {
    position: sticky; top: 57px; bottom: auto;
    /* Volle Breite, Inhalt zentriert. Mit `margin: 0 auto` schrumpft ein
       Flex-Element auf seine Inhaltsbreite -- der Balken deckte dann nur die
       Mitte ab und der Seiteninhalt scrollte links und rechts daneben
       sichtbar durch. */
    width: 100%; justify-content: center;
    border-top: none; border-bottom: 1px solid var(--line);
  }
  nav button { flex: 0 1 auto; min-width: 132px; flex-direction: row; gap: 8px; font-size: 13.5px; padding: 13px 18px; }
  nav button .ico { font-size: 16px; }
  nav button.on::before { top: auto; bottom: 0; left: 18%; right: 18%; border-radius: 3px 3px 0 0; }
}

/* ----------------------------------------------------------- Ueberlagerung */

.modal-bg {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4,7,10,.78); backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center; padding: 18px;
}
.modal-bg.on { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; width: 100%; max-width: 440px; box-shadow: var(--shadow);
  max-height: 88dvh; overflow-y: auto;
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal h3 { font-size: 18px; margin-bottom: 5px; letter-spacing: -.02em; }
.modal p.sub { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; line-height: 1.5; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--dim); margin-top: 5px; line-height: 1.45; }
.modal-actions { display: flex; gap: 9px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
.err-msg { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 17px; font-weight: 600; }

/* Kurze Rueckmeldung oben. Ein Einkauf muss sichtbar quittiert werden --
   sonst drueckt am Tisch jemand zweimal, weil er nicht sicher ist. */
.toast-wrap {
  position: fixed; top: calc(env(safe-area-inset-top) + 66px); left: 0; right: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px;
}
.toast {
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 18px; font-size: 13.5px; font-weight: 650;
  box-shadow: var(--shadow); animation: toastIn .22s ease, toastOut .3s ease 2.5s forwards;
  max-width: 100%;
}
.toast.with-action { display: flex; align-items: center; gap: 14px; padding-right: 6px; }
.toast-action {
  background: var(--gold); color: #241a02; border-radius: 999px;
  padding: 7px 15px; font-size: 12.5px; font-weight: 750; white-space: nowrap;
}
.toast-action:hover { filter: brightness(1.1); }
.toast.ok { border-color: rgba(53,196,106,.5); color: #9fe8b8; }
.toast.err { border-color: rgba(255,90,82,.5); color: #ffb3ae; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty .ico { font-size: 40px; margin-bottom: 12px; opacity: .55; }
.empty p { font-size: 14px; line-height: 1.6; max-width: 330px; margin: 0 auto; }
.empty .t { font-weight: 700; color: var(--text); font-size: 16px; margin-bottom: 6px; }

/* --------------------------------------------- Spielerkacheln im Vollbild */

/* Ausserhalb des Vollbilds gibt es dafuer die Ansicht "Spieler" -- hier
   waeren die Kacheln nur eine zweite, schlechtere Kopie davon. */
.tv-players { display: none; }

body.tv .tv-players { display: block; padding: 0 3vw 2.5vh; }
.tv-players-hint {
  text-align: center; font-size: min(1.7vh, 1.3vw); color: var(--dim);
  text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin-bottom: 1.4vh;
}
.tv-player-grid {
  display: grid; gap: min(1.2vh, .9vw);
  /* Passt sich der Rundengroesse an: vier Leute bekommen breite Kacheln,
     zehn schmale, ohne dass jemand aus dem Bild faellt. */
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 24%), 1fr));
}
.tv-player {
  display: flex; align-items: center; gap: min(1.4vh, 1vw);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 14px; padding: min(1.5vh, 1.1vw) min(1.8vh, 1.3vw);
  text-align: left; position: relative; overflow: hidden;
  transition: .13s; width: 100%; color: var(--text);
}
button.tv-player:hover { background: var(--surface-3); border-color: var(--green); transform: translateY(-2px); }
button.tv-player:active { transform: scale(.97); background: var(--green-dark); }
.tv-player.out { opacity: .4; }
.tv-player.out .tv-player-name { text-decoration: line-through; text-decoration-color: var(--red); }
.tv-player .avatar { width: min(4.4vh, 3.2vw); height: min(4.4vh, 3.2vw); font-size: min(1.9vh, 1.4vw); }
.tv-player-main { flex: 1; min-width: 0; }
.tv-player-name {
  font-weight: 700; font-size: min(2.3vh, 1.7vw); letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tv-player-sub {
  font-size: min(1.7vh, 1.25vw); color: var(--muted); margin-top: .3vh;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tv-player-plus {
  font-size: min(3vh, 2.2vw); font-weight: 300; color: var(--green);
  line-height: 1; flex: none; opacity: .55;
}
button.tv-player:hover .tv-player-plus { opacity: 1; }
.tv-player-count {
  position: absolute; top: 0; right: 0;
  background: var(--blue); color: #05101d;
  font-size: min(1.4vh, 1vw); font-weight: 750;
  padding: .25vh .8vh; border-bottom-left-radius: 8px;
}

/* --------------------------------------------------------- Vollbild-Modus */

/* Fuer den Rechner am Tischende: nur Uhr, Blinds und Kennzahlen, sonst
   nichts. Aus drei Metern muss die Uhr die groesste Sache im Raum sein. */
body.tv header, body.tv nav, body.tv .no-tv { display: none !important; }
body.tv main { padding: 0; max-width: none; height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
body.tv .clock-card { border: none; border-radius: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 3vh 4vw; }
body.tv .clock { font-size: min(30vh, 25vw); }
body.tv .blind-value { font-size: min(11vh, 9vw); }
body.tv .blind-block.next .blind-value { font-size: min(5.5vh, 4.5vw); }
body.tv .stats { grid-template-columns: repeat(4, 1fr); padding: 0 4vw 3vh; margin-top: 0; }
body.tv .stat-value { font-size: min(4.6vh, 3.4vw); }
body.tv .card { display: none; }
body.tv .stats { display: grid; }
/* Im Vollbild darf die Uhr nicht mehr den ganzen Platz nehmen -- die Kacheln
   brauchen ihren Anteil, sonst schiebt die Uhr sie aus dem Bild. */
body.tv .clock-card { flex: 0 1 auto; }
body.tv main { justify-content: flex-start; padding-top: 2vh; }
.tv-exit {
  display: none; position: fixed; top: 14px; right: 14px; z-index: 60;
  background: rgba(26,34,44,.75); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 15px; font-size: 13px; color: var(--muted);
  opacity: .18; transition: opacity .2s;
}
body.tv .tv-exit { display: block; }
.tv-exit:hover { opacity: 1; }

.mono-hint { font-size: 12px; color: var(--dim); line-height: 1.55; }
.log-line { font-size: 12.5px; color: var(--muted); padding: 6px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.log-line:first-child { border-top: none; }
.log-time { font-family: var(--num); color: var(--dim); flex: none; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 900px) { .split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; align-items: start; } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
