/* Shitportal
   Klar und neutral: Graphit und Weiß, Gelb als einziger Farbakzent
   (Platz 1, Schiss des Monats, Einjeschissn). Tasten mit Hub und Federung. */

@font-face {
  font-family: "Barlow";
  src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/fonts/barlow-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-latin-800-normal.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}

:root {
  --yellow: #f4c300;
  --accent: #2b2f33;      /* Graphit: Hauptaktionen, Karten */
  --accent-2: #16191c;
  --sign-black: #000;
  --sign-white: #fff;
  --red: #d7381a;

  --bg: #eceef0;
  --surface: #ffffff;
  --surface-2: #f2f4f5;
  --ink: #16191c;
  --ink-soft: #5d646b;
  --line: #d5d9dd;
  --hair: rgba(22, 25, 28, .08);
  --toast-bg: #16191c;
  --toast-ink: #f4f5f6;

  /* Tasten: helle Standardtaste */
  --key-top: #ffffff;
  --key-bot: #eef0f2;
  --key-ink: var(--ink);
  --key-hi: rgba(255, 255, 255, .9);
  --key-edge: rgba(22, 25, 28, .14);
  --key-depth: rgba(22, 25, 28, .18);

  /* Graphit-Taste */
  --dark-top: #3a3f45;
  --dark-bot: #1f2327;
  --dark-depth: #0d0f11;

  --shadow-panel: 0 0 0 1px var(--hair), 0 1px 2px rgba(22, 25, 28, .04), 0 16px 32px -26px rgba(22, 25, 28, .35);
  --shadow-float: 0 2px 4px rgba(22, 25, 28, .06), 0 24px 48px -22px rgba(22, 25, 28, .4);

  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  --r-plate: 22px;
  --r-key: 14px;
  --r-field: 12px;

  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sign: "Barlow Condensed", "Arial Narrow", sans-serif;

  --tabs-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #e9ecef;
    --accent-2: #ffffff;
    --bg: #121416;
    --surface: #1c1f22;
    --surface-2: #17191c;
    --ink: #eef0f2;
    --ink-soft: #a2a9b0;
    --line: #33383d;
    --hair: rgba(255, 255, 255, .07);
    --toast-bg: #eef0f2;
    --toast-ink: #121416;
    --key-top: #2c3135;
    --key-bot: #22262a;
    --key-hi: rgba(255, 255, 255, .08);
    --key-edge: rgba(0, 0, 0, .55);
    --key-depth: rgba(0, 0, 0, .6);
    --dark-top: #f4f6f7;
    --dark-bot: #d9dde1;
    --dark-depth: #8f969c;
    --shadow-panel: 0 0 0 1px var(--hair), 0 16px 32px -24px rgba(0, 0, 0, .8);
    --shadow-float: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.booting .app, body.booting .login { visibility: hidden; }

.app {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: minmax(0, 1fr); /* breite Inhalte (z. B. Tab-Leisten) dürfen die Seite nicht verbreitern */
}
.app[hidden], .login[hidden] { display: none; }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
::selection { background: rgba(244, 195, 0, .45); }

.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;
}

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 10;
  background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 6px;
}
.skip:focus { top: 8px; }

/* ---------- Kopf ---------- */

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) var(--gutter) 10px;
}

.brand {
  margin: 0;
  font-family: var(--font-sign);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: .01em;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 0;
}

.sync {
  font-size: .8125rem;
  color: var(--ink-soft);
  min-height: 1em;
}

main {
  min-height: 0;
  padding-bottom: calc(var(--tabs-h) + var(--safe-b));
}

.view[hidden] { display: none !important; }


/* ---------- Seiten ---------- */

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px var(--gutter) 32px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 0;
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: 2.5rem;
  line-height: 1;
}

.block { margin-top: 32px; }
.block:first-child { margin-top: 0; }

.block h2 {
  margin: 0 0 12px;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Leerer Zustand */
.empty {
  padding: 32px 0;
}
.empty p { margin: 0 0 16px; font-size: 1.125rem; }
.empty-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-key);
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Regeln ---------- */

.rules {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: para;
}
.rules > li {
  counter-increment: para;
  display: grid;
  grid-template-columns: 3rem 1fr;
  column-gap: 8px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.rules > li:last-child { border-bottom: 1px solid var(--line); }
.rules > li::before {
  content: "§\00a0" counter(para);
  grid-row: 1 / span 3;
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--ink-soft);
}
.rules h2 {
  margin: 0 0 4px;
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.1;
}
.rules p { margin: 0; max-width: 34em; }

/* ---------- Kopf: Konto und Admin ---------- */

