/* Wiener Tarock — Blau in Blau, schwarze Schrift, gruener Tisch.
   Die Karten sind weiss und tragen franzoesische Farben. */

:root {
  --ink: #0b0f14;
  --ink-soft: #33404e;
  --blue-950: #071a2c;
  --blue-900: #0a2340;
  --blue-800: #10314e;
  --blue-700: #16456c;
  --blue-600: #1d5787;
  --blue-500: #2a6fa6;
  --blue-200: #b9cfe2;
  --blue-100: #dde9f4;
  --paper: #f7fafc;
  /* Lobby: helles Blau statt Weiß, passend zu Blau und Gold. */
  --lobby-1: #eef6fd;
  --lobby-2: #dcebf9;
  --lobby-edge: #b9cfe2;
  --felt-1: #1e6d49;
  --felt-2: #14503a;
  --felt-3: #0f3e2d;
  --gold: #c9a227;
  --red: #b3252c;
  --green-dot: #1f9d55;
  --grey-dot: #9aa6b2;
  --radius: 14px;
  --card-w: 84px;
  --card-h: 124px;
  --trick-w: 92px;
  --trick-h: 136px;
}

* { box-sizing: border-box; }

html {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(160deg, var(--blue-950), var(--blue-800) 55%, var(--blue-700));
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

body {
  margin: 0;
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

/* ---------------------------------------------------------------- Kopf -- */

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: rgba(4, 16, 28, 0.72);
  border-bottom: 1px solid rgba(185, 207, 226, 0.25);
  color: var(--blue-100);
}

.brand {
  font-size: 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}

.meta {
  flex: 1;
  font-size: 13px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  opacity: 0.85;
}

.score {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* Name in der Kopfzeile: öffnet das Profil. */
.top .me {
  flex: 0 0 auto;
  max-width: 22ch;
  padding: 4px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid rgba(185, 207, 226, 0.35);
  background: rgba(185, 207, 226, 0.1);
  color: var(--blue-100);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.top .me:hover { border-color: var(--blue-200); background: rgba(185, 207, 226, 0.18); }
.top .me[hidden] { display: none; }
.top .me:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ------------------------------------------------------------ Aufbau ---- */

.app {
  display: grid;
  min-width: 0;
  overflow: hidden;
  grid-template-columns: 208px minmax(0, 1fr) 272px;
  gap: 12px;
  padding: 12px;
  min-height: 0;
}

/* ------------------------------------------------------------ Leiste ---- */

.rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
}

.rail-block {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 8px 20px rgba(3, 12, 22, 0.35);
}

.rail-block h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.rail-block button {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 9px 10px;
  border: 1px solid var(--blue-200);
  border-radius: 9px;
  background: linear-gradient(180deg, #fff, var(--blue-100));
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.rail-block button:hover { border-color: var(--blue-500); }
.rail-block button:disabled { opacity: 0.45; cursor: default; }
.rail-block button.primary {
  background: linear-gradient(180deg, var(--blue-600), var(--blue-700));
  color: #fff;
  border-color: var(--blue-700);
}
.rail-block button.danger {
  background: linear-gradient(180deg, #c8484f, var(--red));
  color: #fff;
  border-color: #8d1f25;
}
.rail-block button small {
  display: block;
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}

.rail-info {
  font-size: 13px;
  line-height: 1.45;
}
/* Tischinfo: erste Zeile Tischname, zweite Zeile Runde und Platz. */
.rail-info .table-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-info .table-where {
  color: var(--ink-soft);
  font-size: 12px;
  margin-bottom: 4px;
}
.rail-info .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}
.rail-info .row span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ------------------------------------------------------------- Tisch ---- */

.table {
  position: relative;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 42%, var(--felt-1), var(--felt-2) 62%, var(--felt-3));
  box-shadow:
    inset 0 0 0 2px rgba(201, 162, 39, 0.35),
    inset 0 0 90px rgba(0, 0, 0, 0.45),
    0 18px 45px rgba(2, 8, 16, 0.5);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

/* Namensschilder */

.plate {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(247, 250, 252, 0.95);
  border-radius: 10px;
  border: 1px solid rgba(11, 15, 20, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font-size: 13px;
  min-width: 148px;
  max-width: 46%;
  overflow: hidden;
}

.plate .who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.plate .name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plate .name-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.plate .sub {
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Tischchef: kleines Zeichen neben dem Namen. */
.plate .chef {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.18);
  border: 1px solid rgba(201, 162, 39, 0.55);
  color: #7a5f0d;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* Kontra steht sofort unter dem Namen, mit Verdopplung; die Farbe folgt der
   Partei: Gegner rot, Ruferpartei grün, neutral grau. */
.plate .kontra-mark {
  margin-top: 2px;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.plate .kontra-mark.party-gegner { color: var(--red); }
.plate .kontra-mark.party-rufer { color: #17773f; }
.plate .kontra-mark.party-neutral { color: #5d6b78; }
.plate .dots { display: flex; gap: 4px; margin-left: auto; }
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--grey-dot);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.dot.rufer { background: var(--green-dot); }
.dot.gegner { background: var(--red); }
.dot.kontra { background: var(--red); }
.dot.partner { background: var(--green-dot); }

.plate .stack { display: flex; align-items: center; }
.plate .stack .back {
  width: 22px; height: 32px;
  margin-left: -14px;
  border-radius: 3px;
  background: url("/cards/back.webp") center/cover no-repeat, var(--blue-700);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.plate .stack .back:first-child { margin-left: 0; }
.plate .stats {
  margin-left: 6px;
  white-space: nowrap;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.plate.active { outline: 2px solid var(--gold); }
.plate.turn { box-shadow: 0 0 0 2px var(--gold), 0 6px 18px rgba(0, 0, 0, 0.4); }
/* Ab dem Ruf steht jeder Name in der Farbe seiner Partei; Kontrageber als Gegner. */
.plate.party-rufer { border-color: rgba(31, 157, 85, 0.6); }
.plate.party-gegner { border-color: rgba(179, 37, 44, 0.5); }
.plate.party-rufer .name { color: #17773f; }
.plate.party-gegner .name { color: var(--red); }

.plate-north { top: 12px; left: 50%; transform: translateX(-50%); }
.plate-south { bottom: 12px; left: 50%; transform: translateX(-50%); }
.plate-west { left: 12px; top: 46%; transform: translateY(-50%); }
.plate-east { right: 12px; top: 46%; transform: translateY(-50%); }

/* Stich in der Mitte */
/* Nach der Haltezeit wandert der Stich zum Stecher (Punkt 6). */

.trick {
  transition: transform 360ms cubic-bezier(0.4, 0, 0.9, 0.4), opacity 360ms ease-in;
  position: absolute;
  left: 50%; top: 52%;
  width: calc(var(--trick-w) * 3.1);
  height: calc(var(--trick-h) * 2.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.trick::before {
  /* leichter Schatten unter dem Stich, damit er sich vom Filz abhebt */
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74%;
  height: 62%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.26), rgba(0, 0, 0, 0) 70%);
}

.trick.gather-north { transform: translate(-50%, calc(-50% - 26vh)) scale(0.62); opacity: 0; }
.trick.gather-south { transform: translate(-50%, calc(-50% + 26vh)) scale(0.62); opacity: 0; }
.trick.gather-west  { transform: translate(calc(-50% - 24vw), -50%) scale(0.62); opacity: 0; }
.trick.gather-east  { transform: translate(calc(-50% + 24vw), -50%) scale(0.62); opacity: 0; }

.card.trick.winner { box-shadow: 0 0 0 3px var(--gold), 0 8px 18px rgba(0, 0, 0, 0.45); }

.slot { position: absolute; width: var(--trick-w); height: var(--trick-h); }
.slot-north { left: 50%; top: 0; transform: translateX(-50%); }
.slot-south { left: 50%; bottom: 0; transform: translateX(-50%); }
.slot-west  { left: 0; top: 50%; transform: translateY(-50%); }
.slot-east  { right: 0; top: 50%; transform: translateY(-50%); }

/* Die eine Statusbox oben links am Tisch: alle Zustandsmeldungen. */
.status {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 3;
  text-align: left;
  max-width: min(340px, 46%);
  padding: 7px 11px 8px;
  border-radius: 10px;
  background: rgba(6, 14, 24, 0.62);
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-left: 3px solid var(--gold);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(3px);
  pointer-events: none;
}
.status[hidden] { display: none; }
.status strong { display: block; font-size: 15px; margin-bottom: 2px; }
.status div { font-size: 12px; color: rgba(255, 255, 255, 0.7); }

/* Warten: deutlich sichtbar für alle, nicht nur für den Tischchef. */
.paused-note {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.94);
  color: #221a04;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  font-size: 12px;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.paused-note[hidden] { display: none; }
.paused-note strong { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
.table.is-paused { box-shadow: inset 0 0 0 3px rgba(201, 162, 39, 0.75), inset 0 0 90px rgba(0, 0, 0, 0.45); }

/* Karten */

.card {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 7px;
  background: linear-gradient(175deg, #ffffff, #f2f4f6);
  border: 1px solid rgba(11, 15, 20, 0.28);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.32);
  color: var(--ink);
  overflow: hidden;
  user-select: none;
}

.card .corner {
  z-index: 3;
  position: absolute;
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 2px 4px 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(11, 15, 20, 0.1);
}
.card .corner.tl { top: 4px; left: 4px; }
/* Punkt 1: die gespiegelte Ecke unten rechts entfällt. */
.card .corner small { display: block; font-size: 15px; line-height: 1; margin-top: 1px; letter-spacing: 0; font-weight: 700; }

.card .face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 42px;
  opacity: 0.94;
}

.card .art {
  position: absolute;
  /* Das Motiv füllt die Karte wie bei einer echten Spielkarte. Die
     Rangzeichen liegen als Plakette darüber, damit nichts verdecken kann. */
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.card.with-art .face { display: none; }

.card.red { color: var(--red); }
.card.black { color: #16181c; }

/* Abgelegte Karten werden nicht ausgegraut (PDF-Korrektur 2, Punkt 5). */
.card.dim { opacity: 1; }

.card.flying { border-radius: 7px; box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45); }

@keyframes land {
  from { transform: scale(1.06); opacity: 0.6; }
  to { transform: scale(1); opacity: 1; }
}
.card.trick.landing { animation: land 170ms ease-out; }
/* Karten gleiten langsam vom jeweiligen Spielerrand in die Mitte, statt
   dort neu zu erscheinen (PDF-Korrektur 3, Punkt 13). */
.slot-north .card.trick.landing { animation: glide-north 260ms ease-out; }
.slot-south .card.trick.landing { animation: glide-south 260ms ease-out; }
.slot-west  .card.trick.landing { animation: glide-west 260ms ease-out; }
.slot-east  .card.trick.landing { animation: glide-east 260ms ease-out; }
@keyframes glide-north { from { transform: translateY(-120%) scale(0.92); opacity: 0.55; } to { transform: none; opacity: 1; } }
@keyframes glide-south { from { transform: translateY(120%) scale(0.92); opacity: 0.55; } to { transform: none; opacity: 1; } }
@keyframes glide-west  { from { transform: translateX(-120%) scale(0.92); opacity: 0.55; } to { transform: none; opacity: 1; } }
@keyframes glide-east  { from { transform: translateX(120%) scale(0.92); opacity: 0.55; } to { transform: none; opacity: 1; } }
.card.playable { cursor: pointer; }
.card.playable:hover { transform: translateY(-10px); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4); }

.card.trick { width: var(--trick-w); height: var(--trick-h); }
.card.trick .face { font-size: 50px; }
.card.trick.lead { box-shadow: 0 0 0 2px var(--gold), 0 6px 16px rgba(0, 0, 0, 0.4); }

.card.back {
  width: var(--trick-w); height: var(--trick-h);
  background: url("/cards/back.webp") center/cover no-repeat, var(--blue-700);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Punkte-Layout fuer Zahlkarten */

.card .face.court {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 30px;
  line-height: 1;
}
.card .face .rname {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.72;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.card .pips {
  position: absolute;
  inset: 16px 12px;
  display: grid;
  gap: 2px;
  place-items: center;
  font-size: 18px;
}
.card .pips.two { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; }
.card .pips.one { font-size: 46px; }

/* Hand */

.handbar {
  padding: 4px 12px max(10px, env(safe-area-inset-bottom));
  overflow: visible;
  flex: 0 0 auto;
}

.hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  min-height: calc(var(--card-h) + 12px);
  padding-top: 10px;
}

.hand .card {
  margin-left: -12px;
  transition: transform 120ms ease, box-shadow 120ms ease;
  transform-origin: bottom center;
}
.hand .card:first-child { margin-left: 0; }
.hand .card.playable:hover { transform: translateY(-14px) scale(1.03); z-index: 4; }
.hand .card.selected { transform: translateY(-22px) scale(1.04); z-index: 5; box-shadow: 0 0 0 2px var(--gold); }

.hand-empty {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  padding: 40px 0;
}

/* Chat */

.chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(247, 250, 252, 0.96);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(3, 12, 22, 0.35);
  overflow: hidden;
}

.chat-head {
  padding: 9px 12px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-100);
  background: var(--blue-700);
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}
.chat-log .msg { margin-bottom: 5px; }
.chat-log .msg b { color: var(--blue-700); }
.chat-log .sys { color: var(--ink-soft); font-style: italic; }

.chat-form {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid rgba(11, 15, 20, 0.1);
}
.chat-form input {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--blue-200);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
}
.chat-form button {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--blue-700);
  background: var(--blue-700);
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* Ergebnis */

.result {
  /* Vorgabe 09.11.2026: die Abrechnung lag ueber dem eigenen Namensschild
     (unten) und verdeckte dort Ansagen und Kartenpunkte. Sie sitzt jetzt in
     der Mitte ueber dem leeren Stichfeld und scrollt bei langen Analysen. */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 92%);
  max-height: min(72vh, 620px);
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  color: var(--ink);
}
.result h2 { margin: 0 0 6px; font-size: 17px; }
.result .line { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.result table { width: 100%; border-collapse: collapse; font-size: 13px; }
.result th, .result td { text-align: right; padding: 3px 6px; border-bottom: 1px solid rgba(11, 15, 20, 0.08); }
.result th:first-child, .result td:first-child { text-align: left; }
.result td.pos { color: var(--green-dot); font-weight: 700; }
.result td.neg { color: var(--red); font-weight: 700; }
/* Auftrag 2026-11-06b, Punkt 1: die Analyse (Postenzeilen) bleibt schwarz —
   rot/grün ist allein der Punkteverteilung je Spieler in der Tabelle
   vorbehalten; die Partei zeigt sich am Punkt am Zeilenbeginn. */
.result .score-points { color: inherit; font-weight: inherit; }
.result button {
  margin-top: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 9px;
  border: 1px solid var(--blue-700);
  background: linear-gradient(180deg, var(--blue-600), var(--blue-700));
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

/* Startbildschirm */

.start {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 12, 22, 0.86);
  backdrop-filter: blur(3px);
  z-index: 20;
  padding: 10px;
}
.start[hidden] { display: none; }

.start-box {
  width: min(420px, 92vw);
  background: var(--paper);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.start-box h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: 0.04em; }
.start-box .lead { margin: 0 0 16px; color: var(--ink-soft); font-size: 14px; }
.start-box label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); margin-bottom: 14px; }
.start-box select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px;
  font: inherit;
  font-size: 14px;
  border-radius: 9px;
  border: 1px solid var(--blue-200);
  background: #fff;
  color: var(--ink);
}
.start-box button {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--blue-700);
  background: linear-gradient(180deg, var(--blue-600), var(--blue-700));
  color: #fff;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.start-box .hint { margin: 12px 0 0; font-size: 12px; color: var(--ink-soft); min-height: 1em; }

/* Schmale Fenster */

@media (max-width: 980px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
  }
  .table { grid-row: 1; }
  .rail {
    grid-row: 2;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding-bottom: 2px;
  }
  .rail-block { min-width: 180px; padding: 8px; }
  .rail-block h3 { margin-bottom: 6px; }
  .rail-block button { margin-bottom: 4px; padding: 8px; }
  .rail-info { min-width: 150px; }
  .chat { display: none; }
  :root { --card-w: 68px; --card-h: 100px; --trick-w: 72px; --trick-h: 106px; }
  .plate { min-width: 118px; font-size: 12px; padding: 5px 7px; gap: 5px; }
  .plate .stack .back { width: 16px; height: 24px; margin-left: -11px; }
  .hand { justify-content: flex-start; overflow-x: auto; }
  .hand .card { margin-left: -14px; }
}

@media (max-width: 640px) {
  .top { padding: 8px 10px; gap: 10px; }
  .plate { min-width: 0; max-width: 42vw; padding: 4px 6px; gap: 4px; font-size: 11px; }
  .plate .stack { display: none; }
  .plate .stats { font-size: 10px; }
  .plate .sub { font-size: 10px; }
  .plate-west { left: 6px; }
  .plate-east { right: 6px; }
  .brand { font-size: 14px; letter-spacing: 0.1em; }
  .meta { font-size: 11px; }
  :root { --card-w: 62px; --card-h: 92px; --trick-w: 64px; --trick-h: 94px; }
  .hand { overflow-x: auto; justify-content: flex-start; padding-bottom: 2px; }
  .status { top: 10px; left: 10px; }
  .plate-west, .plate-east { top: 38%; }
  .status { font-size: 12px; max-width: 58%; }
}

/* ------------------------------------------------------------- Lobby ---- */

.lobby {
  /* Mehr Bildschirmfläche als früher (720 px), bleibt aber auf kleinen
     Fenstern scrollbar statt überzulaufen. */
  width: min(1120px, 100%);
  max-width: 100%;
  height: min(820px, 92vh);
  max-height: 92vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(170deg, var(--lobby-1), var(--lobby-2));
  border: 1px solid var(--lobby-edge);
  border-radius: 18px;
  padding: 26px 30px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  color: var(--ink);
}
.lobby h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: 0.04em; }
.lobby .lead { margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; }

.lobby-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}
.lobby-row label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
/* Angemeldete sehen kein Namensfeld — ohne diese Regel schlägt `display: block`
   das `hidden`-Merkmal. */
.lobby-row label[hidden] { display: none; }
.lobby-row input, .lobby-row select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px;
  font: inherit;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid var(--blue-200);
  background: #fff;
  color: var(--ink);
}
.lobby button {
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--blue-700);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.lobby button.primary {
  background: linear-gradient(180deg, var(--blue-600), var(--blue-700));
  color: #fff;
}
.lobby button:hover { border-color: var(--blue-500); }
.lobby button:disabled { opacity: 0.45; cursor: default; }

.lobby-list { border-top: 1px solid rgba(11, 15, 20, 0.1); }
.lobby-list-head, .table-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr 0.9fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 2px;
  font-size: 13px;
}
.lobby-list-head {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid rgba(11, 15, 20, 0.08);
}
.table-row { border-bottom: 1px solid rgba(11, 15, 20, 0.06); min-width: 0; }
.table-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-row .actions { display: flex; gap: 6px; }
.table-row .actions button { padding: 5px 8px; font-size: 12px; }
.table-row .status { color: var(--ink-soft); font-size: 12px; }
.lobby-empty { padding: 14px 2px; color: var(--ink-soft); font-size: 13px; }

.lobby-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.lobby-foot .hint { font-size: 12px; color: var(--ink-soft); }

/* --------------------------------------------------- Warten am Tisch ---- */

.waiting {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 24, 40, 0.72);
  backdrop-filter: blur(2px);
  z-index: 5;
}
.waiting[hidden] { display: none; }

