/* Skat-App – Design „Spieltisch dunkel“ */
/* Schriften lokal (SIL Open Font License, siehe fonts/OFL-*.txt) – keine Verbindung zu Google */
@font-face { font-family: Inter; src: url(fonts/inter.woff) format('woff'); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Barlow Semi Condensed'; src: url(fonts/barlow-semi-condensed-medium.woff) format('woff'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Barlow Semi Condensed'; src: url(fonts/barlow-semi-condensed-semibold.woff) format('woff'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Barlow Semi Condensed'; src: url(fonts/barlow-semi-condensed-bold.woff) format('woff'); font-weight: 700; font-style: normal; font-display: swap; }
:root {
  --grund: #0E1613;
  --tief: #070B09;
  --flaeche: #16221D;
  --flaeche2: #1E2D27;
  --leiste: #121C18;
  --linie: #22322B;
  --linie2: #2B3C35;
  --linie3: #2F443B;
  --text: #EEF2EE;
  --text2: #C9D6CF;
  --leise: #9DB0A6;
  --leiser: #7E9389;
  --messing: #E2B654;
  --messing-hell: #F0CB74;
  --auf-messing: #1A1408;
  --plus: #8FDCA6;
  --minus: #F28B7D;
  --zahl: 'Barlow Semi Condensed', 'Arial Narrow', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--grund); }
html, body { margin: 0; }
body {
  background: var(--grund); color: var(--text);
  font: 15px/1.45 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh; -webkit-tap-highlight-color: transparent;
}
a { color: var(--messing); text-decoration: none; }
a:hover { color: var(--messing-hell); }
h1, h2 { margin: 0; }
button { font: inherit; color: inherit; }
small { font-size: .75em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.leise { color: var(--leise); font-size: 13px; margin: 6px 0; }
.warn { color: var(--messing); }
.plus { color: var(--plus); }
.minus { color: var(--minus); }
.etikett { font-size: 11px; font-weight: 500; color: var(--leise); text-transform: uppercase; letter-spacing: .06em; }
.etikett.abstand { margin: 4px 0 8px; }
:focus-visible { outline: 2px solid var(--messing); outline-offset: 2px; }

/* Scrollbalken ausblenden, Scrollen per Wischen/Mausrad bleibt */
.ohne-balken { scrollbar-width: none; -ms-overflow-style: none; }
.ohne-balken::-webkit-scrollbar { display: none; width: 0; height: 0; }

.main { max-width: 560px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }

/* Navigation unten */
.unten {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  height: calc(76px + env(safe-area-inset-bottom)); padding: 8px 8px calc(16px + env(safe-area-inset-bottom));
  background: var(--leiste); border-top: 1px solid var(--linie);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
}
.unten a { color: var(--leise); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; }
.unten a.aktiv { color: var(--messing); font-weight: 600; }
.unten .plus-knopf { justify-self: center; width: 56px; height: 56px; margin-top: -18px; border-radius: 18px; background: var(--messing); color: var(--auf-messing); justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.unten .plus-knopf:hover { color: var(--auf-messing); background: var(--messing-hell); }
body[data-seite="partie"] .unten, body[data-seite="neu"] .unten { display: none; }
@media (min-width: 600px) and (max-width: 899.98px) { .unten { left: 50%; right: auto; width: 560px; transform: translateX(-50%); border-left: 1px solid var(--linie); border-right: 1px solid var(--linie); } }
.unten .marke, .unten .plus-text { display: none; }
@media (max-width: 899.98px) { .unten [data-nav="jahr"] { order: 4; } .unten [data-nav="spieler"] { order: 5; } .unten .plus-knopf { order: 3; } }

/* Desktop: breiter, Navigation oben */
@media (min-width: 900px) {
  :root { --breite: 1160px; }
  .main { max-width: var(--breite); padding: 8px 32px 40px; }
  .unten {
    position: sticky; top: 0; bottom: auto; height: 64px; padding: 0 max(32px, calc((100% - var(--breite)) / 2 + 32px));
    border-top: 0; border-bottom: 1px solid var(--linie);
    display: flex; align-items: center; gap: 6px;
  }
  .unten .marke { display: block; margin-right: 22px; font: 700 22px var(--zahl); color: var(--text); letter-spacing: .02em; }
  .unten .marke span { color: var(--messing); margin: 0 1px; }
  .unten a:not(.marke) { flex-direction: row; gap: 8px; font-size: 14px; padding: 8px 14px; border-radius: 10px; }
  .unten a:not(.marke):not(.plus-knopf):hover { background: var(--flaeche); color: var(--text); }
  .unten a.aktiv:not(.plus-knopf) { background: var(--flaeche); }
  .unten a svg { width: 18px; height: 18px; }
  .unten .plus-knopf { order: 10; margin: 0 0 0 auto; width: auto; height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 600; box-shadow: none; }
  .unten .plus-text { display: inline; }
  body .toast { bottom: 32px; }

  /* Monatsübersicht: links Wertung, rechts Partien */
  .monat-raster { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; column-gap: 28px; align-items: start; }
  .feld-rang { grid-column: 1; grid-row: 1; }
  .feld-hl { grid-column: 1; grid-row: 2; }
  .feld-diagramm { grid-column: 1; grid-row: 3; }
  .feld-partien { grid-column: 2; grid-row: 1 / span 4; }
  .monat-raster > :only-child, .monat-raster:not(:has(.feld-partien)) .feld-rang { grid-column: 1 / -1; }
  .zwei-spalten { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
  .zwei-spalten > .sieger-karte { margin-top: 28px; }

  /* Editor und Neue Partie: etwas breiter, weiterhin bildschirmfüllend */
  .main[data-seite="partie"], .main[data-seite="neu"] { max-width: 860px; }
  .diagramm { max-height: 360px; }
}
@media (min-width: 1600px) { :root { --breite: 1400px; } }

/* Bausteine */
.ikon-knopf { width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--linie2); background: var(--flaeche); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ikon-knopf:hover { color: var(--text); border-color: var(--linie3); }
.ikon-knopf.flach { border: 0; background: var(--flaeche2); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--flaeche); font-size: 12px; color: var(--leise); white-space: nowrap; border: 1px solid transparent; }
.knopf-pill { border-color: var(--linie2); cursor: pointer; min-height: 36px; }
.knopf-pill.rund { width: 36px; padding: 0; justify-content: center; position: relative; }
.knopf-pill.angemeldet { color: var(--messing); border-color: #5A4A20; }
.knopf-pill .rolle { position: absolute; right: -4px; top: -4px; background: var(--messing); color: var(--auf-messing); font: 700 9px/14px Inter, sans-serif; width: 14px; height: 14px; border-radius: 50%; }
.punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--plus); display: inline-block; flex: none; }
.punkt.warten { background: var(--messing); }
.punkt.aus { background: var(--minus); }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--linie3); background: var(--flaeche); color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer; text-align: center; }
.knopf:hover { color: var(--text); }
.knopf.haupt { background: var(--messing); border-color: var(--messing); color: var(--auf-messing); }
.knopf.haupt:hover { background: var(--messing-hell); color: var(--auf-messing); }
.knopf.zweit { background: var(--flaeche); }
.knopf.gross { min-height: 56px; border-radius: 16px; font-size: 16px; }
.knopf.verloren { background: #2A1B19; border-color: #5A3530; color: var(--minus); font: 700 20px var(--zahl); }
.knopf.gefahr { color: var(--minus); }
.knopf.breit, .breit { width: 100%; }
button.haupt:not(.knopf), button.zweit:not(.knopf) { min-height: 44px; border-radius: 12px; border: 1px solid var(--linie3); background: var(--flaeche2); font-weight: 600; cursor: pointer; padding: 0 14px; }
button.haupt:not(.knopf) { background: var(--messing); border-color: var(--messing); color: var(--auf-messing); }
.link { background: none; border: 0; color: var(--messing); cursor: pointer; padding: 8px 4px; font-size: 14px; min-height: 36px; }
.link.gefahr { color: var(--minus); }
.link.mitte { display: flex; align-items: center; justify-content: center; color: var(--text2); min-height: 44px; }
.klein-knopf { height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--linie2); background: transparent; color: var(--text2); font-size: 12px; cursor: pointer; }
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 16px; padding: 14px; margin: 0 0 14px; }
.karte h2 { margin-bottom: 10px; font-size: 11px; font-weight: 500; color: var(--leise); text-transform: uppercase; letter-spacing: .06em; }
.abschnitt { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; }
.abschnitt-kopf { display: flex; justify-content: space-between; align-items: center; }
.aktionen { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.aktionen .knopf { flex: 1 1 auto; font-weight: 500; font-size: 14px; }
.leer { text-align: center; padding: 40px 16px; color: var(--leise); }
.chip { display: inline-block; border: 1px solid var(--linie2); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--leise); }

