:root {
  color-scheme: dark;
  --bg: #0b0e12;
  --surface: #131820;
  --surface-2: #1a212b;
  --border: #263040;
  --text: #e8edf3;
  --muted: #8b97a8;
  --accent: #25f4ee;
  --accent-2: #fe2c55;
  --ok: #3ddc84;
  --warn: #ffb020;
  --danger: #ff5c6c;
  --radius: 14px;
  --gap: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

h1, h2, p { margin: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Kopfzeile ---------- */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px var(--gap);
  padding: 12px max(16px, 2vw);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 18px; letter-spacing: .2px; }
.brand strong { color: var(--accent); font-weight: 700; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 4px 0 0 -1px var(--accent-2);
  position: relative;
}

.watch-form { display: flex; flex: 1 1 320px; gap: 8px; min-width: 0; max-width: 640px; }
.input-wrap {
  flex: 1; min-width: 0; display: flex; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 0 12px;
}
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.at { color: var(--muted); margin-right: 4px; }
.input-wrap input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text);
  font: inherit; padding: 10px 0;
}
.input-wrap input::placeholder { color: var(--muted); }

.btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px; padding: 9px 16px;
  border: 1px solid transparent; transition: filter .15s, background .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent-2); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: #212a37; }
.btn:focus-visible, .link-btn:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 13px;
  margin-left: auto;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill-live { color: var(--text); }
.pill-live .dot { background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 1.8s infinite; }
.pill-wait .dot { background: var(--warn); }
.pill-error .dot { background: var(--danger); }

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Layout ---------- */
.layout {
  flex: 1; display: grid; gap: var(--gap);
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  padding: var(--gap) max(16px, 2vw);
  align-items: start;
}

.stage { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

.player-card, .feed, .streamer, .stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}

.player-card { overflow: hidden; }
.player-frame { position: relative; background: #000; aspect-ratio: 16 / 9; max-height: 72dvh; width: 100%; }
.player-frame video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }

.overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 24px; text-align: center;
  background: radial-gradient(ellipse at center, rgba(19, 24, 32, .86), rgba(11, 14, 18, .96));
}
.overlay[hidden] { display: none; }
.overlay-title { font-size: 18px; font-weight: 700; }
.overlay-text { color: var(--muted); max-width: 46ch; }

.player-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--border); }
.select-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-left: auto; }
.select-label select {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font: inherit;
}

