:root {
  --bg: #24184f;
  --bg2: #35246f;
  --ink: #ffffff;
  --muted: #c9c0f0;
  --card: #ffffff;
  --cardInk: #1b1340;
  --a0: #e14b4b; /* rot */
  --a1: #2f74d8; /* blau */
  --a2: #e0a51f; /* gelb */
  --a3: #2e9e57; /* grün */
  --ok: #2e9e57;
  --bad: #e14b4b;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.07) 0 120px, transparent 121px),
    radial-gradient(circle at 85% 75%, rgba(255,255,255,.05) 0 200px, transparent 201px),
    linear-gradient(160deg, var(--bg2), var(--bg));
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
.screen { display: none; min-height: 100vh; min-height: 100dvh; padding: 24px; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; }
.screen.on { display: flex; }
h1 { font-size: clamp(32px, 6vw, 64px); margin: 0; font-weight: 700; letter-spacing: .5px; }
h2 { font-size: clamp(22px, 3.5vw, 40px); margin: 0; font-weight: 600; }
.muted { color: var(--muted); }
.logo { font-weight: 700; font-size: 22px; letter-spacing: 1px; opacity: .9; }
.logo b { color: var(--a2); }

.card { background: var(--card); color: var(--cardInk); border-radius: var(--r); padding: 22px; box-shadow: 0 8px 0 rgba(0,0,0,.25); width: min(420px, 100%); }
input, select {
  font: inherit; font-size: 22px; width: 100%; padding: 14px; border-radius: 10px; border: 2px solid #d6d0ee;
  text-align: center; font-weight: 600; color: var(--cardInk);
}
input:focus { outline: none; border-color: var(--a1); }
button {
  font: inherit; font-weight: 600; font-size: 20px; border: 0; border-radius: 10px; padding: 14px 22px; cursor: pointer;
  background: #1b1340; color: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.35); transition: transform .06s;
}
button:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
button.big { width: 100%; margin-top: 12px; }
button.light { background: #fff; color: var(--cardInk); }
button.ghost { background: rgba(255,255,255,.15); box-shadow: none; }
button:disabled { opacity: .45; cursor: default; }
.err { color: var(--bad); min-height: 1.3em; font-weight: 500; margin-top: 8px; }

/* Antwort-Kacheln */
.shape { display: inline-block; width: 1.1em; height: 1.1em; background: #fff; flex: none; }
.s0 { clip-path: polygon(50% 5%, 95% 92%, 5% 92%); }
.s1 { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.s2 { border-radius: 50%; }
.s3 { border-radius: 3px; transform: scale(.88); }
.c0 { background: var(--a0); } .c1 { background: var(--a1); } .c2 { background: var(--a2); } .c3 { background: var(--a3); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.ans {
  display: flex; align-items: center; gap: 14px; text-align: left; color: #fff; border-radius: var(--r);
  padding: 18px 20px; font-size: clamp(18px, 2.4vw, 30px); font-weight: 600; min-height: 90px;
  box-shadow: 0 6px 0 rgba(0,0,0,.28); transition: opacity .3s, transform .3s;
}
.ans .shape { font-size: 1.2em; }
.ans.dim { opacity: .25; }
.ans.win { transform: scale(1.02); outline: 5px solid #fff; }
.ans .cnt { margin-left: auto; font-size: .9em; opacity: .95; }

/* Spieler-Buttons */
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; flex: 1; max-height: 70vh; }
.pgrid.two { grid-template-columns: 1fr; }
.pbtn {
  border-radius: var(--r); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: #fff; font-size: 17px; padding: 10px; min-height: 120px; box-shadow: 0 6px 0 rgba(0,0,0,.3);
}
.pbtn .shape { font-size: 52px; }
.pbtn span.t { line-height: 1.15; }

/* Host-Layout */
.top { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; font-size: 20px; pointer-events: none; }
.top > * { pointer-events: auto; }
.pinbox { background: #fff; color: var(--cardInk); border-radius: var(--r); padding: 16px 28px; box-shadow: 0 8px 0 rgba(0,0,0,.25); display: flex; gap: 28px; align-items: center; text-align: left; }
.pinbox .pin { font-size: clamp(48px, 8vw, 96px); font-weight: 700; letter-spacing: 6px; line-height: 1; }
.pinbox img { width: 150px; height: 150px; }
.names { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 1100px; }
.name { background: rgba(255,255,255,.14); padding: 8px 16px; border-radius: 999px; font-size: 22px; font-weight: 600; cursor: pointer; animation: pop .35s; }
.name.off { opacity: .4; }
.name:hover { background: var(--bad); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.qbox { background: #fff; color: var(--cardInk); border-radius: var(--r); padding: 26px 30px; width: min(1200px, 100%); font-size: clamp(24px, 3.4vw, 46px); font-weight: 600; box-shadow: 0 8px 0 rgba(0,0,0,.25); }
.qmeta { display: flex; justify-content: space-between; width: min(1200px, 100%); align-items: center; font-size: 20px; }
.timer { width: 96px; height: 96px; border-radius: 50%; background: #fff; color: var(--cardInk); display: grid; place-items: center; font-size: 42px; font-weight: 700; box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.timer.hot { background: var(--a2); color: #fff; }
.mid { display: flex; align-items: center; gap: 24px; width: min(1200px, 100%); justify-content: space-between; }
.bar { height: 10px; background: rgba(255,255,255,.2); border-radius: 99px; overflow: hidden; width: min(1200px, 100%); }
.bar i { display: block; height: 100%; background: var(--a2); width: 100%; transition: width linear; }
.info { background: rgba(255,255,255,.12); border-radius: var(--r); padding: 12px 16px 12px 20px; font-size: clamp(16px, 2vw, 24px); width: min(1200px, 100%); display: flex; align-items: center; gap: 16px; text-align: left; }
.info span { flex: 1; }
.info button { flex: none; }
#sQuestion { justify-content: flex-start; padding-top: 76px; gap: 14px; }
.wide { width: min(1200px, 100%); }

.board { width: min(800px, 100%); display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 16px; background: #fff; color: var(--cardInk); border-radius: 12px; padding: 14px 22px; font-size: 26px; font-weight: 600; box-shadow: 0 5px 0 rgba(0,0,0,.2); animation: slide .4s backwards; }
.row .r { width: 42px; font-weight: 700; color: var(--a1); }
.row .s { margin-left: auto; }
.row .fire { font-size: 18px; color: var(--a0); }
@keyframes slide { from { transform: translateX(-40px); opacity: 0; } }

.podium { display: flex; align-items: flex-end; gap: 16px; justify-content: center; margin-top: 10px; }
.pod { width: 200px; border-radius: 12px 12px 0 0; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; padding: 16px 10px; font-weight: 600; animation: rise .9s backwards; }
.pod .n { font-size: 26px; } .pod .p { font-size: 18px; opacity: .85; } .pod .m { font-size: 54px; font-weight: 700; }
.pod1 { height: 300px; background: var(--a2); animation-delay: 1.6s; }
.pod2 { height: 220px; background: #8f9bb5; animation-delay: .9s; }
.pod3 { height: 160px; background: #b97a43; animation-delay: .3s; }
@keyframes rise { from { transform: translateY(80px); opacity: 0; } }

/* Setup */
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left; margin: 10px 0; }
.cats label { display: flex; gap: 8px; align-items: center; background: #f1eefb; padding: 10px; border-radius: 8px; cursor: pointer; font-size: 16px; }
.cats input { width: auto; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; font-size: 15px; }
.opts select, .opts input { font-size: 18px; padding: 10px; }

/* Spieler-Feedback */
.verdict { font-size: 44px; font-weight: 700; }
.badge { display: inline-block; background: rgba(0,0,0,.25); border-radius: 999px; padding: 8px 18px; font-size: 22px; }
body.good .muted, body.bad .muted { color: rgba(255,255,255,.9); }
.badge { border-radius: 18px; }
body.good { background: linear-gradient(160deg, #36b366, #1f7a43); }
body.bad { background: linear-gradient(160deg, #e65a5a, #a52f2f); }
.spinner { width: 56px; height: 56px; border: 6px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.foot { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 12px 18px; background: rgba(0,0,0,.25); font-weight: 600; font-size: 18px; }

@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
  .pinbox { flex-direction: column; text-align: center; }
  .cats, .opts { grid-template-columns: 1fr; }
}
