/* ==========================================================================
   Listen-App: Design-System
   Aufbau: Tokens, Basis, Bedienelemente, Kopfleiste, Startseite, Liste, Spiele, Dialoge, Kalender,
   Konto, Party/Banner, Anzeigen, Login, Admin, Anpassungen für kleine Fenster
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #0d0f15;
  --surface: #151822;
  --surface-2: #1c2030;
  --surface-3: #252a3c;
  --border: #272c3d;
  --border-strong: #353c54;
  --text: #eceef5;
  --text-dim: #98a1b6;
  --text-faint: #66708a;
  --accent: #7b8cff;
  --accent-2: #b37cff;
  --accent-soft: rgba(123, 140, 255, 0.14);
  --on-accent: #0b0d1a;
  --danger: #ff6b86;
  --danger-soft: rgba(255, 107, 134, 0.12);
  --success: #43d19b;
  --success-soft: rgba(67, 209, 155, 0.13);
  --warn: #f1b44c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --radius: 14px;
  --radius-sm: 10px;
  --ring: 0 0 0 3px rgba(123, 140, 255, 0.35);

  /* Namen aus der früheren Version (Skripte und Styles nutzen sie noch) */
  --bg-elevated: var(--surface);
  --bg-hover: var(--surface-3);
  --accent-hover: #a0adff;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f4f5fa;
    --surface: #ffffff;
    --surface-2: #f0f2f8;
    --surface-3: #e5e8f2;
    --border: #e1e4ee;
    --border-strong: #cdd2e2;
    --text: #161a27;
    --text-dim: #566078;
    --text-faint: #8a93a8;
    --accent: #4f62f0;
    --accent-2: #8a4fe8;
    --accent-soft: rgba(79, 98, 240, 0.1);
    --on-accent: #ffffff;
    --danger: #d83a5a;
    --danger-soft: rgba(216, 58, 90, 0.09);
    --success: #12a06e;
    --success-soft: rgba(18, 160, 110, 0.1);
    --warn: #b87708;
    --shadow: 0 18px 44px rgba(30, 40, 80, 0.18);
    --ring: 0 0 0 3px rgba(79, 98, 240, 0.28);
    --accent-hover: #3a4bd6;
  }
}

/* ---------- Basis ---------- */
* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--accent-hover);
}

code {
  padding: 0.1rem 0.4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85em;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.hint {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.detail-note {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.eyebrow {
  margin: 0 0 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 8px;
}

::selection {
  background: var(--accent-soft);
}

body.modal-open {
  overflow: hidden;
}

/* ---------- Bedienelemente ---------- */
button,
.btn,
.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}

button:hover,
.btn:hover,
.file-btn:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

button:active,
.btn:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-primary,
button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: var(--on-accent);
  font-weight: 600;
}

.btn-primary:hover,
button.primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-2));
  border-color: transparent;
  color: var(--on-accent);
  filter: brightness(1.06);
}

.btn.danger,
button.danger {
  color: var(--danger);
}

.btn.danger:hover,
button.danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

input[type="number"] {
  width: 6.5rem;
}

input[type="file"] {
  padding: 0.4rem;
  font-size: 0.85rem;
}

select {
  width: auto;
  padding-right: 1.6rem;
}

textarea {
  resize: vertical;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
}

.field select {
  width: 100%;
}

.field-row {
  display: flex;
  gap: 0.7rem;
  align-items: flex-end;
}

.field.grow {
  flex: 1;
  min-width: 0;
}

.icon-field {
  width: 4.6rem;
  flex: none;
}

