/* Tom & Darren – Das Quiz: Look der Instagram-Termingrafiken
   Dark #164949 · Yellow #D9FF45 · Mint #1B868E · Gray #E5E5E5 · Weiß
   Schrift: PP Agrandir (Dateien in /public/fonts ablegen, sonst Fallback) */
@font-face { font-family: 'Agrandir'; font-weight: 800; src: local('PP Agrandir Grand Heavy'), url('/fonts/agrandir-heavy.woff2') format('woff2'); }
@font-face { font-family: 'Agrandir'; font-weight: 300; src: local('PP Agrandir Grand Light'), url('/fonts/agrandir-light.woff2') format('woff2'); }
@font-face { font-family: 'Agrandir'; font-weight: 500; src: local('PP Agrandir Grand Medium'), url('/fonts/agrandir-medium.woff2') format('woff2'); }

:root {
  --dark: #164949; --yellow: #D9FF45; --mint: #1B868E; --gray: #E5E5E5; --white: #fff; --black: #000;
  --deep: #0f3535; --line: rgba(255,255,255,.55);
  --frame: 2.4vmin;           /* Rahmenstärke und Abstand wie in der 1080er-Grafik (26/1080) */
  --font: 'Agrandir', 'Helvetica Neue', Arial, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--mint); color: var(--white); font-family: var(--font); font-weight: 300;
  line-height: 1.2; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* Rahmenlücke unten mit Logo-Plakette (nur Beamer-Seite) */
body.tv::after {
  content: ''; position: fixed; bottom: var(--frame); left: 50%; transform: translateX(-50%);
  width: 23.8vmin; height: var(--frame); background: var(--mint); z-index: 51; pointer-events: none;
}
html.tv-logo::after {
  content: ''; position: fixed; left: 50%; transform: translateX(-50%); width: 23.8vmin; height: 4.84vmin;
  bottom: calc(1.5 * var(--frame) - 3.2vmin); background: url(/img/logo-banner.png) center / contain no-repeat;
  z-index: 52; pointer-events: none;
}
/* gelber Rahmen */
body::before {
  content: ''; position: fixed; inset: var(--frame); border: var(--frame) solid var(--yellow);
  pointer-events: none; z-index: 50;
}
.h, h1, h2, h3, .label { font-weight: 800; text-transform: uppercase; letter-spacing: .01em; }
.label { color: var(--yellow); font-size: 2.4vmin; }
.mid { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 2.6vmin; }
.src { align-self: flex-end; color: var(--yellow); font-weight: 800; font-size: 3vmin; }
.muted { opacity: .7; }

button {
  font: inherit; font-weight: 800; text-transform: uppercase; cursor: pointer; border: 0;
  background: var(--yellow); color: var(--dark); padding: 1.6vmin 3.6vmin; font-size: 2.4vmin; border-radius: 0;
}
button.ghost { background: transparent; color: var(--white); border: .35vmin solid var(--line); }
button:disabled { opacity: .35; cursor: default; }
input, select {
  font: inherit; font-weight: 500; font-size: 2.4vmin; padding: 1.4vmin 1.8vmin; border: .35vmin solid var(--line);
  background: var(--deep); color: var(--white); border-radius: 0; width: 100%;
}
input::placeholder { color: rgba(255,255,255,.45); }

