:root {
  --bg: #0d0b1f;
  --bg2: #17133a;
  --card: #201a4d;
  --card2: #2a2363;
  --line: #3b3380;
  --text: #f3f0ff;
  --muted: #a9a3d6;
  --accent: #ffcc33;
  --accent2: #ff4f8b;
  --ok: #2fd47a;
  --bad: #ff4d5e;
  --blue: #3fa9ff;
  --radius: 14px;
  --a: #ff4f6d; --b: #3fa9ff; --c: #ffb627; --d: #2fd47a; --e: #b06bff; --f: #ff7ad9;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: radial-gradient(1200px 700px at 20% -10%, #3a1f7a 0%, transparent 60%),
              radial-gradient(1000px 600px at 110% 110%, #5a1450 0%, transparent 55%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; }
.center { text-align: center; }
.card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.logo {
  font-weight: 900; letter-spacing: .02em;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  background: #120f2c; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 60px; }
label { display: block; font-size: .85em; color: var(--muted); margin-bottom: 4px; }
button, .btn {
  background: var(--card2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-block;
  transition: transform .05s, filter .15s; color: var(--text); white-space: nowrap;
}
button:hover, .btn:hover { filter: brightness(1.2); }
button:active { transform: scale(.97); }
button:disabled { opacity: .4; cursor: not-allowed; filter: none; }
button.primary, .btn.primary { background: linear-gradient(90deg, #ffb800, #ff7a00); color: #1b1200; border: none; }
button.pink { background: linear-gradient(90deg, #ff4f8b, #c22dff); border: none; }
button.ok { background: var(--ok); color: #04210f; border: none; }
button.bad { background: var(--bad); border: none; }
button.ghost { background: transparent; }
button.sm { padding: 5px 9px; font-size: .85em; border-radius: 8px; }
button.big { padding: 16px 22px; font-size: 1.2em; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; background: #120f2c; border: 1px solid var(--line); font-size: .8em; }
.pill.ok { background: rgba(47,212,122,.15); border-color: var(--ok); color: var(--ok); }
.pill.bad { background: rgba(255,77,94,.15); border-color: var(--bad); color: var(--bad); }
.pill.gold { background: rgba(255,204,51,.15); border-color: var(--accent); color: var(--accent); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #000c; border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; z-index: 99;
  max-width: 90vw;
}

/* ---------- Frage-Darstellung ---------- */
.runde { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-weight: 800; font-size: .85em; }
.frage-text { font-size: 1.5em; font-weight: 800; margin: .3em 0 .6em; }
.media { position: relative; display: flex; justify-content: center; align-items: center; margin: 10px 0; }
.media img { max-width: 100%; max-height: 55vh; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.5); image-rendering: auto; }
.media img.pixel { image-rendering: pixelated; }
.stufe-badge { position: absolute; top: 8px; left: 8px; }
.timer {
  font-variant-numeric: tabular-nums; font-weight: 900; font-size: 1.4em;
  padding: 4px 14px; border-radius: 99px; background: #120f2c; border: 2px solid var(--accent);
}
.timer.low { border-color: var(--bad); color: var(--bad); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.sound-wave { font-size: 4em; text-align: center; padding: 20px; }
.sound-wave.playing { animation: pulse .4s infinite alternate; }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt {
  padding: 18px 14px; border-radius: 14px; font-size: 1.1em; font-weight: 800; border: 3px solid transparent;
  text-align: left; white-space: normal; display: flex; gap: 10px; align-items: center;
}
.opt .l { background: #0005; border-radius: 8px; padding: 2px 9px; }
.opt.o0 { background: var(--a); } .opt.o1 { background: var(--b); } .opt.o2 { background: var(--c); color: #231600; }
.opt.o3 { background: var(--d); color: #04210f; } .opt.o4 { background: var(--e); } .opt.o5 { background: var(--f); }
.opt.sel { border-color: #fff; box-shadow: 0 0 0 4px #fff4; }
.opt.dim { opacity: .3; }
.opt.right { border-color: #fff; outline: 4px solid var(--ok); }

/* ---------- Buzzer ---------- */
.buzzer {
  width: min(70vw, 300px); height: min(70vw, 300px); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a9a, #e0102e 55%, #8a0016);
  border: 10px solid #2b0710; box-shadow: 0 14px 0 #4a0010, 0 20px 40px rgba(0,0,0,.5);
  font-size: 2.2em; font-weight: 900; color: #fff; text-shadow: 0 3px 0 #0006; margin: 10px auto; display: block;
}
.buzzer:active:not(:disabled) { transform: translateY(10px); box-shadow: 0 4px 0 #4a0010, 0 10px 20px rgba(0,0,0,.5); }
.buzzer:disabled { filter: grayscale(.8) brightness(.6); opacity: 1; }
.buzzed-banner {
  font-size: 2em; font-weight: 900; text-align: center; padding: 20px; border-radius: 16px;
  background: linear-gradient(90deg, #ff4f8b, #ffb800); color: #1b0010; animation: pop .3s;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* ---------- Spielerliste ---------- */
.plist { display: flex; flex-direction: column; gap: 6px; }
.pl { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #120f2c; border: 1px solid var(--line); }
.pl .name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .pts { font-weight: 900; color: var(--accent); min-width: 2.5em; text-align: right; font-variant-numeric: tabular-nums; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #555; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.dot.local { background: var(--blue); }
.pl.me { border-color: var(--accent); }
.pl.buzz { border-color: var(--accent2); background: #3a0f2b; }

/* ---------- Rangliste ---------- */
.ranking { display: flex; flex-direction: column; gap: 8px; max-width: 600px; margin: 0 auto; }
.rank { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 1.2em; animation: pop .4s backwards; }
.rank .pos { font-weight: 900; width: 2em; text-align: center; }
.rank.p1 { background: linear-gradient(90deg, #6b5200, var(--card)); border-color: var(--accent); }
.rank.p2 { background: linear-gradient(90deg, #555, var(--card)); }
.rank.p3 { background: linear-gradient(90deg, #6b3a12, var(--card)); }

.answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.ans { padding: 10px 12px; border-radius: 10px; background: #120f2c; border: 2px solid var(--line); }
.ans.ok { border-color: var(--ok); }
.ans.bad { border-color: var(--bad); opacity: .85; }
.ans .who { font-size: .8em; color: var(--muted); }
.ans .what { font-weight: 800; word-break: break-word; }

/* ---------- Layouts ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 14px; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #0007; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px); }
.overlay { position: fixed; inset: 0; background: #0b0920ee; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; overflow: auto; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button.active { background: var(--accent); color: #1b1200; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } .opts { grid-template-columns: 1fr; } }

/* ---------- Teams ---------- */
.tdot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; flex: none; vertical-align: middle; }
.teamrow { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 10px; background: #120f2c; border: 1px solid var(--line); border-left-width: 6px; }
.teamrow .name { flex: 1; font-weight: 800; }
.teamrow .members { font-size: .8em; color: var(--muted); }
.teamrow .pts { font-weight: 900; color: var(--accent); font-size: 1.2em; font-variant-numeric: tabular-nums; }
.teampick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.teampick button { border-width: 3px; padding: 14px; white-space: normal; }
.teampick button.mine { box-shadow: 0 0 0 3px #fff; }
.pl select { width: auto; padding: 3px 6px; font-size: .8em; }

/* ---------- Jeopardy-Brett ---------- */
.board { display: grid; gap: 8px; }
.bcat { background: linear-gradient(180deg, #2b3fc4, #1b2a8a); border-radius: 10px; padding: 10px 6px; text-align: center; font-weight: 900;
  text-transform: uppercase; letter-spacing: .04em; font-size: .9em; display: flex; align-items: center; justify-content: center; min-height: 56px; word-break: break-word; }
.bcell { background: linear-gradient(180deg, #2a39b0, #16207a); border: 2px solid #3b4fd8; border-radius: 10px; color: var(--accent);
  font-weight: 900; font-size: 1.6em; display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 6px;
  text-shadow: 0 2px 0 #0008; white-space: nowrap; }
button.bcell:hover { filter: brightness(1.3); }
.bcell.done { opacity: .18; color: transparent; text-shadow: none; }
.bcell .ico { font-size: .5em; margin-left: 4px; opacity: .8; }
.chooser { text-align: center; font-size: 1.2em; margin: 6px 0 12px; }
.chooser b { color: var(--accent); }

/* ---------- Karte (GeoGuessr) ---------- */
.gmap { width: 100%; height: 50vh; min-height: 280px; border-radius: 12px; overflow: hidden; background: #0b0920; border: 1px solid var(--line); }
.gmap.big { height: 52vh; }
.gmap.leaflet-container, .gmap .leaflet-container { font: inherit; background: #10142e; }
.gpin { background: none; border: none; }
.gpin .d { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 6px #000a; position: absolute; left: -9px; top: -9px; }
.gpin .n { position: absolute; left: 12px; top: -11px; background: #000c; color: #fff; padding: 1px 7px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.gpin.me .d { width: 24px; height: 24px; left: -12px; top: -12px; }
.gziel { background: none; border: none; font-size: 30px; line-height: 1; }
.gziel span { position: absolute; left: -15px; top: -28px; filter: drop-shadow(0 2px 3px #000); }

/* ---------- Zeitstrahl ---------- */
.tl { display: flex; align-items: stretch; gap: 8px; overflow-x: auto; padding: 6px 2px 10px; }
.tl .end { flex: none; display: flex; align-items: center; font-weight: 900; color: var(--accent); writing-mode: vertical-rl; transform: rotate(180deg); padding: 4px; }
.tl .end.r { transform: none; }
.tlitem { flex: 1 0 120px; max-width: 220px; background: #120f2c; border: 2px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-weight: 800; position: relative; }
.tlitem img { max-width: 100%; max-height: 120px; border-radius: 8px; }
.tlitem .info { color: var(--accent); font-size: .9em; }
.tlitem .nr { position: absolute; top: -10px; left: -6px; background: var(--accent); color: #1b1200; border-radius: 99px; padding: 0 7px; font-size: .8em; }
.tlitem.ok { border-color: var(--ok); } .tlitem.bad { border-color: var(--bad); }
.tlline { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--blue), var(--accent2)); margin: 2px 0 8px; }
.tlsort { display: flex; flex-direction: column; gap: 8px; }
.tlsort .tlrow { display: flex; align-items: center; gap: 10px; background: #120f2c; border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; font-weight: 800; cursor: grab; touch-action: none; user-select: none; }
.tlsort .tlrow img { height: 56px; max-width: 90px; object-fit: cover; border-radius: 8px; }
.tlsort .tlrow .grip { color: var(--muted); font-size: 1.3em; }
.tlsort .tlrow .pos { background: var(--card2); border-radius: 8px; padding: 2px 8px; font-size: .85em; }
.tlsort .ghost { opacity: .35; } .tlsort .chosen { border-color: var(--accent); }
.tlend { text-align: center; font-weight: 900; color: var(--accent); }
.note { background: rgba(255,204,51,.08); border: 1px dashed var(--accent); padding: 10px; border-radius: 10px; white-space: pre-wrap; }

a.logo { text-decoration: none; font-weight: 900; cursor: pointer; }
a.logo:hover { filter: brightness(1.2); }
.navsel { width: auto; padding: 4px 28px 4px 10px; border-radius: 99px; font-size: .85em; font-weight: 700; background-color: #120f2c; cursor: pointer; }
.vol { display: flex; align-items: center; gap: 8px; }
.vol input[type=range] { width: 160px; padding: 0; accent-color: var(--accent); }

/* ---------- Clickable (wie Sporcle) ---------- */
.kstats { gap: 6px; }
.khint { display: flex; align-items: center; gap: 10px; }
.kclue { flex: 1; text-align: center; font-size: 1.35em; font-weight: 800; min-height: 2.4em; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.kclue img { max-height: 150px; max-width: 100%; border-radius: 10px; }
.ktiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; background: #0006; padding: 12px; border-radius: 12px; }
.ktile { background: #55556a; border: 1px solid #7a7a90; border-radius: 6px; padding: 9px 13px; font-size: 1.05em; font-weight: 600; white-space: normal; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ktile img { max-height: 70px; max-width: 120px; border-radius: 4px; }
.ktile:hover:not(:disabled) { background: #6c6c85; filter: none; }
.ktile.weg { background: var(--ok); color: #04210f; opacity: .35; pointer-events: none; }
.ktile.bad { background: var(--bad); animation: shake .35s; }
.ktile.good { background: var(--ok); color: #04210f; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.kprog { display: flex; flex-direction: column; gap: 6px; }
.kprog .bar { height: 10px; border-radius: 5px; background: #120f2c; overflow: hidden; }
.kprog .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #8af0b8); }
.ksol { width: 100%; border-collapse: collapse; }
.ksol td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.ksol td:last-child { font-weight: 800; color: var(--ok); }
.kboxes { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.kbox { min-width: 22px; height: 26px; border: 2px solid #ffffff88; border-radius: 4px; padding: 0 6px; font-size: .55em; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.kbox.on { background: var(--ok); color: #04210f; border-color: var(--ok); }

@media (max-width: 520px) { #raumpill { display: none; } .navsel { max-width: 46vw; } .topbar { gap: 6px; padding: 8px 10px; } }
