/* ============================================================
   Doppelkopf — Familien-Styleguide (Tokens kommen aus tokens.css)
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 15px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { min-height: 100vh; min-height: 100dvh; }

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-4) var(--space-8);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

button, input, select, textarea, [tabindex]:not([tabindex="-1"]) { outline: none; }
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: 'Figtree', system-ui, sans-serif;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.01em;
}
h1 { font-size: 32px; line-height: 40px; font-weight: 800; }
h2 { font-size: 26px; line-height: 34px; font-weight: 700; }
h3 { font-size: 21px; line-height: 28px; font-weight: 700; }
h4 { font-size: 18px; line-height: 24px; font-weight: 600; }

p { margin: 0; }
.text-muted   { color: var(--text-muted); }
.text-small   { font-size: 13px; line-height: 20px; }
.text-label {
  font-size: 12px; line-height: 16px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}

/* ============================================================
   App-Header (Styleguide 7.3)
   ============================================================ */
.app-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}
.app-header-title { display: flex; align-items: center; gap: var(--space-2); min-width: 0; flex: 1 1 auto; }
.app-header-icon  { display: inline-flex; flex-shrink: 0; }
.app-header-icon img { width: 28px; height: 28px; border-radius: 7px; display: block; }
.app-header-title h1 {
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 22px; line-height: 28px; font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-header-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.app-header-status {
  position: absolute; bottom: -9px; right: 0;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 10px; line-height: 14px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap; pointer-events: none;
  transition: opacity 0.25s, background-color 0.2s, border-color 0.2s, color 0.2s;
}
.app-header-status[hidden]                 { display: none; }
.app-header-status[data-status="offline"]  { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
.app-header-status[data-status="pending"]  { background: var(--info-bg);    border-color: var(--info-border);    color: var(--info-text); }
.app-header-status[data-status="saved"]    { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.app-header-status[data-status="error"]    { background: var(--error-bg);   border-color: var(--error-border);   color: var(--error-text); }

/* ============================================================
   Pill-Buttons (Styleguide 7.1)
   ============================================================ */
.btn-pill {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 0 var(--space-3);
  min-height: 44px; min-width: 44px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-1);
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background-color 0.15s;
}
.btn-pill:hover  { background: var(--surface-hover); }
.btn-pill:active { background: var(--surface-active); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  font-family: inherit; font-size: 15px; font-weight: 600; line-height: 24px;
  padding: var(--space-3) var(--space-5); min-height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary  { background: var(--action); color: var(--on-action); border-color: var(--action); }
.btn-primary:hover:not(:disabled)  { background: var(--action-hover); border-color: var(--action-hover); }
.btn-accent   { background: var(--accent-solid); color: var(--on-accent); border-color: var(--accent-solid); }
.btn-accent:hover:not(:disabled)   { background: var(--a-800); border-color: var(--a-800); }
[data-theme="dark"]
  .btn-accent:hover:not(:disabled) { background: var(--a-200); border-color: var(--a-200); }
.btn-ghost    { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled)    { background: var(--surface-hover); }
.btn-block    { width: 100%; }

.btn-small {
  font-size: 13px; font-weight: 600; line-height: 20px;
  padding: var(--space-2) var(--space-3); min-height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-1);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn-small:hover:not(:disabled)        { background: var(--surface-hover); }
.btn-small.danger                      { color: var(--error-text); border-color: var(--error-border); }
.btn-small.danger:hover:not(:disabled) { background: var(--error); color: var(--n-0); border-color: var(--error); }
[data-theme="dark"]
  .btn-small.danger:hover:not(:disabled) { color: var(--n-900); }

.icon-btn {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent;
  cursor: pointer; flex-shrink: 0;
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover         { background: var(--surface-hover); color: var(--text); }
.icon-btn.danger        { color: var(--error-text); }
.icon-btn.danger:hover  { background: var(--error-bg); }

/* ============================================================
   Inputs
   ============================================================ */
label.field { display: flex; flex-direction: column; gap: var(--space-1); }
label.field > span {
  font-size: 12px; line-height: 16px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}
.input {
  font-family: inherit; font-size: 16px; line-height: 24px;
  padding: var(--space-3) var(--space-4);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  min-height: 48px; width: 100%;
}
.input::placeholder { color: var(--text-disabled); }
.input:focus-visible { border-color: var(--action); }
.input-code {
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 28px; line-height: 36px; font-weight: 700;
  letter-spacing: 0.18em; text-align: center; text-transform: uppercase;
  padding: var(--space-3); min-height: 60px;
}

/* ============================================================
   Cards + Stacks
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--space-4); }
.stack    > * + * { margin-top: var(--space-3); }
.stack-lg > * + * { margin-top: var(--space-4); }

/* ============================================================
   Home / Hero
   ============================================================ */
.home-hero { text-align: center; margin-bottom: var(--space-4); }
.home-hero h2 { margin-bottom: var(--space-2); }
.home-hero p  { color: var(--text-muted); font-size: 17px; line-height: 26px; }

.divider-or {
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--text-muted);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  margin: var(--space-4) 0;
}
.divider-or::before, .divider-or::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px; line-height: 22px;
  border: 1px solid;
}
.alert-error { background: var(--error-bg);   border-color: var(--error-border);   color: var(--error-text); }
.alert-info  { background: var(--info-bg);    border-color: var(--info-border);    color: var(--info-text); }

.history-list { list-style: none; padding: 0; margin: 0; }
.history-item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }
.history-link {
  flex: 1;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: var(--space-2);
  background: transparent; border: 0;
  color: var(--text);
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.history-link:hover { background: var(--surface-hover); }
.history-name { font-weight: 600; font-size: 15px; line-height: 22px; }
.history-code {
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 12px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-muted);
}

/* ============================================================
   Session-Heading
   ============================================================ */
.session-heading h2.editable {
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  display: inline-block;
}
.session-heading h2.editable:hover {
  border-bottom-color: var(--border-strong);
}
.code-row {
  display: flex; align-items: center; gap: var(--space-3);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}
.code-value-inline {
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 22px; font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--action);
}