.streamer { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.streamer[hidden] { display: none; }
.streamer-text { min-width: 0; }
.streamer-text h1 { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.streamer-text p { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar { border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-sm { width: 22px; height: 22px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.stat { padding: 12px 14px; }
.stat dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.stat dd { margin: 4px 0 0; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Feeds ---------- */
.feeds { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; position: sticky; top: 76px; }
.feed { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.feed-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.feed-head h2 { font-size: 14px; letter-spacing: .4px; }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; padding: 2px 4px; }
.link-btn[hidden] { display: none; }

.feed-list { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; overscroll-behavior: contain; }
.feed:first-of-type .feed-list { height: min(52dvh, 520px); }
.feed-events .feed-list { height: min(26dvh, 260px); }

.feed-list li { padding: 5px 14px; display: flex; gap: 8px; align-items: flex-start; word-break: break-word; }
.feed-list li:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.feed-list .name { font-weight: 700; color: var(--accent); margin-right: 6px; }
.feed-list .system { color: var(--muted); font-style: italic; }
.feed-list .gift .name { color: var(--accent-2); }
.feed-list .gift-icon { width: 22px; height: 22px; flex: none; }
.feed-list .diamonds { color: var(--warn); font-variant-numeric: tabular-nums; }

.footer { padding: 14px max(16px, 2vw) 20px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }

/* ---------- Responsiv ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .feeds { position: static; }
  .feed:first-of-type .feed-list { height: 44dvh; }
  .pill { margin-left: 0; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat dd { font-size: 20px; }
  .watch-form { flex-wrap: wrap; }
  .btn-primary { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .pill-live .dot { animation: none; }
}

/* ---------- Embed-Modus (embed.html) ---------- */
body.embed { min-height: 100dvh; font-size: 14px; }
body.embed .topbar { position: static; padding: 8px 12px; backdrop-filter: none; }
body.embed.locked .brand,
body.embed.locked .watch-form { display: none; }
body.embed.locked .topbar { justify-content: flex-end; border-bottom: 0; background: transparent; padding-bottom: 0; }
body.embed .layout { grid-template-columns: minmax(0, 1.7fr) minmax(220px, 1fr); padding: 8px 12px 12px; gap: 10px; }
body.embed .stage { gap: 10px; }
body.embed .feeds { position: static; gap: 10px; }
body.embed .feed:first-of-type .feed-list { height: min(60dvh, 520px); }
body.embed .stat { padding: 8px 10px; }
body.embed .stat dd { font-size: 18px; }
body.embed.no-video .player-card,
body.embed.no-stats .stats,
body.embed.no-chat .feed:first-of-type,
body.embed.no-events .feed-events { display: none; }
body.embed.no-video .layout,
body.embed.no-chat .layout { grid-template-columns: minmax(0, 1fr); }
body.embed.no-video.no-chat .layout { display: block; }
body.embed.no-video.no-chat .feeds { display: none; }
body.embed.no-video .feed:first-of-type .feed-list { height: min(72dvh, 640px); }
body.embed.bg-transparent,
body.embed.bg-transparent .topbar { background: transparent; }
@media (max-width: 720px) {
  body.embed .layout { grid-template-columns: minmax(0, 1fr); }
  body.embed .feed:first-of-type .feed-list { height: 38dvh; }
}

body.theme-light {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --border: #d5dbe3;
  --text: #11161d;
  --muted: #5a6677;
  --accent: #0a8f8a;
}
body.theme-light .btn-ghost:hover:not(:disabled) { background: #e2e7ee; }
body.theme-light .pill-live { color: var(--text); }

/* ---------- Info-Zeile: Streamer + Statistiken ---------- */
.info-row { display: grid; grid-template-columns: minmax(170px, 260px) minmax(0, 1fr); gap: 12px; align-items: stretch; }
.info-row .streamer[hidden] + .stats { grid-column: 1 / -1; }
.stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 9px 10px; min-width: 0; }
.stat dt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .3px; font-size: 11px; }
.stat dd { font-size: clamp(14px, 1.3vw, 22px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-money dd { color: var(--ok); }
.streamer { padding: 10px 14px; }
.avatar-lg { width: 44px; height: 44px; }

/* ---------- Coin-Rechner ---------- */
.calc-actions { display: flex; gap: 6px; }
.link-btn:disabled { color: var(--muted); cursor: not-allowed; }
.calc-body { padding: 10px 14px 12px; display: grid; gap: 8px; }
.calc-input { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.calc-input input, .calc-settings input {
  width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 15px; font-variant-numeric: tabular-nums;
}
.calc-input input:focus-visible, .calc-settings input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.calc-out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.calc-out div { background: var(--surface-2); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.calc-out dt { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-out dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
#calc-earn { color: var(--ok); }
.calc-settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.calc-settings[hidden] { display: none; }
.calc-settings label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.calc-settings .link-btn { grid-column: 1 / -1; justify-self: start; }
.calc-note { color: var(--muted); font-size: 11px; line-height: 1.3; }
body.embed.no-calc .calc { display: none; }

/* ---------- Desktop: alles auf einer Bildschirmseite ---------- */
@media (min-width: 961px) and (min-height: 560px) {
  body:not(.embed) { height: 100dvh; overflow: hidden; }
  body:not(.embed) .topbar { position: static; padding-top: 8px; padding-bottom: 8px; }
  body:not(.embed) .layout {
    flex: 1; min-height: 0; padding-top: 12px; padding-bottom: 8px; gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); grid-template-rows: minmax(0, 1fr); align-items: stretch;
  }
  body:not(.embed) .stage { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; }
  body:not(.embed) .player-card { min-height: 0; display: flex; flex-direction: column; }
  body:not(.embed) .player-frame { flex: 1; min-height: 0; aspect-ratio: auto; max-height: none; }
  body:not(.embed) .player-controls { padding: 6px 10px; }
  body:not(.embed) .feeds {
    position: static; min-height: 0; gap: 12px;
    display: grid; grid-template-rows: minmax(0, 1.7fr) minmax(0, 1fr) auto;
  }
  body:not(.embed) .feed { min-height: 0; display: flex; flex-direction: column; }
  body:not(.embed) .feed .feed-list,
  body:not(.embed) .feed:first-of-type .feed-list,
  body:not(.embed) .feed-events .feed-list { flex: 1; height: auto; min-height: 0; }
  body:not(.embed) .feed-head { padding: 7px 14px; }
  body:not(.embed) .footer { padding: 4px max(16px, 2vw) 6px; border-top: 0; }
}
@media (min-width: 961px) and (max-width: 1100px) {
  .info-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .info-row { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-out, .calc-settings { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Player passt sich dem Stream-Format an (hochkant oder quer) ---------- */
.player-stage { position: relative; display: flex; align-items: center; justify-content: center; background: #000; }
.player-stage .player-frame { --video-ar: 16 / 9; aspect-ratio: var(--video-ar); width: 100%; max-height: 72dvh; }
.player-stage .player-frame video { object-fit: contain; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 961px) and (min-height: 560px) {
  body:not(.embed) .player-stage { flex: 1; min-height: 0; background: transparent; }
  /* Breite der Video-Spalte setzt app.js (--player-w) passend zum Stream-Format, der Rest geht an Chat/Geschenke. */
  body:not(.embed) .layout { grid-template-columns: var(--player-w, minmax(0, 1fr)) minmax(380px, 1fr); }
  body:not(.embed) .player-stage .player-frame { flex: none; width: 100%; height: auto; max-height: 100%; aspect-ratio: var(--video-ar); }
  /* Chat und Geschenke je halbe Hoehe, jeweils eigener Scrollbalken. */
  body:not(.embed) .feeds { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Desktop: Info-Zeile unten ueber volle Breite, damit sie bei Hochkant-Streams nicht gequetscht wird. */
@media (min-width: 961px) and (min-height: 560px) {
  body:not(.embed) .layout { grid-template-rows: minmax(0, 1fr) auto; }
  body:not(.embed) .stage { display: contents; }
  body:not(.embed) .player-card { grid-column: 1; grid-row: 1; min-width: 0; }
  body:not(.embed) .feeds { grid-column: 2; grid-row: 1; }
  body:not(.embed) .info-row { grid-column: 1 / -1; grid-row: 2; grid-template-columns: minmax(200px, 320px) minmax(0, 1fr); }
  body:not(.embed) .player-controls { flex-wrap: nowrap; gap: 6px; }
  body:not(.embed) .player-controls .btn { padding: 7px 12px; }
  body:not(.embed) .select-label span, body:not(.embed) .select-label { font-size: 12px; }
}

/* Desktop: Steuerleiste liegt ueber dem Bild – der Player ist damit exakt so gross wie der Stream. */
@media (min-width: 961px) and (min-height: 560px) {
  body:not(.embed) .player-card { position: relative; background: #000; }
  body:not(.embed) .player-controls {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; border-top: 0; flex-wrap: wrap; gap: 6px;
    padding: 18px 8px 8px; background: linear-gradient(to top, rgba(0, 0, 0, .75), rgba(0, 0, 0, 0));
    opacity: .92; transition: opacity .2s;
  }
  body:not(.embed) .player-card:not(:hover) .player-controls { opacity: .55; }
  body:not(.embed) .player-controls .btn-ghost { background: rgba(26, 33, 43, .85); }
  body:not(.embed) .select-label { margin-left: auto; color: #cfd6df; }
}
@media (prefers-reduced-motion: reduce) { body:not(.embed) .player-controls { transition: none; } }
@media (min-width: 961px) and (min-height: 560px) { body:not(.embed) .q-text { display: none; } }

/* ---------- Autocomplete ---------- */
.topbar, body:not(.embed) .topbar { position: relative; z-index: 30; }
.input-wrap { position: relative; }
.ac {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45); overflow: hidden;
}
.ac[hidden] { display: none; }
.ac-list { list-style: none; margin: 0; padding: 6px 0; max-height: min(62vh, 480px); overflow-y: auto; overscroll-behavior: contain; }
.ac-section { padding: 8px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: .8px; color: var(--muted); }
.ac-section-live { color: var(--accent-2); }
.ac-note { padding: 8px 14px; color: var(--muted); font-size: 13px; }
.ac-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 7px 14px; cursor: pointer; }
.ac-item:hover, .ac-item[aria-selected="true"] { background: var(--surface-2); }
.ac-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.ac-main { display: flex; flex-direction: column; min-width: 0; }
.ac-id { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-nick { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-meta { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ac-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; letter-spacing: .4px; }
.ac-live { background: var(--accent-2); color: #fff; animation: ac-pulse 1.6s ease-in-out infinite; }
.ac-offline { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
@keyframes ac-pulse { 50% { box-shadow: 0 0 0 5px rgba(254, 44, 85, .25); } }
@media (prefers-reduced-motion: reduce) { .ac-live { animation: none; } }
@media (max-width: 560px) {
  .ac-item { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .ac-meta { display: none; }
}

/* ---------- Konto im Header ---------- */
.header-actions { display: flex; align-items: center; gap: 8px; }
.user-box { display: flex; align-items: center; gap: 8px; }
.user-box[hidden] { display: none; }
.user-name { color: var(--text); font-weight: 600; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions .btn { padding: 8px 12px; }

/* ---------- Aufnahme-Buttons ---------- */
.btn-rec { background: rgba(254, 44, 85, .16); color: #ffd3dc; border: 1px solid rgba(254, 44, 85, .45); }
.btn-rec:hover:not(:disabled) { background: rgba(254, 44, 85, .28); }
.btn-rec.is-recording { background: var(--accent-2); color: #fff; animation: ac-pulse 1.6s ease-in-out infinite; }
.btn-danger:hover:not(:disabled) { background: rgba(255, 92, 108, .2); border-color: var(--danger); }
@media (prefers-reduced-motion: reduce) { .btn-rec.is-recording { animation: none; } }

/* ---------- Archiv ---------- */
.archive { flex: 1; min-height: 0; overflow-y: auto; padding: 16px max(16px, 2vw); display: flex; flex-direction: column; gap: 12px; }
.archive[hidden] { display: none; }
body.view-archive .layout { display: none; }
.archive-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.archive-head h2 { font-size: 20px; }
.archive-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 13px; cursor: pointer; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent); color: #062b2a; border-color: var(--accent); font-weight: 700; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.archive-note { color: var(--muted); font-size: 13px; }
.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-content: start; }
.rec-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.rec-thumb { position: relative; aspect-ratio: 16 / 9; background: #000 radial-gradient(circle at 50% 45%, #1a212b, #000); }
.rec-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-flag { position: absolute; top: 8px; left: 8px; font-size: 20px; line-height: 1; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.rec-duration, .rec-live { position: absolute; bottom: 8px; right: 8px; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .75); font-variant-numeric: tabular-nums; }
.rec-live { background: var(--accent-2); color: #fff; }
.rec-body { padding: 10px 12px 4px; min-width: 0; }
.rec-body h3 { font-size: 15px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-meta, .rec-title { color: var(--muted); font-size: 12px; margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 12px; margin-top: auto; }
.rec-actions .btn { padding: 7px 10px; font-size: 13px; text-decoration: none; }

/* ---------- Anmelde-Dialog ---------- */
.auth-dialog { width: min(420px, calc(100vw - 32px)); padding: 22px 22px 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.auth-dialog::backdrop { background: rgba(5, 8, 12, .72); backdrop-filter: blur(3px); }
.auth-close-form { position: absolute; top: 8px; right: 8px; margin: 0; }
.auth-close { background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; padding: 4px 8px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--surface-2); border-radius: 10px; padding: 4px; margin: 6px 0 16px; }
.auth-tabs [role="tab"] { font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 8px; cursor: pointer; background: transparent; color: var(--muted); }
.auth-tabs [aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.auth-form label[hidden] { display: none; }
.auth-form input { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.auth-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.auth-error { color: var(--danger); font-size: 13px; min-height: 1em; margin: 0; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.btn-google { width: 100%; background: #fff; color: #1f1f1f; border-color: #dadce0; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
.btn-google .g-logo { flex: none; }
.btn-google:hover { filter: brightness(.96); }
.auth-hint { font-size: 12px; color: var(--warn); margin: 10px 0 0; }
.auth-hint[hidden] { display: none; }

@media (max-width: 960px) {
  .header-actions { margin-left: auto; }
}
@media (max-width: 560px) {
  .header-actions .btn { padding: 7px 10px; font-size: 13px; }
  .archive-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Rechte Spalte: Diamanten/Einnahmen oben, Chat + Geschenke fuellen die volle Hoehe ---------- */
.stats-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-side .stat { padding: 7px 10px; }
.stats-side .stat dd { font-size: clamp(15px, 1.2vw, 20px); margin-top: 2px; }
.info-row .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (min-width: 961px) and (min-height: 560px) {
  /* Links: Player + Info-Zeile; rechts: Spalte ueber beide Zeilen */
  body:not(.embed) .info-row { grid-column: 1; grid-row: 2; grid-template-columns: minmax(180px, 320px) minmax(0, 1fr); }
  body:not(.embed) .feeds { grid-column: 2; grid-row: 1 / -1; grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr); }
}

/* Duenne Scrollbars */
.feed-list, .archive, .ac-list { scrollbar-width: thin; scrollbar-color: #3a4656 transparent; }
.feed-list::-webkit-scrollbar, .archive::-webkit-scrollbar, .ac-list::-webkit-scrollbar { width: 6px; }
.feed-list::-webkit-scrollbar-thumb, .archive::-webkit-scrollbar-thumb, .ac-list::-webkit-scrollbar-thumb { background: #3a4656; border-radius: 6px; }
.feed-list::-webkit-scrollbar-track, .archive::-webkit-scrollbar-track, .ac-list::-webkit-scrollbar-track { background: transparent; }

/* ---------- Geschenk-Feed ---------- */
.feed-list .gift-icon-emoji { display: inline-grid; place-items: center; font-size: 17px; line-height: 1; }
.feed-list .eur { color: var(--muted); font-size: 12px; }
.feed-list li[data-tier="medium"] { background: linear-gradient(90deg, rgba(37, 244, 238, .08), transparent 70%); }
.feed-list li[data-tier="large"] { background: linear-gradient(90deg, rgba(254, 44, 85, .14), transparent 75%); }
.feed-list li[data-tier="epic"] { background: linear-gradient(90deg, rgba(255, 196, 0, .2), rgba(254, 44, 85, .08) 60%, transparent); box-shadow: inset 3px 0 0 #ffc400; }
.feed-list li[data-tier="epic"] .diamonds { color: #ffd54a; font-weight: 700; }

/* ---------- Live-Coin-Zaehler ---------- */
.stat-coins { position: relative; overflow: hidden; border-color: color-mix(in srgb, #ffc400 45%, var(--border));
  background: radial-gradient(120% 140% at 0% 0%, rgba(255, 196, 0, .16), transparent 55%), var(--surface); }
.stat-coins dt { color: #ffd54a; }
.stat-coins dd { color: #fff3c4; text-shadow: 0 0 18px rgba(255, 196, 0, .35); }
.stat-coins.is-pulsing { animation: coin-pulse .6s ease-out; }
.coin-bump { position: absolute; right: 12px; top: 10px; font-weight: 800; font-size: 14px; color: #ffd54a; pointer-events: none;
  text-shadow: 0 0 10px rgba(255, 196, 0, .7); animation: coin-bump 1.1s ease-out forwards; }
@keyframes coin-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 196, 0, .55); } 100% { box-shadow: 0 0 0 14px rgba(255, 196, 0, 0); } }
@keyframes coin-bump { 0% { opacity: 0; transform: translateY(8px) scale(.8); } 20% { opacity: 1; transform: translateY(0) scale(1.1); } 100% { opacity: 0; transform: translateY(-26px) scale(1); } }

/* ---------- Geschenk-Overlay ueber dem Video ---------- */
.gift-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; contain: layout paint; }
.gift-banners { position: absolute; left: 12px; bottom: 74px; display: flex; flex-direction: column-reverse; gap: 8px; max-width: min(78%, 360px); }

.gift-banner { position: relative; display: flex; align-items: center; gap: 8px; padding: 4px 58px 4px 4px; min-height: 42px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, .28)); color: #fff; will-change: transform, opacity;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35); animation: gb-in .38s cubic-bezier(.2, .9, .25, 1.2) both; }
.gift-banner[data-tier="medium"] { background: linear-gradient(90deg, rgba(37, 244, 238, .55), rgba(0, 0, 0, .3)); }
.gift-banner[data-tier="large"] { background: linear-gradient(90deg, rgba(254, 44, 85, .78), rgba(120, 20, 60, .35)); }
.gift-banner[data-tier="epic"] { background: linear-gradient(90deg, rgba(255, 170, 0, .85), rgba(254, 44, 85, .45)); box-shadow: 0 0 24px rgba(255, 196, 0, .55); }
.gift-banner.is-leaving { animation: gb-out .45s ease-in forwards; }
.gb-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid rgba(255, 255, 255, .85); background: var(--surface-2); }
.gb-avatar.is-initial { display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.gb-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.gb-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-what { font-size: 12px; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-icon { position: absolute; right: 6px; top: 50%; width: 48px; height: 48px; object-fit: contain; transform: translateY(-50%);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); animation: gb-icon-in .5s cubic-bezier(.2, .9, .25, 1.4) both .08s; }
.gb-icon.is-emoji { display: grid; place-items: center; font-size: 34px; }
.gb-combo { position: absolute; left: calc(100% + 8px); top: 50%; translate: 0 -50%; font-size: 30px; font-weight: 900; font-style: italic; white-space: nowrap;
  color: #fff; -webkit-text-stroke: 1.5px #ff3b6b; paint-order: stroke fill; text-shadow: 0 2px 0 #c2185b, 0 0 14px rgba(254, 44, 85, .7); }
.gift-banner[data-tier="epic"] .gb-combo, .gift-banner[data-tier="large"] .gb-combo { -webkit-text-stroke-color: #ffb300; text-shadow: 0 2px 0 #e65100, 0 0 16px rgba(255, 196, 0, .8); }

@keyframes gb-in { from { opacity: 0; transform: translateX(-110%); } to { opacity: 1; transform: none; } }
@keyframes gb-out { to { opacity: 0; transform: translateX(-30%); } }
@keyframes gb-icon-in { from { opacity: 0; transform: translateY(-50%) scale(.2) rotate(-25deg); } to { opacity: 1; transform: translateY(-50%) scale(1) rotate(0); } }

.gift-burst-box { position: absolute; inset: 0; display: grid; place-items: center; }
.gift-burst { position: relative; display: grid; justify-items: center; gap: 10px; will-change: transform, opacity; animation: burst-in .6s cubic-bezier(.2, .9, .25, 1.25) both; }
.gift-burst.is-leaving { animation: burst-out .45s ease-in forwards; }
.gb-glow { position: absolute; left: 50%; top: 40%; width: 420px; height: 420px; margin: -210px 0 0 -210px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(37, 244, 238, .55), rgba(37, 244, 238, .12) 45%, transparent 70%); animation: glow-breathe 1.6s ease-in-out infinite alternate; }
.gift-burst[data-tier="large"] .gb-glow { background: radial-gradient(circle, rgba(254, 44, 85, .6), rgba(254, 44, 85, .15) 45%, transparent 70%); }
.gift-burst[data-tier="epic"] .gb-glow { width: 560px; height: 560px; margin: -280px 0 0 -280px;
  background: radial-gradient(circle, rgba(255, 214, 74, .75), rgba(255, 120, 0, .25) 42%, transparent 70%); }
.gb-rays { position: absolute; left: 50%; top: 40%; width: 640px; height: 640px; margin: -320px 0 0 -320px; z-index: -2; border-radius: 50%; opacity: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .16) 0deg 7deg, transparent 7deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%); mask: radial-gradient(circle, #000 18%, transparent 68%); }
.gift-burst[data-tier="large"] .gb-rays, .gift-burst[data-tier="epic"] .gb-rays { opacity: 1; animation: rays-spin 9s linear infinite; }
.gift-burst[data-tier="epic"] .gb-rays { background: repeating-conic-gradient(from 0deg, rgba(255, 220, 120, .3) 0deg 6deg, transparent 6deg 18deg); }
.gb-big-icon { width: clamp(110px, 26vmin, 220px); height: clamp(110px, 26vmin, 220px); object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(255, 255, 255, .55)) drop-shadow(0 10px 18px rgba(0, 0, 0, .5)); animation: icon-float 1.8s ease-in-out infinite alternate .6s; }
.gb-big-icon.is-emoji { display: grid; place-items: center; font-size: clamp(90px, 20vmin, 170px); }
.gb-caption { display: grid; justify-items: center; gap: 2px; padding: 8px 18px; border-radius: 16px; text-align: center;
  background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); color: #fff; max-width: min(90vw, 520px); }
.gb-sender { font-size: clamp(15px, 2.2vmin, 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.gb-gift { font-size: clamp(13px, 1.9vmin, 16px); opacity: .9; }
.gb-coins { font-size: clamp(22px, 4.2vmin, 38px); font-weight: 900; letter-spacing: .5px;
  background: linear-gradient(180deg, #fff6c9, #ffc400 55%, #ff8a00); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 196, 0, .65)); }
.gb-sparks { position: absolute; left: 50%; top: 40%; width: 0; height: 0; }
.gb-sparks i { position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #fff, #ffd54a 45%, transparent 70%); animation: spark 1.4s ease-out var(--d) infinite; }
.gift-burst[data-tier="medium"] .gb-sparks i { background: radial-gradient(circle, #fff, #25f4ee 45%, transparent 70%); }

@keyframes burst-in { 0% { opacity: 0; transform: scale(.3) translateY(40px); } 60% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes burst-out { to { opacity: 0; transform: scale(1.15) translateY(-20px); } }
@keyframes glow-breathe { from { transform: scale(.85); opacity: .75; } to { transform: scale(1.08); opacity: 1; } }
@keyframes rays-spin { to { transform: rotate(360deg); } }
@keyframes icon-float { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-10px) rotate(2deg); } }
@keyframes spark { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1.1); } }

@media (max-width: 560px) {
  .gift-banners { left: 8px; bottom: 64px; gap: 6px; }
  .gift-banner { min-height: 36px; padding-right: 48px; }
  .gb-avatar { width: 28px; height: 28px; }
  .gb-icon { width: 40px; height: 40px; }
  .gb-combo { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .gift-banner, .gift-banner.is-leaving, .gb-icon, .gift-burst, .gift-burst.is-leaving, .gb-glow, .gb-rays, .gb-big-icon, .gb-sparks i,
  .stat-coins.is-pulsing { animation: none !important; }
  .gb-sparks { display: none; }
  .gift-banner.is-leaving, .gift-burst.is-leaving { opacity: 0; }
}

/* ---------- Archiv-Suche & externe Eintraege ---------- */
.archive-search { margin: 0 0 10px; }
.archive-search input { width: min(100%, 420px); background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; font: inherit; }
.archive-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.rec-source { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: rgba(0, 0, 0, .65); color: #fff; }
.rec-thumb .rec-live-badge { position: absolute; right: 8px; top: 8px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px;
  background: var(--accent-2); color: #fff; letter-spacing: .5px; }
.rec-thumb .rec-avatar { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.1); }
.archive-gate { display: grid; justify-items: center; gap: 12px; padding: 48px 16px; text-align: center; grid-column: 1 / -1; }
.archive-gate p { color: var(--muted); max-width: 46ch; }
.archive-gate .gate-icon { font-size: 42px; }

/* ---------- Admin-Zugang in der Kopfzeile ---------- */
.btn-admin { background: linear-gradient(90deg, rgba(255, 213, 74, .18), rgba(255, 159, 26, .12)); color: #ffd54a; border-color: rgba(255, 196, 0, .5); font-weight: 700; text-decoration: none; }
.btn-admin:hover { border-color: #ffc400; }
.btn-admin[hidden] { display: none; }

/* ---------- Werbe-Einwilligung ---------- */
.consent { position: fixed; z-index: 60; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(640px, calc(100% - 24px)); padding: 8px 10px 8px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between;
  border-radius: 14px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55); font-size: 13px; color: var(--text); }
.consent p { flex: 1 1 260px; margin: 0; }
.consent-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.consent .btn { padding: 6px 12px; font-size: 13px; }
.consent-toggle { position: fixed; z-index: 55; left: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-size: 16px; opacity: .55; }
.consent-toggle:hover, .consent-toggle:focus-visible { opacity: 1; }

/* ---------- Passwort-Auge, Passwort vergessen, Support ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; box-sizing: border-box; padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--text); background: var(--surface-2); outline: none; }
.pw-eye svg { width: 20px; height: 20px; }
.forgot-link { justify-self: end; margin-top: -6px; font-size: 13px; }
.support-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.support-dialog h2 { font-size: 18px; margin-bottom: 10px; }
.support-dialog textarea { width: 100%; box-sizing: border-box; resize: vertical; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font: inherit; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.thread { display: grid; gap: 8px; margin: 8px 0 12px; max-height: 42dvh; overflow-y: auto; }
.msg { padding: 9px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.msg.from-admin { background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.msg small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.ticket-badge { position: fixed; z-index: 56; right: 14px; bottom: 14px; }
#ticket-link { word-break: break-all; }

.captcha:empty { display: none; }
.captcha { min-height: 65px; }

/* ---------- Wartungsmodus ---------- */
.maintenance { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; background: rgba(8, 11, 15, .94); backdrop-filter: blur(6px); }
.maintenance-card { max-width: 460px; text-align: center; display: grid; gap: 12px; padding: 28px 24px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.maintenance-card h1 { font-size: 22px; }
.maintenance-card p { color: var(--muted); }

/* ---------- Video-Werbepause ---------- */
.adbreak { position: absolute; inset: 0; z-index: 3; background: #000; display: grid; }
.adbreak video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.adbreak-bar { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 8px; }
.adbreak-label { margin-right: auto; padding: 3px 10px; border-radius: 6px; background: rgba(255, 196, 0, .92); color: #1b1300; font-size: 12px; font-weight: 800; letter-spacing: .5px; }
.adbreak-skip { background: rgba(0, 0, 0, .7); color: #fff; border-color: rgba(255, 255, 255, .35); }
.adbreak-skip:disabled { opacity: .75; cursor: default; }
.adbreak-more { text-decoration: none; }

/* ---------- Klickbare Namen / Zuschauerliste ---------- */
a.name, a.gb-name { color: inherit; text-decoration: none; }
.feed-list a.name { color: var(--accent); }
.feed-list .gift a.name { color: var(--accent-2); }
a.name:hover, a.gb-name:hover { text-decoration: underline; }
.avatar-link { display: inline-flex; flex: none; }
.gift-banner { pointer-events: auto; }
.stat-click { cursor: pointer; transition: border-color .15s, background .15s; }
.stat-click:hover, .stat-click:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); outline: none; }
.stat-click .chev { color: var(--accent); font-weight: 800; }
.viewers-dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.viewers-dialog[open] { display: grid; gap: 10px; grid-template-rows: auto auto auto auto minmax(0, 1fr); }
.viewers-dialog h2 { font-size: 18px; }
.viewers-dialog input[type="search"] { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font: inherit; }
.viewers-dialog input[type="search"]:focus { outline: none; border-color: var(--accent); }
.viewers-tabs { flex-wrap: wrap; gap: 6px; }
.viewers-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 52dvh; overscroll-behavior: contain; scrollbar-width: thin; display: grid; align-content: start; }
.viewers-list li { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.viewers-list .avatar { width: 34px; height: 34px; }
.vw-text { display: grid; min-width: 0; flex: 1; }
.vw-text .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-text small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-badges { display: flex; gap: 8px; font-size: 12px; font-style: normal; white-space: nowrap; }
.vw-badges b { color: var(--warn); }
.vw-badges i { color: var(--muted); font-style: normal; }
.vw-empty { color: var(--muted); padding: 18px 6px !important; }

/* ---------- Handy-Ansicht (bis 720 px) ---------- */
@media (max-width: 720px) {
  .hide-sm { display: none; }
  body:not(.embed) .topbar {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand pill actions" "form form form";
    gap: 8px 10px; padding: 8px 12px; align-items: center;
  }
  body:not(.embed) .brand { grid-area: brand; font-size: 16px; gap: 8px; }
  body:not(.embed) .brand-mark { width: 24px; height: 24px; }
  /* Status auf dem Handy nur als Punkt (Text bleibt fuer Screenreader erhalten; Details zeigt der Player) */
  body:not(.embed) #conn-pill { grid-area: pill; justify-self: end; padding: 9px; }
  body:not(.embed) #conn-pill #conn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body:not(.embed) .header-actions { grid-area: actions; gap: 6px; }
  body:not(.embed) .header-actions .btn, body:not(.embed) .user-box .btn { padding: 7px 10px; font-size: 13px; }
  body:not(.embed) .user-box .user-name { display: none; }
  body:not(.embed) .watch-form { grid-area: form; flex: none; max-width: none; flex-wrap: nowrap; gap: 6px; }
  body:not(.embed) .watch-form .input-wrap { flex: 1 1 auto; min-width: 0; padding: 0 10px; }
  body:not(.embed) .watch-form .btn { padding: 9px 12px; font-size: 14px; flex: none; }

  body:not(.embed) .layout { padding: 10px 10px 16px; gap: 10px; }
  body:not(.embed) .stage { gap: 10px; }
  body:not(.embed) .player-frame { max-height: 64dvh; }
  body:not(.embed) .player-controls { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
  body:not(.embed) .player-controls .btn { flex: 1 1 30%; min-width: 0; padding: 8px 4px; font-size: 13px; white-space: nowrap; justify-content: center; }
  body:not(.embed) .player-controls .select-label { flex: 1 1 30%; min-width: 0; margin: 0; }
  body:not(.embed) .player-controls .select-label select { width: 100%; padding: 8px 6px; }
  body:not(.embed) .q-text { display: none; }

  body:not(.embed) .info-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  body:not(.embed) .streamer { padding: 8px 12px; gap: 10px; }
  body:not(.embed) .avatar-lg { width: 40px; height: 40px; }
  body:not(.embed) .streamer-text h1 { font-size: 16px; }
  body:not(.embed) .info-row .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  body:not(.embed) .stat { padding: 8px 10px; }
  body:not(.embed) .stat dt { font-size: 10px; letter-spacing: .2px; }
  body:not(.embed) .stat dd { font-size: 17px; margin-top: 2px; }
  body:not(.embed) .stats-side { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body:not(.embed) .stats-side .stat dd { font-size: 17px; }
  .coin-bump { right: 6px; top: 4px; font-size: 12px; }

  body:not(.embed) .feeds { gap: 10px; }
  body:not(.embed) .feed:first-of-type .feed-list { height: 36dvh; }
  body:not(.embed) .feed-events .feed-list { height: 30dvh; }
  body:not(.embed) .feed-list li { padding: 4px 12px; font-size: 14px; }

  /* Geschenk-Effekte im kleinen Player: kompakter, hoechstens zwei Banner */
  .gift-banners { left: 6px; bottom: 6px; max-width: 78%; gap: 4px; }
  .gift-banner:nth-child(n + 3) { display: none; }
  .gift-banner { min-height: 30px; padding: 2px 44px 2px 2px; transform-origin: left bottom; }
  .gb-avatar { width: 24px; height: 24px; }
  .gb-name { font-size: 12px; }
  .gb-what { font-size: 10px; }
  .gb-icon { width: 32px; height: 32px; right: 4px; }
  .gb-combo { font-size: 20px; left: calc(100% + 4px); }
  .gb-big-icon { width: 64px; height: 64px; }
  .gb-big-icon.is-emoji { font-size: 56px; }
  .gb-glow { width: 220px; height: 220px; margin: -110px 0 0 -110px; }
  .gb-rays { width: 300px; height: 300px; margin: -150px 0 0 -150px; }
  .gb-caption { padding: 4px 10px; }
  .gb-sender { font-size: 13px; }
  .gb-gift { font-size: 11px; }
  .gb-coins { font-size: 18px; }

  .auth-dialog, .support-dialog, .viewers-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); padding: 16px 14px; }
  .archive { padding: 12px 10px; }
  .archive-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .archive-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .archive-filters::-webkit-scrollbar { display: none; }
  .archive-filters .chip { flex: none; }
  .consent-toggle, .ticket-badge { bottom: 8px; }
}
@media (max-width: 380px) {
  body:not(.embed) .info-row .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Rechtstexte, Hinweise ---------- */
.legal-links { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 4px 12px 6px; font-size: 12px; color: var(--muted); }
.legal-links .link-btn { font-size: 12px; color: var(--muted); }
.legal-links .link-btn:hover { color: var(--text); text-decoration: underline; }
.legal-dialog { width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
.legal-dialog h2 { font-size: 20px; margin-bottom: 10px; }
.legal-body h3 { font-size: 15px; margin: 16px 0 4px; color: var(--accent); }
.legal-body p { margin: 0 0 8px; color: var(--text); line-height: 1.5; font-size: 14px; word-break: break-word; }
.notice { position: fixed; z-index: 80; left: 50%; top: 14px; transform: translateX(-50%); max-width: min(520px, calc(100vw - 24px)); padding: 10px 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--accent); box-shadow: 0 14px 40px rgba(0, 0, 0, .5); font-size: 14px; }
@media (min-width: 961px) and (min-height: 560px) { body:not(.embed) .legal-links { padding: 0 12px 4px; } }

/* "hidden" gilt immer – auch fuer Elemente, deren Klasse display setzt */
[hidden] { display: none !important; }

/* =====================================================================================================
   Icon-Knoepfe, Lautstaerke, Hochformat-Streams
   ===================================================================================================== */
.btn .ic { line-height: 1; }
.btn .ic + .lbl { margin-left: .4em; }
.tt-only { display: none !important; }
html.tt .tt-only { display: inline-flex !important; }
@media (max-width: 900px) { .desktop-only { display: none !important; } }

.vol { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.vol-range { width: 90px; accent-color: var(--accent); cursor: pointer; }
.vol:has(.vol-range:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 10px; }

/* Hochformat-Stream im klassischen Desktop-Layout: Knoepfe nur als Icons, Kennzahlen unter dem Video, Lautstaerke als Popover */
html.stream-portrait:not(.tt) body:not(.embed) {
  & .player-controls .lbl, & .player-controls .q-text { display: none; }
  & .player-controls .btn { padding: 7px 9px; }
  & .player-controls .select-label { margin-left: 0; }
  & .info-row { grid-template-columns: minmax(0, 1fr) !important; gap: 8px; }
  & .info-row .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  & .stat { padding: 6px 8px; }
  & .stat dt { font-size: 10px; letter-spacing: 0; }
  & .stat dd { font-size: 15px; }
  & .streamer { padding: 8px 12px; }
}
/* Hochformat am Desktop: Video bekommt die volle Hoehe, Streamer-Leiste + Kennzahlen wandern unter Chat/Geschenke. */
@media (min-width: 961px) and (min-height: 560px) {
  html.stream-portrait:not(.tt) body:not(.embed) {
    & .player-card { grid-row: 1 / -1; }
    & .feeds { grid-row: 1; }
    & .info-row { grid-column: 2; grid-row: 2; }
  }
}
:is(html.stream-portrait:not(.tt), html.tt) .vol-range {
  position: absolute; width: 120px; padding: 8px 12px; border-radius: 999px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5;
}
html.stream-portrait:not(.tt) .vol-range { bottom: calc(100% + 8px); left: 0; }
html.tt .vol-range { right: calc(100% + 10px); top: 50%; transform: translateY(-50%); }
:is(html.stream-portrait:not(.tt), html.tt) .vol:hover .vol-range, :is(html.stream-portrait:not(.tt), html.tt) .vol:focus-within .vol-range, :is(html.stream-portrait:not(.tt), html.tt) .vol.open .vol-range { opacity: 1; pointer-events: auto; }

/* =====================================================================================================
   TikTok-Modus (html.tt): Livestream als Vollbild-Hintergrund, alles andere transparent darueber
   ===================================================================================================== */
html.tt, html.tt body:not(.embed) { height: 100dvh; overflow: hidden; }
html.tt body:not(.embed) {
  display: block; min-height: 0; background: #000;

  & .layout, & .stage, & .player-card, & .player-stage, & .info-row { display: contents; }
  & .player-card { border: 0; background: none; }

  /* --- Video: ganzer Bildschirm --- */
  & .player-frame { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-height: none; flex: none; aspect-ratio: auto; z-index: 1; background: #000; border-radius: 0; }
  & .player-frame video { object-fit: contain; }
  & .player-frame::after {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: linear-gradient(to top, rgba(0, 0, 0, .55) 0%, transparent 35%), linear-gradient(to bottom, rgba(0, 0, 0, .4) 0%, transparent 16%);
  }

  /* --- Kopfzeile --- */
  & .topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: flex; flex-wrap: nowrap; align-items: center; gap: 6px;
    padding: calc(8px + env(safe-area-inset-top)) 10px 18px; border: 0; backdrop-filter: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent); pointer-events: none;
  }
  & .topbar > * { pointer-events: auto; }
  & .brand { gap: 0; } & .brand > span:last-child { display: none; }
  & .brand-mark { width: 26px; height: 26px; }
  & #conn-pill { padding: 9px; margin: 0; border: 0; background: rgba(0, 0, 0, .3); backdrop-filter: blur(6px); }
  & #conn-pill #conn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  & .header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
  & .topbar .btn, & .topbar .stat-viewers {
    padding: 6px 11px; border: 0; border-radius: 999px; font-size: 13px; color: #fff; background: rgba(0, 0, 0, .3); backdrop-filter: blur(6px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
  }
  & .topbar .btn-admin { color: #ffd54a; }
  & .topbar .btn .lbl { display: none; }
  & #auth-btn .lbl, & #logout-btn .lbl { display: inline; }
  & .user-box .user-name { display: none; }
  & .watch-form {
    position: fixed; top: calc(50px + env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 40; display: none; max-width: none; padding: 8px; border-radius: 14px;
    background: rgba(10, 12, 16, .85); backdrop-filter: blur(10px);
  }

  /* --- Streamer-Kapsel und Live-Werte als schmale Pills --- */
  & .streamer {
    position: fixed; top: calc(48px + env(safe-area-inset-top)); left: 10px; z-index: 20; max-width: min(66vw, 380px); padding: 4px 14px 4px 4px; gap: 8px;
    border: 0; border-radius: 999px; background: rgba(0, 0, 0, .3); backdrop-filter: blur(6px); color: #fff;
  }
  & .streamer .avatar-lg { width: 36px; height: 36px; }
  & .streamer-text h1 { font-size: 14px; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
  & .streamer-text p { font-size: 11px; color: rgba(255, 255, 255, .85); }
  & .info-row .stats, & .stats-side {
    position: fixed; z-index: 20; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; background: none; max-width: 80vw;
  }
  & .info-row .stats { top: calc(92px + env(safe-area-inset-top)); }
  & .stats-side { top: calc(124px + env(safe-area-inset-top)); pointer-events: auto; }
  & .info-row .stats { pointer-events: auto; }
  & .stat {
    position: relative; overflow: visible; display: flex; align-items: center; gap: 5px; padding: 3px 10px; border: 0; border-radius: 999px;
    background: rgba(0, 0, 0, .25); backdrop-filter: blur(4px); color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); box-shadow: none;
  }
  & .stat dt { margin: 0; font-size: 0 !important; color: #fff; }
  & .stat dt::before { font-size: 12px; }
  & .stat-likes dt::before { content: '❤️'; } & .stat-coins dt::before { content: '🪙'; } & .stat-diamonds dt::before { content: '💎'; }
  & .stat-money dt::before { content: '💶'; } & .stat-viewers dt::before { content: '👁'; }
  & .stat-viewers .chev { display: none; }
  & .stat dd { margin: 0 !important; font-size: 13px !important; font-weight: 800; color: #fff; text-shadow: inherit; }
  & .stat-money dd { color: #6fe3a1; }
  & .stat-coins { border: 0; } & .stat-coins dd { color: #ffe69a; text-shadow: 0 0 10px rgba(255, 196, 0, .45), 0 1px 3px rgba(0, 0, 0, .9); }
  & .coin-bump { top: -14px; right: 2px; font-size: 12px; }

  /* --- Chat und Geschenke: transparent unten links ueber dem Video --- */
  & .feeds {
    position: fixed; top: auto; left: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); width: min(78vw, 360px); max-height: 62dvh; z-index: 15;
    display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; background: none; pointer-events: none;
  }
  & .feed { display: block; min-height: 0; border: 0; border-radius: 0; background: none; overflow: visible; }
  & .feed-events { order: -1; }
  & .feed-head { display: contents; }
  & .feed-head h2 { display: none; }
  & .feed-list {
    height: auto !important; margin: 0; padding: 0; overflow-y: auto; pointer-events: auto; scrollbar-width: none; background: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%); mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  }
  & .feed-list::-webkit-scrollbar { display: none; }
  & #chat-list { max-height: 32dvh; } & #event-list { max-height: 15dvh; }
  & .feed-list li {
    width: fit-content; max-width: 100%; margin: 2px 0; padding: 3px 10px; border-radius: 14px; box-shadow: none; background: rgba(0, 0, 0, .22); color: #fff;
    font-size: 14px; text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
  }
  & .feed-list li:hover { background: rgba(0, 0, 0, .22); }
  & .feed-list li[data-tier="medium"] { background: rgba(37, 244, 238, .22); }
  & .feed-list li[data-tier="large"] { background: rgba(254, 44, 85, .3); }
  & .feed-list li[data-tier="epic"] { background: rgba(255, 196, 0, .32); }
  & .feed-list .system { color: rgba(255, 255, 255, .75); }
  & #chat-follow { align-self: flex-start; pointer-events: auto; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .45); color: #fff; }

  /* --- Geschenk-Effekte ueber dem Chat --- */
  & .gift-banners { left: 10px; bottom: calc(70px + 47dvh + 22px); }

  /* --- Runde Action-Icons am rechten Rand --- */
  & .player-controls {
    position: fixed; top: auto; left: auto; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 25; width: auto; padding: 0; border: 0;
    display: flex; flex-direction: column; flex-wrap: nowrap; align-items: center; gap: 10px; background: none; opacity: 1 !important; transition: none;
  }
  & .player-controls .btn, & .player-controls .select-label, & .player-controls #log-btn {
    flex: none; width: 42px; height: 42px; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; font-size: 19px; color: #fff;
    background: rgba(0, 0, 0, .35); backdrop-filter: blur(6px); white-space: nowrap; overflow: visible;
  }
  & .player-controls .vol { flex: none; }
  & .player-controls .btn:disabled { opacity: .5; }
  & .player-controls .lbl, & .player-controls .q-text { display: none; }
  & .player-controls .btn-rec.is-recording { background: rgba(220, 30, 60, .8); }
  & .select-label { position: relative; font-size: 0; }
  & .select-label::before { content: '⚙️'; font-size: 19px; }
  & .select-label select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

  /* --- Impressum/Datenschutz dezent ganz unten --- */
  & .legal-links { position: fixed; left: 0; right: 0; bottom: calc(2px + env(safe-area-inset-bottom)); z-index: 14; padding: 0; font-size: 10px; pointer-events: none; }
  & .legal-links .link-btn { pointer-events: auto; color: rgba(255, 255, 255, .7); text-shadow: 0 1px 3px rgba(0, 0, 0, .9); font-size: 10px; }

  /* --- Archiv-Ansicht ueber dem Video --- */
  & .archive { position: fixed; inset: 0; top: calc(52px + env(safe-area-inset-top)); z-index: 25; overflow-y: auto; padding: 12px; background: var(--bg); }
}
/* TikTok-Modus am breiten Bildschirm mit Hochformat-Stream: die schwarzen Seitenflaechen werden genutzt –
   links Geschenke, Ereignisse und Geschenk-Animationen, rechts der Chat (neben den Action-Icons). */
@media (min-aspect-ratio: 3/2) and (min-height: 500px) {
  html.tt.stream-portrait body:not(.embed) {
    --side: calc((100vw - 100dvh * 9 / 16) / 2);
    & .feeds { display: contents; }
    & .feed { position: fixed; z-index: 15; display: flex; flex-direction: column; gap: 6px; min-height: 0; pointer-events: none; }
    & .feed-events { left: 12px; top: calc(205px + env(safe-area-inset-top)); bottom: calc(14px + env(safe-area-inset-bottom)); width: calc(var(--side) - 24px); }
    & .feed:not(.feed-events) { right: 66px; top: calc(56px + env(safe-area-inset-top)); bottom: calc(14px + env(safe-area-inset-bottom)); width: calc(var(--side) - 80px); }
    & #chat-list, & #event-list { flex: 1 1 0; min-height: 0; max-height: none; height: auto !important; overflow-y: auto; overscroll-behavior: contain; }
    & .feed-list li { font-size: 15px; }
    /* Oberer Bereich der Geschenke-Liste blendet weich aus – dort schweben die Geschenk-Animationen */
    & #event-list { padding-top: 120px; -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 110px, #000 175px); mask-image: linear-gradient(to bottom, transparent 0, transparent 110px, #000 175px); }
    /* Geschenk-Animationen schweben (wie bei TikTok) ueber dem oberen Teil der Geschenke-Liste */
    & .gift-banners {
      position: fixed; z-index: 16; left: 12px; right: auto; top: calc(205px + env(safe-area-inset-top)); bottom: auto;
      flex-direction: column; justify-content: flex-start; overflow: visible; max-width: calc(var(--side) - 90px);
    }
  }
}
/* TikTok-Modus: neue Chat-/Geschenk-Eintraege gleiten ein; Scrollen per Rad/Wischen ohne sichtbare Leiste */
html.tt body:not(.embed) .feed-list { scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior: contain; touch-action: pan-y; }
html.tt body:not(.embed) .feed-list::-webkit-scrollbar { width: 0; height: 0; display: none; }
html.tt body:not(.embed) .feed-list > li:last-child { animation: tt-msg-in .32s cubic-bezier(.2, .9, .3, 1.15) both; }
html.tt body:not(.embed) #event-list > li[data-tier]:last-child { animation: tt-gift-in .5s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes tt-msg-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes tt-gift-in { 0% { opacity: 0; transform: translateX(-24px) scale(.9); } 60% { opacity: 1; transform: translateX(3px) scale(1.03); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { html.tt body:not(.embed) .feed-list > li:last-child { animation: none; } }
/* Auge (Oberflaeche ein/aus): gleiche Kreis-Optik wie die anderen Icons, Zustand sichtbar */
.eye-ic { display: inline-grid; place-items: center; line-height: 0; }
.eye-ic .eye-closed { display: none; }
html.tt-clear .eye-ic .eye-open { display: none; }
html.tt-clear .eye-ic .eye-closed { display: block; }
html.tt body:not(.embed) #ui-btn { color: #fff; }
html.tt.tt-clear body:not(.embed) #ui-btn { background: rgba(37, 244, 238, .25); color: #25f4ee; box-shadow: 0 0 0 2px rgba(37, 244, 238, .5); }
html.tt.search-open body:not(.embed) .watch-form { display: flex; }
html.tt body.view-archive:not(.embed) .layout { display: none; }
html.tt body.view-archive:not(.embed) .topbar { background: rgba(11, 14, 18, .96); }
html.tt body.view-archive:not(.embed) .player-frame, html.tt body.view-archive:not(.embed) .feeds, html.tt body.view-archive:not(.embed) .player-controls { display: none; }
/* Handy-Stream (Hochformat) auf einem Hochkant-Bildschirm: Bild fuellt alles; sonst (Desktop) zentriert mit schwarzen Seiten */
@media (max-aspect-ratio: 4/5) { html.tt.stream-portrait body:not(.embed) .player-frame video { object-fit: cover; } }

/* "Clear Mode": Oberflaeche ausblenden (Tippen auf das Video oder Auge-Knopf) */
html.tt.tt-clear body:not(.embed) {
  & .topbar, & .streamer, & .info-row .stats, & .stats-side, & .feeds, & .legal-links, & .gift-layer { display: none !important; }
  & .player-controls > :not(#ui-btn) { display: none !important; }
  & .player-controls { opacity: .55 !important; }
}

/* =====================================================================================================
   Universal-Modal (#statsModal): Desktop zentriert (max. 720 px), Handy als Bottom-Sheet
   ===================================================================================================== */
.stat-click:hover, .stat-click:focus-visible { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 28%, transparent); }
.head-click { cursor: pointer; border-radius: 8px; transition: color .15s, text-shadow .15s; }
.head-click:hover, .head-click:focus-visible { color: var(--accent); text-shadow: 0 0 14px color-mix(in srgb, var(--accent) 45%, transparent); outline: none; }
.head-click .chev { color: var(--accent); }
a.streamer { color: inherit; text-decoration: none; transition: box-shadow .15s, border-color .15s; }
a.streamer[href]:hover, a.streamer[href]:focus-visible { border-color: var(--accent); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 28%, transparent); outline: none; }
a.streamer:not([href]) { cursor: default; }

.modal { padding: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); width: min(720px, calc(100vw - 24px)); max-height: min(86dvh, 800px); box-shadow: 0 30px 80px rgba(0, 0, 0, .65); overflow: hidden; }
.modal[open] { display: flex; animation: modal-in .24s cubic-bezier(.2, .9, .3, 1); }
.modal::backdrop { background: rgba(5, 8, 12, .72); backdrop-filter: blur(3px); animation: modal-fade .2s ease-out; }
.modal-card { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; }
.modal-close { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
.modal-close:hover, .modal-close:focus-visible { background: color-mix(in srgb, var(--accent-2) 30%, var(--surface-2)); outline: none; }
.modal-head { flex: none; }
.modal-tabs { flex: none; display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; padding: 10px 18px 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.modal-tabs::-webkit-scrollbar { display: none; }
.modal-tabs .chip { flex: none; }
.modal-body { padding: 14px 18px 22px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; scrollbar-width: thin; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes modal-sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }

.m-sub { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.m-note { color: var(--muted); font-size: 12px; margin: 14px 0 0; line-height: 1.5; }
.m-empty { color: var(--muted); padding: 14px 4px; font-size: 14px; }
.m-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 10px; }
.m-kpi { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.m-kpi-l { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.m-kpi-v { font-size: 20px; font-variant-numeric: tabular-nums; }
.m-kpi small { color: var(--muted); font-size: 11px; }
.m-chart { margin: 6px 0 10px; }
.m-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.m-grid { stroke: rgba(139, 151, 168, .16); }
.m-tick { fill: var(--muted); font-size: 10px; }
.m-bar { fill: var(--accent); opacity: .85; }
.m-bar:hover { opacity: 1; fill: var(--accent-2); }
.m-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.m-col h3 { font-size: 13px; margin: 6px 0; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.m-list, .m-feed { list-style: none; margin: 0; padding: 0; }
.m-list li { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.m-grow { display: grid; min-width: 0; flex: 1; }
.m-grow strong, .m-grow .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-grow small { color: var(--muted); font-size: 12px; }
.m-icon { width: 26px; height: 26px; object-fit: contain; flex: none; }
.m-emoji { display: inline-grid; place-items: center; font-size: 20px; }
.m-rank { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-size: 12px; font-weight: 800; color: var(--accent); }
.m-coins { color: var(--warn); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.m-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.m-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.m-search { flex: 1 1 160px; min-width: 0; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font: inherit; }
.m-search:focus { outline: none; border-color: var(--accent); }
.m-feed li { display: flex; align-items: baseline; gap: 10px; padding: 5px 2px; font-size: 14px; border-bottom: 1px solid color-mix(in srgb, var(--border) 45%, transparent); word-break: break-word; }
.m-feed time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; flex: none; }
.m-feed .name { color: var(--accent); font-weight: 700; }

@media (max-width: 700px) {
  .modal { width: 100vw; max-width: none; height: 92dvh; max-height: 92dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
  .modal[open] { animation: modal-sheet .28s cubic-bezier(.2, .9, .3, 1); }
  .m-cols { grid-template-columns: minmax(0, 1fr); }
  .modal-body { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .modal[open], .modal::backdrop { animation: none; } }

/* Hinweis: E-Mail noch nicht bestaetigt */
.verify-banner { position: fixed; z-index: 60; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(640px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 14px; background: rgba(20, 26, 33, .96); border: 1px solid #2a3a4c;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45); backdrop-filter: blur(8px); color: var(--text); font-size: 14px; animation: vb-in .35s cubic-bezier(.2, .9, .3, 1.2) both; }
.verify-banner .vb-icon { font-size: 20px; flex: none; }
.verify-banner .vb-text { flex: 1; min-width: 0; line-height: 1.35; }
.verify-banner .vb-resend { flex: none; padding: 7px 12px; font-size: 13px; }
.verify-banner .vb-close { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.verify-banner .vb-close:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
@keyframes vb-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 560px) { .verify-banner { flex-wrap: wrap; } .verify-banner .vb-text { flex-basis: calc(100% - 70px); } .verify-banner .vb-resend { margin-left: 30px; } }

/* ---------- Swipe-Feed: Pfeil-Knoepfe, Wechsel-Animation, Streamer-Karte, "Fuer dich live" ---------- */
.swipe-nav { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; gap: 10px; }
.swipe-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .14); display: grid; place-items: center; cursor: pointer;
  color: #fff; background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); transition: transform .15s, background .15s, opacity .15s; }
.swipe-btn:hover:not(:disabled) { background: rgba(37, 244, 238, .25); transform: scale(1.06); }
.swipe-btn:disabled { opacity: .3; cursor: default; }
.swipe-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.player-frame.swipe-up video, .player-frame.swipe-up .overlay { animation: swipe-up .42s cubic-bezier(.2, .8, .2, 1); }
.player-frame.swipe-down video, .player-frame.swipe-down .overlay { animation: swipe-down .42s cubic-bezier(.2, .8, .2, 1); }
@keyframes swipe-up { 0% { transform: translateY(0); opacity: 1; } 45% { transform: translateY(-14%); opacity: 0; } 55% { transform: translateY(14%); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes swipe-down { 0% { transform: translateY(0); opacity: 1; } 45% { transform: translateY(14%); opacity: 0; } 55% { transform: translateY(-14%); opacity: 0; } 100% { transform: none; opacity: 1; } }
.swipe-card { position: absolute; left: 50%; top: 14%; z-index: 7; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: min(92%, 420px);
  padding: 6px 16px 6px 6px; border-radius: 999px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(8px); color: #fff; pointer-events: none; }
.swipe-card[hidden] { display: none; }
.swipe-card.is-in { animation: sc-in .4s cubic-bezier(.2, .9, .3, 1.25) both; }
.swipe-card .sc-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid #fe2c55; flex: none; background: #222; }
.swipe-card .sc-text { display: grid; min-width: 0; line-height: 1.25; }
.swipe-card .sc-text strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swipe-card .sc-text span { font-size: 12px; color: rgba(255, 255, 255, .8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes sc-in { from { opacity: 0; transform: translate(-50%, -10px) scale(.95); } to { opacity: 1; transform: translate(-50%, 0); } }
/* TikTok-Modus: Pfeile oben rechts (unter der Kopfzeile), damit sie die Action-Icons nicht verdecken */
html.tt body:not(.embed) .swipe-nav { position: fixed; top: calc(56px + env(safe-area-inset-top)); right: 10px; transform: none; z-index: 26; }
html.tt body:not(.embed) .swipe-btn { width: 42px; height: 42px; }
html.tt body:not(.embed) .swipe-card { position: fixed; top: calc(150px + env(safe-area-inset-top)); z-index: 27; }
html.tt.tt-clear body:not(.embed) .swipe-nav { display: none; }
@media (max-width: 560px) { .swipe-nav { right: 8px; } }
@media (prefers-reduced-motion: reduce) { .player-frame.swipe-up video, .player-frame.swipe-down video, .player-frame.swipe-up .overlay, .player-frame.swipe-down .overlay, .swipe-card.is-in { animation: none; } }

/* ---------- Discovery-Center (statt "Kein Stream aktiv"): Live-Karten aus dem DACH-Pool ---------- */
.discover { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; gap: 12px; padding: 16px 70px 16px 16px; overflow-y: auto;
  background: radial-gradient(ellipse at top, rgba(254, 44, 85, .10), transparent 55%), linear-gradient(180deg, #0d1117, #0b0e12); scrollbar-width: thin; }
.discover[hidden] { display: none; }
.dc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dc-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 17px; }
.dc-pulse { width: 10px; height: 10px; border-radius: 50%; background: #fe2c55; box-shadow: 0 0 0 0 rgba(254, 44, 85, .7); animation: dc-pulse 1.6s infinite; }
@keyframes dc-pulse { 0% { box-shadow: 0 0 0 0 rgba(254, 44, 85, .7); } 70% { box-shadow: 0 0 0 10px rgba(254, 44, 85, 0); } 100% { box-shadow: 0 0 0 0 rgba(254, 44, 85, 0); } }
.dc-count { font-size: 12px; color: var(--muted); }
.dc-close { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 20px; cursor: pointer; }
.dc-pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.dc-pills::-webkit-scrollbar { display: none; }
.dc-pill { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.dc-pill[aria-selected="true"] { background: linear-gradient(135deg, #fe2c55, #ff5f7e); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(254, 44, 85, .35); }
.dc-pill.dc-random { border-style: dashed; }
.dc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.dc-card { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); padding: 0; cursor: pointer;
  background: #111; color: #fff; font: inherit; text-align: left; transition: transform .18s, box-shadow .18s, border-color .18s; }
.dc-card:hover, .dc-card:focus-visible { transform: translateY(-3px); border-color: #fe2c55; box-shadow: 0 10px 26px rgba(0, 0, 0, .45); outline: none; }
.dc-card.tier-large { border-color: rgba(255, 196, 0, .55); }
.dc-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.dc-card:hover .dc-cover { transform: scale(1.06); }
.dc-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, .45), transparent 30%, transparent 55%, rgba(0, 0, 0, .85)); pointer-events: none; }
.dc-top { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.dc-live { padding: 2px 7px; border-radius: 6px; background: #fe2c55; font-size: 11px; font-weight: 800; letter-spacing: .4px; animation: dc-live 2s ease-in-out infinite; }
@keyframes dc-live { 50% { box-shadow: 0 0 0 4px rgba(254, 44, 85, .25); } }
.dc-viewers { padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .55); font-size: 12px; font-weight: 700; }
.dc-badge { position: absolute; z-index: 1; left: 8px; top: 36px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .55); font-size: 11px; font-weight: 700; }
.tier-large .dc-badge { background: rgba(255, 170, 0, .85); color: #1b1300; }
.tier-medium .dc-badge { background: rgba(254, 44, 85, .8); }
.tier-small .dc-badge { background: rgba(46, 204, 113, .8); color: #04170c; }
.dc-foot { position: absolute; z-index: 1; left: 8px; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 8px; }
.dc-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; flex: none; background: #222; }
.dc-text { display: grid; min-width: 0; line-height: 1.2; }
.dc-text strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-text span { font-size: 11px; color: rgba(255, 255, 255, .8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-empty { color: var(--muted); text-align: center; margin: 30px auto; max-width: 46ch; }
.dc-start { flex: none; align-self: center; height: auto; padding: 11px 24px; font-size: 15px; }
.btn-discover { color: #ff8fa3; }
.btn-discover[aria-pressed="true"] { background: rgba(254, 44, 85, .18); border-color: rgba(254, 44, 85, .5); }
/* Mini-Vorschau am Pfeil runter */
.swipe-tip { position: absolute; right: calc(100% + 10px); bottom: 4px; white-space: nowrap; padding: 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, .8);
  color: #fff; font-size: 12px; pointer-events: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.swipe-tip[hidden] { display: none; }
/* TikTok-Modus: Entdecken-Bereich unter der Kopfzeile, rechts Platz fuer Icons */
html.tt body:not(.embed) .discover { position: fixed; top: calc(52px + env(safe-area-inset-top)); z-index: 24; padding: 12px 64px 90px 12px; }
@media (max-width: 560px) {
  .discover { padding: 12px 58px 12px 10px; }
  .dc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .btn-discover .lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) { .dc-pulse, .dc-live { animation: none; } .dc-card, .dc-cover { transition: none; } }
/* TikTok-Modus: solange "Entdecken" offen ist, Stream-Overlays (Kennzahlen, Chat, Geschenke) ausblenden */
html.tt body:not(.embed):has(.discover:not([hidden])) :is(.streamer, .info-row .stats, .stats-side, .feeds, .gift-layer, .player-controls) { display: none !important; }
html.tt body:not(.embed):has(.discover:not([hidden])) .player-frame { z-index: 22; }

/* ---------- Geschenk-Effekte nach Groesse: schweben (klein), Pop-up (mittel); gross = .gift-burst ---------- */
.gift-float { position: absolute; left: var(--x); bottom: 12%; width: 56px; height: 56px; object-fit: contain; z-index: 2; pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(255, 196, 0, .7)) drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); animation: gift-float var(--dur, 3s) cubic-bezier(.3, .6, .4, 1) forwards; }
.gift-float.is-emoji { display: grid; place-items: center; font-size: 40px; }
@keyframes gift-float {
  0% { opacity: 0; transform: translate(0, 20px) scale(.5); }
  12% { opacity: 1; transform: translate(0, 0) scale(1.1); }
  100% { opacity: 0; transform: translate(var(--drift), -320px) scale(.8) rotate(12deg); }
}
.gift-pop { position: absolute; left: var(--x); top: var(--y); z-index: 3; display: grid; justify-items: center; gap: 4px; transform: translate(-50%, -50%); pointer-events: none;
  animation: gift-pop 2.2s cubic-bezier(.2, .9, .3, 1.3) forwards; }
.gift-pop .gp-icon { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 0 18px rgba(37, 244, 238, .75)); }
.gift-pop .gp-icon.is-emoji { display: grid; place-items: center; font-size: 64px; }
.gift-pop .gp-ring { position: absolute; top: 48px; left: 50%; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%; border: 3px solid rgba(37, 244, 238, .85);
  box-shadow: 0 0 24px rgba(37, 244, 238, .6); animation: gift-ring 1.1s ease-out forwards; }
.gift-pop .gp-label { padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; }
@keyframes gift-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 30% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%) scale(.9); } }
@keyframes gift-ring { from { opacity: 1; transform: scale(.6); } to { opacity: 0; transform: scale(2.4); } }
@media (prefers-reduced-motion: reduce) { .gift-pop, .gift-pop .gp-ring { animation: none; } }

/* ---------- Privater TikTok-Login (Auth-Modal) ---------- */
.btn-tiktok { width: 100%; margin-top: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700;
  color: #fff; background: #000; border-color: #000; }
.btn-tiktok .tt-logo { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 5px; font-size: 14px;
  background: linear-gradient(135deg, #25f4ee 0 45%, #fe2c55 55% 100%); color: #000; font-weight: 900; text-shadow: 1px 0 #25f4ee, -1px 0 #fe2c55; }
.tiktok-flow { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.tiktok-flow[hidden] { display: none; }
.tt-confirm { display: grid; gap: 10px; }
.tt-profile { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.tt-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid #fe2c55; background: #222; }
.tt-meta { display: grid; min-width: 0; }
.tt-meta strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-meta .muted { font-size: 13px; }
.tt-actions { display: flex; gap: 8px; }
.tt-actions .btn { flex: 1; }
.tt-cancel { justify-self: center; }
.user-avatar { border-radius: 50%; object-fit: cover; border: 1.5px solid var(--border); background: var(--surface-2); flex: none; }

/* =====================================================================================================
   High-End-Feinschliff (klassische Ansicht): Glas-Header, leuchtender Player, Verlaufs-Kennzahlen, ruhige Panels
   ===================================================================================================== */
html:not(.tt) body:not(.embed) {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(254, 44, 85, .10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(37, 244, 238, .08), transparent 55%),
    var(--bg);
  & .topbar {
    background: rgba(13, 16, 22, .72); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
    border-bottom: 1px solid rgba(255, 255, 255, .06); box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  }
  & .brand { font-weight: 800; letter-spacing: .2px; }
  & .watch-form input { border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
  & .watch-form input:focus { border-color: #fe2c55; box-shadow: 0 0 0 4px rgba(254, 44, 85, .18); }
  & .btn { border-radius: 12px; transition: transform .15s, box-shadow .2s, background .2s, border-color .2s; }
  & .btn:hover:not(:disabled) { transform: translateY(-1px); }
  & .btn-primary { background: linear-gradient(135deg, #fe2c55, #ff5f7e); border-color: transparent; box-shadow: 0 6px 18px rgba(254, 44, 85, .32); }
  & .btn-primary:hover:not(:disabled) { box-shadow: 0 10px 26px rgba(254, 44, 85, .45); }

  /* Player: abgerundeter Rahmen mit dezentem Neon-Rand */
  & .player-card { border-radius: 20px; border: 1px solid rgba(255, 255, 255, .07); background: linear-gradient(180deg, #11151c, #0c0f14);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(37, 244, 238, .04); overflow: hidden; }
  & .player-frame { border-radius: 16px; overflow: hidden; }
  & .player-controls { background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent); }

  /* Kennzahlen: Glas-Karten mit farbigem Akzent und weicher Zahl-Animation */
  & .stat { border-radius: 16px; border: 1px solid rgba(255, 255, 255, .07);
    background: linear-gradient(160deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .01)); position: relative; overflow: hidden;
    transition: transform .18s, border-color .18s, box-shadow .18s; }
  & .stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--stat-accent, rgba(255, 255, 255, .12)); }
  & .stat:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .14); box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
  & .stat dt { text-transform: uppercase; letter-spacing: .6px; font-size: 11px; color: var(--muted); }
  & .stat dd { font-weight: 800; letter-spacing: -.2px; font-variant-numeric: tabular-nums; }
  & .stat-diamonds { --stat-accent: linear-gradient(#25f4ee, #1fc7c2); }
  & .stat-money { --stat-accent: linear-gradient(#2ecc71, #1fa85a); }
  & .stat-coins { --stat-accent: linear-gradient(#ffc400, #ff9f1a); }
  & .stat-likes { --stat-accent: linear-gradient(#fe2c55, #ff5f7e); }
  & .stat-viewers { --stat-accent: linear-gradient(#b388ff, #7c4dff); }

  /* Chat / Geschenke: ruhige Panels, klare Kopfzeile, weiche Zeilen */
  & .feed { border-radius: 18px; border: 1px solid rgba(255, 255, 255, .07); background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01));
    box-shadow: 0 12px 30px rgba(0, 0, 0, .25); overflow: hidden; }
  & .feed-head { background: rgba(255, 255, 255, .025); border-bottom: 1px solid rgba(255, 255, 255, .06); }
  & .feed-head h2 { font-weight: 800; letter-spacing: .2px; }
  & .feed-list li { border-radius: 10px; margin: 1px 6px; transition: background .15s; }
  & .feed-list li:hover { background: rgba(255, 255, 255, .04); }
  & .feed-list > li:last-child { animation: hi-row .35s ease-out both; }
  & .streamer { border-radius: 16px; border: 1px solid rgba(255, 255, 255, .07); background: linear-gradient(160deg, rgba(254, 44, 85, .08), rgba(37, 244, 238, .05)); }
}
@keyframes hi-row { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html:not(.tt) body:not(.embed) .feed-list > li:last-child { animation: none; } }

/* ---------- High-End: Anmelde-Fenster ---------- */
#auth-dialog.auth-dialog {
  width: min(420px, calc(100vw - 24px)); padding: 26px 24px 22px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .08);
  background: radial-gradient(500px 220px at 0% 0%, rgba(254, 44, 85, .14), transparent 60%), radial-gradient(400px 200px at 100% 0%, rgba(37, 244, 238, .10), transparent 60%), #10141a;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .03);
}
#auth-dialog[open] { animation: auth-in .28s cubic-bezier(.2, .9, .3, 1.15) both; }
#auth-dialog::backdrop { background: rgba(5, 7, 10, .6); backdrop-filter: blur(6px); }
@keyframes auth-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
#auth-dialog::before { content: 'TikTokWatch'; display: block; margin: 0 0 14px; text-align: center; font-size: 20px; font-weight: 800; letter-spacing: .3px;
  background: linear-gradient(90deg, #fff, #25f4ee 60%, #fe2c55); -webkit-background-clip: text; background-clip: text; color: transparent; }
#auth-dialog .auth-tabs { padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06); }
#auth-dialog .auth-tabs button { border-radius: 10px; font-weight: 700; transition: background .2s, color .2s; }
#auth-dialog .auth-tabs button[aria-selected="true"] { background: linear-gradient(135deg, #fe2c55, #ff5f7e); color: #fff; box-shadow: 0 6px 16px rgba(254, 44, 85, .3); }
#auth-dialog .auth-form label { font-size: 12px; font-weight: 600; letter-spacing: .3px; color: var(--muted); }
#auth-dialog .auth-form input { margin-top: 6px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1);
  color: var(--text); font-size: 15px; transition: border-color .2s, box-shadow .2s, background .2s; }
#auth-dialog .auth-form input:focus { outline: none; border-color: #25f4ee; background: rgba(255, 255, 255, .06); box-shadow: 0 0 0 4px rgba(37, 244, 238, .15); }
#auth-dialog .btn-primary { width: 100%; padding: 12px; border-radius: 12px; font-size: 15px; font-weight: 800; background: linear-gradient(135deg, #fe2c55, #ff5f7e); border-color: transparent; box-shadow: 0 8px 22px rgba(254, 44, 85, .35); }
#auth-dialog .btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(254, 44, 85, .45); }
#auth-dialog .auth-divider { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
#auth-dialog .btn-google, #auth-dialog .btn-tiktok { padding: 12px; border-radius: 12px; transition: transform .15s, box-shadow .2s; }
#auth-dialog .btn-google:hover, #auth-dialog .btn-tiktok:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0, 0, 0, .35); }
#auth-dialog .btn-tiktok { background: #000; border: 1px solid rgba(255, 255, 255, .14); box-shadow: inset 2px 0 0 #25f4ee, inset -2px 0 0 #fe2c55; }
#auth-dialog .tt-profile { background: linear-gradient(135deg, rgba(254, 44, 85, .12), rgba(37, 244, 238, .08)); border-color: rgba(255, 255, 255, .1); animation: auth-in .3s ease-out both; }
#auth-dialog #tt-pin { text-align: center; font-size: 22px; letter-spacing: 10px; font-variant-numeric: tabular-nums; }
#auth-dialog .auth-error:not(:empty) { padding: 8px 10px; border-radius: 10px; background: rgba(255, 77, 109, .12); border: 1px solid rgba(255, 77, 109, .3); }
#auth-dialog .auth-close { border-radius: 50%; transition: background .2s, transform .2s; }
#auth-dialog .auth-close:hover { background: rgba(255, 255, 255, .08); transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { #auth-dialog[open], #auth-dialog .tt-profile { animation: none; } }
/* TikTok-Anmeldung aktiv: nur diesen Schritt zeigen */
#auth-dialog:has(#tiktok-flow:not([hidden])) :is(.auth-tabs, #auth-form, .auth-divider, #google-btn, #google-hint) { display: none !important; }
#auth-dialog:has(#tiktok-flow:not([hidden])) .tiktok-flow { border-top: 0; padding-top: 4px; }

/* ---------- High-End: Discovery-Raster ---------- */
.dc-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.dc-card { border-radius: 18px; border-color: rgba(255, 255, 255, .08); box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
  animation: dc-in .45s cubic-bezier(.2, .9, .3, 1.15) both; animation-delay: calc(var(--i, 0) * 45ms); }
.dc-card:hover, .dc-card:focus-visible { transform: translateY(-4px) scale(1.015); box-shadow: 0 18px 40px rgba(0, 0, 0, .5), 0 0 0 2px rgba(254, 44, 85, .55); }
.dc-card::after { background: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 32%, transparent 52%, rgba(0, 0, 0, .9)); }
.dc-card .dc-live { box-shadow: 0 0 0 0 rgba(254, 44, 85, .6); }
.dc-card.is-new { box-shadow: 0 0 0 2px #25f4ee, 0 0 28px rgba(37, 244, 238, .45); }
.dc-card.is-new::before { content: 'NEU'; position: absolute; z-index: 2; right: 8px; top: 36px; padding: 2px 7px; border-radius: 6px; background: #25f4ee; color: #00201f; font-size: 10px; font-weight: 900; letter-spacing: .5px; }
.dc-text strong { font-size: 14px; }
.dc-title strong { font-size: 19px; background: linear-gradient(90deg, #fff, #ffd1da); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dc-pill { transition: transform .15s, box-shadow .2s, background .2s; }
.dc-pill:hover { transform: translateY(-1px); }
@keyframes dc-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .dc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
@media (prefers-reduced-motion: reduce) { .dc-card { animation: none; } }
.discover > .dc-head, .discover > .dc-pills, .discover > .dc-grid, .discover > .dc-empty { flex: none; }
.dc-pills { padding: 2px 0 4px; }