.waiting-box {
  width: min(420px, 90%);
  background: var(--paper);
  border-radius: 16px;
  padding: 18px;
  color: var(--ink);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}
.waiting-box h2 { margin: 0 0 10px; font-size: 18px; }
.waiting-seats { display: grid; gap: 6px; margin-bottom: 10px; }
.waiting-seat {
  display: flex;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  background: #eef3f8;
  font-size: 13px;
}
.waiting-seat.empty { color: var(--ink-soft); background: #f4f6f8; }
.waiting-seat.bot { color: var(--blue-700); }
.waiting-seat.me { outline: 2px solid var(--gold); }
.waiting-box .hint { font-size: 12px; color: var(--ink-soft); min-height: 1em; }
.waiting-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.waiting-actions button {
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--blue-700);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.waiting-actions button.primary {
  background: linear-gradient(180deg, var(--blue-600), var(--blue-700));
  color: #fff;
}

/* Kartenset: Auswahl fuer den Tischchef, Anzeige fuer alle anderen */
.waiting-actions .set-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}
.waiting-actions .set-choice span { color: var(--ink-soft); }
.waiting-actions .set-choice select {
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--blue-700);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.waiting-actions .set-shown {
  padding: 8px 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* Spielerstand in der Leiste */

#rail-ranking table { width: 100%; border-collapse: collapse; font-size: 12px; }
#rail-ranking td { padding: 2px 0; }
#rail-ranking td.punkte { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
#rail-ranking td.werfen { width: 1%; padding-left: 6px; text-align: right; }
#rail-ranking .rail-kick {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 6px;
}
#rail-ranking .rail-kick:hover { color: var(--ink); background: rgba(127, 127, 127, 0.18); }
#rail-ranking .rail-rueckkehr { margin-top: 8px; display: grid; gap: 6px; }
#rail-ranking .rail-rueckkehr-zeile {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}
#rail-ranking .rail-rueckkehr-zeile button { font-size: 11px; padding: 3px 6px; }
#rail-ranking .rail-geworfen { margin: 8px 0 0; font-size: 11px; color: var(--ink-soft); }