.icon-field input {
  text-align: center;
  font-size: 1.05rem;
  padding-left: 0.3rem;
  padding-right: 0.3rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.7rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.form-error {
  min-height: 1.1rem;
  color: var(--danger);
  font-size: 0.85rem;
}

.form-error.ok {
  color: var(--success);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.inline-form input[type="text"] {
  flex: 1 1 200px;
  width: auto;
}

/* Schalter */
.switch-line {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
}

.switch-line > span {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

.switch-line small {
  color: var(--text-dim);
  font-size: 0.8rem;
}

input[type="checkbox"].toggle,
.switch-line input[type="checkbox"] {
  appearance: none;
  flex: none;
  position: relative;
  width: 2.5rem;
  height: 1.4rem;
  margin: 0;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

input[type="checkbox"].toggle::after,
.switch-line input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.4rem - 8px);
  height: calc(1.4rem - 8px);
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.15s;
}

input[type="checkbox"].toggle:checked,
.switch-line input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

input[type="checkbox"].toggle:checked::after,
.switch-line input[type="checkbox"]:checked::after {
  background: #fff;
  transform: translateX(1.1rem);
}

/* Segment-Schalter */
.seg {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.seg-btn {
  padding: 0.3rem 0.65rem;
  background: transparent;
  border: 0;
  color: var(--text-dim);
}

.seg-btn:hover {
  background: transparent;
  color: var(--text);
}

.seg-btn.active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Kleine Bausteine */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}

.badge-accent {
  color: var(--accent-hover);
  background: var(--accent-soft);
  border-color: transparent;
}

.badge-alert {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  border-color: transparent;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
}

.notice {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}

button.chip {
  cursor: pointer;
}

.chip--mode {
  color: var(--accent-hover);
  background: var(--accent-soft);
  border-color: transparent;
}

.chip--me {
  color: var(--success);
  background: var(--success-soft);
  border-color: transparent;
}

.chip--toggle {
  cursor: pointer;
}

.chip--toggle.on {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.live-dot {
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
}

.live-dot.on {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

/* Avatare */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  background: hsl(var(--hue, 225) 52% 44%);
  color: #fff;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.avatar-stack {
  display: inline-flex;
  align-items: center;
}

.avatar-stack .avatar {
  width: 1.6rem;
  height: 1.6rem;
  margin-left: -0.45rem;
  border: 2px solid var(--surface);
  font-size: 0.68rem;
}

.avatar-stack .avatar:first-child {
  margin-left: 0;
}

.avatar-more {
  background: var(--surface-3);
  color: var(--text-dim);
}

/* ---------- Kopfleiste ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
}

.topbar-spacer {
  flex: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 9px;
  font-size: 1rem;
}

.brand-name {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crumb-sep {
  color: var(--text-faint);
  font-size: 1.2rem;
}

.menu-wrap {
  position: relative;
}

.switch-btn {
  gap: 0.5rem;
  padding: 0.3rem 0.6rem 0.3rem 0.35rem;
  background: transparent;
  border-color: transparent;
  font-weight: 600;
}

.switch-btn:hover,
.switch-btn[aria-expanded="true"] {
  background: var(--surface-2);
  border-color: var(--border);
}

.switch-label {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chev {
  color: var(--text-faint);
}

.list-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 1.7rem;
  height: 1.7rem;
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1;
}

.list-icon--lg {
  width: 3rem;
  height: 3rem;
  border-radius: 13px;
  font-size: 1.6rem;
}

.avatar-btn {
  padding: 0.15rem;
  background: transparent;
  border-color: transparent;
  border-radius: 50%;
}

.avatar-btn:hover {
  background: transparent;
  border-color: var(--border-strong);
}

.popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  min-width: 270px;
  max-width: min(340px, calc(100vw - 1.5rem));
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.popover-right {
  left: auto;
  right: 0;
  min-width: 220px;
}

.menu-label {
  padding: 0.4rem 0.6rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.menu-head {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.65rem 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.3rem;
}

.menu-head small {
  color: var(--accent-hover);
}

.menu-sep {
  height: 1px;
  margin: 0.3rem 0;
  background: var(--border);
}

.menu-empty {
  padding: 0.4rem 0.6rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
  text-decoration: none;
}

.menu-item:hover {
  background: var(--surface-2);
}

.menu-item.current {
  background: var(--accent-soft);
}

.menu-item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-check {
  color: var(--accent);
}

/* ---------- Seiten ---------- */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem;
}

.page-head {
  margin: 0.5rem 0 1.2rem;
}

.page-head h1 {
  font-size: 1.7rem;
}

body.no-list #list-shell {
  display: none;
}

body:not(.no-list) #view-lists {
  display: none;
}

