/* ═══════════════════════════════════════════════════════════════════════════
   Midnight Questions — die App (spiel.html).

   ⚠️ DIES IST DIE VORLAGE FÜR DIE FLUTTER-APP. Darum:
      · Alle Farben stehen als Variablen hier oben und NUR hier (Hausregel:
        kein rohes Hex in einer Regel). In Flutter wird daraus eine
        ThemeExtension mit denselben Namen.
      · Nur Dinge, die Flutter auch kann: flache Flächen, Rahmen, Radien,
        lineare/radiale Verläufe, Schatten, Transformationen. Kein
        backdrop-filter, keine mix-blend-modes, keine clip-path-Tricks.
      · Abstände im 4er-Raster (4, 8, 12, 16, 20, 24, 32).
      · Eine Spalte, höchstens 520 px breit — auf dem Telefon randlos, auf dem
        Rechner wie ein Telefon in der Mitte. So sieht die Webfassung aus wie
        die App, und umgekehrt.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --page-bg: var(--bg);
  /* Grund — dieselbe Nacht wie die Produktseiten der Familie. */
  --bg:        #08070A;
  --surface:   #121015;
  --surface-2: #1A171D;
  --surface-3: #252128;
  --line:      rgba(232, 180, 160, .12);
  --line-2:    rgba(232, 180, 160, .24);

  --text:      #F6F1EE;
  --text-2:    #A99D98;
  --text-3:    #635A57;

  /* Der Akzent von Midnight Questions: Rosé. */
  --rose:      #E8B4A0;
  --rose-2:    #F5D5C8;
  --rose-ink:  #1C110D;   /* Schrift AUF Rosé */
  --rose-dim:  rgba(232, 180, 160, .12);
  --rose-glow: rgba(232, 180, 160, .26);

  /* Die zwei Seiten am Tisch. */
  --moon:      #9DB0EC;   /* Seite 0 — Mitternacht */
  --moon-dim:  rgba(157, 176, 236, .13);
  --sun:       #EBC064;   /* Seite 1 — Sonne */
  --sun-dim:   rgba(235, 192, 100, .13);

  --ok:        #7FD3A0;
  --warn:      #E58C7A;

  /* Die Karte. */
  --paper:     #F4EEE6;
  --paper-2:   #E9E1D6;
  --paper-ink: #2A2224;
  --night:     #16101A;   /* Grund der Rückseite und der Mitternachtskarte */

  --radius:    14px;
  --radius-lg: 22px;
  --font: 'Zen Kaku Gothic New', -apple-system, BlinkMacSystemFont, 'Segoe UI',
          system-ui, 'Noto Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Ein schwacher Schein von oben — derselbe in der App (RadialGradient). */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(120% 60% at 50% -10%, var(--rose-dim), transparent 60%);
}
a { color: var(--rose); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
svg { display: block; }

/* ═══════════════════════════════════════════════════════════════ Gerüst */

.app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto;
       min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.bar {
  position: sticky; top: 0; z-index: 20; height: 56px;
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.bar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.bar-brand svg { width: 26px; height: 26px; flex: none; }
.bar-brand span { font-weight: 900; font-size: 15px; letter-spacing: -.2px; white-space: nowrap; }
.bar-gap { flex: 1; }
.bar-code {
  font-weight: 900; font-size: 12.5px; letter-spacing: 1.4px; color: var(--rose); white-space: nowrap;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px;
}
/* Im Spiel steht oben der Code — auf dem Telefon weicht dafür der Schriftzug. */
@media (max-width: 460px) { .bar.in-game .bar-brand span { display: none; } }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang button { font-size: 11px; font-weight: 700; letter-spacing: .6px; padding: 4px 9px;
               border-radius: 999px; color: var(--text-3); }
.lang button.on { background: var(--rose-dim); color: var(--rose); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
            color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

.screen { flex: 1; padding: 20px 16px 120px; display: flex; flex-direction: column; gap: 16px; }
.screen-center { justify-content: center; }

/* Untere Aktionsleiste — klebt am Rand wie eine BottomAppBar. */
.dock {
  position: sticky; bottom: 0; z-index: 15; margin: auto -16px -120px; padding: 26px 16px 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  /* Der durchsichtige Rand liegt ÜBER dem Hinweis, nicht hinter ihm — sonst
     scheint der Verlauf durch die Schrift. Farbe = Seitenhintergrund (auch getönt). */
  background: linear-gradient(to top, var(--page-bg) calc(100% - 22px), rgba(8, 7, 10, 0));
  display: flex; flex-direction: column; gap: 8px;
}
.dock-row { display: flex; gap: 10px; }
.dock-row > * { flex: 1; }
.dock-note { text-align: center; font-size: 12.5px; color: var(--text-2); }

/* ═══════════════════════════════════════════════════════════ Bausteine */

.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
           color: var(--rose); }
.h1 { font-size: 30px; line-height: 1.08; font-weight: 900; letter-spacing: -1px; }
.h1 em { font-style: normal; color: var(--rose); }
.h2 { font-size: 19px; font-weight: 900; letter-spacing: -.4px; }
.h3 { font-size: 15px; font-weight: 700; }
.sub { font-size: 14.5px; color: var(--text-2); }
.small { font-size: 12.5px; color: var(--text-2); }
.muted { color: var(--text-3); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
         padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-flat { background: transparent; }

.btn {
  height: 50px; padding: 0 20px; border-radius: 14px; font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s, background .15s, opacity .15s; user-select: none;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-primary { background: var(--rose); color: var(--rose-ink); }
.btn-primary:hover { background: var(--rose-2); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-quiet { color: var(--text-2); height: 40px; font-weight: 500; font-size: 14px; }
.btn-quiet:hover { color: var(--text); }
.btn-moon { background: var(--moon); color: var(--rose-ink); }
.btn-sun { background: var(--sun); color: var(--rose-ink); }
.btn-danger { color: var(--warn); border: 1px solid rgba(229, 140, 122, .35); }
.btn-sm { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 700; letter-spacing: .4px; color: var(--text-2); }
.input, .textarea, .select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 16px; color: var(--text); outline: none;
  transition: border-color .15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--rose); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { resize: none; min-height: 76px; line-height: 1.45; }
.select { appearance: none; cursor: pointer; }
.input-code { font-size: 22px; font-weight: 900; letter-spacing: 4px; text-align: center;
              text-transform: uppercase; }

/* Segmente (SegmentedButton) */
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; height: 40px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--text-2);
              display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--rose); color: var(--rose-ink); }
.seg button[disabled] { opacity: .45; }
.seg button svg { width: 15px; height: 15px; }

/* Auswahlchips (FilterChip) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 34px; padding: 0 13px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  border: 1px solid var(--line-2); color: var(--text-2); display: inline-flex; align-items: center; gap: 7px;
}
.chip.on { background: var(--rose-dim); border-color: var(--rose); color: var(--text); }
.chip[disabled] { opacity: .35; pointer-events: none; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--rose)); flex: none; }
.chip-static { pointer-events: none; }

/* Hinweise */
.note { border-left: 2px solid var(--line-2); padding: 2px 0 2px 12px; font-size: 13px; color: var(--text-2); }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 20px);
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 11px 16px; font-size: 14px; max-width: calc(100% - 32px);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(229, 140, 122, .5); }