/* ============================================================
   Player-Manager
   ============================================================ */
.player-mgr-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--space-2);
}
.player-list { list-style: none; padding: 0; margin: 0; }
.player-list li {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}
.player-list li:last-child { border-bottom: none; }
.player-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--p-100); color: var(--p-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
[data-theme="dark"] .player-avatar { background: var(--p-700); color: var(--p-100); }
.player-name {
  flex: 1;
  font-weight: 500;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}
.player-name:hover { background: var(--surface-hover); }
.player-add {
  display: flex; gap: var(--space-2);
  margin-top: var(--space-3);
}
.player-add .input { flex: 1; min-height: 44px; font-size: 15px; }

/* Pflicht-Solo-Status — kleine Pille rechts vom Spielernamen.
   Grün wenn erledigt, gedämpft wenn noch offen. */
.pflicht-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; line-height: 14px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
}
.pflicht-pill.done {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}
.pflicht-pill.open {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-muted);
}

/* ============================================================
   Score-Tabelle
   ============================================================ */
.score-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.score-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.score-table thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}
.score-table thead th.th-no { text-align: left; width: 60px; }
.score-table tbody tr.round-row { cursor: pointer; transition: background-color 0.1s; }
.score-table tbody tr.round-row:hover { background: var(--surface-hover); }
.score-table tbody tr.round-row.is-expanded { background: var(--surface-hover); }
.score-table tbody td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-size: 15px;
  line-height: 22px;
}
.score-table tbody td.td-no {
  display: flex; align-items: center; gap: var(--space-1);
  text-align: left;
  font-weight: 600;
  color: var(--text-2);
}
.round-chevron { display: inline-flex; color: var(--text-muted); }
.round-no { font-weight: 700; color: var(--text); }
.round-type {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-left: 4px;
}
.td-pts { font-weight: 600; }
.td-pos { color: var(--success-text); }
.td-neg { color: var(--error-text); }
.td-out { color: var(--text-disabled); }

.total-row td {
  background: var(--surface-2);
  border-top: 2px solid var(--border-strong);
  border-bottom: none;
  font-weight: 800;
  font-size: 16px;
  padding: var(--space-3);
}
.total-row td.td-no { font-family: 'Figtree', system-ui, sans-serif; font-size: 18px; }

.round-detail-row td {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: var(--space-3) var(--space-4);
}

/* Kompakter Header über der Detail-Liste — Spieltyp, Sieger, Spielwert
   als Pills, damit das Wichtigste auf einen Blick erfassbar ist. */
