/* PokerAnalyser – Oberfläche. Keine externen Schriften, kein Build-Schritt.
   Farben als CSS-Variablen; dunkles Schema über prefers-color-scheme. */

:root {
  --bg: #f4f6f4;
  --surface: #ffffff;
  --surface-2: #eef2ef;
  --surface-3: #e2e8e4;
  --text: #1b2420;
  --muted: #5a6761;
  --border: #d3dbd6;
  --accent: #1d6b47;
  --accent-hover: #175a3b;
  --accent-text: #ffffff;
  --accent-soft: #dcefe4;
  --focus: #2563eb;
  --link: #17603f;

  --good: #1d7a3e;
  --good-bg: #e2f4e7;
  --warn: #8a5a00;
  --warn-bg: #fff3d6;
  --warn-border: #e8b84a;
  --bad: #b3261e;
  --bad-bg: #fde7e5;
  --info: #1f5aa6;
  --info-bg: #e3edfb;

  --felt: #1f6b45;
  --felt-dark: #15502f;
  --rail: #5b3a21;
  --rail-light: #7a5032;
  --seat-bg: rgba(20, 28, 25, 0.92);
  --seat-text: #f2f5f3;
  --seat-muted: #b9c6bf;
  --card-face: #fdfdf8;
  --card-border: rgba(0, 0, 0, 0.28);
  --suit-s: #1a1a1a;
  --suit-h: #c62828;
  --suit-d: #1f5bd1;
  --suit-c: #1b7a3a;
  --chip: #e4b838;
  --bar: #2f7d57;
  --bar-bg: #e3e9e5;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111614;
    --surface: #181f1c;
    --surface-2: #1f2824;
    --surface-3: #29342f;
    --text: #e4ebe7;
    --muted: #9eaca5;
    --border: #33413a;
    --accent: #3fae78;
    --accent-hover: #55c08b;
    --accent-text: #0b1510;
    --accent-soft: #1d3a2c;
    --focus: #7aa7ff;
    --link: #6fd3a0;

    --good: #5bd08a;
    --good-bg: #173726;
    --warn: #f0c35a;
    --warn-bg: #3a2f14;
    --warn-border: #a17b22;
    --bad: #ff8a80;
    --bad-bg: #3d1c1a;
    --info: #8db7ff;
    --info-bg: #1a2a42;

    --felt: #17563a;
    --felt-dark: #0f3d28;
    --rail: #3f2817;
    --rail-light: #5a3a22;
    --seat-bg: rgba(10, 14, 12, 0.92);
    --card-face: #f3f3ec;
    --bar: #4cbf86;
    --bar-bg: #26322c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------ Grundlagen */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  min-width: 320px;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }
code, pre { font-family: var(--mono); font-size: 0.9em; }
img { max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute; left: 8px; top: -60px;
  background: var(--surface); color: var(--text);
  padding: 8px 12px; border-radius: 6px; z-index: 100;
}
.skip-link:focus { top: 8px; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Kopf und Navigation */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 8px 16px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05rem;
}
.main-nav { flex: 1 1 auto; }
.main-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
}
.main-nav li:last-child { margin-left: auto; }
.main-nav a, .nav-button {
  display: inline-block; padding: 6px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font: inherit; font-size: 0.95rem;
  background: none; border: 0; cursor: pointer;
}
.main-nav a:hover, .nav-button:hover { background: var(--surface-2); }
.main-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--link); font-weight: 600; }
.logout-form { margin: 0; }

@media (max-width: 700px) {
  .header-inner { gap: 4px 8px; padding: 6px 12px; }
  .site-header { position: static; }
  .main-nav { width: 100%; }
  .main-nav ul { gap: 2px; }
  .main-nav a, .nav-button { padding: 6px 8px; white-space: nowrap; font-size: 0.9rem; }
}

