:root {
  --accent: #e4572e;
  --bgimg: none;
  --bg: #15122b;
  --panel: rgba(255, 255, 255, .07);
  --panel2: rgba(255, 255, 255, .12);
  --line: rgba(255, 255, 255, .14);
  --text: #f6f4ff;
  --muted: #b9b4d6;
  --ok: #3ccf7a;
  --bad: #ff5468;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 700px at 10% -10%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%),
    radial-gradient(900px 600px at 110% 110%, rgba(42, 159, 214, .25), transparent 60%),
    linear-gradient(rgba(16, 13, 34, .78), rgba(16, 13, 34, .9)),
    var(--bgimg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.conn { position: fixed; right: 10px; bottom: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); opacity: .6; z-index: 50; }
.conn.off { background: var(--bad); opacity: 1; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.empty { color: var(--muted); text-align: center; padding: 2em; font-size: .8em; }
.shape { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 8px; color: #fff; font-size: .8em; flex: none; }

.btn {
  border: 0; border-radius: 12px; padding: .8em 1.2em; background: var(--accent); color: #fff; font-weight: 700;
  transition: transform .08s, filter .15s; box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: var(--panel2); box-shadow: none; }
.btn.small { padding: .45em .8em; font-size: .9em; border-radius: 9px; }
.btn.danger { background: var(--bad); }
.input, .textarea, select.input {
  width: 100%; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); border-radius: 12px; padding: .8em 1em; outline: none;
}
.input:focus, .textarea:focus { border-color: var(--accent); }
.textarea { min-height: 6em; resize: vertical; }

/* ---------- Ergebnisse ---------- */
.bars { display: flex; flex-direction: column; gap: .7em; width: 100%; }
.bar-label { display: flex; align-items: center; gap: .6em; margin-bottom: .3em; font-weight: 600; }
.bar-track { position: relative; height: 1.7em; background: var(--panel); border-radius: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 10px; transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.bar.lead .bar-label { color: #fff; }
.bar-val { position: absolute; right: .6em; top: 50%; transform: translateY(-50%); font-weight: 700; font-size: .85em; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .6em; width: 100%; }
.tile { border-radius: 14px; padding: .8em 1em; display: flex; align-items: center; gap: .7em; font-weight: 700; color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.tile .shape { background: rgba(0, 0, 0, .2); }


@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.cards { columns: 3 14em; column-gap: .8em; width: 100%; }
.card { break-inside: avoid; margin-bottom: .8em; background: var(--panel2); border-left: 5px solid var(--c); border-radius: 12px; padding: .7em .9em; font-size: .85em; animation: pop .4s ease-out; }


  background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255, 255, 255, .1) 0); }

/* ---------- Beamer ---------- */
body.present { overflow: hidden; height: 100vh; font-size: clamp(14px, 1.55vw, 34px); }
.present #app { height: 100vh; padding: 3.5vh 4vw; display: flex; flex-direction: column; }
.lobby { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 4vw; align-items: center; }
.kicker { text-transform: uppercase; letter-spacing: .2em; color: var(--accent); font-weight: 800; font-size: .9em; }
.lobby h1 { font-size: 3.6em; line-height: 1.02; margin: .2em 0 .3em; letter-spacing: -.02em; }
.lead { font-size: 1.3em; color: var(--muted); margin: 0 0 1em; }
.url { display: inline-block; font-size: 1.5em; font-weight: 800; background: var(--panel2); padding: .3em .7em; border-radius: 12px; }
.count { margin-top: 1em; font-size: 1.2em; color: var(--muted); }
.count b { color: var(--text); font-size: 1.6em; }
.qr { background: #fff; border-radius: 24px; padding: 1.2vw; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); aspect-ratio: 1; max-height: 70vh; justify-self: center; }
.qr img { width: 100%; height: 100%; display: block; }
.qhead { display: flex; align-items: center; gap: 1em; margin-bottom: 2vh; padding-right: 10.5em; }
.qmeta { color: var(--muted); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: .75em; }
.qtext { font-size: 2.1em; font-weight: 800; line-height: 1.15; margin: .1em 0 0; letter-spacing: -.01em; }
.qbody { flex: 1; display: flex; gap: 3vw; min-height: 0; align-items: center; }
.qbody .qimg { max-width: 38%; max-height: 100%; border-radius: var(--radius); object-fit: contain; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); }
.qres { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; max-height: 100%; overflow: hidden; font-size: 1.15em; }
.qfoot { display: flex; justify-content: space-between; align-items: center; color: var(--muted); margin-top: 1.5vh; font-size: .9em; }
.qfoot b { color: var(--text); font-size: 1.3em; }
.present .cloud { font-size: 1.4em; }
.closedtag { background: var(--panel2); padding: .2em .7em; border-radius: 999px; }
.bigcenter { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.bigcenter h1 { font-size: 3.4em; margin: .2em 0; }
.joinhint { position: fixed; right: 1.2vw; top: 1.2vw; background: #fff; border-radius: 10px; padding: 6px; display: flex; align-items: center; gap: 8px; color: #111; font-weight: 800; font-size: .7em; }
.joinhint img { width: 4.6em; height: 4.6em; display: block; }
.joinhint span { padding-right: 6px; }

/* ---------- Gäste ---------- */
body.guest #app { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; min-height: 100vh; display: flex; flex-direction: column; }
.ghead { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--muted); margin-bottom: 18px; gap: 10px; }
.ghead .pill { background: var(--panel2); color: var(--text); border-radius: 999px; padding: .3em .8em; font-size: .9em; }
.gcenter { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 14px; }
.gcenter h1 { font-size: 2em; margin: 0; line-height: 1.1; }
.gcenter p { color: var(--muted); margin: 0; }
.gq { font-size: 1.35em; font-weight: 800; line-height: 1.2; margin: 6px 0 16px; }
.gq-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.gimg { width: 100%; border-radius: 14px; margin-bottom: 14px; max-height: 38vh; object-fit: contain; background: rgba(0, 0, 0, .2); }
.gopts { display: flex; flex-direction: column; gap: 10px; }
.gopt { display: flex; align-items: center; gap: 12px; text-align: left; border: 2px solid var(--line); background: var(--panel); border-radius: 14px; padding: 14px; font-weight: 700; font-size: 1.05em; }
.gopt.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 25%, transparent); }
.gopt.sel::after { content: "✔"; margin-left: auto; color: var(--accent); }
.emoji { font-size: 3.4em; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 8px; }
.note { color: var(--muted); text-align: center; margin-top: 14px; }

/* ---------- Admin ---------- */
body.admin { font-size: 15px; background-attachment: fixed; }
.abar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px; background: rgba(16, 13, 34, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.abar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.abar nav button { border: 0; background: none; padding: .5em .9em; border-radius: 9px; color: var(--muted); font-weight: 700; }
.abar nav button.on { background: var(--panel2); color: var(--text); }
.abar .sp { flex: 1; }
.abar a { color: var(--muted); font-size: .9em; }
.amain { max-width: 1200px; margin: 0 auto; padding: 18px 16px 80px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 1.05em; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.grid2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; }
.nextbtn { font-size: 1.15em; padding: .9em 1.4em; }
.status { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); margin-bottom: 12px; }
.status b { color: var(--text); }
.preview { font-size: 14px; }
.preview .qtext { font-size: 1.4em; margin-bottom: 12px; }
.qlist { display: flex; flex-direction: column; gap: 6px; }
.qitem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .15); }
.qitem.cur { outline: 2px solid var(--accent); }
.qitem .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: .75em; font-weight: 800; padding: .15em .55em; border-radius: 6px; background: var(--panel2); color: var(--muted); text-transform: uppercase; }
.raw { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; }
.raw div { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; background: rgba(0, 0, 0, .15); }
.raw div.hid { opacity: .4; text-decoration: line-through; }
.raw .who { color: var(--muted); font-size: .85em; min-width: 7em; }
.raw .what { flex: 1; }
.qcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.qcard .top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qnum { font-weight: 900; color: var(--accent); width: 1.6em; }
.qcard select.input { width: auto; }
.qcard label, .form label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: .9em; }
.qcard label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.qcard label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.imgrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.imgrow img { height: 60px; border-radius: 8px; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(16, 13, 34, .95); padding: 12px 0; display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.dirty { color: var(--accent); font-weight: 700; align-self: center; }
.form { display: grid; gap: 12px; max-width: 700px; }
.login { max-width: 380px; margin: 18vh auto; display: flex; flex-direction: column; gap: 12px; padding: 0 16px; }
.err { color: var(--bad); }
@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr; }
}
.present .cards { columns: 3 16em; column-gap: 1em; }
.present .card { font-size: 1.05em; padding: .8em 1em; margin-bottom: 1em; line-height: 1.3; }