/* Seitenkopf */
.seitenkopf { padding: 20px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.seitenkopf.einfach { padding-bottom: 8px; }
.kopfzeile { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.titel { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.seitenkopf.einfach .titel { align-items: flex-start; text-align: left; }
.ueber { font-size: 12px; color: var(--leise); letter-spacing: .08em; text-transform: uppercase; }
.titel h1 { font: 700 28px/1 var(--zahl); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
@media (max-width: 420px) { .pills .pill { padding: 4px 8px; font-size: 11.5px; } }
.partiekopf { display: flex; align-items: center; gap: 10px; padding: 16px 0 12px; }
.partiekopf h1 { font-size: 18px; font-weight: 600; }
.partiekopf .leise { margin: 2px 0 0; }

/* Rangliste */
.rangkarte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 16px; padding: 4px 0 10px; margin: 0 0 14px; }
.rangzeile { display: grid; grid-template-columns: 34px 1fr 52px 66px 58px; gap: 4px; align-items: center; padding: 0 14px; min-height: 48px; border-top: 1px solid var(--linie); }
.rangzeile.kopf { min-height: 0; padding-top: 10px; padding-bottom: 8px; border-top: 0; font-size: 11px; color: var(--leise); text-transform: uppercase; letter-spacing: .06em; }
.rangzeile .rang { font: 700 20px var(--zahl); }
.rangzeile .wer { display: flex; flex-direction: column; line-height: 1.2; }
.rangzeile .wer b { font-weight: 600; font-size: 15px; letter-spacing: .04em; }
.rangzeile .wer { min-width: 0; }
.rangzeile .wer small { font-size: 10px; color: var(--leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rangzeile .zahl { text-align: right; font: 500 17px var(--zahl); color: var(--text2); font-variant-numeric: tabular-nums; }
.rangzeile.kopf .zahl { font: inherit; color: inherit; }
.rangzeile .zahl.stark { font-weight: 700; font-size: 19px; color: var(--text); }
.rangzeile.ohne-rang { opacity: .6; }
.fussnote { margin: 8px 14px 0; font-size: 11px; color: var(--leise); }
.innen { padding: 12px 14px; }

.kacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.kacheln.drei { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kacheln.drei .kachel { padding: 10px; }
.kacheln.drei .kachel b { font-size: 22px; }
.kachel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kachel b { font: 700 26px var(--zahl); font-variant-numeric: tabular-nums; }
.kachel b { white-space: nowrap; }
.kachel span:last-child { font-size: 12px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Partienliste */
.partiekarte { margin-bottom: 0; color: var(--text); background: var(--flaeche2); border: 1px solid var(--linie3); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.partiekarte:hover { color: var(--text); border-color: var(--linie3); }
.partiekarte.laeuft { border-color: #5A4A20; }
.partiekarte svg { color: var(--leiser); flex: none; }
.partiekarte.laeuft svg { color: var(--messing); }
.partiekarte.offen { box-shadow: inset 3px 0 0 var(--messing); }
.pk-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pk-titel { font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.pk-sub { font-size: 12px; color: var(--leise); }
.pk-punkte { font: 500 15px var(--zahl); color: var(--text2); display: flex; gap: 6px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.pk-punkte i { color: var(--leiser); font-style: normal; }

/* Diagramm */
.diagramm { width: 100%; height: auto; display: block; }
.diagramm .raster { stroke: #22322B; stroke-width: 1; }
.diagramm .null-linie { stroke: #3F554B; stroke-width: 1; }
.diagramm .achse { fill: var(--leise); font-size: 20px; font-family: var(--zahl); }
.legende { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.leg { display: inline-flex; align-items: center; gap: 6px; background: var(--flaeche2); border: 1px solid var(--linie2); color: var(--text); border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; min-height: 36px; }
.leg i { width: 8px; height: 8px; border-radius: 50%; background: var(--f); }
.leg.aus { opacity: .45; }
.leg.aus i { background: transparent; border: 1px solid var(--f); }

/* ---------- Editor ---------- */
.main[data-seite="partie"], .main[data-seite="neu"] { padding: 0; }
.editor, .neu { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.ed-kopf { padding: 16px 16px 10px; display: flex; align-items: center; gap: 10px; flex: none; }
.ed-titel { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ed-titel h1, .ed-titel-h { font-size: 17px; font-weight: 600; flex: 1; }
.ed-titel span { font-size: 12px; color: var(--leise); }
.stand { margin: 0 16px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 18px; padding: 14px 10px 12px; flex: none; }
.stand-zeile { display: grid; align-items: baseline; }
.stand-zeile + .stand-zeile { margin-top: 8px; }
.sp-name { text-align: center; font-weight: 600; font-size: 15px; letter-spacing: .06em; }
.sp-name.geber { color: var(--messing); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 3px; text-decoration-color: var(--messing); }
.sp-final { text-align: center; font: 700 40px/1 var(--zahl); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; min-width: 0; letter-spacing: -.01em; }
.stand-zeile.final { min-height: 44px; align-items: center; }
.sp-sigma { white-space: nowrap; overflow: hidden; min-width: 0; text-align: center; font: 500 17px var(--zahl); color: var(--leise); font-variant-numeric: tabular-nums; }
.stand-zeile.sigma > span:first-child { font-size: 13px; color: var(--leise); }
.spiele { flex: 1; min-height: 0; overflow-y: auto; margin: 12px 16px 0; display: flex; flex-direction: column; padding-bottom: 12px; overscroll-behavior: contain; }
.spielzeile { all: unset; box-sizing: border-box; display: grid; align-items: center; min-height: 58px; border-bottom: 1px solid var(--flaeche2); cursor: pointer; flex: none; }
.spielzeile:disabled { cursor: default; }
.spielzeile:not(:disabled):hover { background: rgba(255,255,255,.02); }
.spielzeile:focus-visible { outline: 2px solid var(--messing); outline-offset: -2px; border-radius: 8px; }
.nr { font: 500 15px var(--zahl); color: var(--leiser); padding-left: 6px; }
.zelle { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.zelle b { font: 600 var(--zellgroesse, 21px) var(--zahl); font-variant-numeric: tabular-nums; white-space: nowrap; }
.zelle small { font-size: 10px; color: var(--leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.zelle-leer b { color: var(--leiser); font-weight: 500; }
.zelle.aussetzer b { opacity: .45; }
.zeile-text { font-size: 13px; color: var(--leise); text-align: center; }
.naechster { display: grid; align-items: center; min-height: 58px; border: 1px dashed var(--linie3); border-radius: 12px; margin-top: 10px; flex: none; }
.hinweis { margin: 10px 2px 0; font-size: 12px; color: var(--leiser); }
.nebenaktionen { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.ed-fuss { padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 10px; flex: none; }
.ed-fuss.zwei { grid-template-columns: 1fr 1.5fr; }
.ed-fuss.stapel { gap: 4px; }

/* ---------- Spiel-Dialog (Bottom Sheet) ---------- */
.schleier { position: fixed; inset: 0; z-index: 20; background: rgba(7,11,9,.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.schleier:has(.blatt) { align-items: flex-end; padding: 0; }
.dialog { background: var(--flaeche); border: 1px solid var(--linie3); border-radius: 18px; width: 100%; max-width: 420px; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 18px 16px; box-shadow: 0 16px 48px rgba(0,0,0,.5); scrollbar-width: none; }
.dialog::-webkit-scrollbar { display: none; }
.dialog h2 { font-size: 18px; font-weight: 600; }
.dialog form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.dialog input:not([type=checkbox]):not([type=radio]), .dialog select, .eingabe, .formular input, .formular select {
  font: inherit; color: var(--text); background: var(--grund); border: 1px solid var(--linie2); border-radius: 12px; padding: 0 12px; min-height: 48px; width: 100%;
}
.knopfreihe { display: flex; gap: 8px; }
.knopfreihe button { flex: 1; }
.dialog.blatt { max-width: 560px; border-radius: 24px 24px 0 0; border-bottom: 0; max-height: calc(100dvh - 56px); padding: 10px 16px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.griff-leiste { width: 40px; height: 4px; border-radius: 2px; background: #3F554B; align-self: center; flex: none; }
.dlg-kopf { display: flex; align-items: center; justify-content: space-between; }
.dlg-kopf h1 { font-size: 18px; font-weight: 600; }
.spielerwahl-feld { border: 0; margin: 0; padding: 0; }
.spielerwahl-feld legend { padding: 0; margin-bottom: 8px; }
.wahlen { display: grid; gap: 8px; }
.wahl { height: 52px; border-radius: 14px; border: 1px solid var(--linie2); background: var(--flaeche2); color: var(--text); font-weight: 600; font-size: 16px; letter-spacing: .05em; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; min-width: 0; }
.wahl small { font-size: 10px; font-weight: 500; letter-spacing: 0; color: var(--leise); }
.wahl.an { background: var(--messing); border-color: var(--messing); color: var(--auf-messing); }
.wahl.an small { color: var(--auf-messing); }
.wahl.aus { background: transparent; border-style: dashed; border-color: var(--linie3); color: var(--leiser); cursor: not-allowed; }
.tabs { display: flex; overflow-x: auto; background: var(--grund); border-radius: 12px; padding: 4px; gap: 4px; flex: none; }
.tab { flex: none; padding: 0 14px; height: 44px; border-radius: 9px; border: 0; background: transparent; color: var(--leise); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.tab.aktiv { background: #2A3D35; color: var(--text); font-weight: 600; }
.raster-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; overscroll-behavior-x: contain; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.raster-wrap.am-ende { -webkit-mask-image: none; mask-image: none; }
@media (min-width: 760px) { .dialog.blatt { max-width: 740px; } .raster-wrap { -webkit-mask-image: none; mask-image: none; } }
.raster { display: flex; flex-direction: column; gap: 6px; width: max-content; }
.raster-zeile { display: grid; grid-template-columns: 92px repeat(10, 52px); gap: 6px; align-items: center; }
.raster-zeile.kopf { font-size: 11px; color: var(--leise); text-align: center; }
.raster-zeile .farbe { position: sticky; left: -16px; z-index: 1; background: var(--flaeche); display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; height: 44px; padding-left: 0; text-align: left; box-shadow: 8px 0 8px -6px var(--flaeche); }
.raster-zeile.kopf .farbe { height: auto; }
.raster-zeile .farbe small { color: var(--leiser); font-size: 11px; }
.wert { height: 44px; border-radius: 10px; border: 1px solid var(--linie2); background: var(--flaeche2); color: var(--text); font: 600 17px var(--zahl); cursor: pointer; }
.wert:hover { border-color: var(--linie3); }
.wert.an { background: var(--messing); border-color: var(--messing); color: var(--auf-messing); }
.nullliste { display: flex; flex-direction: column; gap: 6px; }
.nullzeile { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--linie2); background: var(--flaeche2); color: var(--text); font-size: 15px; cursor: pointer; }
.nullzeile b { font: 700 20px var(--zahl); }
.nullzeile.an { background: var(--messing); border-color: var(--messing); color: var(--auf-messing); }
.frei-feld { display: flex; flex-direction: column; gap: 8px; }
.dialog input.frei { font: 700 28px var(--zahl); min-height: 56px; }
.kontra { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.umschalter { height: 44px; border-radius: 12px; border: 1px solid var(--linie3); background: transparent; color: var(--text2); font-size: 14px; font-weight: 500; cursor: pointer; }
.umschalter.an { background: #2A2614; border-color: var(--messing); color: var(--messing); font-weight: 600; }
.zusammenfassung { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 2px; }
.zusammenfassung span { font-size: 14px; color: var(--text2); }
.zusammenfassung b { font: 700 34px/1 var(--zahl); color: var(--messing); }
.vorschau { margin: 4px 2px 0; font-size: 11px; color: var(--leiser); }
.ergebnisse { display: grid; grid-template-columns: 64px 64px 1fr; gap: 8px; position: sticky; bottom: calc(-22px - env(safe-area-inset-bottom)); background: var(--flaeche); padding: 8px 0 0; margin-top: auto; }
.ergebnisse.eins { grid-template-columns: 1fr; }
.ergebnisse .knopf { min-height: 60px; }
.ramsch { display: flex; flex-direction: column; gap: 8px; }
.augen { display: grid; grid-template-columns: 7rem 1fr; align-items: center; gap: 8px; }
.augen input, .augen select { font: inherit; color: var(--text); background: var(--grund); border: 1px solid var(--linie2); border-radius: 12px; padding: 0 12px; min-height: 48px; width: 100%; }
.schalter { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 40px; color: var(--text2); }
.schalter input { width: 20px; height: 20px; accent-color: var(--messing); }

/* ---------- Neue Partie ---------- */
.neu-inhalt { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 16px 0; }
.datum-pill input { min-height: 36px; border-radius: 999px; border: 1px solid var(--linie2); background: var(--flaeche); color: var(--leise); padding: 0 10px; font: inherit; font-size: 13px; }
.segment { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 4px; gap: 4px; }
.segment > * { height: 48px; border-radius: 10px; border: 0; background: transparent; color: var(--text2); font: 600 17px var(--zahl); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.segment > .aktiv { background: var(--messing); color: var(--auf-messing); font-weight: 700; }
.segment.klein { max-width: 240px; margin: 0 auto 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segment.klein > * { height: 40px; font-size: 15px; }
.pool { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.poolwahl { height: 48px; border-radius: 12px; border: 1px solid var(--linie2); background: transparent; color: var(--text2); font-weight: 600; font-size: 15px; letter-spacing: .05em; cursor: pointer; }
.poolwahl.an { background: var(--flaeche2); border-color: var(--messing); color: var(--messing); }
.poolwahl.neu-sp { border-style: dashed; border-color: #3F554B; color: var(--leise); letter-spacing: 0; }
.sitzliste { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; overflow: hidden; }
.sitzzeile { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 6px 0 12px; border-top: 1px solid var(--linie); }
.sitzzeile:first-child { border-top: 0; }
.sitzzeile.unbesetzt .sitz-name { color: var(--leiser); font-weight: 400; letter-spacing: 0; }
.platz { width: 28px; height: 28px; border-radius: 8px; background: var(--grund); color: var(--leise); display: flex; align-items: center; justify-content: center; font: 600 15px var(--zahl); flex: none; }
.sitz-name { flex: 1; font-weight: 600; font-size: 15px; letter-spacing: .05em; }
.sitz-tag { font-size: 12px; color: var(--leise); }
.sitz-tag.gold { color: var(--messing); }
.griff { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--leiser); cursor: grab; touch-action: none; flex: none; }
.laengen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.laengen button { height: 56px; border-radius: 12px; border: 1px solid var(--linie2); background: var(--flaeche); color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.laengen b { font: 600 19px/1.1 var(--zahl); }
.laengen small { font-size: 10px; color: var(--leise); }
.laengen .aktiv { border-color: var(--messing); background: #2A2614; color: var(--messing); }
.laengen .aktiv b { font-weight: 700; }
.punkte { display: flex; flex-direction: column; gap: 8px; }

/* ---------- übrige Seiten ---------- */
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th, .tabelle td { padding: 8px 6px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
.tabelle th { color: var(--leise); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.tabelle .zahl { text-align: right; font-family: var(--zahl); font-variant-numeric: tabular-nums; }
/* High-/Lowscore-Tabelle */
.hl-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.hl-kopf small { text-transform: none; letter-spacing: 0; font-size: 11px; }
.mini-segment { display: inline-flex; background: var(--flaeche); border: 1px solid var(--linie2); border-radius: 10px; padding: 2px; flex: none; }
.mini-segment button { border: 0; background: transparent; color: var(--leise); font-size: 12px; padding: 0 10px; min-height: 30px; border-radius: 8px; cursor: pointer; }
.mini-segment button.aktiv { background: var(--flaeche2); color: var(--messing); font-weight: 600; }
.hl-tabelle { padding: 10px 12px 4px; }
.hl-tabelle .tabelle { font-size: 14px; }
.hl-tabelle .tabelle th, .hl-tabelle .tabelle td { padding: 7px 5px; vertical-align: middle; }
.hl-tabelle .tabelle tr:last-child td { border-bottom: 0; }
.hl-tabelle .tabelle td.zahl { font-size: 16px; }
.hl-tabelle .stark { font-weight: 700; }
.hl-tabelle .leiser { color: var(--leiser); }
.hl-paar { display: grid; gap: 0; min-width: 0; }
.hl-tabelle { overflow-x: auto; }
.hl-tabelle .tabelle { table-layout: fixed; }
.hl-tabelle th:nth-child(1) { width: 40px; }
.hl-tabelle th:nth-child(3) { width: 68px; }
.hl-tabelle th:nth-child(4) { width: 54px; }
.hl-tabelle th:nth-child(5) { width: 76px; }
.hl-tabelle th:nth-child(6) { width: 60px; }
.hl-tabelle th:nth-child(7) { width: 84px; }
.hl-mehr-oben { float: right; margin-top: -6px; padding: 4px; min-height: 0; font-size: 13px; }
.hl-abstand { height: 10px; }
.nur-breit { display: none; }
@media (min-width: 520px) { .nur-breit { display: table-cell; } }
.spielerwahl { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.spielerchip { height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--linie2); background: transparent; color: var(--text2); font-weight: 600; letter-spacing: .05em; cursor: pointer; }
.spielerchip.gewaehlt { background: var(--flaeche2); border-color: var(--messing); color: var(--messing); }
.spielerzeile { display: grid; grid-template-columns: 4rem 1fr auto auto; gap: 8px; align-items: center; min-height: 48px; border-top: 1px solid var(--linie); }
.spielerzeile:first-child { border-top: 0; }
.spielerzeile b { letter-spacing: .05em; }
.spielerzeile.inaktiv { opacity: .5; }
.anmeldung { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--text2); }
.formular { display: flex; flex-direction: column; gap: 12px; }
.formular label { display: flex; flex-direction: column; gap: 6px; color: var(--leise); font-size: 13px; }
.formular label.schalter { flex-direction: row; color: var(--text2); font-size: 15px; }
.formular.reihe { flex-direction: row; flex-wrap: wrap; }
.formular.reihe input { flex: 1 1 8rem; width: auto; }
.balken { display: grid; grid-template-columns: 7rem 1fr 2.5rem; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.balken i { display: block; height: 12px; background: var(--messing); border-radius: 4px; min-width: 2px; }
.balken b { text-align: right; font-family: var(--zahl); font-size: 16px; }

.toast { visibility: hidden; opacity: 0; position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--flaeche2); color: var(--text); border: 1px solid var(--linie3); padding: 10px 14px; border-radius: 12px; transition: transform .2s, opacity .2s, visibility .2s; z-index: 30; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.45); font-size: 14px; }
.toast.sichtbar { visibility: visible; opacity: 1; transform: translate(-50%, 0); }
.toast.warn { border-color: #6B5520; }
.toast.fehler { border-color: var(--minus); }
body[data-seite="partie"] .toast, body[data-seite="neu"] .toast { bottom: calc(100px + env(safe-area-inset-bottom)); }

@media print {
  html, body { background: #fff; color: #000; }
  .unten, .aktionen, .pills, .ikon-knopf, .legende, .toast, .ed-fuss, .mini-segment, [data-act="hl-alle"] { display: none !important; }
  .karte, .kachel, .rangkarte, .partiekarte { background: #fff; border-color: #bbb; color: #000; break-inside: avoid; }
  .rangzeile .zahl, .rangzeile .zahl.stark, .pk-punkte { color: #000; }
  .leise, .etikett, .fussnote, .pk-sub { color: #444; }
  .diagramm .achse { fill: #333; }
  .main { max-width: none; padding: 0; }
}

/* v0.4.0: Toast mit Knöpfen (Rückgängig, Abschließen) */
.toast { display: flex; align-items: center; gap: 10px; width: max-content; }
.toast span { flex: 1 1 auto; min-width: 0; }
.toast.mit-knopf { padding: 6px 6px 6px 14px; }
.toast-knopf { min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--linie3); background: var(--flaeche); color: var(--messing); font-weight: 600; cursor: pointer; }
.toast-knopf:hover { color: var(--messing-hell); }

/* Konflikt zwischen Gerät und Server */
.konflikt-hinweis { flex: none; max-height: 45vh; overflow-y: auto; margin: 0 16px 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid #6B5520; background: #241E10; color: var(--text); font-size: 14px; }
.konflikt-hinweis b { color: var(--messing); }
.konflikt-hinweis p { margin: 6px 0; }
.konflikt-hinweis .knopfreihe { margin-top: 10px; }
.partiekarte.konflikt { border-color: #6B5520; box-shadow: inset 3px 0 0 var(--minus); }

/* Datensicherung */
.sicherung .knopfreihe.umbruch { flex-wrap: wrap; }
.sicherung .knopfreihe .knopf { flex: 1 1 12rem; }
.datei-knopf { position: relative; cursor: pointer; }
.datei-knopf:focus-within { outline: 2px solid var(--messing); outline-offset: 2px; }
.ed-fuss .hinweis.mitte { text-align: center; margin: 4px 8px; font-size: 13px; color: var(--messing); }
.sieger-tabelle td.letzter b { color: var(--minus); }
.sieger-tabelle th.letzter, .sieger-tabelle td.letzter { border-left: 1px solid var(--linie); padding-left: 10px; }
.sieger-tabelle td small { white-space: nowrap; }

/* v0.4.2: Statistiken */
.herkunft-zeile { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 4rem; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--linie); font-size: 14px; }
.herkunft-zeile span { display: flex; flex-direction: column; min-width: 0; }
.herkunft-zeile small { font-size: 11px; color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.herkunft-zeile i { display: block; height: 10px; border-radius: 4px; min-width: 2px; }
.herkunft-zeile i.plus { background: var(--plus); }
.herkunft-zeile i.minus { background: var(--minus); }
.herkunft-zeile b { text-align: right; font: 600 17px var(--zahl); font-variant-numeric: tabular-nums; }
.herkunft-zeile.summe { border-bottom: 0; font-weight: 600; }
.herkunft-zeile.summe b { font-size: 19px; }
.tabelle tr.gewaehlt td { background: var(--flaeche2); }
.tabelle tr.gewaehlt td:first-child b { color: var(--messing); }
.rekord { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--linie); color: var(--text); font-size: 14px; }
.rekord:last-child { border-bottom: 0; }
a.rekord:hover { color: var(--text); background: var(--flaeche2); }
.rekord span { display: flex; flex-direction: column; min-width: 0; }
.rekord small { font-size: 12px; color: var(--leise); }
.rekord b { font: 700 19px var(--zahl); white-space: nowrap; color: var(--messing); }
.medaillen .gold b { color: #E2B654; }
.medaillen .silber b { color: #C9D6CF; }
.medaillen .bronze b { color: #C8A06A; }
.medaillen .letzter b { color: var(--minus); }
.medaillen th, .medaillen td { padding-left: 4px; padding-right: 4px; }
.jahr-rechts > .karte { margin-bottom: 14px; }
@media (min-width: 900px) { .zwei-spalten > .jahr-rechts { margin-top: 28px; } .zwei-spalten > .jahr-rechts > .sieger-karte { margin-top: 0; } }
.leiser { color: var(--leiser); }
.kacheln.drei .kachel span:last-child { white-space: normal; line-height: 1.25; }
.herkunft-zeile i.ohne { min-width: 0; }
.tabelle tr.wenig td { color: var(--leiser); }
