/* =============================================================================
   style.css – Aussehen der Kino-Umfrage (dunkles "Kinosaal"-Design, mobil zuerst)
   ============================================================================= */

/* ---- Farbpalette als Variablen: hier zentral ändern, wirkt überall ---- */
:root {
  --bg: #121016;          /* Seitenhintergrund */
  --card: #1d1a24;        /* Hintergrund der Karten/Kästen */
  --line: #2f2a3a;        /* Rahmen und Trennlinien */
  --text: #ece9f2;        /* normale Schrift */
  --muted: #9a93a8;       /* gedämpfte Schrift (Hinweise, Namenslisten) */
  --accent: #f5b83d;      /* Akzentfarbe (Popcorn-Gelb): Buttons, Auswahl, beste Uhrzeit */
  --accent-ink: #1a1405;  /* Schrift auf gelbem Hintergrund */
  --yes: #3fb27f;         /* grün  = dabei */
  --maybe: #d9a441;       /* gelb  = vielleicht */
  --no: #b5575b;          /* rot   = nicht dabei / löschen */
  color-scheme: dark;     /* Browser-eigene Elemente (Scrollbalken, Checkboxen) ebenfalls dunkel */
}

/* ---- Grundlayout ---- */
* { box-sizing: border-box; }   /* Breiten inkl. Rand/Innenabstand rechnen – macht Layout vorhersehbar */
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }  /* Systemschrift des Geräts */
main { max-width: 720px; margin: 0 auto; padding: 0 16px 64px; }  /* Inhalt mittig, max. 720px breit */
a { color: var(--accent); }

/* ---- Überschriften ---- */
h1 { font-size: 1.6rem; margin: 20px 0 4px; }
h2 { margin-top: 32px; }
h3 { margin: 0 0 10px; font-size: 1.05rem; }

/* ---- Kopfzeile (aus base.html) ---- */
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid var(--line); max-width: 720px; margin: 0 auto; }
.brand { color: var(--text); text-decoration: none; font-weight: 700; }
.adminlink { font-size: .9rem; }

/* ---- Kleine Text-Helfer ---- */
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .85rem; }
.date { font-size: 1.1rem; margin: 4px 0; }
.info { white-space: pre-line; }   /* Zeilenumbrüche aus dem Info-Feld beibehalten */

/* ---- Karten (die abgerundeten Kästen) ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 14px 0; }
.card.link { display: flex; flex-direction: column; text-decoration: none; color: var(--text); }  /* Karte als Link (Startseite) */
.list { list-style: none; padding: 0; }   /* Aufzählungspunkte weg */

/* ---- Aufklappbare Bereiche (<details>/<summary>) ---- */
summary { cursor: pointer; }
details[open] summary { margin-bottom: 12px; }

/* ---- Layout-Helfer ---- */
.stack { display: flex; flex-direction: column; gap: 16px; }   /* Elemente untereinander mit Abstand */
.row { display: flex; gap: 8px; align-items: center; }         /* Elemente nebeneinander */
.row.wrap { flex-wrap: wrap; margin-top: 10px; }               /* … und bei Platzmangel umbrechen */
.between { justify-content: space-between; }                   /* links und rechts verteilen */

/* ---- Formularfelder ---- */
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }  /* Beschriftung über dem Feld */
label.check { flex-direction: row; align-items: center; }                      /* Checkbox neben dem Text */
input, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }  /* gelber Rahmen beim Tippen */
input[type=checkbox], input[type=radio] { width: auto; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }  /* Standard-Rahmen entfernen */
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
[hidden] { display: none !important; }   /* vom JavaScript ausgeblendete Bereiche sicher verstecken */

/* ---- Buttons ---- */
button { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 12px 18px;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; }   /* Standard: gelb */
button.small { padding: 6px 12px; font-size: .85rem; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }  /* nur Rahmen */
button.danger { background: transparent; color: var(--no); border: 1px solid var(--no); }    /* rot: Löschen */
form.inline { display: inline; }   /* Formular (Lösch-Knopf) in einer Tabellenzelle neben dem Link */

/* ---- "Pillen": Radio-Buttons/Checkboxen als runde Auswahlknöpfe ----
   Aufbau im HTML: <label class="pill"><input …><span>Text</span></label>
   Das echte <input> wird unsichtbar gemacht, gestylt wird das <span> dahinter. */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; font-weight: 500; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }   /* echtes Häkchen verstecken */
.pill span { border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer;
  user-select: none; }
.pill input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }  /* ausgewählt = gelb */
.pill input:focus-visible + span { outline: 2px solid var(--accent); }   /* Tastatur-Fokus sichtbar machen */

/* ---- Film-Ranking-Liste mit ↑↓ ---- */
.rank { padding-left: 24px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.rank li { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px 6px 10px; }
.rank li > span:first-child { display: inline-block; max-width: calc(100% - 90px); }   /* Filmname lässt Platz für die Knöpfe */
.rankbtns { float: right; display: inline-flex; gap: 4px; }                            /* ↑↓ rechts */

/* ---- Namens-Chips in der Auswertung ---- */
.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; margin: 2px 4px 2px 0; font-size: .9rem;
  background: var(--line); white-space: nowrap; }
/* color-mix: Statusfarbe zu 30 % mit Transparenz mischen -> dezent getönter Hintergrund */
.chip.yes { background: color-mix(in srgb, var(--yes) 30%, transparent); }
.chip.maybe { background: color-mix(in srgb, var(--maybe) 30%, transparent); }
.chip.no { background: color-mix(in srgb, var(--no) 30%, transparent); }

/* ---- Hinweise und Markierungen ---- */
.badge { display: inline-block; background: var(--line); border-radius: 6px; padding: 1px 8px; font-size: .8rem; margin-left: 6px; }  /* z. B. "geschlossen" */
.badge.big { font-size: 1rem; padding: 10px 14px; margin: 14px 0; }
.ok { background: color-mix(in srgb, var(--yes) 20%, transparent); border-radius: 10px; padding: 10px 14px; }  /* "Gespeichert!" */
.error { color: var(--no); margin: 0; }   /* "Falscher Token" */

/* ---- Balken in der Uhrzeit-Auswertung ---- */
.bar { margin-bottom: 12px; }
.barlabel { display: flex; gap: 8px; align-items: baseline; }
.track { height: 10px; background: var(--bg); border-radius: 6px; overflow: hidden; margin: 4px 0; }  /* grauer Hintergrund */
.fill { height: 100%; background: var(--muted); border-radius: 6px; }   /* Füllung; Breite kommt per style="" aus dem Template */
.bar.best .fill { background: var(--accent); }                          /* beste Uhrzeit in Gelb */

/* ---- Tabellen ---- */
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
table.tight { width: auto; }                              /* kompakte Tabellen (Tickets, 3D, Essen) */
table.tight td { border: 0; padding: 3px 12px 3px 0; }
td.num { font-weight: 700; text-align: right; white-space: nowrap; }   /* Zahlenspalte */
.nowrap { white-space: nowrap; }
/* Große Antworten-Tabelle: auf schmalen Bildschirmen seitlich scrollen statt zu quetschen */
.scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.scroll table { min-width: 640px; }
