/* ==========================================================================
   Kwaba Sync – Cyber-Voodoo
   Palette: Void / Crypt / Loa-Violet / Spirit-Green / Ritual-Gold / Bone
   ========================================================================== */

/* Cinzel and JetBrains Mono are the default. public/js/theme.js loads further fonts
   on demand – only the one actually chosen. */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --void:      #08050d;
  --crypt:     #120b1c;
  --crypt-2:   #1b1129;
  --veil:      #251838;
  --loa:       #7b3fa0;
  --loa-lit:   #b478e8;
  --spirit:    #3ff0b0;
  --spirit-dim:#1d8f6b;
  --gold:      #e8c37a;
  --bone:      #ded6ea;
  --ash:       #8d80a3;
  --blood:     #d5486b;

  /* "Altar" tokens (design docs/design/altar, 2.38.0): gold = content/progress, turquoise = on/active,
     red = live/critical, violet = volume. Where the colour existed already, the token hangs on it. */
  --k-ground:    var(--void);
  --k-video:     #050308;
  --k-panel:     #170d22;
  --k-panel-2:   #241433;
  --k-tile:      #1f1530;
  --k-line:      #3b2a52;
  --k-line-soft: #2a1c3a;
  --k-text:      var(--bone);
  --k-muted:     #a596b8;
  --k-gold:      var(--gold);
  --k-gold-dim:  #a08446;
  --k-teal:      var(--spirit);
  --k-teal-bg:   #10261f;
  --k-teal-line: #2f5a4c;
  --k-violet:    var(--loa-lit);
  --k-live:      #e0524a;
  --k-live-text: #ff8a80;
  --k-live-bg:   #2a0f14;

  /* overridable by public/js/theme.js */
  --display: 'Cinzel', 'Times New Roman', serif;
  --data: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --r: 3px;
  --glow-spirit: 0 0 12px rgba(63, 240, 176, .35);
  --glow-loa: 0 0 18px rgba(180, 120, 232, .28);
  --hairline: 1px solid rgba(180, 120, 232, .22);

  /* Overridden per device by public/js/theme.js. Fonts stay,
     brightness, cut and size are controlled. */
  --ui-title: var(--gold);
  --ui-title-weight: 700;
  --ui-text: var(--bone);
  --ui-dim: var(--ash);
  --ui-queue-size: .88rem;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 82% -8%, rgba(123, 63, 160, .30), transparent 62%),
    radial-gradient(760px 520px at 6% 104%, rgba(63, 240, 176, .10), transparent 60%),
    var(--void);
  /* Fixed to the viewport instead of the document - otherwise the gradients don't reach
     the bottom on long pages (e.g. /admin) and there is a hard
     cut where only --void comes afterwards. For the same reason the
     veve texture below (body::before) is fixed too. */
  background-attachment: fixed;
  color: var(--ui-text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* veve grid as a calm texture, not as decorative fireworks */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(180, 120, 232, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 120, 232, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--spirit); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: rgba(180, 120, 232, .4); }

:focus-visible {
  outline: 2px solid var(--spirit);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ typography */

h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: .06em;
  margin: 0;
}

h1 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); color: var(--ui-title); font-weight: var(--ui-title-weight); }
h2 { font-size: 1.1rem; color: var(--loa-lit); text-transform: uppercase; letter-spacing: .16em; }

.eyebrow {
  font-family: var(--data);
  font-size: .68rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ui-dim);
}

.mono { font-family: var(--data); }
.muted { color: var(--ui-dim); }
.gold { color: var(--gold); }
.spirit { color: var(--spirit); }

/* ---------------------------------------------------------------------- shell */

.wrap { position: relative; z-index: 1; max-width: 1600px; margin: 0 auto; padding: 28px 20px 64px; }

.topbar {
  position: relative; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: 3px 14px; min-height: 36px;   /* 2.90.0 "Kompakt": as high as the app's window buttons (desktop/src/preload.js) */
  background: linear-gradient(180deg, rgba(27, 17, 41, .96), rgba(18, 11, 28, .88));
  border-bottom: var(--hairline);
  backdrop-filter: blur(6px);
}
.topbar .brand {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  color: var(--loa-lit); text-decoration: none;
  padding: 2px 6px 2px 2px; border-radius: var(--r);
  transition: background .15s;
}
.topbar .brand:hover { background: rgba(180, 120, 232, .14); text-decoration: none; }
.topbar .brand:hover b { color: #f3dcae; }
.topbar .brand svg { width: 20px; height: 20px; flex: 0 0 auto; }
.topbar .brand b {
  font-family: var(--display); font-size: .86rem; letter-spacing: .22em;
  color: var(--ui-title); font-weight: var(--ui-title-weight);
  text-transform: uppercase; white-space: nowrap;
}
/* subtitle only in the logo's tooltip since 2.90.0 - the element stays for body.tv .topbar .sub */
.topbar .sub { display: none; font-family: var(--data); font-size: .68rem; color: var(--ui-dim); letter-spacing: .12em; }

/* room name in the header: small and in mono, hence one step bolder */
.topbar .room-tag {
  font-family: var(--data); font-size: .74rem; font-weight: 600;
  letter-spacing: .06em; color: var(--ui-title);
  max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .spacer { flex: 1; }
/* 2.153.2: lead = the page's own buttons next to the logo (room: Rooms, Copy link); center = the room name exactly in the
   middle of the bar, its max-width set by js/common.js fitTopbarCenter; up to 1080 px it stands in the row */
.topbar .tb-lead { display: flex; align-items: center; gap: 6px; flex: none; }
.topbar .tb-lead > .btn.sm { padding: 3px 8px; font-size: .64rem; min-height: 24px; }
.topbar .tb-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 28ch; }
.topbar .tb-ts { color: var(--k-teal); }   /* 2.162.0: the room's Teamspeak channel next to its name */
@media (max-width: 1080px) {
  .topbar { flex-wrap: wrap; }
  .topbar .tb-center { position: static; transform: none; min-width: 12ch; flex: 1 1 0; max-width: none !important; }
  .topbar .tb-center ~ .spacer { display: none; }
}
/* thin divider: in front of name and menu, the person's own corner */
.topbar .tb-sep { width: 1px; height: 18px; margin: 0 4px; background: rgba(180, 120, 232, .22); }
.topbar nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* buttons IN the bar only (2.90.0) - the entries of .tb-menu/.lang-menu keep the normal .btn.sm size */
.topbar nav > .btn.sm, .topbar .tb-menu-wrap > .btn { padding: 3px 8px; font-size: .64rem; min-height: 24px; }
.topbar .lang-wrap > .lang-btn { padding: 2px 6px; min-height: 24px; }
/* menu next to the name (js/common.js mountTopbarMenu): overlay below the button, right-aligned */
.tb-menu-wrap { position: relative; }
.tb-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  display: flex; flex-direction: column; gap: 6px; min-width: 180px; padding: 8px;
  background: linear-gradient(180deg, #1b1129, var(--crypt));
  border: var(--hairline); border-radius: var(--r); box-shadow: var(--glow-loa);
}
.tb-menu[hidden] { display: none; }
#tbMenuBtn[hidden] { display: none; }
.tb-menu .btn { justify-content: flex-start; width: 100%; }
/* Language switch next to the name (js/common.js mountLangSwitch, 2.81.0): flag button, same overlay as the menu */
.flag { width: 20px; height: 12px; border-radius: 2px; display: inline-block; vertical-align: middle; box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); }
.lang-wrap { position: relative; }
.lang-btn { padding: 4px 7px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lang-menu { min-width: 150px; }
.lang-menu .btn { gap: 8px; }
.lang-menu .btn[aria-checked="true"] { color: var(--ui-title); border-color: var(--loa-lit); }
.gate { position: relative; }
.gate-lang { position: absolute; top: 14px; right: 14px; z-index: 5; }

/* --------------------------------------------------------------------- panels */

.panel {
  background: linear-gradient(180deg, rgba(27, 17, 41, .82), rgba(15, 9, 23, .82));
  border: var(--hairline);
  border-radius: var(--r);
  padding: 18px;
  position: relative;
}
.panel::after {
  /* ritual gold corner at the top left: marks every chamber */
  content: ''; position: absolute; top: 0; left: 0;
  width: 14px; height: 14px;
  border-top: 2px solid var(--gold); border-left: 2px solid var(--gold);
  opacity: .55;
}
.panel > header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.panel > header .spacer { flex: 1; }

/* Lobby with the livestream panel: a third column to the left of "Rooms", not
   merged/as a tab - see the feature specification screenshare v2. */
.grid-3 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }

/* --------------------------------------------------------------------- inputs */

label.field { display: block; margin-bottom: 12px; }
label.field span {
  display: block; font-family: var(--data); font-size: .68rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ui-dim); margin-bottom: 5px;
}

input[type=text], input[type=password], input[type=search], input[type=number], input[type=email], select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(8, 5, 13, .85);
  border: 1px solid rgba(180, 120, 232, .28);
  border-radius: var(--r);
  color: var(--ui-text);
  font-family: var(--body);
  font-size: .95rem;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--spirit);
  box-shadow: var(--glow-spirit);
  outline: none;
}
input::placeholder { color: #5d5270; }
/* The browser's own spinner arrows don't fit the theme and are replaced anyway
   by the fields' own min/max/step limits. */
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px;
  font-family: var(--data); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(123, 63, 160, .18);
  color: var(--bone);
  border: 1px solid rgba(180, 120, 232, .45);
  border-radius: var(--r);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover:not(:disabled) { background: rgba(180, 120, 232, .3); border-color: var(--loa-lit); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, rgba(63, 240, 176, .22), rgba(29, 143, 107, .22));
  border-color: var(--spirit); color: #d7fff0;
}
.btn.primary:hover:not(:disabled) { background: rgba(63, 240, 176, .34); box-shadow: var(--glow-spirit); }
.btn.gold { border-color: var(--gold); color: var(--gold); background: rgba(232, 195, 122, .1); }
.btn.danger { border-color: var(--blood); color: #ffc9d6; background: rgba(213, 72, 107, .12); }
.btn.ghost { background: none; border-color: rgba(180, 120, 232, .25); }
.btn.sm { padding: 5px 9px; font-size: .68rem; }
.btn.icon { padding: 6px 8px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }

.switch { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--ui-dim); cursor: pointer; }
.switch input { accent-color: var(--spirit); width: 16px; height: 16px; }

.notice {
  padding: 10px 12px; border-radius: var(--r); font-size: .88rem;
  border-left: 3px solid var(--blood); background: rgba(213, 72, 107, .12); color: #ffd3de;
}
.notice.ok { border-left-color: var(--spirit); background: rgba(63, 240, 176, .1); color: #cffbec; }
.notice.hidden { display: none; }

/* -------------------------------------------------------------- login / lobby */

/* Lobby: shared column for the drawer buttons at the left edge ("Releases", "Free games"; public/js/edge-tabs.js) */
.edge-tabs {
  position: fixed; left: 0; top: 50%; z-index: 30; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
}

.gate { min-height: 100%; display: grid; place-items: center; padding: 40px 18px; }
.gate .card { width: 100%; max-width: 430px; }
/* login.html hides the invite code field by class - there was no rule for it, it was always there */
.gate .field.hidden { display: none; }
.gate .sigil { display: grid; place-items: center; margin-bottom: 18px; }
.gate .sigil svg { width: 96px; height: 96px; filter: drop-shadow(0 0 16px rgba(180, 120, 232, .45)); }
.gate h1 { text-align: center; margin-bottom: 4px; }
.gate .tagline { text-align: center; margin-bottom: 22px; }
.tabs { display: flex; gap: 0; margin-bottom: 18px; border-bottom: var(--hairline); }
.tabs button {
  flex: 1; padding: 9px 0; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--ui-dim); font-family: var(--data); font-size: .74rem; letter-spacing: .18em;
  text-transform: uppercase; cursor: pointer;
}
.tabs button[aria-selected=true] { color: var(--ui-title); border-bottom-color: var(--ui-title); }

.room-list { display: grid; gap: 10px; }
/* Lobby: cards may become as narrow as their column. Without a column width the content (long name +
   buttons) decided the track's minimum width, the card ran out of the box and lay below the neighbouring column
   (only at certain window widths). The name breaks in the middle of a word for that if need be. Deliberately only .grid-3 (lobby):
   the TV mode's list (tv-rooms.html) stays untouched. */
.grid-3 .room-list { grid-template-columns: minmax(0, 1fr); }
.grid-3 .room-card .name, .grid-3 .room-card .meta { overflow-wrap: anywhere; }
.grid-3 .panel > header { flex-wrap: wrap; row-gap: 6px; }   /* a header with a long heading + button wraps on narrow screens instead of overflowing */
/* Lobby cards (rooms, playlists; livestreams see .stream-card): badges and buttons form a group on the right.
   If the width isn't enough, the group slides right-aligned below the name - the name keeps at least about 150 px
   and isn't squeezed to a few letters per line (e.g. when a room carries "Password" and "N live").
   Without badges and with enough room everything stays in one line as before. */