/* Lobby auf schmalen Geräten: Tischname und Plätze untereinander, keine Spalten */

@media (max-width: 560px) {
  .lobby { width: min(720px, calc(100vw - 20px)); padding: 14px; border-radius: 14px; height: auto; max-height: 94vh; }
  .lobby h1 { font-size: 22px; }
  .lobby-row { grid-template-columns: 1fr; gap: 8px; }
  .lobby-list-head { display: none; }
  .table-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name actions"
      "info actions";
    row-gap: 2px;
    padding: 10px 2px;
  }
  .table-row > span:nth-child(1) { grid-area: name; font-weight: 600; }
  .table-row > span:nth-child(2) { grid-area: info; font-size: 11px; color: var(--ink-soft); }
  .table-row > span:nth-child(2)::before { content: "Chef "; }
  .table-row > span:nth-child(3) { display: none; }
  .table-row > span:nth-child(4) { grid-area: info; font-size: 11px; text-align: right; }
  .table-row .actions { grid-area: actions; flex-direction: column; }
  .table-row .actions button { padding: 6px 8px; }
  .lobby-foot { flex-direction: column; align-items: stretch; }
}

.lobby-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(11, 15, 20, 0.1);
  font-size: 13px;
}
.lobby-extra[hidden] { display: none; }
.lobby-extra .who {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--blue-200);
  text-underline-offset: 3px;
}
.lobby-extra input {
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--blue-200);
  font: inherit;
  font-size: 13px;
}
.lobby-extra button {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--blue-700);
  background: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.lobby-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.lobby-col h2 {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.lobby-col .chat-log {
  height: 120px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(11, 15, 20, 0.1);
  border-radius: 8px;
  padding: 6px;
  font-size: 12px;
}
.lobby-col .chat-form { display: flex; gap: 6px; margin-top: 6px; }
.lobby-col .chat-form input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--blue-200);
  font: inherit;
  font-size: 12px;
}
.lobby-col .chat-form button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--blue-700);
  background: linear-gradient(180deg, var(--blue-600), var(--blue-700));
  color: #fff;
  font: inherit;
  font-size: 12px;
}
.board-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; }
.board-row span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Spielerstand je Regelmodell: zwei getrennte Bereiche, gewertet und darunter
   „noch nicht gewertet". */
