/* ============================================================
   Farben & Formen kommen aus Variablen – die Skins weiter unten
   überschreiben nur diese Variablen.
   ============================================================ */
:root, [data-skin="standard"] {
  --bg: #46178f;          /* Hintergrund oben */
  --bg2: #2d0f5e;         /* Hintergrund unten */
  --fg: #ffffff;          /* Schrift auf dem Hintergrund */
  --card: #ffffff;        /* Karten / Kästen */
  --text: #1b1b1b;        /* Schrift in Karten */
  --muted: #6b6b6b;
  --a0: #e21b3c;          /* Antwortfarben */
  --a1: #1368ce;
  --a2: #d89e00;
  --a3: #26890c;
  --ans-fg: #ffffff;      /* Schrift & Symbol auf den Antwortfeldern */
  --accent: #ffffff;      /* helle Knöpfe (Start, Weiter …) */
  --accent-fg: #46178f;
  --btn: #333333;         /* normale Knöpfe */
  --chip: rgba(255,255,255,.15);  /* Namens-Kärtchen in der Lobby */
  --bar: rgba(0,0,0,.2);          /* Leisten */
  --ok-fg: #7dff5c;       /* "Richtig!" auf dem Handy */
  --bad-fg: #ff8a9c;      /* "Leider falsch" */
  --gold: #ffd34d; --bronze: #e0a36b;
  --radius: 6px;
  --shadow: 0 4px 0 rgba(0,0,0,.3);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;

  /* feste Bedienfarben im Lehrer-Bereich (unabhängig vom Skin) */
  --ui-go: #26890c; --ui-stop: #d0312d; --ui-edit: #1368ce;
  --bad: #e21b3c;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: linear-gradient(160deg, var(--bg), var(--bg2)) fixed;
  color: var(--fg);
  min-height: 100vh;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; text-align: center; padding: 16px; }