/* ---------- Startseite ---------- */
.search-field {
  position: relative;
}

.search-ico {
  position: absolute;
  top: 0.85rem;
  left: 0.9rem;
  color: var(--text-faint);
  pointer-events: none;
}

.search-field > input {
  padding: 0.8rem 1rem 0.8rem 2.7rem;
  font-size: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
}

.home-section {
  margin-top: 1.6rem;
}

.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.9rem;
}

.list-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.list-card.clickable {
  cursor: pointer;
}

.list-card.clickable:hover,
.list-card.clickable:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 14%, transparent);
}

.list-card-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.list-card-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.list-card-title h3 {
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.list-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.list-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.list-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-top: auto;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.list-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.list-card--new {
  align-items: center;
  justify-content: center;
  min-height: 9rem;
  gap: 0.2rem;
  text-align: center;
  background: transparent;
  border: 1.5px dashed var(--border-strong);
  color: var(--text-dim);
}

.list-card--new:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.new-plus {
  font-size: 1.6rem;
  line-height: 1;
}

/* ---------- Geöffnete Liste ---------- */
.list-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.4rem 1.25rem 0.4rem;
}

.list-hero-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.list-hero-text {
  min-width: 0;
}

.list-hero-text h1 {
  font-size: 1.6rem;
  overflow-wrap: anywhere;
}

.list-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  max-width: 1180px;
  margin: 0.4rem auto 0;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 0.65rem 1rem;
  margin-bottom: -1px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--text-dim);
  font-weight: 600;
}

.tab:hover {
  background: transparent;
  color: var(--text);
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 0.4rem;
}

.filterbar input[type="search"] {
  flex: 1 1 200px;
  width: auto;
}

