/* Seelensammler – Spieler-App. Mobile first, dunkles Halloween-Theme. */

:root {
  --bg: #0d0a12;
  --surface: #1a1422;
  --surface-2: #241b30;
  --border: #3a2d4a;
  --text: #f3eee8;
  --muted: #a99bb8;
  --pumpkin: #ff7a1a;
  --pumpkin-2: #ffb347;
  --slime: #8be04e;
  --blood: #e5484d;
  --ghost: #c9b8ff;
  /* Kategorien */
  --cat-sneaky: #c9b8ff;
  --cat-open: #ffb347;
  --cat-basics: #8be04e;
  --cat-acroyoga: #ff7a1a;
  --cat-partnerakro: #4ec9e0;

  --gutter: 16px;
  --radius: 18px;
  --radius-sm: 14px;
  --tabbar-h: 64px;
  --font-display: 'Creepster', 'Chiller', fantasy, cursive;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Roboto Mono', monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

[data-cat='sneaky'] { --cat: var(--cat-sneaky); }
[data-cat='open'] { --cat: var(--cat-open); }
[data-cat='basics'] { --cat: var(--cat-basics); }
[data-cat='acroyoga'] { --cat: var(--cat-acroyoga); }
[data-cat='partnerakro'] { --cat: var(--cat-partnerakro); }

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.modal-open,
html.modal-open body {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 var(--font-body);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}

/* Dezentes Kürbis-Leuchten im Hintergrund */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 55% at 50% -12%, rgba(255, 122, 26, 0.16), transparent 62%),
    radial-gradient(90% 45% at 100% 105%, rgba(201, 184, 255, 0.08), transparent 60%);
}

h1, h2, h3, p, ul, ol {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

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

[hidden] {
  display: none !important;
}

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

.offscreen {
  position: fixed;
  top: -1000px;
  left: 0;
  opacity: 0;
}

.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.big { font-size: 1.15rem; font-weight: 700; }

/* ── Header ─────────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: var(--safe-top);
  background: rgba(13, 10, 18, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(58, 45, 74, 0.7);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 560px;
  min-height: 58px;
  margin: 0 auto;
  padding: 6px calc(var(--gutter) + var(--safe-right)) 6px calc(var(--gutter) + var(--safe-left));
}

.brand {
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.85rem;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--pumpkin);
  text-shadow: 0 0 18px rgba(255, 122, 26, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.score-pill.bump {
  animation: bump 0.6s ease;
}

.lang-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.lang-btn:active {
  background: var(--surface-2);
}

.offline-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 4px calc(var(--gutter) + var(--safe-right)) 4px calc(var(--gutter) + var(--safe-left));
  background: var(--blood);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
}

.offline-retry {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-weight: 800;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.main {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px calc(var(--gutter) + var(--safe-right)) calc(28px + var(--safe-bottom)) calc(var(--gutter) + var(--safe-left));
  outline: none;
}

body.has-tabbar .main {
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 28px);
}

.view-enter {
  animation: view-in 0.24s ease-out;
}

.view-loading {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18vh 0 0;
  text-align: center;
}

.loading-ghost {
  font-size: 3.4rem;
}

.card {
  margin: 0 0 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card > * + * {
  margin-top: 10px;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: 0.03em;
  color: var(--ghost);
}

.title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.1rem;
  line-height: 1.1;
  letter-spacing: 0.035em;
  color: var(--pumpkin-2);
}

.title-xl {
  font-size: clamp(2.5rem, 13vw, 3.4rem);
  color: var(--pumpkin);
  text-shadow: 0 0 24px rgba(255, 122, 26, 0.45);
}

.page-title {
  margin: 2px 0 8px;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-error {
  color: #ff8a8d;
  font-weight: 700;
  font-size: 0.95rem;
}

.form-error:empty {
  display: none;
}

/* ── Buttons & Inputs ───────────────────────────────────────────────────── */

.btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 50px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  transition: transform 0.12s ease, filter 0.15s ease, opacity 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, var(--pumpkin-2) 0%, var(--pumpkin) 100%);
  color: #1b0d02;
  box-shadow: 0 8px 26px -10px rgba(255, 122, 26, 0.85);
}

.btn-primary:disabled {
  box-shadow: none;
}

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
}

.btn-ghost {
  background: rgba(201, 184, 255, 0.06);
  border-color: var(--ghost);
  color: var(--ghost);
}