.grid-3 .room-card { flex-wrap: wrap; row-gap: 8px; }
.grid-3 .room-card .grow { flex: 1 1 150px; }
.grid-3 .room-card .card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-left: auto; max-width: 100%; }

/* Lobby dashboard (public/js/dashboard.js): fixed columns (3/2/1 depending on the width), tiles arrangeable per account.
   Moving/adding/removing only in the mode "Customise" (.dash.editing), collapsing always. */
.dash-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.dash-bar .spacer { flex: 1; }
.dash-edit-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-edit-tools[hidden] { display: none; }
.dash-add-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 200px; padding: 10px;
  background: var(--crypt-2); box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
}
.dash-add-menu[hidden] { display: none; }
.dash-add-menu .btn { justify-content: flex-start; }
.dash { grid-template-columns: repeat(var(--dash-cols, 3), minmax(0, 1fr)); align-items: start; }
.dash:not(.ready) > .tile { display: none; }
/* minmax(0,1fr): otherwise the content decides the track width and the column slides below the neighbouring column */
.dash-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; min-width: 0; min-height: 60px; }
.dash-stash[hidden] { display: none; }   /* entfernte Kacheln (dashboard.js) */
.dash-empty { padding: 18px; }
.tile-edit { display: none; flex-basis: 100%; align-items: center; justify-content: flex-end; gap: 6px; }
.dash.editing .tile-edit { display: flex; }
.tile-edit .btn.icon { font-size: .9rem; line-height: 1; padding: 5px 9px; }
.tile-grip { cursor: grab; color: var(--ash); padding: 0 4px; font-size: 1.1rem; user-select: none; margin-right: auto; }
.tile-fold {
  background: none; border: 0; padding: 0 2px; margin-right: -4px; cursor: pointer;
  color: var(--ash); font-size: 1.05rem; line-height: 1; min-width: 1.1em; align-self: center;
}
.tile-fold:hover, .tile-fold:focus-visible { color: var(--loa-lit); }
.tile.collapsed > :not(header) { display: none; }
.tile.collapsed > header { margin-bottom: 0; }
.dash.editing .dash-col { outline: 1px dashed rgba(180, 120, 232, .35); outline-offset: 6px; border-radius: var(--r); }
.dash.editing .tile { cursor: grab; }
.dash.editing .tile input, .dash.editing .tile select, .dash.editing .tile textarea { cursor: auto; }
.tile.dragging { opacity: .45; }
.cal { min-width: 0; }
.cal-num { line-height: 1; }
.cal-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cal-title {
  flex: 1; min-width: 0; text-align: center;
  font-family: var(--display); font-size: .98rem; letter-spacing: .05em;
  color: var(--ui-title); font-weight: var(--ui-title-weight);
}
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-dow {
  padding: 2px 0 4px; text-align: center;
  font-family: var(--data); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ui-dim);
}
.cal-day {
  position: relative; min-width: 0; aspect-ratio: 8 / 7; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-family: var(--data); font-size: .76rem; color: var(--ui-text);
  background: rgba(8, 5, 13, .45); border: 1px solid transparent; border-radius: var(--r);
  transition: border-color .15s, background .15s;
}
.cal-day:hover, .cal-day:focus-visible { border-color: var(--loa-lit); background: rgba(37, 24, 56, .7); outline: none; }
.cal-day.other { opacity: .35; }
.cal-day.has { background: rgba(123, 63, 160, .24); border-color: rgba(180, 120, 232, .38); }
.cal-day.today { color: var(--gold); border-color: var(--gold); }
.cal-dots { display: flex; gap: 3px; height: 5px; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--k); box-shadow: 0 0 6px var(--k); }

.cal-next { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }   /* minmax(0,1fr): a long title must not widen the column */
.cal-next .empty { padding: 4px 0; }
.cal-up {
  display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 7px 10px; text-align: left; cursor: pointer;
  font: inherit; color: var(--ui-text);
  background: rgba(8, 5, 13, .5); border: 1px solid rgba(180, 120, 232, .18); border-left: 3px solid var(--k); border-radius: var(--r);
}
.cal-up:hover, .cal-up:focus-visible { border-color: var(--loa-lit); border-left-color: var(--k); outline: none; }
.cal-up-when { flex: 0 0 auto; font-family: var(--data); font-size: .7rem; color: var(--ui-dim); white-space: nowrap; }
.cal-up-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }

/* Livestream card in the lobby: thumbnail, name and meta as with the rooms, badge and buttons as an own
   group on the right. If the width isn't enough for everything in one line, the group slides right-aligned below the
   name instead of squeezing it to one word per line. Only for the lobby - .room-card itself (in TV mode too)
   stays untouched. */

.badge {
  font-family: var(--data); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 2px;
  border: 1px solid rgba(180, 120, 232, .4); color: var(--loa-lit);
}
.badge.live { border-color: var(--spirit); color: var(--spirit); box-shadow: var(--glow-spirit); }
.badge.lock { border-color: var(--gold); color: var(--gold); }
.badge.on-air { border-color: var(--k-live); color: var(--k-live-text); background: var(--k-live-bg); }

/* ----------------------------------------------------------------- room layout */

/* The room page doesn't scroll: stage and control bar must always be visible,
   scrolling only happens inside playlist and chat. */
body.room-page { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ live-room layout */
/* stage left, chat right: fixed columns so a hidden handle shifts nothing */
/* Below the video lie the control bar and (for the streamer) the send settings. The video keeps a
   minimum share of the window height; if the rest isn't enough, this area scrolls instead of reaching over the chat. */
.stage-under { display: flex; flex-direction: column; gap: 10px; flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--loa) transparent; }
.stage-under > .panel { flex: 0 0 auto; }

/* Die Sendeeinstellungen des Streamers gehoeren zur Steuerung - im Kinomodus weg. Bei eingeklappter Leiste nicht mehr
   (2.149.1): sie stehen im schwebenden Fenster #sendPop, das der Live-Knopf seit #266 auch eingeklappt oeffnet */
body.cinema #qualityPanel { display: none; }
body.controls-hidden .stage-under, body.cinema .stage-under { display: none; }   /* otherwise an empty gap would stay */

/* The streamer's send settings: two labelled columns (picture | sound) that slide below each other on a narrow
   screen. Selects fill their column so long names (e.g. programs) aren't cut off;
   state and help stand small below. */
.send-panel { padding: 12px 14px; }
.send-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 14px 28px; }
/* sound and camera below each other in one column (next to "Picture") */
.send-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.send-group { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; }
.send-group > .eyebrow { margin: 0; }
.send-group select { width: 100%; padding: 7px 10px; font-size: .9rem; }
.send-custom { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.send-custom .field { margin: 0; flex: 1 1 100px; }
.send-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: .82rem; }
.send-note:not(:has(> :not([hidden]))) { display: none; }   /* nichts zu sagen -> kein leerer Zeilenabstand */
.send-encoder { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: .82rem; }   /* encoder state and switch (desktop app only) */

.room-shell {
  position: relative; z-index: 1;
  flex: 1 1 auto; min-height: 0; overflow: hidden;
  display: grid;
  --side-col: var(--side-w, clamp(340px, 27vw, 480px));   /* --side-w: room-stage.js, dragged */
  grid-template-columns: minmax(0, 1fr) var(--side-col);
  gap: 10px;
  padding: 14px;
  align-items: stretch;
}

.stage { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }

/* keeps the 16:9 window centred and as big as the free room allows */
.screen-fit { position: relative; flex: 1 1 auto; min-height: 140px; }

.screen {
  position: absolute; inset: 0; margin: auto;
  aspect-ratio: 16 / 9;
  max-width: 100%; max-height: 100%;
  background: #000;
  border: var(--hairline);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(8, 5, 13, .9), 0 18px 60px rgba(0, 0, 0, .6);
}

/* Both playback layers always keep their size. A YT player created in a
   display:none element stays black – hence visibility instead of display. */
.screen .layer { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.screen .layer.off { visibility: hidden; pointer-events: none; }
.screen .layer > div, .screen .layer iframe { width: 100%; height: 100%; border: 0; display: block; }
.screen video.layer { object-fit: contain; background: #000; }

:is(.screen, .stage-row) > .veil {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: radial-gradient(circle at 50% 45%, rgba(37, 24, 56, .94), rgba(8, 5, 13, .98));
  text-align: center; padding: 20px;
}
:is(.screen, .stage-row) > .veil.hidden { display: none; }
:is(.screen, .stage-row) > .veil svg { width: clamp(64px, 14vh, 120px); height: clamp(64px, 14vh, 120px); opacity: .8; }
:is(.screen, .stage-row) > .veil p { max-width: 44ch; color: var(--ui-dim); font-size: .9rem; margin: 0; }
/* Click catcher so the YouTube UI doesn't undermine the synchronisation.
   Whoever shows the YouTube controls doesn't need it – otherwise one couldn't
   reach the gear for the quality. */
.screen .shield { position: absolute; inset: 0; z-index: 1; background: transparent; }
.screen .shield.off { display: none; }

/* The detail boost enlarges the iframe and scales it back via CSS.
   What sticks out must vanish. */
.screen { contain: paint; }

/* the viewers' camera window (js/live-cam.js): the script sets left/top/width/height (inside the video picture). */
.cam-box {
  position: absolute; z-index: 3; touch-action: none; cursor: grab; user-select: none;
  border-radius: 8px; overflow: hidden; background: #000;
  border: 1px solid rgba(180, 120, 232, .45); box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
}
.cam-box[hidden] { display: none; }
.cam-box.dragging { cursor: grabbing; }
.cam-box .cam-video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.cam-box .cam-tools {
  position: absolute; top: 4px; right: 4px; display: flex; gap: 4px;
  opacity: 0; transition: opacity .15s;
}
.cam-box:hover .cam-tools, .cam-box:focus-within .cam-tools { opacity: 1; }
@media (hover: none) { .cam-box .cam-tools { opacity: 1; } }
.cam-box .cam-tool {
  width: 26px; height: 26px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(180, 120, 232, .45); background: rgba(8, 5, 13, .8); color: var(--ui-text);
  font: 600 14px/1 var(--body);
}
.cam-box .cam-tool:hover { border-color: var(--loa-lit); }
.cam-box .cam-grip {
  position: absolute; top: 0; left: 0; width: 18px; height: 18px; cursor: nwse-resize;
  background: linear-gradient(135deg, rgba(222, 214, 234, .75) 0 3px, transparent 3px 6px, rgba(222, 214, 234, .55) 6px 8px, transparent 8px);
  opacity: 0; transition: opacity .15s;
}
.cam-box:hover .cam-grip { opacity: 1; }
@media (hover: none) { .cam-box .cam-grip { opacity: 1; width: 24px; height: 24px; } }
.cam-reopen { position: absolute; right: 10px; bottom: 10px; z-index: 3; font-size: .68rem; padding: 3px 9px; opacity: .8; }
.cam-reopen:hover { opacity: 1; }
.cam-reopen[hidden] { display: none; }

/* Twitch-like statistics overlay in the livestream: small, top left, doesn't disturb
   the picture - see live.js updateStats(). */
.stream-stats {
  position: absolute; top: 8px; left: 8px; z-index: 10;
  background: rgba(8, 5, 13, .88); border: var(--hairline); border-radius: var(--r);
  padding: 8px 10px; font-family: var(--data); font-size: .68rem; line-height: 1.7;
  color: var(--ui-text); min-width: 140px; pointer-events: none;
}
/* Autoplay with sound is blocked without a prior click: the picture runs muted, the sound is released here. */
.stream-stats .row { display: flex; justify-content: space-between; gap: 10px; }
.stream-stats .k { color: var(--ui-dim); }

.now {
  display: flex; gap: 12px; align-items: center; flex: 0 0 auto;
  padding: 9px 12px; border: var(--hairline); border-radius: var(--r);
  background: rgba(27, 17, 41, .7);
}
.now .title {
  font-family: var(--display); font-size: 1.05rem;
  color: var(--ui-title); font-weight: var(--ui-title-weight);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.now .who { font-family: var(--data); font-size: .7rem; color: var(--ui-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now .grow { flex: 1; min-width: 0; }

.controls { flex: 0 0 auto; padding: 10px 12px; }

.bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* "⋯" menu (lobby): rarely used buttons, opens upwards. */
.more-wrap { position: relative; }
.seek { flex: 1; min-width: 140px; }
/* Time under the mouse or target time while dragging above the bar (js/room.js showSeekTip); fixed so it doesn't
   shift the bar's flex layout - the script sets left/top to mouse x and the bar's top edge */
.seek-tip {
  position: fixed; z-index: 40; transform: translate(-50%, calc(-100% - 6px)); pointer-events: none;
  padding: 2px 6px; border: var(--hairline); border-radius: var(--r); background: var(--crypt);
  font-family: var(--data); font-size: .76rem; color: var(--ui-text); white-space: nowrap;
}
.seek-tip[hidden] { display: none; }
input[type=range] { accent-color: var(--loa-lit); width: 100%; }
.time { font-family: var(--data); font-size: .76rem; color: var(--ui-dim); white-space: nowrap; }

/* Signature: the sync circle. Shows progress and state without text.
   pathLength=100 makes stroke-dashoffset a percentage directly. The rotation
   by -90 degrees sits on a group – a CSS animation on the arc itself
   would overwrite the transform attribute and make the ring jump. */
.circle { width: 40px; height: 40px; flex: 0 0 auto; overflow: visible; }
.circle .ring { fill: none; stroke-width: 3; stroke-linecap: butt; }
.circle .track { stroke: rgba(180, 120, 232, .18); }
.circle .arc { stroke: var(--spirit); transition: stroke .3s, stroke-dashoffset .45s linear; }
.circle .pip { fill: var(--spirit); transition: fill .3s; }
.circle.drift .arc, .circle.drift .pip { stroke: var(--gold); fill: var(--gold); }
.circle.bad .arc, .circle.bad .pip { stroke: var(--blood); fill: var(--blood); }
.circle.paused .arc, .circle.paused .pip { stroke: var(--loa-lit); fill: var(--loa-lit); }
.circle.spin .pip { animation: pip 2.2s ease-in-out infinite; }
@keyframes pip { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .circle.spin .pip { animation: none; } }

/* Narrow windows and portrait: normal page flow again. Only the room page; the livestream page has its own
   grid (see "live-room layout") and stays two-column down to 860 px. Without the prefix the chat wandered into the
   18 px handle column there and the video was forced to a fixed 16:9 height. :where() has no specificity, so the
   rules on the room page compete against the rest exactly as before. */
@media (max-width: 1080px) {
  body.room-page { height: auto; overflow: auto; }
  .room-shell, body.side-hidden .room-shell { grid-template-columns: 1fr; overflow: visible; }
  :where(.room-page) .side-toggle, :where(.room-page) .fold-toggle, :where(.room-page) #altar > .fold-seal-line { display: none !important; }
  body.side-hidden:where(.room-page) .side, body.controls-hidden:where(.room-page) .controls, body.controls-hidden:where(.room-page) .now { display: revert; }
  :where(.room-page) .screen-fit { aspect-ratio: 16 / 9; flex: none; }
  :where(.room-page) .side > .panel { max-height: none; }
  :where(.room-page) #queue { max-height: 46vh; }
  :where(.room-page) #chatlog { height: 40vh; }
}

/* ------------------------------------------------------------------- sidebar */

.side { display: flex; flex-direction: column; min-width: 0; min-height: 0; container-type: inline-size; }
.side > .panel { padding: 13px; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

#paneQueue, #paneChat { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#paneRoom { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }

.pill-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex: 0 0 auto; }
.pill-tabs button {
  flex: 1; padding: 6px 4px; background: rgba(8, 5, 13, .6);
  border: 1px solid rgba(180, 120, 232, .2); border-radius: var(--r);
  color: var(--ui-dim); font-family: var(--data); font-size: .69rem; letter-spacing: .1em;
  text-transform: uppercase; cursor: pointer;
}
.pill-tabs button[aria-selected=true] { color: var(--ui-title); border-color: var(--ui-title); background: rgba(232, 195, 122, .12); }

/* Scroll bars in the theme: narrow, in loa violet - for the whole page and every scrolling area, not only
   for .scroll. Otherwise the browser's or desktop app's glaring default bar appears there.
   scrollbar-color is inherited; the page's own bar follows :root. Browsers without these
   properties (older WebKit) get the -webkit version. */
:root { scrollbar-width: thin; scrollbar-color: var(--loa) transparent; }
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(123, 63, 160, .6); border-radius: 4px; }
}

.scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--loa) transparent; }
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: rgba(123, 63, 160, .6); border-radius: 4px; }