/* ------------------------------------------------------------------ Seitenrahmen */
.container { max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.crumb { margin: 0 0 4px; font-size: 0.9rem; }
.head-actions { display: flex; gap: 8px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  min-width: 0;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }

/* ------------------------------------------------------------------ Knöpfe und Formulare */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 40px; padding: 6px 14px;
  font: inherit; font-size: 0.95rem; font-weight: 500;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--surface-3); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-danger { color: var(--bad); border-color: currentColor; background: transparent; }
.btn-danger:hover:not(:disabled) { background: var(--bad-bg); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--link); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-sm { min-height: 32px; padding: 3px 10px; font-size: 0.875rem; }
.file-btn { position: relative; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

input[type="text"], input[type="password"], input[type="search"], input[type="date"], input[type="number"],
select, textarea {
  font: inherit; font-size: 0.95rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; min-height: 40px; width: 100%;
  min-width: 0;
}
textarea { min-height: 80px; resize: vertical; font-family: var(--mono); }
input:disabled, select:disabled { opacity: 0.55; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
label { font-size: 0.9rem; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); }
label.block { display: block; margin-top: 12px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 0.95rem; }
.field-error { display: block; color: var(--bad); font-size: 0.8rem; margin-top: 2px; }

.form-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  margin-bottom: 12px;
}
.form-grid > label { display: flex; flex-direction: column; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.stack-form { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.stack-form > .btn { align-self: flex-start; margin-top: 8px; }
.stack-form > label.check { margin: 6px 0; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.inline-form > label { width: 100%; }
.inline-form > input { flex: 1 1 180px; width: auto; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.sub { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 16px; }
legend { font-weight: 600; padding: 0; margin-bottom: 8px; }

.segmented {
  display: inline-flex; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  background: var(--surface-2);
}
.segmented label {
  position: relative; display: inline-flex; align-items: center;
  padding: 6px 12px; cursor: pointer; color: var(--text); font-size: 0.9rem;
  border-right: 1px solid var(--border);
}
.segmented label:last-child { border-right: 0; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label:has(input:checked) { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: -3px; }

/* ------------------------------------------------------------------ Meldungen, Tags */
.msg { padding: 10px 12px; border-radius: 8px; border: 1px solid transparent; margin: 0 0 12px; }
.msg ul { margin: 0; padding-left: 1.2em; }
.msg p:last-child { margin-bottom: 0; }
.msg .btn { margin-top: 8px; }
.msg-error { background: var(--bad-bg); color: var(--bad); border-color: currentColor; }
.msg-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.msg-ok { background: var(--good-bg); color: var(--good); }
.msg-info { background: var(--info-bg); color: var(--info); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-info ul { flex-basis: 100%; }

.banner { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 2px solid; }
.banner-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); font-size: 1rem; }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.tag-sm { font-size: 0.72rem; padding: 0 6px; margin-left: 6px; vertical-align: middle; }
.tag-ok { background: var(--good-bg); color: var(--good); border-color: transparent; }
.tag-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.tag-bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.tag-info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.tag-muted { background: var(--surface-2); color: var(--muted); }
.tag-played { background: var(--surface-3); color: var(--text); }
.badge { background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 0 8px; font-size: 0.75rem; margin-left: 6px; }

.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 8px 0; }
.spinner {
  display: inline-block; width: 16px; height: 16px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ------------------------------------------------------------------ Tabellen */
.table-scroll { overflow-x: auto; max-width: 100%; }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.92rem; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.data th { font-weight: 600; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
table.data th.num, table.data td.num { text-align: right; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.empty { text-align: center; color: var(--muted); padding: 24px; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data.compact td, table.data.compact th { padding: 6px 8px; }
table.data.compact input { min-height: 34px; padding: 4px 8px; }
table.data tr.is-off { color: var(--muted); }
table.data tr.is-selected { background: var(--accent-soft); }
tr.clickable { cursor: pointer; }
tr.row-incomplete td:first-child { box-shadow: inset 4px 0 0 var(--warn-border); }
button.sort {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600;
}
th[aria-sort="descending"] button.sort::after { content: " ▼"; }
th[aria-sort="ascending"] button.sort::after { content: " ▲"; }

.hands-table { border: 1px solid var(--border); border-radius: var(--radius); }

/* Schmale Bildschirme: Tabellenzeilen als Karten */
@media (max-width: 760px) {
  .hands-table thead, #t-table thead, #tok-table thead, #stats-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hands-table, .hands-table tbody, .hands-table tr, .hands-table td,
  #t-table, #t-table tbody, #t-table tr, #t-table td,
  #tok-table, #tok-table tbody, #tok-table tr, #tok-table td,
  #stats-table, #stats-table tbody, #stats-table tr, #stats-table td, #stats-table th { display: block; width: 100%; }
  .hands-table tr, #t-table tr, #tok-table tr, #stats-table tr {
    border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 10px;
    background: var(--surface);
  }
  .hands-table { border: 0; background: transparent; }
  .hands-table td, #t-table td, #tok-table td, #stats-table td, #stats-table th {
    border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right;
  }
  .hands-table td::before, #t-table td[data-label]::before, #tok-table td[data-label]::before,
  #stats-table td::before {
    content: attr(data-label); color: var(--muted); font-size: 0.85rem; text-align: left;
  }
  .hands-table td:first-child { font-weight: 600; }
  tr.row-incomplete td:first-child { box-shadow: none; }
  tr.row-incomplete { border-left: 4px solid var(--warn-border) !important; }
  table.data td.actions { justify-content: flex-end; }
  #stats-table th { color: var(--text); font-size: 1rem; }
  /* Handliste: zweispaltige Karten */
  .hands-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; padding: 8px 12px; }
  .hands-table td { flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 0; text-align: left; }
  .hands-table td::before { font-size: 0.75rem; }
  .hands-table td:first-child { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; font-size: 1rem; }
  .hands-table td:first-child::before { display: none; }
  .hands-table td.num { text-align: left; }
  .hands-table td.empty, .hands-table td[colspan] { grid-column: 1 / -1; }
}

.pager { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; margin: 16px 0; }
.page-link {
  min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none;
}
.page-link.is-current { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.page-link.is-disabled { opacity: 0.45; }
.page-gap { align-self: center; padding: 0 4px; color: var(--muted); }

/* ------------------------------------------------------------------ Filter */
.filters > summary {
  cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center;
}
.filters > summary::-webkit-details-marker { display: none; }
.filters > summary::before { content: "▸"; margin-right: 8px; transition: transform 0.15s; }
.filters[open] > summary::before { transform: rotate(90deg); }
.filter-grid {
  display: grid; gap: 12px; margin-top: 12px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.filter-grid > label { display: flex; flex-direction: column; }
.filter-grid .span-2 { grid-column: span 2; }
.filter-grid .span-all { grid-column: 1 / -1; margin-top: 0; }
.filter-grid .range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.filter-grid .range legend { grid-column: 1 / -1; font-weight: 400; font-size: 0.9rem; color: var(--muted); margin-bottom: 0; }
@media (max-width: 420px) { .filter-grid .span-2 { grid-column: 1 / -1; } }

/* ------------------------------------------------------------------ Karten */
.cards { display: inline-flex; gap: 3px; vertical-align: middle; }
.card {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--card-face); border: 1px solid var(--card-border); border-radius: 5px;
  font-weight: 700; line-height: 1; color: var(--suit-s);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  user-select: none; flex: none;
}
.card .card-suit { font-size: 0.95em; }
.card-xs { width: 22px; height: 28px; font-size: 11px; border-radius: 3px; flex-direction: row; gap: 0; letter-spacing: -0.5px; }
.card-xs .card-suit { font-size: 10px; }
.card-sm { width: clamp(22px, 3.9cqw, 36px); height: clamp(30px, 5.4cqw, 50px); font-size: clamp(11px, 1.9cqw, 17px); border-radius: 4px; }
.card-md { width: clamp(28px, 5.4cqw, 50px); height: clamp(40px, 7.6cqw, 70px); font-size: clamp(13px, 2.5cqw, 22px); }
.card-lg { width: 56px; height: 78px; font-size: 24px; }
.cards-preview .card-md { width: 44px; height: 62px; font-size: 20px; }
.suit-s { color: var(--suit-s); }
.suit-h { color: var(--suit-h); }
.suit-d { color: var(--suit-d); }
.suit-c { color: var(--suit-c); }
.card-back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.18) 0 3px, transparent 3px 6px),
    #7a2533;
  border-color: rgba(255, 255, 255, 0.65);
}
.card-slot { background: rgba(255, 255, 255, 0.06); border: 1px dashed rgba(255, 255, 255, 0.35); box-shadow: none; }

.card-picker { display: grid; gap: 4px; margin-top: 8px; }
.card-picker-row { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 3px; }
.pick {
  font: inherit; font-weight: 700; font-size: 0.85rem;
  background: var(--card-face); border: 1px solid var(--card-border); border-radius: 5px;
  min-height: 38px; padding: 0; cursor: pointer; line-height: 1;
}
.pick:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
.pick.is-on { outline: 3px solid var(--accent); outline-offset: -1px; background: #fff6c8; }
.pick.is-full { opacity: 0.75; }
.pick:disabled { opacity: 0.25; cursor: not-allowed; text-decoration: line-through; }
@media (max-width: 480px) {
  .pick { font-size: 0.72rem; min-height: 34px; letter-spacing: -0.5px; }
  .card-picker-row { gap: 2px; }
}

/* ------------------------------------------------------------------ Pokertisch */
.table-wrap { container-type: inline-size; width: 100%; }
.poker-table {
  --rx: 44%; --ry: 40%;
  position: relative; width: 100%; max-width: 920px; margin: 0 auto;
  aspect-ratio: 16 / 9.5;
  font-size: clamp(10px, 1.55cqw, 14px);
}
.felt {
  position: absolute; inset: 13% 10%;
  border-radius: 999px;
  background: radial-gradient(ellipse at 50% 45%, var(--felt) 0%, var(--felt) 55%, var(--felt-dark) 100%);
  border: clamp(6px, 1.5cqw, 14px) solid var(--rail);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), inset 0 0 30px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.3);
  outline: 2px solid var(--rail-light); outline-offset: -1px;
}
.table-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6em;
}
.board { display: flex; gap: clamp(3px, 0.7cqw, 6px); }
.pot {
  color: #f6f7f2; background: rgba(0, 0, 0, 0.35); padding: 2px 12px; border-radius: 999px;
  font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}

