:root {
  --bg: #070b2e;
  --bg2: #0d1445;
  --panel: #121a57;
  --line: #2a3590;
  --blue: #1426b8;
  --blue-hi: #1f36e0;
  --gold: #ffcf40;
  --text: #f2f4ff;
  --muted: #a4abd9;
  --ok: #2fbf71;
  --no: #e5484d;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 700px at 50% -10%, #17227a 0%, var(--bg) 60%) fixed var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.15; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
a { color: var(--gold); }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.spacer { flex: 1; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }
.stack { display: flex; flex-direction: column; gap: .9rem; align-items: stretch; }
.kicker { text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; color: var(--gold); font-weight: 700; }

/* --- Bedienelemente --- */
button, .button {
  font: inherit; font-weight: 600; color: var(--text); background: #1c2670; border: 1px solid var(--line);
  border-radius: 8px; padding: .5rem .9rem; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: .4rem; white-space: nowrap; transition: background .12s, transform .05s;
}
button:hover:not(:disabled), .button:hover { background: #26329a; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible, .button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
.primary { background: var(--gold); border-color: var(--gold); color: #1a1500; }
button.primary:hover:not(:disabled), .button.primary:hover { background: #ffdd70; }
.danger { background: var(--no); border-color: var(--no); color: #fff; }
button.danger:hover:not(:disabled) { background: #f0636a; }
.ghost { background: transparent; border-color: transparent; }
.big { padding: .8rem 1.5rem; font-size: 1.1rem; }
.icon { padding: .2rem .5rem; background: transparent; border-color: transparent; color: var(--muted); line-height: 1.2; }
.icon:hover:not(:disabled) { color: var(--text); }
.link { background: none; border: none; color: var(--gold); padding: .2rem 0; text-decoration: underline; font-weight: 500; }
button.link:hover:not(:disabled) { background: none; color: #ffe38a; }
.danger-text { color: #ff8f93; }

input[type=text], input[type=password], input[type=number], textarea, select {
  font: inherit; color: var(--text); background: #0a0f3a; border: 1px solid var(--line); border-radius: 8px;
  padding: .55rem .7rem; width: 100%; min-width: 0;
}
textarea { resize: vertical; }
input[type=number] { width: 7.5rem; }
select { width: auto; }
::placeholder { color: #6a72ab; }

.field { display: flex; flex-direction: column; gap: .3rem; }
.field > span, .media-label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field small { color: var(--muted); }
.form-error { color: #ff9a9e; font-weight: 600; }

.switch { display: flex; align-items: center; gap: .6rem; cursor: pointer; font-weight: 600; }
.switch small { font-weight: 400; color: var(--muted); }
.switch input { appearance: none; width: 2.6rem; height: 1.5rem; border-radius: 1rem; background: #2b3378; position: relative; flex: none; cursor: pointer; margin: 0; transition: background .15s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: calc(1.5rem - 6px); height: calc(1.5rem - 6px); border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--gold); }
.switch input:checked::after { transform: translateX(1.1rem); }

/* --- Rahmen --- */
.topbar { display: flex; align-items: center; gap: .75rem; padding: .7rem clamp(.8rem, 3vw, 2rem); border-bottom: 1px solid #1b2468; background: rgba(7, 11, 46, .8); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; }
.logo { width: 1.9rem; height: 1.9rem; border-radius: 7px; background: var(--blue); color: var(--gold); display: grid; place-items: center; font-family: Georgia, serif; font-size: 1.3rem; }
.user { display: flex; align-items: center; }
.save-status { font-size: .85rem; color: var(--muted); }
.save-status.pending { color: var(--gold); }
.save-status.error { color: #ff9a9e; font-weight: 700; }

.page { max-width: 1280px; margin: 0 auto; padding: 1.5rem clamp(.8rem, 3vw, 2rem) 4rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

.center-card { max-width: 30rem; margin: clamp(1.5rem, 8vh, 5rem) auto; padding: 2rem; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; gap: 1rem; text-align: center; }
.center-card form { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.center-card.setup { max-width: 34rem; }
.center-card .desc { white-space: pre-wrap; }
.team-inputs { display: flex; flex-direction: column; gap: .5rem; }
.team-inputs .row { flex-wrap: nowrap; }

/* --- Landing --- */
.landing { max-width: 1000px; margin: 0 auto; padding: clamp(2rem, 8vh, 5rem) 1.2rem 4rem; display: flex; flex-direction: column; gap: 3rem; }
.hero { display: flex; flex-direction: column; gap: 1.2rem; align-items: flex-start; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); }
.hero em { color: var(--gold); font-style: normal; font-family: Georgia, 'Times New Roman', serif; }
.hero p { font-size: 1.15rem; color: #cfd4f5; max-width: 42rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.feature h3 { color: var(--gold); margin-bottom: .3rem; }
.feature p { color: #cfd4f5; font-size: .95rem; }
.join-box { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: 1rem 1.2rem; border: 1px dashed var(--line); border-radius: var(--radius); }
input.code-input { width: 8rem; text-transform: uppercase; letter-spacing: .25em; text-align: center; font-weight: 700; font-size: 1.2rem; }
.center-card input.code-input { width: 100%; font-size: 1.8rem; }

/* --- Dashboard --- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; }
.card-main { padding: 1.1rem 1.2rem .8rem; color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: .45rem; flex: 1; border-radius: 14px 14px 0 0; }
.card-main:hover h3 { color: var(--gold); }
.card h3 { font-size: 1.2rem; overflow-wrap: anywhere; }
.progress { height: 6px; border-radius: 3px; background: #0a0f3a; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--gold); }
.badge { margin-left: .5rem; padding: .05rem .5rem; border-radius: 1rem; background: rgba(47, 191, 113, .18); color: #7be3a8; font-size: .75rem; font-weight: 700; }
.card-actions { display: flex; gap: .4rem; padding: .7rem 1.2rem 1rem; align-items: center; flex-wrap: wrap; }
.empty { grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; border: 1px dashed var(--line); border-radius: 14px; display: flex; flex-direction: column; gap: 1rem; align-items: center; }

details.more { position: relative; margin-left: auto; }
details.more summary { list-style: none; cursor: pointer; padding: .35rem .7rem; border-radius: 8px; font-weight: 800; font-size: 1.2rem; line-height: 1; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary:hover { background: #26329a; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: #0a0f3a; border: 1px solid var(--line); border-radius: 10px; padding: .3rem; display: flex; flex-direction: column; min-width: 13rem; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.menu button { justify-content: flex-start; background: none; border: none; font-weight: 500; }
.card details.more .menu { top: auto; bottom: calc(100% + 4px); }

/* --- Dialoge --- */
.backdrop { position: fixed; inset: 0; background: rgba(2, 4, 20, .75); display: grid; place-items: center; z-index: 100; padding: 1rem; overflow-y: auto; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; width: min(30rem, 100%); max-height: calc(100dvh - 2rem); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.modal.wide { width: min(52rem, 100%); }
.modal > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem .6rem; }
.modal > header h2 { overflow-wrap: anywhere; }
.modal-body { padding: .4rem 1.2rem 1.2rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.modal-body form { display: flex; flex-direction: column; gap: 1rem; }
.modal > footer { display: flex; gap: .5rem; padding: .8rem 1.2rem; border-top: 1px solid var(--line); flex-wrap: wrap; justify-content: flex-end; align-items: center; }

#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; z-index: 200; align-items: center; width: min(92vw, 32rem); pointer-events: none; }
.toast { background: #0a0f3a; border: 1px solid var(--line); border-left: 4px solid var(--gold); padding: .7rem 1rem; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.toast.error { border-left-color: var(--no); }
.toast.ok { border-left-color: var(--ok); }

.share { display: flex; flex-direction: column; gap: 1rem; }
.copy-row { display: flex; gap: .5rem; }
.qr { width: 11rem; height: 11rem; background: #fff; border-radius: 10px; padding: .4rem; align-self: center; }

/* --- Editor --- */
.title-input { flex: 1 1 18rem; font-size: 1.6rem !important; font-weight: 800; background: transparent !important; border-color: transparent !important; padding-left: .3rem !important; }
.title-input:hover, .title-input:focus { border-color: var(--line) !important; background: #0a0f3a !important; }
.grid-scroll { overflow-x: auto; padding-bottom: .5rem; }
.edit-grid { display: grid; gap: 6px; min-width: min-content; }
.corner { display: grid; place-items: center; color: var(--muted); font-size: .8rem; font-weight: 600; }
.cat-head { background: var(--blue); border-radius: 8px; padding: .4rem; display: flex; flex-direction: column; gap: .2rem; }
.cat-head input { background: rgba(0, 0, 0, .25); border-color: transparent; font-weight: 700; text-align: center; }
.cat-head .tools { display: flex; justify-content: center; }
.cat-head .icon { color: #c8cfff; }
.row-head { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; }
.row-head input { width: 5.2rem; text-align: center; font-weight: 800; color: var(--gold); }
.edit-cell { min-height: 5.6rem; background: #101850; border: 1px dashed #35409a; flex-direction: column; align-items: stretch; justify-content: space-between; text-align: left; white-space: normal; padding: .5rem .6rem; font-weight: 500; gap: .3rem; }
.edit-cell.filled { background: var(--blue); border: 1px solid var(--blue-hi); }
.edit-cell .plus { color: #7d86c9; margin: auto; }
.snippet { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .9rem; line-height: 1.3; overflow-wrap: anywhere; }
.marks { display: flex; gap: .3rem; flex-wrap: wrap; font-size: .7rem; }
.marks i, .marks b { font-style: normal; padding: 0 .4rem; border-radius: 1rem; background: rgba(0, 0, 0, .3); color: #d5daff; }
.marks b { background: var(--gold); color: #1a1500; }
.marks .warn { background: rgba(229, 72, 77, .3); color: #ffc2c4; }
.add-col { font-size: 1.5rem; background: transparent; border-style: dashed; color: var(--muted); min-width: 2.8rem; }
.add-row { background: transparent; border-style: dashed; color: var(--muted); }
.final-box { margin: 1.5rem 0 1rem; padding: 1.1rem 1.2rem; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; gap: .6rem; }
.final-edit { flex-direction: column; align-items: flex-start; white-space: normal; text-align: left; background: #101850; border-style: dashed; padding: .8rem 1rem; font-weight: 500; }
.final-edit.filled { background: var(--blue); border: 1px solid var(--blue-hi); }
.final-edit b { color: var(--gold); text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; }

.clue-form { display: flex; flex-direction: column; gap: 1rem; }
.media-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; }
.media-field { display: flex; flex-direction: column; gap: .3rem; }
.drop { width: 100%; min-height: 6.5rem; background: #0a0f3a; border: 1px dashed #4450b0; color: var(--muted); white-space: normal; font-weight: 500; font-size: .9rem; }
.drop.over { border-color: var(--gold); color: var(--gold); }
.drop.busy { display: grid; place-items: center; border-radius: 8px; }
.media-preview { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.media-preview img { max-height: 9rem; border-radius: 8px; background: #000; }
.media-preview audio { width: 100%; }
.media-preview button { padding: .25rem .6rem; font-size: .85rem; }
.opts { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-end; }

/* --- Spielen --- */
body.playing { overflow: hidden; }
.play { height: 100dvh; display: flex; flex-direction: column; }
.playbar { display: flex; align-items: center; gap: .3rem; padding: .35rem .8rem; flex: none; }
.playbar h1 { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 600; }
.playbar button { padding: .3rem .6rem; font-size: .85rem; color: var(--muted); }
.playbar .menu button { color: var(--text); font-size: .95rem; padding: .5rem .8rem; }
.banner { display: flex; justify-content: center; align-items: center; gap: 1rem; padding: .6rem; background: rgba(255, 207, 64, .12); border-block: 1px solid rgba(255, 207, 64, .4); flex-wrap: wrap; }

.board { flex: 1; min-height: 0; display: grid; gap: clamp(3px, .6vw, 9px); padding: 0 clamp(.4rem, 1vw, 1rem); }
.b-cat { background: linear-gradient(180deg, #2238e8, var(--blue)); border-radius: 8px; display: grid; place-items: center; text-align: center; padding: .5rem .3rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; font-size: clamp(.62rem, 1.45vw, 1.5rem); line-height: 1.15; min-height: clamp(2.8rem, 9vh, 6rem); overflow-wrap: anywhere; hyphens: auto; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.b-cell { background: var(--blue); border: none; border-radius: 8px; color: var(--gold); font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: clamp(1.1rem, 3.6vw, 4rem); text-shadow: 0 3px 0 rgba(0, 0, 0, .45); min-height: 0; padding: 0; }
button.b-cell:hover:not(:disabled) { background: var(--blue-hi); transform: scale(1.02); }
.b-cell.used, button.b-cell.used:hover { background: #0c1240; color: transparent; text-shadow: none; transform: none; }
.b-cell.blank { background: rgba(12, 18, 64, .5); }

.scores { flex: none; display: flex; gap: clamp(.3rem, 1vw, .8rem); padding: clamp(.4rem, 1vw, .9rem); justify-content: center; flex-wrap: wrap; }
.team { flex: 1 1 7rem; max-width: 17rem; flex-direction: column; gap: 0; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: .35rem .6rem; white-space: normal; }
.team.turn { border-color: var(--gold); box-shadow: 0 0 18px rgba(255, 207, 64, .35); }
.name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.team .name { font-size: clamp(.8rem, 1.4vw, 1.1rem); white-space: nowrap; }
.score { font-family: Georgia, serif; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.team .score { font-size: clamp(1.2rem, 2.6vw, 2.2rem); line-height: 1.1; }
.score.neg { color: #ff8f93; }

.clue-view { position: fixed; inset: 0; z-index: 50; background: radial-gradient(1000px 600px at 50% 0%, #2238e8 0%, var(--blue) 45%, #0b1470 100%); display: flex; flex-direction: column; animation: pop .22s ease-out; }
.clue-view.inline { position: static; flex: 1; min-height: 0; animation: none; margin: 0 clamp(.4rem, 1vw, 1rem) clamp(.4rem, 1vw, 1rem); border-radius: 14px; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.clue-view > header { display: flex; align-items: center; justify-content: space-between; padding: .5rem 1rem; flex: none; }
.clue-title { text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--gold); font-size: clamp(.9rem, 1.8vw, 1.4rem); overflow-wrap: anywhere; }
.clue-content { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: clamp(.6rem, 2vh, 1.5rem); padding: .5rem clamp(1rem, 5vw, 5rem); text-align: center; }
.q-block, .a-block { display: flex; flex-direction: column; align-items: center; gap: clamp(.6rem, 2vh, 1.2rem); max-width: 100%; min-height: 0; }
.q-text { font-weight: 700; white-space: pre-wrap; overflow-wrap: anywhere; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); line-height: 1.2; }
.q-text.big { font-size: clamp(1.6rem, 4.6vw, 4.2rem); }
.q-text.mid { font-size: clamp(1.3rem, 3.2vw, 2.8rem); }
.q-text.small { font-size: clamp(1.05rem, 2.2vw, 1.9rem); }
.q-img { max-height: 46vh; max-width: 100%; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); cursor: zoom-in; object-fit: contain; }
.q-img.zoom { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-height: none; z-index: 60; background: rgba(0, 0, 0, .92); border-radius: 0; cursor: zoom-out; }
.q-audio { width: min(34rem, 100%); }
.stage-answer .q-block .q-text { font-size: clamp(1rem, 2vw, 1.6rem); opacity: .8; }
.stage-answer .q-block .q-img { max-height: 18vh; }
.a-block { background: rgba(0, 0, 0, .28); border: 2px solid var(--gold); border-radius: 14px; padding: clamp(.8rem, 2vh, 1.4rem) clamp(1rem, 3vw, 2.5rem); animation: pop .25s ease-out; }
.a-text { font-size: clamp(1.5rem, 4vw, 3.4rem); font-weight: 800; color: var(--gold); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.15; }
.a-block .q-img { max-height: 34vh; }

.timer { display: flex; align-items: center; gap: .8rem; padding: 0 1rem; flex: none; }
.timer .bar { flex: 1; height: 10px; background: rgba(0, 0, 0, .35); border-radius: 5px; overflow: hidden; }
.timer .bar i { display: block; height: 100%; background: var(--gold); transition: width .1s linear; }
.timer .num { font-family: Georgia, serif; font-weight: 700; font-size: clamp(1.4rem, 3vw, 2.4rem); min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; opacity: .7; }
.timer.running .num { opacity: 1; }
.timer.low .bar i { background: var(--no); }
.timer.low .num { color: #ff8f93; animation: pulse .5s infinite alternate; }
.timer.over .num { color: #ff8f93; }
@keyframes pulse { to { transform: scale(1.18); } }

.clue-controls { flex: none; background: rgba(4, 8, 40, .82); padding: .6rem clamp(.6rem, 2vw, 1.5rem) .8rem; display: flex; flex-direction: column; gap: .6rem; }
.clue-controls:empty { display: none; }
.judge { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.judge-team { display: flex; align-items: center; gap: .6rem; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: .35rem .6rem; flex-wrap: wrap; justify-content: center; }
.judge-team .name { max-width: 11rem; white-space: nowrap; }
.judge-team.buzzed { border-color: var(--gold); box-shadow: 0 0 20px rgba(255, 207, 64, .55); }
.judge-team.won { border-color: var(--ok); background: rgba(47, 191, 113, .18); }
.judge-team.lost { opacity: .55; }
.ok { background: rgba(47, 191, 113, .2); border-color: var(--ok); color: #9af0c0; }
button.ok:hover:not(:disabled), .ok.on { background: var(--ok); color: #04210f; }
.no { background: rgba(229, 72, 77, .18); border-color: var(--no); color: #ffb3b6; }
button.no:hover:not(:disabled), .no.on { background: var(--no); color: #fff; }
.judge button { padding: .35rem .7rem; }
.actions button.active { border-color: var(--gold); color: var(--gold); }
.buzz-banner { text-align: center; background: var(--gold); color: #1a1500; font-weight: 800; font-size: clamp(1rem, 2.2vw, 1.5rem); border-radius: 10px; padding: .4rem; animation: pop .2s ease-out; }
.dd-note { text-align: center; color: var(--gold); font-weight: 700; }
.wager-row { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); }
.wager-row input { width: 6.5rem; }

.dd-splash { display: flex; flex-direction: column; align-items: center; gap: 1rem; margin: auto; padding: 1rem; text-align: center; }
.dd-title { font-family: Georgia, serif; font-weight: 700; font-size: clamp(2.6rem, 9vw, 7rem); color: var(--gold); text-shadow: 0 5px 0 rgba(0, 0, 0, .4); line-height: 1; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.final-cat { font-size: clamp(1.8rem, 5vw, 3.6rem); font-weight: 800; text-transform: uppercase; overflow-wrap: anywhere; }
input.wager { font-size: 2rem; width: 12rem; text-align: center; font-weight: 800; color: var(--gold); }

.results { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 1.2rem; padding: 1.5rem; text-align: center; }
.results h1 { font-size: clamp(2.4rem, 8vw, 5.5rem); color: var(--gold); font-family: Georgia, serif; overflow-wrap: anywhere; }
.ranking { list-style: none; padding: 0; margin: 0; width: min(34rem, 100%); display: flex; flex-direction: column; gap: .5rem; }
.ranking li { display: flex; align-items: center; gap: 1rem; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: .6rem 1rem; font-size: 1.3rem; }
.ranking li.first { border-color: var(--gold); }
.ranking .place { color: var(--muted); font-weight: 800; width: 2.2rem; text-align: left; }
.ranking .name { flex: 1; text-align: left; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

.buzz-join { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.buzz-url { font-weight: 700; overflow-wrap: anywhere; }
.buzz-code { font-size: 2.6rem; font-weight: 800; letter-spacing: .2em; color: var(--gold); font-family: ui-monospace, Menlo, Consolas, monospace; }
.buzz-teams { display: flex; flex-direction: column; gap: .5rem; }
.buzz-teams > div { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.chip { background: #0a0f3a; border: 1px solid var(--line); border-radius: 1rem; padding: 0 .2rem 0 .7rem; display: inline-flex; align-items: center; font-size: .9rem; }

/* --- Buzzer am Handy --- */
body.buzzing { overscroll-behavior: none; touch-action: manipulation; }
.buzz-screen { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 1rem; gap: 1rem; }
.buzz-screen header { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.buzz-btn { margin: auto; width: min(78vw, 58dvh, 26rem); aspect-ratio: 1; border-radius: 50%; font-size: clamp(1.8rem, 9vw, 3.4rem); font-weight: 900; border: 10px solid rgba(0, 0, 0, .35); white-space: normal; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.buzz-btn:disabled { opacity: 1; }
.buzz-btn.wait { background: #232b6e; color: #8088c4; }
.buzz-btn.open, button.buzz-btn.open:hover { background: radial-gradient(circle at 35% 30%, #ff7a7f, var(--no) 60%, #a51d22); color: #fff; box-shadow: 0 0 60px rgba(229, 72, 77, .6), inset 0 -12px 0 rgba(0, 0, 0, .25); }
.buzz-btn.open:active { transform: scale(.96); }
.buzz-btn.won { background: var(--ok); color: #04210f; box-shadow: 0 0 60px rgba(47, 191, 113, .6); }
.buzz-btn.late { background: #2a2f55; color: #a4abd9; }
.buzz-info { font-size: 1.15rem; text-align: center; min-height: 3.5rem; }
.team-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .5rem; }
.team-pick button { white-space: normal; padding: .8rem; }

@media (max-width: 640px) {
  .page-head { align-items: stretch; flex-direction: column; }
  .user .ghost:first-child { max-width: 6.5rem; overflow: hidden; text-overflow: ellipsis; display: block; }
  .topbar { gap: .3rem; }
  .topbar button, .topbar .button { padding: .4rem .5rem; }
  .playbar h1 { display: none; }
  .judge-team { flex: 1 1 100%; }
  .copy-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- Runden --- */
.round-tabs { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; }
.tab { background: transparent; border-color: var(--line); color: var(--muted); }
.tab.active { background: var(--blue); border-color: var(--blue-hi); color: var(--text); }
.tab.add { border-style: dashed; }
input.round-name { width: 12rem; }
.edit-cell.over { outline: 2px dashed var(--gold); outline-offset: 2px; }
.edit-cell[draggable=true] { cursor: grab; }
.round-label { text-align: center; text-transform: uppercase; letter-spacing: .2em; font-size: .75rem; font-weight: 700; color: var(--gold); padding-bottom: .3rem; flex: none; }
.q-video { width: min(100%, 78vh); aspect-ratio: 16 / 9; border: 0; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); background: #000; flex: none; }
.mod-link summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.mod-link .buzz-join { margin-top: .8rem; justify-content: flex-start; }
.mod-link .qr { width: 8rem; height: 8rem; }
.mod-link .buzz-join > div { flex: 1 1 12rem; display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }

/* --- Spielleiter-Ansicht --- */
.mod-screen { min-height: 100dvh; max-width: 40rem; margin: 0 auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.mod-clue { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; display: flex; flex-direction: column; gap: .8rem; }
.mod-clue.idle { text-align: center; padding: 2.5rem 1rem; }
.mod-clue img { max-height: 30vh; border-radius: 8px; align-self: center; }
.mod-q { font-size: 1.15rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.mod-clue .a-block { align-items: flex-start; text-align: left; animation: none; }
.mod-clue .a-text { font-size: 1.7rem; }
.mod-note { white-space: pre-wrap; background: rgba(255, 207, 64, .1); border-left: 3px solid var(--gold); padding: .5rem .8rem; border-radius: 0 8px 8px 0; }
.mod-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .5rem; }
.mod-scores > div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .4rem .7rem; display: flex; flex-direction: column; }
.mod-scores .score { font-size: 1.4rem; }
.buzz-score { font-family: Georgia, serif; color: var(--gold); font-weight: 700; }

/* --- Loesungsblatt --- */
.sheet { max-width: 60rem; margin: 0 auto; padding: 1.5rem clamp(.8rem, 3vw, 2rem) 4rem; display: flex; flex-direction: column; gap: 1.2rem; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.sheet h2.round { margin-top: 1rem; color: var(--gold); text-transform: uppercase; letter-spacing: .1em; }
.sheet h3 { margin-bottom: .4rem; }
.sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sheet th, .sheet td { border: 1px solid var(--line); padding: .5rem .7rem; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.sheet th { width: 6.5rem; color: var(--gold); font-family: Georgia, serif; font-size: 1.1rem; }
.sheet td p { white-space: pre-wrap; }
.sheet td img { max-height: 7rem; border-radius: 6px; display: block; margin-top: .3rem; }
.sheet .ans { font-weight: 700; }
.sheet .note { font-style: italic; color: var(--muted); margin-top: .3rem; }
.sheet .tag { display: block; font: 600 .7rem/1.4 system-ui, sans-serif; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.site-footer { text-align: center; padding: 1.5rem 1rem 2rem; font-size: .85rem; display: flex; gap: 1.2rem; justify-content: center; }
.site-footer a { color: var(--muted); }
.notice { background: rgba(255, 207, 64, .12); border: 1px solid rgba(255, 207, 64, .4); border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1.2rem; display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.search { max-width: 18rem; }

@media print {
  body { background: #fff !important; color: #000; }
  .no-print, #toasts { display: none !important; }
  .sheet { max-width: none; padding: 0; }
  .sheet .kicker, .sheet h2.round, .sheet th { color: #000; }
  .sheet th, .sheet td { border-color: #999; }
  .sheet .note, .sheet .tag { color: #444; }
  .sheet section { break-inside: avoid; }
}
.account { display: flex; flex-direction: column; gap: 1.5rem; }
.account form { padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.account details form { border: none; padding-top: .8rem; }
.account summary { cursor: pointer; font-weight: 600; }
.account button[type=submit] { align-self: flex-start; }
.badge.warn { background: rgba(255, 207, 64, .18); color: var(--gold); }
input[type=email] { font: inherit; color: var(--text); background: #0a0f3a; border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; width: 100%; min-width: 0; }
.clue-view.inline .judge-team.lost { opacity: 1; border-color: var(--no); background: rgba(229, 72, 77, .12); }

/* Auf kleinen Bildschirmen duerfen Wertungsleiste und Menues nie die Knoepfe aus dem Bild schieben. */
.clue-controls { max-height: 48dvh; overflow-y: auto; }
.menu { max-height: calc(100dvh - 5rem); overflow-y: auto; }
.key-hint { text-align: center; font-size: .75rem; color: var(--muted); opacity: .7; }
.card-actions button, .card-actions .button { padding: .45rem .65rem; }
@media (max-width: 640px) {
  .title-input { flex: none; width: 100%; }
  .brand { font-size: 0; gap: 0; }
  .save-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .round-tabs .spacer { display: none; }
  input.round-name { flex: 1 1 8rem; width: auto; }
}

/* --- Impressum / Datenschutz --- */
.legal { max-width: 46rem; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2rem) 3rem; display: flex; flex-direction: column; gap: .8rem; line-height: 1.6; }
.legal h2 { margin-top: 1.6rem; color: var(--gold); }
.legal h3 { margin-top: .9rem; }
.legal h4 { margin: .5rem 0 0; font-size: 1rem; }
.legal p { white-space: pre-line; overflow-wrap: anywhere; color: #dfe3fb; }
.legal p.li { padding-left: 1rem; }
.legal-links a { color: var(--muted); }
