/* Punkte zählen (A.19.0.0): Gesamtstand als Rangliste (Führender mit Krone, Gold wie Platz 1 bei der Reihenfolge),
   je Spieler eine Glaskarte zum Eintragen mit großem Feld und Schnellknöpfen, Tabelle aller Runden zum Aufklappen.
   Die Spielerfarbe kommt als --farbe an jede Zeile und färbt nur Kante, Punkt und Balken. */

.buehne-punkte {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 10px 14px 22px;
}
.punkte-raster { display: grid; gap: 18px; width: min(100%, 1040px); }
.punkte-raster[hidden] { display: none; }
@container (min-width: 760px) {
  .punkte-raster { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); align-items: start; gap: 22px; }
}
.punkte-ueberschrift {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 0 0 10px;
  padding-left: 4px;
  font-size: 1.2rem;
}
.punkte-ueberschrift small { font-family: var(--schrift); font-size: .9rem; font-weight: 550; letter-spacing: 0; color: var(--tusche-weich); }

/* ---------- Gesamtstand ---------- */
.rangliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rang {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 16px 8px 8px;
  border-radius: 18px;
  background: var(--flaeche);
  -webkit-backdrop-filter: var(--glas-blur);
  backdrop-filter: var(--glas-blur);
  box-shadow: inset 4px 0 0 var(--farbe), var(--schatten-klein);
}
.rang-platz {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--farbe) 16%, #fff);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--farbe) 45%, transparent);
  color: var(--tusche);
  font-weight: 750;
  font-size: 1.05rem;
}
.rang-platz svg { width: 22px; height: 22px; }
.rang-mitte { display: grid; gap: 2px; min-width: 0; }
.rang-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; font-size: 1.1rem; }
.rang-abstand { font-size: .85rem; font-weight: 600; color: var(--tusche-weich); }
.rang-abstand:empty { display: none; }
.rang-balken { position: relative; height: 5px; margin-top: 3px; border-radius: 3px; background: rgba(139, 92, 246, .12); overflow: hidden; }
.rang-balken::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--anteil, 0) * 100%);
  border-radius: inherit;
  background: var(--farbe);
  transition: width .5s cubic-bezier(.2, .9, .3, 1);
}
.rang-summe { font-size: 1.65rem; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.rang.neu .rang-summe { animation: punkte-neu .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes punkte-neu { 40% { scale: 1.25; color: #6d28d9; } }

/* Führender (allein): Gold, Krone, größere Zahl */
.rang.fuehrt { min-height: 68px; }
.rang.allein { box-shadow: inset 4px 0 0 var(--farbe), inset 0 0 0 2px rgba(245, 158, 11, .5), 0 10px 26px rgba(245, 158, 11, .22); }
.rang.allein .rang-platz { background: linear-gradient(135deg, #fde68a, #f59e0b); box-shadow: 0 4px 12px rgba(245, 158, 11, .35); color: #78350f; }
.rang.allein .rang-summe { font-size: 2rem; }
.rang.allein .rang-abstand { color: #92400e; }

/* ---------- laufende Runde ---------- */
.punkte-runde[hidden] { display: none; }
.eingabe { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.eingabe-zeile {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px 14px;
  border-radius: 20px;
  background: var(--flaeche);
  -webkit-backdrop-filter: var(--glas-blur);
  backdrop-filter: var(--glas-blur);
  box-shadow: inset 5px 0 0 var(--farbe), var(--schatten-klein);
  transition: box-shadow .2s ease;
}
.eingabe-zeile.ist-dran { box-shadow: inset 5px 0 0 var(--farbe), inset 0 0 0 2px color-mix(in srgb, var(--farbe) 55%, transparent), var(--schatten-klein); }
.ez-kopf { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ez-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 1.08rem; }
.ez-name::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 7px; border-radius: 50%; background: var(--farbe); vertical-align: 0; box-shadow: 0 1px 3px rgba(80, 60, 160, .3); }
.ez-dran { flex: none; padding: 2px 9px; border-radius: 999px; background: #6d28d9; color: #fff; font-size: .78rem; font-weight: 700; }
.ez-dran[hidden] { display: none; }
.ez-summe { margin-left: auto; flex: none; font-size: .88rem; font-weight: 600; color: var(--tusche-weich); font-variant-numeric: tabular-nums; }
.ez-tasten { display: grid; grid-template-columns: 48px 48px minmax(60px, 1fr) 48px 48px; gap: 6px; }
.ez-knopf {
  min-height: 52px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 0 0 1px rgba(30, 27, 58, .1);
  color: var(--tusche);
  font-weight: 700;
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background .15s ease;
}
.ez-knopf.plus { background: rgba(139, 92, 246, .14); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .28); color: #5b21b6; }
.ez-knopf:hover { background: #fff; }
.ez-knopf.plus:hover { background: rgba(139, 92, 246, .22); }
.ez-knopf:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.ez-feld {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 0 8px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(30, 27, 58, .12), inset 0 2px 4px rgba(80, 60, 160, .06);
  font-size: 1.55rem;
  font-weight: 750;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ez-feld::placeholder { color: rgba(95, 90, 126, .55); font-weight: 600; }
.ez-feld:focus { outline: none; border-color: var(--akzent); }
.hat-wert .ez-feld { background: color-mix(in srgb, var(--farbe) 10%, #fff); }

.punkte-knoepfe {
  position: sticky;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 3;
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
.abschluss-knopf { min-width: min(100%, 320px); min-height: 60px; font-size: 1.2rem; font-weight: 650; letter-spacing: -.01em; }

/* ---------- Siegmeldung ---------- */
.punkte-sieg {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: min(100%, 560px);
  padding: 22px 20px 20px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255, 251, 235, .92), rgba(253, 242, 248, .92));
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, .45), 0 18px 44px rgba(245, 158, 11, .22);
  text-align: center;
  animation: punkte-sieg .6s cubic-bezier(.2, 1.4, .4, 1) both;
}
.punkte-sieg[hidden] { display: none; }
.sieg-krone {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--farbe, #8b5cf6) 30%, transparent), 0 8px 20px rgba(245, 158, 11, .35);
  color: #78350f;
}
.sieg-krone svg { width: 40px; height: 40px; }
.sieg-titel { margin: 6px 0 0; font-family: var(--schrift-titel); font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 800; letter-spacing: -.03em; text-wrap: balance; }
.sieg-text { margin: 0 0 8px; font-weight: 600; color: var(--tusche-weich); }
.sieg-knoepfe { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.sieg-knoepfe .knopf.haupt { min-height: 54px; font-size: 1.05rem; }
@keyframes punkte-sieg { from { opacity: 0; transform: scale(.92) translateY(10px); } }

/* ---------- Tabelle aller Runden ---------- */
.punkte-tabelle { width: min(100%, 1040px); }
.punkte-tabelle[hidden] { display: none; }
.punkte-tabelle summary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 46px;
  margin: 0 auto;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--flaeche);
  -webkit-backdrop-filter: var(--glas-blur);
  backdrop-filter: var(--glas-blur);
  box-shadow: var(--schatten-klein);
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.punkte-tabelle summary::-webkit-details-marker { display: none; }
.punkte-tabelle summary::after { content: ""; width: 8px; height: 8px; margin-left: 2px; border: solid currentColor; border-width: 0 2.5px 2.5px 0; rotate: 45deg; translate: 0 -2px; transition: rotate .2s ease; }
.punkte-tabelle[open] summary::after { rotate: -135deg; translate: 0 2px; }
.punkte-tabelle summary small { font-weight: 550; color: var(--tusche-weich); }
.punkte-tabelle summary:focus-visible { outline: 2px solid var(--akzent); outline-offset: 3px; }
.tabelle-scroll {
  max-width: 100%;
  margin-top: 12px;
  overflow-x: auto;
  border-radius: 18px;
  background: var(--flaeche);
  -webkit-backdrop-filter: var(--glas-blur);
  backdrop-filter: var(--glas-blur);
  box-shadow: var(--schatten-klein);
}
.tabelle-scroll:focus-visible { outline: 2px solid var(--akzent); outline-offset: 3px; }
.runden-tabelle { min-width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.runden-tabelle th, .runden-tabelle td { padding: 4px 6px; text-align: center; white-space: nowrap; }
.runden-tabelle thead th { padding: 10px 8px 8px; font-size: .9rem; font-weight: 700; }
.tb-name { display: inline-block; max-width: 8em; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; padding-bottom: 3px; border-bottom: 3px solid var(--farbe); }
.runden-tabelle th[scope="row"] { position: sticky; left: 0; z-index: 1; padding-inline: 12px; background: rgba(246, 244, 255, .96); color: var(--tusche-weich); font-weight: 650; font-size: .9rem; }
.runden-tabelle thead th:first-child { position: sticky; left: 0; z-index: 1; background: rgba(246, 244, 255, .96); color: var(--tusche-weich); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.runden-tabelle th[scope="row"] small { font-weight: 550; }
.runden-tabelle tbody tr + tr { border-top: 1px solid rgba(30, 27, 58, .07); }
.runden-tabelle tr.laeuft { background: rgba(139, 92, 246, .06); }
.runden-tabelle tr.ziel-runde th { color: #92400e; }
.tb-wert {
  min-width: 52px;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-weight: 650;
  font-size: 1rem;
  cursor: pointer;
}
.tb-wert:hover { background: rgba(139, 92, 246, .12); }
.tb-wert:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
.runden-tabelle tfoot td, .runden-tabelle tfoot th { padding: 10px 8px; border-top: 2px solid rgba(30, 27, 58, .14); font-weight: 750; font-size: 1.05rem; }
.punkte-tabelle .klein-hinweis { text-align: center; }

/* ---------- leer, Extras ---------- */
.punkte-leer { display: grid; justify-items: center; gap: 12px; max-width: 26em; padding-top: 6vh; text-align: center; color: var(--tusche-weich); font-weight: 550; }
.punkte-leer[hidden] { display: none; }
.punkte-leer p { margin: 0; }
.leer-bild { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 28px; background: var(--flaeche); box-shadow: var(--schatten); color: #6d28d9; }
.leer-bild svg { width: 50px; height: 50px; }
.punkte-extras { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.raum-gast .nur-gastgeber { display: none !important; }

/* ---------- Werkbank ---------- */
.spieler-liste li { grid-template-columns: 40px minmax(0, 1fr) auto auto auto; gap: 6px; }
.spieler-liste .feld-farbe, .spieler-liste .feld-text { grid-area: auto; } /* werkbank.css legt sie in die Felder-Fläche */
.spieler-liste .feld-farbe { border-radius: 50%; }
.regel-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 4px 0 6px; font-weight: 600; }
.regel-zeile[hidden] { display: none; }
.regel-zeile .gewicht { margin-left: 0; }
.ziel-feld { width: 5.5em; min-height: 40px; text-align: center; font-weight: 700; }
.regel-wahl { flex: 1 1 10em; min-height: 42px; }
.schritte-wahl button { padding: 0 4px; font-size: .92rem; font-variant-numeric: tabular-nums; }
.partie-punkte { box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(80, 60, 160, .3); }
@media (pointer: coarse) {
  .spieler-liste li { grid-template-columns: 44px minmax(0, 1fr) auto auto auto; }
  .ziel-feld, .regel-wahl { min-height: 44px; }
}

/* ---------- schmal, Querformat, ruhig ---------- */
@media (max-width: 370px) {
  .ez-tasten { grid-template-columns: 44px 44px minmax(52px, 1fr) 44px 44px; gap: 5px; }
  .ez-knopf { font-size: .95rem; }
}
@media (min-width: 980px) {
  .buehne-punkte { min-height: calc(100dvh - 140px); }
}
@media (orientation: landscape) and (max-height: 540px) and (min-width: 480px) {
  .buehne-punkte { gap: 10px; padding-top: 0; }
  .rang { min-height: 48px; padding-block: 4px; }
  .rang.fuehrt { min-height: 52px; }
  .rang-summe { font-size: 1.35rem; }
  .rang.allein .rang-summe { font-size: 1.55rem; }
  .ez-knopf, .ez-feld { min-height: 44px; }
  .abschluss-knopf { min-height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  .rang.neu .rang-summe, .punkte-sieg { animation: none; }
  .rang-balken::after { transition: none; }
}

/* Dunkelmodus „Graphit“ (A.23.3.0, Grundlage in css/basis.css) */
[data-thema="dunkel"] .rang-platz { background: color-mix(in srgb, var(--farbe) 22%, #232323); }
[data-thema="dunkel"] .ez-knopf { background: var(--g-flaeche-hoch); box-shadow: inset 0 0 0 1px var(--g-kante); }
[data-thema="dunkel"] .ez-knopf:hover { background: #3a3a3a; }
[data-thema="dunkel"] .ez-knopf.plus { background: rgba(167, 139, 250, .18); color: #c4b5fd; }
[data-thema="dunkel"] .ez-feld { background: var(--g-feld); color: var(--tusche); box-shadow: inset 0 0 0 1px var(--g-kante); }
[data-thema="dunkel"] .ez-feld::placeholder { color: rgba(163, 163, 163, .6); }
[data-thema="dunkel"] .hat-wert .ez-feld { background: color-mix(in srgb, var(--farbe) 14%, #191919); }