.seat, .bet, .dealer { position: absolute; transform: translate(-50%, -50%); }
.seat {
  left: calc(50% + var(--cx) * var(--rx));
  top: calc(50% + var(--cy) * var(--ry));
  width: clamp(78px, 16cqw, 140px);
  display: flex; flex-direction: column; align-items: center;
  z-index: 2;
}
.seat-cards { min-height: clamp(30px, 5.4cqw, 50px); display: flex; align-items: flex-end; margin-bottom: -0.5em; z-index: 1; }
.seat-box {
  position: relative; width: 100%;
  background: var(--seat-bg); color: var(--seat-text);
  border: 2px solid rgba(255, 255, 255, 0.14); border-radius: 10px;
  padding: 0.45em 0.5em 0.35em; text-align: center; line-height: 1.25;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.seat-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-meta { display: flex; justify-content: center; align-items: center; gap: 0.4em; font-variant-numeric: tabular-nums; }
.seat-meta .stack { font-weight: 600; }
.seat-chips {
  color: var(--seat-muted); font-size: 0.85em; font-variant-numeric: tabular-nums; min-height: 1.2em;
  display: flex; justify-content: center; align-items: center; gap: 0.35em; flex-wrap: wrap;
}
.pos {
  background: rgba(255, 255, 255, 0.16); border-radius: 4px; padding: 0 0.35em;
  font-size: 0.82em; font-weight: 700; letter-spacing: 0.02em;
}
.bounty {
  background: #f2c94c; color: #3b2a00; font-weight: 700; font-size: 0.92em; line-height: 1.25;
  border-radius: 999px; padding: 0 0.45em; white-space: nowrap;
}
.seat.is-hero .seat-box { border-color: #7fd6a6; }
.seat.is-active .seat-box {
  border-color: #ffd54a;
  box-shadow: 0 0 0 3px rgba(255, 213, 74, 0.45), 0 0 16px rgba(255, 213, 74, 0.55);
}
.seat.is-folded .seat-box, .seat.is-folded .seat-cards { opacity: 0.4; }
.seat.is-folded .seat-name { text-decoration: line-through; }
.seat.is-allin .stack { color: #ffb4a8; }
.seat.is-empty .seat-box {
  background: rgba(0, 0, 0, 0.12); border: 2px dashed rgba(127, 127, 127, 0.55); color: var(--muted);
  box-shadow: none;
}
.seat.is-empty .seat-cards { visibility: hidden; }
.seat-action {
  margin-top: 0.3em; background: #fff; color: #1b1b1b; font-weight: 700; font-size: 0.85em;
  border-radius: 999px; padding: 0.05em 0.6em; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.seat-action.act-fold { background: #d9d9d9; color: #444; }
.seat-action.act-raise, .seat-action.act-bet { background: #ffe08a; }
.bet {
  left: calc(50% + var(--cx) * var(--rx) * 0.58);
  top: calc(50% + var(--cy) * var(--ry) * 0.52);
  display: inline-flex; align-items: center; gap: 0.3em;
  color: #fff; font-weight: 700; font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.4); border-radius: 999px; padding: 0.05em 0.55em 0.05em 0.2em;
  z-index: 1; white-space: nowrap;
}
.chip {
  width: 1.1em; height: 1.1em; border-radius: 50%;
  background: var(--chip); border: 0.18em dashed #fff; display: inline-block;
}
.dealer {
  left: calc(50% + var(--cx) * var(--rx) * 0.74 - var(--cy) * 5cqw);
  top: calc(50% + var(--cy) * var(--ry) * 0.7 + var(--cx) * 4cqw);
  width: 1.9em; height: 1.9em; border-radius: 50%;
  background: #fff; color: #111; border: 2px solid #bbb;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); z-index: 1;
}

/* Platzpositionen: Einheitsvektor auf der Ellipse, Platz 0 = unten (Nutzer) */
.t2 .slot-0 { --cx: 0; --cy: 1; }
.t2 .slot-1 { --cx: 0; --cy: -1; }
.t6 .slot-0 { --cx: 0; --cy: 1; }
.t6 .slot-1 { --cx: -0.866; --cy: 0.5; }
.t6 .slot-2 { --cx: -0.866; --cy: -0.5; }
.t6 .slot-3 { --cx: 0; --cy: -1; }
.t6 .slot-4 { --cx: 0.866; --cy: -0.5; }
.t6 .slot-5 { --cx: 0.866; --cy: 0.5; }
.t8 .slot-0 { --cx: 0; --cy: 1; }
.t8 .slot-1 { --cx: -0.707; --cy: 0.707; }
.t8 .slot-2 { --cx: -1; --cy: 0; }
.t8 .slot-3 { --cx: -0.707; --cy: -0.707; }
.t8 .slot-4 { --cx: 0; --cy: -1; }
.t8 .slot-5 { --cx: 0.707; --cy: -0.707; }
.t8 .slot-6 { --cx: 1; --cy: 0; }
.t8 .slot-7 { --cx: 0.707; --cy: 0.707; }
.t9 .slot-0 { --cx: 0; --cy: 1; }
.t9 .slot-1 { --cx: -0.643; --cy: 0.766; }
.t9 .slot-2 { --cx: -0.985; --cy: 0.174; }
.t9 .slot-3 { --cx: -0.866; --cy: -0.5; }
.t9 .slot-4 { --cx: -0.342; --cy: -0.94; }
.t9 .slot-5 { --cx: 0.342; --cy: -0.94; }
.t9 .slot-6 { --cx: 0.866; --cy: -0.5; }
.t9 .slot-7 { --cx: 0.985; --cy: 0.174; }
.t9 .slot-8 { --cx: 0.643; --cy: 0.766; }

/* Schmal: Tisch hochkant */
@container (max-width: 600px) {
  .poker-table { aspect-ratio: 3 / 4; --rx: 37%; --ry: 41%; font-size: 10.5px; }
  .felt { inset: 11% 17%; }
  .seat { width: 25cqw; max-width: 104px; }
  .dealer { left: calc(50% + var(--cx) * var(--rx) * 0.62 - var(--cy) * 7cqw); top: calc(50% + var(--cy) * var(--ry) * 0.66 + var(--cx) * 7cqw); }
  .bet { left: calc(50% + var(--cx) * var(--rx) * 0.5); top: calc(50% + var(--cy) * var(--ry) * 0.56); }
  .board .card-md { width: 9cqw; height: 12.6cqw; font-size: 4.2cqw; }
  .seat-cards .card-sm { width: 7.4cqw; height: 10.4cqw; font-size: 3.6cqw; }
  .seat-cards { min-height: 10.4cqw; }
}

/* ------------------------------------------------------------------ Hand-Seite */
.hand-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1040px) {
  .hand-layout { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
}
.hand-main { min-width: 0; }
.replay-controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.progress-row { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 10px; font-variant-numeric: tabular-nums; }
.progress-row progress { width: min(320px, 50%); height: 8px; accent-color: var(--accent); }
.kbd-hint { text-align: center; margin-top: 6px; }
@media (max-width: 520px) {
  .replay-controls .btn-text { display: none; }
  .replay-controls .btn { min-width: 48px; }
  .replay-controls #btn-decision { flex-basis: 100%; }
  .kbd-hint { display: none; }
}

.action-log {
  list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto;
  font-size: 0.9rem; border-top: 1px solid var(--border);
}
.action-log li { border-bottom: 1px solid var(--border); }
.log-street {
  font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); padding: 8px 6px 4px; background: var(--surface-2);
}
.log-step { display: flex; align-items: center; gap: 4px; padding: 0 4px 0 0; }
.log-step > span { padding: 5px 6px; }
.log-jump {
  flex: 1; text-align: left; font: inherit; color: inherit; background: none; border: 0;
  padding: 5px 6px; cursor: pointer; border-radius: 4px;
}
.log-jump:hover { background: var(--surface-2); }
.log-step.is-current { background: var(--accent-soft); font-weight: 600; }
.log-step.is-truncated { color: var(--warn); font-style: italic; }

.rec-best {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px;
}
.rec-best-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.rec-best-action { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.rec-context { margin-bottom: 6px; }
.freq-list { list-style: none; margin: 0 0 10px; padding: 0; }
.freq-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(50px, 90px) 46px; gap: 8px; align-items: center;
  padding: 5px 4px; border-radius: 6px; font-size: 0.92rem;
}
.freq-list.with-ev li { grid-template-columns: minmax(0, 1fr) minmax(40px, 70px) 42px 92px; }
.freq-head { display: flex; gap: 8px; padding: 0 4px 2px; }
.freq-head > span:first-child { flex: 1; }
.freq-list li.is-best { background: var(--surface-2); font-weight: 600; }
.freq-list li.is-played { box-shadow: inset 3px 0 0 var(--info); }
.freq-label { overflow-wrap: anywhere; }
.freq-val { text-align: right; font-variant-numeric: tabular-nums; }
.freq-ev { text-align: right; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; line-height: 1.2; }
.ev-diff { font-size: 0.78rem; color: var(--muted); font-weight: 400; }
.bar { width: 100%; height: 10px; display: block; }
.bar-bg { fill: var(--bar-bg); }
.bar-fill { fill: var(--bar); }

.played { border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid; }
.played-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.loss-tag { margin-left: auto; font-weight: 700; font-size: 0.85rem; }
.loss-good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.loss-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.loss-bad { background: var(--bad-bg); color: var(--bad); border-color: currentColor; }
.loss-none { background: var(--surface-2); }
.played .muted { color: inherit; opacity: 0.8; }
.played.abort { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.rec-note { font-size: 0.9rem; border-left: 3px solid var(--border); padding-left: 8px; }
.quality { font-size: 0.8rem; color: var(--muted); margin: 0; }
.quality.is-refining { color: var(--info); }
.rec-prev { margin-bottom: 12px; padding-bottom: 4px; border-bottom: 1px dashed var(--border); }
.utility { margin: 8px 0 0; }
.notes { margin: 2px 0 8px; padding-left: 1.2em; }

.raw pre {
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 400px; overflow-y: auto;
  background: var(--surface-2); padding: 12px; border-radius: 8px; margin: 12px 0 0;
}
.raw > summary { cursor: pointer; font-weight: 600; }

/* ------------------------------------------------------------------ Spot-Seite */
.spot-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
  .spot-layout { grid-template-columns: minmax(0, 520px) minmax(0, 1fr); align-items: start; }
  .spot-play { position: sticky; top: 72px; }
}
.seats-table td input[type="text"] { min-width: 72px; }
.seats-table th, .seats-table td { padding: 6px 6px; }
@media (max-width: 520px) {
  .seats-table td input[type="text"] { min-width: 0; width: 100%; padding: 4px 6px; min-height: 34px; }
  .seats-table th, .seats-table td { padding: 4px 3px; }
  .seats-table { table-layout: fixed; }
  .seats-table th:nth-child(1), .seats-table th:nth-child(2), .seats-table th:nth-child(5), .seats-table th:nth-child(6) { width: 13%; }
}
.seats-table th[scope="row"] { color: var(--text); }
.hero-cards-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.cards-preview { min-height: 62px; display: flex; align-items: center; }
.next-box { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 12px; }
.next-box.is-hero { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.legal { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.sizing { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 10px; }
.sizing-label { color: var(--text); font-weight: 600; }
.sizing-row { display: flex; gap: 8px; }
.sizing-row input { flex: 1 1 auto; width: auto; min-width: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.act-fold { color: var(--muted); }

/* ------------------------------------------------------------------ Turniere, Auswertung, Einstellungen */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; }
.toolbar-fields { display: flex; flex-wrap: wrap; gap: 12px; }
.toolbar-fields label { display: flex; flex-direction: column; min-width: 150px; flex: 1 1 150px; }
.chart { min-height: 120px; }
.bar-chart { max-width: 100%; height: auto; display: block; font-family: var(--font); }
.bar-chart .grid { stroke: var(--border); stroke-width: 1; }
.bar-chart .baseline { stroke: var(--muted); stroke-width: 1; }
.bar-chart .axis { fill: var(--muted); font-size: 12px; }
.bar-chart .label { fill: var(--text); font-size: 14px; }
.bar-chart .value { fill: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.bar-chart .bar-fill { fill: var(--bar); }
.bar-chart .hit { fill: transparent; }
.bar-chart .bar-link:hover .hit, .bar-chart .bar-link:focus-visible .hit { fill: var(--surface-2); }
.bar-chart .bar-link:hover .bar-fill { fill: var(--accent-hover); }
.bar-chart .bar-link:focus-visible { outline: none; }
.bar-chart .bar-link:focus-visible .hit { stroke: var(--focus); stroke-width: 3; }

.settings-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.settings-grid .panel { margin-bottom: 0; }
.token-box { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--warn-bg); border: 1px solid var(--warn-border); }
.token-box p { color: var(--text); }
.token-value { font-family: var(--mono); }
.cmd { background: var(--surface); padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border); margin: 0 0 8px; }
#c-payouts, #c-remaining { max-width: 560px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
ul.plain { list-style: none; margin: 0; padding: 0; }

/* ------------------------------------------------------------------ Login */
.login-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px 24px; box-shadow: var(--shadow);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-brand h1 { margin: 0; font-size: 1.5rem; }
.login-card .stack-form { max-width: none; }
.login-card .btn { width: 100%; align-self: stretch; }
