/* LiveVote – Styles */
:root {
  --primary: #6366f1;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #0f172a;
  --text: #f8fafc;
  --page: #f4f5fb;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --ok: #059669;
  --bad: #dc2626;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--page); color: var(--ink); line-height: 1.45; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
a { color: var(--primary); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .8rem; margin-top: 1.5rem; }
.center { text-align: center; }
.spacer { flex: 1; }
.hint { display: block; color: var(--muted); font-size: .82rem; margin-top: .3rem; }

/* Buttons & Inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .65em 1.1em; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .05s, box-shadow .15s, background .15s; }
.btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { color: var(--bad); border-color: #fecaca; background: #fff5f5; }
.btn.ghost { background: transparent; }
.btn.block { display: flex; width: 100%; margin-top: .8rem; }
.btn.small { padding: .4em .8em; font-size: .85rem; }
.btn.big { padding: 1em 1.2em; font-size: 1.1rem; }
.ibtn { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 2.1rem; height: 2.1rem; cursor: pointer; font: inherit; color: var(--ink); }
.ibtn:disabled { opacity: .35; cursor: not-allowed; }
.input { width: 100%; padding: .7em .9em; border: 1px solid #d1d5db; border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
.input:focus, .btn:focus-visible, .opt:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 1px; }
.input.short { max-width: 8rem; }
textarea.input { resize: vertical; }
.field { display: block; margin: .8rem 0; }
.flabel { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.row { display: flex; gap: .6rem; align-items: center; }
.row.flexwrap { flex-wrap: wrap; }
.row.spread { justify-content: space-between; margin-top: 1rem; }
.row .input { flex: 1; min-width: 0; }
.stack > * + * { margin-top: .5rem; }
.check { display: flex; gap: .6rem; align-items: center; margin: .8rem 0; font-weight: 500; }
.note { padding: .7em 1em; border-radius: 10px; margin: .8rem 0; font-weight: 500; }
.note.ok { background: #ecfdf5; color: #065f46; }
.note.warn { background: #fffbeb; color: #92400e; }
.badge { display: inline-block; background: #eef2ff; color: #4338ca; border-radius: 99px; padding: .1em .6em; font-size: .72rem; margin-left: .5em; font-weight: 600; vertical-align: middle; }
.badge.ok { background: #d1fae5; color: #065f46; }
.card { background: var(--card); border-radius: var(--radius); padding: 1.2rem; box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(17,24,39,.05); margin-bottom: 1rem; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: #111827; color: #fff; padding: .7em 1.2em; border-radius: 99px; z-index: 100; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.3); max-width: 92vw; }
.toast.bad { background: var(--bad); }

/* Startseite / Login */
.landing { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% -10%, color-mix(in srgb, var(--primary) 25%, transparent), transparent), var(--page); padding: 1rem; }
.admin .landing-card, .landing-card { width: min(94vw, 26rem); background: #fff; border-radius: 20px; padding: 2rem 1.6rem; box-shadow: 0 20px 60px rgba(17,24,39,.15); text-align: center; margin: 8vh auto 0; }
.landing-card form { text-align: left; }
.logo-mark { width: 3.4rem; height: 3.4rem; border-radius: 16px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; margin: 0 auto 1rem; letter-spacing: .02em; }
.code-input { text-align: center; font-size: 2rem; letter-spacing: .15em; font-weight: 700; margin: 1rem 0 0; }

/* Teilnehmer (Handy) */
.vote { min-height: 100vh; }
.vbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; background: #fff; border-bottom: 1px solid var(--line); padding-top: max(.7rem, env(safe-area-inset-top)); }
.vlogo { height: 1.8rem; width: auto; max-width: 6rem; object-fit: contain; }
.vtitle { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; background: #d1d5db; }
.dot.ok { background: #10b981; }
.dot.bad { background: #ef4444; }
.vstage { width: min(100%, 38rem); margin: 0 auto; padding: 1rem 1rem 3rem; }
.vq { font-size: 1.45rem; margin-bottom: .8rem; overflow-wrap: anywhere; }
.opts { display: grid; gap: .6rem; margin: .8rem 0; }
.opt { display: flex; align-items: center; gap: .8rem; text-align: left; padding: .95em 1em; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); transition: border-color .12s, background .12s; }
.opt .mark { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--c, var(--primary)); display: grid; place-items: center; font-size: .85rem; flex: none; color: #fff; }
.opt.on { border-color: var(--c, var(--primary)); background: color-mix(in srgb, var(--c, var(--primary)) 10%, #fff); }
.opt.on .mark { background: var(--c, var(--primary)); }
.opt.big { padding: 1.2em 1em; font-size: 1.1rem; background: color-mix(in srgb, var(--c) 12%, #fff); border-color: var(--c); }
.opt.big .mark { background: var(--c); }
.opt:disabled { opacity: .55; cursor: not-allowed; }
.clock { font-weight: 800; font-size: 1.2rem; color: var(--primary); margin-bottom: .4rem; }
.srow { margin: 1.1rem 0; }
.slabel { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: .3rem; }
.sval { color: var(--primary); font-weight: 800; }
.srow input[type=range] { width: 100%; accent-color: var(--primary); height: 2rem; }
.ends { display: flex; justify-content: space-between; font-size: .8rem; }
.rank { list-style: none; padding: 0; margin: .8rem 0; display: grid; gap: .5rem; }
.rank li { display: flex; align-items: center; gap: .6rem; padding: .6em .8em; background: #f9fafb; border: 1px solid var(--line); border-radius: 12px; }
.rpos { width: 1.7rem; height: 1.7rem; background: var(--primary); color: #fff; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.rtxt { flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.chip { display: inline-block; background: #eef2ff; color: #3730a3; padding: .3em .8em; border-radius: 99px; margin: .2rem .3rem .2rem 0; font-weight: 600; border: 0; font: inherit; }
button.chip { cursor: pointer; }
.mine { margin-top: 1rem; }
.qalist { margin-top: 1rem; display: grid; gap: .5rem; }
.qaitem { display: flex; gap: .7rem; align-items: center; padding: .7em .9em; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.qaitem.done { opacity: .6; }
.qatext { flex: 1; overflow-wrap: anywhere; }
.vote-btn { border: 1px solid var(--line); background: #f9fafb; border-radius: 99px; padding: .4em .8em; cursor: pointer; font: inherit; font-weight: 700; }
.vote-btn.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.quizres .bigres { font-size: 1.8rem; font-weight: 800; margin: .5rem 0; }
.bigres.ok { color: var(--ok); } .bigres.bad { color: var(--bad); }
.pts { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.lb { padding-left: 1.2rem; } .lb li.me { font-weight: 800; color: var(--primary); }

/* Admin */
.topbar { display: flex; align-items: center; gap: .6rem; padding: .7rem 1.2rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.1rem; }
.wrap { width: min(100% - 2rem, 62rem); margin: 1.2rem auto 4rem; }
.wrap.wide { width: min(100% - 2rem, 80rem); }
.sec { margin: 1.5rem 0 .6rem; }
.pcard { display: flex; gap: 1rem; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: .6rem; flex-wrap: wrap; }
.pc-title { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--ink); }
.pc-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.ehead { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: .8rem; }
.ehead > .row { flex: 0 1 auto; }
.title-input { font-size: 1.4rem; font-weight: 700; width: auto; flex: 1 1 16rem; max-width: 28rem; }
.joinbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1rem; }
.big-code-inline { font-size: 1.4rem; letter-spacing: .08em; }
.editor { display: grid; grid-template-columns: 19rem 1fr; gap: 1rem; align-items: start; }
@media (max-width: 860px) { .editor { grid-template-columns: 1fr; } }
.sidebar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; position: sticky; top: 4.2rem; max-height: calc(100vh - 5rem); overflow: auto; }
@media (max-width: 860px) { .sidebar { position: static; max-height: none; } }
.sidebar h4 { margin: 1rem 0 .5rem; }
.sidebar-head { display: flex; justify-content: space-between; margin-bottom: .5rem; }
.slist { display: grid; gap: .3rem; }
.sitem { display: flex; align-items: center; gap: .5rem; padding: .5em .6em; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.sitem:hover { background: #f3f4f6; }
.sitem.on { background: color-mix(in srgb, var(--primary) 10%, #fff); border-color: var(--primary); }
.snum { font-weight: 700; color: var(--muted); font-size: .8rem; }
.stxt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.sbtns { display: flex; gap: .2rem; }
.sbtns .ibtn { width: 1.6rem; height: 1.6rem; font-size: .65rem; }
.addgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-bottom: .8rem; }
.addbtn { display: flex; align-items: center; gap: .4rem; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: .5em .6em; font: inherit; font-size: .82rem; cursor: pointer; text-align: left; font-weight: 600; }
.addbtn:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, #fff); }
.ftype { font-weight: 700; color: var(--primary); margin-bottom: .6rem; }
.opts-edit { display: grid; gap: .4rem; }
.orow { display: flex; gap: .5rem; align-items: center; }
.odot { width: .9rem; height: .9rem; border-radius: 50%; flex: none; }
.imgprev img { max-width: 100%; max-height: 22rem; border-radius: 10px; border: 1px solid var(--line); }
.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.colors input[type=color] { width: 100%; height: 2.6rem; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.qrbox { display: grid; place-items: center; padding: .8rem; }
.qrbox svg { border-radius: 12px; border: 1px solid var(--line); max-width: 100%; height: auto; }
.big-code { font-size: 2.2rem; font-weight: 800; letter-spacing: .1em; margin: .3rem 0; }
.modal-back { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal { background: #fff; border-radius: 18px; width: min(100%, 34rem); max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem .4rem; }
.modal-head h3 { margin: 0; }
.modal-body { padding: .4rem 1.2rem 1.2rem; }
.urow { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.prog { width: 100%; height: 1rem; }
.sugg { display: flex; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.ai-out { margin-top: 1rem; }

/* Präsentation (Beamer) */
.present { background: var(--bg) center / cover no-repeat fixed; color: var(--text); min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
.pbar { display: flex; align-items: center; gap: 1.2rem; padding: .8rem 1.6rem; background: rgba(0,0,0,.28); font-size: 1.15rem; }
.plogo { height: 2.4rem; max-width: 9rem; object-fit: contain; }
.join { flex: 1; } .join b { color: #fff; } .join .code { font-size: 1.6rem; letter-spacing: .08em; background: var(--primary); padding: .05em .5em; border-radius: 8px; }
.pcount { opacity: .85; }
.pmain { flex: 1; padding: 1.5rem 3vw 7rem; display: flex; flex-direction: column; gap: 1rem; }
.pquestion { font-size: clamp(1.8rem, 4vw, 3.4rem); margin: 0; overflow-wrap: anywhere; }
.pextra { display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap; }
.timer { font-size: 2.2rem; font-weight: 800; background: var(--primary); padding: .15em .7em; border-radius: 14px; }
.timer.over { background: rgba(255,255,255,.18); }
.pbody { display: flex; gap: 2rem; align-items: flex-start; flex: 1; }
.pbody .pstage { flex: 1; min-width: 0; }
.pside { flex: 0 0 21rem; max-height: calc(100vh - 10.5rem); overflow-y: auto; }
.lboard { background: rgba(255,255,255,.08); border-radius: 16px; padding: .8rem 1.2rem; }
.lboard h3 { margin-bottom: .3rem; }
.lboard ol { margin: 0; padding-left: 1.6rem; font-size: 1.15rem; line-height: 1.6; }
.lboard li span { display: inline-block; min-width: 9rem; } .lboard li b { color: var(--primary); filter: brightness(1.6); }
.pstage { flex: 1; }
.bars { display: grid; gap: 1rem; }
.bars.flexcol { display: flex; flex-direction: column; }
.brow { display: grid; grid-template-columns: minmax(10rem, 22%) 1fr 8rem; gap: 1rem; align-items: center; transition: opacity .3s; }
.blabel { font-size: clamp(1.1rem, 2vw, 1.8rem); font-weight: 600; overflow-wrap: anywhere; }
.letter { display: inline-grid; place-items: center; width: 1.8em; height: 1.8em; background: rgba(255,255,255,.18); border-radius: 8px; margin-right: .5em; font-size: .8em; }
.track { height: clamp(2rem, 5vw, 3.4rem); background: rgba(255,255,255,.1); border-radius: 12px; overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 12px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.val { font-size: clamp(1rem, 1.8vw, 1.6rem); font-weight: 700; text-align: right; }
.val.big { font-size: 1.6rem; }
.brow.correct .track { outline: 4px solid #10b981; } .brow.correct .blabel::after { content: " ✓"; color: #34d399; }
.brow.dim { opacity: .35; }
.srow2 { display: grid; grid-template-columns: minmax(10rem, 25%) 1fr 11rem; gap: 1rem; align-items: center; }
.ends2 { display: flex; justify-content: space-between; opacity: .7; padding: 0 12rem 0 calc(25% + 1rem); }
.rankpos { display: inline-block; min-width: 2.2rem; opacity: .7; }
.cloud { position: relative; height: 62vh; }
.cw { position: absolute; font-weight: 700; white-space: nowrap; line-height: 1.1; cursor: pointer; animation: pop .4s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.cards { columns: 3 18rem; column-gap: 1rem; }
.ocard { position: relative; break-inside: avoid; margin-bottom: 1rem; background: rgba(255,255,255,.1); border-left: 6px solid var(--c); padding: 1em 1.2em; border-radius: 12px; font-size: 1.4rem; overflow-wrap: anywhere; }
.ocard .x, .qarow .btn { opacity: 0; }
.ocard:hover .x, .qarow:hover .btn { opacity: 1; }
.ocard .x { position: absolute; top: .3rem; right: .4rem; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; }
.qa { display: grid; gap: .7rem; }
.qarow { display: flex; gap: 1rem; align-items: center; background: rgba(255,255,255,.1); padding: .9rem 1.2rem; border-radius: 14px; font-size: 1.5rem; }
.qarow.done { opacity: .45; }
.qv { font-weight: 800; min-width: 4.5rem; } .qt { flex: 1; overflow-wrap: anywhere; }
.empty { font-size: 1.6rem; opacity: .6; }
.infobody { font-size: clamp(1.4rem, 2.6vw, 2.4rem); max-width: 60ch; white-space: pre-wrap; opacity: .92; }
.imgwrap { display: grid; place-items: center; height: 100%; }
.imgwrap img { max-width: 100%; max-height: 72vh; border-radius: 12px; box-shadow: 0 10px 50px rgba(0,0,0,.45); }
.controls { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(8px); padding: .6rem 1rem; opacity: .35; transition: opacity .2s; z-index: 20; }
.controls:hover, .controls:focus-within { opacity: 1; }
.cnav { display: flex; gap: .3rem; overflow-x: auto; padding-bottom: .4rem; }
.chip2 { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: .25em .6em; font: inherit; font-size: .8rem; cursor: pointer; white-space: nowrap; font-weight: 600; }
.chip2.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.crow { display: flex; gap: .5rem; justify-content: center; align-items: center; flex-wrap: wrap; }
.cbtn { background: rgba(255,255,255,.14); color: #fff; border: 0; padding: .55em 1em; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.cbtn:hover { background: rgba(255,255,255,.28); } .cbtn.primary { background: var(--primary); } .cbtn:disabled { opacity: .3; cursor: not-allowed; }
.cpos { font-weight: 700; min-width: 4.5rem; text-align: center; color: #fff; }
.overlay { position: fixed; inset: 0; background: rgba(2,6,23,.92); display: grid; place-items: center; z-index: 60; cursor: pointer; text-align: center; }
.ovbox h2 { font-size: 2.6rem; } .ovqr { display: inline-block; background: #fff; padding: .6rem; border-radius: 18px; }
.ovurl { font-size: 1.5rem; margin: 1rem 0 0; } .ovcode { font-size: clamp(3rem, 9vw, 6.5rem); font-weight: 800; letter-spacing: .1em; margin: .2rem 0; color: #fff; }

/* Fernbedienung */
.remote { padding: 0 0 4rem; }
.remote #app { width: min(100%, 34rem); margin: 0 auto; padding: 1rem; }
.rhead { display: flex; justify-content: space-between; margin-bottom: .8rem; }
.rpos2 { color: var(--muted); font-weight: 600; }
.rq { margin: .3rem 0 1rem; overflow-wrap: anywhere; }
.rnav { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.rtools { display: flex; gap: .5rem; margin-top: .8rem; flex-wrap: wrap; }
.rrow2 { display: grid; grid-template-columns: 1fr 5rem; gap: .2rem .6rem; margin: .5rem 0; align-items: center; }
.rrow2 .rl { grid-column: 1 / -1; font-weight: 600; font-size: .9rem; } .rrow2 meter { width: 100%; } .rrow2.correct .rl { color: var(--ok); }
.rmod { display: flex; gap: .5rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--line); } .rmod span { flex: 1; overflow-wrap: anywhere; } .rmod.done { opacity: .5; }
.jump { display: flex; flex-wrap: wrap; gap: .3rem; }

/* Bericht */
.report { background: #fff; }
.report-actions { display: flex; gap: .5rem; padding: 1rem; justify-content: center; background: var(--page); flex-wrap: wrap; }
.report-page { width: min(100% - 2rem, 52rem); margin: 1rem auto 3rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .8rem; margin: 1rem 0 1.5rem; }
.kpi { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; text-align: center; }
.kpi b { display: block; font-size: 1.8rem; color: var(--primary); } .kpi span { color: var(--muted); font-size: .85rem; }
.rsec { border-top: 1px solid var(--line); padding: 1rem 0; break-inside: avoid; }
.rrow { display: grid; grid-template-columns: 12rem 1fr 7rem; gap: .6rem; align-items: center; margin: .3rem 0; } .rrow meter { width: 100%; height: 1.1rem; } .rrow .rv { text-align: right; font-size: .9rem; }
@media print { .noprint { display: none !important; } body { background: #fff; } .report-page { width: 100%; margin: 0; } }

@media (max-width: 900px) { .pbody { flex-direction: column; } .pside { flex: none; width: 100%; } }
@media (max-width: 700px) {
  .brow, .srow2 { grid-template-columns: 1fr; gap: .3rem; } .val { text-align: left; } .ends2 { padding: 0; }
  .pbar { flex-wrap: wrap; padding: .6rem 1rem; font-size: 1rem; } .colors { grid-template-columns: 1fr; }
}

/* ===================== v2 ===================== */
.langbtn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .25em .6em; font: inherit; font-weight: 700; font-size: .8rem; cursor: pointer; color: var(--ink); }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.presence { background: #ecfeff; color: #155e75; }
.wrapall { overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; }
.chip.block { display: block; border-radius: 12px; }

/* Teilnehmer: Optionen mit Bildern, Ergebnisse */
.opt .otext { flex: 1; overflow-wrap: anywhere; }
.optimg { width: 3.4rem; height: 3.4rem; object-fit: cover; border-radius: 8px; flex: none; }
.vres { margin-top: 1.2rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
.vbar2 { margin: .5rem 0; }
.vbl { display: flex; justify-content: space-between; gap: .6rem; font-weight: 600; font-size: .92rem; }
.vbt { height: .8rem; background: #eef0f6; border-radius: 99px; overflow: hidden; margin-top: .2rem; }
.vbf { height: 100%; border-radius: 99px; transition: width .5s; }
.hist { display: flex; align-items: flex-end; gap: 3px; height: 6rem; margin: .6rem 0; }
.hist .hbar { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; }
.hist .hfill { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.hist.big { height: 38vh; gap: 8px; margin-top: 2.2rem; padding-bottom: 1.4rem; }
.hist.big .hfill { background: var(--primary); filter: brightness(1.3); border-radius: 8px 8px 0 0; }
.hist.big .hn { position: absolute; top: -1.6rem; left: 0; right: 0; text-align: center; font-weight: 700; font-size: 1.2rem; }
.hist.big .hl { position: absolute; bottom: -1.5rem; left: 0; right: 0; text-align: center; font-size: .85rem; opacity: .7; }
.hist.big .hbar { position: relative; }
.numwrap .numinfo { display: flex; gap: 2rem; flex-wrap: wrap; font-size: 1.5rem; font-weight: 700; }
.numinfo .solution { background: #059669; padding: .1em .6em; border-radius: 10px; }
.idbox { display: grid; gap: .5rem; margin-top: 1rem; }
.emoji-row { display: flex; justify-content: space-between; gap: .3rem; }
.emo { flex: 1; font-size: 1.9rem; padding: .25em 0; border: 2px solid var(--line); background: #fff; border-radius: 12px; cursor: pointer; filter: grayscale(.7); transition: transform .1s, filter .1s; }
.emo.on { filter: none; transform: scale(1.12); border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, #fff); }
.remaining { font-weight: 800; font-size: 1.15rem; color: var(--primary); text-align: center; background: #eef2ff; border-radius: 12px; padding: .4em; }
.remaining.ok { color: var(--ok); background: #ecfdf5; }
.stepper { display: flex; align-items: center; gap: .4rem; }
.stepper input { flex: 1; }
.stepper .ibtn { width: 2.6rem; flex: none; }
.srow .optimg { margin-bottom: .3rem; }
.input.num { font-size: 1.6rem; text-align: center; font-weight: 700; }
.pinbox { position: relative; display: block; line-height: 0; touch-action: manipulation; cursor: crosshair; user-select: none; margin: .6rem 0; }
.pinbox img { width: 100%; height: auto; border-radius: 12px; display: block; -webkit-user-drag: none; }
.pinbox.big { cursor: default; max-width: 100%; display: inline-block; }
.pinbox.big img { max-height: calc(100vh - 21rem); width: auto; max-width: 100%; }
.pinmark { position: absolute; width: 1.7rem; height: 1.7rem; border-radius: 50% 50% 50% 0; transform: translate(-50%, -100%) rotate(-45deg); background: var(--primary); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); pointer-events: none; }
.pinlayer { position: absolute; inset: 0; pointer-events: none; }
.pdot { position: absolute; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: rgba(239,68,68,.55); border: 2px solid #fff; transform: translate(-50%, -50%); }

/* Beamer: Moderation-Schublade */
.cbtn.alert { background: #f59e0b; color: #111827; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(100%, 26rem); background: #fff; color: var(--ink); z-index: 55; padding: 1rem 1.2rem 5rem; overflow: auto; box-shadow: -10px 0 40px rgba(0,0,0,.4); }
.dhead { display: flex; justify-content: space-between; align-items: center; }
.mrow { display: flex; gap: .5rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.mrow .mt { flex: 1; overflow-wrap: anywhere; }
.mb { display: flex; gap: .3rem; }
.ovbox.light { background: #fff; color: var(--ink); padding: 1.4rem; border-radius: 18px; max-width: min(92vw, 30rem); text-align: left; cursor: default; }
.ovbox.light.wide { max-width: min(94vw, 46rem); max-height: 88vh; overflow: auto; }
.ovbox.light h2 { font-size: 1.5rem; }
.agroup { margin: .8rem 0; } .agroup h4 { margin-bottom: .3rem; }
.tbh { margin-top: .8rem; }

/* Dashboard / Editor */
.tplrow { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-top: .8rem; }
.foldbar { display: flex; gap: .4rem; overflow-x: auto; padding: .3rem 0 .8rem; }
.wrap > .input[type=search] { margin: .2rem 0 .6rem; }
.grip { color: var(--muted); cursor: grab; letter-spacing: -.15em; font-size: .8rem; }
.sitem.over { outline: 2px dashed var(--primary); }
.sitem[draggable=true] { -webkit-user-drag: element; }
.addbox summary { cursor: pointer; font-weight: 700; padding: .6rem 0; }
.othumb { width: 2.2rem; height: 2.2rem; object-fit: cover; border-radius: 6px; }
.savebar { display: flex; gap: .6rem; justify-content: space-between; margin-top: 1rem; flex-wrap: wrap; }
.savebar .btn.primary { margin-left: auto; }
.ubtns { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.urow { gap: .6rem; flex-wrap: wrap; }
.runs { margin-top: .4rem; }
.cfgbox { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; }
.form label { display: block; margin: .7rem 0; font-weight: 600; }
.form label.check { display: flex; }
.form input:not([type=checkbox]), .form select { display: block; width: 100%; margin-top: .25rem; padding: .7em .9em; border: 1px solid #d1d5db; border-radius: 10px; font: inherit; background: #fff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.rform { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; }
.rform select { padding: .4em; }
.report-actions .rform label { font-size: .85rem; display: grid; }
.rrow .rv { overflow-wrap: anywhere; }

/* ===================== Handy ===================== */
@media (max-width: 860px) {
  body.admin .topbar { padding: .55rem .8rem; gap: .4rem; }
  .uname { display: none; }
  .wrap, .wrap.wide { width: min(100% - 1.2rem, 80rem); margin-top: .8rem; }
  .btn { min-height: 2.75rem; }
  .btn.small { min-height: 2.4rem; }
  .ibtn { width: 2.6rem; height: 2.6rem; }
  .input, .form input:not([type=checkbox]), .form select { font-size: 16px; } /* verhindert Zoom auf iOS */
  .pcard { padding: .8rem; }
  .pc-actions .btn { flex: 1 1 auto; }
  .ehead { flex-direction: column; align-items: stretch; }
  .title-input { max-width: none; width: 100%; }
  .actions > .btn { flex: 1 1 45%; }
  .joinbar { flex-direction: column; align-items: stretch; }
  .sidebar { padding: .7rem; }
  .slist { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; scroll-snap-type: x proximity; }
  .sitem { flex: 0 0 9.5rem; flex-wrap: wrap; scroll-snap-align: start; border: 1px solid var(--line); background: #fff; }
  .sitem .stxt { flex-basis: 100%; order: 5; font-size: .8rem; }
  .sitem .grip { display: none; }
  .sitem .sbtns { margin-left: auto; }
  .addgrid { grid-template-columns: 1fr 1fr 1fr; }
  .addbtn { flex-direction: column; text-align: center; padding: .6em .3em; font-size: .75rem; }
  .orow { flex-wrap: wrap; }
  .orow .input { flex: 1 1 8rem; }
  .savebar { position: sticky; bottom: 0; background: #fff; padding: .7rem 0 max(.7rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); margin: 1rem -1.2rem -1.2rem; padding-left: 1.2rem; padding-right: 1.2rem; z-index: 4; }
  .savebar .btn.primary { flex: 1; }
  .modal-back { place-items: end center; padding: 0; }
  .modal { width: 100%; border-radius: 18px 18px 0 0; max-height: 94vh; }
  .grid2 { grid-template-columns: 1fr; }
  .urow { align-items: flex-start; }
}
@media (max-width: 700px) {
  .controls { padding: .4rem .5rem; opacity: .92; }
  .cbtn { padding: .5em .7em; font-size: .85rem; }
  .pmain { padding: 1rem 4vw 9rem; }
  .pquestion { font-size: 1.6rem; }
  .cloud { height: 52vh; }
  .drawer { width: 100%; }
  .hist.big { height: 28vh; }
  .report-page { width: min(100% - 1rem, 52rem); }
  .rrow { grid-template-columns: 1fr; gap: .1rem; } .rrow .rv { text-align: left; }
}
@media (max-width: 420px) {
  .vq { font-size: 1.25rem; }
  .vstage { padding: .7rem .7rem 3rem; }
  .card { padding: 1rem; }
}
@media (hover: none) { .ocard .x, .qarow .btn { opacity: 1; } .controls { opacity: .95; } }

/* ---- v3: Bild-Kacheln, 2x2-Matrix, Mehrfach-Bewertung ---- */
.opts.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.opts.tiles .opt { flex-direction: column; align-items: stretch; text-align: center; padding: .5rem; min-height: 0; }
.opts.tiles .opt .optimg { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; max-height: none; }
.opts.tiles .opt .mark { position: absolute; top: .6rem; left: .6rem; background: var(--primary); color: #fff; border-radius: 50%; min-width: 1.6rem; }
.opts.tiles .opt { position: relative; }
.bimg { height: 2.6rem; width: 3.6rem; object-fit: cover; border-radius: 8px; margin-right: .6rem; vertical-align: middle; }

.mplane { position: relative; width: 100%; aspect-ratio: 1 / 1; background: color-mix(in srgb, var(--primary, #6366f1) 6%, #fff); border: 2px solid #cfd3e4; border-radius: 14px; margin: .6rem 0 1.6rem; touch-action: manipulation; cursor: crosshair; user-select: none; }
.mplane.off { opacity: .6; cursor: default; }
.mplane .mx, .mplane .my { position: absolute; background: #cfd3e4; }
.mplane .mx { left: 50%; top: 0; bottom: 0; width: 2px; }
.mplane .my { top: 50%; left: 0; right: 0; height: 2px; }
.mdots { position: absolute; inset: 0; pointer-events: none; }
.mdot { position: absolute; width: 2rem; height: 2rem; border-radius: 50%; transform: translate(-50%, -50%); color: #fff; font-weight: 700; font-size: .9rem; display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.mdot.cur { outline: 3px solid #111827; }
.mdot.sm { position: static; transform: none; width: 1.5rem; height: 1.5rem; font-size: .75rem; display: inline-grid; margin-right: .5rem; border-width: 2px; }
.mpt { position: absolute; width: .7rem; height: .7rem; border-radius: 50%; transform: translate(-50%, -50%); opacity: .45; }
.ax { position: absolute; font-size: .78rem; color: #6b7280; font-weight: 600; pointer-events: none; }
.axl { left: .4rem; bottom: -1.4rem; } .axr { right: .4rem; bottom: -1.4rem; text-align: right; }
.axt { top: .3rem; left: .5rem; } .axb { bottom: .3rem; left: .5rem; }
.mchips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0; }
.mchip { border: 2px solid var(--c); background: #fff; border-radius: 999px; padding: .45rem .8rem; font: inherit; min-height: 44px; }
.mchip.on { background: var(--c); color: #fff; }
.mchip.set b::after { content: ' ✓'; }
.mwrap { display: flex; gap: 2rem; align-items: flex-start; }
.mplane.big { width: min(50vh, 46vw); flex: none; margin: 0 0 1.6rem; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.3); cursor: default; }
.mplane.big .mx, .mplane.big .my { background: rgba(255,255,255,.3); }
.mplane.big .ax { color: rgba(255,255,255,.75); font-size: 1rem; }
.mlegend { font-size: 1.2rem; line-height: 2; }
.mlg { display: flex; align-items: center; }

.gblock { margin: 1rem 0; padding: .7rem; border: 1px solid #e3e6f0; border-radius: 14px; }
.gtitle { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; font-size: 1.1rem; }
.grow { margin: .5rem 0; }
.glabel { font-size: .9rem; color: #4b5563; margin-bottom: .25rem; }
.gbtns { display: flex; flex-wrap: wrap; gap: .35rem; }
.gbtn { flex: 1 0 2.6rem; min-height: 46px; border: 2px solid #d5d9e8; background: #fff; border-radius: 10px; font: inherit; font-weight: 700; }
.gbtn.on { background: var(--primary, #6366f1); border-color: var(--primary, #6366f1); color: #fff; }
.gtab { border-collapse: collapse; font-size: 1.3rem; }
.gtab th, .gtab td { padding: .6rem 1rem; text-align: center; }
.gtab th.grl { text-align: left; }
.gcell { border-radius: 8px; font-weight: 700; }
.bigcode { font-size: 2.2rem; font-weight: 800; letter-spacing: .12em; margin: .2rem 0 .6rem; }
body.addin { padding: .5rem; }
body.addin .qrbox { display: inline-block; }
.opts.tiles .opt .mark:empty { display: none; }
.bimg { height: 3.6rem; width: 4.8rem; }

/* ---- v3 Feinschliff: Ordnung im Editor ---- */
@media (min-width: 861px) { .editor { grid-template-columns: 21rem 1fr; } }
.sitem .stxt { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.addgroups { display: grid; gap: .9rem; margin: .6rem 0 1rem; }
.addgroup h4 { margin: 0 0 .35rem; font-size: .85rem; font-weight: 700; color: #4b5563; }
.addgroup .addgrid { margin-bottom: 0; grid-template-columns: 1fr; gap: .3rem; }
.addbtn { padding: .5em .7em; gap: .65rem; align-items: center; }
.addic { font-size: 1.25rem; width: 1.6rem; text-align: center; flex: none; }
.addtx { display: flex; flex-direction: column; line-height: 1.25; }
.addtx b { font-size: .88rem; }
.addtx small { display: none; }
.fsec { margin: 1.4rem 0 .2rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 1rem; }
.savebar { position: sticky; bottom: 0; background: #fff; padding: .8rem 0; border-top: 1px solid var(--line); z-index: 4; }
@media (min-width: 861px) { .addgroup .addgrid { grid-template-columns: 1fr 1fr; } .addtx small { display: none; } .addbtn { padding: .45em .6em; } }
@media (max-width: 860px) {
  .title-input { flex: 0 0 auto; }
  .addgroup .addgrid { grid-template-columns: 1fr 1fr; }
  .addbtn { flex-direction: row; text-align: left; font-size: .85rem; padding: .55em .7em; }
}
@media (max-width: 860px) {
  .savebar { flex-wrap: nowrap; gap: .4rem; }
  .savebar .btn { padding: .65em .8em; white-space: nowrap; font-size: .9rem; }
}

/* Startseite: Code-Feld passt immer in die Karte */
.code-input { box-sizing: border-box; display: block; width: 100%; max-width: 100%; min-width: 0; padding: .7rem .5rem; border: 2px solid var(--line, #d5d9e8); border-radius: 14px; background: #fff; color: #111827; font-family: inherit; letter-spacing: .12em; }
.code-input::placeholder { color: #b6bccb; }
.code-input:focus { outline: none; border-color: var(--primary, #6366f1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary, #6366f1) 18%, transparent); }
.landing-card .btn.block { margin-top: .8rem; }

/* Manuelle Freigabe */
.cbtn.go { background: #10b981; color: #fff; border-color: #10b981; font-weight: 700; opacity: 1; box-shadow: 0 0 0 3px rgba(16,185,129,.35); }

/* Bildfolien (z. B. PowerPoint-Import): Folie füllt den ganzen Bildschirm */
body.present.imgfull .pbar { position: fixed; bottom: .6rem; right: .6rem; top: auto; left: auto; z-index: 20; padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; background: rgba(0,0,0,.6); color: #fff; opacity: .8; }
body.present.imgfull .pcount { display: none; }
body.present.imgfull #question, body.present.imgfull #extra { display: none; }
body.present.imgfull .pmain { padding: 0; flex: 1; }
body.present.imgfull .pbody, body.present.imgfull .pstage { height: 100vh; padding: 0; }
body.present.imgfull .imgwrap { height: 100vh; background: #000; }
body.present.imgfull .imgwrap img { max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; object-fit: contain; border-radius: 0; box-shadow: none; }
body.present.imgfull .controls { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; opacity: 0; transition: opacity .25s; }
body.present.imgfull.showctl .controls, body.present.imgfull .controls:hover, body.present.imgfull .controls:focus-within { opacity: 1; }

/* ===== Geräte-Anpassung (assets/device.js setzt html[data-device]) ===== */
/* Touch (Handy + Tablet): große Tippflächen, keine Hover-Hinweise nötig */
html[data-touch="1"] .btn, html[data-touch="1"] .cbtn, html[data-touch="1"] .chip2 { min-height: 46px; }
html[data-touch="1"] .opt { min-height: 56px; }
html[data-touch="1"] input[type=text], html[data-touch="1"] input[type=search], html[data-touch="1"] input[type=password], html[data-touch="1"] textarea, html[data-touch="1"] select { font-size: 16px; }

/* Tablet: Teilnehmer-Ansicht größer und zentriert, Editor/Bedienung mit mehr Platz */
html[data-device="tablet"] .vstage { width: min(100%, 46rem); padding-top: 1.6rem; }
html[data-device="tablet"] .vstage .card { padding: 1.6rem; font-size: 1.08rem; }
html[data-device="tablet"] .vstage .vq { font-size: 1.7rem; }
html[data-device="tablet"] .opt { padding: 1.05em 1.2em; font-size: 1.1rem; }
html[data-device="tablet"] .remote #app { width: min(100%, 44rem); }
@media (min-width: 861px) {
  html[data-device="tablet"] .editor { grid-template-columns: 17rem 1fr; }
  html[data-device="tablet"] .sidebar { position: sticky; max-height: calc(100vh - 6rem); }
}
html[data-device="tablet"] .wrap, html[data-device="tablet"] .wrap.wide { width: min(100% - 1.6rem, 80rem); }
/* Tablet quer am Beamer/Pult: Steuerleiste in einer Reihe, große Knöpfe */
html[data-device="tablet"] .controls .cbtn { padding: .7em 1em; font-size: 1.05rem; }

/* PC: Mausbedienung – Hover-Effekte und kompakter */
html[data-device="desktop"] .opt:hover { border-color: var(--primary); }
html[data-device="desktop"] .vstage { width: min(100%, 40rem); }

/* Handy: eine Spalte, Kopfzeile kompakt */
html[data-device="phone"] .vstage .card { padding: 1rem; }
html[data-device="phone"] .wrap, html[data-device="phone"] .wrap.wide { width: min(100% - 1.2rem, 80rem); }

/* Tastaturhinweise nur am PC sinnvoll */
html[data-touch="1"] .kbdhint { display: none; }

/* Antwort nicht mehr änderbar */
.noedit .card .opt, .noedit .card .vote-btn, .noedit .card input, .noedit .card select, .noedit .card .pinbox, .noedit .card .mplane, .noedit .card .chip { pointer-events: none; }
.noedit .card .btn.primary.block, .noedit .card .note.ok:not(.final) { display: none; }
[hidden] { display: none !important; }

/* Übergänge zwischen Folien */
@keyframes trFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes trSlide { from { opacity: 0; transform: translateX(7%); } to { opacity: 1; transform: none; } }
@keyframes trZoom { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.pmain.tr-fade { animation: trFade .5s ease both; }
.pmain.tr-slide { animation: trSlide .5s cubic-bezier(.2,.8,.2,1) both; }
.pmain.tr-zoom { animation: trZoom .5s cubic-bezier(.2,.8,.2,1) both; }
.vfade { animation: trFade .35s ease both; }
@media (prefers-reduced-motion: reduce) { .pmain.tr-fade, .pmain.tr-slide, .pmain.tr-zoom, .vfade { animation: none; } }

/* Live-Reaktionen */
.reactbar { position: fixed; left: 50%; bottom: max(.6rem, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: .3rem; padding: .35rem .5rem; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 6px 24px rgba(17,24,39,.18); z-index: 40; max-width: calc(100vw - 1rem); }
.rbtn { border: 0; background: transparent; font-size: 1.7rem; line-height: 1; width: 2.6rem; height: 2.6rem; border-radius: 50%; cursor: pointer; padding: 0; }
.rbtn:active, .rbtn.pop { animation: rpop .3s ease; }
@keyframes rpop { 50% { transform: scale(1.35); } }
body.hasreact .vstage { padding-bottom: 6rem; }
@media (max-width: 380px) { .rbtn { width: 2.2rem; height: 2.2rem; font-size: 1.4rem; } }
.reactlayer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.rx { position: absolute; bottom: -4rem; opacity: 0; animation: rxUp 4s ease-out forwards; will-change: transform, opacity; }
@keyframes rxUp { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 12% { opacity: 1; transform: translate(0, -8vh) scale(1); } 100% { transform: translate(var(--dx, 0), -105vh) scale(1.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .rx { animation-duration: 1.5s !important; } }