#queue { flex: 1 1 auto; min-height: 90px; }
#chatlog { flex: 1 1 auto; min-height: 90px; }

/* questions above the playlist (2.89.0, js/room-queue.js): big playlist, next batch of a YouTube mix */
#paneQueue .q-ask {
  display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center;
  margin: 0 0 8px; padding: 8px 10px; border-radius: var(--r);
  border: 1px solid rgba(180, 120, 232, .35); background: rgba(37, 24, 56, .6);
  font-size: .82rem;
}
#paneQueue .q-ask[hidden] { display: none; }
#paneQueue .q-ask > span { flex: 1 1 100%; }

.q-item {
  display: flex; gap: 9px; align-items: center;
  padding: 6px; border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer; contain: layout style;
}
.q-item:hover { background: rgba(37, 24, 56, .8); border-color: rgba(180, 120, 232, .3); }
.q-item.current {
  background: rgba(63, 240, 176, .13);
  border-color: rgba(63, 240, 176, .55);
  box-shadow: inset 3px 0 0 var(--spirit);
  padding-left: 9px;
}
.q-item.current .t { color: #e8fff6; }
.q-item.current .n { color: var(--spirit); font-weight: 600; }
.q-item.dragging { opacity: .4; }
.q-item.drop-above { border-top-color: var(--gold); }
.q-item .n { font-family: var(--data); font-size: .68rem; color: var(--ui-dim); width: 1.8em; text-align: right; flex: 0 0 auto; }
.q-item .thumb { width: 56px; height: 32px; object-fit: cover; border-radius: 2px; background: #000; flex: 0 0 auto; }
.q-item .tt { flex: 1; min-width: 0; display: flex; flex-direction: row; align-items: baseline; gap: 8px; }
.q-item .t { flex: 1; min-width: 0; font-size: var(--ui-queue-size); color: var(--ui-text); line-height: 1.32; max-height: 2.7em; overflow: hidden; }
.q-item .d { font-family: var(--data); font-size: .68rem; color: var(--ui-dim); flex: 0 0 auto; }
.q-item .x { opacity: 0; flex: 0 0 auto; }
.q-item:hover .x { opacity: 1; }
/* the running entry's link (room-queue.js copyLink, 2.96.0) - only on the running one */
.q-item:not(.current) .q-copy { display: none; }
.q-item .q-copy svg { width: 14px; height: 14px; }
/* Browse-Cursor im TV-Modus: DPAD hoch/runter bewegt diese Markierung durch
   die Playlist, unabhaengig vom tatsaechlich laufenden Video (.current) -
   beide Klassen koennen gleichzeitig auf demselben Eintrag sitzen. */
.q-item.tv-highlight { outline: 2px solid var(--gold); outline-offset: -2px; }
.q-item.blocked { opacity: .45; }
/* already watched (for the whole room): toned down a little, tick at the number */
.q-item.watched { opacity: .6; }
.q-item.watched .n::after { content: '✓'; color: var(--spirit); margin-left: 2px; }
.q-item.blocked .t { text-decoration: line-through; text-decoration-color: var(--blood); }
.q-item.blocked .n::after { content: '!'; color: var(--blood); margin-left: 2px; }

/* The sidebar is always only 320-400px wide in the desktop two-column layout
   (see .room-shell), independent of the window/screen size - a
   window-width media query would never catch that. A container query on the
   sidebar's actual width reacts correctly in both layouts.
   Must stand AFTER the base rules above: same specificity, otherwise
   the base rule standing later wins in a cascade tie. */
@container (max-width: 440px) {
  .q-item { padding: 5px 4px; gap: 7px; }
  .q-item .tt { flex-direction: column; align-items: flex-start; gap: 1px; }
}

.who-list { display: flex; flex-wrap: wrap; gap: 6px; }
/* Benutzerverwaltung: Invite-Flag hinter dem Namen */
.invite-flag { margin-left: 6px; padding: 1px 7px; border: var(--hairline); border-radius: 999px; font-size: .72rem; color: var(--ui-dim); white-space: nowrap; }
.who-chip {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--data); font-size: .72rem; color: var(--ui-text);
  padding: 3px 8px; border-radius: 12px;
  background: rgba(8, 5, 13, .6); border: 1px solid rgba(180, 120, 232, .3);
}
.who-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--spirit); box-shadow: var(--glow-spirit); flex: 0 0 auto; }
.who-chip.buffering .dot { background: var(--gold); box-shadow: none; animation: pulse 1s ease-in-out infinite; }
/* Livestream: wer gerade sendet */
.who-chip.sending { border-color: var(--blood); }
.who-chip.sending .dot { background: var(--blood); box-shadow: none; }
@keyframes pulse { 50% { opacity: .25; } }

/* chat in altar style (2.41.0, public/js/chat.js): avatar | name · shield · time, the text below */
.msg { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; font-size: .86rem; word-wrap: break-word; min-width: 0; }
.msg .msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.msg .msg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font: .72rem/1.2 var(--data); }
.msg .u { font-family: var(--data); font-size: .74rem; color: var(--loa-lit); }
.msg .msg-tag { font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--k-live-text); }
.msg .msg-time { color: var(--ui-dim); font-size: .66rem; }
.msg { position: relative; }
/* admins: delete a line (chat.js, 2.96.0) - shows on hover/focus of the line */
.msg .msg-del { position: absolute; top: 0; right: 0; padding: 0 6px; border: 0; background: none; color: var(--ui-dim); font-size: .9rem; line-height: 1.2; cursor: pointer; opacity: 0; }
.msg:hover .msg-del, .msg .msg-del:focus-visible { opacity: 1; }
.msg .msg-del:hover { color: var(--blood); }
@media (hover: none) { .msg .msg-del { opacity: .6; } }
.msg .msg-body { font-family: var(--data); font-size: .78rem; line-height: 1.5; color: var(--ui-text); overflow-wrap: anywhere; }
/* chat Markdown and pictures (2.159.0, js/chat-format.js) */
.msg .msg-body code { font-family: var(--data); padding: 0 4px; border-radius: 4px; background: rgba(255,255,255,.07); }
.msg .msg-body .chat-code { margin: 4px 0; padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,.05); white-space: pre-wrap; overflow-x: auto; }
.msg .msg-body .chat-code code { padding: 0; background: none; }
.msg .msg-body .spoiler { border-radius: 4px; background: var(--ui-text); color: transparent; cursor: pointer; }
.msg .msg-body .spoiler:focus { background: rgba(255,255,255,.07); color: inherit; outline: none; }
.msg .msg-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg .chat-img img { display: block; max-width: min(260px, 100%); max-height: 220px; border-radius: 6px; }
.msg.mine { margin-left: -8px; padding: 8px 8px 8px 6px; border-left: 2px solid var(--k-gold); background: rgba(232, 195, 122, .05); }
.msg.mine .u { color: var(--k-gold); }
.msg.system { align-items: center; gap: 8px; color: var(--k-gold-dim); font: .66rem/1.35 var(--data); letter-spacing: .04em; margin-bottom: 10px; }
.msg.system .msg-ic { display: inline-flex; flex: none; }
.msg.system .msg-ic svg { width: 12px; height: 12px; }
.msg.ts .msg-ic { display: inline-flex; flex: none; width: 28px; height: 28px; align-items: center; justify-content: center; color: var(--k-gold-dim); }   /* Teamspeak line (2.157.0): a headset where the avatar would be */
.msg.ts .msg-ic svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------- toasts */