/* Ratespiel */
.tile { position: relative; }
.tile-text { flex: 1; }
.tile .badge { display: flex; flex-direction: column; align-items: flex-end; background: rgba(0, 0, 0, .45); padding: .25em .6em; border-radius: 10px; font-size: 1.05em; white-space: nowrap; animation: pop .45s ease-out; }
.tile .badge small { font-size: .55em; opacity: .8; text-transform: uppercase; letter-spacing: .08em; }
.tiles:has(.guessed) .tile:not(.guessed) { opacity: .55; }
.tile.guessed { outline: 4px solid #fff; transform: scale(1.02); transition: transform .3s; }
.tile.hit { outline-color: var(--ok); box-shadow: 0 0 0 8px color-mix(in srgb, var(--ok) 35%, transparent), 0 10px 40px rgba(0,0,0,.4); }
.rank { font-weight: 900; min-width: 1.6em; color: var(--muted); }
.bar.lead .rank { color: #fff; }
.tipchip { margin-left: .4em; font-size: .7em; background: #fff; color: #111; padding: .1em .5em; border-radius: 999px; font-weight: 800; }
.guessbar { font-size: 1.5em; font-weight: 800; }
.guesspanel { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.guesspanel button { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: rgba(0,0,0,.2); border-radius: 10px; padding: 10px 12px; font-weight: 700; }
.guesspanel button:disabled { opacity: .45; cursor: default; }
.guesspanel .meta { margin-left: auto; color: var(--muted); font-weight: 600; font-size: .9em; }
.present .tiles { font-size: 1.15em; }