.board-section + .board-section { margin-top: 14px; }
.board-section h3 {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.board-sub {
  margin: 10px 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.board-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.board-table th {
  text-align: left;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 3px 4px;
  border-bottom: 1px solid rgba(11, 15, 20, 0.1);
}
.board-table td {
  padding: 3px 4px;
  border-bottom: 1px solid rgba(11, 15, 20, 0.05);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.board-table td:nth-child(2) { width: 100%; overflow: hidden; text-overflow: ellipsis; }
.board-empty { margin: 2px 0 0; font-size: 12px; }

@media (max-width: 560px) {
  .lobby-cols { grid-template-columns: 1fr; }
  .auth-box { max-height: 94vh; }
}

/* Karten- und Lobby-Schaltfläche in der Leiste */
.rail-links button {
  width: 100%;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--blue-700);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
/* Warten/Fortsetzen: pausiert ist der Knopf golden, damit der Zustand auffällt. */
#table-pause.on {
  background: linear-gradient(180deg, #e3c455, var(--gold));
  border-color: #8d7115;
  color: #221a04;
  font-weight: 700;
}

/* Infobereich Regeln in der Lobby */
.rules-panel {
  margin: 12px 0 0;
  border: 1px solid var(--blue-200);
  border-radius: 10px;
  background: var(--paper);
  padding: 10px 14px 14px;
  box-shadow: inset 0 1px 0 #fff, 0 6px 16px rgba(7, 26, 44, 0.1);
}
.rules-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rules-head strong { font-size: 14px; }
.rules-head button {
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
}
.rules-body { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }
.rules-body p { margin: 6px 0; }
.rules-lead { font-weight: 600; color: var(--ink); }
.rules-head { margin-top: 14px; font-weight: 700; color: var(--ink); }
.rules-sub { margin-top: 10px; font-weight: 700; color: var(--ink); }
.rules-list { margin: 4px 0 8px; padding-left: 18px; }
.rules-list li { margin: 1px 0; }
.rules-note { font-size: 11.5px; opacity: 0.85; }

/* Wer gibt, wird am Namensschild vermerkt */
.plate .sub[data-dealer]::after {
  content: ' · gibt';
  font-weight: 600;
  opacity: 0.75;
}

/* Auswahlzeilen in der Ansage-Runde */
.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 6px;
  font-size: 14px;
  cursor: pointer;
}
.choice input { accent-color: #1f9d55; width: 16px; height: 16px; }
.choice:hover { background: rgba(255, 255, 255, 0.1); }

/* Unauffällige Knöpfe (Passwort vergessen, Zurück) */
button.link {
  background: none;
  border: none;
  color: var(--blue-500);
  font-size: 13px;
  padding: 4px 0;
  cursor: pointer;
  text-decoration: underline;
}
button.link:hover { color: var(--blue-700); }

/* Gruppen in der Ansage */
.choice-group { margin-bottom: 10px; }
.choice-group h4 {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

/* Abrechnung: Einzelposten mit Parteifarben */
.score-lines {
  list-style: none;
  margin: 10px 0 12px;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.score-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  border-left: 3px solid transparent;
}
.score-line.party-rufer,
.score-line.party-gegner,
.score-line.party-neutral {
  /* Punkt 3 (Auftrag 2026-11-05f): die Partei zeigt sich nur am Punkt am
     Zeilenbeginn — Umrandung und Fläche der Zeile bleiben farblos. */
  border-left-color: transparent;
}
.score-line .party-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #9aa6b2;
}
.score-line.party-rufer .party-dot { background: #1f9d55; }
.score-line.party-gegner .party-dot { background: var(--red); }
/* Punkt 6/11: Parteifarbe auch vor den Spielernamen der Aufteilung. */
#result td .party-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  background: #9aa6b2;
}
#result td .party-dot.rufer { background: #1f9d55; }
#result td .party-dot.gegner { background: var(--red); }
/* Punkt 6: die Namen selbst bleiben schwarz/dunkel — die Farbe kommt nur vom
   Punkt davor. */
.score-line strong { font-weight: 700; }
/* Vorgabe 07.11.2026: Posten stehen in normaler Schrift; fett bleiben allein
   die Summen (Eintraege mit .score-line-summe). */
.score-line .score-label { font-weight: 400; }
.score-line-summe .score-label { font-weight: 700; }
/* Vorgabe 07.11.2026, Punkt 3: der Zusatztext stand in Weiss auf weissem
   Grund und war damit unsichtbar. */
.score-detail { color: rgba(20, 28, 38, 0.62); flex: 1 1 auto; }
/* Vorgabe 09.11.2026 (Z6): kurze Erklaerung, wofuer der Punkt steht. */
.score-legend {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(20, 28, 38, 0.62);
}
/* Punkt 5 (SPEC-auftrag-2026-11-05b.md): Vermerk „still"/„angesagt" direkt
   neben dem Postennamen, dezent aber sichtbar. */
.score-marking {
  /* Vorgabe 07.11.2026, Punkt 3: „still“/„angesagt“ war weiss auf weiss. */
  color: rgba(20, 28, 38, 0.8);
  border: 1px solid rgba(20, 28, 38, 0.3);
  border-radius: 8px;
  padding: 0 6px;
  font-size: 0.8em;
  white-space: nowrap;
}
/* Vorgabe 07.11.2026: Punktzahlen der Posten in normaler Schrift; fett sind
   allein die Summen (.score-points.score-sum). */
.score-points { font-variant-numeric: tabular-nums; font-weight: 400; }
.score-points { min-width: 62px; text-align: right; }
/* Punkt 3 (Auftrag 2026-11-05f): alle Zahlen der Analyse stehen schwarz —
   die Rot-Grün-Färbung bleibt allein in der Punkteverteilung je Spieler. */
.score-line-summe .score-detail { color: rgba(20, 28, 38, 0.62); }
/* Punkt 4a (Auftrag 2026-11-05): die Summen erscheinen als nackte Zahl. */
.score-points.score-sum { font-weight: 700; }
/* Kontra: eigene Zeile ohne Sonderfarbe. */
.score-line-kontra .score-factor {
  min-width: 52px;
  font-weight: 700;
}
#result td.seat-rufer { color: #6ee7a8; }
#result td.seat-gegner { color: #ffb3b3; }

/* Talon-Auswahl, Vogelpflicht, offene Haende ------------------------------ */
.card.picked {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
  transform: translateY(-10px);
}

.card.duty {
  box-shadow: 0 0 0 3px #1f9d55;
}

.open-hands {
  position: absolute;
  left: 16px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--paper);
  opacity: 0.9;
  max-width: 46%;
}

.open-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.open-name {
  font-weight: 700;
  color: var(--gold);
  min-width: 84px;
}

.open-card {
  background: rgba(7, 26, 44, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 1px 5px;
}

.talon-queue {
  position: absolute;
  right: 16px;
  bottom: 12px;
  font-size: 12px;
  color: var(--gold);
}

.hint {
  opacity: 0.8;
  font-size: 12px;
  margin: 4px 0 8px;
}

/* ------------------------------------------------- Öffentliche Startseite -- */

.start-public {
  /* Der Blau-Verlauf des Dokuments, ohne dass die Lobby dahinter durchscheint. */
  background: linear-gradient(160deg, var(--blue-950), var(--blue-800) 55%, var(--blue-700));
  backdrop-filter: none;
  overflow-y: auto;
}

.public {
  width: min(980px, 100%);
  max-height: calc(100vh - 20px);
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius);
  border-top: 4px solid var(--felt-1);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  padding: 26px 24px 18px;
  color: var(--ink);
}

.public-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

@media (min-width: 900px) {
  .public-inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 34px;
    align-items: center;
  }
}

.public-text { min-width: 0; }

/* Kartenfahne aus den vorhandenen Bildern, leicht gefächert. */
.fan {
  --fan-w: 92px;
  --fan-h: 136px;
  position: relative;
  height: calc(var(--fan-h) + 26px);
  margin: 0 0 16px;
  animation: fan-fade 220ms ease-out both;
}

.fan-card {
  position: absolute;
  top: 8px;
  left: 50%;
  width: var(--fan-w);
  height: var(--fan-h);
  margin-left: calc(var(--fan-w) / -2);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(7, 26, 44, 0.24);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.fan-card.fan-1 { transform: translateX(calc(var(--fan-w) * -1.02)) rotate(-15deg); z-index: 1; }
.fan-card.fan-2 { transform: translateX(calc(var(--fan-w) * -0.51)) rotate(-7deg); z-index: 2; }
.fan-card.fan-3 { transform: rotate(0deg); z-index: 5; }
.fan-card.fan-4 { transform: translateX(calc(var(--fan-w) * 0.51)) rotate(7deg); z-index: 3; }
.fan-card.fan-5 { transform: translateX(calc(var(--fan-w) * 1.02)) rotate(15deg); z-index: 1; }

@media (max-width: 480px) {
  .fan { --fan-w: 64px; --fan-h: 96px; }
}

@keyframes fan-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.public-title {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

@media (max-width: 480px) {
  .public-title { font-size: 27px; }
}

/* Goldene Haarlinie unter dem Titel — der einzige goldene Flächenakzent. */
.public-rule {
  height: 2px;
  width: min(240px, 62%);
  margin: 12px 0 14px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--gold), rgba(201, 162, 39, 0.35));
}

.public-lead {
  margin: 0 0 18px;
  max-width: 40ch;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.public-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.public-points li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.public-points svg { color: var(--felt-2); margin-top: 1px; }
.public-points b { color: var(--ink); font-weight: 600; }

.public-foot {
  margin: 18px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(11, 15, 20, 0.1);
  font-size: 12px;
  color: var(--ink-soft);
}

/* -------------------------------------------------------- Anmeldekasten -- */

.auth-box {
  min-width: 0;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid rgba(11, 15, 20, 0.08);
  box-shadow: 0 10px 26px rgba(7, 26, 44, 0.1);
  padding: 20px;
}

.auth-box h2.auth-title {
  margin: 0 0 2px;
  font-size: 20px;
  letter-spacing: 0.03em;
}

.auth-box .lead {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ink-soft);
}

.auth-box label {
  display: block;
  margin-bottom: 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.auth-box input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px;
  font: inherit;
  font-size: 15px;
  border-radius: 9px;
  border: 1px solid var(--blue-200);
  background: #fff;
  color: var(--ink);
}

.auth-box input:focus-visible,
.panel input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.auth-box button,
.panel button {
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--blue-700);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.auth-box button:hover,
.panel button:hover { border-color: var(--blue-500); }

.auth-box button.primary,
.panel button.primary {
  width: 100%;
  background: linear-gradient(180deg, var(--blue-600), var(--blue-700));
  color: #fff;
}

.auth-box button.link,
.panel button.link {
  width: auto;
  margin-top: 8px;
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--blue-700);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 6px;
}

