/* Stadt Land Fluss – dunkler Spiel-Look: Nachtblau, gelbe Buttons, bunte Kategorien */

:root {
  --bg: #0a1430;
  --bg2: #101e48;
  --card: #13214d;
  --card2: #1a2b61;
  --line: #2a3d82;
  --text: #ffffff;
  --muted: #9fb1df;
  --yellow: #ffcd2e;
  --yellow2: #ffae00;
  --yellow-ink: #221a3d;
  --green: #2bd36b;
  --red: #ff5d6c;
  --blue: #4f8bff;
  --shadow: 0 10px 30px rgba(2, 6, 25, 0.45);
  --glow: 0 0 0 1px rgba(110, 150, 255, 0.18), 0 12px 40px rgba(2, 6, 25, 0.6);
  --title: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --ui: 'Nunito', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); scroll-padding-top: 80px; scroll-padding-bottom: 170px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body {
  margin: 0; min-height: 100dvh; color: var(--text); font: 16px/1.45 var(--ui);
  background: radial-gradient(120% 60% at 50% 0%, #17296a 0%, var(--bg2) 35%, var(--bg) 75%) fixed, var(--bg);
}
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--title); line-height: 1.05; margin: 0; }
h2 { font-size: 28px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 800; }
p { margin: 0 0 10px; }
b { font-weight: 800; }

.muted { color: var(--muted); }
.label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 16px 0 8px; }
.label:first-child { margin-top: 0; }
.ic { width: 1.2em; height: 1.2em; flex-shrink: 0; }
.ic.fill { fill: currentColor; }
[hidden] { display: none !important; }

/* Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 22px; border-radius: 16px;
  border: 1.5px solid var(--line); background: rgba(17, 30, 72, 0.85); color: var(--text);
  font-weight: 800; cursor: pointer; text-decoration: none;
  transition: transform 0.08s, box-shadow 0.15s, opacity 0.15s;
}
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled { opacity: 0.45; cursor: default; }
.sticky .btn:disabled { opacity: 1; background: #1a2550; color: rgba(255, 255, 255, 0.45); border-color: var(--line); box-shadow: none; }
.btn.primary {
  border: 0; color: var(--yellow-ink);
  background: linear-gradient(180deg, var(--yellow), var(--yellow2));
  box-shadow: 0 4px 0 #c47f00, 0 10px 24px rgba(255, 180, 0, 0.25);
}
.btn.primary:active:not(:disabled) { box-shadow: 0 2px 0 #c47f00; }
.btn.big { width: 100%; min-height: 58px; font-size: 19px; font-family: var(--title); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn:focus-visible, .room-name:focus-visible, .room-ic:focus-visible, .rooms-pill:focus-visible, .acct-btn:focus-visible, .room-open:focus-visible, .room-del:focus-visible, .rules-btn:focus-visible, .tile:focus-visible, .seg button:focus-visible, .veto:focus-visible, input:focus-visible {
  outline: 3px solid var(--yellow); outline-offset: 2px;
}
.av-pick:focus-visible { outline: 3px dashed #fff; outline-offset: 3px; }
.link { background: none; border: 0; padding: 4px 2px; color: var(--yellow); font-weight: 800; text-decoration: underline; cursor: pointer; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(17, 30, 72, 0.85);
  display: grid; place-items: center; cursor: pointer; color: var(--text); flex-shrink: 0;
}

/* Avatare */

