/* Game Tracker PWA - eigenes Stylesheet (kein style.css der App: die Shell muss klein und
   offline-cachebar bleiben). Die Farb-Tokens sind aus style.css :root kopiert - wer sie dort
   aendert, zieht sie hier nach. */
:root {
    --bg: #0a0d14;
    --card: #131a26;
    --text: #e8e2d0;
    --muted: #93a0b4;
    --accent: #7db3d8;
    --accent-strong: #9ecbea;
    --magenta: #bf5b9e;
    --border: #263349;
    --hover: #1a2436;
    --input-bg: #0f141d;
    --good: #3fbf6f;
    --bad: #e66767;
    --warn: #e0b04a;
    --bar-h: 3.25rem;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    /* Tisch-Tracker: kein Zoom-Doppeltipp, kein Pull-to-Refresh, keine Textauswahl */
    touch-action: manipulation;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 100dvh;
}
input, textarea, select { -webkit-user-select: text; user-select: text; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { margin: 0 0 0.5rem; font-weight: 600; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 1.1rem; }
p { margin: 0.4rem 0; }
.muted { color: var(--muted); }
code.tk-code { font-size: 0.8rem; word-break: break-all; color: var(--accent); }

button, .button {
    display: inline-block;
    background: var(--accent);
    color: #0b1018;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
    text-align: center;
}
button:hover, .button:hover { background: var(--accent-strong); color: #0b1018; }
button:disabled { opacity: 0.45; cursor: default; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); font-weight: 500; }
button.secondary:hover, .button.secondary:hover { background: var(--hover); }
button.danger, .button.danger { color: var(--bad); border-color: var(--bad); }
button.primary, .button.primary { background: var(--accent); }
button.big, .button.big { padding: 1rem 1.25rem; font-size: 1.15rem; width: 100%; }

input[type=text], input[type=search], input[type=number], input[type=password], select {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    font-size: 1rem;
    font-family: inherit;
    min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); }
label > select, label > input { color: var(--text); font-size: 1rem; }

/* ---------- Seitenrahmen ---------- */

#screen { max-width: 760px; margin: 0 auto; padding: 0.75rem 1rem 2rem; }
body[data-screen=game] #screen, body[data-screen=finish] #screen, body[data-screen=setup] #screen:has(.tk-table) {
    max-width: none; padding: 0; height: 100dvh; overflow: hidden;
}

#banner {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.5rem 1rem;
    background: var(--card); border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem; font-size: 0.9rem;
}
#banner button { padding: 0.35rem 0.8rem; font-size: 0.9rem; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin: 0 0 0.9rem;
}
.notice { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--warn); border-radius: 10px; padding: 0.6rem 0.9rem; margin: 0 0 0.9rem; font-size: 0.92rem; }

.tk-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0 0.9rem; }
.tk-head h1 { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-back { font-size: 1.5rem; line-height: 1; padding: 0.2rem 0.5rem; border-radius: 8px; }
.tk-back:hover { background: var(--hover); }
.tk-head-actions { display: flex; gap: 0.5rem; align-items: center; }
.tk-head-actions button { padding: 0.4rem 0.8rem; font-size: 0.9rem; }
.tk-user { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.9rem; }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; }
.avatar-placeholder { background: var(--hover); color: var(--accent); font-weight: 600; }

.tk-actions { display: grid; gap: 0.6rem; margin: 0.25rem 0 1rem; }
.tk-nav-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; margin-bottom: 0.9rem; }
.tk-nav-card { display: block; color: var(--text); }
.tk-nav-card:hover { background: var(--hover); color: var(--text); }
.tk-nav-card h2 { color: var(--accent); }
.tk-foot { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 1.5rem;
    display: flex; flex-direction: column; gap: 0.35rem; align-items: center; }
/* Rechtliches: Imprint/Privacy/Terms und die Hinweise zu Scryfall und dem Wizards Fan Content
   (Pflicht, sobald der Tracker auch ohne Konto Kartenbilder zeigt) */
.tk-legal { font-size: 0.75rem; max-width: 46rem; line-height: 1.4; }
/* Lokaler Modus ohne Konto: Erklaerung auf der Startseite und im Setup */
.tk-local-intro h2 { margin-top: 0; }
.tk-local-intro p { margin: 0.4rem 0; }
.tk-local-intro .tk-local-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.1rem; }
.tk-local-note { margin: -0.4rem 0 0; font-size: 0.85rem; }
/* Registrierung im Tracker (#/register, Tracker-Konto ohne Invite-Code) */
.tk-register-form { display: grid; gap: 0.8rem; max-width: 26rem; }
.tk-register-form label { display: grid; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); }
.tk-register-form label.tk-check { grid-template-columns: auto 1fr; align-items: start; gap: 0.6rem; color: var(--text); }
.tk-check input { width: 1.1rem; height: 1.1rem; margin-top: 0.15rem; accent-color: var(--accent); }
.tk-register-actions { margin: 0.2rem 0 0; }
.tk-register .error, .tk-upload .error { color: var(--bad); margin: 0; }
/* Lokales Spiel in eine Playgroup uebernehmen (Spieldetail) */
.tk-upload { display: grid; gap: 0.5rem; margin: 1rem 0 0.5rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.tk-upload h3 { margin: 0; font-size: 1rem; }
.tk-upload .tk-inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.tk-list { list-style: none; margin: 0.4rem 0; padding: 0; }
.tk-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 0; border-top: 1px solid var(--border); }
.tk-list li:first-child { border-top: none; }
.tk-list li > span:first-child { min-width: 0; }
.tk-links li { padding: 0; }
.tk-links a { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.1rem 0.75rem; width: 100%; padding: 0.7rem 0.25rem; color: var(--text); border-radius: 8px; }
.tk-links a:hover { background: var(--hover); color: var(--text); }
.tk-links a > span { grid-column: 1; }
/* a > .tk-chevron statt nur .tk-chevron: ".tk-links a > span" ist spezifischer und zog den Pfeil
   sonst in die erste Spalte (stand dann ueber dem Datum) */