#toasts {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 50; display: grid; gap: 8px; justify-items: center; pointer-events: none;
}
.toast {
  padding: 9px 15px; border-radius: var(--r);
  background: rgba(18, 11, 28, .96); border: 1px solid var(--loa-lit);
  font-family: var(--data); font-size: .76rem; letter-spacing: .04em;
  box-shadow: var(--glow-loa); animation: rise .25s ease-out;
}
.toast.ok { border-color: var(--spirit); color: #cffbec; }
.toast.err { border-color: var(--blood); color: #ffd3de; }
.toast.wait { border-color: var(--gold); color: var(--gold); }
.toast.info { border-color: rgba(180, 120, 232, .55); color: var(--bone); box-shadow: none; opacity: .93; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* -------------------------------------------------------------------- overlay */

/* Switching rooms and settings without leaving the page: playback
   keeps running, the background is only blurred. */
.overlay {
  position: fixed; inset: 0; z-index: 55;
  /* safe center + own scrolling: see "Small window" further below */
  display: grid; place-items: safe center; padding: 24px; overflow-y: auto;
  background: rgba(8, 5, 13, .72);
  backdrop-filter: blur(10px) saturate(.7);
  animation: fadein .18s ease-out;
}
.overlay[hidden] { display: none !important; }
/* Kwaba not in front for 5 s (common.js, 2.94.1): ornaments stand still instead of costing CPU and GPU */
html.kw-rest *, html.kw-rest *::before, html.kw-rest *::after { animation-play-state: paused !important; }
/* name effects out of the picture (common.js, 2.95.2) */
.kw-idle, .kw-idle::before, .kw-idle::after { animation-play-state: paused !important; }
#dlOverlay { z-index: 90; }   /* the app's download window, also opened from "How to stream right" (altar.css, 80) */
.overlay .sheet { width: min(680px, 100%); max-height: 82vh; display: flex; flex-direction: column; }
.overlay .sheet > .scroll { min-height: 0; }
/* Small window (feedback 2026-10-07: in the app an overlay could no longer be closed - centred, the header
   with "Close" stuck out at the top, unreachable): only centre while it fits, otherwise start at the top; the window scrolls
   itself if it has no own scrolling area, and its header stays put meanwhile */
.overlay .sheet { overflow-y: auto; overscroll-behavior: contain; }
.overlay .sheet > header { position: sticky; top: -18px; z-index: 2; margin: -18px -18px 14px; padding: 18px 18px 10px; background: #1b1129; }
@keyframes fadein { from { opacity: 0; } }

/* guide for the helper program "Kwaba Audio" (livestream rooms) */
.audio-help { line-height: 1.5; overflow-y: auto; }
.audio-help ol { padding-left: 1.3em; display: grid; gap: 12px; }
.audio-help li::marker { color: var(--loa-lit); font-weight: 700; }
.audio-help .audio-cmd {
  display: block; margin-top: 6px; padding: 7px 10px; cursor: copy;
  font-family: var(--data); font-size: .8rem; overflow-wrap: anywhere;
  background: rgba(8, 5, 13, .6); border: 1px solid rgba(180, 120, 232, .25); border-radius: 6px;
}
.audio-help .audio-cmd:hover { border-color: var(--loa-lit); }

/* the lobby's download window (uses the look of the Kwaba Audio guide): button + hint per file */
.audio-help h3 { margin: 14px 0 4px; font: 700 .95rem var(--display); color: var(--ui-title); }
.dl-list { display: grid; gap: 8px; margin: 12px 0 6px; }
.dl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.dl-row .btn { flex: 0 0 auto; width: 270px; max-width: 100%; justify-content: center; }
.dl-code { font-family: var(--data); font-size: .8rem; padding: 1px 6px; border: var(--hairline); border-radius: 3px; background: rgba(8, 5, 13, .85); cursor: copy; }
@media (prefers-reduced-motion: reduce) { .overlay { animation: none; } }

/* ------------------------------------------------------ Darstellungs-Dialog */

.opt-group { padding: 12px 0; border-bottom: 1px solid rgba(180, 120, 232, .12); }
.opt-group:last-child { border-bottom: none; }
.opt-head { margin-bottom: 8px; }
.opt-head b {
  font-family: var(--display); font-size: .92rem; letter-spacing: .08em;
  color: var(--ui-title); font-weight: var(--ui-title-weight);
}
.opt-head span { display: block; font-size: .78rem; color: var(--ui-dim); }
.opt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-row .btn { flex-direction: column; align-items: flex-start; gap: 1px; line-height: 1.25; }
.opt-ratio { font-size: .62rem; opacity: .65; letter-spacing: .04em; text-transform: none; }

.opt-preview {
  padding: 12px; border: var(--hairline); border-radius: var(--r);
  background: rgba(8, 5, 13, .55);
}
.preview-title {
  font-family: var(--display); font-size: 1.08rem;
  color: var(--ui-title); font-weight: var(--ui-title-weight);
}
.preview-meta {
  font-family: var(--data); font-size: .72rem; letter-spacing: .06em;
  color: var(--ui-dim); margin: 2px 0 9px;
}
.preview-item {
  display: flex; gap: 9px; align-items: baseline;
  font-size: var(--ui-queue-size); color: var(--ui-text);
}
.preview-n { font-family: var(--data); font-size: .68rem; color: var(--ui-dim); }

/* ------------------------------------------------------------ Falt-Griffe */

/* Seals instead of bars: a diamond with an arrow that takes no room in the layout. The arrow's centre is the centre (12/12) of
   the viewBox, so it stays exactly in the middle of the diamond in every rotation. box-sizing on the diamond: with the border
   outside it would be 18 px and the arrow 1 px off. */
.fold-seal {
  position: absolute; z-index: 6; width: 24px; height: 24px; padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
  color: var(--k-gold-dim);
}
.fold-seal::before {
  content: ''; position: absolute; box-sizing: border-box; left: 4px; top: 4px; width: 16px; height: 16px; transform: rotate(45deg);
  background: var(--void); border: 1px solid currentColor; transition: box-shadow .15s;
}
.fold-seal svg {
  position: absolute; left: 7px; top: 7px; width: 10px; height: 10px; display: block;
  fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .2s;
}
.fold-toggle:hover, .fold-toggle:focus-visible { color: var(--gold); outline: none; }
.fold-toggle:hover::before, .fold-toggle:focus-visible::before, .side-toggle:hover .fold-seal::before, .side-toggle:focus-visible .fold-seal::before { box-shadow: 0 0 12px rgba(232, 195, 122, .45); }

/* Below: always on the top edge of the altar. Open the arrow points down (collapse), collapsed up (expand) */
.fold-toggle { left: 50%; top: -1px; transform: translate(-50%, -50%); }
.fold-toggle svg { transform: rotate(90deg); }
body.controls-hidden .fold-toggle svg { transform: rotate(-90deg); }
#altar > .fold-seal-line {
  position: absolute; left: 50%; top: -1px; width: 120px; height: 1px; transform: translateX(-50%); pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--k-gold-dim) 30%, var(--k-gold-dim) 70%, transparent);
}
#altar:has(> .fold-toggle:hover, > .fold-toggle:focus-visible) > .fold-seal-line { background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent); }

/* Right: an invisible strip over the gap (open) or the right edge (collapsed), it has to lie above the YouTube iframe, which
   would swallow the mouse. Open it sits in the middle of the gap: shell padding 14 px + half the gap 5 px. */
.side-toggle {
  position: absolute; z-index: 6; top: 14px; bottom: 14px; width: 26px; padding: 0; border: 0; background: none;
  right: calc(14px + var(--side-col) + 5px); transform: translateX(50%);
  cursor: col-resize; touch-action: none;
}
.side-toggle:focus-visible { outline: none; }
.side-toggle .fold-seal {
  left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; opacity: 0;
  color: var(--gold); transition: opacity .15s;
}
.side-toggle .fold-seal-line {
  position: absolute; left: 50%; top: 50%; width: 1px; height: 120px; margin-top: -60px; transform: translateX(-50%); pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent); transition: opacity .15s;
}
.side-toggle:hover .fold-seal, .side-toggle:hover .fold-seal-line, .side-toggle:focus-visible .fold-seal, .side-toggle:focus-visible .fold-seal-line { opacity: 1; }
@media (hover: none) { .side-toggle .fold-seal, .side-toggle .fold-seal-line { opacity: 1; } }
.side-toggle .fold-seal svg { transform: rotate(0deg); }
body.side-hidden .side-toggle { right: 0; transform: none; cursor: pointer; }
body.side-hidden .side-toggle .fold-seal { left: auto; right: 6px; transform: translateY(-50%); }
body.side-hidden .side-toggle .fold-seal svg { transform: rotate(180deg); }
body.side-hidden .side-toggle .fold-seal-line { left: auto; right: 17px; transform: none; }
/* briefly open: goes shut by itself, the diamond shows that */
body.side-peek .side-toggle .fold-seal::before { background: color-mix(in srgb, var(--gold) 22%, var(--void)); }
@media (prefers-reduced-motion: reduce) { .fold-seal svg { transition: none; } }
body.side-hidden .room-shell { grid-template-columns: minmax(0, 1fr); }
body.side-hidden .side { display: none; }
/* Sidebar on the left (own arrangement, 2.133.0, js/room-arrange.js sets body.side-left only outside TV/cinema/narrow) */
@media (min-width: 1081px) {
  body.side-left:not(.cinema):not(.tv):not(.side-hidden) .room-shell { grid-template-columns: var(--side-col) minmax(0, 1fr); }
  body.side-left:not(.cinema):not(.tv) .side { order: -1; }
  body.side-left:not(.cinema):not(.tv) .side-toggle { right: auto; left: calc(14px + var(--side-col) + 5px); transform: translateX(-50%); }
  body.side-left:not(.cinema):not(.tv) .side-toggle .fold-seal svg { transform: rotate(180deg); }
  body.side-left:not(.cinema):not(.tv).side-hidden .side-toggle { left: 0; right: auto; transform: none; }
  body.side-left:not(.cinema):not(.tv).side-hidden .side-toggle .fold-seal { right: auto; left: 6px; }
  body.side-left:not(.cinema):not(.tv).side-hidden .side-toggle .fold-seal svg { transform: rotate(0deg); }
  body.side-left:not(.cinema):not(.tv).side-hidden .side-toggle .fold-seal-line { right: auto; left: 17px; }
}

body.controls-hidden .now,
body.controls-hidden .controls { display: none; }

/* ------------------------------------------------------------- Kinomodus */
/* Only the video, fitted to the window size. The controls fade in
   briefly on mouse movement and vanish again. */
body.cinema { background: #000; cursor: none; }
body.cinema.cinema-ui { cursor: auto; }
body.cinema::before { display: none; }
body.cinema .topbar,
body.cinema .side,
body.cinema .side-toggle,
body.cinema .now,
body.cinema .controls,
body.cinema .fold-toggle,
body.cinema .fold-seal-line { display: none; }
body.cinema .room-shell { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
body.cinema .stage { gap: 0; }
body.cinema .screen-fit { min-height: 0; }
body.cinema .screen { border: 0; border-radius: 0; box-shadow: none; }

.cinema-exit {
  position: fixed; top: 14px; right: 14px; z-index: 60;
  display: none; padding: 8px 14px;
  font-family: var(--data); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--bone); cursor: pointer;
  background: rgba(18, 11, 28, .9);
  border: 1px solid rgba(180, 120, 232, .45); border-radius: var(--r);
  opacity: 0; transition: opacity .25s;
}
body.cinema .cinema-exit { display: block; }
body.cinema.cinema-ui .cinema-exit { opacity: 1; }
.cinema-exit:hover { border-color: var(--spirit); color: #d7fff0; }

/* --------------------------------------------------------------- TV-Modus */
/* 10-Fuss-Layout fuer Fire-TV/Android-TV: fester 60/40-Split, kein Banner,
   Playlist und Hotbar dauerhaft sichtbar, groessere Schrift/Buttons fuer
   Sofa-Abstand. Reine Layout-Variante der normalen Raumseite - siehe
   docs/superpowers/specs/2026-09-15-tv-mode-design.md. Muss nach den
   Basis-Regeln stehen, die sie ueberschreibt (gleiche Spezifitaet: .side
   Grid-Spalte, .controls .btn Basis-Groesse), sonst gewinnt bei einer
   Cascade-Bindung die spaeter stehende Basis-Regel. */
/* Topbar bleibt sichtbar, aber reduziert auf Logo+Marke und Nutzer/Punkte -
   Raumwechsel/Einladung/Darstellung/Verwaltung/Abmelden sind vom Sofa aus
   ohnehin nicht gedacht (Login ist einmalig, siehe Fixed Product Decisions). */
body.tv .topbar .sub, body.tv .topbar #tbCenter, body.tv .topbar #bInvite, body.tv .topbar #bRooms, body.tv .topbar #appearance, body.tv .topbar a[href="/admin"], body.tv .topbar #logout {
  display: none !important;
}
body.tv .room-shell,
body.tv.side-hidden .room-shell {
  grid-template-columns: minmax(0, 4fr) minmax(280px, 1fr);
}
body.tv .side-toggle, body.tv .fold-toggle, body.tv #altar > .fold-seal-line { display: none !important; }
/* Nur die Playlist wird im TV-Modus gebraucht - Chat ist ausgeschlossen
   (siehe body.tv #tabChat unten), Raum-Einstellungen sind vom Sofa aus
   nicht bedienbar. Mit nur einer verbleibenden Ansicht braucht es keine
   Tab-Leiste mehr; #paneQueue ist ohnehin die Standardansicht. */
body.tv .pill-tabs { display: none !important; }
/* Ohne Tab-Leiste steht sonst nirgends mehr, dass das hier die Playlist ist. */
body.tv .tv-playlist-title { display: block !important; font-size: 1.15rem; font-family: var(--display); color: var(--ui-title); margin: 0 0 10px; }
/* Hinzufuegen/Suchen/Zufall/Mischen/Leeren sind am Sofa nicht vorgesehen
   (keine Tastatur, keine Notwendigkeit fuer Playlist-Verwaltung per Fernbedienung). */
body.tv #rowAddUrl, body.tv #rowFilter, body.tv #rowPlaylistTools { display: none !important; }
/* Die Zuschauerliste zieht per JS ans Ende der Playlist-Ansicht um (statt in
   die Hotbar) - siehe room.js. Hier nur die Optik fuer die neue Position. */
body.tv #who { margin-top: 10px; padding-top: 10px; border-top: var(--hairline); }

body.tv.room-page { height: 100dvh; overflow: hidden; }
body.tv .room-shell { overflow: hidden; }
body.tv .screen-fit { aspect-ratio: auto; flex: 1 1 auto; }
body.tv #queue { max-height: none; }
/* body.cinema .room-shell (oben, "Kinomodus") und body.tv .room-shell (eine
   Zeile drueber) haben dieselbe Spezifitaet - ohne diese Regel gewinnt bei
   beiden Klassen gleichzeitig (seit "Vollbild" im TV-Modus per Kinomodus
   statt echtem Fullscreen laeuft, siehe bFs.onclick) die spaeter stehende
   Basisregel body.tv, und die Video-Spalte bleibt auf 4fr/5 statt auf volle
   Breite stehen - der Rest der Spalte bleibt als leerer Streifen sichtbar,
   das Video wirkt nach links verschoben. */
body.tv.cinema .room-shell { grid-template-columns: minmax(0, 1fr); }

body.tv .now .title { font-size: 1.6rem; }
body.tv .now .who { font-size: .95rem; }
body.tv .controls { padding: 16px 18px; }
body.tv .controls .btn { font-size: 1.05rem; padding: 12px 18px; }
body.tv .controls .btn.icon { padding: 12px 16px; }
body.tv .time { font-size: 1rem; }

/* Diese sechs Aktionen wandern im TV-Modus ins Menue-Popup (Task 4) statt in
   der Hotbar zu stehen - siehe Fixed Product Decisions im Spec. Lautstaerke-
   Regler und Tempo-Auswahl entfallen im TV-Modus ganz (Lautstaerke laeuft
   ueber Fernseher/AVR, Tempo ist keine MUSS-Funktion). bHideCtrl/bCinema
   werden verborgen, weil die zugehoerigen Tastenkuerzel unten deaktiviert
   werden - eine sichtbare Schaltflaeche fuer eine deaktivierte Funktion waere
   irrefuehrend. */
body.tv #bResync, body.tv #bMute, body.tv #bCC, body.tv #bFs,
body.tv #bSpoiler, body.tv #bCinema, body.tv #bHideCtrl,
body.tv #vol, body.tv #speed, body.tv #tabChat {
  display: none !important;
}