/* Fortschritt */
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--rose);
                transition: width .4s ease; }

/* Kleine Personenmarke */
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 13px; font-weight: 900; color: var(--rose-ink); background: var(--side, var(--rose));
  position: relative;
}
.avatar.off { opacity: .45; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%;
               background: var(--ok); border: 2px solid var(--surface); }
.side-0 { --side: var(--moon); --side-dim: var(--moon-dim); }
.side-1 { --side: var(--sun);  --side-dim: var(--sun-dim); }

.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 12.5px; color: var(--text-2); }

.badge { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
         padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.badge-rose { background: var(--rose); color: var(--rose-ink); border-color: transparent; }
.badge-side { background: var(--side-dim); color: var(--side); border-color: transparent; }

.divider { height: 1px; background: var(--line); }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; }

/* Die Karten selbst stehen in karten.css. */

/* ═════════════════════════════════════════════════════════════ Startseite */

.hero { display: flex; flex-direction: column; gap: 10px; padding: 8px 2px 4px; }
.fan { position: relative; height: 230px; margin: 4px 0 2px; }
.fan .mc { position: absolute; left: 50%; top: 8px; --w: 138px; transform-origin: 50% 120%; }
.fan .mc:nth-child(1) { transform: translateX(-50%) rotate(-16deg) translateX(-34px); }
.fan .mc:nth-child(2) { transform: translateX(-50%) rotate(-5deg)  translateX(-10px); }
.fan .mc:nth-child(3) { transform: translateX(-50%) rotate(6deg)   translateX(14px); }
.fan .mc:nth-child(4) { transform: translateX(-50%) rotate(17deg)  translateX(38px); }

.seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seats button {
  height: 56px; border-radius: 12px; border: 1px solid var(--line-2); display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--text-2);
}
.seats button b { font-size: 18px; font-weight: 900; color: var(--text); line-height: 1.1; }
.seats button span { font-size: 11px; }
.seats button.on { background: var(--rose-dim); border-color: var(--rose); }
.seats button.on b { color: var(--rose); }

.opt { display: flex; flex-direction: column; gap: 8px; }
.opt-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; text-align: left;
  border: 1px solid var(--line); border-radius: 14px; width: 100%;
}
.opt-item.on { border-color: var(--rose); background: var(--rose-dim); }
.opt-item[disabled] { opacity: .5; }
.opt-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; margin-top: 2px;
             display: grid; place-items: center; }
.opt-item.on .opt-radio { border-color: var(--rose); }
.opt-item.on .opt-radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--rose); }
.opt-item b { display: block; font-size: 14.5px; }
.opt-item span { display: block; font-size: 12.5px; color: var(--text-2); }
.opt-lock { margin-left: auto; color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .6px; white-space: nowrap; }

.gamecard { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.gamecard:first-child { border-top: 0; }

/* ═════════════════════════════════════════════════════════════ Lobby */

.share { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.share-code { font-size: 32px; font-weight: 900; letter-spacing: 5px; color: var(--text); }
.share-code span { color: var(--rose); }
.qr { width: 196px; height: 196px; background: var(--paper); border-radius: 16px; padding: 12px; }
.qr svg, .qr img { width: 100%; height: 100%; }

.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side-col { border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px;
            background: linear-gradient(180deg, var(--side-dim), rgba(0, 0, 0, 0) 70%); }
.side-name { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 900; letter-spacing: 1px;
             text-transform: uppercase; color: var(--side); }
.side-name svg { width: 15px; height: 15px; }
.seat { display: flex; align-items: center; gap: 9px; min-height: 34px; }
.seat-name { font-size: 14px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-free { height: 34px; border: 1.5px dashed var(--line-2); border-radius: 10px; display: grid; place-items: center;
             font-size: 12px; color: var(--text-3); }
.seat-x { margin-left: auto; color: var(--text-3); font-size: 18px; line-height: 1; padding: 2px 4px; }
.prof { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.prof span { font-size: 10.5px; color: var(--text-2); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; }

.searching { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 12px 0; }
.orbit { width: 120px; height: 120px; position: relative; }
.orbit::before, .orbit::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--rose); opacity: 0;
                                animation: mq-ping 2.4s ease-out infinite; }
.orbit::after { animation-delay: 1.2s; }
.orbit .mc { position: absolute; left: 50%; top: 50%; --w: 54px; transform: translate(-50%, -50%) rotate(-6deg); }
@keyframes mq-ping { 0% { transform: scale(.45); opacity: .8; } 100% { transform: scale(1.15); opacity: 0; } }

/* ═════════════════════════════════════════════════════════════ Themen */

.picker-head { display: flex; align-items: center; gap: 12px; }
.round-dots { display: flex; gap: 5px; }
.round-dots i { width: 22px; height: 4px; border-radius: 4px; background: var(--surface-3); }
.round-dots i.on { background: var(--rose); }
.pool { display: flex; flex-wrap: wrap; gap: 8px; }
.pool .chip { height: 38px; }
.taken { display: flex; flex-direction: column; gap: 8px; }
.taken-row { display: flex; align-items: center; gap: 10px; }
.taken-row .chips { flex: 1; }
.tchip { height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
         color: var(--paper); background: var(--c); display: inline-flex; align-items: center; }

/* ═════════════════════════════════════════════════════════════ Schreiben */

.topic-block { display: flex; flex-direction: column; gap: 10px; }
.topic-head { display: flex; align-items: center; gap: 10px; }
.topic-head .tchip { height: 30px; font-size: 13px; }
.slot { display: flex; gap: 12px; align-items: flex-start; }
.slot .mc { --w: 62px; margin-top: 2px; }
.slot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.slot-tools { display: flex; gap: 6px; align-items: center; }
.slot-tools .btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.slot-count { margin-left: auto; font-size: 11px; color: var(--text-3); }
.slot.done .textarea { border-color: var(--line-2); }
.risk-block { border: 1px solid var(--rose-glow); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px;
              background: radial-gradient(90% 80% at 0% 0%, var(--rose-dim), rgba(0, 0, 0, 0) 70%); }
.risk-block .slot .mc { --w: 72px; }

/* ═════════════════════════════════════════════════════════════ Tisch */

.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 8px; }
.team { border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
        transition: border-color .2s, background .2s; min-width: 0; }
.team.active { border-color: var(--side); background: var(--side-dim); }
.team-top { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 900; letter-spacing: 1px;
            text-transform: uppercase; color: var(--side); }
.team-top svg { width: 14px; height: 14px; }
.fold summary .h3 svg { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin-right: 2px; }
.team-names { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-won { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.team-won i { width: 11px; height: 15px; border-radius: 2.5px; background: var(--side); opacity: .85; }
.vs { align-self: center; font-size: 11px; font-weight: 900; color: var(--text-3); letter-spacing: 1px; }

.status { text-align: center; font-size: 15px; font-weight: 700; min-height: 24px; }
.status small { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-top: 2px; }

.table-area { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 330px; padding-bottom: 18px; }
.table-area .mc-deck { --w: 78px; }
.table-card { position: relative; }
.table-card .mc { --w: min(66vw, 236px); }
.table-empty { --w: min(66vw, 236px); width: var(--w); aspect-ratio: 5 / 7; border: 1.5px dashed var(--line-2); border-radius: 16px;
               display: grid; place-items: center; color: var(--text-3); font-size: 13px; padding: 20px; text-align: center; }

.answer-box { display: flex; flex-direction: column; gap: 8px; }
.answer-shown { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; font-size: 14.5px; white-space: pre-wrap; }
.answer-shown b { display: block; font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--text-2); margin-bottom: 4px; }

.log { display: flex; flex-direction: column; }
.log-item { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.log-item:first-child { border-top: 0; }
.log-item .mc { --w: 34px; }
.log-text { font-size: 13px; color: var(--text-2); flex: 1; min-width: 0; }
.log-text b { color: var(--text); font-weight: 700; }
.log-q { display: block; color: var(--text); margin-top: 2px; }
.log-a { display: block; margin-top: 2px; font-style: italic; }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: '+'; color: var(--text-3); font-size: 18px; }
details.fold[open] > summary::after { content: '−'; }

/* ═════════════════════════════════════════════════════════════ Ergebnis */

.result-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.result-score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; width: 100%; }
.result-side { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border-radius: 18px;
               border: 1px solid var(--line); }
.result-side.win { border-color: var(--side); background: var(--side-dim); }
.result-side b { font-size: 46px; font-weight: 900; line-height: 1; color: var(--side); font-variant-numeric: tabular-nums; }
.result-side span { font-size: 12px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: var(--side); }
.result-side small { font-size: 12.5px; color: var(--text-2); text-align: center; }
.crown { width: 34px; height: 34px; color: var(--rose); }

/* ═════════════════════════════════════════════════════════════ Bereich */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px; text-align: center; background: var(--surface); }
.stat b { display: block; font-size: 22px; font-weight: 900; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.stat:first-child b { color: var(--rose); }
.stat span { font-size: 11px; color: var(--text-2); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 10px 12px; font-size: 14px; font-weight: 700; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--rose); }
.lib-topic { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.lib-topic:first-child { border-top: 0; }
.lib-q { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.lib-q:first-child { border-top: 0; }

/* ═════════════════════════════════════════════════════════════ Sonstiges */

.sheet-back { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .6); display: none; }
.sheet-back.on { display: block; }
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 41; width: 100%; max-width: 520px; transform: translate(-50%, 100%);
  background: var(--surface); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); transition: transform .25s ease;
  max-height: 86vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
}
.sheet.on { transform: translate(-50%, 0); }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--surface-3); margin: 0 auto 6px; }
.sheet-item { display: flex; align-items: center; gap: 12px; padding: 13px 4px; font-size: 15px; width: 100%; text-align: left; border-radius: 10px; }
.sheet-item:hover { background: var(--surface-2); }
.sheet-item svg { width: 20px; height: 20px; color: var(--text-2); }