/* ---------- Beamer (Host) ---------- */
.stage { min-height: 100vh; padding: calc(var(--frame) * 2 + 3vmin) calc(var(--frame) * 2 + 4vmin) calc(var(--frame) * 2 + 2vmin); display: flex; flex-direction: column; gap: 3vmin; }
.top { display: flex; justify-content: space-between; align-items: center; }
.bar { height: 1.4vmin; background: var(--dark); }
.bar i { display: block; height: 100%; width: 100%; background: var(--yellow); }
.timer { font-weight: 800; font-size: 7vmin; color: var(--yellow); min-width: 8vmin; text-align: right; }
.question { font-weight: 800; font-size: 5.6vmin; line-height: 1.12; max-width: 88vw; color: var(--yellow); text-align: center; }
.question.long { font-size: 4.4vmin; }
.media { display: flex; gap: 4vmin; align-items: center; justify-content: center; }
.media img { max-height: 38vh; max-width: 48vw; object-fit: contain; }
.media audio { width: 40vw; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 2vmin; width: 88vw; text-align: left; }
.opt { display: flex; gap: 2.4vmin; align-items: center; padding: 2.2vmin 3vmin; font-weight: 800; font-size: 3.6vmin; }
.opt b { font-size: 4.4vmin; min-width: 5vmin; }
.opt small { margin-left: auto; font-size: 3vmin; font-weight: 300; }
.o0 { background: var(--yellow); color: var(--dark); }
.o1 { background: var(--white); color: var(--dark); }
.o2 { background: var(--dark); color: var(--white); }
.o3 { background: transparent; color: var(--yellow); border: .5vmin solid var(--yellow); }
.opt.dim { opacity: .3; filter: saturate(.2); }
.opt.ok { outline: 1vmin solid var(--yellow); outline-offset: .4vmin; }
.hint { font-size: 3.2vmin; font-weight: 300; }
.count { font-size: 2.4vmin; font-weight: 300; opacity: .85; }
.foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 2vmin; }
.foot img { height: 12vmin; }
.foot .ctl { display: flex; gap: 1.6vmin; }
.lobby { display: grid; grid-template-columns: auto 1fr; gap: 6vmin; align-items: center; }
.lobby img.qr { width: 38vmin; height: 38vmin; background: #fff; padding: 1.6vmin; }
.pin { font-weight: 800; font-size: 13vmin; letter-spacing: .06em; color: var(--yellow); line-height: 1; }
.url { font-size: 3vmin; font-weight: 300; }
.chips { display: flex; flex-wrap: wrap; gap: 1.2vmin; }
.chip { border: .35vmin solid var(--line); padding: .8vmin 1.8vmin; font-size: 2.6vmin; font-weight: 300; }
table.rank { border-collapse: collapse; font-size: 3vmin; text-align: left; width: 100%; max-width: 70vw; }
table.rank td { padding: .6vmin 2vmin; border-bottom: .3vmin solid var(--line); }
table.rank td.n { width: 8vmin; color: var(--yellow); font-weight: 800; }
table.rank td.s { text-align: right; font-weight: 800; }
table.rank tr:first-child td { color: var(--yellow); }
.sol { background: var(--yellow); color: var(--dark); padding: 2vmin 3vmin; font-weight: 800; font-size: 4.4vmin; display: inline-block; white-space: pre-line; text-align: left; }
.solimg { max-height: 24vh; max-width: 60vw; object-fit: contain; }
.guess { display: flex; gap: 3vmin; font-size: 3vmin; font-weight: 300; flex-wrap: wrap; }
.guess span b { color: var(--yellow); }
.grade { display: grid; grid-template-columns: 1fr 2fr auto; gap: 1.2vmin 2vmin; align-items: center; font-size: 3vmin; max-width: 90vw; }
.grade .t { font-weight: 800; }
.grade button { padding: 1vmin 2.4vmin; font-size: 2.6vmin; background: var(--deep); color: var(--white); border: .35vmin solid var(--line); min-width: 12vmin; }
.grade button.yes { background: var(--yellow); color: var(--dark); border-color: var(--yellow); }

/* ---------- Setup (Host) ---------- */
.setup { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 2vmin; font-size: 2.4vmin; }
.setup h1 { font-size: 5vmin; margin: 0; }
.setup .box { border: .35vmin solid var(--line); padding: 2.4vmin; display: flex; flex-direction: column; gap: 1.6vmin; }
.setup label { font-weight: 800; text-transform: uppercase; font-size: 2vmin; color: var(--yellow); }
.setup .row { display: flex; gap: 1.6vmin; flex-wrap: wrap; }
.setup .row > * { flex: 1; }
.setup a { color: var(--yellow); cursor: pointer; text-decoration: underline; }
.setup .warn { color: var(--yellow); font-size: 2vmin; white-space: pre-wrap; }
.err { color: #ffb3b3; min-height: 1.2em; font-weight: 300; }

/* ---------- Handy ---------- */
.phone { min-height: 100dvh; padding: calc(var(--frame) * 2 + 1.5vmin); display: flex; flex-direction: column; gap: 2.4vmin; justify-content: center; text-align: center; }
@media (min-width: 700px) { .phone { max-width: 520px; margin: 0 auto; } }
.phone h1 { font-size: 5.4vmin; margin: 0; }
@media (min-width: 700px) { .phone h1 { font-size: 36px; } }
.phone .big { font-weight: 800; text-transform: uppercase; font-size: 6.4vmin; line-height: 1.05; }
@media (min-width: 700px) { .phone .big { font-size: 40px; } }
.phone .lbl { color: var(--yellow); font-weight: 800; text-transform: uppercase; font-size: 3.4vmin; }
.phone input { text-align: center; font-size: 4.4vmin; padding: 2.2vmin; }
@media (min-width: 700px) { .phone input { font-size: 24px; } }
.phone button { font-size: 4vmin; padding: 2.4vmin; }
@media (min-width: 700px) { .phone button { font-size: 22px; } }
.phone .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2vmin; flex: 1; }
.phone .grid button { min-height: 28vh; font-size: 9vmin; display: flex; align-items: center; justify-content: center; padding: 1vmin; }
.phone .grid button { position: relative; }
.phone .grid button { flex-direction: column; gap: 1vmin; }
.phone .grid button small { font-size: 5vmin; font-weight: 800; }
.phone .grid button.sel { opacity: .4; filter: saturate(.3); }
.phone .row2 { display: grid; grid-template-columns: 1fr 2fr; gap: 2vmin; }
.phone .ok { color: var(--yellow); }
.phone .bad { color: #ffb3b3; }
.phone .pts { font-weight: 800; font-size: 8vmin; color: var(--yellow); }

/* ---------- Auflösung: weißer Hintergrund, Mint-Rand ---------- */
html.rv body { background: var(--white); color: var(--dark); }
html.rv body::before { border-color: var(--mint); }
html.rv body.tv::after { background: var(--white); }
html.rv::after { background-image: url(/img/logo-banner-weiss.png); }
html.rv .label, html.rv .src, html.rv .guess span b, html.rv table.rank tr:first-child td, html.rv table.rank td.n { color: var(--mint); }
html.rv .question { color: var(--dark); }
html.rv .hint, html.rv .count { color: var(--dark); }
html.rv button { background: var(--mint); color: var(--white); }
html.rv .sol { background: var(--mint); color: var(--white); }
html.rv .o0 { background: var(--mint); color: var(--white); }
html.rv .o1 { background: var(--dark); color: var(--white); }
html.rv .o2 { background: var(--gray); color: var(--dark); }
html.rv .o3 { background: transparent; color: var(--mint); border-color: var(--mint); }
html.rv .opt.dim { opacity: .35; filter: none; }
html.rv .opt.ok { outline-color: var(--dark); }
html.rv table.rank td { border-bottom-color: rgba(27,134,142,.35); }

/* Beamer-Fenster: keine Bedienelemente */
body.screen button, body.screen .foot .ctl { display: none !important; }
#soundhint { position: fixed; bottom: 6vmin; right: 5vmin; z-index: 60; font-size: 1.8vmin; opacity: .7; cursor: pointer; }
#openscreen { position: fixed; top: 5.6vmin; left: 50%; transform: translateX(-50%); z-index: 60; font-size: 1.8vmin; padding: .8vmin 1.8vmin; opacity: .7; }
html.rv #openscreen { background: transparent; color: var(--dark); border: .3vmin solid var(--mint); }

/* Siegerehrung: Balkenrennen */
.brows { flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; gap: .5vmin; margin: 1.5vmin 0 0; min-height: 0; }
.brow { display: flex; align-items: center; gap: 1.6vmin; height: calc(54vmin / var(--n)); max-height: 6vmin; font-size: min(3vmin, calc(42vmin / var(--n))); }
.bn { width: 6.5vmin; text-align: right; font-weight: 800; color: var(--yellow); }
.bname { width: 24vmin; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; }
.btrack { flex: 1; height: 72%; }
.bbar { height: 100%; width: 0; background: #fff; min-width: .4vmin; }
.bs { width: 11vmin; font-weight: 800; text-align: left; }
.brow.win .bbar { background: var(--yellow); }
.brow.win .bname, .brow.win .bs { color: var(--yellow); }

/* Mehrfachauswahl (bis zu 10 Antworten) */
.opts.many { gap: 1.2vmin 2vmin; }
.opts.many .opt { padding: 1.1vmin 2.4vmin; font-size: 3vmin; }
.opts.many .opt b { font-size: 3.4vmin; min-width: 4vmin; }
.phone .grid.many { grid-template-columns: 1fr 1fr 1fr 1fr; grid-auto-rows: 1fr; }
.phone .grid.many button { min-height: 12vh; font-size: 7vmin; }
.opts.many .opt.ok { outline-width: .7vmin; outline-offset: -.7vmin; }