.list-count {
  margin: 0.4rem 0 0.8rem;
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* ---------- Spiele ---------- */
.search-section {
  margin-top: 0.4rem;
}

.search-box {
  position: relative;
}

.search-status {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0.2rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.search-status:empty {
  display: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 420px;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 9px;
  cursor: pointer;
}

.result-item:hover {
  background: var(--surface-2);
}

.result-item img {
  width: 42px;
  height: 56px;
  flex: none;
  object-fit: cover;
  background: var(--surface-3);
  border-radius: 6px;
}

.result-info {
  min-width: 0;
}

.result-title {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-sub {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-added {
  margin-left: auto;
  flex: none;
  color: var(--success);
  font-size: 0.75rem;
}

.result-item.busy {
  opacity: 0.5;
  pointer-events: none;
}

.library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card.clickable {
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.card.clickable:hover,
.card.clickable:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.card-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--surface-3);
}

.card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
}

.card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.95rem;
  line-height: 1.3;
}

.card-meta {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.store-badge {
  padding: 0.1rem 0.45rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.68rem;
}

.card-added,
.card-dislikers {
  color: var(--text-faint);
  font-size: 0.74rem;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.4rem;
}

.card-foot .avatar-stack .avatar {
  border-color: var(--surface);
}

.vote-row {
  display: flex;
  gap: 0.3rem;
  margin-left: auto;
}

.vote-btn,
.dislike-btn {
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: var(--surface-2);
  border-radius: 999px;
  font-size: 0.82rem;
}

.vote-btn.voted {
  color: var(--success);
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 50%, transparent);
}

.dislike-btn.voted {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
}

.vote-count {
  min-width: 0.9em;
  font-variant-numeric: tabular-nums;
}

.steam-price {
  color: var(--success);
  font-size: 0.78rem;
}

.steam-price a {
  color: inherit;
  text-decoration: none;
}

.steam-price a:hover {
  text-decoration: underline;
}

/* Kompakte Listenansicht */
.library.compact {
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.library.compact .card {
  flex-direction: row;
  align-items: center;
  height: auto;
  padding: 0.5rem 0.75rem 0.5rem 0.5rem;
  gap: 0.8rem;
}

.library.compact .card-cover {
  flex: none;
  width: 44px;
  overflow: hidden;
  border-radius: 8px;
}

.library.compact .card-body {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title foot" "meta foot";
  column-gap: 1rem;
  row-gap: 0;
  align-items: center;
  padding: 0;
}

.library.compact .card-title {
  grid-area: title;
  -webkit-line-clamp: 1;
}

.library.compact .card-meta {
  grid-area: meta;
}

.library.compact .card-foot {
  grid-area: foot;
  margin: 0;
  padding: 0;
  gap: 0.8rem;
}

.library.compact .card-stores,
.library.compact .card-added,
.library.compact .card-dislikers {
  display: none;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 3.5rem 1rem;
  text-align: center;
  color: var(--text-dim);
}

.empty-state strong {
  color: var(--text);
  font-size: 1.1rem;
}

.empty-emoji {
  font-size: 2.6rem;
}

/* ---------- Dialoge ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  overflow-y: auto;
  padding: 1rem;
  background: rgba(6, 8, 14, 0.66);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: auto;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: pop-in 0.18s ease-out;
}

.modal-lg {
  max-width: 740px;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal-title {
  margin: 0 2rem 0.4rem 0;
  font-size: 1.25rem;
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
}

.overlay-sheet {
  justify-content: flex-end;
  padding: 0;
}

.sheet {
  position: relative;
  width: min(500px, 100%);
  min-height: 100%;
  height: max-content;
  padding: 1.5rem;
  background: var(--surface);
  border-left: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  animation: slide-in 0.2s ease-out;
}

@keyframes slide-in {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 2rem 1.2rem 0;
}

.sheet-block {
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}

.sheet-block h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  font-size: 0.95rem;
}

.sheet-block .hint {
  margin-bottom: 0.7rem;
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.member-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.member-name {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.member-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Neue Liste: Vorlagen und Symbole */
.template-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}

.template {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.65rem 0.7rem;
  text-align: left;
}

.template small {
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 400;
}

.template-icon {
  font-size: 1.4rem;
}

.template.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.emoji-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: -0.3rem;
}

.emoji-btn {
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  background: transparent;
  border-color: transparent;
  font-size: 1.15rem;
}