.tv-menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.tv-menu-grid .btn { font-size: 1.05rem; padding: 14px; justify-content: center; }

/* ----------------------------------------------------------- TV-Raumliste */
/* Reine Layout-Seite fuer den TV-Modus (siehe
   docs/superpowers/specs/2026-09-16-tv-room-list-design.md). body ist hier
   direkt fest auf class="tv" gesetzt, nicht bedingt wie bei room.html - die
   Seite hat kein Desktop-Aequivalent, das dieselbe Datei teilt. */
.tv-rooms-wrap { padding-top: 24px; }
.tv-rooms-wrap h2 { font-size: 1.6rem; margin-bottom: 16px; }
.room-card[tabindex] { cursor: pointer; }
.room-card:focus-visible {
  outline: none;
  border-color: var(--spirit);
  background: rgba(63, 240, 176, .1);
  box-shadow: var(--glow-spirit);
}
body.tv .room-card .name { font-size: 1.2rem; }
body.tv .room-card .meta { font-size: .82rem; }
.tv-unlock-form { display: flex; gap: 8px; margin-top: 10px; }
.tv-unlock-form input { flex: 1; min-width: 0; }

/* --------------------------------------------------------- Spoilerschutz */

.q-item.veiled .t { display: flex; align-items: center; }
.q-item.veiled .veil-bar {
  display: block; width: 100%; height: 1em; border-radius: 2px;
  background: repeating-linear-gradient(
    115deg, rgba(180, 120, 232, .30) 0 7px, rgba(37, 24, 56, .85) 7px 14px);
}
.q-item.veiled .thumb {
  background: rgba(37, 24, 56, .9);
  border: 1px dashed rgba(180, 120, 232, .35);
}
.q-item.veiled:hover .veil-bar { background: repeating-linear-gradient(
    115deg, rgba(232, 195, 122, .35) 0 7px, rgba(37, 24, 56, .85) 7px 14px); }
.q-item.veiled .d { opacity: .5; }

/* -------------------------------------------------------- Gasteinladungen */

.invite-list { display: grid; gap: 6px; }
.invite-row {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border: var(--hairline); border-radius: var(--r);
  background: rgba(8, 5, 13, .5);
}
.invite-row .grow { flex: 1; min-width: 0; }
.invite-meta { font-family: var(--data); font-size: .68rem; color: var(--ui-dim); letter-spacing: .04em; }
.invite-token { font-family: var(--data); font-size: .66rem; color: var(--loa-lit); }

.invite-box {
  padding: 13px; margin-bottom: 18px;
  border: var(--hairline); border-radius: var(--r);
  background: rgba(8, 5, 13, .55);
}
.invite-room {
  font-family: var(--display); font-size: 1.15rem;
  color: var(--ui-title); font-weight: var(--ui-title-weight);
}
.invite-label { font-size: .84rem; color: var(--ui-dim); margin-top: 2px; }
.invite-facts {
  margin: 10px 0 0; padding-left: 1.1em;
  font-size: .82rem; color: var(--ui-text); line-height: 1.7;
}
.invite-facts b { color: var(--gold); font-weight: 600; }

/* --------------------------------------------------------------------- tables */

table.data { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.data th {
  text-align: left; font-family: var(--data); font-size: .66rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ui-dim); padding: 7px 8px; border-bottom: var(--hairline);
}
table.data td { padding: 7px 8px; border-bottom: 1px solid rgba(180, 120, 232, .1); }
table.data tr:hover td { background: rgba(37, 24, 56, .5); }

kbd {
  font-family: var(--data); font-size: .7rem; padding: 1px 5px;
  border: 1px solid rgba(180, 120, 232, .4); border-radius: 2px;
  background: rgba(8, 5, 13, .7); color: var(--ui-text);
}

.empty { padding: 26px 14px; text-align: center; color: var(--ui-dim); font-size: .88rem; }

/* --------------------------------------------------------------------- footer */
/* Maintained by admins (tagline, status, link columns, links at the bottom) via /admin,
   see mountFooter() in common.js. Not included on the room page -
   that stays compact and is the TV mode's terrain. */

.site-footer {
  position: relative; z-index: 1;
  margin-top: 40px;
  border-top: var(--hairline);
  background: linear-gradient(180deg, rgba(18, 11, 28, .35), rgba(8, 5, 13, .9));
}
.footer-inner {
  max-width: 1120px; margin: 0 auto;
  padding: 36px 20px 22px;
  display: flex; flex-wrap: wrap; gap: 36px;
}
.footer-brand { flex: 1 1 220px; min-width: 200px; }
.footer-brand b {
  font-family: var(--display); font-size: 1.05rem; letter-spacing: .18em;
  color: var(--ui-title); font-weight: var(--ui-title-weight); text-transform: uppercase;
}
.footer-tagline { margin: 9px 0 14px; color: var(--ui-dim); font-size: .84rem; max-width: 32ch; }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; margin-top: 4px;
  border-radius: 999px; border: 1px solid currentColor;
  font-family: var(--data); font-size: .7rem; font-weight: 600; letter-spacing: .04em;
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.status-pill.status-operational { color: var(--spirit); }
.status-pill.status-degraded { color: var(--gold); }
.status-pill.status-maintenance { color: var(--loa-lit); }
.status-pill.status-down { color: var(--blood); }

.footer-groups { flex: 3 1 480px; display: flex; flex-wrap: wrap; gap: 28px; }
.footer-group { flex: 1 1 140px; min-width: 130px; }
.footer-group h4 {
  font-family: var(--data); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--loa-lit); margin: 0 0 10px;
}
.footer-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.footer-group a { color: var(--ui-dim); font-size: .84rem; }
.footer-group a:hover { color: var(--bone); text-decoration: none; }

.footer-bottom {
  max-width: 1120px; margin: 0 auto;
  padding: 14px 20px 26px;
  border-top: 1px solid rgba(180, 120, 232, .12);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
}
.footer-copy { font-size: .74rem; color: var(--ui-dim); }
.footer-bottom-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-bottom-links a { font-size: .74rem; color: var(--ui-dim); }
.footer-bottom-links a:hover { color: var(--bone); text-decoration: none; }

/* single sign-on pages (src/oidc.js ssoPage): no access, e-mail missing, sign out - in the frame of the sign-in page */
.sso-card p { margin: 0 0 14px; }
.sso-card .notice { margin-bottom: 14px; }
.sso-actions { flex-wrap: wrap; gap: 8px; }

/* Administration: groups and single sign-on (admin.html) */
.admin-add { margin-top: 12px; flex-wrap: wrap; gap: 8px; }
.admin-add input { flex: 1 1 180px; min-width: 0; }
.admin-note { font-size: .8rem; margin: 10px 0 0; }
.admin-mail { font-size: .8rem; overflow-wrap: anywhere; }
.admin-uris { font-size: .72rem; overflow-wrap: anywhere; }
.admin-inline { width: 100%; min-width: 140px; padding: 4px 8px; font-size: .82rem; }
.mail-ok { color: var(--spirit); font-weight: 700; }
.grp-chip { display: inline-block; margin: 1px 4px 1px 0; }
.grp-list { display: grid; gap: 8px; margin: 4px 0 8px; }
.overlay .sheet.admin-sheet { width: min(560px, 100%); gap: 12px; }
.admin-sheet textarea { width: 100%; font-family: var(--data); font-size: .8rem; resize: vertical; }
.secret-box { flex: 1; min-width: 0; padding: 8px 10px; overflow-wrap: anywhere; user-select: all;
  background: var(--void); border: var(--hairline); border-radius: var(--r); font-size: .82rem; }

/* Verwaltung: Einladung per Mail */
.admin-sub { margin: 18px 0 0; font-size: .85rem; letter-spacing: .1em; color: var(--loa-lit); text-transform: uppercase; }

/* Anmeldeseite: Passwort vergessen (login.html) */
.forgot-link { margin: 10px 0 0; text-align: center; font-size: .8rem; }
.forgot-box { margin-top: 14px; padding-top: 14px; border-top: var(--hairline); display: grid; gap: 10px; }
.forgot-box .field { margin: 0; }
.forgot-note { font-size: .75rem; margin: 0; }
.forgot-link.hidden, .forgot-box.hidden { display: none; }

/* Lobby: Hinweis "E-Mail eintragen/bestaetigen" (lobby.html) */
.notice.mail-nudge { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
  border-left-color: var(--gold); background: rgba(232, 195, 122, .08); color: var(--ui-text); }
.notice.mail-nudge[hidden] { display: none; }

/* Mein Konto (account.html) */
.account-wrap { max-width: 640px; }
.account-wrap .panel { margin-bottom: 18px; }
.notice.account-next { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
  border-left-color: var(--spirit); background: rgba(63, 240, 176, .08); color: var(--ui-text); }
.notice.account-next[hidden] { display: none; }
.account-state { margin: 0 0 12px; }
.account-state .mail-ok { margin-left: 6px; }
.account-actions { flex-wrap: wrap; gap: 8px; margin-top: 4px; }
/* Menüeintrag "Konto" im TV-Modus aus (wie die übrigen Kontoeinträge dort, siehe body.tv .topbar weiter oben) */
body.tv .topbar a[href="/account"] { display: none !important; }

/* Lobby: Changelog-Kachel (js/changelog-tile.js) */
.cl-entry { font-size: .88rem; line-height: 1.55; }
.cl-entry p { margin: 0 0 8px; }
.cl-entry .cl-head { font-family: var(--data); font-size: .72rem; letter-spacing: .06em; color: var(--ui-dim); margin-bottom: 4px; }
.cl-entry .cl-ver { color: var(--loa-lit); }
.cl-entry .cl-title { font-weight: 600; color: var(--ui-text); }
.cl-entry code { font-family: var(--data); font-size: .82em; }
.cl-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.cl-nav[hidden] { display: none; }
.cl-pos { font-size: .75rem; }
.cl-nav .btn { min-width: 38px; justify-content: center; font-size: 1.05rem; line-height: 1; padding: 5px 10px; }

/* ------------------------------------------------------------ Livestream: Kachelflaeche (js/live-tiles.js) */
/* Several streams per room like Discord: one tile per screen and per webcam, click = big with a row below.
   live-tiles.js computes size and position of the tiles (gridFor); here only the look. On the right the collapsible chat
   (again since 2.37.0, grid see .live-shell above). */