.auth-box .hint {
  margin: 12px 0 0;
  min-height: 1.2em;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------- Profil, Verwaltung -- */

.panel {
  width: min(720px, 100%);
  max-width: 100%;
  max-height: 90vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius);
  border-top: 4px solid var(--felt-1);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  padding: 20px 22px;
  color: var(--ink);
}

.panel.panel-wide { width: min(940px, 100%); }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(11, 15, 20, 0.1);
}

.panel-head h2 { margin: 0; font-size: 22px; letter-spacing: 0.03em; }

.panel-close {
  border: none !important;
  background: none !important;
  font-size: 22px;
  line-height: 1;
  padding: 0 4px !important;
  color: var(--ink-soft);
}

.panel-sub { margin: 8px 0 14px; font-size: 13px; color: var(--ink-soft); }
.panel h3 { margin: 18px 0 8px; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

@media (min-width: 760px) {
  .panel-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.panel-block {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(11, 15, 20, 0.1);
  border-radius: 11px;
  background: #fff;
}

.panel-block h3 { margin: 0 0 8px; }

.panel label {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.panel input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px;
  font: inherit;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid var(--blue-200);
  background: #fff;
  color: var(--ink);
}

.panel .hint { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-soft); overflow-wrap: anywhere; }

.panel-status {
  margin: 14px 0 0;
  min-height: 1.2em;
  font-size: 13px;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.panel-status.ok { color: var(--felt-2); }
.panel-status.bad { color: var(--red); }

/* Kontenliste und Einladungen */

.admin-table { display: grid; gap: 2px; }

.admin-row {
  display: grid;
  /* Name, Mail, Partien, Passkeys, Zuletzt, Rolle/Status, Aktionen. */
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) 52px 62px 84px 132px 168px;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  font-size: 13px;
  border-bottom: 1px solid rgba(11, 15, 20, 0.07);
}

.admin-row.head {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom-color: rgba(11, 15, 20, 0.16);
}

.admin-row .mail,
.admin-row .actions { overflow-wrap: anywhere; }
.admin-row .actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.admin-row .actions button { padding: 4px 8px; font-size: 12px; }
.admin-row .tag { font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.admin-row .tag.admin { color: var(--felt-2); }
.admin-row .tag.off { color: var(--red); }
.admin-row .tag.on { color: var(--felt-2); }
.admin-row .tag.gone { color: var(--ink-soft); opacity: 0.75; }
.admin-row .link-cell {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
  word-break: break-all;
  color: var(--ink-soft);
}

/* Rolle und Status in einer Zelle: mehrere kleine Marken nebeneinander. */
.admin-row .tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
}
.admin-row .tag { white-space: nowrap; }

/* Einladungen: eigene Spaltenbreiten (Mail, Stand, Ablauf, Link, Von, Aktionen). */
.admin-row.invite {
  grid-template-columns: minmax(0, 1.2fr) 76px 74px minmax(0, 1.6fr) 84px 150px;
}

/* Mailprotokoll: Ausgang (Empfänger, Betreff, Zeitpunkt, Ergebnis) und
   Eingang (Absender, Betreff, Art, Textprobe, Zeitpunkt). */
.admin-mail-head {
  margin: 14px 0 4px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.admin-row.mail-out {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) 104px 136px;
}

.admin-row.mail-in {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) 96px minmax(0, 1.7fr) 104px;
}