.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line-2); border-top-color: var(--rose); border-radius: 50%;
           animation: mq-spin .8s linear infinite; }
@keyframes mq-spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 60px 0; color: var(--text-2); }

.zodiac { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.zodiac button { height: 52px; border-radius: 12px; border: 1px solid var(--line); display: flex; flex-direction: column;
                 align-items: center; justify-content: center; font-size: 11px; color: var(--text-2); }
.zodiac button b { font-size: 18px; line-height: 1.1; color: var(--text); font-weight: 400; }
.zodiac button.on { border-color: var(--rose); background: var(--rose-dim); }

@media (max-width: 360px) {
  .bar-brand span { display: none; }
  .h1 { font-size: 26px; }
  .fan { height: 200px; }
  .fan .mc { --w: 118px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ═════════════════════════════════════════ Spielarten, ein Gerät, Abstimmung */

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  padding: 12px; border: 1px solid var(--line); border-radius: 14px; min-height: 92px; }
.mode-tile b { font-size: 14.5px; }
.mode-tile span { font-size: 12px; color: var(--text-2); line-height: 1.35; }
.mode-tile.on { border-color: var(--rose); background: var(--rose-dim); }
.mode-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--rose); margin-bottom: 4px; }
.mode-ico svg { width: 17px; height: 17px; }
.mode-tile.on .mode-ico { background: var(--rose); color: var(--rose-ink); }

