/* =========================== Interface joueur (mobile) =========================== */
html, body { height: 100%; }
body { overscroll-behavior: none; }

.app {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--grey);
  font-size: 13px; font-weight: 700; color: var(--grey-text);
}
.top-event { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-user { color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }

.main { flex: 1; display: flex; flex-direction: column; }
.screen { display: none; flex: 1; flex-direction: column; justify-content: space-between; gap: 28px; padding: 28px 20px 20px; }
.screen.is-active { display: flex; animation: screen-in .22s ease-out; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.stack { display: flex; flex-direction: column; gap: 18px; }
.actions { display: flex; flex-direction: column; gap: 12px; }
.center-block { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }

.kicker { color: var(--orange); font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; }
.h-xl { font-size: clamp(34px, 10vw, 46px); }
.h-lg { font-size: clamp(28px, 8vw, 36px); }
.h-q { font-size: clamp(26px, 7.4vw, 34px); line-height: 1.18; outline: none; }
.lead { font-size: 18px; color: #E6E6E6; }

.steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 14px; align-items: center; font-size: 16px; }
.steps b { width: 34px; height: 34px; flex: none; display: grid; place-items: center; background: var(--orange); color: var(--black); font-size: 17px; }

.input-xl { font-size: 22px; min-height: 58px; font-weight: 700; letter-spacing: .02em; }

.identity { border-left: 6px solid var(--orange); background: var(--grey-2); padding: 18px 18px; display: flex; flex-direction: column; gap: 4px; }
.identity-name { font-size: 26px; font-weight: 700; }
.identity-mat { color: var(--grey-text); font-size: 15px; }

.btn-link { background: none; border: 0; padding: 4px 0; color: var(--grey-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 15px; min-height: 36px; }
.btn-link:disabled { opacity: .3; cursor: default; }

/* profilage */
.progress-row { display: flex; justify-content: space-between; align-items: center; }
.progress { height: 6px; background: var(--grey); position: relative; }
.progress > i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--orange); transition: width .25s ease; }

.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-choice {
  min-height: 96px; font-size: 28px; background: var(--grey-2); border: 2px solid var(--grey-3);
}
.btn-choice.is-selected { background: var(--orange); border-color: var(--orange); color: var(--black); }
.btn-choice:not(.is-selected):hover:not([disabled]) { border-color: var(--white); }
.btn-choice[disabled] { opacity: .35; }

/* carte */
.card { background: var(--grey-2); border: 1px solid var(--grey); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-row { display: flex; gap: 12px; align-items: flex-start; }
.card-row .mic-icon { color: var(--orange); width: 28px; height: 28px; margin-top: 2px; }
.card.is-ok { border-color: var(--ok); }
.card-witness { border: 2px solid var(--orange); background: #1A0E05; }
.witness-title { color: var(--orange); font-size: 22px; }

/* quiz live */
.live-head { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--grey); }
.chip-live { background: var(--orange); color: var(--black); }
.chip.is-closed { background: var(--white); color: var(--black); }
.vote-note { color: var(--grey-text); font-size: 15px; }

.btn-speak { background: transparent; border-color: var(--orange); color: var(--orange); }
.btn-speak.is-witness { background: var(--orange); color: var(--black); min-height: 72px; font-size: 21px; animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,102,0,.0); } 50% { box-shadow: 0 0 0 8px rgba(255,102,0,.25); } }

.pending { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--orange); padding: 14px; }
.pending-dot { width: 14px; height: 14px; background: var(--orange); margin-top: 4px; animation: blink 1s steps(2, start) infinite; flex: none; }
@keyframes blink { to { visibility: hidden; } }

.result { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 44px 1fr 52px; gap: 10px; align-items: center; font-weight: 700; }
.bar { height: 22px; background: var(--grey); position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--white); transition: width .6s ease; }
.bar-row:first-child .bar > i { background: var(--orange); }
.reveal { margin-top: 6px; font-size: 22px; font-weight: 700; border-left: 6px solid var(--orange); padding-left: 12px; }

/* pied de page + logo (coin inférieur droit, zone de sécurité) */
.foot { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 20px 20px; min-height: 20px; }
.foot-link { font-size: 13px; }
.logo-slot { width: 44px; height: 44px; margin-left: auto; margin-top: 22px; } /* marge ≥ 0,5 × largeur du logo */

/* chargement */
.spinner { width: 44px; height: 44px; border: 4px solid var(--grey); border-top-color: var(--orange); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* overlays d'appel */
.overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  padding: calc(28px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
}
.overlay[hidden] { display: none; }
.overlay-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; width: 100%; max-width: 480px; align-self: center; }
.overlay-ring { background: var(--orange); color: var(--black); }
.overlay-ring .lead { color: var(--black); }
.overlay-ring .btn-outline { border-color: var(--black); color: var(--black); }
.overlay-ring .btn-outline:hover { background: var(--black); color: var(--white); }
.ring-pulse { width: 120px; height: 120px; margin: 0 auto 10px; display: grid; place-items: center; background: var(--black); color: var(--orange); border-radius: 50%; animation: ring 1.2s ease-out infinite; }
.ring-pulse svg { width: 60px; height: 60px; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(0,0,0,.45); } 100% { box-shadow: 0 0 0 36px rgba(0,0,0,0); } }

.overlay-call { background: var(--black); }
.overlay-call.is-live { box-shadow: inset 0 0 0 6px var(--orange); }
.overlay-call .kicker { font-size: 17px; }
.overlay-call.is-live .kicker::before { content: ""; display: inline-block; width: 12px; height: 12px; background: var(--err); border-radius: 50%; margin-right: 8px; animation: blink 1s steps(2, start) infinite; }
.call-timer { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.call-meter { width: 100%; max-width: 360px; align-self: center; }
.call-meter .meter { height: 14px; }
.call-banner { background: var(--warn); color: var(--black); padding: 10px; font-weight: 700; }
.call-banner-info { background: var(--white); }
.overlay-call.is-muted .call-meter { opacity: .3; }

@media (min-height: 760px) { .screen { padding-top: 40px; } }