.btn-ghost-muted {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.btn-danger {
  background: var(--blood);
  color: #fff;
}

.btn-xl {
  min-height: 62px;
  font-size: 1.12rem;
  border-radius: 16px;
}

.btn-lg {
  min-height: 56px;
  font-size: 1.08rem;
}

.btn-inline {
  width: auto;
}

.btn.is-busy {
  opacity: 0.8;
  cursor: progress;
}

.btn.is-busy::after {
  content: '';
  flex: none;
  width: 1em;
  height: 1em;
  margin-left: 4px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.input {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #120e19;
  color: var(--text);
  font-size: 1.05rem;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: #6f6280;
}

.input:focus {
  outline: none;
  border-color: var(--pumpkin);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.28);
}

.input-lg {
  min-height: 56px;
  font-size: 1.2rem;
  font-weight: 700;
}

/* ── Chips ──────────────────────────────────────────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--cat, var(--ghost));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  background: color-mix(in srgb, var(--cat, var(--ghost)) 16%, transparent);
  color: var(--cat, var(--ghost));
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.stars {
  color: var(--pumpkin-2);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ── Tabbar ─────────────────────────────────────────────────────────────── */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
  background: rgba(17, 13, 24, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--tabbar-h);
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.tab-icon {
  font-size: 1.45rem;
  line-height: 1;
  filter: grayscale(0.7);
  opacity: 0.75;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.tab[aria-current='page'] {
  color: var(--pumpkin-2);
}

.tab[aria-current='page']::before {
  content: '';
  position: absolute;
  top: 0;
  left: 28%;
  right: 28%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--pumpkin);
  box-shadow: 0 0 12px var(--pumpkin);
}

.tab[aria-current='page'] .tab-icon {
  filter: none;
  opacity: 1;
  transform: translateY(-1px) scale(1.08);
}

.tab-dot {
  position: absolute;
  top: 9px;
  left: calc(50% + 10px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blood);
  box-shadow: 0 0 0 2px var(--bg);
}

/* ── Beitreten ──────────────────────────────────────────────────────────── */

.join-hero {
  text-align: center;
  margin: 6px 0 18px;
}

.join-emoji {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 8px;
}

.join-intro {
  margin-top: 8px;
  color: #dcd3e6;
}

.join-form > .btn {
  margin-top: 6px;
}

.party-note {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: #dcd3e6;
  font-size: 0.95rem;
}

.have-link {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}

.have-link summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--ghost);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.have-link summary::-webkit-details-marker {
  display: none;
}

.have-link summary::before {
  content: '▸';
  display: inline-block;
  width: 1.2em;
  transition: transform 0.15s ease;
}

.have-link[open] summary::before {
  transform: rotate(90deg);
}

.link-form {
  display: grid;
  gap: 10px;
  padding-bottom: 6px;
}

/* ── Vorlieben-Editor ───────────────────────────────────────────────────── */

.prefs {
  display: grid;
  gap: 10px;
}

.disc {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2px 14px;
  transition: border-color 0.2s ease;
}

.disc.is-on {
  border-color: var(--cat);
  padding-bottom: 14px;
}

.disc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  cursor: pointer;
}

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

.disc-title {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  font-size: 1.05rem;
}

.disc.is-on .disc-title {
  color: var(--cat);
}

.switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 31px;
  border-radius: 999px;
  background: var(--border);
  transition: background-color 0.2s ease;
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}

.switch-input:checked + .switch {
  background: var(--cat, var(--pumpkin));
}

.switch-input:checked + .switch::after {
  transform: translateX(21px);
}

.switch-input:focus-visible + .switch {
  outline: 3px solid var(--pumpkin-2);
  outline-offset: 2px;
}

.disc-body {
  display: grid;
  gap: 8px;
}

.disc-body .field-label {
  margin: 6px 0 0;
}

.role-rows {
  display: grid;
  gap: 8px;
}

/* Eine Rolle: Schalter, darunter ihre eigene Stufe */
.role-row {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color 0.15s ease;
}

.role-row.is-on {
  border-color: var(--cat, var(--pumpkin));
}

.chip-btn {
  min-height: 46px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.chip-btn:active {
  transform: scale(0.96);
}

.chip-btn.is-on {
  background: var(--cat, var(--pumpkin));
  border-color: var(--cat, var(--pumpkin));
  color: #140b1c;
}

.role-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  min-width: 132px;
  padding-left: 12px;
}

/* Kästchen links: leer = aus, Haken = an */
.role-check {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--muted);
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1;
}

.role-btn.is-on .role-check {
  border-color: currentColor;
}

/* Stufe als kompakter Dreier-Schalter */
.level-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #120e19;
}

.level-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  min-height: 50px;
  padding: 4px 2px;
  border-radius: 9px;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.level-opt .stars {
  font-size: 0.72rem;
}

