/* Quizz Tony — overlay 1920x1080 affiché dans OBS */
html, body { width: 100%; height: 100%; overflow: hidden; background: transparent; }
#viewport { position: relative; width: 100%; height: 100%; overflow: hidden; }
.stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden;
  background: radial-gradient(1200px 700px at 20% 10%, #2a1a5e 0%, transparent 60%), radial-gradient(900px 600px at 85% 90%, #0e3a4a 0%, transparent 55%), linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
  font-size: 28px; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
.stage.transparent { background: transparent; }
.stage::before { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Ccircle cx='60' cy='60' r='1' fill='white' opacity='0.08'/%3E%3C/svg%3E"); pointer-events: none; }
.stage.transparent::before { display: none; }

/* HUD */
.hud { position: absolute; top: 0; left: 0; right: 0; height: 110px; display: flex; align-items: center; justify-content: space-between; padding: 0 48px; gap: 24px; z-index: 5; }
.hud .theme-badge { display: flex; align-items: center; gap: 16px; font-size: 36px; font-weight: 800; }
.hud .theme-badge .emoji { font-size: 48px; }
.hud .counter { font-size: 38px; font-weight: 800; letter-spacing: 1px; }
.hud .counter small { font-size: 24px; color: var(--muted); font-weight: 600; }
.hud .right { display: flex; gap: 14px; align-items: center; font-size: 22px; }
.hud .badge { font-size: 22px; padding: 8px 16px; }

/* écrans */
.screen { position: absolute; inset: 110px 0 60px 0; display: none; }
.screen.active { display: block; }

/* SETUP */
#screen-setup { padding: 0 72px; }
#screen-setup h1 { margin: 0 0 6px; font-size: 72px; letter-spacing: 2px; }
#screen-setup .sub { color: var(--muted); font-size: 26px; margin-bottom: 26px; }
.theme-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.theme-card { position: relative; background: var(--panel); border: 2px solid var(--border); border-radius: var(--radius); padding: 18px 20px; cursor: pointer; min-height: 132px; transition: transform .1s, border-color .15s, background .15s; overflow: hidden; }
.theme-card:hover { background: var(--panel-strong); transform: translateY(-2px); }
.theme-card.selected { border-color: var(--accent-card, var(--accent)); background: rgba(255, 255, 255, 0.14); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08) inset; }
.theme-card .emoji { font-size: 44px; line-height: 1; }
.theme-card .name { font-size: 26px; font-weight: 800; margin-top: 8px; line-height: 1.1; }
.theme-card .meta { font-size: 18px; color: var(--muted); margin-top: 6px; }
.theme-card .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--accent-card, var(--accent)); }
.theme-card.broken { opacity: 0.4; cursor: not-allowed; }
.setup-bar { display: flex; align-items: center; gap: 22px; margin-top: 28px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 24px; font-size: 22px; }
.setup-bar label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 18px; }
.setup-bar input[type="text"], .setup-bar select { font-size: 22px; }
.setup-bar .grow { flex: 1; }
.setup-bar .btn.primary { font-size: 30px; padding: 16px 40px; border-radius: 16px; }
.setup-bar .vol { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.notice { color: var(--warn); font-size: 22px; margin-top: 12px; min-height: 30px; }

/* INTRO */
#screen-intro { display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; }
#screen-intro.active { display: flex; }
#screen-intro .emoji { font-size: 180px; line-height: 1; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .6)); animation: pop .6s ease-out; }
#screen-intro .label { font-size: 34px; color: var(--muted); letter-spacing: 6px; text-transform: uppercase; }
#screen-intro h2 { margin: 0; font-size: 110px; line-height: 1; font-weight: 900; }
#screen-intro .desc { font-size: 30px; color: var(--muted); max-width: 1200px; }
#screen-intro .rules { font-size: 28px; margin-top: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 28px; }
#screen-intro .progress { margin-top: 20px; font-size: 26px; color: var(--muted); }
#screen-intro .bar { width: 600px; height: 14px; background: rgba(255, 255, 255, 0.12); border-radius: 7px; overflow: hidden; margin: 10px auto 0; }
#screen-intro .bar > div { height: 100%; background: var(--accent); transition: width .3s; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* QUESTION */
#screen-question .center { position: absolute; left: 0; right: 0; top: 0; height: 560px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.cover-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) brightness(.45); opacity: 0; transition: opacity .6s; pointer-events: none; }
.stage[data-revealed="1"] .cover-bg { opacity: 1; }
.visualizer { display: flex; align-items: flex-end; gap: 10px; height: 180px; }
.visualizer span { width: 18px; height: 20%; border-radius: 9px 9px 4px 4px; background: linear-gradient(180deg, var(--accent-card, var(--accent)), rgba(255, 255, 255, .85)); animation: eq 1.1s ease-in-out infinite alternate; transform-origin: bottom; box-shadow: 0 0 16px rgba(139, 92, 246, .5); }
.visualizer.paused span { animation-play-state: paused; opacity: .4; }
.visualizer.off { visibility: hidden; }
@keyframes eq { from { height: 12%; } to { height: 100%; } }
.cover { width: 220px; height: 220px; border-radius: 20px; object-fit: cover; box-shadow: var(--shadow); display: none; }
.stage[data-revealed="1"] .cover.has { display: block; }
.stage[data-revealed="1"] .visualizer { display: none; }

.answer-lines { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 1600px; }
.answer-line { display: flex; align-items: baseline; gap: 22px; }
.answer-line .label { font-size: 26px; color: var(--muted); text-transform: uppercase; letter-spacing: 3px; min-width: 150px; text-align: right; }
.answer-line .text { font-size: 64px; font-weight: 900; letter-spacing: 6px; font-family: "Consolas", "Courier New", monospace; }
.answer-line.revealed .text { letter-spacing: 1px; font-family: var(--font); color: #fff; animation: flip .5s ease-out; }
.answer-line .meta { font-size: 22px; color: var(--muted); }
.answer-sub { font-size: 30px; color: var(--muted); }
.answer-sub strong { color: var(--text); }
@keyframes flip { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.hint-box { font-size: 30px; background: rgba(245, 158, 11, 0.15); border: 1px solid var(--warn); border-radius: 14px; padding: 10px 26px; }
.hint-box::before { content: "💡 "; }
.progress-top3 { font-size: 28px; color: var(--muted); }

/* gagnants */
.winner-banner { display: flex; flex-direction: column; align-items: center; gap: 6px; background: linear-gradient(135deg, rgba(34, 197, 94, .25), rgba(139, 92, 246, .25)); border: 2px solid var(--ok); border-radius: 20px; padding: 12px 40px; font-size: 38px; font-weight: 900; box-shadow: var(--shadow); animation: pop .4s ease-out; z-index: 6; margin-top: 4px; }
.winner-banner .row { display: flex; align-items: center; gap: 16px; }
.winner-banner .pts { font-size: 30px; color: var(--ok); }
.winner-banner .medal { font-size: 40px; }
.stage[data-revealed="1"] .cover { width: 150px; height: 150px; }
#screen-question .center { overflow: visible; }
.stage[data-revealed="1"] #screen-question .center { gap: 14px; }
.stage[data-revealed="1"] .answer-line .text { font-size: 56px; }
.winner-banner .name { max-width: 700px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* feed */
.feed { position: absolute; left: 48px; bottom: 20px; width: 760px; height: 330px; background: rgba(0, 0, 0, .35); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 24px; display: flex; flex-direction: column; }
/* commandes chat affichées à l'écran (masquées si les commandes sont désactivées dans la régie) */
.commands { position: absolute; left: 828px; bottom: 20px; width: 504px; height: 330px; background: rgba(0, 0, 0, .35); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 22px; }
.commands ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.commands li { display: flex; align-items: center; gap: 14px; font-size: 22px; white-space: nowrap; transition: opacity .2s; }
.commands li code { flex: none; min-width: 150px; text-align: center; }
.commands li span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.commands li.off { opacity: .32; }
.commands code, .theme-card .cmd code, .cmd-hint code { font-family: Consolas, "Courier New", monospace; background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; padding: 2px 10px; color: #fff; text-shadow: none; }
.theme-card .cmd { position: absolute; top: 14px; right: 14px; font-size: 18px; }
.cmd-hint { color: var(--muted); }
.intro-cmds { font-size: 24px; margin-top: 18px; }
.score-cmds { text-align: center; font-size: 24px; margin-top: 12px; }
.no-cmds .commands, .no-cmds .theme-card .cmd, .no-cmds .cmd-hint { display: none; }
.feed h3, .leaderboard h3, .commands h3 { margin: 0 0 10px; font-size: 22px; color: var(--muted); text-transform: uppercase; letter-spacing: 3px; font-weight: 700; }
.feed ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.feed li { display: flex; align-items: center; gap: 12px; font-size: 28px; white-space: nowrap; overflow: hidden; }
.feed li .mark { width: 34px; flex: none; text-align: center; }
.feed li .who { font-weight: 800; flex: none; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.feed li .what { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.feed li.ok .what { color: var(--ok); font-weight: 700; }
.feed .empty { color: var(--muted); font-size: 24px; }
.feed .howto { margin-top: auto; font-size: 22px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; }
.feed .howto code { background: rgba(255, 255, 255, .12); padding: 2px 10px; border-radius: 8px; font-size: 22px; color: var(--text); }

/* mini classement */
.leaderboard { position: absolute; right: 48px; bottom: 20px; width: 520px; height: 330px; background: rgba(0, 0, 0, .35); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 24px; }
.leaderboard ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.leaderboard li { display: flex; align-items: center; gap: 12px; font-size: 28px; }
.leaderboard li .rank { width: 44px; color: var(--muted); font-weight: 800; }
.leaderboard li .who { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard li .pts { font-weight: 900; }
.leaderboard .empty { color: var(--muted); font-size: 24px; }

/* SCOREBOARD */
#screen-scoreboard { padding: 0 72px; }
#screen-scoreboard h2 { margin: 0; font-size: 70px; text-align: center; }
#screen-scoreboard .sub { text-align: center; color: var(--muted); font-size: 28px; margin-bottom: 20px; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 26px; height: 420px; margin-top: 10px; }
.podium .step { width: 330px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.podium .step .name { font-size: 36px; font-weight: 900; text-align: center; max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .step .pts { font-size: 28px; color: var(--muted); }
.podium .step .block { width: 100%; border-radius: 18px 18px 0 0; display: flex; align-items: flex-start; justify-content: center; font-size: 80px; font-weight: 900; padding-top: 14px; box-shadow: var(--shadow); }
.podium .step.p1 .block { height: 260px; background: linear-gradient(180deg, var(--gold), #92400e); }
.podium .step.p2 .block { height: 190px; background: linear-gradient(180deg, var(--silver), #475569); }
.podium .step.p3 .block { height: 140px; background: linear-gradient(180deg, var(--bronze), #78350f); }
.podium .empty { color: var(--muted); font-size: 32px; align-self: center; }
.score-list { margin: 22px auto 0; max-width: 1200px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 40px; font-size: 28px; }
.score-list li { display: flex; gap: 14px; align-items: center; list-style: none; }
.score-list .rank { width: 50px; color: var(--muted); font-weight: 800; }
.score-list .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.score-list .pts { font-weight: 900; }

/* pied, crédits */
.credits { position: absolute; right: 48px; bottom: 0; height: 60px; display: flex; align-items: center; justify-content: flex-end; font-size: 18px; color: var(--muted); z-index: 5; }
.credits .src { opacity: .8; }
.status-line { position: absolute; left: 48px; bottom: 0; height: 60px; display: flex; align-items: center; gap: 16px; font-size: 20px; color: var(--muted); z-index: 5; }

/* bouton d'activation du son (hors OBS) */
.unlock { position: absolute; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); }
.unlock button { font-size: 44px; padding: 26px 56px; border-radius: 24px; }

/* barre de contrôle (survol / ?controls=1) */
.controls { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); width: max-content; white-space: nowrap; display: flex; gap: 10px; align-items: center; background: rgba(0, 0, 0, .8); border: 1px solid var(--border); border-radius: 16px; padding: 12px 16px; z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s; }
.controls.show { opacity: 1; pointer-events: auto; }
.controls .btn { font-size: 20px; padding: 12px 18px; }
.controls .btn.primary { font-size: 24px; padding: 12px 26px; }
.controls .vol { display: flex; align-items: center; gap: 8px; font-size: 18px; color: var(--muted); width: 200px; }

.debug-banner { position: absolute; top: 0; left: 0; right: 0; z-index: 95; background: var(--bad); color: #fff; text-align: center; font-size: 22px; font-weight: 800; padding: 4px; letter-spacing: 2px; }
.mirror-badge { position: absolute; top: 120px; right: 48px; z-index: 95; }
.sim { position: absolute; left: 48px; top: 120px; z-index: 96; background: rgba(0, 0, 0, .85); border: 1px solid var(--bad); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 16px; width: 420px; }
.sim .row { display: flex; gap: 6px; flex-wrap: wrap; }
.sim input { font-size: 16px; flex: 1; }
.sim .btn { font-size: 14px; padding: 6px 10px; }
.sim pre { margin: 0; max-height: 300px; overflow: auto; font-size: 12px; color: var(--muted); white-space: pre-wrap; }
/* titres longs (plus de 24 caractères) : police réduite pour tenir sur une ligne */
.answer-line.long .text { font-size: 46px; letter-spacing: 3px; }
.stage[data-revealed="1"] .answer-line.long .text { font-size: 44px; letter-spacing: 0; }
.answer-line .meta { white-space: nowrap; }
.commands li { font-size: 21px; }
.commands ul { gap: 4px; }
.theme-card .cmd { font-size: 20px; }
