/* Couvre-feu — la coque : en-tête, accueil, première visite, salon, fin, grille (propriétaire : agent « Écrans — coque »). */

/* ---- En-tête et bande d'état ---- */
#bar {
  flex: none; height: calc(var(--cible) + 8px + var(--safe-t)); padding: var(--safe-t) 8px 0 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.bar-title { font-size: 15px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
#app[data-screen="accueil"] .bar-title { visibility: hidden; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: var(--cible); height: var(--cible);
  border: 0; border-radius: 12px; background: transparent; color: var(--fg); cursor: pointer;
}
.icon-btn[aria-pressed="true"] { color: var(--danger); }
#etat { position: absolute; z-index: 30; top: calc(var(--cible) + 8px + var(--safe-t)); left: 12px; right: 12px; margin: 0; pointer-events: none; }
.status-msg {
  margin: 0; padding: 8px 12px; border-radius: 10px; background: #3a2a14; color: #ffd9a0; border: 1px solid #6b4a1e;
  font-size: 13px; text-align: center;
}

/* ---- Structure commune d'un écran ---- */
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 4px 16px var(--marge-bas); }
.screen > .body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 12px; }
.screen > .actions { flex: none; display: flex; flex-direction: column; gap: 8px; }
.screen > .actions.row { flex-direction: row; }
.screen > .actions.row .btn { flex: 1; min-width: 0; }
.center { text-align: center; }
.center-v { justify-content: center; }
.sub { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.big { margin: 0; font-size: 30px; line-height: 1.15; text-align: center; }
.lead { margin: 0; font-size: 16px; color: var(--fg); }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.notice { margin: 0; padding: 10px 12px; border-radius: 10px; background: #3a2a14; border: 1px solid #6b4a1e; color: #ffd9a0; font-size: 14px; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: 12px; line-height: 1.5; white-space: nowrap; }
.chip.me { background: var(--accent); color: var(--accent-fg); font-weight: 700; }
.chip.away { color: var(--danger); }

/* ---- Accueil ---- */
.brand { flex: none; padding-top: 4px; text-align: center; }
.brand h1 { margin: 0; font-size: 38px; line-height: 1.1; letter-spacing: .06em; text-transform: uppercase; }
.slogan { margin: 6px 0 0; font-size: 15px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.input {
  min-height: var(--bouton); padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); color: var(--fg); font-size: 18px;
}

/* ---- Première visite : Pourquoi / Comment ---- */
.intro-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tabs { display: flex; gap: 4px; }
.tab {
  min-height: var(--cible); padding: 6px 14px; border: 0; border-bottom: 3px solid transparent; background: transparent;
  color: var(--muted); font-size: 16px; font-weight: 600; cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.intro-body { gap: 14px; }
.intro-item { padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.intro-item h2 { margin: 0 0 4px; font-size: 16px; color: var(--accent); }
.intro-item p { margin: 0; font-size: 15px; }

/* ---- Salon ---- */
.qr-block { flex: none; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.qr {
  width: min(52vw, 200px, calc(var(--hv) * .3)); aspect-ratio: 1; background: #fff; border-radius: 10px; overflow: hidden;
}
.qr svg { display: block; width: 100%; height: 100%; }
.seats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seat {
  display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 40px;
  padding: 4px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
}
.seat.mine { border-color: var(--accent); }
.seat.away { opacity: .6; }
.seat-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .chip { flex: none; }

/* ---- Attente de l'invité ---- */
.wait { margin: 0; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--cible); font-size: 17px; font-weight: 700; text-align: center; }
.wait-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: wait-pulse 1.6s ease-in-out infinite; }
@keyframes wait-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wait-dot { animation: none; } }

/* ---- Fin ---- */
.fin-head { flex: none; padding: 12px 14px; border-radius: 14px; text-align: center; background: var(--panel); border: 1px solid var(--line); }
.fin-head h2 { margin: 0; font-size: 26px; line-height: 1.15; }
.fin-head p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.fin-head.win-quartier { border-color: var(--quartier); }
.fin-head.win-quartier h2 { color: var(--quartier); }
.fin-head.win-rodeurs { border-color: var(--rodeurs); }
.fin-head.win-rodeurs h2 { color: var(--rodeurs); }
.fin-head .verdict-me { font-weight: 700; color: var(--fg); }
.roles-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.role-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 4px 12px; border-radius: 10px; background: var(--panel); border: 1px solid transparent; }
.role-row.mine { border-color: var(--accent); }
.role-name { font-size: 15px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-tag { font-size: 14px; font-weight: 700; flex: none; }
.role-row.quartier .role-tag { color: var(--quartier); }
.role-row.rodeurs .role-tag { color: var(--rodeurs); }
.role-row.out .role-name { text-decoration: line-through; text-decoration-color: var(--muted); }
.replay-head, .grille-head { flex: none; }
.replay-head h2, .grille-head h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.replay { gap: 14px; }
.replay-sec h3 { margin: 0 0 4px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.replay-sec p { margin: 0 0 4px; font-size: 15px; }

/* ---- Grille du testeur (core/playtest : classes pt-) ---- */
.pt-q { display: flex; flex-direction: column; gap: 12px; }
.pt-step { margin: 0; font-size: 13px; color: var(--muted); }
.pt-ask { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.25; }
.pt-grades { display: flex; gap: 6px; }
.pt-grade {
  flex: 1; min-width: 0; min-height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
  font-size: 22px; font-weight: 700; cursor: pointer;
}
.pt-grade.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.pt-ends { margin: 0; display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.pt-ends span { max-width: 48%; }
.pt-ends span:last-child { text-align: right; }

/* ---- Écran d'attente (stand-in de l'agent jeu) ---- */
.attente .big { font-size: 22px; }

/* ---- Petits écrans (320 × 568, 375 × 667) : mêmes écrans, moins d'espace entre les blocs ---- */
@media (max-height: 700px) {
  .screen { gap: 8px; }
  .screen > .body { gap: 8px; }
  .intro-body { gap: 8px; }
  .intro-item { padding: 8px 12px; }
  .intro-item p { font-size: 14px; }
  .brand h1 { font-size: 32px; }
  .fin-head { padding: 8px 12px; }
  .fin-head h2 { font-size: 22px; }
  .replay { gap: 7px; }
  .replay-head h2 { font-size: 19px; }
  .replay-sec h3 { font-size: 11px; margin-bottom: 2px; }
  .replay-sec p { font-size: 13px; line-height: 1.28; margin-bottom: 2px; }
  .seat { min-height: 36px; }
  .role-row { min-height: 32px; padding-top: 2px; padding-bottom: 2px; }
  .qr { width: min(52vw, 200px, calc(var(--hv) * .26)); }
}
@media (max-height: 640px) {
  .qr-block .hint { display: none; }
}