.tiles { position: absolute; inset: 8px; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 8px; }
:is(.tiles, .cam-grid6) .tile {
  position: relative; flex: none; overflow: hidden; border-radius: 8px; background: #000;
  border: 1px solid rgba(180, 120, 232, .25); box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
:is(.tiles, .cam-grid6) .tile.merged { display: none; }
:is(.tiles, .cam-grid6) .tile-media { position: absolute; inset: 0; }
:is(.tiles, .cam-grid6) .tile-video, :is(.tiles, .cam-grid6) .tile-thumb, :is(.tiles, .cam-grid6) .tile-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
:is(.tiles, .cam-grid6) .tile-cam .tile-video { object-fit: cover; }
:is(.tiles, .cam-grid6) .tile-self.tile-cam .tile-video { transform: scaleX(-1); }   /* own webcam mirrored like a mirror, it is sent unmirrored */
:is(.tiles, .cam-grid6) .tile-thumb { object-fit: cover; filter: brightness(.5) saturate(.85); }
:is(.tiles, .cam-grid6) .tile-cover { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; }
:is(.tiles, .cam-grid6) .tile-popped { gap: 8px; align-content: center; }
:is(.tiles, .cam-grid6) .tile-popped, :is(.tiles, .cam-grid6) .tile-waiting .tile-media::after {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 2;
  color: var(--ui-dim); font-size: .8rem; text-align: center; padding: 10px;
}
:is(.tiles, .cam-grid6) .tile-waiting .tile-media::after { content: "Verbinde …"; }
/* own screen stream while its tile isn't big (like Discord) */
:is(.tiles, .cam-grid6) .tile-selfnote { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; gap: 4px; text-align: center;
  background: radial-gradient(circle at 50% 45%, rgba(213, 72, 107, .18), rgba(8, 5, 13, .95) 70%); cursor: pointer; }
:is(.tiles, .cam-grid6) .tile-selfnote[hidden] { display: none; }
/* the stream stops at the sender's side (2.91.0, #224, live-tiles.js ISSUE_TEXT): said on the tile, over the frozen picture */
:is(.tiles, .cam-grid6) .tile-issue { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; gap: 6px; padding: 14px; text-align: center;
  background: rgba(8, 5, 13, .78); pointer-events: none; }
:is(.tiles, .cam-grid6) .tile-issue[hidden] { display: none; }
:is(.tiles, .cam-grid6) .tile-issue b { color: var(--blood); font: 600 .85rem/1.2 var(--data); letter-spacing: .14em; text-transform: uppercase; }
:is(.tiles, .cam-grid6) .tile-issue span { color: var(--ui-text); font-size: .82rem; line-height: 1.45; max-width: 46ch; margin: 0 auto; }
/* the sender delivers no picture (#193, live.js watchForBlack): a hint instead of just black */
:is(.tiles, .cam-grid6) .tile[data-wait] .tile-media::after { content: attr(data-wait); position: absolute; inset: 0; z-index: 2; display: grid; place-content: center;
  padding: 12px; text-align: center; font: .78rem/1.4 var(--data); color: var(--ui-dim); background: rgba(8, 5, 13, .6); pointer-events: none; }
:is(.tiles, .cam-grid6) .tile-selfnote span { color: var(--blood); font: 600 .78rem/1.2 var(--data); letter-spacing: .14em; text-transform: uppercase; }
:is(.tiles, .cam-grid6) .tile-selfnote small { color: var(--ui-dim); font-size: .72rem; }
:is(.tiles, .cam-grid6) .tile:not(.tile-waiting):has(.tile-video:not([hidden])), :is(.tiles, .cam-grid6) .tile.tile-cam { cursor: pointer; }
:is(.tiles, .cam-grid6) .tile-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 8px; border-radius: 4px; background: rgba(8, 5, 13, .72); color: var(--ui-text); font-size: .78rem;
}
:is(.tiles, .cam-grid6) .tile-tools { position: absolute; top: 6px; right: 6px; z-index: 5; display: flex; gap: 4px; }   /* top right: the camera window sits at the bottom right */
:is(.tiles, .cam-grid6) .tile-btn {
  width: 28px; height: 28px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(180, 120, 232, .45); background: rgba(8, 5, 13, .78); color: var(--ui-text); font: 600 13px/1 var(--body);
}
:is(.tiles, .cam-grid6) .tile-btn:hover, :is(.tiles, .cam-grid6) .tile-btn:focus-visible { border-color: var(--loa-lit); }
/* volume per stream: small slider left of the speaker button */
:is(.tiles, .cam-grid6) .tile-vol { display: flex; align-items: center; height: 28px; padding: 0 9px; border-radius: 14px;
  border: 1px solid rgba(180, 120, 232, .45); background: rgba(8, 5, 13, .78); }
:is(.tiles, .cam-grid6) .tile-vol[hidden] { display: none; }
:is(.tiles, .cam-grid6) .tile-vol input { -webkit-appearance: none; appearance: none; width: 100px; height: 12px; margin: 0; background: transparent; cursor: pointer; }
/* like the volume slider in the room (altar.css #vol): thin track with fill (live-tiles.js sets --p), round handle */
:is(.tiles, .cam-grid6) .tile-vol input::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--k-violet) var(--p, 100%), var(--k-line) var(--p, 100%)); }
:is(.tiles, .cam-grid6) .tile-vol input::-moz-range-track { height: 2px; background: var(--k-line); }
:is(.tiles, .cam-grid6) .tile-vol input::-moz-range-progress { height: 2px; background: var(--k-violet); }
:is(.tiles, .cam-grid6) .tile-vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; border: 0; border-radius: 50%; background: var(--k-violet); }
:is(.tiles, .cam-grid6) .tile-vol input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--k-violet); }

/* Verwaltung: Reiter (admin.html) */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.admin-tabs button {
  padding: 8px 14px; border: var(--hairline); border-radius: var(--r); background: rgba(8, 5, 13, .5);
  color: var(--ui-dim); font: .7rem/1.2 var(--data); letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
}
.admin-tabs button:hover { color: var(--ui-text); }
.admin-tabs button[aria-selected="true"] { color: var(--gold); border-color: var(--gold); background: rgba(232, 195, 122, .08); }
.admin-offerings { margin-top: 14px; }
/* collapsible sections of the administration (2.79.2, js/admin-fold.js) */
.admin-fold { border-top: var(--hairline); }
.admin-fold + .admin-fold { border-top: 0; }
.admin-fold > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 2px;
  font: .78rem/1.2 var(--data); letter-spacing: .08em; text-transform: uppercase;
}
.admin-fold > summary::-webkit-details-marker { display: none; }
/* 2.117.4: the room's sigil (js/altar-icons.js ICON.sigil) as the fold mark - tip to the right folded, down open */
.admin-fold > summary::before {
  content: ''; flex: none; width: 14px; height: 14px; background: var(--loa-lit); transform: rotate(90deg); transition: transform .15s;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 2.5l8.2 14.2H3.8z'/%3E%3Ccircle cx='12' cy='12.4' r='1.8'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 2.5l8.2 14.2H3.8z'/%3E%3Ccircle cx='12' cy='12.4' r='1.8'/%3E%3C/svg%3E") center / contain no-repeat;
}
.admin-fold[open] > summary::before { transform: rotate(180deg); }
/* every page section folds (2.117.4, foldSections): the sigil in the header toggles, folded only title + description */
.panel > header.admin-fold-head { cursor: pointer; align-items: center; }
.admin-fold-tg {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; margin: 0 -4px 0 -4px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--loa-lit); cursor: pointer; transform: rotate(180deg); transition: transform .2s, color .15s;
}
.admin-fold-tg:hover, .admin-fold-head:hover > .admin-fold-tg { color: var(--gold); }
.admin-fold-tg:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.panel.is-folded > header > .admin-fold-tg { transform: rotate(90deg); }
.panel.is-folded > header { margin-bottom: 4px; }
.panel.is-folded > header > :not(h2):not(.admin-fold-tg) { display: none; }
.panel.is-folded > :not(header):not(.admin-desc) { display: none; }
.admin-desc { margin: -8px 0 14px; font-size: .82rem; }
.panel.is-folded > .admin-desc { margin: 0; }
@media (prefers-reduced-motion: reduce) { .admin-fold-tg, .admin-fold > summary::before { transition: none; } }
.admin-fold > summary .muted { text-transform: none; letter-spacing: 0; }
.admin-fold > summary:hover { color: var(--ui-text); }
.admin-fold-body { padding: 0 0 12px; overflow-x: auto; }
#offerings .admin-add { align-items: center; }
#offerings #ofUser { flex: 0 1 240px; width: auto; }
#offerings #ofAmount { flex: 0 1 300px; }
#offerings .switch { white-space: nowrap; }
#pointsEvent .admin-add, #totems .admin-add { align-items: center; }
#pointsEvent #evFactor { flex: 0 1 170px; width: auto; }
#pointsEvent #evUntil { flex: 0 1 230px; }
#totems #totemRotate { flex: 0 0 5em; }
#skinForm { align-items: flex-end; }
#skinForm label.field { flex: 1 1 110px; }
#skinForm label.field:has(input:disabled) span { opacity: .45; }
.admin-tabs ~ section[hidden] { display: none !important; }

/* Hexe als Overlay waehrend eines Updates (public/js/kessel-watch.js, Inhalt: public/kessel.html) */
.kessel-overlay { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; z-index: 2147482000; background: transparent; }

/* --------------------------------------------------------------------- Reaktionen (public/js/reactions.js) */
.react-fly { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
/* reactions.js sets path and duration (Web Animations, randomly through the picture) */
.react-item { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; opacity: 0; will-change: transform, opacity; }
.react-item img { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6)); }
.react-item span { font: 600 .68rem/1 var(--data); color: #fff; text-shadow: 0 1px 3px #000; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.react-menu { position: relative; display: inline-flex; }
.react-menu[hidden] { display: none; }
.react-trigger { display: inline-flex; align-items: center; gap: 6px; }
.react-trigger img { width: 18px; height: 18px; }
.react-pop { position: fixed; z-index: 60; width: 330px; max-width: calc(100vw - 32px); max-height: 360px; overflow-y: auto;
  padding: 10px 12px; display: grid; gap: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .55); }
.react-pop[hidden] { display: none; }
.react-sec { display: grid; gap: 4px; }
.react-grid { display: grid; grid-template-columns: repeat(auto-fill, 40px); gap: 4px; }
.react-pop .react-btn { width: 40px; height: 40px; position: relative; display: block; }
.react-btn.locked { opacity: .35; filter: grayscale(.8); }
.react-btn.locked::after { content: '🔒'; position: absolute; right: -2px; bottom: -2px; font-size: .62rem; }
.react-btn.locked:hover { opacity: .7; }
/* reaction buttons and the admin list - moved here from modules/ping.css in 2.108.0 (they are not part of pings:
   with the ping module off the emote menu had no button styles) */
