/* Skat-Akademie Klassenraum – Stil (dunkel, Beamer-tauglich, wie Mockup) */
:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #222633;
  --border: #2a2e3b;
  --border-2: #3a3f50;
  --text: #e4e6ed;
  --text-2: #c5c8d6;
  --muted: #9a9eb2;
  --primary: #5b4bd6;
  --primary-hover: #6b5ce6;
  --accent: #b3acff;
  --accent-2: #d4d0ff;
  --felt: #1d4a38;
  --felt-border: #2b6650;
  --felt-text: #dff2e9;
  --felt-muted: #bfe3d2;
  --gold: #e3b341;
  --online: #3ecf8e;
  --offline: #6b7083;
  --error: #ff7a6e;
  --error-bg: rgba(231, 76, 60, 0.14);
  --ok: #3ecf8e;
  --ok-bg: rgba(46, 204, 113, 0.14);
  --font: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 17px; line-height: 1.45; min-height: 100vh; }
a { color: var(--accent); } a:hover { color: var(--accent-2); }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------------- Kopf ---------------- */
.kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--border); }
.kopf-links { display: flex; align-items: baseline; gap: 12px; }
.logo { font-size: 22px; font-weight: 700; color: var(--accent); }
.logo-sub { font-size: 15px; color: var(--muted); }
.kopf-mitte { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kopf-rechts { display: flex; align-items: center; gap: 14px; }
.kopf-name { font-size: 15px; color: var(--muted); }
.raum-titel { font-size: 17px; font-weight: 500; }

/* ---------------- Buttons ---------------- */
.btn { font-size: 16px; padding: 11px 18px; min-height: 46px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, border-color .15s; }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primaer { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.btn-primaer:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-leise { background: transparent; color: var(--text-2); }
.btn-gross { font-size: 19px; padding: 15px 28px; min-height: 56px; border-radius: 12px; }
.btn-klein { font-size: 14px; padding: 7px 12px; min-height: 40px; border-radius: 8px; }
.btn-filz { background: transparent; border-color: var(--felt-border); color: var(--felt-text); }
.btn-gefahr { background: transparent; border-color: #6a3a3a; color: #ffb4ac; }

/* ---------------- Layout ---------------- */
.haupt { padding: 28px; }
.laden { color: var(--muted); padding: 60px; text-align: center; }
.spalten { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.spalte-haupt { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.spalte-seite { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.zentriert { display: flex; flex-wrap: wrap; gap: 32px; justify-content: center; align-items: flex-start; padding-top: 20px; }

.karte { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px 28px; display: flex; flex-direction: column; gap: 16px; }
.karte-schmal { flex: 0 1 520px; min-width: 0; padding: 32px; }
.karte h1 { font-size: 30px; font-weight: 700; }
.karte h2 { font-size: 21px; font-weight: 700; }
.zeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 12px; }
.hinweis { font-size: 15px; color: var(--muted); }
.text { font-size: 18px; color: var(--text-2); line-height: 1.55; }
.etikett { font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------------- Login ---------------- */
.login { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; }
.login h1 { font-size: 38px; color: var(--accent); }
.login p { max-width: 460px; color: var(--text-2); font-size: 18px; }

/* ---------------- Formulare ---------------- */
.feld { display: flex; flex-direction: column; gap: 8px; }
.feld label { font-size: 15px; font-weight: 700; color: var(--text-2); }
.eingabe { font-family: inherit; font-size: 18px; padding: 12px 16px; min-height: 52px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--bg); color: var(--text); width: 100%; }
.eingabe:focus { border-color: var(--accent); outline: none; }
.eingabe-code { font-size: 34px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; border: 2px solid var(--primary); }

/* ---------------- Listen ---------------- */
.liste { display: flex; flex-direction: column; gap: 8px; }
.eintrag { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
.eintrag-links { display: flex; align-items: center; gap: 10px; min-width: 0; }
.eintrag-name { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eintrag-rechts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.punkt { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--offline); }
.punkt.an { background: var(--online); }
.leer { color: var(--muted); font-size: 15px; padding: 12px; text-align: center; border: 1px dashed var(--border-2); border-radius: 10px; }

/* ---------------- Badges ---------------- */
.badge { font-size: 14px; font-weight: 700; padding: 4px 10px; border-radius: 6px; background: var(--border); color: var(--text); white-space: nowrap; }
.badge-filz { background: var(--felt); color: var(--felt-text); }
.badge-gold { background: var(--gold); color: #141414; }
.badge-sitz { color: #8fd3b4; background: transparent; padding: 0; }
.badge-hand { background: var(--gold); color: #141414; display: inline-flex; align-items: center; gap: 4px; }

/* ---------------- Raum-Code ---------------- */
.code-karte { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.code { font-size: 56px; font-weight: 700; letter-spacing: .12em; line-height: 1.05; }
.code-link { font-size: 16px; color: var(--muted); word-break: break-all; }

/* ---------------- Tisch / Sitze ---------------- */
.sitze { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.sitz { background: var(--felt); border: 1px solid var(--felt-border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; min-height: 150px; }
.sitz-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sitz-platz { font-size: 15px; font-weight: 700; letter-spacing: .05em; color: var(--felt-muted); }
.sitz-rolle { font-size: 14px; color: var(--felt-muted); }
.sitz-name { font-size: 24px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; }
.sitz-frei { font-size: 18px; color: var(--felt-muted); font-style: italic; }
.sitz.ich { outline: 3px solid var(--accent); outline-offset: -3px; }

/* ---------------- Status-Banner ---------------- */
.banner { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 12px; background: var(--surface-2); font-size: 18px; line-height: 1.45; }
.banner svg { flex-shrink: 0; color: var(--accent); }

/* ---------------- Toast ---------------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; padding: 14px 22px; border-radius: 12px; font-size: 16px; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); z-index: 50; }
.toast.sichtbar { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-fehler { background: #3a1f1f; border-color: #6a3a3a; color: #ffd2cc; }
.toast-ok { background: #173326; border-color: #2b6650; color: #dff2e9; }

/* ---------------- Modal ---------------- */
.modal-hg { position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; max-width: 520px; width: 100%; display: flex; flex-direction: column; gap: 18px; }
.modal h2 { font-size: 22px; }
.vollbild-code { position: fixed; inset: 0; background: var(--bg); z-index: 45; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 20px; text-align: center; }
.vollbild-code .code { font-size: clamp(64px, 16vw, 220px); }
.vollbild-code .code-link { font-size: clamp(18px, 2.4vw, 32px); }

/* ---------------- Klein ---------------- */
@media (max-width: 700px) {
  .kopf, .haupt { padding-left: 16px; padding-right: 16px; }
  .karte { padding: 20px; }
  .code { font-size: 42px; }
}

/* =====================================================================
   E2 – SPIELTISCH
   ===================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.filz { background: var(--felt); border: 1px solid var(--felt-border); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 16px; min-height: 720px; color: var(--felt-text); }
.filz-oben { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.gegner { display: flex; flex-direction: column; gap: 8px; max-width: 48%; min-width: 0; }
.gegner-rechts { align-items: flex-end; text-align: right; }
.filz-mitte { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 230px; }
.filz-dialog { display: flex; justify-content: center; }
.unten { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.sitz-kopfzeile { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gegner-rechts .sitz-kopfzeile { justify-content: flex-end; }
.sitz-name-klein { font-size: 19px; font-weight: 700; color: #fff; }
.filz .hinweis { color: var(--felt-muted); }

/* Karten */
.kb { display: block; width: auto; height: auto; border-radius: 7px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); user-select: none; }
.hand { display: flex; align-items: flex-end; flex-wrap: nowrap; padding-top: 22px; }
.hand-gross img.kb { height: 150px; }
.hand-mittel img.kb { height: 96px; }
.hand-klein img.kb { height: 64px; }
.hand-gross > * + * { margin-left: -46px; }
.hand-mittel > * + * { margin-left: -34px; }
.hand-klein > * + * { margin-left: -22px; }
.hand-klein { padding-top: 4px; }
.hand-ruecken { padding-top: 4px; }
.hand-ruecken > * + * { margin-left: -36px; }
.karte-ruecken { display: inline-block; width: 54px; height: 78px; border-radius: 6px; background: repeating-linear-gradient(45deg, #3a4ba8 0 6px, #33429a 6px 12px); border: 3px solid #f2f2f2; box-shadow: 0 2px 5px rgba(0,0,0,.35); }
.karte-btn { padding: 0; border: none; background: none; cursor: pointer; border-radius: 8px; transition: transform .12s; }
.karte-btn:hover { transform: translateY(-10px); }
.karte-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.karte-btn.gewaehlt, img.kb.gewaehlt { transform: translateY(-20px); }
.karte-btn.gewaehlt img { outline: 4px solid var(--accent); outline-offset: -4px; }
.karte-btn.spielbar img, img.kb.spielbar { outline: 3px solid #8b7fff; outline-offset: -3px; }
.karte-btn.spielbar { transform: translateY(-12px); }
.karte-btn.gesperrt img, img.kb.gesperrt { filter: brightness(.62); }
.karte-mini { height: 54px !important; display: inline-block; vertical-align: middle; margin-right: 3px; }

/* Stich als Stapel */
.stapel { position: relative; width: 300px; height: 210px; }
.stapel-karte { position: absolute; left: 50%; top: 50%; height: 150px; box-shadow: 0 6px 14px rgba(0,0,0,.45); }
.skat-info { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: center; font-size: 15px; padding: 8px 12px; border-radius: 10px; background: #163a2c; }

/* Dialoge */
.dialog { background: rgba(15,17,23,.92); border: 1px solid var(--border-2); border-radius: 14px; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; color: var(--text); max-width: 760px; }
.dialog-titel { font-size: 19px; }
.status-zeile { font-size: 18px; font-weight: 700; padding: 8px 18px; border-radius: 999px; background: rgba(15,17,23,.85); color: #fff; }
.status-du { box-shadow: 0 0 0 2px var(--accent) inset; }
.stellvertreter-hinweis { font-size: 15px; font-weight: 700; color: var(--gold); text-align: center; margin-bottom: 6px; }
.auswahl-klein { width: auto; min-height: 46px; font-size: 16px; padding: 8px 12px; }
.optionen { display: flex; flex-wrap: wrap; gap: 16px; }
.option { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; min-height: 44px; cursor: pointer; }
.option input { width: 20px; height: 20px; }
.option.gesperrt { opacity: .6; }

/* Seitenpanel */
.liste-kompakt { display: flex; flex-direction: column; gap: 6px; }
.zeile-kompakt { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; }
.mini-stich { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-karte { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mini-karte img { margin: 0; }
.mini-karte.sieger img { outline: 3px solid var(--gold); outline-offset: -3px; }
.schalter { justify-content: space-between; width: 100%; }
.schalter strong { color: var(--accent-2); }
.badge-zug { background: transparent; border: 1px solid var(--accent); color: #fff; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-fehler { background: var(--error-bg); color: var(--error); }
.bereit-marke { font-size: 15px; color: var(--felt-muted); }
.bereit-marke.ja { color: #8ff0c0; font-weight: 700; }

/* Augenleiste (Lehrer) */
.augenleiste { position: relative; display: flex; height: 18px; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.augenleiste .al-skat { background: #b8902f; }
.augenleiste .al-as { background: var(--gold); }
.augenleiste .al-frei { flex: 1; }
.augenleiste .al-gs { background: var(--online); }
.augenleiste .al-grenze { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; opacity: .8; }
.augenleiste .al-grenze-90 { opacity: .4; }
.farbe-as { color: var(--gold); }
.farbe-gs { color: #8fd3b4; }

/* Ergebnis */
.ergebnis-haende { display: flex; flex-wrap: wrap; gap: 18px; }
.ergebnis-hand { display: flex; flex-direction: column; gap: 4px; }
.trenner { display: inline-block; width: 14px; }
.hand-klein > .trenner + img { margin-left: 0; }

@media (max-width: 900px) {
  .hand-gross img.kb { height: 110px; }
  .hand-gross > * + * { margin-left: -40px; }
  .gegner { max-width: 100%; }
  .stapel { width: 240px; height: 180px; }
  .stapel-karte { height: 120px; }
}
.ansage-banner { font-size: 22px; padding: 10px 22px; border-radius: 12px; background: rgba(15,17,23,.88); color: #fff; text-align: center; border: 1px solid var(--gold); }
.ansage-banner strong { color: var(--gold); }
.ansage-leise { font-size: 18px; border-color: var(--border-2); }
.ansage-leise strong { color: #fff; }
.ansage-zusatz { display: inline-block; margin-left: 10px; font-size: 15px; color: var(--muted); }
