/* Design: helles Blau-Weiß mit dunkelblauer Welle oben, dunkle Pill-Buttons */
:root {
  --navy: #0d1436;
  --navy-2: #1c2754;
  --bg: #e9eef8;
  --card: #ffffff;
  --field: #dfe6f3;
  --line: #d3dcec;
  --text: #0d1436;
  --muted: #5d6789;
  --ok: #1e9e63;
  --ok-2: #137a4b;
  --bad: #d23c44;
  --gold: #e0a400;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.45 "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif; }
body { padding: 0 0 calc(28px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
main { max-width: 720px; margin: 0 auto; padding: 0 16px; }
main.narrow { max-width: 460px; }
h1, h2 { margin: 0 0 .6em; }
h2 { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
a { color: var(--navy-2); word-break: break-all; font-weight: 600; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--bad); min-height: 1em; font-weight: 600; }

/* Kopf mit Welle */
.hero { background: var(--navy); color: #fff; padding: calc(14px + env(safe-area-inset-top)) 20px 0; position: relative; }
.hero-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.hero.hero-big .hero-inner { flex-direction: column; padding: 28px 0 6px; }
.wave { display: block; width: 100%; height: 56px; margin: -1px 0 6px; }
.wave path { fill: var(--navy); }
.logo { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; flex: 1; display: flex; align-items: center; gap: 10px; }
.hero.hero-big .logo { font-size: 2.3rem; flex-direction: column; gap: 10px; }
.logo img { width: 34px; height: 34px; }
.hero.hero-big .logo img { width: 74px; height: 74px; }
.logo i { font-style: normal; font-weight: 400; opacity: .6; font-size: .75em; }
.tagline { color: #b9c3e6; margin: 6px 0 0; font-size: .95rem; }
.room-tag { background: rgba(255, 255, 255, .14); padding: 3px 10px; border-radius: 999px; font-weight: 700; letter-spacing: .1em; font-size: .85rem; }
.room-tag:empty { display: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.dot.on { background: #4ade80; }

.card { background: var(--card); border-radius: 22px; padding: 20px; margin: 14px 0; box-shadow: 0 6px 24px rgba(13, 20, 54, .07); }
form, label { display: flex; flex-direction: column; gap: 10px; }
label { margin-bottom: 12px; color: var(--muted); font-size: .85rem; font-weight: 600; }
input, select {
  font: inherit; color: var(--text); background: var(--field); border: 0;
  border-radius: 999px; padding: 12px 18px; width: 100%; outline: none;
}
input:focus, select:focus { box-shadow: 0 0 0 2px var(--navy-2); }
#code { text-transform: uppercase; text-align: center; font-size: 1.6rem; letter-spacing: .3em; font-weight: 800; }

button, .btn {
  font: inherit; font-weight: 700; color: #fff; background: var(--navy); border: 0; border-radius: 999px;
  padding: 11px 18px; cursor: pointer; text-decoration: none; display: inline-block; text-align: center;
}
button:disabled { opacity: .35; cursor: not-allowed; }
.big { display: block; width: 100%; padding: 15px; font-size: 1.05rem; margin: 10px 0; }
.big small { opacity: .75; font-weight: 600; }
.pill { padding: 10px 18px; }
.pill.light { background: var(--field); color: var(--navy); }
.ghost { display: block; width: 100%; background: transparent; color: var(--muted); margin-top: 8px; }
.ghost-dark { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.row { display: flex; gap: 10px; align-items: center; }
.row select, .row input { flex: 1; }
.row.wrap { flex-wrap: wrap; justify-content: center; margin-top: 14px; }

.code { font-size: 3.6rem; font-weight: 900; letter-spacing: .15em; color: var(--navy); }
.big-num { font-size: 2.4rem; font-weight: 900; margin: 6px 0; }
.badge { display: inline-block; background: var(--navy); color: #fff; border-radius: 999px; padding: 5px 14px; font-weight: 700; font-size: .9rem; margin-bottom: 10px; }
.bonus { color: var(--ok-2); font-weight: 700; }
.result { font-size: 1.7rem; font-weight: 900; margin-bottom: 6px; }

.scores { list-style: none; margin: 0; padding: 0; }
.scores li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.scores li:last-child { border: 0; }
.scores li.me .pname { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.scores li.offline { opacity: .4; }
.pname { flex: 1; font-weight: 700; }
.ptag { color: var(--muted); font-size: .78rem; }
.pscore { font-weight: 900; font-size: 1.2rem; min-width: 3.5em; text-align: right; }
.pscore small { color: var(--muted); font-weight: 500; font-size: .7rem; }
.x { background: transparent; color: var(--muted); padding: 4px 8px; }

.track { display: flex; gap: 14px; align-items: center; text-align: left; background: var(--bg); border-radius: 18px; padding: 10px; margin: 12px 0; }
.track img, .noimg { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; flex: none; }
.noimg { display: grid; place-items: center; background: var(--field); font-size: 2rem; }
.tname { font-weight: 800; font-size: 1.1rem; }
.tartist { color: var(--muted); }
.towners { font-size: .8rem; color: var(--navy-2); margin-top: 4px; font-weight: 600; }

.who { font-size: 2.1rem; font-weight: 900; }
.buzzed { box-shadow: 0 0 0 3px var(--navy), 0 10px 40px rgba(13, 20, 54, .2); }
.win { box-shadow: 0 0 0 3px var(--gold), 0 10px 40px rgba(224, 164, 0, .25); }
.trophy { font-size: 4rem; }
.pulse { font-size: 3.6rem; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.2); opacity: .5; } }
.countdown { display: inline-block; margin: 8px 0; padding: 6px 16px; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 800; font-size: 1.2rem; }
.countdown.done { background: var(--bad); }

.event { background: var(--navy); color: #fff; }
.event .muted { color: #b9c3e6; }
.eicon { font-size: 3.6rem; }
.ename { font-size: 2rem; font-weight: 900; margin-bottom: 8px; }

.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toggle { display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 18px; padding: 12px 8px; background: var(--field); color: var(--muted); }
.toggle.on { background: var(--navy); color: #fff; }
.ticon { font-size: 1.6rem; }
.tname { font-size: .9rem; }
.tstate { font-size: .72rem; opacity: .75; text-transform: uppercase; letter-spacing: .08em; }

.guesses { list-style: none; padding: 0; margin: 6px 0; }
.guesses li { padding: 4px 0; }
.guesses li.win { font-weight: 800; color: var(--ok-2); }
.victims .big small { opacity: .7; }

.judge { display: grid; gap: 2px; }
.big.bad { background: var(--bad); }
.big.ok { background: var(--ok-2); }
.big.ok2 { background: var(--ok); }

.buzzer {
  display: block; width: min(76vw, 330px); aspect-ratio: 1; margin: 22px auto; border-radius: 50%;
  font-size: 2.6rem; font-weight: 900; letter-spacing: .04em;
  background: radial-gradient(circle at 35% 30%, #34417a, var(--navy) 60%, #050a1f);
  box-shadow: 0 12px 0 #050a1f, 0 22px 40px rgba(13, 20, 54, .35), inset 0 0 0 8px rgba(255, 255, 255, .08);
  user-select: none; touch-action: manipulation; transition: transform .05s, box-shadow .05s;
}
.buzzer:active, .buzzer.pressed { transform: translateY(10px); box-shadow: 0 2px 0 #050a1f, 0 8px 20px rgba(13, 20, 54, .3); }
.buzzer:disabled { background: var(--field); color: var(--muted); box-shadow: none; font-size: 1.3rem; opacity: 1; }

/* Kein Text-Cursor "|" und keine Textmarkierung beim Antippen – nur in Eingabefeldern */
body { -webkit-user-select: none; user-select: none; caret-color: transparent; cursor: default; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; caret-color: var(--navy); cursor: text; }
button, .btn, select, a, .toggle { cursor: pointer; }
:focus:not(input):not(select) { outline: none; }

.preg { padding: 10px 0; border-bottom: 1px solid var(--line); }
.preg .row.wrap { justify-content: flex-start; margin-top: 8px; }
.pending { box-shadow: 0 0 0 2px var(--navy), 0 6px 24px rgba(13, 20, 54, .07); }
details { margin-top: 10px; }
summary { cursor: pointer; font-weight: 600; }

.cats .tstate { text-transform: none; letter-spacing: 0; }

/* ---------- Startseite ---------- */
.home .hero.hero-big .hero-inner { padding: 34px 0 4px; text-align: center; gap: 6px; }
.home-icon { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.home-title { font-size: 2.2rem; font-weight: 900; letter-spacing: -.02em; margin-top: 8px; }
.home-title i { font-style: normal; font-weight: 400; opacity: .55; font-size: .7em; }
.home .tagline { letter-spacing: .04em; }
.home main { margin-top: -18px; position: relative; }

.join-row { flex-direction: row; gap: 10px; }
.join-row input { flex: 1; text-transform: uppercase; text-align: center; font-size: 1.5rem; font-weight: 800; letter-spacing: .35em; padding: 12px 10px; }
.join-row input::placeholder { color: #9aa6c6; letter-spacing: .25em; font-weight: 700; }
.join-row .go { padding: 0 26px; font-size: 1.1rem; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 22px 4px 4px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.modes { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 14px 0; }
.mode {
  display: flex; align-items: center; gap: 16px; text-align: left; width: 100%;
  background: var(--card); color: var(--text); border-radius: 22px; padding: 18px 20px;
  box-shadow: 0 6px 24px rgba(13, 20, 54, .07); transition: transform .1s;
}
.mode:active { transform: scale(.98); }
.mode.on { background: var(--navy); color: #fff; }
.mode-icon { font-size: 1.7rem; width: 54px; height: 54px; flex: none; display: grid; place-items: center; border-radius: 16px; background: var(--field); }
.mode.on .mode-icon { background: rgba(255, 255, 255, .12); }
.mode-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.mode-name { font-size: 1.12rem; font-weight: 800; }
.mode-text { font-size: .82rem; font-weight: 500; line-height: 1.35; opacity: .7; }
.mode-arrow { font-size: 1.4rem; font-weight: 700; opacity: .5; transition: transform .15s; }
.mode.on .mode-arrow { transform: rotate(90deg); opacity: .9; }

.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 4px 0 8px; }
.stepper .pill { width: 52px; height: 52px; padding: 0; font-size: 1.6rem; line-height: 1; }
.stepper span { font-size: 2.4rem; font-weight: 900; min-width: 2.2em; text-align: center; }
#cats { margin-bottom: 18px; }
#cats h2 small { text-transform: none; letter-spacing: 0; font-weight: 500; }

.qr { display: block; width: min(64vw, 240px); aspect-ratio: 1; margin: 8px auto 4px; border-radius: 16px; background: #fff; }

/* ---------- Handy während einer Runde: kein Scrollen ---------- */
body.game { height: 100dvh; overflow: hidden; overscroll-behavior: none; position: fixed; inset: 0; padding-bottom: 0; display: flex; flex-direction: column; touch-action: manipulation; }
body.game .wave { height: 28px; margin-bottom: 0; flex: none; }
body.game .hero { flex: none; padding-top: calc(8px + env(safe-area-inset-top)); }
body.game main { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
body.game #msg:empty { display: none; }
body.game #view { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
body.game #view > * { flex: none; }
body.game .card { margin: 6px 0; padding: 16px; }
body.game .mini { margin-top: auto; }
body.game .buzzer { width: min(78vw, 44dvh, 340px); margin: 10px auto; }
body.game .big { padding: 13px; margin: 6px 0; }
body.game .track { margin: 8px 0; }
body.game .track img, body.game .noimg { width: 64px; height: 64px; }
body.game .who { font-size: 1.8rem; }
body.game .eicon { font-size: 2.8rem; }
.mini { display: flex; justify-content: space-between; gap: 8px; background: var(--card); border-radius: 999px; padding: 10px 18px; font-size: .9rem; box-shadow: 0 6px 24px rgba(13, 20, 54, .07); }