.top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.top-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  min-width: 40px;
  justify-content: center;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: .9375rem;
}
.top-link span {
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-link svg {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.top-link[aria-current="page"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.top-gear[hidden] { display: none; }
.top { align-items: center; padding-top: calc(env(safe-area-inset-top, 0px) + 8px); padding-bottom: 6px; }
.sync:empty { display: none; }
.sync { margin-right: 4px; }

/* ---------- Formulare ---------- */

.form { display: grid; gap: 16px; max-width: 420px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: .9375rem; }
.field small { color: var(--ink-soft); font-size: .8125rem; }
.field input, .field select {
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-field);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem; /* verhindert Auto-Zoom auf iOS */
  box-shadow: inset 0 1px 2px rgba(20, 24, 22, .07);
  transition: border-color 160ms, box-shadow 200ms var(--ease-out);
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 1px 2px rgba(20, 24, 22, .07), 0 0 0 4px rgba(244, 195, 0, .35);
}
.field input[type="number"] { max-width: 160px; }
.field input::placeholder { color: var(--ink-soft); opacity: .8; }

.check { display: flex; align-items: center; gap: 10px; font-weight: 500; min-height: 40px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }

.form-error {
  margin: 0;
  padding: 11px 14px;
  border-radius: var(--r-field);
  background: #fbe3dd;
  color: #7a1d0c;
  font-weight: 500;
}
.form-error[hidden] { display: none; }
.hint { margin: 0; color: var(--ink-soft); font-size: .9375rem; }
.hint[hidden] { display: none; }
.form-info {
  margin: 0;
  padding: 11px 14px;
  border-radius: var(--r-field);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  font-weight: 500;
}
.form-info[hidden] { display: none; }
.login .btn[hidden] { display: none; }

.top-gear { position: relative; }
.badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #c4300f;
  color: #fff;
  font-size: .6875rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.badge[hidden] { display: none; }

.requests li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 0;
}
.requests .r-actions { display: flex; gap: 8px; }
.block[hidden] { display: none; }

/* ---------- Tasten ----------
   Gemeinsame Mechanik: Lichtkante oben, Hub nach unten, beim Drücken sinkt die Taste ein
   und federt beim Loslassen zurück. Farben kommen über --key-* */

.btn, .vote, .undo-btn, .toast-action, .empty-link, .play {
  position: relative;
  border: 0;
  color: var(--key-ink);
  background: linear-gradient(180deg, var(--key-top), var(--key-bot));
  box-shadow:
    inset 0 1px 0 var(--key-hi),
    inset 0 0 0 1px var(--key-edge),
    0 2px 0 var(--key-depth),
    0 10px 18px -12px rgba(20, 24, 22, .5);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 260ms var(--ease-spring), box-shadow 200ms var(--ease-out), filter 160ms;
}
.btn:active:not(:disabled), .vote:active, .undo-btn:active, .toast-action:active, .empty-link:active, .play:active {
  transform: translateY(2px) scale(.98);
  box-shadow:
    inset 0 1px 0 var(--key-hi),
    inset 0 0 0 1px var(--key-edge),
    0 0 0 var(--key-depth),
    0 4px 10px -8px rgba(20, 24, 22, .5);
  transition-duration: 70ms;
}
@media (hover: hover) {
  .btn:hover:not(:disabled), .vote:hover, .undo-btn:hover, .toast-action:hover, .empty-link:hover, .play:hover { filter: brightness(1.04); }
}

/* Graphit: Hauptaktion (im Dunkelmodus hell) */
.btn-primary, .empty-link, .play {
  --key-top: var(--dark-top);
  --key-bot: var(--dark-bot);
  --key-ink: var(--surface);
  --key-hi: rgba(255, 255, 255, .16);
  --key-edge: rgba(0, 0, 0, .35);
  --key-depth: var(--dark-depth);
}

.btn {
  min-height: 50px;
  padding: 0 22px;
  border-radius: var(--r-key);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: .005em;
}
.btn-small { min-height: 40px; padding: 0 15px; border-radius: 11px; font-size: .9375rem; }
.btn-danger { --key-ink: #b02a10; }
.btn:disabled { opacity: .5; cursor: default; }

@media (prefers-color-scheme: dark) {
  .btn-danger { --key-ink: #ff9a85; }
}

/* ---------- Anmeldung ---------- */

.login {
  min-height: 100dvh;
  display: grid;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) var(--gutter) calc(var(--safe-b) + 24px);
}
.login-inner { width: 100%; max-width: 420px; margin: 0 auto; }
.login-sign {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin-bottom: 36px;
  padding: 30px 16px 24px;
  border-radius: 26px;
  background: linear-gradient(160deg, #3a3f45 0%, #1f2327 100%);
  color: var(--sign-white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), var(--shadow-float);
  text-align: center;
}
.login-sign::after {
  content: "";
  width: 44px;
  height: 4px;
  margin-top: 12px;
  border-radius: 2px;
  background: var(--yellow);
}
.login-sign-name {
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: clamp(2.25rem, 12vw, 3.25rem);
  line-height: 1;
}
.login-sign-sub {
  font-family: var(--font-sign);
  font-weight: 600;
  font-size: 1.125rem;
  opacity: .8;
}
.login .btn { width: 100%; }

.force-title {
  margin: 0 0 8px;
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: 2.25rem;
  line-height: 1.05;
}
.force-text { margin: 0 0 24px; font-size: 1.0625rem; }

/* ---------- Konto ---------- */

.whoami { margin: 0; font-size: 1.0625rem; }
.whoami span { color: var(--ink-soft); }
.whoami-login { margin: 4px 0 0; color: var(--ink-soft); }
.whoami-login[hidden] { display: none; }


/* ---------- Ranking ---------- */

.rk-month { margin: 0; font-size: 1.0625rem; font-weight: 600; color: var(--ink-soft); }

.podium {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}
.podium[hidden] { display: none; }
.pod { display: flex; flex-direction: column; min-width: 0; text-align: center; }
.pod-pos-1 { order: 2; }
.pod-pos-2 { order: 1; }
.pod-pos-3 { order: 3; }
.pod-name {
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pod-sum {
  margin: 2px 0 8px;
  color: var(--ink-soft);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.pod-block {
  display: flex;
  border-radius: 18px 18px 8px 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 0 0 1px rgba(0, 0, 0, .18), var(--shadow-float);
  transform-origin: bottom center;
  animation: pod-rise 620ms var(--ease-spring) both;
}
.pod-pos-2 .pod-block { animation-delay: 80ms; }
.pod-pos-3 .pod-block { animation-delay: 160ms; }
@keyframes pod-rise { from { transform: scaleY(.4); opacity: 0; } }
.pod-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
}
.pod-rank { font-family: var(--font-sign); font-weight: 800; font-size: 2.75rem; line-height: 1; text-shadow: 0 1px 0 rgba(255, 255, 255, .25); }
.pod.me .pod-inner::after {
  content: "du";
  padding: 1px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
  color: #fff;
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.5;
}
.pod-1 .pod-block { height: 150px; background: linear-gradient(180deg, #ffd84d, #e5b400); color: #2b1b00; }
.pod-1 .pod-rank { font-size: 3.5rem; }
.pod-2 .pod-block { height: 112px; background: linear-gradient(180deg, #3a3f45, #1f2327); color: var(--sign-white); }
.pod-2 .pod-rank { text-shadow: none; }
.pod-3 .pod-block { height: 92px; background: linear-gradient(180deg, #e3e7ea, #c3c9ce); color: #16191c; }
.pod.free .pod-name { color: var(--ink-soft); font-weight: 500; }
.pod.free .pod-block { opacity: .28; box-shadow: none; animation: none; }

.ranks, .history { list-style: none; margin: 0; padding: 0; }
.ranks li {
  display: grid;
  grid-template-columns: 1.75em minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.ranks li:last-child { border-bottom: 1px solid var(--line); }
.r-rank { font-family: var(--font-sign); font-weight: 800; font-size: 1.25rem; color: var(--ink-soft); }
.r-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-sum { font-variant-numeric: tabular-nums; }
.ranks .me .r-name::after { content: " (du)"; font-weight: 500; color: var(--ink-soft); }

.rk-reset { margin: 20px 0 0; color: var(--ink-soft); font-size: .9375rem; }
.rk-history { margin-top: 40px; }

.history li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.history li:last-child { border-bottom: 1px solid var(--line); }
.h-month { grid-column: 1 / -1; color: var(--ink-soft); font-size: .875rem; font-weight: 600; }
.h-name { font-weight: 700; font-size: 1.0625rem; overflow-wrap: anywhere; }
.h-name::before {
  content: "1";
  display: inline-grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  margin-right: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd84d, #e5b400);
  color: #2b1b00;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 0 #9c7700;
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: .9375rem;
  vertical-align: 1px;
}
.h-sum { color: var(--ink-soft); font-size: .9375rem; font-variant-numeric: tabular-nums; white-space: nowrap; }


/* ---------- Admin ---------- */

.u-rename { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px; padding: 0 0 14px; max-width: 480px; }
.u-rename .field { flex: 1 1 200px; }
.u-rename .btn { margin-top: 27px; }

.credential {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  max-width: 420px;
}
.credential[hidden] { display: none; }
.credential p { margin: 0 0 8px; }
.credential .pw {
  display: inline-block;
  margin-right: 8px;
  padding: 4px 10px;
  border-radius: 9px;
  background: var(--surface-2);
  box-shadow: inset 0 1px 2px rgba(20, 24, 22, .1);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: .04em;
  user-select: all;
  -webkit-user-select: all;
}
.credential small { display: block; margin-top: 8px; color: var(--ink-soft); }

.users {
  list-style: none;
  margin: 0;
  padding: 0 14px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}
.users:empty { display: none; }
.users > li + li { border-top: 1px solid var(--hair); }
.users summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
}
.users summary::-webkit-details-marker { display: none; }
.users summary::after {
  content: "";
  width: 10px; height: 10px;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg) translateY(-3px);
  grid-row: 1 / span 2;
  grid-column: 2;
}
.users details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.u-name { font-weight: 600; font-size: 1.0625rem; }
.u-meta { grid-column: 1; color: var(--ink-soft); font-size: .875rem; }
.u-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  vertical-align: 2px;
  background: var(--ink);
  color: var(--bg);
}
.u-tag.locked { background: #a3260f; color: #fff; }
.u-tag.pending { background: var(--yellow); color: var(--sign-black); }
.u-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 14px; }
.u-actions .credential { flex-basis: 100%; margin-top: 4px; }

@media (prefers-color-scheme: dark) {
  .form-error { background: #4a1d14; color: #ffd9cf; }
  .u-tag.locked { background: #ff9a85; color: #2a2d2c; }
}


/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  z-index: 20;
  min-height: 56px;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 18px;
  border-radius: 18px;
  background: var(--toast-bg);
  color: var(--toast-ink);
  box-shadow: var(--shadow-float);
  animation: toast-in 420ms var(--ease-spring);
}
.toast[hidden] { display: none; }
.toast-text { font-weight: 500; line-height: 1.35; }
.toast-action {
  --key-top: #ffd84d;
  --key-bot: #ebb900;
  --key-ink: #2b1b00;
  --key-hi: rgba(255, 255, 255, .6);
  --key-edge: rgba(120, 80, 0, .4);
  --key-depth: #9c7700;
  flex: none;
  font-weight: 600;
  padding: 0 16px;
  border-radius: 11px;
  min-height: 40px;
}

@keyframes toast-in {
  from { transform: translateY(-16px) scale(.96); opacity: 0; }
  to   { transform: none; opacity: 1; }
}


/* ---------- Tab-Leiste ---------- */

.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tabs a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .8125rem;
  font-weight: 500;
}
.tabs svg {
  width: 26px; height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tabs a[aria-current="page"] svg { stroke-width: 2.2; }
.tabs a:focus-visible { outline-offset: -4px; }
.tabs .badge { top: 6px; right: calc(50% - 24px); }

.sheet {
  border: 0;
  padding: 0;
  color: var(--ink);
  background: var(--bg);
}
.sheet::backdrop {
  background: rgba(14, 16, 15, .5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.sheet {
  width: min(480px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 32px);
  border-radius: 24px;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  box-shadow: var(--shadow-float);
}
.sheet[open] { animation: sheet-in 380ms var(--ease-spring); }
.sheet[open]::backdrop { animation: fade-in 240ms var(--ease-out); }
@keyframes sheet-in {
  from { transform: translateY(24px) scale(.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@keyframes fade-in { from { opacity: 0; } }
.sheet .form { padding: 20px var(--gutter) 20px; max-width: none; }
.sheet-title {
  margin: 0;
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
}

.ap-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.ap-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ap-bar [hidden] { display: none; }

/* ---------- Admin: Unter-Tabs ---------- */

.subtabs {
  display: flex;
  gap: 4px;
  margin: 0 0 20px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: inset 0 1px 3px rgba(20, 24, 22, .12), inset 0 0 0 1px var(--hair);
}
.subtabs::-webkit-scrollbar { display: none; }
.subtabs [role="tab"] {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 200ms var(--ease-out), color 200ms, box-shadow 200ms, transform 260ms var(--ease-spring);
}
.subtabs [role="tab"]:active { transform: scale(.97); }
.subtabs [role="tab"][aria-selected="true"] {
  color: var(--ink);
  background: linear-gradient(180deg, var(--key-top), var(--key-bot));
  box-shadow: inset 0 1px 0 var(--key-hi), inset 0 0 0 1px var(--key-edge), 0 2px 6px -2px rgba(20, 24, 22, .3);
}
.subtabs [role="tab"]:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.subtab-badge {
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #c4300f;
  color: #fff;
  font-size: .6875rem;
  line-height: 18px;
  text-align: center;
}
.subtab-badge[hidden] { display: none; }
.admin-panel[hidden] { display: none; }
.admin-panel > .hint:first-child { margin-bottom: 12px; }
.empty-note { margin: 16px 0; color: var(--ink-soft); font-size: 1.0625rem; }
.empty-note[hidden] { display: none; }

.create-box {
  margin-bottom: 20px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}
.create-box summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  transition: background 160ms;
}
.create-box summary:active { background: var(--surface-2); }
.create-box summary::-webkit-details-marker { display: none; }
.create-box summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(180deg, var(--dark-top), var(--dark-bot));
  color: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 2px 0 var(--dark-depth);
  font-size: 1.125rem;
  line-height: 1;
}
.create-box[open] summary::before { content: "−"; }
.create-box .form { padding: 4px 14px 16px; }
.create-box .credential { margin: 0 14px 16px; }

/* ---------- Regeln bestätigen ---------- */

.rules-sheet { width: min(560px, calc(100vw - 2 * var(--gutter))); overflow: hidden; }
.rules-sheet-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
}
.rules-sheet-head { flex: none; padding: 20px var(--gutter) 8px; }
.rules-sheet-head .hint { margin-top: 6px; }
.rules-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 var(--gutter) 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.rules-sheet-body .rules { margin-top: 8px; }
.rules-sheet-body .definition { margin-top: 32px; }
.rules-sheet-body .definition h2 { font-size: 1.75rem; }
.rules-sheet-actions { flex: none; display: grid; gap: 8px; padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom, 0px)); }
.captcha { min-height: 65px; }
.captcha[hidden] { display: none; }
.captcha-setup { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.captcha-setup h3 { margin: 0 0 6px; font-size: 1.0625rem; }
.captcha-setup .form { margin-top: 14px; }
.captcha-status { margin: 10px 0 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.captcha-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.captcha-status.on::before { background: #2f9e44; box-shadow: 0 0 0 3px rgba(47, 158, 68, .2); }
.captcha-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rules-reset { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.rules-reset h3 { margin: 0 0 6px; font-size: 1.0625rem; }
.rules-reset .btn { margin-top: 10px; }
/* ---------- Aufnehmen ---------- */

.view-record {
  min-height: calc(100dvh - var(--tabs-h) - var(--safe-b) - 64px);
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px var(--gutter) 12px;
}
.view-record[hidden] { display: none; }

/* Aufnahmebereich mit Frequenzkranz als Canvas hinter dem Knopf */
.recorder {
  --dx: 0px;
  flex: 1 1 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 340px;
  padding: 18px 0;
  border-radius: var(--r-plate);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  isolation: isolate;
}
.recorder > :not(.rec-viz) { position: relative; z-index: 1; }
.rec-viz {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 280ms var(--ease-out);
}
.recorder[data-state="recording"] .rec-viz,
.recorder[data-state="locked"] .rec-viz { opacity: 1; }
.rec-status {
  margin: 0;
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.1;
  text-align: center;
}
.rec-live {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.rec-time { font-size: 1.125rem; }
.rec-hz { color: var(--ink-soft); font-size: .875rem; min-width: 6.5em; }
.rec-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(207, 53, 23, .2);
  animation: rec-blink 1.1s ease-in-out infinite;
}
@keyframes rec-blink { 50% { opacity: .25; } }
.rec-cancel-hint {
  display: none;
  margin: 0;
  color: var(--ink-soft);
  font-weight: 600;
  transform: translateX(calc(var(--dx) * .5));
}
.rec-lock {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  color: var(--ink-soft);
  font-size: .8125rem;
  font-weight: 600;
}
.rec-lock svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  animation: nudge 1.2s ease-in-out infinite;
}
@keyframes nudge { 50% { transform: translateY(-4px); } }

/* Aufnahmeknopf: gewölbte Graphit-Taste mit hellem Ring */
.mic {
  position: relative;
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 28%, #4a5057 0%, #2b2f33 50%, #16191c 100%);
  color: var(--sign-white);
  box-shadow:
    0 0 0 8px var(--surface),
    0 0 0 9px var(--hair),
    inset 0 2px 1px rgba(255, 255, 255, .18),
    inset 0 -6px 14px rgba(0, 0, 0, .35),
    0 4px 0 9px var(--key-depth),
    0 24px 36px -16px rgba(22, 25, 28, .55);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 320ms var(--ease-spring), box-shadow 200ms var(--ease-out);
}
.mic svg {
  width: 58px; height: 58px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35));
}
.mic:active, .recorder[data-state="starting"] .mic {
  transform: translateY(3px) scale(.97);
  box-shadow:
    0 0 0 8px var(--surface),
    0 0 0 9px var(--hair),
    inset 0 2px 1px rgba(255, 255, 255, .14),
    inset 0 -2px 10px rgba(0, 0, 0, .45),
    0 1px 0 9px var(--key-depth),
    0 10px 20px -14px rgba(22, 25, 28, .6);
  transition-duration: 80ms;
}
.mic:disabled { opacity: .6; cursor: default; }
.rec-locked-actions { display: none; gap: 10px; }
.rec-hint { text-align: center; padding: 0 16px; }

.recorder[data-state="recording"] .mic,
.recorder[data-state="locked"] .mic {
  background: radial-gradient(circle at 50% 28%, #ff7a52 0%, #d8401c 45%, #8f220b 100%);
  animation: rec-glow 1.6s ease-in-out infinite;
}
.recorder[data-state="recording"] .mic { transform: translateX(var(--dx)) translateY(3px) scale(1.02); transition: none; }
@keyframes rec-glow {
  0%, 100% { box-shadow: 0 0 0 8px var(--surface), 0 0 0 9px rgba(216, 64, 28, .35), inset 0 2px 1px rgba(255, 255, 255, .3), inset 0 -6px 14px rgba(0, 0, 0, .3); }
  50%      { box-shadow: 0 0 0 8px var(--surface), 0 0 0 22px rgba(216, 64, 28, 0), inset 0 2px 1px rgba(255, 255, 255, .3), inset 0 -6px 14px rgba(0, 0, 0, .3); }
}
.recorder[data-state="recording"] .rec-live,
.recorder[data-state="locked"] .rec-live { display: flex; }
.recorder[data-state="recording"] .rec-cancel-hint { display: block; }
.recorder[data-state="recording"] .rec-lock { display: flex; }
.recorder[data-state="locked"] .rec-locked-actions { display: flex; }
.recorder[data-state="locked"] .rec-hint,
.recorder[data-state="recording"] .rec-hint { visibility: hidden; }
.recorder[data-state="sending"] .rec-status { color: var(--ink-soft); }
.recorder[data-state="sending"] .mic { animation: sending 900ms ease-in-out infinite; }
@keyframes sending { 50% { transform: scale(.95); filter: brightness(.9); } }

/* ---------- Letzte Aufnahme ---------- */

.undo-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 8px 8px 8px 16px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}
.undo-text {
  flex: 1;
  margin: 0;
  font-size: .9375rem;
  line-height: 1.3;
  color: var(--ink-soft);
}
.undo-text b { color: var(--ink); font-weight: 600; }
.undo-play:empty { display: none; }
.undo-btn {
  flex: none;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 12px;
  font-weight: 600;
}
.undo-btn.confirm { --key-top: #e0482a; --key-bot: #b52d12; --key-ink: #fff; --key-hi: rgba(255, 255, 255, .25); --key-edge: rgba(90, 20, 5, .5); --key-depth: #7a1e0b; }
.undo-btn[hidden] { display: none; }

/* ---------- Abspielen ---------- */

.player {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.play {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}
.play svg { width: 20px; height: 20px; fill: currentColor; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); }
.play .i-play { transform: translateX(1px); }
.play .i-pause { display: none; }
.player.playing .play .i-play { display: none; }
.player.playing .play .i-pause { display: inline; }
.wave {
  --p: 0%;
  position: relative;
  flex: 1 1 auto;
  min-width: 60px;
  height: 36px;
}
.wave .bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
.wave .bars i {
  flex: 1 1 0;
  min-width: 1px;
  border-radius: 99px;
  background: var(--line);
}
.wave .bars.fill { clip-path: inset(0 calc(100% - var(--p)) 0 0); }
.wave .bars.fill i { background: var(--accent); }
.dur {
  flex: none;
  min-width: 3.4em;
  text-align: right;
  font-size: .875rem;
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.player-mini .play { width: 40px; height: 40px; }
.player-big .play { width: 64px; height: 64px; }
.player-big .play svg { width: 28px; height: 28px; }
.player-big .wave { height: 64px; cursor: pointer; }
.player-big .wave .bars { gap: 3px; }
.player.playing .play { animation: play-breath 1.8s ease-in-out infinite; }
@keyframes play-breath { 50% { filter: brightness(1.12); } }


/* ---------- Swipe ---------- */

.deck {
  --pull: 0;
  position: relative;
  width: 100%;
  max-width: 440px;
  height: min(380px, calc(100dvh - var(--tabs-h) - var(--safe-b) - 320px));
  min-height: 280px;
  margin: 4px auto 0;
}
.deck[hidden] { display: none; }
.card {
  position: absolute;
  inset: 0;
  display: flex;
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 18% 0%, rgba(255, 255, 255, .1) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(165deg, #3d4248 0%, #25292d 55%, #16191c 100%);
  color: var(--sign-white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 0 0 1px rgba(0, 0, 0, .3), var(--shadow-float);
  touch-action: none; /* alle Richtungen fürs Swipen, auch nach oben */
  user-select: none;
  -webkit-user-select: none;
  transition: transform 520ms var(--ease-spring), filter 300ms var(--ease-out);
  will-change: transform;
}
/* Die Karte darunter rückt beim Ziehen nach vorn (--pull 0…1, per Skript) */
.card:not(.is-top) {
  transform: translateY(calc(16px - 16px * var(--pull))) scale(calc(.93 + .07 * var(--pull)));
  filter: brightness(calc(.78 + .22 * var(--pull)));
  transition: transform 300ms var(--ease-out), filter 300ms var(--ease-out);
}
.deck.dragging .card:not(.is-top) { transition: none; }
.card.is-top { cursor: grab; animation: card-in 420ms var(--ease-spring); }
.card.is-top:active { cursor: grabbing; }
@keyframes card-in { from { transform: translateY(16px) scale(.93); filter: brightness(.78); } }
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 26px 22px;
}
.card-who {
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: 2.125rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.card-when { opacity: .78; font-weight: 500; margin-bottom: 20px; }
.card .play {
  --key-top: #ffffff;
  --key-bot: #e6e9ec;
  --key-ink: #16191c;
  --key-hi: rgba(255, 255, 255, 1);
  --key-edge: rgba(0, 0, 0, .25);
  --key-depth: rgba(0, 0, 0, .35);
}
.card .play svg { filter: none; }
.card .wave .bars i { background: rgba(255, 255, 255, .26); }
.card .wave .bars.fill i { background: var(--sign-white); }
.card .dur { color: rgba(255, 255, 255, .8); }

/* Stempel wie Gummistempel: Rahmen in Farbe, leicht transparent */
.stamp {
  position: absolute;
  top: 24px;
  padding: 5px 14px 3px;
  border: 3px solid currentColor;
  border-radius: 12px;
  background: rgba(0, 0, 0, .18);
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: 2.125rem;
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.stamp-furz { right: 20px; font-size: 1.75rem; transform: rotate(10deg); color: #c9ced3; }
.stamp-ultra { left: 20px; transform: rotate(-10deg); color: var(--sign-white); }
.stamp-schiss {
  top: auto;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  color: var(--yellow);
  font-size: 1.875rem;
}

/* Drei Bewertungstasten */
.deck-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 440px;
  margin: 18px auto 0;
}
.deck-actions[hidden] { display: none; }
.vote {
  min-height: 64px;
  border-radius: 18px;
  font-family: var(--font-sign);
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 1.125rem;
  line-height: 1.1;
  padding: 7px 4px;
}
.vote-furz {
  --key-bot: var(--surface-2);
  --key-top: var(--surface);
  --key-ink: var(--ink);
  --key-hi: rgba(255, 255, 255, .9);
  --key-edge: rgba(22, 25, 28, .16);
  --key-depth: rgba(22, 25, 28, .24);
}
.vote-schiss {
  --key-top: #ffd84d;
  --key-bot: #ebb900;
  --key-ink: #2b1b00;
  --key-hi: rgba(255, 255, 255, .7);
  --key-edge: rgba(120, 80, 0, .45);
  --key-depth: #9c7700;
}
.vote-ultra {
  --key-top: var(--dark-top);
  --key-bot: var(--dark-bot);
  --key-ink: var(--surface);
  --key-hi: rgba(255, 255, 255, .16);
  --key-edge: rgba(0, 0, 0, .35);
  --key-depth: var(--dark-depth);
}
.vote-arrow { font-family: var(--font); font-size: 1.125rem; line-height: 1; opacity: .7; }
.deck-hint { max-width: 440px; margin: 14px auto 0; text-align: center; font-size: .875rem; }
#sw-play[hidden] { display: none; }
.more-btn { display: block; margin: 16px auto 0; }
.more-btn[hidden] { display: none; }

/* ---------- Listen ---------- */
/* Eine Tafel pro Liste, Trennlinien eingerückt */

.rec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}
.rec-list:empty { display: none; }
.rec-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  transition: background 160ms;
}
.rec-item + .rec-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 70px;
  right: 0;
  border-top: 1px solid var(--hair);
}
.rec-item:has(.rec-meta:active) { background: var(--surface-2); }
.rec-item > .player { display: contents; }
.rec-item .play { order: 0; }
.rec-item .rec-meta { order: 1; }
.rec-item .wave { order: 2; flex: 0 0 96px; min-width: 0; height: 30px; }
.rec-item .dur { order: 3; min-width: 2.8em; }
.rec-check { order: -1; }
.rec-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.rec-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-who.anon { font-style: italic; color: var(--ink-soft); }
.rec-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .8125rem; }
.rec-when { color: var(--ink-soft); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px 1px 7px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .75rem;
  line-height: 1.6;
  white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.chip-furz { background: var(--surface-2); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--line); }
.chip-ultra { background: #2b2f33; color: #fff; }
.chip-schiss { background: var(--yellow); color: #2b1b00; }
.rec-check { display: none; flex: none; width: 22px; height: 22px; accent-color: var(--accent); }
.rec-list.selecting .rec-check { display: block; }

@media (prefers-color-scheme: dark) {
  .chip-ultra { background: #e9ecef; color: #16191c; }
}
@media (max-width: 480px) {
  .rec-item .wave { display: none; }
}

/* ---------- Detailansicht ---------- */

.detail { width: min(520px, calc(100vw - 2 * var(--gutter))); }
.detail-inner { display: grid; gap: 12px; padding: 24px 20px 20px; }
.detail-inner p { margin: 0; }
.detail-votes { color: var(--ink-soft); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* ---------- Schiss des Monats ---------- */

.sdm { margin-bottom: 32px; }
.sdm-title {
  margin: 0 0 12px;
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1;
}
.sdm-current { display: grid; gap: 14px; }
.sdm-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--yellow), var(--shadow-panel);
}
.sdm-card.big {
  padding: 18px;
  border-radius: 22px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(244, 195, 0, .16) 0%, rgba(244, 195, 0, 0) 60%),
    var(--surface);
  box-shadow: inset 0 0 0 2px var(--yellow), 0 0 0 5px rgba(244, 195, 0, .22), var(--shadow-float);
}
.sdm-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.sdm-count {
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--yellow);
  color: #2b1b00;
  font-size: .875rem;
  font-weight: 800;
  white-space: nowrap;
}
.sdm-by { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sdm-card:not(.big) { grid-template-columns: auto minmax(0, 1fr); align-items: center; padding: 8px; }
.sdm-card:not(.big) .sdm-meta { flex-direction: column; align-items: flex-start; gap: 2px; font-size: .875rem; }
.sdm-meta { align-items: center; }
.rk-sub {
  margin: 0;
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1;
}
.sdm-history { list-style: none; margin: 0; padding: 0; }
.sdm-history li { padding: 12px 0; border-top: 1px solid var(--line); }
.sdm-history li:last-child { border-bottom: 1px solid var(--line); }
.sdm-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 6px; }

/* ---------- Admin ---------- */

.threshold { display: grid; justify-items: start; gap: 10px; margin-top: 16px; }
#setting-usage { margin-top: 12px; }
.r-info { display: grid; }
.admin-panel > .check + .hint { margin: 0 0 4px 32px; font-size: .875rem; }

/* ---------- Kacke-Regen während der Aufnahme ---------- */
.poop-rain {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  pointer-events: none;
}
.poop-drop {
  position: absolute;
  top: -60px;
  line-height: 1;
  will-change: transform;
  animation: poop-fall linear forwards;
}
@keyframes poop-fall {
  to { transform: translate(var(--drift), calc(100vh + 80px)) rotate(var(--spin)); }
}

/* ---------- Seitenwechsel ----------
   Kopf und Tab-Leiste bleiben stehen, nur der Inhalt gleitet in Richtung des Tabs. */
.top { view-transition-name: top; }
.tabs { view-transition-name: tabs; }
::view-transition-group(top), ::view-transition-group(tabs) { animation: none; }
::view-transition-old(root) { animation: vt-out 160ms var(--ease-out) both; }
::view-transition-new(root) { animation: vt-in 300ms var(--ease-out) both; }
[data-nav="back"]::view-transition-old(root) { animation-name: vt-out-back; }
[data-nav="back"]::view-transition-new(root) { animation-name: vt-in-back; }
@keyframes vt-out { to { opacity: 0; transform: translateX(-18px); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(18px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-24px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
