/* ===============================================================
   SFR QUIZ — charte blanc / rouge / noir
   =============================================================== */
:root {
  --sfr-red: #e2001a;
  --sfr-red-dark: #b30014;
  --sfr-black: #1d1d1b;
  --sfr-grey: #6b6b6b;
  --sfr-light: #f4f4f4;
  --green: #1a9e4b;
  --radius: 999px;
  --font: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Doit primer sur les `display: flex` des blocs ci-dessous */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: var(--font);
  color: var(--sfr-black);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }

.logo {
  background: var(--sfr-red);
  color: #fff;
  font-weight: 800;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------------------------------------------------------------
   ACCUEIL (index.html)
   --------------------------------------------------------------- */
.home {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 40px;
}
.home h1 { font-size: 2rem; text-transform: uppercase; letter-spacing: 1px; }
.home p.sub { color: var(--sfr-grey); margin-top: 8px; }
.home .choices { display: flex; gap: 32px; flex-wrap: wrap; justify-content: center; }
.choice {
  width: 300px; height: 240px;
  border-radius: 24px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  color: #fff; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.choice:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.choice.tablet { background: var(--sfr-red); }
.choice.tv { background: var(--sfr-black); }
.choice svg { width: 64px; height: 64px; stroke: #fff; fill: none; stroke-width: 5; }
.choice .label { font-size: 1.8rem; font-weight: 800; }
.choice .hint { font-size: .95rem; opacity: .8; }

/* ---------------------------------------------------------------
   TV
   --------------------------------------------------------------- */
.tv-body { overflow: hidden; }

/* La scène occupe tout l'écran. Le décor étant composé d'images
   positionnées (et non d'un fond unique), rien n'est recadré :
   les cqw/cqh ci-dessous restent relatifs à la scène. */
.tv-stage {
  position: relative;
  width: 100vw; height: 100vh;
  container-type: size;
  background: #fff;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* --- Décor (empilé sous le contenu) ---
   Les visuels sont dimensionnés en hauteur ; leur largeur dépend donc de
   leur ratio. Les variables ci-dessous rejouent ce calcul pour que les
   textes se calent dessus quel que soit le format de l'écran. */
.tv-stage {
  --perso-h: 60cqh;
  --perso-w: calc(var(--perso-h) * 584 / 678); /* ratio de personnage.png */
  --deco-w: calc(100cqh * 472 / 1080);         /* ratio de deco.png */
}

.tv-bar {                      /* bande rouge, derrière les visuels */
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 4.5cqh; background: var(--sfr-red); z-index: 0;
}
.tv-perso {                    /* personnages, collés en bas à gauche */
  position: absolute; left: 0; bottom: 0;
  height: var(--perso-h); width: auto; z-index: 1;
}
.tv-deco {                     /* déco, collée à droite sur toute la hauteur */
  position: absolute; right: 0; top: 0;
  height: 100cqh; width: auto; z-index: 1;
}
.tv-logo { position: absolute; left: 0; top: 0; width: 13cqw; height: auto; z-index: 3; }

.tv-header {
  position: relative; z-index: 2;
  padding: 3cqh 3cqw 0;
  text-align: center;
}
.tv-score { font-size: 7cqh; line-height: 1; font-weight: 800; color: var(--sfr-red); }
.tv-score-label {
  font-size: 1.6cqh; letter-spacing: 3px; font-weight: 700;
  color: var(--sfr-red); text-transform: uppercase; margin-top: .6cqh;
}
.tv-rule { height: 2px; background: #d9d9d9; margin: 3cqh 6cqw 0; }

.tv-content {
  position: relative; z-index: 2;
  flex: 1;
  display: flex; align-items: center;
  padding: 0 4cqw 6cqh calc(var(--perso-w) + 3cqw); /* dégage les personnages */
}
.tv-qblock { width: 100%; }
.tv-question {
  font-size: 2.3cqw; font-weight: 800; text-transform: uppercase;
  line-height: 1.25; margin-bottom: 4cqh;
}
.tv-answers { display: flex; flex-direction: column; gap: 2.2cqh; }
.tv-answer {
  display: flex; align-items: center; gap: 1.4cqw;
  border: .22cqw solid var(--sfr-black);
  border-radius: var(--radius);
  padding: 1.6cqh 2cqw;
  font-size: 1.45cqw; font-weight: 700; text-transform: uppercase;
  background: #fff;
  transition: all .25s ease;
}
.tv-answer .bullet {
  flex: 0 0 auto;
  width: 2.8cqw; height: 2.8cqw;
  border-radius: 50%;
  background: var(--sfr-black); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4cqw; font-weight: 800;
}
.tv-answer.correct {
  border-color: var(--green); background: var(--green); color: #fff;
}
.tv-answer.correct .bullet { background: #fff; color: var(--green); }
.tv-answer.wrong { opacity: .3; }

/* Écrans début / fin */
.tv-splash {
  position: relative; z-index: 2;
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  /* centré entre les personnages (gauche) et la déco (droite) */
  padding: 0 calc(var(--deco-w) + 2cqw) 6cqh calc(var(--perso-w) + 2cqw);
}
.tv-splash h1 {
  font-size: 7.5cqw; font-weight: 800; text-transform: uppercase;
  line-height: 1; color: var(--sfr-red); letter-spacing: .02em;
}
.tv-splash-sub {
  font-size: 3.2cqw; font-weight: 800; line-height: 1.15;
  color: var(--sfr-red); margin-top: 3cqh;
}
.tv-splash .big-score {
  font-size: 9cqw; font-weight: 800; color: var(--sfr-red); line-height: 1; margin-top: 2cqh;
}

.tv-offline {
  position: fixed; bottom: 16px; right: 20px;
  background: var(--sfr-black); color: #fff;
  padding: 8px 16px; border-radius: var(--radius); font-size: 14px;
}

/* ---------------------------------------------------------------
   TABLETTE
   --------------------------------------------------------------- */
.tb-body { background: var(--sfr-light); }
.tb-wrap {
  max-width: 900px; margin: 0 auto; min-height: 100vh;
  display: flex; flex-direction: column; padding: 20px;
}
.tb-top {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
}
.tb-top .logo-img { width: 46px; height: auto; }
.tb-top .title { font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.tb-top .spacer { flex: 1; }
.pill {
  border-radius: var(--radius); padding: 7px 16px;
  font-size: 13px; font-weight: 700; background: #fff; border: 2px solid #ddd;
}
.pill.ok { border-color: var(--green); color: var(--green); }
.pill.ko { border-color: var(--sfr-red); color: var(--sfr-red); }

.tb-card {
  background: #fff; border-radius: 20px; padding: 24px;
  box-shadow: 0 6px 24px rgba(0,0,0,.06); flex: 1;
  display: flex; flex-direction: column;
}
.tb-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.tb-step { font-weight: 800; color: var(--sfr-red); text-transform: uppercase; letter-spacing: 1px; }
.tb-score { font-weight: 800; }
.tb-question { font-size: 1.35rem; font-weight: 800; line-height: 1.3; margin-bottom: 20px; }

.tb-answers { display: flex; flex-direction: column; gap: 12px; }
.tb-answer {
  display: flex; align-items: center; gap: 14px; text-align: left;
  border: 3px solid var(--sfr-black); border-radius: 16px;
  padding: 16px 18px; font-size: 1.02rem; font-weight: 600; background: #fff;
  transition: all .15s ease;
}
.tb-answer .bullet {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  background: var(--sfr-black); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.tb-answer .good-tag {
  margin-left: auto; font-size: 11px; font-weight: 800; letter-spacing: 1px;
  color: var(--green); border: 2px solid var(--green); border-radius: var(--radius);
  padding: 3px 10px;
}
.tb-answer:active { transform: scale(.99); }
.tb-answer.picked { border-color: var(--sfr-red); background: #fff1f2; }
.tb-answer.picked.is-good { border-color: var(--green); background: #edf9f1; }

.tb-actions { margin-top: auto; padding-top: 22px; display: flex; gap: 12px; }
.btn {
  flex: 1; border-radius: var(--radius); padding: 18px 20px;
  font-size: 1.05rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
}
.btn-primary { background: var(--sfr-red); color: #fff; }
.btn-primary:hover { background: var(--sfr-red-dark); }
.btn-dark { background: var(--sfr-black); color: #fff; }
.btn-ghost { background: #fff; color: var(--sfr-black); border: 2px solid #ddd; flex: 0 0 auto; }
.btn:disabled { opacity: .35; cursor: not-allowed; }

.tb-center { text-align: center; margin: auto 0; }
.tb-center h2 { font-size: 2rem; text-transform: uppercase; margin-bottom: 10px; }
.tb-center p { color: var(--sfr-grey); }
.tb-center .big-score { font-size: 4rem; font-weight: 800; color: var(--sfr-red); margin: 16px 0; }

@media (max-width: 720px) {
  .tb-question { font-size: 1.15rem; }
  .tb-actions { flex-direction: column; }
}