/* Spiel-Details */
.modal-head {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.modal-head img {
  flex: none;
  width: 110px;
  height: 147px;
  object-fit: cover;
  background: var(--surface-3);
  border-radius: 10px;
}

.modal-head-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.modal-head-info h2 {
  font-size: 1.4rem;
}

.modal-head-info .card-meta {
  white-space: normal;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.detail-summary {
  line-height: 1.6;
}

.shot-main {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
}

.shot-thumbs {
  display: flex;
  gap: 0.5rem;
  padding-bottom: 0.3rem;
  overflow-x: auto;
}

.shot-thumb {
  flex: none;
  padding: 0;
  overflow: hidden;
  opacity: 0.6;
  border: 2px solid transparent;
  border-radius: 8px;
}

.shot-thumb.active {
  opacity: 1;
  border-color: var(--accent);
}

.shot-thumb img {
  display: block;
  width: 112px;
  height: 63px;
  object-fit: cover;
}

/* ---------- Kalender ---------- */
.cal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cal-head h2 {
  margin-bottom: 0.2rem;
  font-size: 1.3rem;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cal-month {
  min-width: 9rem;
  text-align: center;
  text-transform: capitalize;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.9rem;
  align-items: start;
}

.cal-day {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cal-day.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px color-mix(in srgb, var(--accent) 14%, transparent);
}

.cal-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-day-label {
  display: flex;
  flex-direction: column;
}

.cal-day-label strong {
  text-transform: capitalize;
}

.cal-day-label span {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.cal-add-day {
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
}

.cal-empty {
  padding: 0.5rem 0;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.ev {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
}

.ev--meal { border-left-color: #e0a800; }
.ev--shopping { border-left-color: #43d19b; }
.ev--break { border-left-color: #98a1b6; }
.ev--other { border-left-color: #c779e8; }

.ev-time {
  color: var(--accent-hover);
  font-size: 0.8rem;
  font-weight: 700;
}

.ev-body {
  display: flex;
  gap: 0.6rem;
}

.ev-cover {
  flex: none;
  width: 44px;
  height: 58px;
  object-fit: cover;
  background: var(--surface-3);
  border-radius: 6px;
}

.ev-main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.ev-title {
  font-size: 0.95rem;
  line-height: 1.3;
  text-align: left;
}

button.ev-title--link {
  padding: 0;
  background: transparent;
  border: 0;
  font-weight: 700;
  text-align: left;
}

button.ev-title--link:hover {
  background: transparent;
  color: var(--accent-hover);
  text-decoration: underline;
}

.ev-note {
  color: var(--text-dim);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ev-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ev-actions button {
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
}

.ev-join.joined {
  color: var(--success);
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 50%, transparent);
}

.ev-people {
  margin: 0;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.ev-people legend {
  padding: 0 0.3rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.ev-people .inline-form {
  margin-top: 0.6rem;
}

/* ---------- Konto ---------- */
.account-section {
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}

.account-section:first-of-type {
  border-top: 0;
}

.account-section h3 {
  margin-bottom: 0.7rem;
  font-size: 0.95rem;
}

.account-section .hint {
  margin-top: 0.6rem;
}

.account-code {
  margin-top: 0.8rem;
  color: var(--accent-hover);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 1.8rem;
  letter-spacing: 0.15em;
  user-select: all;
}

.account-result {
  padding: 0.7rem 0.9rem;
  background: var(--success-soft);
  border: 1px solid color-mix(in srgb, var(--success) 45%, transparent);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.account-code-inline {
  font-size: 1.05rem;
  font-weight: 700;
  user-select: all;
}

/* ---------- Banner, Einfrieren, Party ---------- */
.announcement {
  padding: 0.55rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--on-accent);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

body.frozen .search-section,
body.frozen .vote-btn,
body.frozen .dislike-btn,
body.frozen .cal-write {
  opacity: 0.45;
  pointer-events: none;
}

@keyframes party-hue {
  to { filter: hue-rotate(360deg); }
}

@keyframes party-bg {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

body.party {
  background: linear-gradient(120deg, #1a1030, #0f1f33, #2a1030, #0f2a22, #1a1030);
  background-size: 300% 300%;
  animation: party-bg 14s linear infinite;
}

body.party .brand-name,
body.party .list-hero-text h1 {
  background: linear-gradient(90deg, #ff5f6d, #ffc371, #7bed9f, #70a1ff, #ff5f6d);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: party-bg 4s linear infinite;
}

body.party .card {
  animation: party-hue 18s linear infinite;
}

/* ---------- Anzeigen links und rechts ---------- */
:root {
  --rail-w: 240px;
}

@media (min-width: 1400px) {
  :root { --rail-w: 300px; }
}

@media (min-width: 1700px) {
  :root { --rail-w: 360px; }
}

.slot {
  z-index: 30;
}

/* Breiter Bildschirm: Anzeigen sind fest am Rand verankert, die Hoehe setzt das Skript */
body.rails-wide .slot {
  position: fixed;
  top: 76px;
  width: var(--rail-w);
  transition: top 0.7s ease;
}

body.rails-wide .slot--left { left: 12px; }
body.rails-wide .slot--right { right: 12px; }
body.rails-wide .slot[hidden] { display: none; }

/* Platz fuer die Anzeigen schaffen, solange sie laufen */
body.rails-wide.rails-left { padding-left: calc(var(--rail-w) + 28px); }
body.rails-wide.rails-right { padding-right: calc(var(--rail-w) + 28px); }

@keyframes pitch-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.pitch {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  color: #202124;
  border: 1px solid #dadce0;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  animation: pitch-in 0.3s ease-out;
}

.pitch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.35rem 0.3rem 0.65rem;
  font-size: 0.72rem;
  color: #5f6368;
  background: #f8f9fa;
  border-bottom: 1px solid #e8eaed;
}

.pitch-label {
  cursor: help;
}

button.pitch-close {
  padding: 0 0.45rem;
  border: 0;
  background: transparent;
  color: #5f6368;
  font-size: 0.9rem;
  line-height: 1.5;
}

button.pitch-close:hover {
  background: transparent;
  color: #202124;
}

.pitch-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.pitch-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.pitch-image {
  display: block;
  width: 100%;
  background: #f1f3f4;
}

button.pitch-sound {
  position: absolute;
  left: 0.55rem;
  bottom: 2.6rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 4px;
}

button.pitch-sound:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.78);
  border-color: #fff;
}

.pitch-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem 0.85rem 0.9rem;
}

.pitch-title {
  font-size: 1.05rem;
  line-height: 1.3;
}

.pitch-text {
  font-size: 0.88rem;
  line-height: 1.45;
  color: #5f6368;
}

.pitch-cta {
  align-self: flex-start;
  margin-top: 0.2rem;
  padding: 0.55rem 1.1rem;
  border: 0;
  border-radius: 4px;
  background: #1a73e8;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.pitch-cta:hover {
  background: #1765cc;
  color: #fff;
}

.pitch-target {
  font-size: 0.72rem;
  color: #5f6368;
}

/* Schmale Fenster/Handy: kompakte Leiste unten, bei Platz zwei Anzeigen nebeneinander */
@media (max-width: 1199px) {
  body.rails-strip {
    padding-bottom: 270px;
  }

  body.rails-strip .rail-layer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
    background: rgba(8, 9, 14, 0.92);
  }

  body.rails-strip .slot {
    flex: 1 1 0;
    min-width: 0;
    max-width: 520px;
    margin: 0 auto;
  }

  body.rails-strip .pitch-text,
  body.rails-strip .pitch-target {
    display: none;
  }

  body.rails-strip .pitch--video .pitch-media {
    aspect-ratio: auto;
    height: 130px;
  }

  body.rails-strip .pitch-image {
    max-height: 90px;
    object-fit: cover;
  }

  body.rails-strip .pitch-body {
    padding: 0.45rem 0.6rem 0.55rem;
  }

  body.rails-strip button.pitch-sound {
    bottom: 0.5rem;
  }
}

/* ---------- Login ---------- */
body.login-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1rem;
  background:
    radial-gradient(60rem 30rem at 15% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent),
    radial-gradient(50rem 30rem at 100% 110%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent),
    var(--bg);
}

.login-card {
  width: min(400px, 100%);
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.3rem;
}

.login-brand h1 {
  font-size: 1.3rem;
}

.login-brand .brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.3rem;
}

.login-card .seg {
  display: flex;
  margin-bottom: 1.2rem;
}

.login-card .seg-btn {
  flex: 1;
}

.login-hint {
  margin-bottom: 0.2rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.login-form > button[type="submit"] {
  padding: 0.7rem;
}

/* ---------- Admin ---------- */
.admin-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem;
}

.admin-nav {
  position: sticky;
  top: 4.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  align-self: start;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-weight: 500;
  text-decoration: none;
}

.admin-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.admin-nav a.active {
  background: var(--accent-soft);
  color: var(--text);
}

.admin-nav .count-badge {
  margin-left: auto;
}

.admin-page {
  display: none;
  flex-direction: column;
  gap: 1.2rem;
}

.admin-page.active {
  display: flex;
}

.admin-page > h1 {
  font-size: 1.5rem;
}

.panel {
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel > h2 {
  margin-bottom: 0.7rem;
  font-size: 1rem;
}

.panel > .hint {
  margin-bottom: 0.9rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.8rem;
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat strong {
  font-size: 1.7rem;
  line-height: 1.1;
}

.stat span {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.inbox {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.inbox-empty {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--success);
  font-weight: 500;
}

.row-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.row.is-alert {
  border-color: color-mix(in srgb, var(--warn) 55%, transparent);
  background: color-mix(in srgb, var(--warn) 7%, var(--surface-2));
}

.row-main {
  display: flex;
  flex: 1 1 200px;
  flex-direction: column;
  min-width: 0;
}

.row-main strong {
  overflow-wrap: anywhere;
}

.row-main small {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
}

.row input[type="text"] {
  flex: 1 1 160px;
  width: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.55rem;
  color: var(--text-dim);
  background: var(--surface-3);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill-ok { color: var(--success); background: var(--success-soft); }
.pill-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.pill-bad { color: var(--danger); background: var(--danger-soft); }

.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.35rem;
  background: var(--success);
  border-radius: 50%;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.toolbar input[type="search"] {
  flex: 1 1 220px;
  width: auto;
}

.switch-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.switch-card > span {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.switch-card small {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.8rem;
}

.entry-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.6rem;
  margin: 0.8rem 0;
}

.admin-thumb {
  width: 56px;
  height: 56px;
  flex: none;
  object-fit: cover;
  border-radius: 8px;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.55rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--text-faint);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Kleine Fenster ---------- */
@media (max-width: 820px) {
  .admin-shell {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .admin-nav {
    position: sticky;
    top: 3.6rem;
    z-index: 20;
    flex-direction: row;
    margin: -0.25rem -1.25rem 0;
    padding: 0.4rem 1.25rem;
    overflow-x: auto;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }

  .admin-nav a {
    flex: none;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
  }

  .brand-name,
  .crumb-sep {
    display: none;
  }

  .switch-label {
    max-width: 9rem;
  }

  .page,
  .list-hero {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .tabs {
    padding: 0 0.9rem;
  }

  .library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .list-hero-actions {
    width: 100%;
    justify-content: space-between;
  }

  .modal {
    padding: 1.2rem;
  }

  .modal-head img {
    width: 80px;
    height: 107px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pitch,
  .modal,
  .sheet,
  body.party,
  body.party .card,
  body.party .brand-name,
  body.party .list-hero-text h1 {
    animation: none;
  }

  body.rails-wide .slot,
  .card.clickable,
  .list-card {
    transition: none;
  }
}

/* Kleinigkeiten (statt Inline-Styles, die die Sicherheitsrichtlinie sperrt) */
a.btn {
  text-decoration: none;
}

.align-end {
  align-self: flex-end;
}

.mt {
  margin-top: 0.7rem;
}

.list-hero .avatar-stack .avatar {
  border-color: var(--bg);
}

/* Website-Manager: Aktivität und aufklappbare Listen */
.activity {
  display: flex;
  flex-direction: column;
}

.activity-row {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-icon {
  flex: none;
}

.activity-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.list-admin-card {
  padding: 0.9rem 1rem;
}

.list-admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.list-admin-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

/* Fusszeile, Rechtstexte, Kleinteile */
.site-footer {
  max-width: 1180px;
  margin: 2.5rem auto 1.5rem;
  padding: 0 1.25rem;
  color: var(--text-faint);
  font-size: 0.82rem;
  text-align: center;
}

.site-footer a {
  color: var(--text-dim);
}

.link-button {
  padding: 0;
  background: none;
  border: 0;
  color: var(--accent-hover);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover {
  background: none;
}

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.check-line {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.check-line input {
  flex: none;
  margin-top: 0.15rem;
}

.rec-question {
  padding: 0.6rem 0.8rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

body.legal-body {
  background: var(--bg);
}

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.legal h1 {
  margin: 0.8rem 0 1rem;
  font-size: 1.8rem;
}

.legal h2 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.1rem;
}

.legal p,
.legal li {
  color: var(--text-dim);
}

.legal ul {
  padding-left: 1.2rem;
}

.legal li {
  margin: 0.35rem 0;
}

.legal-nav {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.report-text {
  margin-top: 0.2rem;
  color: var(--text);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* --- Preise, Drei-Punkte-Menue, Bildauswahl --- */
.card-menu-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 3;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: #fff;
  background: rgba(10, 12, 20, 0.62);
  border-color: transparent;
  border-radius: 999px;
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0;
  backdrop-filter: blur(6px);
}

.card-menu-btn:hover,
.card-menu-btn[aria-expanded="true"] {
  color: #fff;
  background: rgba(10, 12, 20, 0.85);
  border-color: transparent;
}

.card:hover .card-menu-btn,
.card:focus-within .card-menu-btn,
.card-menu-btn[aria-expanded="true"] {
  opacity: 1;
}

@media (hover: none) {
  .card-menu-btn {
    opacity: 0.9;
  }
}

.library.compact .card-menu-btn {
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  color: var(--text-dim);
  background: transparent;
  opacity: 0.8;
  backdrop-filter: none;
}

.library.compact .card-menu-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

.library.compact .card {
  padding-right: 2.8rem;
}

.card-menu {
  position: fixed;
  z-index: 80;
  min-width: 15rem;
  max-width: calc(100vw - 1rem);
}

.card-price {
  min-height: 0;
  font-size: 0.82rem;
}

.price-link {
  color: inherit;
  text-decoration: none;
}

.price-link:hover .price-now {
  text-decoration: underline;
}

.price {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.price-now {
  color: var(--text);
  font-weight: 700;
}

.on-sale .price-now {
  color: var(--success);
}

.price-old {
  color: var(--text-faint);
  font-size: 0.78rem;
}

.price-discount {
  align-self: center;
  padding: 0.05rem 0.4rem;
  color: #fff;
  background: var(--success);
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
}

.library.compact .card-body {
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "title price foot" "meta price foot";
}

.library.compact .card-price {
  grid-area: price;
  align-self: center;
  text-align: right;
}

.price-history {
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

.price-history h3 {
  margin-bottom: 0.7rem;
  font-size: 1rem;
}

.price-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.price-stat {
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.7rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.price-stat strong {
  font-size: 1.15rem;
}

.price-chart {
  display: block;
  width: 100%;
  height: auto;
}

.pc-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.pc-label {
  fill: var(--text-faint);
  font-size: 11px;
}

.pc-area {
  fill: var(--accent-soft);
}

.pc-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.pc-dot {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}

.pc-dot.sale {
  stroke: var(--success);
}

.image-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.image-option {
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.4rem;
  text-align: center;
  font-size: 0.78rem;
}

.image-option img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--surface-3);
  border-radius: 8px;
}

.image-option img.wide {
  aspect-ratio: 16 / 9;
}

.image-option.current {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  max-width: calc(100vw - 2rem);
  padding: 0.6rem 1rem;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  transform: translateX(-50%);
}

.toast-error {
  color: var(--danger);
  border-color: var(--danger);
}

.copy-helper {
  position: fixed;
  left: -9999px;
  top: 0;
}

/* Schmale Karten (Handy, 2 Spalten): Avatare oben, Abstimm-Knoepfe in voller Breite darunter */
.card-foot {
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .library:not(.compact) .vote-row {
    width: 100%;
    margin-left: 0;
  }

  .library:not(.compact) .vote-btn,
  .library:not(.compact) .dislike-btn {
    flex: 1;
  }

  /* Kompakte Liste auf dem Handy: Preis unter dem Titel statt als eigene Spalte */
  .library.compact .card-body {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title foot" "meta foot" "price foot";
  }

  .library.compact .card-price {
    text-align: left;
  }

  .library.compact .card-foot .avatar-stack {
    display: none;
  }
}