.card { background: var(--card); color: var(--text); border-radius: calc(var(--radius) + 4px); padding: 20px; box-shadow: var(--shadow); width: 100%; max-width: 420px; }
h1 { font-size: clamp(28px, 5vw, 52px); margin: 0 0 12px; }
h2 { margin: 0 0 12px; }
input, select, textarea {
  font: inherit; width: 100%; padding: 12px; border: 2px solid #ccc; border-radius: var(--radius); margin-bottom: 10px; text-align: inherit;
  background: #fff; color: #1b1b1b;
}
input.big { font-size: 22px; font-weight: 700; text-align: center; }
button, .btn {
  font: inherit; font-weight: 700; border: 0; border-radius: var(--radius); padding: 12px 20px; cursor: pointer;
  background: var(--btn); color: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.35); text-decoration: none; display: inline-block;
}
button:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
button:disabled { opacity: .5; cursor: default; }
button.full { width: 100%; }
button.light { background: var(--accent); color: var(--accent-fg); }
button.ghost { background: transparent; color: inherit; box-shadow: none; text-decoration: underline; padding: 6px; }
.err { color: var(--bad); min-height: 1.4em; font-weight: 600; margin-top: 8px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Lobby */
.pinbox { background: var(--card); color: var(--text); border-radius: calc(var(--radius) + 4px); padding: 12px 28px; display: inline-block; margin-bottom: 20px; box-shadow: var(--shadow); }
.pinbox .pin { font-size: clamp(48px, 10vw, 96px); font-weight: 900; letter-spacing: 6px; line-height: 1; }
.players { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 20px 0; }
.players span { background: var(--chip); padding: 8px 14px; border-radius: var(--radius); font-weight: 700; cursor: pointer; }
.players span:hover { background: var(--bad); color: #fff; text-decoration: line-through; }

/* Frage */
.qtext { background: var(--card); color: var(--text); font-size: clamp(22px, 3.5vw, 40px); font-weight: 700; padding: 20px; border-radius: calc(var(--radius) + 2px); text-align: center; margin-bottom: 16px; box-shadow: var(--shadow); }
.qbar { display: flex; justify-content: space-between; align-items: center; margin: 16px 0; gap: 12px; }
.timer { width: 90px; height: 90px; border-radius: 50%; background: var(--bg2); color: var(--fg); border: 4px solid var(--fg); display: grid; place-items: center; font-size: 36px; font-weight: 900; }
.stat { text-align: center; font-size: 22px; font-weight: 700; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ans { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius); font-size: clamp(18px, 2.4vw, 28px); font-weight: 700; color: var(--ans-fg); box-shadow: var(--shadow); min-height: 90px; text-align: left; }
.ans.dim { opacity: .3; }
.ans .count { margin-left: auto; font-size: 1.1em; }
.a0 { background: var(--a0); --glow: var(--a0); } .a1 { background: var(--a1); --glow: var(--a1); }
.a2 { background: var(--a2); --glow: var(--a2); } .a3 { background: var(--a3); --glow: var(--a3); }
.shape { width: 36px; height: 36px; flex: none; fill: currentColor; color: var(--ans-fg); }

/* Spieler-Buttons */
.pad { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; height: calc(100vh - 90px); padding: 10px; }
.pad button { border-radius: calc(var(--radius) + 2px); display: grid; place-items: center; color: var(--ans-fg); box-shadow: var(--shadow); }
.pad button .shape { width: 30%; height: 30%; max-width: 110px; max-height: 110px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--bar); font-weight: 700; height: 50px; }
.result { font-size: 34px; font-weight: 900; }
.result.ok { color: var(--ok-fg); } .result.bad { color: var(--bad-fg); }
.points { font-size: 24px; background: var(--bar); padding: 8px 18px; border-radius: var(--radius); margin-top: 12px; display: inline-block; }

/* Rangliste */
.board { list-style: none; padding: 0; margin: 0 auto; max-width: 640px; }
.board li { display: flex; justify-content: space-between; background: var(--card); color: var(--text); margin-bottom: 8px; padding: 12px 18px; border-radius: var(--radius); font-size: 22px; font-weight: 700; box-shadow: var(--shadow); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin: 30px 0; }
.podium div { background: var(--card); color: var(--text); width: min(30vw, 200px); border-radius: calc(var(--radius) + 2px) calc(var(--radius) + 2px) 0 0; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; padding: 14px 6px; font-weight: 800; }
.podium .p1 { height: 240px; background: var(--gold); color: #1b1b1b; } .podium .p2 { height: 180px; } .podium .p3 { height: 140px; background: var(--bronze); color: #1b1b1b; }
.podium .place { font-size: 40px; }
.podium .nm { font-size: 20px; word-break: break-word; }

/* Editor & Listen (Lehrer-Bereich) */
.qedit { background: var(--card); color: var(--text); border-radius: calc(var(--radius) + 2px); padding: 16px; margin-bottom: 16px; }
.qedit .row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.qedit .row input[type=text] { margin: 0; }
.qedit .row input[type=radio] { width: 22px; height: 22px; margin: 0; flex: none; }
.qedit .sw { width: 14px; align-self: stretch; border-radius: 4px; flex: none; }
.list { list-style: none; padding: 0; }
.list li { background: var(--card); color: var(--text); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list li .t { flex: 1; font-weight: 700; min-width: 160px; }
button.play { background: var(--ui-go); } button.del { background: var(--ui-stop); } button.edit { background: var(--ui-edit); }

/* Skin-Auswahl in den Einstellungen */
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.skin-card { all: unset; box-sizing: border-box; cursor: pointer; border-radius: 10px; overflow: hidden; background: #fff; color: #1b1b1b; box-shadow: 0 2px 6px rgba(0,0,0,.25); outline: 3px solid transparent; transition: outline-color .15s, transform .15s; }
.skin-card:hover { transform: translateY(-2px); }
.skin-card:focus-visible { outline-color: #1368ce; }
.skin-card.selected { outline: 4px solid #26890c; }
.skin-card .mini { background: linear-gradient(160deg, var(--bg), var(--bg2)); padding: 10px; font-family: var(--font); }
.skin-card .mini .mq { background: var(--card); color: var(--text); border-radius: var(--radius); font-size: 11px; font-weight: 700; padding: 5px; text-align: center; margin-bottom: 6px; }
.skin-card .mini .mg { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.skin-card .mini .mg span { height: 30px; border-radius: var(--radius); display: grid; place-items: center; }
.skin-card .mini .shape { width: 18px; height: 18px; }
.skin-card .info { padding: 8px 10px 10px; font-size: 13px; line-height: 1.35; }
.skin-card .info b { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 2px; }

/* Musik-Leiste (Beamer) */
.musicbar { position: fixed; right: 12px; bottom: 12px; display: flex; gap: 10px; align-items: center; background: var(--bar); color: var(--fg); padding: 6px 10px; border-radius: 8px; font-size: 13px; opacity: .55; transition: opacity .2s; }
.musicbar:hover { opacity: 1; }
.musicbar button { padding: 4px 10px; font-size: 20px; background: transparent; box-shadow: none; }
/* Hinweis, wenn der Browser den Ton noch sperrt */
.musicbar.attention { opacity: 1; background: var(--accent); color: var(--accent-fg); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* Timer in den letzten 5 Sekunden */
.timer.urgent { background: var(--bad); color: #fff; }

/* Ein/Aus-Schalter */
.switch { position: relative; width: 52px; height: 28px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #bbb; border-radius: 28px; transition: background .2s; }
.switch span::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--ui-go); }
.switch input:checked + span::before { transform: translateX(24px); }
.switch input:focus-visible + span { outline: 3px solid var(--ui-edit); outline-offset: 2px; }

@media (max-width: 640px) {
  .answers { grid-template-columns: 1fr; }
  .ans { min-height: 60px; }
}

/* ============================================================
   SKINS  – gelten für die ganze Seite (<html data-skin="…">)
   und für die Vorschau-Kärtchen in den Einstellungen.
   Neuer Skin: Block kopieren, Variablen ändern und in app.js
   (SKINS) mit Namen und Symbolen eintragen.
   ============================================================ */

/* Ozean: tiefes Blau, Koralle/Türkis/Sand/Violett, runde Ecken */
[data-skin="ozean"] {
  --bg: #0b5575; --bg2: #03263a; --fg: #ffffff;
  --card: #f2fbff; --text: #0b2a3a; --muted: #4f6b78;
  --a0: #e85d4a; --a1: #0f9d94; --a2: #d68a00; --a3: #6b4fb8;
  --ans-fg: #ffffff;
  --accent: #ffd166; --accent-fg: #03263a;
  --btn: #0b3d54;
  --chip: rgba(255,255,255,.16); --bar: rgba(0,0,0,.22);
  --ok-fg: #7ff2c8; --bad-fg: #ffb3a7;
  --radius: 14px; --shadow: 0 6px 16px rgba(0,0,0,.28);
  --font: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

/* Kreidetafel: grüne Tafel, Pastell-Kreide, Buchstaben A–D */
[data-skin="kreide"] {
  --bg: #2f5241; --bg2: #1c3328; --fg: #f4f1e6;
  --card: #f4f1e6; --text: #23332a; --muted: #6b705f;
  --a0: #f2a7b9; --a1: #9fd3f2; --a2: #f5dc7c; --a3: #b4e3a3;
  --ans-fg: #1c3328;
  --accent: #f4f1e6; --accent-fg: #1c3328;
  --btn: #3c2f23;
  --chip: rgba(244,241,230,.16); --bar: rgba(0,0,0,.25);
  --ok-fg: #c8f2b5; --bad-fg: #ffc2cf;
  --radius: 4px; --shadow: 0 3px 0 rgba(0,0,0,.35);
  --font: "Chalkboard SE", "Comic Sans MS", "Comic Neue", "Segoe Print", cursive;
}

/* Neon: dunkel, leuchtende Farben mit Glow */
[data-skin="neon"] {
  --bg: #1a0636; --bg2: #05010f; --fg: #f3eaff;
  --card: #1d0f38; --text: #f3eaff; --muted: #b3a4d6;
  --a0: #ff2e97; --a1: #00d9ff; --a2: #c6ff00; --a3: #ff9100;
  --ans-fg: #12041f;
  --accent: #00d9ff; --accent-fg: #05010f;
  --btn: #3a1a6e;
  --chip: rgba(0,217,255,.14); --bar: rgba(0,0,0,.4);
  --ok-fg: #c6ff00; --bad-fg: #ff5cb0;
  --gold: #c6ff00; --bronze: #ff9100;
  --radius: 10px; --shadow: 0 0 0 2px rgba(255,255,255,.08), 0 0 22px rgba(0,217,255,.18);
  --font: "Segoe UI", system-ui, sans-serif;
}
/* Glow in der Farbe des jeweiligen Antwortfelds */
[data-skin="neon"] .ans, [data-skin="neon"] .pad button, [data-skin="neon"] .mg span { filter: drop-shadow(0 0 10px var(--glow)); }
.skin-card:not([data-skin="neon"]) .mg span { filter: none; }
[data-skin="neon"] .qtext, [data-skin="neon"] .pinbox { border: 1px solid rgba(0,217,255,.35); }

/* Papier: hell und schlicht, Zahlen 1–4 */
[data-skin="papier"] {
  --bg: #f5f6f8; --bg2: #e3e6ec; --fg: #1d2330;
  --card: #ffffff; --text: #1d2330; --muted: #667085;
  --a0: #d9480f; --a1: #5f3dc4; --a2: #0b7285; --a3: #c2255c;
  --ans-fg: #ffffff;
  --accent: #1d2330; --accent-fg: #ffffff;
  --btn: #1d2330;
  --chip: rgba(29,35,48,.08); --bar: rgba(29,35,48,.07);
  --ok-fg: #2b8a3e; --bad-fg: #c92a2a;
  --gold: #ffd43b; --bronze: #f0a868;
  --radius: 8px; --shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.08);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ============================================================
   Login-Formulare
   ============================================================ */
.card { text-align: left; }
.field-label { display: block; font-size: 14px; font-weight: 700; margin: 2px 0 4px; }
.small { font-size: 13px; }
button.ghost.small { font-size: 13px; padding: 2px 4px; }
.center .card p { margin-bottom: 0; }

/* ============================================================
   Admin-Backend
   ============================================================ */
:root, [data-skin] { --chart: #2a78d6; }
[data-skin="neon"] { --chart: #3987e5; }

.bk-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 18px; }
.tabs button { background: var(--bar); color: var(--fg); box-shadow: none; padding: 9px 14px; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-fg); }
.panel { background: var(--card); color: var(--text); border-radius: calc(var(--radius) + 2px); padding: 16px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 18px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.banner { background: #fff3cd; color: #5c4400; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--card); color: var(--text); border-radius: calc(var(--radius) + 2px); padding: 12px 14px; position: relative; }
.kpi .v { font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 13px; color: var(--muted); margin-top: 2px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi .x { position: absolute; top: 6px; right: 6px; }
/* Reihe 1: drei große Kacheln, Reihe 2: sechs kleine */
.kpis.main { grid-template-columns: repeat(3, 1fr); margin-bottom: 10px; }
.kpis.main .kpi { padding: 16px 18px; }
.kpis.main .kpi .v { font-size: 38px; }
.kpis.main .kpi .l { font-size: 15px; font-weight: 700; color: var(--text); }
.kpis.small { grid-template-columns: repeat(6, 1fr); gap: 8px; }
.kpis.small .kpi { padding: 9px 10px; }
.kpis.small .kpi .v { font-size: 22px; }
.kpis.small .kpi .l { font-size: 12px; padding-right: 14px; }
.kpis.small .kpi .sub { font-size: 11px; margin-top: 2px; }
.kpis.small .kpi .x { top: 3px; right: 3px; font-size: 12px; }
/* Status-Plakette in der Kachel "Quiz online" */
.kpi .status { position: absolute; top: 12px; right: 12px; font-size: 12px; font-weight: 700; padding: 3px 10px 3px 8px; border-radius: 99px; }
.kpi .status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: currentColor; }
.kpi .status.on { background: #d3f9d8; color: #1b5e20; }
.kpi .status.off { background: #ececec; color: #5f5f5f; }
.kpi.is-active { box-shadow: inset 0 0 0 2px #2fb344; }
@media (max-width: 900px) { .kpis.small { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) {
  .kpis.main { grid-template-columns: 1fr; }
  .kpis.small { grid-template-columns: repeat(2, 1fr); }
}

/* kleine Lösch-/Aktionsknöpfe */
button.icon { background: transparent; color: var(--muted); box-shadow: none; padding: 2px 6px; font-size: 14px; border-radius: 4px; }
button.icon:hover, button.icon:focus-visible { background: rgba(208,49,45,.12); color: var(--ui-stop); }
button.mini { padding: 5px 10px; font-size: 13px; box-shadow: none; }

/* Tabellen */
.tbl-wrap { overflow-x: auto; position: relative; }   /* hält auch unsichtbare Hilfstexte im Rahmen */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 7px 8px; border-bottom: 1px solid rgba(128,128,128,.22); vertical-align: middle; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .actions { white-space: nowrap; text-align: right; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.badge.ok { background: #d3f9d8; color: #1b5e20; }
.badge.warn { background: #fff3cd; color: #6b4e00; }
.badge.stop { background: #ffe0e0; color: #8a1c1c; }

/* Balkendiagramm (eine Reihe pro Diagramm) */
.chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding-top: 18px; border-bottom: 1px solid rgba(128,128,128,.35); position: relative; }
.chart .col { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; cursor: default; }
.chart .col .b { width: 100%; background: var(--chart); border-radius: 4px 4px 0 0; min-height: 0; }
.chart .col.zero .b { background: transparent; }
.chart .col:hover .b, .chart .col:focus-visible .b { filter: brightness(1.15); }
.chart .col:focus-visible { outline: 2px solid var(--chart); outline-offset: 1px; }
.chart .tip { display: none; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: #1b1b1b; color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 4px; white-space: nowrap; pointer-events: none; z-index: 2; }
.chart .col.edge-l .tip { left: 0; transform: none; }
.chart .col.edge-r .tip { left: auto; right: 0; transform: none; }
.chart .col:hover .tip, .chart .col:focus-visible .tip { display: block; }
.chart .max { position: absolute; top: 0; left: 0; font-size: 11px; color: var(--muted); }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
details.days summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-top: 8px; }

/* Dialoge */
dialog { border: 0; border-radius: 12px; padding: 20px; max-width: 460px; width: calc(100% - 32px); background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
dialog::backdrop { background: rgba(0,0,0,.5); }
dialog h3 { margin-top: 0; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.radio-list label { display: flex; gap: 8px; align-items: center; padding: 4px 0; cursor: pointer; }
.radio-list input { width: auto; margin: 0; }

/* Zähler in der Fußzeile */
body.has-footer { padding-bottom: 56px; }
.footer-counter { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 22px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--bar); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--fg); font-size: 14px; z-index: 5; }
.footer-counter b { font-variant-numeric: tabular-nums; font-size: 16px; }
.footer-counter .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2fb344; margin-right: 6px; vertical-align: middle; box-shadow: 0 0 0 3px rgba(47,179,68,.25); }
.dot-live { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #2fb344; margin-right: 8px; box-shadow: 0 0 0 3px rgba(47,179,68,.25); }

.footer-counter .dot.off, .dot-live.off { background: #9a9a9a; box-shadow: 0 0 0 3px rgba(154,154,154,.25); }

.tbl tr.unused td { color: var(--muted); }
.tbl tr.unused td b { font-weight: 600; }

.banner.danger { background: #ffe0e0; color: #7a1010; border: 2px solid #d0312d; }

/* Ein-/ausblendbare Bereiche im Backend */
.h3-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 16px; }
.collapse-btn { background: transparent; color: var(--muted); box-shadow: none; padding: 4px 10px; font-size: 13px; border: 1px solid rgba(128,128,128,.35); border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; }
.collapse-btn:hover, .collapse-btn:focus-visible { color: var(--text); border-color: var(--text); }
.collapse-btn .chev { display: inline-block; transition: transform .15s; }
.panel.collapsed .collapse-btn .chev { transform: rotate(-90deg); }
.panel.collapsed .panel-body, .panel.collapsed .hide-when-collapsed { display: none; }
.panel.collapsed { padding-top: 12px; padding-bottom: 12px; }
.panel.collapsed h3 { margin-bottom: 0; }
.info-panel { font-size: 14px; line-height: 1.45; border-left: 4px solid var(--ui-edit); }
.muted-light { opacity: .7; font-weight: 400; }
.set-label { width: 170px; flex: none; }
.qedit .row select.my-sel { margin: 0; }
@media (max-width: 560px) { .set-label { width: 120px; } }

/* ============ Protokoll-Ansicht ============ */
.log-filters { display: flex; flex-direction: column; gap: 12px; }
.lf-row { display: flex; gap: 14px 18px; align-items: center; flex-wrap: wrap; }
.lf-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lf-grow { flex: 1; min-width: 220px; }
.lf-grow select, .lf-grow input { flex: 1; margin: 0; padding: 8px; }
.lf-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); min-width: 78px; }
.lf-date { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.lf-date input { width: auto; margin: 0; padding: 6px; }
.seg { display: inline-flex; border: 1px solid rgba(128,128,128,.4); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; color: var(--text); box-shadow: none; border-radius: 0; padding: 6px 12px; font-size: 13px; font-weight: 600; border-right: 1px solid rgba(128,128,128,.3); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ui-edit); color: #fff; }
.chip { background: transparent; color: var(--text); box-shadow: none; border: 1px solid rgba(128,128,128,.45); border-radius: 99px; padding: 5px 12px; font-size: 13px; font-weight: 600; }
.chip.on { background: rgba(19,104,206,.12); border-color: var(--ui-edit); }
.chip:not(.on) { opacity: .55; text-decoration: line-through; }
.chip-n { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 99px; background: rgba(128,128,128,.18); font-variant-numeric: tabular-nums; font-size: 12px; }
.sort-btn { background: transparent; color: inherit; box-shadow: none; padding: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; gap: 4px; align-items: center; }
.sort-btn:active { transform: none; }
.sort-btn.active { color: var(--text); }
.sort-ind { font-size: 10px; opacity: .7; }
.log-table td.nowrap { white-space: nowrap; }
.ev { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; background: rgba(128,128,128,.14); }
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.pager .pg { background: transparent; color: var(--text); box-shadow: none; border: 1px solid rgba(128,128,128,.4); padding: 5px 11px; font-size: 13px; }
.pager .pg.cur { background: var(--ui-edit); color: #fff; border-color: var(--ui-edit); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Copyright-Hinweis */
.site-credit { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1; text-align: center; padding: 6px 12px;
  font-size: 12px; color: var(--fg); opacity: .6; pointer-events: none; }
body:has(.site-credit) .wrap { padding-bottom: 40px; }
#s-game:not(.hidden) ~ .site-credit { display: none; }   /* Schüler-Handy: nicht über den Antwort-Knöpfen */
.footer-counter .credit-inline { opacity: .65; font-size: 12px; align-self: center; }
@media (min-width: 900px) { .footer-counter .credit-inline { margin-left: auto; } .footer-counter { padding-right: 20px; } }

/* ============================================================
   Skin „RTO“: Schulgebäude im Hintergrund, geschwungene graue Bänder,
   Milchglas-Felder mit farbigem Randstreifen, Schrift Poppins
   ============================================================ */
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url(fonts/Poppins-Regular.ttf) format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 500 600; font-display: swap; src: url(fonts/Poppins-Medium.ttf) format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 700 900; font-display: swap; src: url(fonts/Poppins-Bold.ttf) format("truetype"); }

[data-skin="rto"] {
  --bg: #6b757d; --bg2: #3f464d; --fg: #ffffff;
  --card: rgba(255,255,255,.84); --text: #1f2429; --muted: #56606a;
  --a0: #49B2F8; --a1: #8FF748; --a2: #F79048; --a3: #F7D048;   /* Randstreifen */
  --ans-fg: #ffffff;
  --accent: #ffffff; --accent-fg: #1f2429;
  --btn: #3a4148;
  --chip: rgba(52,57,63,.58); --bar: rgba(40,44,50,.62);
  --ok-fg: #b8ff8c; --bad-fg: #ffc2a3;
  --gold: #F7D048; --bronze: #F79048;
  --radius: 4px; --shadow: 0 8px 28px rgba(0,0,0,.16);
  --font: "Poppins", "Segoe UI", system-ui, sans-serif;
  --glass: rgba(52,57,63,.58); --glass-strong: rgba(40,44,50,.74); --glass-line: rgba(255,255,255,.28);
}
/* Hintergrund: Schulbild mit leichtem Grauschleier (nur für die Seite, nicht für die Vorschau-Kärtchen) */
html[data-skin="rto"] body {
  background: linear-gradient(180deg, rgba(60,66,72,.32) 0%, rgba(60,66,72,.12) 45%, rgba(40,44,50,.50) 100%),
              url(skins/rto.jpg) 62% center / cover no-repeat fixed, #5b6770;
}
/* geschwungene Bänder, angelehnt an die Galerie des Gebäudes */
html[data-skin="rto"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1920 1080' preserveAspectRatio='none'%3E%3Cpath d='M-40 270 C 380 130, 760 480, 1250 410 S 1860 270, 1980 340 L 1980 -40 L -40 -40 Z' fill='rgba(62,67,74,.42)'/%3E%3Cpath d='M-40 270 C 380 130, 760 480, 1250 410 S 1860 270, 1980 340' fill='none' stroke='rgba(255,255,255,.10)' stroke-width='46'/%3E%3Cpath d='M-40 270 C 380 130, 760 480, 1250 410 S 1860 270, 1980 340' fill='none' stroke='rgba(255,255,255,.55)' stroke-width='3'/%3E%3Cpath d='M-40 330 C 420 190, 780 540, 1270 470 S 1860 330, 1980 410' fill='none' stroke='rgba(255,255,255,.22)' stroke-width='2'/%3E%3Cpath d='M-40 1120 L -40 800 C 420 690, 900 950, 1400 850 S 1860 740, 1980 780 L 1980 1120 Z' fill='rgba(62,67,74,.44)'/%3E%3Cpath d='M-40 800 C 420 690, 900 950, 1400 850 S 1860 740, 1980 780' fill='none' stroke='rgba(255,255,255,.10)' stroke-width='40'/%3E%3Cpath d='M-40 800 C 420 690, 900 950, 1400 850 S 1860 740, 1980 780' fill='none' stroke='rgba(255,255,255,.5)' stroke-width='3'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
/* Antwortfelder: Milchglas + farbiger Streifen links */
html[data-skin="rto"] .ans, html[data-skin="rto"] .pad button, .skin-card[data-skin="rto"] .mg span {
  background: var(--glass); color: #fff; border: 1px solid var(--glass-line); border-left: 12px solid var(--glow);
  backdrop-filter: blur(12px) saturate(1.1); -webkit-backdrop-filter: blur(12px) saturate(1.1);
}
html[data-skin="rto"] .pad button { border-left-width: 10px; }
.skin-card[data-skin="rto"] .mg span { border-left-width: 5px; }
[data-skin="rto"] .ans { font-weight: 500; }
[data-skin="rto"] .ans.dim { opacity: .55; background: rgba(52,57,63,.45); }
/* helle Glasflächen mit geschwungenen Ecken: Frage, PIN, Karten */
[data-skin="rto"] .qtext, [data-skin="rto"] .pinbox { border-radius: 6px 48px 6px 48px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-weight: 700; }
[data-skin="rto"] .card, [data-skin="rto"] .board li, [data-skin="rto"] .podium div,
[data-skin="rto"] .panel, [data-skin="rto"] .kpi, [data-skin="rto"] .list li, [data-skin="rto"] .qedit { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
[data-skin="rto"] .card { border-radius: 6px 36px 6px 36px; }
[data-skin="rto"] .timer { background: var(--glass); border-color: rgba(255,255,255,.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
[data-skin="rto"] .stat, [data-skin="rto"] .points { background: var(--glass); border: 1px solid var(--glass-line); border-radius: 40px; padding: 8px 24px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
[data-skin="rto"] .players span { border: 1px solid var(--glass-line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
[data-skin="rto"] button.light { border-radius: 40px; }
[data-skin="rto"] .topbar { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
/* Überschriften und freie Texte direkt auf dem Foto lesbar halten */
html[data-skin="rto"] h1, html[data-skin="rto"] h2, html[data-skin="rto"] .center > p,
html[data-skin="rto"] .result, html[data-skin="rto"] .wrap > p { text-shadow: 0 2px 14px rgba(0,0,0,.45); }
html[data-skin="rto"] .card h1, html[data-skin="rto"] .panel h2, html[data-skin="rto"] .panel h3 { text-shadow: none; }
/* Vorschau-Kärtchen in den Einstellungen */
.skin-card[data-skin="rto"] .mini { background: linear-gradient(rgba(60,66,72,.25), rgba(40,44,50,.4)), url(skins/rto.jpg) 55% center / cover; }
