:root {
  /* Defence-Tech trifft Weihnachten: Anthrazit, Oliv, Sand, Signalorange + Weihnachtsrot/-gold */
  --bg: #121614; --bg2: #1a201c; --card: #1e2620; --line: #3b4a3c; --text: #ebe6d6; --muted: #9ea793;
  --sand: #c9b98a; --signal: #ff7a1a; --xmas: #b3202c; --gold: #d4a52a;
  --red: #a3242f; --green: #3b6b45; --blue: #3e5f7a;
  --ok: #7bc47f; --bad: #ff5a4a;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    linear-gradient(rgba(201,185,138,.045) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(201,185,138,.045) 1px, transparent 1px) 0 0 / 40px 40px,
    radial-gradient(ellipse at top, #24302a 0%, var(--bg) 65%) fixed;
  color: var(--text); -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; border: 0; border-radius: 6px; color: #fff; }
button:disabled { opacity: .45; cursor: default; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 18px; position: relative; }
.btn { background: var(--signal); color: #1a1208; text-transform: uppercase; letter-spacing: .06em; padding: 14px 22px; font-weight: 700; font-size: 1.1rem; }
.btn.secondary { background: #2c372e; color: var(--text); border: 1px solid var(--line); }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #2b4a6f; font-size: .85rem; }

/* Schnee im Hintergrund */
.snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.snow i { position: absolute; top: -10px; color: #fff; opacity: .5; animation: fall linear infinite; }
@keyframes fall { to { transform: translateY(110vh) translateX(30px); } }
main { position: relative; z-index: 1; }

/* Antwortfarben */
.a0 { background: var(--red); } .a1 { background: var(--green); }
.a2 { background: #a8822a; } .a3 { background: var(--blue); }
.shape { font-size: 1.3em; margin-right: .4em; opacity: .9; }

/* ---------- Spieler (Handy) ---------- */
.player main { max-width: 560px; margin: 0 auto; padding: 16px; min-height: 100vh; display: flex; flex-direction: column; gap: 14px; }
.player h1 { font-size: 1.6rem; margin: 8px 0; }
.player input { width: 100%; padding: 14px; font-size: 1.2rem; border-radius: 12px; border: 2px solid #2b4a6f; background: #0f2236; color: var(--text); }
.topbar { display: flex; justify-content: space-between; align-items: center; font-size: .95rem; }
.qtext { font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.answers { display: grid; grid-template-columns: 1fr; gap: 10px; transition: filter .3s; }
.answers button { padding: 18px 14px; font-size: 1.1rem; font-weight: 600; text-align: left; min-height: 64px; display: flex; align-items: center; transition: transform .25s, opacity .2s; }
.answers button.chosen { outline: 4px solid #fff; }
.answers button.removed { visibility: hidden; }
.answers.locked button:not(.chosen) { opacity: .35; }
.timebar { height: 10px; background: #0f2236; border-radius: 6px; overflow: hidden; }
.timebar > div { height: 100%; background: var(--gold); width: 100%; }
.effect-banner { padding: 10px 14px; border-radius: 12px; background: #4a2a6a; font-weight: 600; }
.effect-banner.bad { background: #6a2a2a; }
.result { font-size: 2.2rem; font-weight: 800; }
.result.ok { color: var(--ok); } .result.bad { color: var(--bad); }
.fact { background: #12304d; border-left: 4px solid var(--gold); padding: 12px 14px; border-radius: 10px; line-height: 1.4; }
.bonus-list { display: grid; gap: 10px; }
.bonus-list button { background: #2b4a6f; padding: 14px; text-align: left; display: flex; gap: 12px; align-items: center; }
.bonus-list button.attack { background: #6a2a2a; }
.bonus-list .ico { font-size: 2rem; }
.bonus-list small { display: block; color: #dbe4ee; font-weight: 400; }
.big-rank { font-size: 3.2rem; font-weight: 800; }

/* Schneesturm-Effekt */
.blizzard-overlay { position: absolute; inset: 0; pointer-events: none; border-radius: 14px;
  background-image: radial-gradient(#fff 1.5px, transparent 2px), radial-gradient(#fff 1px, transparent 1.5px);
  background-size: 24px 24px, 13px 13px; animation: blizz 1s linear infinite; opacity: .8; transition: opacity 1s; }
@keyframes blizz { to { background-position: 24px 48px, -13px 26px; } }
.answers-wrap { position: relative; }

/* ---------- Host (Beamer) ---------- */
.host main { padding: 3vh 4vw; min-height: 100vh; display: flex; flex-direction: column; gap: 2.5vh; }
.host h1 { font-size: 4.5vh; margin: 0; }
.lobby { display: grid; grid-template-columns: auto 1fr; gap: 4vw; align-items: start; }
.qr { background: #fff; padding: 2vh; border-radius: 18px; width: 42vh; }
.qr svg { width: 100%; height: auto; display: block; }
.joinurl { font-size: 3vh; font-weight: 700; margin-top: 1vh; word-break: break-all; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: #2b4a6f; padding: 8px 14px; border-radius: 999px; font-size: 2.3vh; animation: pop .3s; }
.chip.off { opacity: .4; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.hq { font-size: 5vh; font-weight: 800; line-height: 1.2; }
.hanswers { display: grid; grid-template-columns: 1fr 1fr; gap: 2vh; }
.hanswers div { padding: 3vh 2vw; border-radius: 16px; font-size: 3.4vh; font-weight: 700; display: flex; align-items: center; position: relative; overflow: hidden; }
.hanswers div.dim { opacity: .3; }
.hanswers div.right { outline: 6px solid #fff; }
.hanswers .count { margin-left: auto; font-size: 3vh; background: rgba(0,0,0,.25); padding: 4px 14px; border-radius: 10px; }
.hstatus { display: flex; justify-content: space-between; align-items: center; font-size: 3vh; }
.clock { font-size: 7vh; font-weight: 800; min-width: 12vh; text-align: center; background: var(--card); border-radius: 50%; width: 14vh; height: 14vh; display: flex; align-items: center; justify-content: center; }
.hfact { font-size: 3vh; background: #12304d; border-left: 8px solid var(--gold); padding: 2vh 2vw; border-radius: 12px; line-height: 1.35; }
.board { display: grid; gap: 1vh; }
.row { display: grid; grid-template-columns: 7vh 1fr auto auto; gap: 2vw; align-items: center; background: var(--card); padding: 1.3vh 2vw; border-radius: 12px; font-size: 3vh; transition: transform .4s; }
.row .rk { font-weight: 800; }
.row .delta { color: var(--ok); font-size: 2.4vh; }
.row.leader { border: 2px solid var(--gold); }
.row.trailer { border: 2px dashed #b48ae0; }
.events { display: grid; gap: 1vh; }
.event { font-size: 3vh; background: #4a2a6a; padding: 1.4vh 2vw; border-radius: 12px; animation: pop .4s; }
.event.attack { background: #6a2a2a; }
.controls { position: fixed; bottom: 2vh; right: 2vw; display: flex; gap: 10px; z-index: 5; opacity: .35; transition: opacity .2s; }
.controls:hover { opacity: 1; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 3vw; margin-top: 4vh; }
.podium > div { text-align: center; }
.podium .step { background: var(--card); border-radius: 14px 14px 0 0; width: 22vw; display: flex; align-items: center; justify-content: center; font-size: 8vh; font-weight: 800; }
.podium .nm { font-size: 4vh; font-weight: 800; } .podium .sc { font-size: 2.6vh; color: var(--muted); }
.login { max-width: 420px; margin: 20vh auto; display: grid; gap: 12px; }
.login input { padding: 14px; font-size: 1.2rem; border-radius: 12px; border: 0; }
#v-game { display: flex; flex-direction: column; gap: 14px; }
#view { display: flex; flex-direction: column; gap: 2.5vh; }

/* ---------- Thema: Defence-Tech x Weihnachten ---------- */
h1, h2, .hq, .qtext { letter-spacing: .01em; }
h1 { text-transform: uppercase; letter-spacing: .05em; }
.label, .tag { font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--sand); font-size: .85rem; }
.brand .tag { color: var(--signal); }
.brand .tag::before { content: "◉ "; color: var(--xmas); animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.brand h1 { margin: 2px 0 0; }
.brand h1::after { content: " 🎄"; }
.chip-range { display: inline-block; font-family: var(--mono); font-size: .8em; padding: 2px 8px; border: 1px solid var(--sand); color: var(--sand); border-radius: 3px; margin-left: 6px; letter-spacing: .08em; }
.pill { border-radius: 3px; background: #2c372e; border: 1px solid var(--line); font-family: var(--mono); }
.snow i { color: #e9f1ea; opacity: .35; }

/* Eckwinkel wie in einem Zielfernrohr/HUD */
.card::before, .card::after, .hfact::before, .qr::before {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none; }
.card::before { top: -1px; left: -1px; border-top: 2px solid var(--signal); border-left: 2px solid var(--signal); }
.card::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--signal); border-right: 2px solid var(--signal); }

/* Antworten */
.answers button, .hanswers div { border: 1px solid rgba(255,255,255,.12); box-shadow: inset 4px 0 0 rgba(255,255,255,.25); }
.answers button.chosen, .hanswers div.right { outline: 3px solid var(--signal); outline-offset: 2px; }
.shape { font-family: var(--mono); }

/* Zeitbalken wie eine Entfernungsskala */
.timebar { height: 12px; border-radius: 2px; border: 1px solid var(--line);
  background: repeating-linear-gradient(90deg, transparent 0 9%, rgba(201,185,138,.35) 9% 10%), #0e1210; }
.timebar > div { background: var(--signal); }

/* Host-Uhr als Fadenkreuz */
.clock { position: relative; background: transparent; border: 3px solid var(--sand); font-family: var(--mono); color: var(--text); }
.clock::before, .clock::after { content: ""; position: absolute; background: var(--sand); }
.clock::before { left: 50%; top: -1.6vh; bottom: -1.6vh; width: 2px; transform: translateX(-50%);
  -webkit-mask: linear-gradient(#000 0 2.4vh, transparent 2.4vh calc(100% - 2.4vh), #000 0); mask: linear-gradient(#000 0 2.4vh, transparent 2.4vh calc(100% - 2.4vh), #000 0); }
.clock::after { top: 50%; left: -1.6vh; right: -1.6vh; height: 2px; transform: translateY(-50%);
  -webkit-mask: linear-gradient(90deg, #000 0 2.4vh, transparent 2.4vh calc(100% - 2.4vh), #000 0); mask: linear-gradient(90deg, #000 0 2.4vh, transparent 2.4vh calc(100% - 2.4vh), #000 0); }

/* Host */
.qr { border-radius: 6px; position: relative; outline: 2px solid var(--sand); outline-offset: 8px; }
.chip { border-radius: 3px; background: #2c372e; border: 1px solid var(--line); font-family: var(--mono); }
.row { border-radius: 4px; border: 1px solid var(--line); background: var(--card); }
.row .rk, .row b, .big-rank, .podium .step { font-family: var(--mono); }
.row.leader { border: 1px solid var(--signal); box-shadow: inset 4px 0 0 var(--signal); }
.event { border-radius: 4px; background: #2a3a2c; border-left: 4px solid var(--gold); }
.event.attack { background: #3a2020; border-left-color: var(--bad); }
.hfact, .fact { background: #1a221c; border-left-color: var(--gold); border-radius: 4px; position: relative; }
.effect-banner { border-radius: 4px; background: #2a3a2c; border-left: 4px solid var(--gold); }
.effect-banner.bad { background: #3a2020; border-left-color: var(--bad); }
.bonus-list button { background: #2a3a2c; border: 1px solid var(--line); }
.bonus-list button.attack { background: #3a2020; border-color: #6a3030; }
.podium .step { background: linear-gradient(#2c372e, #1e2620); border: 1px solid var(--line); border-bottom: 0; border-radius: 4px 4px 0 0; }
.player input { border-radius: 4px; border: 1px solid var(--line); background: #0e1210; font-family: var(--mono); }
.controls .btn { font-size: .95rem; }
.blizzard-overlay { border-radius: 6px; }
/* Weihnachtliche "Warnmarkierung" oben und unten */
body::before, body::after { content: ""; position: fixed; left: 0; right: 0; height: 6px; z-index: 2;
  background: repeating-linear-gradient(-45deg, var(--xmas) 0 14px, var(--gold) 14px 28px); opacity: .85; }
body::before { top: 0; } body::after { bottom: 0; }
