:root {
  --red: #e3000f;
  --red-dark: #b5000c;
  --red-soft: #fde8e9;
  --grey: #4d4d4d;
  --grey-2: #8a8a8a;
  --line: #e4e4e4;
  --bg: #ffffff;
  --panel: #f6f6f6;
  --gold: #c9a227;
  --ok: #1f8a4c;
  --ok-soft: #e6f4ec;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0, 0, 0, .07);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1d1d1d;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100vh; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; }
p { margin: 0 0 .7em; }
.muted { color: var(--grey-2); }
.small { font-size: .85em; }
[hidden] { display: none !important; }

/* Kopf mit Weihnachtsband */
.topbar {
  position: sticky; top: 0; z-index: 20; background: #fff;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 4px;
  background: repeating-linear-gradient(90deg, var(--red) 0 18px, #fff 18px 24px, var(--grey) 24px 30px, #fff 30px 36px);
}
.logo { height: 28px; width: auto; }
.logo-text { font-weight: 800; letter-spacing: .14em; color: var(--red); font-size: 18px; }
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-size: 15px; }
.brand small { color: var(--grey-2); font-size: 11px; }
.grow { flex: 1; }

/* Schnee */
.snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.snow i { position: absolute; top: -20px; color: #d6d6d6; font-style: normal; animation: fall linear infinite; }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); } }
main, .page { position: relative; z-index: 1; }

/* Bausteine */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card.red { border-top: 4px solid var(--red); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--panel); color: var(--grey); }
.pill.red { background: var(--red); color: #fff; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.btn {
  appearance: none; border: 0; border-radius: 12px; padding: 13px 18px; font: inherit; font-weight: 600;
  background: var(--red); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .06s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn:hover { background: var(--red-dark); }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--grey); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--grey-2); background: #fff; }
.btn.grey { background: var(--grey); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input, textarea, select {
  font: inherit; width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 11px; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--red); }
label { display: block; font-weight: 600; font-size: 14px; margin: 10px 0 6px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { min-width: 0; }
.stack > * + * { margin-top: 10px; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #222; color: #fff;
  padding: 11px 18px; border-radius: 10px; z-index: 100; max-width: 92vw; font-size: 14px; box-shadow: var(--shadow);
}
.toast.err { background: var(--red); }
body.offline::before {
  content: "Verbindung wird wiederhergestellt …"; position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: var(--grey); color: #fff; text-align: center; font-size: 13px; padding: 5px;
}

/* Avatare */
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--red-soft); color: var(--red); font-weight: 800; }
.avatar.big { width: 84px; height: 84px; font-size: 32px; }

/* Rangliste */
.scoreboard { list-style: none; margin: 0; padding: 0; }
.scoreboard li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.scoreboard li.me { background: var(--red-soft); border-radius: 10px; }
.scoreboard .rank { width: 28px; font-weight: 800; color: var(--grey-2); text-align: center; }
.scoreboard li:nth-child(1) .rank { color: var(--gold); }
.scoreboard .tname { flex: 1; font-weight: 600; display: flex; flex-direction: column; }
.scoreboard .tname small { font-weight: 400; color: var(--grey-2); font-size: 12px; }
.scoreboard .score { font-weight: 800; font-size: 20px; color: var(--red); }

/* Optionen */
.options { display: grid; gap: 10px; }
.opt {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; padding: 14px; border-radius: 12px;
  border: 2px solid var(--line); background: #fff; font: inherit; cursor: pointer; color: inherit;
}
.opt .key { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--panel); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--grey); }
.opt.sel { border-color: var(--red); background: var(--red-soft); }
.opt.sel .key { background: var(--red); color: #fff; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .key { background: var(--ok); color: #fff; }
.opt:disabled { cursor: default; opacity: .55; }
.opt.own { opacity: .5; }

/* Timer */
.timer { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--grey); background: var(--panel); padding: 4px 12px; border-radius: 99px; }
.timer.urgent { background: var(--red); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }

.emoji-big { font-size: 42px; letter-spacing: 4px; line-height: 1.2; word-break: break-word; }
.done-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.done-dot.on { background: var(--ok); }
.topbar .logo { height: 34px; }