.rd-header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.rd-pill {
  font-size: 12px; line-height: 18px; font-weight: 600;
  padding: 4px 10px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 4px;
}
.rd-pill strong { color: var(--text); font-weight: 800; }
.rd-pill-winner.re strong      { color: var(--action); }
.rd-pill-winner.kontra strong  { color: var(--accent-solid); }
.rd-pill-type {
  background: var(--p-50);
  border-color: var(--p-200);
  color: var(--p-700);
}
[data-theme="dark"] .rd-pill-type {
  background: var(--p-800);
  border-color: var(--p-700);
  color: var(--p-100);
}
.rd-pill-pflicht {
  background: var(--a-50);
  border-color: var(--a-200);
  color: var(--a-700);
}
[data-theme="dark"] .rd-pill-pflicht {
  background: var(--a-900);
  border-color: var(--a-700);
  color: var(--a-200);
}

/* Kurz-Werte in einem 2-Spalten-Grid. Label ist klein oben,
   Wert direkt darunter — vertikales Layout heißt nichts kann mehr
   überlagern, egal wie lang die Beschriftung ist. */
.rd-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-4);
}
.rd-row {
  display: flex; flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rd-row-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
}
.rd-row-value {
  color: var(--text);
  font-size: 14px; line-height: 20px;
  word-break: break-word;
}

/* Aufschlüsselung als eigene Sektion mit einzelnen Chips —
   jede Punkte-Position separat sichtbar statt einer langen Komma-Liste. */