.level-opt-name {
  max-width: 100%;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.15;
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: anywhere; /* letzter Ausweg, falls nichts trennt */
}

.level-opt.is-on {
  background: color-mix(in srgb, var(--cat, var(--pumpkin)) 18%, var(--surface-2));
  box-shadow: inset 0 0 0 1px var(--cat, var(--pumpkin));
  color: var(--text);
}

/* Fokusring nur bei Tastaturbedienung, nicht nach Antippen */
.level-opt:has(:focus-visible) {
  outline: 3px solid var(--pumpkin-2);
  outline-offset: 1px;
}

@supports not selector(:has(*)) {
  .level-opt:focus-within {
    outline: 3px solid var(--pumpkin-2);
    outline-offset: 1px;
  }
}

.level-info {
  font-size: 0.86rem;
  line-height: 1.35;
  color: #dcd3e6;
}

.level-ex {
  color: var(--muted);
  font-style: italic;
}

/* ── Mission ────────────────────────────────────────────────────────────── */

.ends-in {
  display: block;
  width: fit-content;
  margin: 0 auto 12px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(201, 184, 255, 0.1);
  border: 1px solid rgba(201, 184, 255, 0.4);
}

.banner p {
  flex: 1 1 200px;
}

.hero-card {
  text-align: center;
  padding: 26px 18px 20px;
}

.hero-card .btn {
  margin-top: 16px;
}

.hero-emoji {
  font-size: 4rem;
  line-height: 1.1;
}

.hero-emoji > span {
  display: inline-block;
}

.hero-ended {
  border-color: rgba(255, 179, 71, 0.6);
  background: linear-gradient(180deg, rgba(255, 179, 71, 0.12), var(--surface) 70%);
}

/* Verschnaufpause nach zu vielen Aufgaben in kurzer Zeit */
.hero-rest {
  border-color: rgba(201, 184, 255, 0.55);
  background: linear-gradient(180deg, rgba(201, 184, 255, 0.12), var(--surface) 70%);
}

.rest-countdown {
  margin: 14px 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ghost);
}