.admin-row .snippet { color: var(--ink-soft); font-size: 12px; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .admin-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px 10px;
    padding: 9px 8px;
  }
  .admin-row.invite { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .admin-row.mail-out,
  .admin-row.mail-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .admin-row.head { display: none; }
  .admin-row .actions { justify-content: flex-start; grid-column: 1 / -1; }
}

.admin-invite-form { margin-top: 14px; }

/* ------------------------------------------------------------- Passkeys -- */

/* Haarlinie mit „oder" zwischen Passwort und Passkey. */
.auth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.auth-or::before,
.auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(11, 15, 20, 0.14);
}

.passkey-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.passkey-empty {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--ink-soft);
}

.passkey-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(11, 15, 20, 0.08);
}

.passkey-row:last-child { border-bottom: none; }

.passkey-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.passkey-name {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.passkey-meta {
  font-size: 11px;
  color: var(--ink-soft);
}

.passkey-row .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.passkey-row .actions button {
  padding: 4px 8px;
  font-size: 12px;
}

.passkey-row input {
  margin-top: 0;
  padding: 5px 8px;
  font-size: 13px;
}

/* Bewegung nur, wenn sie erwünscht ist. */
@media (prefers-reduced-motion: reduce) {
  .fan,
  .fan-card,
  .auth-box button,
  .panel button {
    animation: none !important;
    transition: none !important;
  }
}

/* Ansage: Tarockzahl als Auswahlliste, gesperrte Zahlen bleiben sichtbar. */
.declare-number {
  width: 100%;
  padding: 0.35rem 0.5rem;
  font: inherit;
  color: inherit;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--gold-dim, rgba(212, 175, 55, 0.4));
  border-radius: 4px;
}
.declare-number option:disabled {
  color: rgba(255, 255, 255, 0.35);
}
/* Der Rufknopf trägt die vorgeschlagene Zahl („Tarock 19 rufen"). */
.call-number,
.call-kontra {
  width: 100%;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.call-number:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Punkt 1 (Auftrag 2026-11-05): Offline-Markierung am Namensschild. */
.plate.offline .name { color: rgba(255, 255, 255, 0.45); }
.plate .offline {
  font-size: 10px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 1px 4px;
}