.roster { display: flex; flex-direction: column; gap: 8px; }
.roster-row { display: flex; gap: 8px; align-items: center; }
.swatch { width: 38px; height: 38px; border-radius: 50%; background: var(--c); flex: none; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.swatch-big { height: 64px; border-radius: 14px; background: var(--c); color: #2A2224; font-weight: 700; font-size: 13px;
  display: flex; align-items: flex-end; padding: 8px 10px; border: 3px solid transparent; }
.swatch-big.on { border-color: var(--text); }
.swatch-big[disabled] { opacity: .3; }

/* Hintergrund in der Farbe dessen, der dran ist (nur an EINEM Gerät).
   Flutter: ein Container mit RadialGradient aus derselben Farbe. */
body.tinted { --page-bg: color-mix(in srgb, var(--tint) 16%, var(--bg)); background: var(--bg); background: var(--page-bg); transition: background .4s; }
body.tinted::before {
  background: radial-gradient(140% 90% at 50% -10%, var(--tint) 0%, rgba(8, 7, 10, 0) 75%);
  opacity: .7; transition: background .4s;
}
body.tinted .bar { border-bottom: 3px solid var(--tint); }

.handover { position: fixed; top: 56px; left: 0; right: 0; bottom: 0; z-index: 18; overflow-y: auto; padding: 40px 24px 60px;
  background: var(--c); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.hand-avatar { width: 92px; height: 92px; border-radius: 50%; background: rgba(28, 17, 13, .12); color: #1C110D;
  display: grid; place-items: center; font-size: 40px; font-weight: 900; }
.hand-btn { background: #1C110D; color: #F6F1EE; max-width: 340px; margin-top: 10px; }

.voice-row { display: flex; align-items: center; gap: 10px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--warn); animation: mq-pulse 1s infinite; }
@keyframes mq-pulse { 50% { opacity: .3; } }
.voice-btn { margin-top: 6px; height: 30px; font-size: 12.5px; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }
.last-card { position: relative; opacity: .92; }
.last-no > .mc { opacity: .55; filter: saturate(.6); }
.last-no .last-tag { background: var(--surface-2, #221D22); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }
.last-tag { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); white-space: nowrap;
  background: var(--side); color: var(--rose-ink); font-size: 12px; font-weight: 900; padding: 4px 12px; border-radius: 999px; }