.target-card {
  position: relative;
  text-align: center;
  padding: 18px 16px 20px;
  border-color: rgba(255, 122, 26, 0.55);
  background: linear-gradient(180deg, #2b1913 0%, var(--surface) 85%);
  box-shadow: 0 14px 40px -18px rgba(255, 122, 26, 0.55);
}

.target-name {
  font-size: clamp(2.1rem, 11vw, 3.1rem);
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: #fff;
  overflow-wrap: anywhere;
  text-shadow: 0 0 22px rgba(255, 122, 26, 0.35);
}

.target-card.is-paused {
  border-color: rgba(201, 184, 255, 0.5);
  background: linear-gradient(180deg, #221b33 0%, var(--surface) 85%);
  box-shadow: none;
}

.target-card.is-paused .target-name {
  color: #d9d0e6;
  text-shadow: none;
}

.target-paused {
  color: var(--ghost);
  font-weight: 700;
}

.task-card {
  border-left: 5px solid var(--cat, var(--border));
}

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

.points {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 179, 71, 0.14);
  color: var(--pumpkin-2);
  font-weight: 850;
  white-space: nowrap;
}

.task-title {
  font-size: 1.55rem;
  line-height: 1.15;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.task-desc {
  font-size: 1.04rem;
  color: #e9e2ef;
}

.spotter-bonus {
  color: var(--muted);
  font-size: 0.9rem;
}

.roles {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 1.04rem;
}

.roles strong {
  color: var(--cat, var(--pumpkin-2));
}

.hint {
  padding: 10px 12px;
  border-radius: 12px;
  border-left: 3px solid var(--cat, var(--ghost));
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.96rem;
  color: #e4dcec;
}

.hint-sneaky {
  background: rgba(201, 184, 255, 0.1);
}

.safety {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid rgba(229, 72, 77, 0.65);
  border-radius: 12px;
  background: rgba(229, 72, 77, 0.1);
  color: #ffd9da;
  font-size: 0.95rem;
}

.safety strong {
  color: #ff9a9d;
}

.actions {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.actions-row .btn {
  font-size: 0.94rem;
  padding: 8px 10px;
  min-height: 54px;
}

@media (max-width: 339px) {
  .actions-row {
    grid-template-columns: 1fr;
  }
}

.code-card {
  text-align: center;
}

.code-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 84px;
  padding: 10px;
  border: 1px dashed var(--ghost);
  border-radius: var(--radius-sm);
  background: rgba(201, 184, 255, 0.06);
  color: var(--ghost);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.code-reveal.is-revealed {
  border-style: solid;
  background: rgba(201, 184, 255, 0.14);
  color: #fff;
}

.code-digits {
  font: 800 2.5rem/1 var(--font-mono);
  letter-spacing: 0.32em;
  padding-left: 0.32em;
  font-variant-numeric: tabular-nums;
}

.code-tap {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.accuse-card {
  border-color: rgba(201, 184, 255, 0.35);
}

.notice-list,
.feed {
  list-style: none;
  padding: 0;
}

.notice,
.feed-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(58, 45, 74, 0.6);
}

.notice:last-child,
.feed-item:last-child {
  border-bottom: 0;
}

.notice-time {
  flex: none;
  min-width: 3em;
  padding-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

/* Flex-Kinder schrumpfen sonst nicht unter ihr längstes Wort – lange Namen ohne Umbruchstelle
   machen die Seite breiter und schieben auf Android die Tab-Leiste aus dem Bild */
.notice-text,
.feed-item > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ── Rangliste ──────────────────────────────────────────────────────────── */

.stats-line {
  margin-bottom: 10px;
}

.my-rank {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 122, 26, 0.12);
  border: 1px solid rgba(255, 122, 26, 0.45);
  font-weight: 750;
}

.board-card {
  padding: 6px 10px;
}

.board-list {
  list-style: none;
  padding: 0;
}

.board-row {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(58, 45, 74, 0.6);
}

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

.board-row.is-top .rank {
  font-size: 1.5rem;
}

.board-row.is-me {
  border-radius: 12px;
  border-bottom-color: transparent;
  background: rgba(255, 122, 26, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.6);
}

.board-row.is-left {
  opacity: 0.6;
}

.rank {
  text-align: center;
  font-weight: 850;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
  font-weight: 650;
}

.name-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.score {
  font-weight: 850;
  color: var(--pumpkin-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.tag-me {
  background: var(--pumpkin);
  color: #1b0d02;
}

/* ── Regeln ─────────────────────────────────────────────────────────────── */

.rules-list {
  display: grid;
  gap: 8px;
  padding-left: 1.3em;
}

.rules-list.bullets {
  list-style: none;
  padding-left: 0;
}

.rules-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.rules-list.dots li {
  position: relative;
  padding-left: 1.1em;
}

.rules-list.dots li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blood);
}

.type-list {
  display: grid;
  gap: 12px;
  list-style: none;
  padding: 0;
}

.type-list li {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.chip-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.points-table {
  width: 100%;
  border-collapse: collapse;
}

.points-table td {
  padding: 9px 2px;
  border-bottom: 1px solid rgba(58, 45, 74, 0.6);
}

.points-table tr:last-child td {
  border-bottom: 0;
}

.points-table td:last-child {
  text-align: right;
  font-weight: 850;
  color: var(--pumpkin-2);
  white-space: nowrap;
}

.rules-safety {
  border-color: rgba(229, 72, 77, 0.55);
  background: linear-gradient(180deg, rgba(229, 72, 77, 0.1), var(--surface) 70%);
}

.rules-busted {
  border-color: rgba(201, 184, 255, 0.4);
}

/* ── Ich ────────────────────────────────────────────────────────────────── */

.me-name {
  font-size: clamp(1.8rem, 9vw, 2.4rem);
  font-weight: 850;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.me-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.me-score,
.me-rank {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  font-weight: 800;
}

.me-score {
  color: var(--pumpkin-2);
}

.presence-options {
  display: grid;
  gap: 8px;
}

.presence-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

.presence-opt:disabled {
  cursor: progress;
}

.presence-opt.is-dim {
  opacity: 0.55;
}

.presence-opt.is-current {
  border-color: var(--slime);
  box-shadow: inset 0 0 0 1px var(--slime);
}

.presence-opt[data-presence='paused'].is-current {
  border-color: var(--ghost);
  box-shadow: inset 0 0 0 1px var(--ghost);
}

.presence-opt[data-presence='left'].is-current {
  border-color: var(--blood);
  box-shadow: inset 0 0 0 1px var(--blood);
}

.presence-icon {
  font-size: 1.6rem;
  flex: none;
}

.presence-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: #120e19;
  border: 1px solid var(--border);
}

.seg-btn {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.seg-btn.is-on {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--pumpkin);
}

.link-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.link-actions .btn {
  white-space: nowrap;
}

.link-input {
  font: 600 0.85rem/1.3 var(--font-mono);
}

/* ── Modals ─────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(var(--safe-top) + 14px) 12px calc(var(--safe-bottom) + 14px);
  overflow-y: auto;
  background: rgba(6, 4, 9, 0.78);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade-in 0.18s ease-out;
}

.modal-sheet {
  width: 100%;
  max-width: 520px;
  margin-top: 4vh;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: sheet-in 0.22s ease-out;
  outline: none;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.modal-title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.15;
  letter-spacing: 0.03em;
  color: var(--pumpkin-2);
  overflow-wrap: anywhere;
}

.modal-close {
  flex: none;
  width: 44px;
  height: 44px;
  margin: -6px -6px 0 0;
  border: 0;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 800;
}

.modal-body {
  display: block;
}

.modal-text {
  margin-bottom: 14px;
  color: #e4dcec;
}

.modal-actions {
  display: grid;
  gap: 10px;
}

.complete-form {
  display: grid;
  gap: 14px;
}

.complete-form .modal-text {
  margin: 0;
}

.code-input {
  min-height: 76px;
  text-align: center;
  font: 800 2.6rem/1 var(--font-mono);
  letter-spacing: 0.45em;
  padding-left: calc(14px + 0.45em);
  font-variant-numeric: tabular-nums;
}

.code-input::placeholder {
  letter-spacing: 0.45em;
}

.check-wrap {
  display: grid;
  gap: 4px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-weight: 700;
  cursor: pointer;
}

.checkbox {
  flex: none;
  width: 26px;
  height: 26px;
  margin: 0;
  accent-color: var(--pumpkin);
}

.accuse-pick {
  display: grid;
  gap: 10px;
}

.player-list {
  list-style: none;
  padding: 0;
  max-height: 58vh;
  max-height: 58dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.list-note {
  padding: 14px;
}

.player-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid rgba(58, 45, 74, 0.6);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.player-list li:last-child .player-btn {
  border-bottom: 0;
}

.player-btn:active {
  background: var(--surface-2);
}

.player-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ghost);
  font-weight: 850;
}

.player-name {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* ── Toasts ─────────────────────────────────────────────────────────────── */

.toasts {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-bottom) + 16px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 calc(var(--gutter) + var(--safe-right)) 0 calc(var(--gutter) + var(--safe-left));
  pointer-events: none;
}

body.has-tabbar .toasts {
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
}

.toast {
  width: 100%;
  max-width: 520px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--ghost);
  border-radius: var(--radius-sm);
  background: #2a2036;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-weight: 650;
  overflow-wrap: anywhere;
  pointer-events: auto;
  cursor: pointer;
  animation: toast-in 0.24s ease-out;
}

.toast-success {
  border-left-color: var(--slime);
}

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

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ── Erfolgs-Animation ──────────────────────────────────────────────────── */

.celebrate {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(13, 10, 18, 0.88) 0%, rgba(13, 10, 18, 0.6) 70%);
  animation: celebrate-fade 2.3s ease forwards;
}

.celebrate-inner {
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
  animation: pop-in 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.celebrate-icon {
  font-size: 5.2rem;
  line-height: 1;
  animation: rise 2.2s ease-in-out both;
}

.celebrate-points {
  font-family: var(--font-display);
  font-size: 4.4rem;
  line-height: 1;
  color: var(--pumpkin);
  text-shadow: 0 0 30px rgba(255, 122, 26, 0.75);
}

.celebrate-text {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--pumpkin-2);
}

.spark {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 1.7rem;
  opacity: 0;
  animation: spark 1.2s ease-out var(--delay, 0ms) forwards;
}

.celebrate.is-reduced {
  animation: none;
}

.celebrate.is-reduced .celebrate-inner,
.celebrate.is-reduced .celebrate-icon {
  animation: none;
}

/* ── Animationen ────────────────────────────────────────────────────────── */

.float {
  display: inline-block;
  animation: float 3.2s ease-in-out infinite;
}

.float-delay {
  animation-delay: -1.6s;
}

.shake {
  animation: shake 0.4s ease;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.25); background: var(--pumpkin); color: #1b0d02; }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}

@keyframes celebrate-fade {
  0% { opacity: 0; }
  10% { opacity: 1; }
  78% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes rise {
  0% { transform: translateY(16px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(-4px); }
}

@keyframes spark {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) rotate(calc(-1 * var(--a))) scale(0.4);
  }
  15% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(-1 * var(--d))) rotate(calc(-1 * var(--a))) scale(1.1);
  }
}

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

/* Größere Bildschirme: etwas mehr Luft */
@media (min-width: 600px) {
  .main {
    padding-top: 24px;
  }
  .modal-sheet {
    margin-top: 10vh;
    padding: 20px;
  }
}