.rd-breakdown-section {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column;
  gap: var(--space-2);
}
.rd-breakdown-chips {
  display: flex; flex-wrap: wrap;
  gap: 6px;
}
.rd-bd-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; line-height: 18px;
  padding: 3px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-2);
  white-space: nowrap;
}
.rd-bd-chip strong {
  color: var(--success-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rd-bd-chip strong.neg { color: var(--error-text); }

.rd-pill-mul {
  color: var(--text-muted);
  margin-left: 2px;
}

.round-detail-actions {
  display: flex; gap: var(--space-2);
  margin-top: var(--space-4);
}

/* ============================================================
   FAB — Neue Runde
   position: fixed am Viewport-Boden, via left:50%+translateX immer
   horizontal zentriert. Die Session-View hat unten padding für den
   FAB-Bereich, sodass die Σ-Zeile nicht vom FAB verdeckt wird.
   ============================================================ */
.fab {
  position: fixed;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  background: var(--action);
  color: var(--on-action);
  border: none;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  min-height: 56px;
  font-size: 16px; font-weight: 700;
  font-family: inherit;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 10;
}
.fab:hover:not(:disabled)  { background: var(--action-hover); transform: translateX(-50%); }
.fab:disabled              { opacity: 0.4; cursor: not-allowed; }

/* Reservierter Raum am unteren Rand der Session-View, sodass der
   fixed-positionierte FAB nichts überdeckt (z.B. die Σ-Summenzeile). */
.view-session {
  padding-bottom: 96px;
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state { text-align: center; padding: var(--space-5) var(--space-4); }

/* ============================================================
   Modal — Neue Runde
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--overlay);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
}
.modal {
  background: var(--surface);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  width: 100%; max-width: 640px;
  max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 600px) {
  .modal {
    border-radius: var(--radius-lg);
    max-height: 86vh; max-height: 86dvh;
  }
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; }
.modal-body {
  padding: var(--space-4);
  overflow-y: auto;
  flex: 1 1 auto;
}
.modal-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  padding: var(--space-3) var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-3);
}
.modal-actions {
  display: flex; gap: var(--space-2); justify-content: flex-end;
}
.modal-actions .btn { flex: 1; max-width: 200px; }

/* ============================================================
   Modal-Form-Bausteine
   ============================================================ */
.field-group { display: flex; flex-direction: column; gap: var(--space-2); }
.field-group + .field-group { margin-top: var(--space-2); }

.chip-row {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.chip {
  font-family: inherit;
  font-size: 13px; font-weight: 600; line-height: 18px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  min-height: 36px;
  display: inline-flex; align-items: center;
  transition: background-color 0.1s, color 0.1s, border-color 0.1s;
}
.chip:hover { background: var(--surface-hover); }
.chip-active {
  background: var(--action);
  color: var(--on-action);
  border-color: var(--action);
}
.chip-active:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
}
.chip-small { font-size: 12px; padding: 4px 10px; min-height: 28px; }
.chip-player { padding-left: 14px; padding-right: 14px; }
.chip-re {
  background: var(--accent-solid);
  color: var(--on-accent);
  border-color: var(--accent-solid);
}
.chip-re:hover {
  background: var(--a-800);
  border-color: var(--a-800);
}
[data-theme="dark"] .chip-re:hover {
  background: var(--a-200);
  border-color: var(--a-200);
}

/* Pflicht-Solo-Toggle: erscheint unter den Spieltyp-Chips, sobald ein
   Solo gewählt ist. Verhält sich wie ein toggleable Button — die innere
   .chk ist rein visuell, der ganze Button reagiert auf Klick. */
.pflicht-toggle {
  display: flex; align-items: center; gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  text-align: left;
  transition: background-color 0.15s, border-color 0.15s;
}
.pflicht-toggle:hover { background: var(--surface-hover); }
.pflicht-toggle.is-active {
  background: var(--a-50);
  border-color: var(--accent-solid);
}
[data-theme="dark"] .pflicht-toggle.is-active {
  background: var(--a-900);
  border-color: var(--accent-solid);
}
.pflicht-toggle .chk {
  pointer-events: none;
  width: 28px; height: 28px;
}
.pflicht-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Augen-Stepper */
.augen-stepper-row {
  display: flex; align-items: stretch;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
}
.stepper-btn-big {
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 16px; font-weight: 700;
  min-width: 44px; min-height: 44px;
  padding: 0 var(--space-2);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.stepper-btn-big:disabled       { opacity: 0.4; cursor: not-allowed; }
.stepper-btn-big:hover:not(:disabled) { background: var(--surface-hover); }
.augen-display {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px var(--space-2);
}
.augen-display-input {
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 28px; font-weight: 800;
  line-height: 32px;
  font-variant-numeric: tabular-nums;
  color: var(--action);
  background: transparent;
  border: none;
  outline: none;
  text-align: center;
  width: 100%;
  padding: 0;
  -moz-appearance: textfield;
  cursor: text;
}
.augen-display-input::-webkit-outer-spin-button,
.augen-display-input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.augen-display-input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.augen-display-sub {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
}
.augen-presets {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: var(--space-2);
}

/* Ansagen-Tabelle */
.ansagen-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ansagen-table th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: var(--space-2);
  border-bottom: 1px solid var(--border);
}
.ansagen-table td {
  padding: var(--space-1) var(--space-2);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.ansagen-table td.ansage-label {
  text-align: left;
  font-weight: 500;
}
.chk {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.1s, color 0.1s, border-color 0.1s;
}
.chk:hover:not(.chk-on) { background: var(--surface-hover); }
.chk-on {
  background: var(--action);
  color: var(--on-action);
  border-color: var(--action);
}
.chk-on:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
}

.sonder-hint {
  margin-top: var(--space-2);
  font-size: 12px;
  line-height: 18px;
  color: var(--text-muted);
  font-style: italic;
}

/* Sonder-Tabelle: gleiche Struktur wie .ansagen-table, nur die Stepper
   in den Zellen brauchen etwas Platz. Auf schmalen Bildschirmen ggf.
   horizontal scrollen lassen. */
.sonder-table td .stepper-compact {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.sonder-table td .stepper-compact .stepper-btn {
  width: 28px; height: 28px;
}
.sonder-table td .stepper-value {
  min-width: 20px;
  font-size: 14px;
}
.sonder-stepper, .sonder-tri {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}
.sonder-label { font-size: 13px; font-weight: 500; flex: 1; }
.stepper {
  display: inline-flex; align-items: center; gap: 4px;
}
.stepper-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.stepper-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.stepper-btn:hover:not(:disabled) { background: var(--surface-hover); }
.stepper-value {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tri-row { display: inline-flex; gap: 2px; }
.tri-btn {
  padding: 4px 10px;
  min-height: 32px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.tri-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.tri-btn:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.tri-btn + .tri-btn  { border-left: none; }
.tri-active {
  background: var(--action);
  color: var(--on-action);
  border-color: var(--action);
}
.tri-active + .tri-btn { border-left: 1px solid var(--action); }

/* Live-Preview im Modal-Footer */
.preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.preview-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.preview-side.preview-winner {
  background: var(--success-bg);
  border-color: var(--success-border);
}
.preview-side.preview-loser {
  opacity: 0.7;
}
.preview-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
}
.preview-names {
  font-size: 13px;
  color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.preview-pts {
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 22px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.preview-winner .preview-pts { color: var(--success-text); }
.preview-loser  .preview-pts { color: var(--text-muted); }
.preview-disabled {
  grid-template-columns: 1fr;
  padding: var(--space-3);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  text-align: center;
}