.av {
  --size: 44px; width: var(--size); height: var(--size); border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 50% 35%, #2c4aa8, #172660); border: 2.5px solid var(--ring, #3b5bc4);
  overflow: hidden; position: relative; display: grid; place-items: center;
}
.av img { width: 100%; height: 100%; object-fit: cover; transform: translateY(6%) scale(1.08); }
.av .initial { font-family: var(--title); font-weight: 800; font-size: calc(var(--size) * 0.45); }
/* Eigene Avatare aus Ebenen (avatar.js): alle Bilder liegen übereinander auf einer quadratischen Bühne */
.avc { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.avc img, .av .avc img { position: absolute; display: block; max-width: none; height: auto; object-fit: fill; transform: none; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.av.off { filter: grayscale(0.7); opacity: 0.6; }
.crown { color: var(--yellow); }

/* Startseite */

/* Die Startseite passt auf eine Bildschirmhöhe: Das Bild oben nimmt, was übrig bleibt. */
.home { height: 100dvh; display: flex; flex-direction: column; overflow-y: auto; } /* scrollt nur, wenn es wirklich nicht passt (z. B. offene Tastatur) */
.hero {
  position: relative; flex: 1 1 auto; min-height: 150px; padding: max(14px, env(safe-area-inset-top)) 16px 0;
  background: url('img/start.webp') center 38% / cover no-repeat;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
@media (min-aspect-ratio: 4/5) { .hero { background-position: center 45%; } } /* breit: Ausschnitt mit dem Fuchsgesicht */
.hero::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 45%;
  background: linear-gradient(transparent, var(--bg));
}
/* Oben rechts: Regeln und Vorschlag */
.top-right {
  position: absolute; z-index: 2; top: max(12px, env(safe-area-inset-top)); right: 12px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
}
.rules-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  background: rgba(10, 20, 48, 0.7); border: 1.5px solid rgba(255, 255, 255, 0.25); color: #fff; font: inherit; font-size: 14px; font-weight: 800;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.rules-btn .ic { width: 18px; height: 18px; }
@media (max-width: 389px) { .top-right .lbl { display: none; } .top-right [data-action="idea"] { padding: 7px 9px; } }
/* Oben links: Anmelden und Meine Räume (Regeln oben rechts) */
.top-left {
  position: absolute; z-index: 2; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 140px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.acct-btn, .rooms-pill {
  min-width: 0; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  background: rgba(10, 20, 48, 0.7); border: 1.5px solid rgba(255, 255, 255, 0.25); color: #fff; font: inherit; font-size: 14px; font-weight: 800;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
@media (max-width: 430px) { .hero .logo { margin-top: 34px; } } /* Platz für Anmelden- und Regeln-Knopf */
.acct-btn { max-width: 100%; }
.rooms-pill { flex-shrink: 0; position: relative; }
.rooms-pill .dot, .room-open .dot {
  position: absolute; top: -3px; right: -3px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--bg); box-shadow: 0 0 8px rgba(255, 93, 108, 0.8);
}
.rooms-pill .dot[hidden] { display: none; }
@media (max-width: 389px) { .rooms-pill .lbl { display: none; } } /* schmal: nur Symbol und Zahl, sonst stößt der Knopf ans Logo */
.room-open { position: relative; }
.room-open .dot { top: -5px; left: -5px; right: auto; }
.room-row:has(.dot) .room-open { border-color: rgba(255, 93, 108, 0.6); }
.turn-note { color: var(--red); font-size: 12px; font-weight: 800; }
.rooms-pill .ic { width: 18px; height: 18px; }
.rooms-pill .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--yellow); color: #1a1a2e; font-size: 12px; line-height: 20px; text-align: center; }

.acct-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-btn .ic { width: 18px; height: 18px; flex-shrink: 0; }
.acct-btn .ic:first-child:not(:only-child) { color: var(--yellow); }
.fixed-name { display: flex; align-items: center; gap: 8px; cursor: pointer; text-align: left; font: inherit; }
.fixed-name .ic { color: var(--yellow); width: 20px; height: 20px; flex-shrink: 0; }
.fixed-name b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.fixed-name small { color: var(--muted); font-size: 12px; font-weight: 800; }
.modal-card.konto-card { max-width: 400px; max-height: calc(100dvh - 40px); overflow-y: auto; text-align: left; padding: 22px 18px 16px; }
.modal-card.konto-card h2 { font-size: 26px; text-align: center; margin-bottom: 10px; }
.modal-card.konto-card .hint { font-size: 14px; margin-bottom: 12px; color: #d6def7; text-align: left; }
.modal-card.konto-card .btn + .btn { margin-top: 8px; }
.modal-card.konto-card .err { margin: 8px 0; }
.konto-new .field { margin-bottom: 4px; }
.name-state { min-height: 1.3em; font-size: 13px; font-weight: 700; margin: 0 0 8px; color: var(--muted); }
.name-state.free { color: var(--green); }
.name-state.taken { color: var(--red); }
.konto-card .or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 14px 0 10px; }
.konto-card .or::before, .konto-card .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.konto-me { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-bottom: 8px; }
.konto-me .ic { color: var(--yellow); width: 26px; height: 26px; }
.danger-text { color: var(--red); }
.konto-why { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 700; color: #ffe9a3; background: rgba(255, 205, 46, 0.1); border: 1px solid rgba(255, 205, 46, 0.35); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; }
.konto-why .ic { width: 20px; height: 20px; color: var(--yellow); flex-shrink: 0; margin-top: 1px; }
.ic.acct { width: 16px; height: 16px; color: var(--yellow); flex-shrink: 0; vertical-align: -2px; }
.danger-text.armed { background: var(--red); color: #fff; border-color: var(--red); }
.logo { position: relative; z-index: 1; margin-top: 4px; transform: rotate(-4deg); }
.logo .crown { display: block; width: clamp(26px, 4.5dvh, 38px); height: clamp(26px, 4.5dvh, 38px); margin: 0 auto -8px; transform: rotate(4deg); filter: drop-shadow(0 3px 0 #b36b00); }
.logo span {
  display: block; font-family: var(--title); font-weight: 800; font-size: clamp(30px, min(12.5vw, 7dvh), 64px); line-height: 0.9;
  -webkit-text-stroke: 6px #12204f; paint-order: stroke fill; text-shadow: 0 5px 0 #0a1430;
}
.logo span:nth-child(2) { color: #fff; }
.logo span:nth-child(3) { color: #ffa53d; margin-left: 0.5em; }
.logo span:nth-child(4) { color: #3dc2ff; }
.tagline {
  position: relative; z-index: 1; margin-top: 6px; font-family: var(--title); font-weight: 700; font-size: 16px;
  transform: rotate(-4deg); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.home-body { position: relative; z-index: 2; flex: none; margin-top: -32px; padding: 0 16px calc(12px + env(safe-area-inset-bottom)); width: 100%; max-width: 520px; align-self: center; }
.panel {
  background: rgba(19, 33, 77, 0.92); border-radius: 22px; padding: 14px 16px 10px; box-shadow: var(--glow);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.panel .label { margin-bottom: 4px; }
.invite { text-align: center; font-weight: 700; margin-bottom: 8px; }
.field { display: block; margin-bottom: 10px; }
.field > span { display: block; font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.input {
  width: 100%; min-height: 48px; padding: 0 16px; border-radius: 14px; font-size: 17px; font-weight: 700;
  border: 1.5px solid var(--line); background: #0d1838; color: var(--text); outline: none;
}
.input:focus { border-color: var(--blue); }
.input::placeholder { color: #6378b0; font-weight: 600; }
.av-row { display: flex; gap: 10px; overflow-x: auto; padding: 6px 8px 8px; margin: 0 -8px 2px; scroll-snap-type: x mandatory; scroll-padding-inline: 8px; scrollbar-width: none; }
.av-row::-webkit-scrollbar { display: none; }
.av-pick { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; scroll-snap-align: start; }
.av-pick .av { --size: 52px; --ring: transparent; }
.av-pick.on .av { --ring: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 205, 46, 0.35); }
.av-pick.own { position: relative; }
.av-edit {
  position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); color: var(--yellow-ink); border: 2px solid var(--card);
}
.av-edit .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.av-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel .av-head .label { margin: 0; }
.av-make {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: var(--card2); border: 1.5px solid var(--line); color: var(--yellow); font: inherit; font-size: 13px; font-weight: 800;
}
.av-make .ic { width: 15px; height: 15px; }
.av-make:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.home .btn.big { min-height: 54px; width: 100%; }
.home .btn + .btn { margin-top: 8px; }
.join { display: flex; gap: 8px; margin-top: 10px; }
.join .input { flex: 1; min-width: 0; text-align: center; text-transform: uppercase; letter-spacing: 0.25em; font-family: var(--title); font-size: 20px; padding: 0 8px; }
.join .btn { flex-shrink: 0; min-height: 48px; padding: 0 16px; }
.err { color: var(--red); font-weight: 700; font-size: 14px; min-height: 1.1em; margin: 6px 0 0; text-align: center; }
.err:empty { min-height: 6px; }
.modal-card.rooms-card { max-width: 440px; max-height: calc(100dvh - 40px); overflow-y: auto; text-align: left; padding: 22px 18px 18px; }
.modal-card.rooms-card h2 { font-size: 26px; text-align: center; margin-bottom: 14px; }
.modal-card.rooms-card .hint { font-size: 13px; text-align: center; margin: 12px 0; }
.room-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.room-row { display: flex; gap: 8px; align-items: stretch; min-width: 0; } /* nie breiter als das Fenster: Knöpfe bleiben rechts */
.room-open {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; cursor: pointer;
  background: var(--card2); border: 1.5px solid var(--line); color: var(--text); font: inherit; text-align: left;
}
.room-open .code-mini { flex-shrink: 0; font-family: var(--title); font-size: 19px; font-weight: 800; letter-spacing: 0.1em; color: var(--yellow); }
.room-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.room-meta b, .room-meta small { overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.room-meta b { font-size: 15px; line-height: 1.25; }
.room-meta small { color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.3; }
.room-open > .ic { color: var(--muted); flex-shrink: 0; }
.room-del {
  flex-shrink: 0; width: 48px; border-radius: 14px; cursor: pointer; display: grid; place-items: center;
  background: transparent; border: 1.5px solid var(--line); color: var(--muted); font: inherit; font-size: 12px; font-weight: 800;
}
.room-ic {
  flex-shrink: 0; width: 42px; border-radius: 14px; cursor: pointer; display: grid; place-items: center;
  background: transparent; border: 1.5px solid var(--line); color: var(--muted);
}
.room-row .room-del { width: 42px; }
.room-row .room-del.armed { width: 92px; }
.room-del.armed { width: 92px; background: var(--red); border-color: var(--red); color: #fff; }
.modal-card.rename-card { max-width: 380px; }
.modal-card.rename-card p { margin-bottom: 14px; font-size: 14px; }
.modal-card.rename-card .input { margin-bottom: 14px; text-align: center; }
.modal-card.rename-card .btn + .btn { margin-top: 8px; }
.room-name {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 12px; padding: 12px 14px; border-radius: 16px; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); color: var(--text); font: inherit; text-align: left;
}
.room-name .lbl { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.room-name b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-name .ic { color: var(--muted); flex-shrink: 0; }
.msg.sys { align-self: center; max-width: 92%; display: block; text-align: center; font-size: 13px; color: var(--muted); font-weight: 700; }
.msg.sys time { margin-left: 6px; font-size: 11px; opacity: 0.8; }
.modal-card.rules-card { max-width: 440px; max-height: calc(100dvh - 40px); overflow-y: auto; text-align: left; padding: 22px 20px 18px; }
.modal-card.rules-card h2 { font-size: 26px; text-align: center; }
.modal-card.rules-card ol .ic { width: 16px; height: 16px; vertical-align: -3px; }
.modal-card.idea-card { display: grid; gap: 10px; max-width: 440px; }
.modal-card.idea-card h2 { margin: 0; }
.modal-card.idea-card .big-ic { width: 72px; height: 72px; margin: 0 auto; }
.modal-card.idea-card .big-ic .ic { width: 38px; height: 38px; }
.modal-card.idea-card .muted { color: #d6def7; font-size: 14px; margin: 0; }
.idea-card textarea { width: 100%; min-height: 120px; resize: vertical; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: #0d1838; color: var(--text); outline: none; }
.idea-card textarea:focus { border-color: var(--yellow); }
.idea-count { text-align: right; font-size: 12px; color: var(--muted); margin-top: -6px; }
.stats-card h2 { display: flex; align-items: center; justify-content: center; gap: 8px; }
.stats-card h2 .ic { width: 26px; height: 26px; color: var(--yellow); }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 14px; }
.stat { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.stat .stat-ic { grid-row: 1 / span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 205, 46, 0.12); color: var(--yellow); }
.stat .stat-ic .ic { width: 18px; height: 18px; }
.stat b { font-family: var(--title); font-size: 22px; line-height: 1.1; }
.stat span:last-child { font-size: 12px; color: var(--muted); font-weight: 700; line-height: 1.2; }
.stats-h { font-family: var(--title); font-size: 17px; color: var(--yellow); margin: 4px 0 6px; }
.modal-card.stats-card .stats-games { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.stats-card .legal-stand { color: var(--muted); font-size: 12px; margin: 10px 0 14px; }
.stats-games li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 8px; align-items: center; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.stats-games li.won { border-color: rgba(255, 205, 46, 0.5); }
.g-rank { font-family: var(--title); font-weight: 800; font-size: 18px; text-align: center; color: var(--muted); }
.g-rank .ic { width: 22px; height: 22px; color: var(--yellow); }
.g-who { min-width: 0; display: grid; }
.g-who b { font-size: 14px; }
.g-who small, .g-pts small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-pts { text-align: right; font-weight: 800; display: grid; }
#push-btn.on { color: var(--yellow); }
.push-hint { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; margin: 0 0 12px; padding: 10px 10px 10px 14px; border-radius: 16px; background: rgba(255, 205, 46, 0.1); border: 1px solid rgba(255, 205, 46, 0.35); }
.push-hint > .ic { width: 24px; height: 24px; color: var(--yellow); }
.push-hint span { font-size: 13px; color: #d6def7; line-height: 1.3; }
.push-hint b { display: block; color: var(--text); font-size: 14px; }
.push-hint .icon-btn { width: 32px; height: 32px; }
.modal-card.push-card { display: grid; gap: 10px; max-width: 420px; text-align: left; }
.modal-card.push-card h2 { text-align: center; margin: 0; }
.modal-card.push-card .big-ic { width: 72px; height: 72px; margin: 0 auto; }
.modal-card.push-card .big-ic .ic { width: 38px; height: 38px; }
.push-card p { margin: 0; color: #d6def7; font-size: 15px; line-height: 1.45; }
.push-card .err:empty { display: none; }
.push-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: #d6def7; }
.push-steps .ic { width: 18px; height: 18px; vertical-align: -3px; color: var(--yellow); }
.push-chat { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: #d6def7; cursor: pointer; }
.push-chat input { width: 20px; height: 20px; accent-color: var(--yellow); flex-shrink: 0; margin: 0; }
.legal-links { margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.legal-links button { background: none; border: 0; padding: 4px 2px; font: inherit; font-weight: 700; color: var(--muted); text-decoration: underline; cursor: pointer; }
.legal-links button:hover, .legal-links button:focus-visible { color: var(--text); }
.legal-card h3 { font-family: var(--title); font-size: 17px; margin: 16px 0 4px; color: var(--yellow); }
.legal-card p { margin: 0 0 8px; font-size: 14px; line-height: 1.45; color: #d6def7; }
.legal-card a { color: var(--yellow); }
.legal-card .legal-stand { color: var(--muted); font-size: 12px; margin: 12px 0 14px; }
.modal-card.rules-card ol { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; color: #d6def7; }

/* Kopfzeile in Räumen */

.bar {
  position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: minmax(84px, 1fr) minmax(0, auto) minmax(84px, 1fr); align-items: center; gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.bar-title { text-align: center; min-width: 0; }
.bar-title .t { font-family: var(--title); font-weight: 800; font-size: 20px; display: inline-flex; align-items: center; gap: 6px; }
.bar-title .s { font-size: 13px; color: var(--muted); font-weight: 700; }
.conn { width: 42px; height: 42px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.conn::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #e0a400; display: block; margin: 0 auto 2px; }
.conn.online::before { background: var(--green); box-shadow: 0 0 10px var(--green); }
.conn.error::before { background: var(--red); }

.bar-l { display: flex; justify-content: flex-start; }
.bar-r { display: flex; justify-content: flex-end; align-items: center; gap: 2px; }
.bar-r .conn { width: 36px; }
.chat-btn { position: relative; }
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
  border: 2px solid var(--bg);
}
.badge[hidden] { display: none; }

/* Chat (eigener Bereich ganz unten im Raum) */

.card.chat-box { margin-top: 18px; padding: 0; overflow: hidden; scroll-margin-bottom: 16px; }
.lobby .card.chat-box, .final .card.chat-box { margin-bottom: 12px; }
.chat-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.chat-h > .ic { width: 24px; height: 24px; color: var(--yellow); flex-shrink: 0; }
.chat-h h3 { font-family: var(--title); font-size: 19px; margin: 0; line-height: 1.1; }
.chat-h small { color: var(--muted); font-size: 12px; font-weight: 700; }
.chat-list { list-style: none; margin: 0; padding: 12px 14px; height: clamp(180px, 38dvh, 340px); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.msg .av { --size: 32px; border-width: 2px; }
.msg.me { align-self: flex-end; }
.bubble { background: var(--card2); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 8px 12px 6px; min-width: 0; }
.msg.me .bubble { background: #2a4bb0; border-color: #3d63d6; border-radius: 18px 18px 6px 18px; }
.bubble b { display: block; font-size: 12px; color: var(--yellow); margin-bottom: 2px; }
.bubble .txt { display: block; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; }
.bubble time { display: block; text-align: right; font-size: 11px; color: var(--muted); margin-top: 2px; }
.msg.me .bubble time { color: #c9d6ff; }
.msg-more { flex-shrink: 0; align-self: center; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.msg-more:hover, .msg-more:focus-visible { background: var(--card2); color: var(--text); }
.msg-more .ic { width: 18px; height: 18px; }
.msg.sys.blocked { display: flex; align-items: center; justify-content: center; gap: 2px; font-style: italic; }
.bubble.removed .txt { font-style: italic; color: var(--muted); }
.modal-card.msg-card { display: grid; gap: 10px; text-align: left; max-width: 420px; }
.modal-card.msg-card h2 { font-size: 22px; text-align: center; margin: 0 0 4px; }
.modal-card.msg-card .btn { width: 100%; justify-content: center; }
.modal-card.msg-card .muted { color: #d6def7; font-size: 14px; margin: 0 0 4px; }
.msg-quote { margin: 0 0 6px; padding: 10px 12px; border-left: 3px solid var(--yellow); background: var(--card2); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 30dvh; overflow-y: auto; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 10px; font-weight: 700; }
.chat-empty .ic { width: 40px; height: 40px; opacity: 0.6; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 14px;
  border: 1.5px solid var(--line); background: #0d1838; color: var(--text); outline: none;
}
.chat-form input:focus { border-color: var(--yellow); }
.chat-form .btn { width: 50px; padding: 0; flex-shrink: 0; }

/* Seiten */

.screen { max-width: 560px; margin: 0 auto; padding: 4px 16px calc(120px + env(safe-area-inset-bottom)); }
.screen.center {
  min-height: calc(100dvh - 70px); display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; padding-bottom: 40px;
}
.screen.center .btn { min-width: 240px; }
.card { background: var(--card); border-radius: 20px; padding: 16px; box-shadow: var(--glow); margin-bottom: 14px; }
.sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 16px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 35%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.sticky > * { width: 100%; max-width: 528px; }
.hint { text-align: center; color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.section-h { font-family: var(--title); font-size: 20px; font-weight: 800; margin: 22px 2px 10px; }

/* Lobby */

.lobby-players { display: flex; gap: 10px; align-items: flex-start; overflow-x: auto; padding: 4px 2px 6px; }
.lobby-players .p { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 66px; flex-shrink: 0; font-size: 13px; font-weight: 700; text-align: center; }
.lobby-players .p .av { --size: 56px; }
.lobby-players .p span { max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-player { width: 56px; height: 56px; border-radius: 50%; border: 2px dashed var(--line); background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.mode {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; margin: 14px 0;
  background: linear-gradient(135deg, #1d3a8f, #172a6a); border: 1.5px solid #2f55c9;
}
.mode .mode-ic { width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.15); display: grid; place-items: center; }
.mode > span:nth-child(2) { min-width: 0; }
.mode .mode-ic .ic { width: 24px; height: 24px; }
.mode small { display: block; color: #c5d3ff; font-weight: 700; font-size: 12px; }
.mode b { font-family: var(--title); font-size: 18px; }
.code-big { font-family: var(--title); font-weight: 800; font-size: clamp(26px, 9vw, 40px); letter-spacing: 0.14em; line-height: 1; margin-left: auto; flex-shrink: 0; }
.player-list { list-style: none; padding: 0; margin: 0; }
.player-list li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid rgba(42, 61, 130, 0.6); }
.player-list li:last-child { border-bottom: 0; }
.player-list .pname { flex: 1; font-weight: 800; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.player-list em { color: var(--muted); font-style: normal; font-weight: 600; font-size: 13px; }
.ready { color: var(--green); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; gap: 4px; }
.ready.off { color: var(--muted); }

/* Spieler entfernen */

.kick-card { border: 1.5px solid rgba(255, 93, 108, 0.5); }
.kick-head { display: flex; gap: 12px; align-items: center; }
.kick-head .av { --size: 44px; }
.kick-head b { display: block; }
.kick-head small { color: var(--muted); font-size: 13px; }
.kick-actions { display: flex; gap: 8px; margin-top: 12px; }
.kick-actions .btn { flex: 1; }
.kick-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--line); background: transparent; color: var(--muted);
  display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; margin-left: auto;
}
.kick-btn .ic { width: 17px; height: 17px; }
.ranking .dots .kick-btn { margin-left: auto; width: 28px; height: 28px; }

/* Kategorien auslosen */

.cats-head { text-align: center; margin: 8px 0 16px; }
.cats-head .av { --size: 72px; margin: 0 auto 10px; }
.cats-head h2 { font-size: 28px; margin-bottom: 6px; }
.cat-rows { display: flex; flex-direction: column; gap: 10px; }
.cat-rows .line { padding: 12px 14px 12px 10px; font-size: 18px; }
.cat-rows .line b { font-family: var(--title); font-size: 20px; }
.cat-rows:not(.mixing) .line { animation: pop 0.35s backwards; }
.cat-rows:not(.mixing) .line:nth-child(2) { animation-delay: 0.06s; }
.cat-rows:not(.mixing) .line:nth-child(3) { animation-delay: 0.12s; }
.cat-rows:not(.mixing) .line:nth-child(4) { animation-delay: 0.18s; }
.cat-rows:not(.mixing) .line:nth-child(5) { animation-delay: 0.24s; }
.cat-rows.mixing .line { filter: saturate(0.8); }
.cat-empty { display: grid; place-items: center; height: 200px; border: 2px dashed var(--line); border-radius: 20px; color: var(--muted); }
.cat-empty .ic { width: 48px; height: 48px; }
.cat-info { display: flex; gap: 12px; align-items: center; margin: 0 0 4px; color: #d6def7; font-size: 14px; }
.cat-info .ic { width: 28px; height: 28px; color: var(--yellow); flex-shrink: 0; }

/* Kategorie-Kacheln */

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile {
  --c: #6d5bd0; position: relative; aspect-ratio: 1 / 0.92; border-radius: 18px; border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 92%, #fff), color-mix(in srgb, var(--c) 78%, #000));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px;
  font-weight: 800; font-size: 12.5px; line-height: 1.15; text-align: center;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18);
}
.tile .ic { width: 30px; height: 30px; }
.tile span { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; max-width: 100%; }
.tile.off { filter: grayscale(0.85) brightness(0.55); opacity: 0.7; box-shadow: none; }
.tile .check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #1a7f45; display: grid; place-items: center; }
.tile .check .ic { width: 13px; height: 13px; stroke-width: 3.5; }
.tile.static { cursor: default; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seg button {
  min-height: 46px; border-radius: 14px; border: 1.5px solid var(--line); background: #0d1838; cursor: pointer;
  font-family: var(--title); font-weight: 800; font-size: 18px;
}
.seg button.on { background: linear-gradient(180deg, var(--yellow), var(--yellow2)); color: var(--yellow-ink); border-color: transparent; }

/* Übersicht */

.turn { text-align: center; padding: 22px 18px; }
.turn .big-ic { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; }
.turn .big-ic .ic { width: 38px; height: 38px; }
.big-ic.yellow { background: radial-gradient(circle, rgba(255, 205, 46, 0.25), transparent 70%); color: var(--yellow); }
.big-ic.green { background: var(--green); color: #fff; box-shadow: 0 0 0 8px rgba(43, 211, 107, 0.15); }
.big-ic.blue { background: radial-gradient(circle, rgba(79, 139, 255, 0.3), transparent 70%); color: #8fb4ff; }
.turn h2 { font-size: 30px; margin-bottom: 8px; }
.turn p { color: #d6def7; }
.turn .btn { margin-top: 6px; }
.turn .hint { margin-top: 12px; }
.waiting-avatars { display: flex; justify-content: center; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.waiting-avatars .av { --size: 48px; }
.last-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.last-head p { margin: 4px 0 0; font-size: 14px; }
.waiting-votes { margin: 0 0 10px; font-weight: 800; color: var(--yellow); }
.older { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.letter-chip {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-family: var(--title); font-weight: 800; font-size: 30px; color: var(--yellow-ink);
  background: linear-gradient(180deg, var(--yellow), var(--yellow2)); box-shadow: 0 4px 0 #c47f00;
}

.ranking { list-style: none; padding: 0; margin: 0; }
.ranking li {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 6px; align-items: center;
  background: var(--card); border-radius: 18px; box-shadow: var(--glow); padding: 12px 14px; margin-bottom: 10px;
  animation: slide 0.35s backwards; animation-delay: calc(var(--i, 0) * 60ms);
}
.ranking li .av { --size: 52px; grid-row: 1 / span 2; }
.ranking .pname { font-weight: 800; font-size: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.pname .nm { min-width: 0; overflow-wrap: break-word; }
.pname em, .pname .tag, .pname .crown { flex-shrink: 0; white-space: nowrap; }
.ranking .pname em { color: var(--muted); font-style: normal; font-weight: 600; font-size: 13px; }
.ranking .score { font-weight: 800; text-align: right; white-space: nowrap; }
.ranking .score small { display: block; color: var(--green); font-size: 12px; }
.ranking .dots { grid-column: 2 / span 2; display: flex; gap: 5px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 800; background: var(--yellow); color: var(--yellow-ink); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.ldot {
  --c: #666; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: #fff; background: var(--c); border: 2px solid rgba(255, 255, 255, 0.25);
}
.ldot.zero { background: #2a3566; color: #6f7cab; border-color: transparent; text-decoration: line-through; }
.tip {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; margin-top: 14px;
  border: 1.5px solid var(--line); background: rgba(17, 30, 72, 0.6); font-size: 14px; color: #d6def7;
}
.tip .ic { width: 28px; height: 28px; color: var(--yellow); }
.dash-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* Schreiben */

.write-head { display: flex; align-items: center; gap: 16px; margin: 6px 0 14px; }
.ring { position: relative; width: 112px; height: 112px; flex-shrink: 0; }
.ring > svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring > svg circle { fill: none; stroke-width: 9; }
.ring .track { stroke: rgba(255, 255, 255, 0.08); }
.ring .prog { stroke: var(--yellow); stroke-linecap: round; transition: stroke-dashoffset 0.2s linear; filter: drop-shadow(0 0 6px rgba(255, 205, 46, 0.5)); }
.ring.urgent .prog { stroke: var(--red); filter: drop-shadow(0 0 8px rgba(255, 93, 108, 0.6)); }
.ring .inner { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .inner .ic { width: 18px; height: 18px; margin: 0 auto 2px; color: var(--muted); }
.ring .num { font-family: var(--title); font-weight: 800; font-size: 36px; line-height: 0.9; }
.ring .unit { font-size: 11px; font-weight: 800; color: var(--muted); }
.write-info { flex: 1; min-width: 0; }
.write-info .letter-chip { width: 64px; height: 64px; font-size: 38px; margin-bottom: 8px; }
.letter-chip.pop { animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
.write-info p { margin: 0; color: #d6def7; font-size: 14px; }
.banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; margin-bottom: 12px;
  background: rgba(17, 30, 72, 0.85); border: 1.5px solid var(--line); font-weight: 800; font-size: 14px;
}
.banner .ic { width: 26px; height: 26px; color: var(--yellow); }
.answers { display: flex; flex-direction: column; gap: 10px; }
.line {
  --c: #6d5bd0; position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 90%, #fff), color-mix(in srgb, var(--c) 72%, #000));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}
.line .ci { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); display: grid; place-items: center; flex-shrink: 0; }
.line .ci .ic { width: 24px; height: 24px; }
.line .lf { flex: 1; min-width: 0; }
.line .lf span { display: block; font-size: 13px; font-weight: 800; opacity: 0.95; }
.line input {
  width: 100%; border: 0; background: transparent; outline: none; color: #fff; font-size: 18px; font-weight: 800; padding: 2px 0 0;
}
.line input::placeholder { color: rgba(255, 255, 255, 0.55); font-weight: 600; }
.line:focus-within { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), 0 0 0 3px var(--yellow); }
.line input.bad { text-decoration: line-through 2px #fff; }
.line .badmark { display: none; position: absolute; top: 8px; right: 12px; font-size: 11px; font-weight: 800; background: rgba(0, 0, 0, 0.35); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.line:has(input.bad) .badmark { display: inline-block; }
.line input:disabled { opacity: 0.75; }
.btn.stop { border-color: #3a56b8; }
.countdown {
  position: fixed; inset: 0; z-index: 10; background: rgb(6, 12, 34); /* undurchsichtig: Kategorien erst mit der Uhr */
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 20px;
  transition: opacity 0.3s, visibility 0s;
}
.countdown.hidden { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.3s, visibility 0s 0.3s; }
.countdown h2 { font-size: 26px; }
.orb {
  width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 35% 30%, #8fd3ff, #3b6dff 45%, #2a2fa8 75%);
  box-shadow: 0 0 60px rgba(80, 140, 255, 0.6), inset 0 -12px 30px rgba(0, 0, 0, 0.35);
}
.orb .roll { font-family: var(--title); font-weight: 800; font-size: 88px; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); }
.sparks { position: absolute; inset: -30px; animation: spin 6s linear infinite; }
.sparks i { position: absolute; width: 14px; height: 5px; border-radius: 3px; }
.sparks i:nth-child(1) { top: 10%; left: 12%; background: var(--yellow); transform: rotate(40deg); }
.sparks i:nth-child(2) { top: 6%; right: 18%; background: #3dc2ff; transform: rotate(-30deg); }
.sparks i:nth-child(3) { bottom: 12%; left: 6%; background: #ff6bd5; transform: rotate(-60deg); }
.sparks i:nth-child(4) { bottom: 8%; right: 10%; background: var(--green); transform: rotate(20deg); }

/* Glücksrad */

.spin-title { text-align: center; font-size: 34px; margin: 4px 0 2px; }
.wheel-btn { display: block; background: none; border: 0; padding: 16px; margin: -6px auto -16px; cursor: grab; border-radius: 50%; color: inherit; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
body:has(.screen.spin) { overscroll-behavior: none; }
.wheel-btn:active { cursor: grabbing; }
#spin-actions .hint .ic { width: 16px; height: 16px; vertical-align: -3px; color: var(--yellow); }
.wheel-btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: -10px; }
.wheel { position: relative; width: min(80vw, 330px); aspect-ratio: 1; }
.wheel svg { width: 100%; height: 100%; filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.45)); }
.wheel text { fill: #fff; font-family: var(--title); font-weight: 800; font-size: 21px; text-anchor: middle; dominant-baseline: central; }
.wheel path { stroke: rgba(10, 20, 48, 0.35); stroke-width: 1; }
.wheel-rim { fill: none; stroke: var(--yellow); stroke-width: 9; }
.wheel-hub { fill: #13214d; stroke: var(--yellow); stroke-width: 6; }
.wheel-hub-ic { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.wheel-hub-ic .ic { width: 28px; height: 28px; color: var(--yellow); }
.hub-letter { font-family: var(--title); font-weight: 800; font-size: 40px; color: var(--yellow); animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
.spin .wheel { width: min(80vw, 330px, 50dvh); }
.spin-sub { text-align: center; color: #d6def7; font-size: 17px; min-height: 1.5em; margin: 4px 0 0; }
.spin-sub b { color: var(--yellow); font-family: var(--title); font-size: 24px; }
.wheel-pointer {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%); z-index: 2;
  border-left: 17px solid transparent; border-right: 17px solid transparent; border-top: 32px solid #fff;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35));
}
.letter-chip.huge { width: 150px; height: 150px; font-size: 96px; box-shadow: 0 6px 0 #c47f00, 0 0 60px rgba(255, 205, 46, 0.45); }
.cd-num { font-family: var(--title); font-weight: 800; font-size: 44px; color: var(--muted); min-height: 1.2em; }
.secret {
  width: 112px; height: 112px; flex-shrink: 0; border-radius: 50%; border: 9px solid rgba(255, 255, 255, 0.08);
  display: grid; place-content: center; text-align: center; gap: 4px;
}
.secret .ic { width: 34px; height: 34px; color: var(--yellow); margin: 0 auto; animation: flip 2.4s ease-in-out infinite; }
.secret span { font-size: 11px; font-weight: 800; color: var(--muted); line-height: 1.2; }
@keyframes flip { 0%, 40% { transform: rotate(0); } 50%, 90% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }

/* Popups */

.modal { position: fixed; inset: 0; z-index: 20; background: rgba(6, 12, 34, 0.8); display: grid; place-items: center; padding: 20px; animation: fade 0.2s; }
.modal-card {
  width: 100%; max-width: 360px; text-align: center; padding: 28px 22px 22px; border-radius: 26px;
  background: linear-gradient(180deg, #1a2c66, #121f4d); border: 1.5px solid #3555c4;
  box-shadow: 0 0 0 6px rgba(53, 85, 196, 0.15), 0 30px 60px rgba(0, 0, 0, 0.5); animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.modal-card .big-ic { width: 92px; height: 92px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; }
.modal-card .big-ic .ic { width: 50px; height: 50px; stroke-width: 2.6; }
.modal-card h2 { font-size: 30px; margin-bottom: 10px; }
.modal-card p { color: #d6def7; margin-bottom: 20px; }

/* Avatar-Generator (Fenster in Schritten, nach dem Entwurf des Users) */

.agen-modal { padding: 10px; }
.modal-card.agen {
  width: min(480px, calc(100vw - 20px)); max-width: none; height: min(780px, calc(100dvh - 20px));
  display: flex; flex-direction: column; text-align: left; padding: 14px 16px 16px; border-radius: 24px;
  background: linear-gradient(180deg, #17235a, #0f1a45); border-color: #2f4aa8;
}
.agen-head { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 12px; }
.agen-head > div { flex: 1; min-width: 0; }
.modal-card .agen-head h2 { font-size: 22px; margin: 2px 0 2px; }
.modal-card .agen-head p { margin: 0; font-size: 13px; color: var(--muted); font-weight: 700; }
.agen-back { flex-shrink: 0; width: 38px; height: 38px; margin-left: -8px; display: grid; place-items: center; border-radius: 12px; cursor: pointer; background: none; border: 0; color: #fff; }
.agen-back .ic { width: 26px; height: 26px; stroke-width: 2.6; }
.agen-steps { display: flex; gap: 4px; padding-top: 12px; }
.agen-steps i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.agen-steps i.on { background: var(--yellow); }

.agen-av { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: #233470; }
.agen-stage { position: relative; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.agen-av.av-big { width: clamp(118px, 27dvh, 230px); border-radius: 22px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12), 0 14px 30px rgba(0, 0, 0, 0.35); }
.agen-av.av-big.roll { animation: roll 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes roll { 0% { transform: rotate(0) scale(1); } 35% { transform: rotate(-8deg) scale(0.9); } 100% { transform: rotate(0) scale(1); } }
.agen-arrow, .agen-dice {
  position: absolute; top: 50%; width: 38px; height: 38px; margin-top: -19px; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: rgba(10, 20, 48, 0.75); border: 1.5px solid rgba(255, 255, 255, 0.25); color: #fff;
}
.agen-arrow:first-child { left: 0; }
.agen-arrow:nth-child(3) { right: 0; }
.agen-dice { top: 0; right: 0; margin: 0; background: var(--yellow); border-color: var(--yellow); color: var(--yellow-ink); }
.agen-arrow .ic, .agen-dice .ic { width: 20px; height: 20px; stroke-width: 2.6; }

.agen-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -16px; padding: 4px 16px 10px; }
.agen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.agen-grid.figs { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
.agen-opt {
  position: relative; padding: 0; cursor: pointer; aspect-ratio: 1; border-radius: 16px; overflow: visible;
  background: #1d2a62; border: 2px solid rgba(255, 255, 255, 0.1); color: inherit;
}
.agen-opt > .agen-av, .agen-opt > .agen-item { width: 100%; height: 100%; border-radius: 14px; }
.agen-opt.on { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow), 0 6px 18px rgba(255, 205, 46, 0.25); }
.agen-check {
  position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); color: var(--yellow-ink); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.agen-check .ic { width: 15px; height: 15px; stroke-width: 3.2; }
.agen-item { position: relative; display: block; overflow: hidden; }
.agen-item img { position: absolute; inset: 12%; width: 76%; height: 76%; object-fit: contain; }
.agen-item.scene img { inset: 0; width: 100%; height: 100%; object-fit: cover; }

.agen-colors h3 { font-family: var(--ui); font-size: 14px; font-weight: 800; margin: 16px 0 8px; }
.agen-dots { display: flex; flex-wrap: wrap; gap: 9px; }
.agen-dot { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; padding: 0; border: 2px solid rgba(255, 255, 255, 0.25); }
.agen-dot.on { border-color: #fff; box-shadow: 0 0 0 3px var(--yellow); }
.agen-foot { flex-shrink: 0; padding-top: 12px; }
.agen-foot .btn { width: 100%; }
.agen-foot .btn + .btn { margin-top: 8px; }
.agen-foot .btn.ghost { border-color: var(--line); }
.agen-del { display: block; margin: 10px auto 0; font-size: 14px; color: var(--muted); }

.agen-done { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; }
.agen-name {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 16px; border-radius: 16px;
  background: #0d1838; border: 1.5px solid var(--line); color: var(--muted);
}
.agen-name:focus-within { border-color: var(--blue); }
.agen-name input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: #fff; font-size: 18px; font-weight: 800; }
.agen-name input::placeholder { color: #6378b0; }
.agen-done .err { margin: 6px 0 0; }
.agen-ready { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 4px 0 6px; font-family: var(--title); font-size: 20px; }
.agen-ready .crown { width: 30px; height: 30px; color: var(--yellow); }
.agen-rays { position: relative; padding: clamp(22px, 4dvh, 30px); }
.agen-rays::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(from -4deg, var(--yellow) 0 8deg, transparent 8deg 30deg);
  -webkit-mask: radial-gradient(closest-side, transparent 87%, #000 88%, #000 99%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 87%, #000 88%, #000 99%, transparent 100%);
}
.agen-av.av-final { width: clamp(96px, 22dvh, 200px); border-radius: 50%; border: 4px solid var(--yellow); box-shadow: 0 0 30px rgba(255, 205, 46, 0.35); }

.agen-intro { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 4px; }
.agen-logo { transform: rotate(-4deg); margin-bottom: 6px; }
.agen-logo .crown { display: block; width: 34px; height: 34px; margin: 0 auto -6px; color: var(--yellow); filter: drop-shadow(0 3px 0 #b36b00); }
.agen-logo span { display: block; font-family: var(--title); font-weight: 800; font-size: clamp(34px, 6dvh, 48px); line-height: 0.95; -webkit-text-stroke: 6px #12204f; paint-order: stroke fill; text-shadow: 0 5px 0 #0a1430; }
.agen-logo span:nth-child(2) { color: #fff; }
.agen-logo span:nth-child(3) { color: var(--yellow); }
.agen-tag { max-width: 300px; font-family: var(--title); font-size: 16px; color: #fff !important; transform: rotate(-3deg); margin: 6px 0 14px !important; }
.agen-av.av-show { width: clamp(110px, 24dvh, 190px); border-radius: 50%; border: 4px solid var(--yellow); box-shadow: 0 0 30px rgba(255, 205, 46, 0.3); flex-shrink: 0; }
.agen-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin: 16px 0 12px; }
.agen-feats span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; background: #1d2a62; font-size: 12px; font-weight: 800; line-height: 1.2; }
.agen-feats .ic { width: 22px; height: 22px; color: var(--yellow); }
.agen-feats span:nth-child(2) .ic { color: #c084fc; }
.agen-strip { display: flex; gap: 8px; width: 100%; justify-content: center; }
.agen-strip .agen-av { flex: 1; max-width: 64px; border-radius: 12px; }

.agen-back:focus-visible, .agen-arrow:focus-visible, .agen-dice:focus-visible, .agen-dot:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.agen-opt:focus-visible { outline: 3px dashed #fff; outline-offset: 3px; }

/* Auswertung */

.review-head { display: flex; gap: 14px; align-items: center; margin: 6px 0 14px; }
.review-head p { margin: 4px 0 0; font-size: 14px; color: #d6def7; }
.cat { padding: 0; overflow: hidden; }
.cat-h {
  --c: #6d5bd0; display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-weight: 800;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 90%, #fff), color-mix(in srgb, var(--c) 72%, #000));
}
.cat-h .ic { width: 22px; height: 22px; }
.answers-list { list-style: none; margin: 0; padding: 4px 14px 8px; }
.ans {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center;
  column-gap: 10px; row-gap: 2px; padding: 10px 0; border-bottom: 1px solid rgba(42, 61, 130, 0.6);
}
.ans:last-child { border-bottom: 0; }
.ans .av { --size: 36px; grid-row: 1 / span 2; border-width: 2px; }
.ans .who { grid-column: 2; font-size: 12px; color: var(--muted); font-weight: 700; }
.ans .what { grid-column: 2; font-size: 16px; font-weight: 800; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.ans .what small { display: block; font-family: var(--ui); font-size: 12px; font-weight: 800; color: var(--red); }
.ans .votes { grid-column: 3; grid-row: 1; font-size: 11px; font-weight: 800; color: var(--red); text-align: right; }
.ans .pts { grid-column: 3; grid-row: 2; font-weight: 800; text-align: right; min-width: 34px; color: var(--muted); }
.pts.p20 { color: var(--yellow); }
.pts.p10 { color: var(--green); }
.pts.p5 { color: #8fb4ff; }
.pts.p3 { color: #8fb4ff; }
.ans.s-rejected .what, .ans.s-letter .what, .ans.s-nonsense .what, .ans.s-blocked .what, .ans.s-declined .what, .ans.s-notaccepted .what { color: var(--muted); text-decoration: line-through 2px var(--red); }
.ans .what small { text-decoration: none; }
.ans.s-empty .what { color: var(--muted); }
.ans.s-pending .what small { color: #c5d3ff; }
.ans.s-approved .what small { color: var(--green); }
.veto {
  grid-column: 4; grid-row: 1 / span 2;
  border: 1.5px solid var(--line); background: #0d1838; color: var(--text); border-radius: 12px;
  padding: 6px 10px; font-size: 13px; font-weight: 800; cursor: pointer; min-height: 38px; white-space: nowrap;
}
.veto.on { border-color: var(--red); color: var(--red); background: rgba(255, 93, 108, 0.12); }
.veto.approve.on { border-color: var(--green); color: var(--green); background: rgba(43, 211, 107, 0.12); }
.veto.typo.on { border-color: #f59e0b; color: #fbbf24; background: rgba(245, 158, 11, 0.12); }
.ans.s-misspelled .what small { color: #fbbf24; }
.decide { grid-column: 4; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 4px; }
.decide .veto { min-height: 34px; padding: 4px 10px; }

/* Endstand */

.screen.final { padding-bottom: calc(210px + env(safe-area-inset-bottom)); } /* Platz für die Leiste mit zwei Knöpfen */
.final-title { text-align: center; font-size: 40px; margin: 6px 0 4px; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 8px; margin: 18px 0; }
.step { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0; }
.step .av { --size: 64px; }
.step-1 .av { --size: 84px; border-color: var(--yellow); box-shadow: 0 0 24px rgba(255, 205, 46, 0.45); }
.step .crown { width: 30px; height: 30px; margin-bottom: -6px; }
.step .pname { font-weight: 800; overflow-wrap: anywhere; }
.step .total { color: var(--muted); font-weight: 800; }
.step .block {
  width: 100%; display: grid; place-items: center; border-radius: 16px 16px 0 0; margin-top: 4px;
  font-family: var(--title); font-size: 40px; font-weight: 800;
  background: linear-gradient(180deg, #2a4bb0, #1a2c6c); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.15);
}
.step-1 .block { height: 130px; background: linear-gradient(180deg, var(--yellow), var(--yellow2)); color: var(--yellow-ink); }
.step-2 .block { height: 96px; }
.step-3 .block { height: 70px; }
.rest li { grid-template-rows: auto; }
.rest li .av { grid-row: auto; --size: 40px; }

/* Sonstiges */

.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--yellow); animation: spin 0.9s linear infinite; }
#toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); z-index: 30;
  transform: translate(-50%, 20px); opacity: 0; transition: 0.25s; pointer-events: none;
  background: #f5f7ff; color: #14204a; font-weight: 800; padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow);
  max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 360px) {
  .modal:has(.rooms-card) { padding: 10px; }
  .modal-card.rooms-card { padding: 18px 10px 12px; }
  .room-row { gap: 5px; }
  .room-open { padding: 8px 8px; gap: 8px; }
  .room-open .code-mini { font-size: 15px; letter-spacing: 0.05em; }
  .room-row .room-ic, .room-row .room-del { width: 36px; }
  .room-row .room-del.armed { width: 80px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ring { width: 96px; height: 96px; }
  .ring .num { font-size: 30px; }
}

/* Tempo-Bonus */
.ldot.bonus { background: var(--yellow); color: #1a1a2e; border-color: transparent; }
.ldot.bonus .ic { width: 14px; height: 14px; fill: currentColor; }
.bonus-hint { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: 14px; color: #ffe9a3; background: rgba(255, 205, 46, 0.1); border: 1px solid rgba(255, 205, 46, 0.35); border-radius: 14px; padding: 10px 12px; }
.bonus-hint .ic { width: 20px; height: 20px; flex-shrink: 0; color: var(--yellow); fill: currentColor; }
.tempo { margin-bottom: 14px; }
.tempo-h { display: flex; gap: 12px; align-items: flex-start; }
.tempo-h > .ic { width: 28px; height: 28px; color: var(--yellow); fill: currentColor; flex-shrink: 0; margin-top: 2px; }
.tempo-h b { display: block; font-family: var(--title); font-size: 18px; }
.tempo-h small { color: var(--muted); font-size: 13px; line-height: 1.35; display: block; }
.tempo-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.tempo-list li { display: flex; align-items: center; gap: 10px; }
.tempo-list .av { --size: 34px; border-width: 2px; }
.tempo-list .who { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tempo-list .time { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.tempo-list .res { min-width: 44px; text-align: right; font-size: 13px; color: var(--muted); font-weight: 800; }
.tempo-list .res.yes { color: var(--yellow); font-size: 16px; }