.tk-links a > .tk-chevron, .tk-chevron { grid-column: 2; grid-row: 1 / span 4; color: var(--muted); font-size: 1.6rem; }
.tk-row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.tk-row-actions button { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.tk-member { display: flex; align-items: center; gap: 0.6rem; }
.tk-member .muted, .tk-decks { display: block; font-size: 0.82rem; }
.tk-pending { opacity: 0.7; }
.tk-inline-form { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.tk-inline-form input, .tk-inline-form select { flex: 1 1 auto; }
.tk-danger-zone { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; font-size: 0.9rem; }
.tk-sync { border-left: 4px solid var(--warn); }
.tk-game-when { font-size: 0.82rem; color: var(--muted); }
.tk-game-players { font-size: 1rem; }
.tk-game-deck { font-size: 0.85rem; }
.tk-results .tk-segment button { min-width: 3.6rem; }

table.tk-table-results { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 0.5rem 0; }
.tk-table-results th, .tk-table-results td { text-align: left; padding: 0.4rem 0.5rem; border-top: 1px solid var(--border); vertical-align: top; }
.tk-table-results th { color: var(--muted); font-weight: 500; border-top: none; }
tr.res-win td:nth-child(4) { color: var(--good); font-weight: 600; }
tr.res-draw td:nth-child(4) { color: var(--warn); }
.scroll-x { overflow-x: auto; }
.tk-timeline { margin-top: 0.75rem; }
.tk-timeline summary { cursor: pointer; color: var(--accent); }
.tk-timeline ol { margin: 0.5rem 0 0; padding-left: 1.2rem; font-size: 0.88rem; line-height: 1.5; }

/* ---------- Farb-Pips (wie in der App) ---------- */
.pips { display: inline-flex; align-items: center; gap: 2px; margin-right: 0.4rem; vertical-align: -1px; }
.pip { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.45); }
.pip-w { background: #f2ecc8; }
.pip-u { background: #a9c7e0; }
.pip-b { background: #3e3646; border-color: #a59aab; }
.pip-r { background: #e49977; }
.pip-g { background: #a3c095; }
.pip-c { background: transparent; border: 1.5px solid var(--muted); }

/* ---------- Segment-Buttons, Formfelder ---------- */
.tk-segment { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
.tk-segment button, .tk-segment input { background: var(--input-bg); color: var(--text); border: 1px solid var(--border); font-weight: 500; padding: 0.5rem 0.8rem; min-width: 2.75rem; }
.tk-segment button.on, .tk-segment input.on { background: var(--accent); color: #0b1018; border-color: var(--accent); font-weight: 600; }
.tk-segment input { width: 6rem; }
.tk-segment button.res-win.on { background: var(--good); border-color: var(--good); }
.tk-segment button.res-draw.on { background: var(--warn); border-color: var(--warn); }
.tk-setup-form { display: grid; gap: 0.9rem; }
.tk-field { display: grid; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }
.tk-check { flex-direction: row; align-items: center; gap: 0.5rem; color: var(--text); }
.tk-minutes { flex-direction: row; align-items: center; gap: 0.5rem; color: var(--text); }
.tk-minutes input { width: 5.5rem; }
.tk-minutes.dim { opacity: 0.5; }
.tk-setup-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }

/* ---------- Typeahead ---------- */
.typeahead { position: relative; }
.typeahead input { width: 100%; }
.ta-menu { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--card); border: 1px solid var(--border); border-radius: 8px; max-height: 12rem; overflow-y: auto; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.ta-menu div[role=option] { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.45rem 0.7rem; cursor: pointer; font-size: 0.95rem; }
.ta-menu div[role=option].active, .ta-menu div[role=option]:hover { background: var(--hover); }
.ta-menu mark { background: transparent; color: var(--accent-strong); font-weight: 600; }
.ta-hint { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.ta-menu .muted { padding: 0.45rem 0.7rem; }

/* ---------- Tisch-Raster ---------- */
.tk-table {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 4px;
    height: 100dvh;
    padding: 4px;
    padding-top: max(4px, env(safe-area-inset-top));
    padding-bottom: max(4px, env(safe-area-inset-bottom));
}
.seat {
    position: relative;
    min-width: 0;
    min-height: 0;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
}
.seat-inner { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 0.5rem 0.6rem; gap: 0.25rem; }
.rot-180 .seat-inner { transform: rotate(180deg); }
/* Im Spiel ist jeder Sitz ein Container (2026-10-10): Mulligan-Knoepfe, Chip-Zeile und das
   Award-Panel richten sich nach der Breite des SITZES, nicht des Fensters - ein Viertel eines
   Handys im Hochformat ist schmaler als jeder Media-Query-Breakpoint vermuten laesst, und bei
   5-6 Spielern am Tablet gilt dasselbe. Regeln im Block "Schmale Sitze" weiter unten. */
.tk-game .seat-inner { container: seat / inline-size; }
.seat.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(125, 179, 216, 0.35), inset 0 0 40px rgba(125, 179, 216, 0.08); }
.seat.out { filter: saturate(0.3); }
.seat.out .seat-inner { opacity: 0.75; }
.seat.drop-hot { border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(191, 91, 158, 0.5); }
body.dragging { cursor: grabbing; }
body.dragging .seat { transition: box-shadow 0.1s; }

.seat-top { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; min-height: 1.2em; }
.seat-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-deck { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.82rem; }

/* "Actions" steht mittig UEBER dem Leben, "End turn" mittig darunter (s. .seat-end): beide
   liegen damit auf der Mittelachse des Sitzes, wo der Daumen des Spielers ohnehin ist. */
.seat-acts { display: flex; align-items: center; justify-content: center; gap: 0.35rem; min-height: 2.1rem; }
.seat-acts .seat-act-btn { padding: 0.35rem 1.1rem; font-size: 0.95rem; min-height: 2.1rem; border-radius: 999px; }
.seat-extra { font-size: 0.72rem; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 0.1rem 0.45rem; white-space: nowrap; }
.seat.on-extra { border-color: var(--magenta); box-shadow: 0 0 0 2px rgba(191, 91, 158, 0.35), inset 0 0 40px rgba(191, 91, 158, 0.08); }
.seat.on-extra .seat-extra { color: var(--magenta); border-color: var(--magenta); }
/* Der Name gehoert an die AEUSSERE Kante: bei den Sitzen, deren CSS-linke Seite zur
   Tischmitte zeigt (oben links, unten rechts), lag er sonst unter dem Hub. Dort steht
   deshalb der Deckname innen. Gleiche Bedingung wie beim Zugreihenfolge-Badge (.seat-order),
   und nur im Spiel - der Hub gibt es weder im Setup noch im Finish. */
.tk-game .seat.rot-180[data-half=left] .seat-top,
.tk-game .seat:not(.rot-180)[data-half=right] .seat-top { flex-direction: row-reverse; }
/* Die Chip-Zeile (Gift, Commander-Schaden, Eliminieren) gehoert dagegen an die INNERE Kante,
   zur senkrechten Tischnaht hin: sie beginnt links im Sitz, und das ist nur oben links und
   unten rechts die Naht - oben rechts und unten links lag sie aussen (2026-09-18). Dort
   gespiegelt statt nur nach rechts geschoben, damit das Gift wie in den beiden anderen
   Vierteln am naechsten an der Naht steht. Volle und mittlere Sitze bleiben aussen vor. */
.tk-game .seat.rot-180[data-half=right] .seat-chips,
.tk-game .seat:not(.rot-180)[data-half=left] .seat-chips { flex-direction: row-reverse; }

/* Custom Tracker (2026-09-18): Knopf am ANDEREN Ende der Chip-Zeile, also in der aeusseren Ecke
   des Tisches; aktive Tracker stehen als farbige Icons im selben Knopf. Die aeussere Ecke ist
   rechts im Sitz - in den beiden gespiegelten Vierteln (row-reverse, s.o.) links, deshalb dort
   margin-right statt margin-left. */
.seat-fx { margin-left: auto; gap: 0.3rem; }
.tk-game .seat.rot-180[data-half=right] .seat-fx,
.tk-game .seat:not(.rot-180)[data-half=left] .seat-fx { margin-left: 0; margin-right: auto; }
.seat-fx.has-fx { border-color: var(--accent); }
.fx-ico { display: inline-flex; width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.fx-ico svg { width: 100%; height: 100%; }
.seat-fx .fx-menu-ico { color: var(--muted); }
/* Das Menue ist eine Flaeche IM Sitz (dreht sich mit ihm) und deckt Leben und Chips ab; der
   Sitz schneidet sie mit seinem overflow: hidden auf die runden Ecken zu. Kopfzeile und Liste
   haengen an der UNTERKANTE des Sitzes = aussen am Tisch: die Oberkante liegt bei allen vier
   Vierteln an der Tischnaht, und deren innere Ecke deckt der Hub ab (dort lag sonst das X). */
.seat-fx-panel {
    position: absolute; inset: 0; z-index: 4;
    display: flex; flex-direction: column-reverse; gap: 0.5rem; padding: 0.6rem 0.75rem;
    background: var(--card);
}
/* Mulligan-Phase im Spiel (2026-10-10): deckt den Sitz ab, bis er gekeept hat - die Uhr laeuft
   schon. Deckend - durchscheinend lagen Name, Leben und "Actions" unruhig dahinter */
.seat-mull { position: absolute; inset: 0; z-index: 5; background: var(--card); }
.seat-mull .mull { position: relative; z-index: 1; height: 100%; }
/* Commander-Streifen hinter der Mulligan-Auswahl (2026-10-17), damit jeder seinen Sitz erkennt:
   heller als im Spiel und gleichmaessig abgedunkelt statt des Verlaufs nach unten - dort stehen
   hier die Knoepfe */
.seat-mull .seat-art img { opacity: 0.75; }
.seat-mull .seat-art::after { background: rgba(19, 26, 38, 0.5); }
.seat-mull .mull-head, .seat-mull .mull-status { text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); }
.seat-mull .mull-head .muted, .seat-mull .mull-status { color: var(--text); }
.fx-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-weight: 600; }
.fx-close { background: transparent; border: 0; color: var(--muted); font-size: 1.6rem; line-height: 1; padding: 0.1rem 0.5rem; }
.fx-close:hover { background: transparent; color: var(--text); }
.fx-list {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; touch-action: pan-y;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(12rem, 100%), 1fr)); gap: 0.45rem; align-content: end;
}
.fx-item {
    display: flex; align-items: center; gap: 0.65rem; text-align: left; min-height: 3rem;
    background: var(--input-bg); color: var(--text); border: 1px solid var(--border); padding: 0.55rem 0.75rem; font-weight: 500;
}
.fx-item:hover { background: var(--hover); color: var(--text); }
.fx-item .fx-ico { width: 1.6rem; height: 1.6rem; }
.fx-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.fx-state { font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.fx-item.on { border-color: var(--accent); background: rgba(125, 179, 216, 0.12); }
/* Volle und mittlere Sitze (2, 3, 5, 6 Spieler) reichen ueber die Tischmitte: dort liegt die
   MITTE des Sitzes unter dem Hub, "Actions" bleibt deshalb an der Kante. */
.tk-game .seat[data-half=mid] .seat-acts { justify-content: flex-start; }

.seat-life {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: none;
    border-radius: 10px;
}
.seat-life .life { font-size: clamp(2.6rem, 17vmin, 8.5rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.seat-life .life.low { color: var(--bad); }
/* Senkrechte Teilung: rechts + / links - (in der Orientierung des Sitzes, die Drehung des
   .seat-inner nimmt die Zeichen mit). Die Zeichen sind bewusst gross - sie markieren die
   Tippflaeche, die den halben Sitz breit ist */
.seat-life .half {
    position: absolute; top: 50%; transform: translateY(-50%); text-align: center;
    color: var(--muted); opacity: 0.4; font-size: clamp(1.8rem, 7vmin, 3.4rem); font-weight: 600;
    line-height: 1; pointer-events: none;
}
.seat-life .half.plus { right: 0.5rem; }
.seat-life .half.minus { left: 0.5rem; }
.seat-life.holding { background: rgba(125, 179, 216, 0.08); }
.seat.out .seat-life .half, .seat.out .seat-life .life { opacity: 0.35; }
.seat-out { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: clamp(1.4rem, 6vmin, 2.6rem); font-weight: 700; color: var(--bad); letter-spacing: 0.1em; }
.seat-out small { font-size: 0.75rem; letter-spacing: 0; color: var(--muted); font-weight: 500; }
/* Das Badge sass rechts mittig - genau dort steht seit der senkrechten Teilung das Minus.
   Jetzt oben mittig, also in der Flaeche, die das frueher dort stehende Plus frei gemacht hat */
.seat-badge {
    position: absolute; left: 50%; top: 0.2rem; transform: translateX(-50%);
    font-size: clamp(1.1rem, 4vmin, 1.8rem); font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 8px;
    background: rgba(10, 13, 20, 0.8); transition: opacity 0.3s;
}
.seat-badge.up { color: var(--good); }
.seat-badge.down { color: var(--bad); }
.seat-badge.fade { opacity: 0; }

.seat-chips { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.chip {
    background: var(--input-bg); color: var(--text); border: 1px solid var(--border);
    border-radius: 999px; padding: 0.35rem 0.7rem; font-size: 0.85rem; font-weight: 500; line-height: 1;
    display: inline-flex; align-items: center; gap: 0.3rem; min-height: 2rem;
}
.chip:hover { background: var(--hover); color: var(--text); }
.chip.warn { border-color: var(--warn); color: var(--warn); }
.chip.attack { cursor: grab; touch-action: none; background: var(--accent); color: #0b1018; font-weight: 700; padding: 0.35rem 0.9rem; }
.chip.attack:active { cursor: grabbing; }
.chip.out { color: var(--muted); }
.chip.revive { color: var(--good); border-color: var(--good); }
.tk-drag {
    position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, -120%);
    background: var(--card); border: 2px solid var(--magenta); border-radius: 10px; padding: 0.4rem 0.7rem;
    font-size: 0.85rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6); white-space: nowrap;
}

/* Leiste zwischen den Zeilen: von beiden Tischseiten erreichbar.
   Der SPIELSCHIRM hat sie nicht mehr (dort steht der Hub, s.u.) - Setup und Finish nutzen
   dieselbe .tk-table und tragen ihre Leiste weiter. */
.tk-bar {
    grid-row: 2; grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap;
    min-height: var(--bar-h); padding: 0.2rem 0.4rem;
    background: var(--bg); border-radius: 10px;
}
.tk-bar button { padding: 0.5rem 0.9rem; font-size: 0.95rem; }
.tk-bar-note { font-size: 0.85rem; }

/* ---------- Hub: das runde Bedienfeld in der Tischmitte ----------
   Der Ring ist im Normalfall ZU: am Tisch steht nur eine kleine Scheibe mit Turn-Nummer,
   aktivem Spieler und Zeit. Ein Tipp darauf haelt die Uhr an und die vier Nebenfunktionen
   (Undo, Redo, Settings, Finish) kommen unter der Scheibe hervor; zu geht es mit der Mitte,
   einem Tipp daneben oder einer Aktion. "End turn" ist bewusst NICHT im Ring, sondern steht
   als .seat-end mittig unter dem Leben des aktiven Spielers - es ist die haeufigste Aktion im
   Spiel und darf keinen zweiten Tipp und keine Pause kosten.
   Die mittlere Rasterzeile faellt dafuer auf 0: die Sitzreihen stossen zusammen, die
   waagrechte Trennlinie verschwindet. */
.tk-game { position: relative; grid-template-rows: minmax(0, 1fr) 0 minmax(0, 1fr); }

.tk-hub {
    --hub: 16rem;                    /* Durchmesser der Umlaufbahn (nur offen sichtbar) */
    --disc: 6.25rem;                 /* Durchmesser der Scheibe, zu (bis 2026-09-18: 7rem) */
    --r: calc(var(--hub) / 2);
    position: absolute; left: 50%; top: 50%;
    width: var(--hub); height: var(--hub);
    transform: translate(-50%, -50%);
    z-index: 5;
    /* Der Ring ist Luft: Drag-to-Attack laeuft ueber document.elementFromPoint und darf nicht
       an der quadratischen Flaeche des Hubs haengenbleiben. */
    pointer-events: none;
}
.tk-hub > * { pointer-events: auto; }

/* Die ganze Scheibe ist der Schalter (ein <button>; der Timer darin ist deshalb ein <span> -
   verschachtelte Buttons waeren ungueltig). Die ausdrueckliche Pause steht im Menue. */
.hub-disc {
    position: absolute; left: 50%; top: 50%;
    width: var(--disc); height: var(--disc);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 50% 30%, var(--card), var(--bg) 84%);
    border: 2px solid var(--border);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.65);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 0.5rem; text-align: center; line-height: 1.15;
    color: var(--text); font-family: inherit; font-size: 0.8rem; font-weight: 400;
    z-index: 2;                      /* liegt UEBER den Satelliten - daher kommen sie darunter hervor */
    transition: width 0.3s ease, height 0.3s ease, font-size 0.3s ease, border-color 0.2s ease;
}
.hub-disc:hover { background: radial-gradient(circle at 50% 30%, var(--hover), var(--bg) 84%); color: var(--text); }
/* Offen 56 % der Umlaufbahn (9rem; bis 2026-09-18 64 %) - seit die Satelliten 3,5rem gross
   sind, laege die Scheibe sonst zu dicht an ihnen */
.tk-hub.open .hub-disc { --disc: calc(var(--hub) * 0.56); border-color: var(--accent); font-size: 1rem; }
/* Am liegenden Geraet wird die kleine Scheibe mit dem Daumen getroffen: unsichtbarer Rand
   rundherum, statt dafuer Durchmesser zu verbrauchen */
.hub-disc::before { content: ""; position: absolute; inset: -0.6rem; border-radius: 50%; }

.hub-face { display: flex; flex-direction: column; align-items: center; max-width: 92%; }
.hub-turn { font-weight: 700; font-size: 0.92em; }
.hub-active {
    font-size: 0.76em; color: var(--muted);
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hub-timer {
    font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.15em; line-height: 1.15;
    display: flex; flex-direction: column; align-items: center; margin-top: 0.1em;
}
.hub-timer #g-countdown { font-size: 0.66em; font-weight: 500; color: var(--muted); }
.hub-timer #g-countdown.soon { color: var(--warn); }
.hub-timer #g-countdown.over { color: var(--bad); font-weight: 600; }
/* Steht die Uhr, sagt die Scheibe das auch - offen ohnehin, sonst nach einer Pause aus dem Menue */
.hub-timer.paused, .tk-hub.open .hub-timer { color: var(--warn); }
/* Der Uebernahme-Hinweis passt nicht in die Scheibe und sitzt deshalb darueber (unten sitzt
   im geoeffneten Ring der Finish-Knopf) */
.hub-live {
    position: absolute; left: 50%; bottom: calc(50% + var(--disc) / 2 + 0.35rem);
    transform: translateX(-50%); background: var(--bg);
}

/* Zu: zusammengeschoben und unsichtbar unter der Scheibe. Offen faehrt jeder Satellit per
   rotate(a) translateY(-r) rotate(-a) an seinen Platz - das zweite rotate stellt ihn wieder
   aufrecht. Die Verzoegerung gilt nur beim Ausfahren, eingeklappt wird alles auf einmal. */
.hub-sat {
    position: absolute; left: 50%; top: 50%;
    --a: 0deg; --d: 0ms;
    transform: translate(-50%, -50%) scale(0.35);
    opacity: 0; pointer-events: none; z-index: 1;
    white-space: nowrap;
    transition: transform 0.3s cubic-bezier(0.2, 0.85, 0.3, 1.15), opacity 0.18s ease;
    transition-delay: 0ms;
}
.tk-hub.open .hub-sat {
    transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(-1 * var(--r))) rotate(calc(-1 * var(--a)));
    opacity: 1; pointer-events: auto;
    transition-delay: var(--d);
}
/* Die Satelliten werden am liegenden Geraet mit dem Daumen getroffen: 3,5rem statt der
   frueheren 2,9rem (2026-09-18), dazu wie bei der Scheibe ein unsichtbarer Trefferrand. Undo
   und Redo liegen 40 Grad auseinander, ihre Mittelpunkte also 2 x r x sin(20) = 5,5rem - auch
   mit Rand bleibt dazwischen gut 1rem Luft. */
.hub-sat::before { content: ""; position: absolute; inset: -0.4rem; border-radius: 999px; }
.hub-ico {
    width: 3.5rem; height: 3.5rem; border-radius: 50%; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--card); color: var(--accent); border: 1px solid var(--border);
    font-size: 1.5rem; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}
.hub-ico:hover { background: var(--hover); color: var(--accent-strong); }
.hub-ico:disabled { opacity: 0.35; }
.hub-ico svg { width: 1.55rem; height: 1.55rem; }
.hub-pill {
    border-radius: 999px; padding: 0.75rem 1.5rem; font-size: 1.1rem; font-weight: 600;
    background: var(--card); color: var(--accent); border: 1px solid var(--accent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}
.hub-pill:hover { background: var(--hover); color: var(--accent-strong); }

/* Anordnung seit 2026-10-10: Finish unten, Undo LINKS davon, Redo RECHTS davon, das Zahnrad
   oben gegenueber - die Seite sagt, wohin der Pfeil geht (vorher standen Undo und Redo
   uebereinander links, mit gebogenen Pfeilen, und keiner wusste, welcher zurueck heisst).
   Winkel: 0 = oben, 90 = rechts, 180 = unten, 270 = links. 230/130 Grad lassen neben der
   Finish-Pille (180) gut 1rem Luft. */
.hub-undo   { --a: 230deg; --d: 0ms; }
.hub-redo   { --a: 130deg; --d: 45ms; }
/* Zahnrad und Log teilen sich die Oberseite (2026-10-10): je 20 Grad neben der Mitte */
.hub-menu   { --a: 340deg; --d: 90ms; }
.hub-log    { --a:  20deg; --d: 110ms; }
#g-finish   { --a: 180deg; --d: 135ms; }

/* Sitzt der aktive Spieler in der oberen Reihe, dreht sich der GANZE Hub zu ihm (seit
   2026-10-10, vorher nur der Scheibentext): Finish liegt dann auf seiner Seite, und Undo
   links / Redo rechts stimmen aus seiner Sicht - mit fest stehendem Ring lag "zurueck" fuer die
   obere Reihe rechts. Gedreht wird der Container, Scheibe und Satelliten erben es; deren
   eigene transforms (Umlaufbahn, Aufrichten) bleiben unberuehrt. */
.tk-hub.active-top { transform: translate(-50%, -50%) rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
    .hub-disc, .hub-sat { transition: none; }
}

/* Setup-Raster: Sitze tragen Formulare */
.tk-setup .seat-inner, .tk-feedback .seat-inner { gap: 0.4rem; overflow-y: auto; justify-content: center; }
.tk-setup .seat-inner select, .tk-setup .seat-inner input { width: 100%; font-size: 0.95rem; padding: 0.45rem 0.6rem; }
.seat-label { font-size: 0.85rem; color: var(--muted); }
.cmd-inputs { display: grid; gap: 0.3rem; }
.seat-deck-chosen { font-size: 0.9rem; }
.seat-ready { font-size: 0.8rem; color: var(--muted); text-align: right; }
/* Gewinnquote im Ready-Panel: die Schaetzung aus der Historie der Playgroup (WinOdds).
   Beiwerk - offline und bei jedem Fehler bleibt der Kasten einfach leer. */
.ready-odds { display: flex; flex-direction: column; align-items: center; line-height: 1.1; min-height: 1.8rem; }
.odds-pct { font-size: 1.35rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
/* Waehrend eine neue Antwort laeuft (Zugreihenfolge getippt) stehen die alten Zahlen gedimmt da */
.odds-pct.stale { opacity: 0.45; }
.odds-label { font-size: 0.68rem; color: var(--muted); text-transform: lowercase; }

.seat-ready.ok { color: var(--good); }
.tk-feedback .seat.res-win { border-color: var(--good); }
.tk-feedback .seat.res-draw { border-color: var(--warn); }
.tk-rate { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); }
.tk-rate .tk-segment button { min-width: 2.4rem; padding: 0.4rem 0.5rem; }

/* ---------- Dialoge ---------- */
.tk-dialog {
    background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 14px;
    padding: 1rem 1.2rem; width: min(440px, 94vw); max-height: 90dvh; overflow-y: auto;
}
/* Sicherheitsnetz gegen die Falle bei `.tk-dialog.full` weiter unten (Idiom wie
   `[hidden] { display: none !important }` in style.css): kein geschlossener Dialog wird je
   sichtbar, egal welche Klasse ihm spaeter ein display gibt. Mit !important, damit die
   Reihenfolge im Stylesheet egal ist. */
.tk-dialog:not([open]) { display: none !important; }
.tk-dialog::backdrop { background: rgba(4, 6, 10, 0.72); }
.tk-dialog.rot-180 { transform: rotate(180deg); }
.tk-dialog label { margin: 0.5rem 0; }
.tk-dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.9rem; }
.tk-stepper { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin: 0.6rem 0; }
.tk-stepper .val { font-size: 2rem; font-weight: 700; min-width: 3rem; text-align: center; font-variant-numeric: tabular-nums; }
.tk-stepper button, .tk-cmd-row .btns button { padding: 0.55rem 0.7rem; min-width: 2.8rem; }
.tk-cmd-rows { display: grid; gap: 0.5rem; margin: 0.6rem 0; }
.tk-cmd-row { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 0.6rem; align-items: center; padding: 0.5rem 0; border-top: 1px solid var(--border); font-size: 0.9rem; }
.tk-cmd-row:first-child { border-top: none; }
.tk-cmd-row .val { font-size: 1.6rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.tk-cmd-row .btns { grid-column: 1 / -1; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.tk-choice, .tk-menu { display: grid; gap: 0.45rem; margin: 0.5rem 0; }
.tk-menu button { background: var(--input-bg); color: var(--text); border: 1px solid var(--border); text-align: left; font-weight: 500; }
.tk-menu button:hover { background: var(--hover); }
.tk-menu button.danger { color: var(--bad); }

/* ---------- Toasts ---------- */
#toast-box { position: fixed; right: 1rem; bottom: 1rem; z-index: 300; display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; pointer-events: none; }
.toast { background: var(--good); color: #0b1018; font-weight: 600; padding: 0.6rem 1rem; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); max-width: 22rem; opacity: 0; transform: translateY(8px); transition: opacity 0.2s ease, transform 0.2s ease; font-size: 0.95rem; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: var(--bad); }

/* ---------- Setup: Kacheln, Slide-Panels, Ready ---------- */
.tk-setup .seat-inner { padding: 0; overflow: hidden; justify-content: stretch; }
.seat-track { display: flex; width: 300%; height: 100%; transition: transform 0.3s ease; }
.seat-track[data-panel=deck] { transform: translateX(-33.333%); }
.seat-track[data-panel=ready] { transform: translateX(-66.666%); }
.panel { flex: 0 0 33.333%; width: 33.333%; min-width: 0; height: 100%; overflow-y: auto; padding: 0.45rem 0.55rem; display: flex; flex-direction: column; gap: 0.4rem; }
.panel-head { display: flex; align-items: center; gap: 0.5rem; }
.panel-head .seat-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-filter { width: 7rem; padding: 0.3rem 0.5rem; font-size: 0.85rem; flex: 0 0 auto; }
.tk-mini { padding: 0.3rem 0.6rem; font-size: 0.8rem; background: var(--input-bg); color: var(--text); border: 1px solid var(--border); font-weight: 500; }
.tk-mini:hover { background: var(--hover); color: var(--text); }
/* Spieler- und Deck-Kacheln gleich breit (2026-10-10): vorher 88 px gegen 110 px Mindestbreite -
   beim Wechsel von der Spieler- zur Deck-Wahl wuchsen "Skip to deck"/"New player" sichtbar zu
   "Other commander"/"No deck". 110 px braucht das Commander-Bild der Deck-Kacheln. */
.tk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.4rem; }
/* Spieler- und Deckwahl an die AUSSENKANTE des Tisches (2026-10-10): oben links (gedreht) und
   unten rechts lag der Anfang der Zeile an der senkrechten Tischnaht - dort Kopfzeile und
   Kachelraster spiegeln (gleiche Bedingung wie Name/Chips im Spiel). direction: rtl dreht nur die
   Belegung des Rasters, die Kacheln selbst lesen weiter von links nach rechts. */
.tk-setup .seat.rot-180[data-half=left] :is(.panel-player, .panel-deck) .panel-head,
.tk-setup .seat:not(.rot-180)[data-half=right] :is(.panel-player, .panel-deck) .panel-head { flex-direction: row-reverse; }
.tk-setup .seat.rot-180[data-half=left] :is(.panel-player, .panel-deck) .seat-label,
.tk-setup .seat:not(.rot-180)[data-half=right] :is(.panel-player, .panel-deck) .seat-label { text-align: right; }
.tk-setup .seat.rot-180[data-half=left] :is(.panel-player, .panel-deck) .tk-tiles,
.tk-setup .seat:not(.rot-180)[data-half=right] :is(.panel-player, .panel-deck) .tk-tiles { direction: rtl; }
.tk-setup .seat.rot-180[data-half=left] :is(.panel-player, .panel-deck) .tk-tiles > *,
.tk-setup .seat:not(.rot-180)[data-half=right] :is(.panel-player, .panel-deck) .tk-tiles > * { direction: ltr; }
.tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem;
    background: var(--input-bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
    padding: 0.45rem 0.35rem; min-height: 4.2rem; font-weight: 500; font-size: 0.85rem; line-height: 1.2; text-align: center;
}
.tile:hover { background: var(--hover); color: var(--text); }
.tile:disabled { opacity: 0.35; }
.tile.guest { border-style: dashed; color: var(--accent); }
.tile.other { color: var(--muted); }
.tile-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 600; background: var(--hover); color: var(--accent); }
.tile-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.deck { padding: 0; overflow: hidden; align-items: stretch; gap: 0; }
.tile.deck .tile-name { padding: 0.3rem 0.4rem; font-size: 0.8rem; }
.tile-img, .ready-art { display: flex; width: 100%; aspect-ratio: 5 / 3; background: var(--hover); }
.tile-img span, .ready-art span, .seat-art span, .cmd-art { background-size: cover; background-position: center 22%; background-repeat: no-repeat; }
.tile-img span, .ready-art span { flex: 1 1 0; }
.tile-img.no-art, .ready-art.no-art { display: none; }
.guest-form, .cmd-form { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.guest-form input, .cmd-form .typeahead { flex: 1 1 8rem; }
.cmd-form button, .guest-form button { padding: 0.45rem 0.8rem; }
.panel-ready { align-items: center; justify-content: center; text-align: center; }
.ready-art { max-width: 14rem; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.ready-name { font-size: 1.2rem; font-weight: 700; }
.ready-deck { font-size: 0.85rem; color: var(--muted); }
.ready-mark { color: var(--good); font-weight: 600; }
.ready-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; }
.ready-hint { font-size: 0.75rem; }
/* Handy quer (2026-10-10): der leere Platzhalter fuer die Gewinnquote (min-height, damit die
   Zahl ohne Ruck erscheint) und die Abstaende kosteten genau die Hoehe, die zum Scrollbalken im
   Ready-Panel fuehrte. Hier faellt der leere Slot weg (lokale Spiele und Gruppen mit wenig
   Historie bekommen ohnehin keine Zahl), die Abstaende werden knapper. */
@media (max-height: 520px) {
    .panel-ready { gap: 0.2rem; padding-top: 0.3rem; padding-bottom: 0.3rem; }
    .ready-odds:empty { display: none; }
    .ready-name { font-size: 1.05rem; }
}
/* Noch flacher: der Drag-Hinweis ("drag onto another seat to swap") weicht als Erstes */
@media (max-height: 460px) {
    .ready-hint { display: none; }
}
/* Zugreihenfolge je Sitz (Setup): Nummer am oberen Eck in der Sitz-Orientierung, 1 = Startspieler */
.seat-order {
    position: absolute; top: 0.5rem; right: 0.5rem; z-index: 2;
    width: 2.6rem; height: 2.6rem; border-radius: 50%; padding: 0;
    background: var(--input-bg); color: var(--muted); border: 2px solid var(--border);
    font-size: 1.15rem; font-weight: 700; line-height: 1;
}
/* Am Eck zur Tischmitte: linke obere Sitze (gedreht) und rechte untere Sitze spiegeln nach links */
.seat.rot-180[data-half=left] .seat-order, .seat:not(.rot-180)[data-half=right] .seat-order { right: auto; left: 0.5rem; }
.seat-order:hover { background: var(--hover); color: var(--text); }
/* Wer anfaengt, sticht heraus: gruen statt Akzentblau (2026-10-10) */
.seat-order.first { background: var(--good); color: #0b1018; border-color: var(--good);
    box-shadow: 0 0 0 3px rgba(63, 191, 111, 0.35), 0 0 14px rgba(63, 191, 111, 0.45); }
/* Sitze tauschen: der Ready-Bereich ist die Zieh-Flaeche (kein Scrollen dort, Buttons bleiben Buttons) */
.tk-setup .panel-ready { touch-action: none; cursor: grab; }
.tk-setup .seat.drop-hot { border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(191, 91, 158, 0.5); }

/* Mulligan */
.mull { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.45rem; padding: 0.5rem; text-align: center; }
.mull-head { font-size: 0.95rem; }
.mull-cards { display: flex; gap: 3px; justify-content: center; }
.card-back { width: clamp(28px, 6vmin, 52px); aspect-ratio: 488 / 680; object-fit: cover; border-radius: 4px; transition: opacity 0.2s, filter 0.2s; }
.card-back.dim { opacity: 0.22; filter: grayscale(1); }
.mull-status { font-size: 0.9rem; color: var(--muted); }
.mull-actions { display: flex; gap: 0.5rem; }
.mull-back { padding-left: 0.7rem; padding-right: 0.7rem; }
/* Grosse Bildschirme (2026-09-18): oben war bei 52 px Schluss, am Monitor blieb der Sitz
   grossteils leer. Die Handy-Groessen bleiben unangetastet - der Block greift erst ab
   1000 x 640 px, ein quer gehaltenes Handy (~900 x 400) faellt damit sicher heraus.
   Die Karten richten sich nach dem SITZ (Container-Einheiten von .mull), nicht nach dem
   Fenster: bei 5-6 Spielern ist ein Sitz nur ein Drittel breit, 7 Karten muessen trotzdem
   in eine Reihe passen (11,5cqw je Karte = gut 80 % der Breite inklusive Luecken). */
@media (min-width: 1000px) and (min-height: 640px) {
    .mull { container-type: size; gap: 0.75rem; }
    .mull-head { font-size: 1.2rem; }
    .mull-cards { gap: 5px; }
    .card-back { width: clamp(52px, min(11.5cqw, 26cqh), 104px); border-radius: 6px; }
    .mull-status { font-size: 1.1rem; }
    .mull-actions { gap: 0.75rem; }
    .mull-actions button { font-size: 1.1rem; padding: 0.7rem 1.4rem; }
}
.tk-timer-presets input { width: 6rem; }
/* Custom-Minuten mit eigenem -/+ statt der weissen Browser-Pfeile (2026-10-10) */
.tk-num-step { display: inline-flex; align-items: stretch; }
.tk-num-step button { min-width: 2.4rem; padding: 0.5rem 0.4rem; font-size: 1.15rem; font-weight: 700; line-height: 1;
    background: var(--input-bg); color: var(--accent); border: 1px solid var(--border); }
.tk-num-step button:first-child { border-radius: 8px 0 0 8px; border-right: none; }
.tk-num-step button:last-child { border-radius: 0 8px 8px 0; border-left: none; }
.tk-num-step button:hover { background: var(--hover); color: var(--accent-strong); }
.tk-num-step button.holding { filter: brightness(1.25); }
.tk-segment .tk-num-step input { width: 5rem; border-radius: 0; text-align: center; font-variant-numeric: tabular-nums; }
.tk-num-step input::-webkit-outer-spin-button, .tk-num-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tk-num-step input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* ---------- Spiel: Commander-Art, End turn im Sitz, Timer, Vollbild-Dialog ---------- */
.seat { touch-action: none; }
.seat-inner { position: relative; }
.seat-art { position: absolute; inset: 0; display: flex; z-index: 0; pointer-events: none; }
.seat-art span { flex: 1 1 0; opacity: 0.55; }
.seat-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(19, 26, 38, 0.55), rgba(19, 26, 38, 0.75) 45%, rgba(19, 26, 38, 0.92)); }
.seat-art.no-art { display: none; }
.seat-top, .seat-acts, .seat-life, .seat-chips, .seat-end { position: relative; z-index: 1; }
.seat-life .life { text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8); }
/* "End turn" steht mittig UNTER dem Leben (order: zwischen .seat-life und .seat-chips, die im
   DOM davor stehen). Der Platz bleibt in jedem Sitz stehen - waere der Knopf nur beim aktiven
   Spieler im Fluss, ruckte bei jedem Zugwechsel der ganze Sitz. */
.seat-end { order: 1; align-self: center; padding: 0.7rem 1.7rem; font-size: 1.1rem; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); }
.seat-end.off { visibility: hidden; }
.seat-chips { order: 2; }
.chip.hint { border-style: dashed; color: var(--muted); font-weight: 400; pointer-events: none; }
/* display gehoert AN DAS [open]-Attribut: eine display-Regel ohne [open] schlaegt das
   UA-`dialog:not([open]) { display: none }` (Autor-Regeln gewinnen gegen den Browser-Default,
   unabhaengig von der Spezifitaet). Der geschlossene Dialog blieb sonst als Vollbildflaeche
   ueber dem Tisch stehen - ein zweiter Klick auf "Done" ist dann ein No-op und Escape greift
   mangels Modalitaet nicht mehr, der Angriffs-Dialog liess sich also scheinbar nicht
   schliessen (2026-09-17; gleiche Falle wie beim Goldfish-Mulligan-Dialog). */
.tk-dialog.full { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border: none; border-radius: 0; padding: 1rem 1.2rem; margin: 0; }
.tk-dialog.full[open] { display: flex; flex-direction: column; }
.tk-dialog.full .tk-cmd-rows { flex: 1 1 auto; overflow-y: auto; }
.tk-dialog.full .tk-dialog-actions button.big { width: 100%; }
.tk-full-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.tk-full-head h3 { font-size: 1.3rem; }
.tk-dialog.full .tk-cmd-row { grid-template-columns: auto 1fr auto; gap: 0.4rem 0.8rem; padding: 0.75rem 0; font-size: 1.05rem; }
.tk-dialog.full .tk-cmd-row .val { font-size: 2.4rem; }
.tk-dialog.full .tk-cmd-row .btns button { flex: 1 1 3rem; min-width: 3rem; padding: 0.9rem 0.5rem; font-size: 1.15rem; }
.cmd-art { display: inline-block; width: 3.2rem; height: 3.2rem; border-radius: 8px; background-color: var(--hover); }
.cmd-art.no-art { opacity: 0.4; }

/* ---------- Finish: groesser, zentriert ---------- */
.tk-finish { max-width: 560px; margin: 0 auto; padding: 1.25rem 1.4rem; font-size: 1.05rem; }
.tk-finish-intro { text-align: center; font-size: 1.15rem; margin-bottom: 0.75rem; }
.tk-finish label { font-size: 1rem; margin-top: 0.75rem; }
.tk-finish select { padding: 0.75rem 0.8rem; font-size: 1.05rem; }
.tk-results li { flex-wrap: wrap; padding: 0.75rem 0; }
.tk-result-who { display: flex; align-items: center; gap: 0.6rem; }
.tk-results .tk-segment { margin-left: auto; }
.tk-results .tk-segment button { min-width: 4.4rem; padding: 0.75rem 0.6rem; font-size: 0.95rem; }
.tk-result-row.res-win strong { color: var(--good); }
.tk-result-row.res-draw strong { color: var(--warn); }
.tk-feedback .seat-inner { align-items: center; justify-content: center; text-align: center; gap: 0.5rem; }
.fb-name { font-size: clamp(1.2rem, 4.5vmin, 1.8rem); font-weight: 700; }
.fb-result { font-size: 0.85rem; color: var(--muted); letter-spacing: 0.1em; }
.tk-feedback .seat.res-win .fb-result { color: var(--good); }
.tk-feedback .seat.res-draw .fb-result { color: var(--warn); }
.fb-q { font-size: clamp(0.9rem, 3vmin, 1.1rem); margin-top: 0.3rem; }
.tk-scale { justify-content: center; }
/* Abstimmung "<Award> of the Game" (2026-10-17): ein Knopf je Mitspieler, gewaehlt in Gold wie
   der Award-Knopf im Spiel */
.fb-vote { justify-content: center; max-width: 100%; }
.fb-vote button { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-vote button.on { background: var(--warn); border-color: var(--warn); color: #0b1018; }
.tk-scale button { min-width: clamp(2.4rem, 7vmin, 3.4rem); padding: clamp(0.5rem, 2vmin, 0.9rem) 0.4rem; font-size: clamp(1rem, 3.5vmin, 1.3rem); }

/* ---------- Commander-Streifen (zugeschnittene Artworks aus /api/commander-art) ---------- */
img.art, img.row-art { display: block; object-fit: cover; object-position: center; }
img.art-missing { display: none !important; }
.tile-img, .ready-art { aspect-ratio: 2.2 / 1; }
.tile-img img, .ready-art img { flex: 1 1 0; min-width: 0; width: 100%; height: 100%; }
.tile-img:has(img.art-missing:only-child), .ready-art:has(img.art-missing:only-child) { display: none; }
.seat-art img { flex: 1 1 0; min-width: 0; height: 100%; opacity: 0.5; }
.borrow-owner { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }
.borrow-list { display: grid; gap: 0.3rem; }
.tk-dialog-actions.spread { justify-content: space-between; flex-wrap: wrap; align-items: flex-end; }
/* Schmal (Timer-Dialog am Handy): die rechte Gruppe bricht in zwei Zeilen um - "Back" blieb
   sonst als hoher, zweizeiliger Klotz daneben stehen (2026-10-10). Er bleibt einzeilig und
   sitzt unten auf Hoehe des Hauptknopfs. */
.tk-dialog-actions.spread > button { white-space: nowrap; flex: 0 0 auto; }
.tk-actions-right button { white-space: nowrap; }

/* Erhaltener Commander-Schaden als Bild-Kacheln je Commander */
.cmd-taken { display: inline-flex; gap: 0.3rem; align-items: center; }
.cmd-tile { position: relative; width: 3.2rem; height: 2rem; padding: 0; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); background: var(--hover); }
.cmd-tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.cmd-tile .cmd-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem; color: #fff; text-shadow: 0 1px 4px #000, 0 0 8px #000; }
.cmd-tile.warn { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }

/* Angriffs-Dialog: Damage | Commander | Partner */
.tk-amount { display: flex; gap: 0.35rem; justify-content: center; flex-wrap: wrap; margin: 0.4rem 0 0.8rem; }
.tk-amount button { flex: 0 0 auto; min-width: 2.6rem; background: var(--input-bg); color: var(--text); border: 1px solid var(--border); font-weight: 600; }
.tk-amount button.on { background: var(--accent); color: #0b1018; border-color: var(--accent); }
/* Actions-Dialog: jede Aktion traegt ein eigenes Icon in eigener Farbe (SVGs in game.js,
   ACTION_ICONS). Der Text steckt in einem eigenen span - als lose Textknoten wuerde das Flex-
   Layout zwischen Menge und Wort ("3" | "damage ...") ebenfalls den gap einschieben */
.tk-act-menu button { display: flex; align-items: center; gap: 0.7rem; }
.act-ico { flex: 0 0 auto; display: inline-flex; width: 1.4rem; height: 1.4rem; }
.act-ico svg { width: 100%; height: 100%; }
.act-ico.ico-dmg { color: var(--bad); }
.act-ico.ico-drain { color: var(--good); }
.act-ico.ico-all { color: var(--warn); }
.act-ico.ico-extra { color: var(--magenta); }   /* wie der Rahmen eines Sitzes im Extra-Zug */

.tk-modes { display: flex; gap: 0.4rem; margin: 0.6rem 0; }
.tk-modes button { flex: 1 1 0; min-width: 0; background: var(--input-bg); color: var(--text); border: 1px solid var(--border); font-weight: 500; padding: 0.7rem 0.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-modes button.on { background: var(--accent); color: #0b1018; border-color: var(--accent); font-weight: 600; }
/* Leben- und Angriffs-Dialog (2026-10-10): beide fuellen den Schirm - oben wer, in der Mitte
   (waechst mit) gross "vorher -> nachher", unten EINE Reihe -10 -5 -1 | +1 +5 +10. Vorher stand
   alles oben gestapelt, darunter zwei Drittel leerer Schirm, und die Knoepfe lagen in zwei
   Reihen zu drei, in denen man den richtigen Wert suchen musste. */
.tk-stage {
    flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 0.3rem; padding: 0.5rem 0;
}
.tk-stage-label { font-size: 1rem; }
.tk-fromto { display: flex; align-items: baseline; justify-content: center; gap: 0.6em; line-height: 1;
    font-size: clamp(2.6rem, 15vmin, 9rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.tk-fromto .ft-from, .tk-fromto .ft-arrow { display: none; color: var(--muted); }
.tk-fromto.changed .ft-from { display: inline; font-size: 0.55em; }
.tk-fromto.changed .ft-arrow { display: inline; font-size: 0.45em; }
.tk-ft-delta { font-size: clamp(1.1rem, 3.5vmin, 1.6rem); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); min-height: 1.4em; }
.tk-ft-delta.up { color: var(--good); }
.tk-ft-note { font-size: 0.95rem; min-height: 1.2em; }
.tk-ft-note:empty { display: none; }
.tk-ft-delta.down { color: var(--bad); }
.tk-step-row { flex: 0 0 auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.45rem; }
.tk-step-row button {
    min-width: 0; padding: clamp(0.7rem, 4vmin, 2rem) 0.2rem; font-size: clamp(1.2rem, 4.5vmin, 2.1rem); font-weight: 700;
    font-variant-numeric: tabular-nums; border: 1px solid var(--border);
}
/* Minus rot, plus gruen getoent - die Seite entscheidet, nicht das Lesen der Zahl */
.tk-step-row button.minus { background: rgba(214, 90, 90, 0.16); color: var(--bad); border-color: rgba(214, 90, 90, 0.45); }
.tk-step-row button.plus { background: rgba(63, 191, 111, 0.14); color: var(--good); border-color: rgba(63, 191, 111, 0.45); }
.tk-step-row button.minus:hover { background: rgba(214, 90, 90, 0.28); }
.tk-step-row button.plus:hover { background: rgba(63, 191, 111, 0.26); }
/* Zwischen -1 und +1 etwas Luft: die Mitte trennt die beiden Seiten */
.tk-step-row button:nth-child(4) { margin-left: 0.6rem; }
.tk-step-row button.holding { filter: brightness(1.3); }
.tk-step-hint { text-align: center; font-size: 0.82rem; margin: 0.5rem 0 0; }

/* Angreifer -> Verteidiger */
.tk-versus { flex: 0 1 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 0.75rem; }
.vs-side { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; min-width: 0; text-align: center; }
.vs-art { display: flex; gap: 4px; width: 100%; max-width: 22rem; border-radius: 10px; overflow: hidden; aspect-ratio: 2.2 / 1; max-height: 20vh; background: var(--hover); }
.vs-art img { flex: 1 1 0; min-width: 0; height: 100%; object-fit: cover; transition: opacity 0.15s ease, filter 0.15s ease; }
.vs-art img.dim { opacity: 0.3; filter: grayscale(0.7); }
/* Ohne Commander: ein kleiner Kreis mit dem Anfangsbuchstaben statt einer grossen leeren Flaeche */
.vs-art.none { width: clamp(2.6rem, 9vmin, 4rem); height: clamp(2.6rem, 9vmin, 4rem); aspect-ratio: 1; border-radius: 50%;
    align-items: center; justify-content: center; font-size: clamp(1.2rem, 4vmin, 1.8rem); font-weight: 700; color: var(--muted); }
.vs-art:has(img.art-missing:only-child) { display: none; }
.vs-name { font-size: 1.15rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-cmd { font-size: 0.85rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-side.defender .vs-name { color: var(--bad); }
.vs-arrow { font-size: clamp(2rem, 7vmin, 3.5rem); color: var(--accent); font-weight: 700; }
/* Quer gehaltenes Handy (wenig Hoehe): Commander-Zeile weg, Abstaende knapper - der Dialog
   scrollt zur Not, aber nichts darf sich ueberlappen */
@media (max-height: 520px) {
    .tk-dialog.full { padding: 0.6rem 1rem; }
    .vs-cmd, .tk-step-hint, .tk-stage-label { display: none; }
    .vs-name { font-size: 1rem; }
    .tk-dialog.full .tk-modes { margin: 0.35rem 0; }
    .tk-dialog.full .tk-modes button { padding: 0.45rem 0.4rem; }
    .tk-dialog.full .tk-dialog-actions { margin-top: 0.5rem; }
    .tk-dialog.full .tk-check { margin: 0.4rem 0 0; }
    .tk-stage { padding: 0; gap: 0.1rem; }
    .vs-art { max-height: 15vh; }
    .tk-fromto { font-size: clamp(2.4rem, 13vmin, 9rem); }
    .tk-step-row button { padding: 0.6rem 0.2rem; }
    .tk-dialog.full .tk-dialog-actions button { padding-top: 0.6rem; padding-bottom: 0.6rem; }
}

/* Game Log (Hub) */
.tk-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; list-style: none; margin: 0.6rem 0 0; padding: 0;
    border-top: 1px solid var(--border); }
.tk-log li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.75rem; padding: 0.55rem 0.2rem; border-bottom: 1px solid var(--border); font-size: 1rem; }
.tk-log .log-when { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.85rem; padding-top: 0.1rem; }
.tk-log li:first-child .log-text { font-weight: 600; }
.tk-log .log-life .log-text, .tk-log .log-cmd_damage .log-text, .tk-log .log-mass_damage .log-text { color: var(--text); }
.tk-log .log-eliminate .log-text { color: var(--bad); }
.tk-log .log-end_turn .log-text, .tk-log .log-timer_pause .log-text, .tk-log .log-timer_resume .log-text { color: var(--muted); }
.tk-log .log-award .log-text, .tk-log .log-extra_turn .log-text { color: var(--magenta); }

/* Lifelink im Angriffs-Dialog: Umschalter in Lila (wie Extra-Zug/Awards), an = gefuellt mit Leuchten */
.tk-ll-row { flex: 0 0 auto; display: flex; align-items: center; gap: 0.75rem; margin: 0.65rem 0 0.15rem; min-width: 0; }
.tk-ll-row .muted { font-size: 0.85rem; min-width: 0; }
.tk-toggle {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1.1rem 0.5rem 0.75rem; border-radius: 999px; font-weight: 700; font-size: 1rem;
    background: rgba(191, 91, 158, 0.12); color: var(--magenta); border: 1.5px solid var(--magenta);
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.tk-toggle:hover { background: rgba(191, 91, 158, 0.24); color: var(--magenta); }
.tk-toggle .tg-dot { width: 0.95rem; height: 0.95rem; border-radius: 50%; border: 2px solid currentColor; flex: 0 0 auto; }
.tk-toggle[aria-pressed="true"] { background: var(--magenta); color: #fff; box-shadow: 0 0 0 3px rgba(191, 91, 158, 0.3), 0 0 16px rgba(191, 91, 158, 0.45); }
.tk-toggle[aria-pressed="true"] .tg-dot { background: #fff; border-color: #fff; }
@media (max-height: 520px) { .tk-ll-row { margin: 0.4rem 0 0; } .tk-toggle { padding: 0.35rem 0.9rem 0.35rem 0.6rem; } }

/* Sitzordnung im Timer-Dialog (Zugreihenfolge ab dem Startspieler) */
/* Zwei Spalten, sobald Platz ist (Zeile fuer Zeile gelesen: 1 2 / 3 4) - sonst muss man auf
   einem quer gehaltenen Handy zum Start-Knopf scrollen */
#s-timer { width: min(44rem, 94vw); max-width: 94vw; }
.tk-seat-order { list-style: none; margin: 0.4rem 0 0.9rem; padding: 0; display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 0.35rem 0.5rem; }
.tk-so-hint { font-size: 0.82rem; margin: -0.2rem 0 0; }
.tk-seat-order li { display: grid; grid-template-columns: 2rem 4.4rem minmax(0, 1fr) auto; align-items: center; gap: 0.65rem;
    padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 10px; background: var(--input-bg); }
.tk-seat-order .so-pos { width: 1.9rem; height: 1.9rem; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.95rem; font-variant-numeric: tabular-nums; border: 1px solid var(--border); color: var(--muted);
    background: var(--card); cursor: pointer; }
.tk-seat-order .so-pos:hover { border-color: var(--good); color: var(--good); }
.tk-seat-order .so-move { display: inline-flex; gap: 0.25rem; }
.tk-seat-order .so-move button { width: 2rem; height: 2rem; padding: 0; border-radius: 8px; font-size: 1.3rem; line-height: 1;
    background: var(--card); color: var(--accent); border: 1px solid var(--border); }
.tk-seat-order .so-move button:disabled { opacity: 0.25; }
.tk-actions-right { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.tk-seat-order li.first { border-color: var(--good); }
.tk-seat-order li.first .so-pos, .tk-seat-order li.first .so-pos:hover { background: var(--good); border-color: var(--good); color: #0b1018;
    box-shadow: 0 0 0 3px rgba(63, 191, 111, 0.3); }
.tk-seat-order .so-art { display: flex; gap: 2px; width: 4.4rem; aspect-ratio: 2.2 / 1; border-radius: 6px; overflow: hidden; background: var(--hover); }
.tk-seat-order .so-art img { flex: 1 1 0; min-width: 0; height: 100%; object-fit: cover; }
.tk-seat-order .so-art:has(img.art-missing:only-child) { visibility: hidden; }
.tk-seat-order .so-art.none { visibility: hidden; }
.tk-seat-order .so-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tk-seat-order .so-text strong, .tk-seat-order .so-text .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-seat-order .so-text .muted { font-size: 0.82rem; }
.tk-timer-title { margin-top: 0.2rem; }

/* "Install as app" (Startseite) und die Anleitung je Browser/OS (install.js) */
.tk-install-row { display: flex; justify-content: center; margin: 0.4rem 0 0.2rem; }
.tk-install-btn { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 1rem; font-weight: 600; padding: 0.6rem 1.3rem; border-radius: 999px; }
.tk-install-btn svg { width: 1.25rem; height: 1.25rem; }
.tk-dialog.tk-install { width: min(32rem, 94vw); padding: 1.4rem 1.3rem 1.2rem; position: relative; }
.tk-install .ig-close { position: absolute; top: 0.5rem; right: 0.6rem; background: none; border: none; color: var(--muted);
    font-size: 1.7rem; line-height: 1; padding: 0.2rem 0.5rem; }
.tk-install .ig-close:hover { color: var(--text); background: none; }
.tk-install .ig-head { text-align: center; }
.tk-install .ig-head > svg { width: 2.6rem; height: 2.6rem; color: var(--accent); }
.tk-install .ig-head h2 { margin: 0.35rem 0 0.4rem; font-size: 1.5rem; }
.tk-install .ig-head p { margin: 0 0 0.6rem; }
.tk-install .ig-now { margin: 0.5rem 0 0.2rem; }
.tk-install .ig-now button { width: 100%; }
.tk-install .ig-or { margin: 0.6rem 0 0.4rem; font-size: 0.85rem; }
.tk-install .ig-or:empty { display: none; }
.tk-install .ig-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.tk-install .ig-steps li { display: flex; align-items: flex-start; gap: 0.8rem; padding: 0.75rem 0.85rem;
    border: 1px solid var(--border); border-radius: 12px; background: var(--input-bg); line-height: 1.45; }
.tk-install .ig-num { flex: 0 0 auto; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 2px solid var(--accent);
    color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.tk-install .ig-key { display: inline-flex; align-items: center; gap: 0.25rem; vertical-align: middle; padding: 0.1rem 0.35rem;
    border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); white-space: nowrap; }
.tk-install .ig-key .ig-ico { width: 1rem; height: 1rem; }
.tk-install .ig-note { margin: 0.8rem 0 0; font-size: 0.85rem; text-align: center; }

/* Haekchen mit Text (Registrierung) */
.tk-check { display: flex; align-items: center; gap: 0.5rem; margin: 0.7rem 0 0.2rem; font-size: 1rem; cursor: pointer; }
.tk-check input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); flex: 0 0 auto; }
.tk-check .muted { font-size: 0.82rem; }


/* Finish: Spieler/Deck und WIN/LOSE/DRAW in EINER Zeile */
.tk-finish { max-width: 680px; }
.tk-results li { flex-wrap: nowrap; gap: 0.6rem; padding: 0.6rem 0; }
.tk-result-who { display: flex; align-items: center; gap: 0.6rem; flex: 1 1 auto; min-width: 0; }
.tk-result-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tk-result-text strong, .tk-result-text .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-result-text .muted { font-size: 0.85rem; }
img.row-art { width: 4.6rem; height: 2.1rem; border-radius: 6px; flex: 0 0 auto; }
.tk-results .tk-segment { flex: 0 0 auto; flex-wrap: nowrap; margin-left: 0; }
.tk-results .tk-segment button { min-width: 3.6rem; padding: 0.6rem 0.45rem; font-size: 0.85rem; }

/* ---------- Schmale Geraete ---------- */
@media (max-width: 480px) {
    .tk-bar button { padding: 0.45rem 0.6rem; font-size: 0.85rem; }
    .hub-ico { width: 3.1rem; height: 3.1rem; font-size: 1.3rem; }
    .hub-ico svg { width: 1.35rem; height: 1.35rem; }
    .hub-pill { padding: 0.65rem 1.3rem; font-size: 1rem; }
    .chip { padding: 0.3rem 0.55rem; font-size: 0.8rem; }
    .seat-inner { padding: 0.35rem 0.45rem; }
    .seat-fx-panel { padding: 0.5rem; }
    .fx-item { padding: 0.45rem 0.55rem; gap: 0.5rem; font-size: 0.9rem; min-height: 2.75rem; }
    .fx-item .fx-ico { width: 1.35rem; height: 1.35rem; }
    .seat-acts { min-height: 1.9rem; }
    .seat-acts .seat-act-btn { padding: 0.25rem 0.8rem; font-size: 0.85rem; min-height: 1.9rem; }
    .seat-end { padding: 0.5rem 1.2rem; font-size: 0.95rem; }
    .tk-setup .seat-inner select, .tk-setup .seat-inner input { font-size: 0.85rem; padding: 0.35rem 0.5rem; }
}
/* ---------- Schmale Sitze (Container "seat", 2026-10-10) ----------
   Unter 420 px Sitzbreite (Handy hochkant mit 4 Spielern: ~230 px):
   - Mulligan: Karten und Knoepfe skalieren mit der Sitzbreite (cqw) und bleiben in EINER Reihe -
     vorher liefen "Mulligan" und "Keep 7" ueber den Rand.
   - Chip-Zeile (Gift, Eliminieren, Awards, Tracker): eine Reihe statt Umbruch.
   - Award-Panel: nur die Bilder (Name und Beschreibung im Tooltip) - der Text quetschte sich
     zeichenweise neben den Streifen.
   Die grossen Bildschirme (Block "Mulligan am grossen Bildschirm") bleiben unberuehrt, ihre
   Sitze sind breiter. */
@container seat (max-width: 420px) {
    .mull { gap: 0.35rem; padding: 0.35rem; }
    .mull-head { font-size: clamp(0.72rem, 5cqw, 0.95rem); }
    .mull-status { font-size: clamp(0.7rem, 4.8cqw, 0.9rem); }
    .mull-cards { gap: 2px; }
    .card-back { width: clamp(16px, 11.5cqw, 52px); }
    .mull-actions { gap: 0.3rem; max-width: 100%; flex-wrap: nowrap; }
    .mull-actions button { flex: 0 1 auto; min-width: 0; white-space: nowrap;
        font-size: clamp(0.72rem, 5.6cqw, 1rem); padding: 0.45rem clamp(0.4rem, 3.6cqw, 1rem); }
    .mull-actions .mull-back { padding-inline: clamp(0.35rem, 2.6cqw, 0.7rem); }

    .seat-chips { flex-wrap: nowrap; gap: 0.2rem; }
    .seat-chips .chip { flex: 0 0 auto; padding: 0.25rem 0.42rem; min-height: 1.85rem; font-size: 0.78rem; gap: 0.2rem; }
    .seat-chips .fx-ico { width: 1rem; height: 1rem; }
    .seat-chips .cmd-taken { flex: 0 1 auto; min-width: 0; overflow: hidden; gap: 0.2rem; }
    .seat-chips .cmd-tile { width: 2.5rem; height: 1.7rem; flex: 0 0 auto; }

    .aw-list { grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr)); }
    .aw-item { justify-content: center; padding: 0.3rem; min-height: 0; }
    .aw-item .fx-text { display: none; }
    .aw-item .aw-strip { width: 100%; }
    .aw-received { font-size: 0.75rem; }
}
@media (max-height: 480px) {
    .seat-life .life { font-size: clamp(2rem, 14vmin, 5rem); }
    .seat-life .half { font-size: clamp(1.4rem, 5vmin, 2.4rem); }
}

/* --- Laufende Spiele der Playgroup (Startseite) + Uebernahme-Hinweis im Spiel --- */
.tk-live-intro { font-size: 0.85rem; margin: 0 0 0.2rem; }
.tk-live-who { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
/* Die Commander-Streifen aller Sitze nebeneinander - schmaler als in den Ergebniszeilen,
   weil hier bis zu sechs davon in eine Zeile muessen */
.tk-live-art { display: flex; gap: 2px; flex: 0 0 auto; }
.tk-live-art img.row-art { width: 2.4rem; height: 2.1rem; border-radius: 4px; }
.tk-live-games .tk-result-text .muted { white-space: normal; }
/* Dezent: das Spiel laeuft weiter, der Hinweis darf nichts verdecken */
.tk-live-note {
    font-size: 0.75rem; color: var(--muted); border: 1px solid var(--border);
    border-radius: 999px; padding: 0.15rem 0.5rem; white-space: nowrap;
}
@media (max-width: 640px) {
    .tk-live-art img.row-art { width: 1.6rem; height: 1.6rem; }
    .tk-live-note { display: none; }
}

/* ---------- Player Awards (V49, game/awards.js + screens/game.js) ---------- */
/* Knopf direkt INNEN neben dem Tracker-Knopf: er steht im DOM vor .seat-fx und uebernimmt
   dessen margin:auto - so liegt er in allen vier Vierteln (auch den gespiegelten) zwischen
   Chips und Tracker-Knopf. Ohne Awards (hidden) bekommt der Tracker-Knopf seinen Rand zurueck. */
.seat-aw { margin-left: auto; gap: 0.25rem; color: var(--warn); }
.seat-aw:not([hidden]) + .seat-fx { margin-left: 0; margin-right: 0; }
.tk-game .seat.rot-180[data-half=right] .seat-aw,
.tk-game .seat:not(.rot-180)[data-half=left] .seat-aw { margin-left: 0; margin-right: auto; }
.tk-game .seat.rot-180[data-half=right] .seat-aw:not([hidden]) + .seat-fx,
.tk-game .seat:not(.rot-180)[data-half=left] .seat-aw:not([hidden]) + .seat-fx { margin-right: 0; }
.seat-aw .aw-ico { color: var(--warn); }
.seat-aw.has-aw { border-color: var(--warn); background: rgba(224, 176, 74, 0.12); }
.aw-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.seat-aw.aw-bump { animation: aw-bump 0.9s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes aw-bump {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(224, 176, 74, 0.9); }
    35% { transform: scale(1.45); box-shadow: 0 0 0 10px rgba(224, 176, 74, 0.35); }
    100% { transform: scale(1); box-shadow: 0 0 0 18px rgba(224, 176, 74, 0); }
}

/* Panel: wie die Tracker, Eintraege mit dem zugeschnittenen Streifen statt Icon */
.aw-list { grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); }
.aw-item .fx-state { white-space: normal; }
.aw-strip {
    display: block; flex: 0 0 auto; width: 5.4rem; border-radius: 6px; background-repeat: no-repeat;
    background-color: var(--hover); border: 1px solid var(--border);
}
.aw-strip-blank { display: inline-flex; align-items: center; justify-content: center; aspect-ratio: 2.2; color: var(--warn); }
.aw-strip-blank svg { width: 1.4rem; height: 1.4rem; }
.aw-received { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; font-size: 0.85rem; }
.aw-got { color: var(--warn); }

/* Die schwebende Karte im Quadranten des Gebers */
.aw-float {
    position: absolute; inset: 0; z-index: 3;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(10, 13, 20, 0.15), rgba(10, 13, 20, 0.6));
}
.aw-float-stage {
    position: relative; height: min(62%, 15rem); aspect-ratio: 488 / 680;
    animation: aw-hover 3.2s ease-in-out infinite; perspective: 600px;
}
.aw-float-card {
    position: relative; z-index: 1; width: 100%; height: 100%; pointer-events: auto; touch-action: none; cursor: grab;
    animation: aw-sway 4.6s ease-in-out infinite; transform-style: preserve-3d;
}
.aw-float-card:active { cursor: grabbing; }
.aw-card { display: block; width: 100%; height: 100%; border-radius: 4.75% / 3.4%; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6); }
.aw-card-blank {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
    background: linear-gradient(160deg, #2a2312, #131a26 60%, #2a1a26); border: 2px solid var(--warn);
    color: var(--warn); font-weight: 700; text-align: center; padding: 0.5rem; font-size: 1.1rem;
}
.aw-blank-ico { width: 45%; }
.aw-blank-ico svg { width: 100%; height: auto; }
.aw-float-glow {
    position: absolute; inset: -18%; border-radius: 50%; z-index: 0; pointer-events: none;
    background: radial-gradient(circle, rgba(242, 216, 140, 0.55), rgba(191, 91, 158, 0.25) 45%, transparent 70%);
    filter: blur(6px); animation: aw-glow 2.4s ease-in-out infinite;
}
.aw-sparkle {
    position: absolute; z-index: 2; width: 0.7rem; height: 0.7rem; pointer-events: none;
    background: radial-gradient(circle, #fff 0 18%, rgba(242, 216, 140, 0.9) 30%, transparent 62%);
    clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
    animation: aw-twinkle 1.8s ease-in-out infinite;
}
.aw-sparkle.s1 { top: -6%; left: -10%; animation-delay: 0s; }
.aw-sparkle.s2 { top: 18%; right: -14%; animation-delay: 0.45s; width: 1rem; height: 1rem; }
.aw-sparkle.s3 { bottom: 4%; left: -16%; animation-delay: 0.9s; }
.aw-sparkle.s4 { bottom: -8%; right: -6%; animation-delay: 1.35s; width: 0.9rem; height: 0.9rem; }
/* Hinweis + X in EINER Zeile unter der Karte: die Ecken des Sitzes taugen nicht - die innere
   liegt unter dem Hub, die aeusseren tragen Name und Chips */
.aw-float-hint {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-size: 0.85rem; color: var(--text); background: rgba(10, 13, 20, 0.8); border: 1px solid var(--warn);
    border-radius: 999px; padding: 0.15rem 0.2rem 0.15rem 0.75rem; white-space: nowrap;
}
.aw-float-x {
    pointer-events: auto; flex: 0 0 auto;
    width: 1.9rem; height: 1.9rem; padding: 0; border-radius: 50%; font-size: 1.25rem; line-height: 1;
    background: var(--input-bg); color: var(--muted); border: 1px solid var(--border);
}
.aw-float-x:hover { background: var(--hover); color: var(--text); }
.aw-float.dragging .aw-float-stage { opacity: 0.2; animation-play-state: paused; }
.aw-float.dragging .aw-float-hint { visibility: hidden; }
.aw-float.returning .aw-float-stage { animation: aw-return 0.5s cubic-bezier(.3, 1.6, .5, 1), aw-hover 3.2s ease-in-out 0.5s infinite; }
@keyframes aw-hover {
    0%, 100% { transform: translateY(-5%) rotate(-2.5deg); }
    50% { transform: translateY(5%) rotate(2.5deg); }
}
@keyframes aw-sway {
    0%, 100% { transform: rotateY(-14deg) rotateX(4deg); }
    50% { transform: rotateY(14deg) rotateX(-4deg); }
}
@keyframes aw-glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes aw-twinkle {
    0%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.2) rotate(90deg); }
}
@keyframes aw-return { from { transform: scale(0.6); opacity: 0.3; } to { transform: scale(1); opacity: 1; } }

/* Ziehen: der Geist folgt dem Finger in der Drehung des eigenen Sitzes, Ziel leuchtet golden */
.aw-ghost {
    position: fixed; z-index: 150; pointer-events: none; width: 7.5rem; aspect-ratio: 488 / 680;
    transform: translate(-50%, -50%) rotate(-7deg) scale(1.05);
    filter: drop-shadow(0 0 14px rgba(242, 216, 140, 0.85)) drop-shadow(0 14px 22px rgba(0, 0, 0, 0.7));
}
.aw-ghost.rot-180 { transform: translate(-50%, -50%) rotate(173deg) scale(1.05); }
.seat.aw-hot { border-color: var(--warn); box-shadow: 0 0 0 3px rgba(224, 176, 74, 0.6), inset 0 0 60px rgba(224, 176, 74, 0.25); }

/* Die Feier: Vollbild, Karte in der Mitte, Text oben (fuer die gegenueber) und unten */
.aw-celebrate {
    position: fixed; inset: 0; z-index: 1000; overflow: hidden;
    display: grid; grid-template-rows: 1fr auto 1fr; justify-items: center; align-items: center;
    padding: max(0.6rem, env(safe-area-inset-top)) 1rem max(0.6rem, env(safe-area-inset-bottom));
    background: radial-gradient(ellipse at center, rgba(40, 30, 10, 0.88), rgba(5, 7, 12, 0.96) 70%);
    opacity: 0; transition: opacity 0.35s; perspective: 1200px; cursor: default;
    user-select: none; -webkit-user-select: none;
}
.aw-celebrate.show { opacity: 1; }
.aw-celebrate.closable { cursor: pointer; }
.aw-celebrate.leaving { background: transparent; transition: background 0.6s; }
.aw-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.aw-rays {
    position: absolute; left: 50%; top: 50%; width: 170vmax; height: 170vmax; z-index: 0; pointer-events: none;
    transform: translate(-50%, -50%); opacity: 0; transition: opacity 0.6s;
    background: repeating-conic-gradient(from 0deg, rgba(242, 216, 140, 0.16) 0deg 9deg, transparent 9deg 22.5deg);
    -webkit-mask-image: radial-gradient(circle, #000 0 18%, transparent 52%);
    mask-image: radial-gradient(circle, #000 0 18%, transparent 52%);
}
.aw-celebrate.landed .aw-rays { opacity: 1; animation: aw-spin 18s linear infinite; }
.aw-celebrate.leaving .aw-rays, .aw-celebrate.leaving .aw-banner, .aw-celebrate.leaving .aw-tap { opacity: 0; transition: opacity 0.3s; }
@keyframes aw-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.aw-hero-wrap {
    grid-row: 2; position: relative; z-index: 2;
    height: min(56dvh, 74vw * 680 / 488); aspect-ratio: 488 / 680; transform-style: preserve-3d;
}
.aw-hero { position: relative; width: 100%; height: 100%; }
.aw-hero-card { display: block; width: 100%; height: 100%; border-radius: 4.75% / 3.4%; box-shadow: 0 0 40px rgba(242, 216, 140, 0.55), 0 24px 60px rgba(0, 0, 0, 0.8); }
.aw-shine {
    position: absolute; inset: 0; border-radius: 4.75% / 3.4%; pointer-events: none; overflow: hidden;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.55) 48%, transparent 60%);
    background-size: 260% 100%; background-position: 150% 0; mix-blend-mode: screen;
}
.aw-celebrate.landed .aw-shine { animation: aw-shine 2.2s ease-in-out 0.2s infinite; }
@keyframes aw-shine { to { background-position: -110% 0; } }
/* Der Tanz: Hueftschwung, Huepfer, Pirouette - im Takt der Fanfare (ca. 0,6 s je Schritt) */
.aw-hero.dance { animation: aw-dance 2.4s ease-in-out 0.1s infinite; transform-origin: 50% 85%; }
@keyframes aw-dance {
    0% { transform: translate(0, 0) rotate(0) scale(1, 1); }
    8% { transform: translate(-6%, -2%) rotate(-8deg) scale(1.03, 0.97); }
    16% { transform: translate(0, -9%) rotate(0) scale(0.96, 1.06); }
    25% { transform: translate(6%, -2%) rotate(8deg) scale(1.03, 0.97); }
    33% { transform: translate(0, 0) rotate(0) scale(1.06, 0.93); }
    42% { transform: translate(-4%, -6%) rotate(-12deg) scale(1, 1); }
    50% { transform: translate(4%, -6%) rotate(12deg) scale(1, 1); }
    58% { transform: translate(0, 0) rotate(0) scale(1.06, 0.93); }
    70% { transform: translate(0, -12%) rotateY(180deg) scale(1, 1.04); }
    82% { transform: translate(0, -4%) rotateY(360deg) scale(1, 1); }
    90% { transform: translate(0, 0) rotate(0) scale(1.05, 0.95); }
    100% { transform: translate(0, 0) rotate(0) scale(1, 1); }
}
.aw-banner {
    position: relative; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
    text-align: center; max-width: 92vw; opacity: 0; transform: scale(0.6);
    transition: opacity 0.4s, transform 0.5s cubic-bezier(.3, 1.6, .5, 1);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}
.aw-banner-top { grid-row: 1; align-self: end; rotate: 180deg; }
.aw-banner-bottom { grid-row: 3; align-self: start; }
.aw-celebrate.landed .aw-banner { opacity: 1; transform: scale(1); }
.aw-banner-who { font-size: clamp(1.3rem, 4.2vmin, 2.4rem); font-weight: 800; color: var(--text); }
.aw-banner-arrow { color: var(--warn); }
.aw-banner-what { font-size: clamp(1rem, 3vmin, 1.6rem); color: var(--muted); }
.aw-banner-what strong {
    background: linear-gradient(90deg, #f7e7a8, #e0b04a, #fff3c4, #e0b04a);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    background-size: 200% 100%; animation: aw-gold 2.5s linear infinite;
}
@keyframes aw-gold { to { background-position: -200% 0; } }
.aw-tap {
    position: absolute; z-index: 4; right: 1rem; bottom: max(0.6rem, env(safe-area-inset-bottom)); margin: 0;
    font-size: 0.8rem; color: var(--muted); opacity: 0; transition: opacity 0.4s;
}
.aw-celebrate.closable .aw-tap { opacity: 0.8; }

@media (prefers-reduced-motion: reduce) {
    .aw-float-stage, .aw-float-card, .aw-float-glow, .aw-sparkle, .aw-hero.dance,
    .aw-celebrate.landed .aw-rays, .aw-celebrate.landed .aw-shine, .aw-banner-what strong { animation: none; }
}

/* Setup: Auswahl der Player Awards (Tabelle unter "Player awards") */
.tk-award-pick { display: grid; gap: 0.4rem; }
.tk-award-pick > p { margin: 0; font-size: 0.85rem; }
.tk-award-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tk-award-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.8rem; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border); }
.tk-award-table td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tk-award-table tbody tr { cursor: pointer; opacity: 0.55; transition: opacity 0.15s, background 0.15s; }
.tk-award-table tbody tr.on { opacity: 1; }
.tk-award-table tbody tr:hover { background: var(--hover); }
.tk-award-table .aw-col-check { width: 2rem; text-align: center; }
.tk-award-table input[type=checkbox] { width: 1.15rem; height: 1.15rem; accent-color: var(--warn); }
.aw-name-cell { display: flex; align-items: center; gap: 0.6rem; color: var(--text); white-space: nowrap; }
.aw-name-cell .aw-strip { width: 6.5rem; }
.tk-award-table .aw-desc { color: var(--muted); font-size: 0.85rem; }
@media (max-width: 560px) {
    .aw-name-cell { flex-direction: column; align-items: flex-start; gap: 0.3rem; white-space: normal; }
    .aw-name-cell .aw-strip { width: 5rem; }
}
.tk-award-got { color: var(--warn); font-size: 0.85rem; }