.react-btn { width: 32px; height: 32px; padding: 2px; border: 1px solid transparent; border-radius: var(--r); background: none; cursor: pointer; }
.react-btn:hover, .react-btn:focus-visible { border-color: var(--spirit); background: rgba(127, 240, 200, .08); }
.react-btn img { width: 100%; height: 100%; object-fit: contain; }
.react-btn.sent { animation: react-pop .3s ease-out; }
@keyframes react-pop { 50% { transform: scale(1.3); } }
.totem-card .totem-sample .react-sample { width: 48px; height: 48px; object-fit: contain; }
.admin-reactions img { width: 32px; height: 32px; object-fit: contain; vertical-align: middle; }
#reactAdmin .admin-add { align-items: center; }
#reactAdmin #raPrice { flex: 0 1 130px; }
.admin-totems .react-sample-sm { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }
.admin-reactions input[type=text] { max-width: 220px; }
.admin-reactions input[type=number] { max-width: 120px; }
/* reaction maker (2.108.0, react-maker.js): one card per picture - editing left (checkerboard = transparent), previews right */
#reactAdmin .rm-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0; padding: 12px; border: 1px dashed var(--k-line, #3b2a52); border-radius: var(--r); }
#reactAdmin .rm-drop.over { border-color: var(--gold); background: rgba(232, 195, 122, .06); }
#reactAdmin .rm-drop > .muted { flex: 1 1 260px; }
#reactAdmin .rm-cards { display: grid; gap: 12px; margin-bottom: 12px; }
#reactAdmin .rm-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 14px; padding: 12px; border: 1px solid var(--k-line-soft, #2a1c3a); border-radius: var(--r); }
#reactAdmin .rm-edit { display: flex; align-items: center; justify-content: center; min-height: 160px;
  background: repeating-conic-gradient(#3a3344 0% 25%, #241f2c 0% 50%) 0 0 / 16px 16px; border-radius: var(--r); }
#reactAdmin .rm-work { max-width: 100%; max-height: 420px; cursor: crosshair; image-rendering: auto; }
#reactAdmin .rm-side { display: grid; gap: 8px; align-content: start; }
#reactAdmin .rm-previews { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
#reactAdmin .rm-previews figure { margin: 0; display: grid; gap: 4px; justify-items: center; font: .68rem var(--data); color: var(--ui-text); }
#reactAdmin .rm-out { width: 72px; height: 72px; border-radius: var(--r); }
#reactAdmin .rm-on-dark { background: #0b0611; }
#reactAdmin .rm-on-light { background: #e9e4ef; }
#reactAdmin .rm-room-stage { position: relative; width: 120px; height: 90px; border-radius: var(--r); overflow: hidden;
  background: linear-gradient(135deg, #2c4a63, #6b3d55 60%, #c9884b); }
#reactAdmin .rm-fly { position: absolute; left: 50%; top: 50%; opacity: 1; transform: translate(-50%, -50%); }
#reactAdmin .rm-fly img { width: 42px; height: 42px; }   /* half size: the stage is about half of a real one */
#reactAdmin .rm-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; }
#reactAdmin .rm-row input[type=range] { flex: 1; min-width: 80px; }
#reactAdmin .rm-row .rm-name { flex: 1 1 140px; }
#reactAdmin .rm-row .rm-price { flex: 0 1 110px; }
#reactAdmin .rm-state { margin: 0; font-size: .78rem; }
@media (max-width: 760px) { #reactAdmin .rm-card { grid-template-columns: 1fr; } }
/* sound maker (2.108.0, sound-maker.js) */
#soundAdmin .sm-maker { display: grid; gap: 8px; margin: 8px 0 12px; }
#soundAdmin .sm-wave { width: 100%; height: 96px; display: block; margin: 6px 0; background: #0b0611; border: 1px solid var(--k-line-soft, #2a1c3a); border-radius: var(--r); cursor: ew-resize; touch-action: none; }
#soundAdmin .sm-row { align-items: center; gap: 10px; flex-wrap: wrap; font-size: .8rem; }
#soundAdmin .sm-row input[type=number] { width: 90px; }
#soundAdmin .sm-row [data-sm="name"] { flex: 1 1 200px; }
#soundAdmin .sm-row [data-sm="price"] { width: 120px; }
#soundAdmin [data-sm="len"].err { color: var(--blood, #e0606a); }
#soundAdmin header label { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; }
.admin-sounds input[type=text] { max-width: 220px; }
.admin-sounds input[type=number] { max-width: 90px; }
/* short notice over the stage who triggered something (room effect, sound) - moved here from seasons.css in 2.108.0 */
.react-note { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 31; padding: 3px 12px; border-radius: 10px; pointer-events: none;
  background: rgba(8, 5, 13, .82); border: 1px solid rgba(232, 195, 122, .45); color: var(--gold); font: 600 .78rem/1.4 var(--display); white-space: nowrap;
  animation: react-note 4s ease-in forwards; }
@keyframes react-note { 0% { opacity: 0; } 10%, 80% { opacity: 1; } 100% { opacity: 0; } }
/* room sounds (2.108.0): play for everyone, ear = only for me, own volume */
.react-snds { display: flex; flex-wrap: wrap; gap: 4px; }
.react-snd { display: inline-flex; gap: 1px; }
.react-snd .react-snd-play { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.react-snd .react-snd-ear { padding-inline: 5px; }
a.react-snd.locked { opacity: .45; text-decoration: none; }
.react-snd-play.sent { animation: react-snd-sent .5s ease-out; }
@keyframes react-snd-sent { from { box-shadow: 0 0 0 0 rgba(232, 195, 122, .8); } to { box-shadow: 0 0 0 8px rgba(232, 195, 122, 0); } }
.react-snd-vol { display: flex; align-items: center; gap: 8px; font: .72rem/1.2 var(--data); color: var(--ui-text); }
.react-snd-vol input { flex: 1; min-width: 0; }
.react-shop { font: .74rem/1.2 var(--data); color: var(--gold); text-decoration: none; }
.react-shop:hover { text-decoration: underline; }
/* Lobby: who is in the room, what is playing (2.32.0) */
.room-card .lobby-now { margin-top: 4px; font-size: .8rem; color: var(--ui-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-card .lobby-now b { color: var(--gold); font-weight: 600; }
.room-card .lobby-people { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; font-size: .78rem; }
.room-card .lobby-person { white-space: nowrap; }
.room-card .lobby-person .tn-badge { margin-right: .2em; }

/* Watch-Raum: Webcams aller unter dem Video (public/js/room-cams.js) */
#camDevice { width: auto; max-width: 180px; padding: 5px 8px; font-size: .78rem; }
@media (max-width: 640px) {   }

/* menu pages as an overlay (common.js openPageOverlay, 2.45.0): the page below keeps running */
.page-overlay { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(8, 5, 13, .72); backdrop-filter: blur(2px); }
.page-overlay[hidden] { display: none; }
/* 2.108.0 (David): grows with the window - about three quarters of the width and 88 % of the height, never smaller
   than before (1180 x 860) and never bigger than the window */
.page-overlay-box { display: flex; flex-direction: column; width: min(max(1180px, 76vw), 100%); height: min(max(860px, 88vh), 100%);
  background: var(--k-ground, #0b0611); border: 1px solid var(--k-line, #3b2a52); box-shadow: 0 24px 80px rgba(0, 0, 0, .7); }
.page-overlay-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--k-line-soft, #2a1c3a); }
.page-overlay-title { flex: 1; font: 700 1rem/1.2 var(--display); color: var(--k-gold, #d4a64a); letter-spacing: .06em; }
.page-overlay-frame { flex: 1; width: 100%; border: 0; background: var(--k-ground, #0b0611); }
html.page-overlay-open, html.page-overlay-open body { overflow: hidden; }
@media (max-width: 760px) { .page-overlay { padding: 0; } .page-overlay-box { height: 100%; border: 0; } }
/* page in the overlay: without its own bar and footer */
html.embedded .topbar, html.embedded .site-footer { display: none !important; }
.page-overlay-x, .page-overlay-full { flex: 0 0 auto; }

/* Konto: Avatar (js/avatar-editor.js, 2.47.0) */
.avatar-edit { display: flex; flex-direction: column; gap: 12px; }
.avatar-now { display: flex; align-items: center; gap: 14px; }
.avatar-circle { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: hsl(280 55% 68%); color: #0b0611; font: 700 2rem/1 var(--display); box-shadow: 0 0 0 2px rgba(180, 120, 232, .35); }
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-src { gap: 8px; flex-wrap: wrap; align-items: center; }
.avatar-src input[type="url"] { flex: 1 1 220px; min-width: 0; }
.avatar-file { cursor: pointer; }
.avatar-crop { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.avatar-crop[hidden] { display: none; }
.avatar-crop canvas { width: 240px; height: 240px; cursor: grab; touch-action: none; background: #050308; border: 1px solid rgba(180, 120, 232, .3); }
.avatar-crop canvas:active { cursor: grabbing; }
.avatar-zoom { width: 240px; }

/* --------------------------------------------------------------------- Automatische Diagnose (2.50.0, js/diag.js) */
.diag-notice { position: fixed; left: 16px; bottom: 16px; z-index: 70; width: min(360px, calc(100vw - 32px)); padding: 12px 14px;
  background: var(--k-panel); border: 1px solid var(--loa); border-radius: var(--r); box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  font-size: .85rem; display: flex; flex-direction: column; gap: 8px; }
.diag-notice-head { display: flex; align-items: center; gap: 8px; }
.diag-notice-head .diag-x { margin-left: auto; background: none; border: 0; color: var(--ui-dim); font-size: 1.1rem; cursor: pointer; }
.diag-notice p { margin: 0; color: var(--ui-dim); }
.diag-note { display: flex; gap: 6px; }
.diag-note input { flex: 1; min-width: 0; }
/* Eingefuegte Screenshots ("Problem melden", Strg+V) */
.diag-notice .diag-shot-hint { font-size: .75rem; }
.diag-notice .diag-shot-hint[hidden], .diag-shots[hidden] { display: none; }
.diag-shots { display: flex; gap: 6px; flex-wrap: wrap; }
.diag-shot { position: relative; display: block; width: 104px; height: 64px; border: 1px solid var(--k-line); border-radius: var(--r); overflow: hidden; }
.diag-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.diag-shot button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0; line-height: 18px; border: 0; border-radius: 50%;
  background: rgba(11, 6, 17, .85); color: var(--ui-text); cursor: pointer; }
.diag-request { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.diag-request select { flex: 0 1 220px; width: auto; min-width: 0; }
.diag-request input { flex: 1 1 220px; width: auto; min-width: 0; }
/* Admin -> Dammberman skins, column "Owners": the dropdown to give a skin to an account stays one line */
#skinList select[data-give] { width: auto; max-width: 180px; padding: 4px 8px; font-size: .85rem; }
.diag-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.diag-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--k-line-soft); border-radius: var(--r); font-size: .82rem; }
.kw-ask { width: min(440px, 92vw); padding: 14px; border: 1px solid var(--k-line); border-radius: 10px; background: var(--k-panel); color: inherit; }
.kw-ask::backdrop { background: rgba(0, 0, 0, .6); }
.kw-ask-q { display: block; }
.kw-ask-q span { display: block; margin-bottom: 8px; }
.kw-ask-q input { width: 100%; box-sizing: border-box; }
.kw-ask-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.diag-view { width: min(1100px, 94vw); height: min(86vh, 900px); padding: 0; border: 1px solid var(--k-line); border-radius: 10px; background: var(--k-panel); color: var(--k-text); }
.diag-view[open] { display: flex; flex-direction: column; }
.diag-view::backdrop { background: rgba(0, 0, 0, .6); }
.diag-view-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--k-line); }
.diag-view-title { flex: 1; }
.diag-view-text { flex: 1; margin: 0; padding: 10px 12px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: .8rem; }
.diag-row.err { border-color: var(--blood); }
.diag-row .grow { flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diag-token pre { white-space: pre-wrap; word-break: break-all; padding: 10px; background: rgba(0, 0, 0, .3); border-radius: var(--r); }

/* ------------------------------------------------------------- Avatar-Kreis */
/* Circle with an initial, colour per name, or an own picture (altar-icons.js avatarHtml). Global since 2.56.0 (lobby tiles,
   profile overlay); the rings for host/live are in altar.css. */
.altar-av {
  width: var(--av-size, 24px); height: var(--av-size, 24px); flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: hsl(var(--av, 280) 55% 68%); color: var(--k-ground);
  font: 700 calc(var(--av-size, 24px) * .44)/1 var(--display);
}
.altar-av.has-img { background: var(--k-tile); overflow: hidden; }
.altar-av.has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* names open the profile overlay (common.js) */
.tn[data-user] { cursor: pointer; }
.tn[data-user]:hover { text-decoration: underline; text-decoration-color: rgba(180, 120, 232, .5); text-underline-offset: 3px; }
body.tv .tn[data-user] { cursor: default; }
body.tv .tn[data-user]:hover, .profile-name .tn[data-user]:hover { text-decoration: none; }
.profile-name .tn[data-user] { cursor: default; }

/* ------------------------------------------------------------- Lobby: Teamspeak (2.56.0, teamspeak-tile.js) */
.ts-list { display: flex; flex-direction: column; gap: 12px; }
.ts-channel { display: flex; flex-direction: column; }
.ts-chan-name {
  display: flex; align-items: baseline; gap: 8px; padding: 0 2px 4px; margin-bottom: 2px;
  font-family: var(--data); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ui-dim);
  border-bottom: 1px solid var(--k-line-soft);
}
.ts-chan-name span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--loa-lit); }
.ts-chan-n { color: var(--ui-dim); }
.ts-person { display: flex; align-items: center; gap: 10px; padding: 7px 2px; }
.ts-person.away { opacity: .6; }
.ts-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ts-name { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-nick { color: var(--ui-text); }
.ts-status { font: .66rem/1.3 var(--data); color: var(--ui-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-icons { display: inline-flex; gap: 6px; color: var(--ui-dim); }
.ts-ic { display: inline-flex; }
.ts-ic.off { color: var(--blood); }
.ts-foot { margin-top: 14px; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------- Profil-Overlay (2.56.0, profile.js) */
.profile .sheet { width: min(720px, 100%); }
.profile-steam { display: contents; }   /* shell for the Steam part loaded later - layout as without */
.profile-body { overflow-y: auto; }
/* padding: room for the ring around the avatar - otherwise the scrolling content (.profile-body) cuts off the edge */
.profile-head { display: flex; gap: 18px; align-items: center; padding: 4px; }
.profile-head > .altar-av { box-shadow: 0 0 0 2px var(--k-panel), 0 0 0 3px var(--loa-lit); }
.profile-id { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.profile-name { font: 700 1.35rem/1.2 var(--display); display: flex; flex-wrap: wrap; align-items: baseline; }
.profile-meta { font-family: var(--data); font-size: .72rem; letter-spacing: .04em; color: var(--ui-dim); }
.profile-now { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 12px; }
.profile-stats > div { padding: 10px 8px; border: 1px solid var(--k-line-soft); border-radius: var(--r); text-align: center; background: rgba(8, 5, 13, .35); }
.profile-stats b { display: block; font: 700 1.2rem var(--display); color: var(--ui-title); }
.profile-stats span { font-family: var(--data); font-size: .66rem; letter-spacing: .06em; color: var(--ui-dim); }
.profile-h { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 8px; font: 700 .95rem var(--display); color: var(--ui-title); }
.profile-h .eyebrow { margin-left: auto; }
.profile-note { font-size: .82rem; margin: 6px 0 0; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-tag { padding: 3px 10px; border-radius: 12px; border: 1px solid rgba(180, 120, 232, .3); background: rgba(8, 5, 13, .6); font-family: var(--data); font-size: .72rem; color: var(--ui-text); }
a.profile-tag:hover { border-color: var(--loa-lit); }
.profile-games { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.profile-game { border-radius: var(--r); overflow: hidden; border: 1px solid var(--k-line-soft); background: rgba(8, 5, 13, .6); }
.profile-game .cov { position: relative; aspect-ratio: 460 / 215; display: flex; align-items: flex-end; background: linear-gradient(135deg, #2b1840, #0d0814); }
.profile-game .cov img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-game .cov span { position: relative; padding: 6px 8px; font: 700 .78rem/1.2 var(--display); color: #fff; text-shadow: 0 1px 4px #000; }
.profile-game .cov img + span { display: none; }
.profile-game .hrs { padding: 5px 8px; font-family: var(--data); font-size: .66rem; color: var(--ui-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 620px) {
  .profile-stats, .profile-games { grid-template-columns: repeat(2, 1fr); }
  .profile-head { flex-direction: column; text-align: center; }
  .profile-meta, .profile-now { justify-content: center; }
}

/* account page: links (Teamspeak, Steam) */
.account-block + .account-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--k-line-soft); }
.account-sub { margin: 0 0 10px; font: 700 .95rem var(--display); color: var(--ui-title); }
.account-switch { display: flex; margin-top: 12px; }

/* "Report a problem" as a window in the middle (2.64.0): background only slightly dimmed, big text field */
.overlay.diag-report { z-index: 95; background: rgba(8, 5, 13, .45); backdrop-filter: none; }
.diag-report .sheet { width: min(560px, 100%); gap: 10px; }
.diag-report .sheet > header { margin-bottom: 4px; }
.diag-report p { margin: 0; }
.diag-report .diag-text { width: 100%; min-height: 150px; resize: vertical; font: inherit; }
.diag-report .diag-logs { display: flex; gap: 8px; align-items: baseline; font-size: .85rem; cursor: pointer; }
.diag-report .diag-logs .muted { font-size: .78rem; }
.diag-report .diag-shot-hint { font-size: .75rem; }
.diag-report .diag-shot-hint[hidden] { display: none; }
.diag-report .diag-send { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.diag-report .diag-status { flex: 1; font-size: .82rem; }
.diag-fixed-head { margin: 10px 0 2px; font: 700 .85rem var(--display); color: var(--ui-dim); }
.diag-row.fixed { opacity: .65; }

/* Verwaltung: Server-Status (2.65.0, js/admin-status.js) */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 10px 0 12px; }
.stat-tile { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--k-line-soft); border-radius: var(--r); min-width: 0; }
.stat-tile.wide { grid-column: span 2; }
.stat-tile > span { font: .7rem var(--data); letter-spacing: .08em; text-transform: uppercase; color: var(--ui-dim); }
.stat-tile > b { font: 700 1.35rem/1.15 var(--data); color: var(--ui-title); overflow-wrap: anywhere; }
.stat-tile ul { list-style: none; margin: 4px 0 0; padding: 6px 0 0; border-top: 1px solid var(--k-line-soft); display: grid; gap: 2px; }
.stat-tile li { font-size: .74rem; line-height: 1.35; color: var(--ui-dim); overflow-wrap: anywhere; }
.stat-tile.warn { border-color: var(--blood); }
.stat-tile.warn > b { color: var(--blood); }
.stat-workers { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.stat-workers li { display: grid; grid-template-columns: 1.2em 1fr 4.2em 6.5em; align-items: center; gap: 8px; font: .74rem var(--data); color: var(--ui-dim); }
.stat-workers em { font-style: normal; text-align: right; }
.stat-workers i { height: 6px; border-radius: 3px; background: var(--k-line-soft); overflow: hidden; }
.stat-workers s { display: block; height: 100%; background: var(--spirit); text-decoration: none; }
.stat-workers b { text-align: right; color: var(--ui-title); font-weight: 600; }
.stat-workers small { font-size: inherit; }
.stat-workers li.warn s { background: var(--blood); }
.stat-workers li.warn b { color: var(--blood); }
@media (max-width: 480px) { .stat-tile.wide { grid-column: auto; } }
.status-rooms { width: 100%; border-collapse: collapse; font-size: .82rem; }
.status-rooms th, .status-rooms td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--k-line-soft); }
.status-rooms th { font: .7rem var(--data); letter-spacing: .08em; text-transform: uppercase; color: var(--ui-dim); }
.status-rooms td:not(:first-child), .status-rooms th:not(:first-child) { text-align: right; }

/* Verwaltung -> Module (2.75.3, public/js/admin-modules.js) */
.admin-module { padding: 10px 12px; border: 1px solid var(--k-line-soft); border-radius: var(--r); margin-top: 10px; }
.admin-module .admin-note { margin: 4px 0 0; }
.admin-module .admin-module-wait { color: var(--k-gold); }

/* Unsichtbar-Schalter in der Leiste, neben der Katze (2.148.0, common.js) */
.topbar nav > .btn.tb-invis { padding: 2px 6px; display: inline-flex; align-items: center; }
.topbar nav > .btn.tb-invis:not(.on) { opacity: .45; }
.topbar nav > .btn.tb-invis.on { color: var(--gold); border-color: var(--gold); background: rgba(232, 195, 122, .1); }

/* Verwaltung -> Konten: Benutzer, Kreise, Gruppen (2.147.0, public/js/pages/admin.js) */
.admin-toolbar { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.admin-toolbar input[type=search] { flex: 1 1 220px; width: auto; min-width: 0; }
.admin-toolbar select { flex: 0 0 auto; width: auto; }
.admin-users td { vertical-align: top; }
.user-name { font-weight: 600; }
.user-sub { font-size: .75rem; color: var(--ui-dim); overflow-wrap: anywhere; margin-top: 2px; }
.user-warn { color: var(--gold); }
.user-circle, .user-roles { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.user-circle { flex-wrap: nowrap; }
.user-circle select { max-width: 150px; padding: 3px 6px; font-size: .8rem; }
.role-pill {
  display: inline-flex; align-items: center; padding: 2px 8px; border: var(--hairline); border-radius: 999px;
  font-size: .74rem; color: var(--ui-dim); cursor: pointer; white-space: nowrap; user-select: none;
}
.role-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.role-pill.is-on { color: var(--gold); border-color: var(--gold); background: rgba(232, 195, 122, .1); }
.role-pill:focus-within { outline: 2px solid var(--gold); outline-offset: 1px; }
.user-seen { font-size: .75rem; white-space: nowrap; }
.user-act { text-align: right; width: 1%; }
.admin-users tr.is-blocked td { opacity: .55; }
.admin-users tr.is-blocked td.user-act { opacity: 1; }
.admin-actions { position: relative; display: inline-block; }
.admin-actions > summary { list-style: none; }
.admin-actions > summary::-webkit-details-marker { display: none; }
.admin-actions-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: flex; flex-direction: column; gap: 4px;
  padding: 6px; border: var(--hairline); border-radius: var(--r); background: var(--k-line-soft); min-width: 120px;
}
.chip-more { display: inline; }
.chip-more > summary { display: inline; cursor: pointer; font-size: .72rem; color: var(--ui-dim); list-style: none; }
.chip-more > summary::-webkit-details-marker { display: none; }
.chip-more[open] > summary { display: none; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.admin-card { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--k-line-soft); border-radius: var(--r); }
.admin-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-card-head .eyebrow { margin-left: auto; white-space: nowrap; }
.admin-card-title { font-weight: 600; font-size: .9rem; }
input.admin-card-title { flex: 1 1 140px; min-width: 120px; }
.admin-card-foot { gap: 8px; align-items: center; margin-top: auto; }
.admin-chips { font-size: .8rem; line-height: 1.7; }
.admin-chips-label { margin-right: 6px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ui-dim); }
.admin-warn { margin-bottom: 12px; padding: 10px 12px; border-left: 3px solid var(--gold); background: rgba(232, 195, 122, .08); font-size: .84rem; }
.admin-none-list { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; }
.admin-none-item { display: inline-flex; align-items: center; gap: 6px; }
.admin-none-item select { padding: 3px 6px; font-size: .8rem; }

/* First-login tour (public/js/tour.js) and the welcome card. */
.tour-wrap { position: fixed; inset: 0; z-index: 9000; pointer-events: none; }
.tour-ring {
  position: fixed; border: 2px solid var(--k-gold); border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(8, 5, 13, .62), var(--glow-loa);
  pointer-events: none;
}
.tour-tip {
  position: fixed; max-width: 320px; pointer-events: auto;
  background: var(--k-panel-2); color: var(--k-text);
  border: 1px solid var(--k-line); border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.tour-text { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
.tour-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tour-count { color: var(--k-muted); font-size: 12px; flex-basis: 100%; }
.tour-spacer { flex: 1; }
.tour-welcome { pointer-events: auto; display: grid; place-items: center; background: rgba(8, 5, 13, .6); }
.tour-card {
  max-width: 520px; margin: 16px; background: var(--k-panel-2); color: var(--k-text);
  border: 1px solid var(--k-line); border-radius: 12px; padding: 20px 22px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .55);
}
.tour-card h2 { font-family: var(--display); color: var(--k-gold); margin: 0 0 8px; font-size: 22px; }
.tour-card p { margin: 0 0 16px; font-size: 14px; line-height: 1.55; }
.tour-card-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
/* topics (2.130.0): pick a part of the tour; help links on a stop */
.tour-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 0 0 16px; }
.tour-topic {
  display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer;
  background: var(--k-panel); color: var(--k-text); border: 1px solid var(--k-line); border-radius: 8px; padding: 9px 11px;
}
.tour-topic:hover, .tour-topic:focus-visible { border-color: var(--k-gold); }
.tour-topic b { font-size: 14px; }
.tour-topic span { color: var(--k-muted); font-size: 12px; line-height: 1.35; }
.tour-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tour-card .tour-text { margin-bottom: 14px; }

/* Tier looks (care-math.js bedLevel / foodLevel), shop tiles (glow); the cat larder only borrows the season colour variables: a gradient ring (::before) plus glow. 1 white faint, 2 blue waves, 3 strong purple,
   4 gold shimmer; special: season (colours per season) and cursed (black, shadowy). */
button.totem-card[class*="tier-"] { position: relative; }
button.totem-card[class*="tier-"]::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--tier-ring, none); background-size: var(--tier-size, 100% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
button.totem-card.tier-1 { border-color: rgba(255, 255, 255, .22); box-shadow: 0 0 6px rgba(255, 255, 255, .12); }
button.totem-card.tier-2 { --tier-ring: linear-gradient(100deg, #2a63e8, #8fd8ff, #2a63e8, #8fd8ff, #2a63e8); --tier-size: 300% 100%;
  box-shadow: 0 0 10px rgba(70, 140, 255, .4); }
button.totem-card.tier-2::before { animation: tier-wave 3.5s linear infinite; }
button.totem-card.tier-3 { --tier-ring: linear-gradient(135deg, #7a2cff, #c06bff); box-shadow: 0 0 14px 1px rgba(150, 70, 255, .65), inset 0 0 10px rgba(150, 70, 255, .2); }
button.totem-card.tier-3::before { animation: tier-pulse 2.6s ease-in-out infinite; }
button.totem-card.tier-4 { --tier-ring: linear-gradient(110deg, #b8862b 0%, #ffe9a0 20%, #e8c37a 40%, #b8862b 60%, #ffe9a0 80%, #b8862b 100%); --tier-size: 300% 100%;
  box-shadow: 0 0 14px rgba(232, 195, 122, .5); }
button.totem-card.tier-4::before { animation: tier-wave 2.8s linear infinite; }
button.totem-card.tier-season { --tier-ring: linear-gradient(120deg, var(--s1, #3ff0b0), var(--s2, #e8c37a), var(--s1, #3ff0b0)); --tier-size: 200% 100%;
  box-shadow: 0 0 12px var(--s1, #3ff0b0); }
button.totem-card.tier-season::before { animation: tier-wave 6s linear infinite; }
:is(button.totem-card, button.kcat-food, .kcat-chip).season-fruehling { --s1: #f4a6c6; --s2: #8fdc8a; }
:is(button.totem-card, button.kcat-food, .kcat-chip).season-sommer { --s1: #2ec4c6; --s2: #f2d49b; }
:is(button.totem-card, button.kcat-food, .kcat-chip).season-herbst { --s1: #e8472b; --s2: #b04a9a; }
:is(button.totem-card, button.kcat-food, .kcat-chip).season-winter { --s1: #9fd8ff; --s2: #e8f6ff; }
button.totem-card.tier-cursed { background: radial-gradient(circle at 50% 100%, rgba(0, 0, 0, .55), var(--k-tile) 70%);
  --tier-ring: linear-gradient(160deg, #000, #3a0d22 45%, #000 70%, #1a0830); --tier-size: 200% 200%;
  box-shadow: 0 0 16px 3px rgba(0, 0, 0, .95), 0 0 6px rgba(110, 10, 50, .5), inset 0 0 14px rgba(0, 0, 0, .8); }
button.totem-card.tier-cursed::before { animation: tier-flicker 5s steps(1) infinite; }
@keyframes tier-wave { to { background-position: 300% 0; } }
@keyframes tier-pulse { 50% { opacity: .55; } }
@keyframes tier-flicker { 0%, 100% { opacity: 1; } 41% { opacity: .35; } 44% { opacity: 1; } 47% { opacity: .5; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { button.totem-card[class*="tier-"]::before { animation: none !important; } }
