/* Style « Cinéma de quartier » : rideau de velours, cadre doré, billets. Surcharge style.css (retirer le lien dans index.html pour revenir en arrière).
   Idée : la question est une affiche dans un cadre doré, le chrono un ruban lumineux. */
:root {
  --bg: #1c0710;
  --surface: #2e0d1b;
  --surface-2: #431627;
  --border: #7a5a2c;
  --border-input: #c29a48;
  --edge: #0c0306;
  --edge-2: #0c0306;
  --text: #fbeed0;
  --text-2: #e6d3a8;
  --muted: #c4aa7e;
  --accent: #ffb627;
  --accent-edge: #8a5d0c;
  --on-accent: #2a0a14;
  --yellow: #ffd36e;
  --yellow-edge: #9a7424;
  --purple: #d9a3c8;
  --blue: #8fd3ff;
  --silver: #d9d2c4;
  --silver-edge: #7d7466;
  --dirt: #c98a5b;
  --dirt-edge: #6e4526;
  --link: #ffd36e;
  --good: #7fe0a0;
  --bad: #ff8a8a;
  --bad-edge: #8e3a3a;
  --on-soft: #2a0a14;
  --cream: #fbeed0;
  --paper: #fbeed0; /* the comic bubble (name error) and selected text stay light */
  --danger: #ff7a7a;
  --radius-xl: 16px;
  --radius-lg: 12px;
}
/* Plis du rideau + ombre de lambrequin en haut. */
body {
  background:
    linear-gradient(var(--edge), transparent 140px),
    repeating-linear-gradient(90deg, #26091a 0 36px, #3a0f24 64px, #26091a 92px);
  background-attachment: fixed;
}
.topbar { background: var(--edge); border-bottom: 3px solid var(--accent); }
.logo { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 55%, transparent), 0 4px 0 var(--accent-edge); }
h1 { text-shadow: 0 0 22px color-mix(in srgb, var(--accent) 45%, transparent), 0 4px 0 var(--edge); }
.card, dialog { border: 2px dashed var(--border-input); box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border); }
button.outline { background: var(--surface-2); }

/* La question : un cadre simple à coins arrondis, filet doré. */
.question { border: 2px solid var(--border-input); border-radius: var(--radius-xl); padding: 44px 24px 40px; background: var(--surface); box-shadow: 0 0 0 3px var(--edge), 0 0 34px color-mix(in srgb, var(--accent) 10%, transparent); }
.badge { top: 0; background: var(--accent); color: var(--on-accent); box-shadow: none; }
.reveal { bottom: 0; }

/* Chrono : un filet de lumière de projecteur qui se retire, avec un éclat à son extrémité. */
.clock { height: 10px; border-radius: 999px; overflow: hidden; background: var(--edge); border: 1px solid var(--border); box-shadow: inset 0 1px 3px #000; }
.clock i { display: block; height: 100%; border-radius: inherit; /* drains by scaleX from style.css: no layout work every tick */
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 65%, black), var(--c) 70%, color-mix(in srgb, var(--c) 60%, white)); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 65%, transparent); }
.timer { background: var(--edge); border: 2px solid var(--border-input); }
.feedback.good { rotate: -3deg; box-shadow: 0 0 16px color-mix(in srgb, var(--good) 50%, transparent), 0 4px 0 var(--edge); }

@media (prefers-reduced-motion: no-preference) {
  /* Scintillement de la marquise du logo. */
  .logo { animation: flicker 5s infinite; }
  @keyframes flicker { 0%, 92%, 96%, 100% { opacity: 1; } 94% { opacity: 0.65; } 98% { opacity: 0.8; } }
}

/* Rideau de changement d'écran : mêmes velours et plis que le fond, deux pans qui se ferment (360 ms) puis s'ouvrent (app.js, curtainSwap). */
.curtain { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.curtain i { position: absolute; top: 0; bottom: 0; width: 51%; transition: translate 480ms cubic-bezier(0.3, 0, 0.2, 1);
  background: linear-gradient(var(--edge), transparent 140px), repeating-linear-gradient(90deg, #26091a 0 36px, #3a0f24 64px, #26091a 92px); }
.curtain i:first-child { left: 0; translate: -101% 0; box-shadow: inset -26px 0 30px -18px rgb(0 0 0 / 0.55); }
.curtain i:last-child { right: 0; translate: 101% 0; box-shadow: inset 26px 0 30px -18px rgb(0 0 0 / 0.55); }
.curtain.closed i { translate: 0 0; transition-duration: 340ms; transition-timing-function: ease-in; }

/* Liste des joueurs : panneau simple (bordure grise, ombre dure), lignes séparées par une perforation, barre de score et réponse sous le pseudo. */
.side .list { gap: 0; }
.side .list li { background: none; border-radius: 0; border-bottom: 1px dashed color-mix(in srgb, var(--accent) 25%, transparent); }
.side .list li:last-child { border-bottom: 0; }
/* Pas de fond ni de liseré de couleur sur la ligne : l'état se lit sur l'avatar, le pseudo, la coche et la réponse. */
.side .list li.is-found, .side .list li.is-wrong { background: none; box-shadow: none; }
.side .list .avatar { box-shadow: none; }
.side .list li.is-found .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--good); }
.side .list li.is-wrong .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--bad); }
.side .list .name { font: 800 0.95rem/1.2 var(--font-title); }
.side .list .score { color: var(--text); font: 700 0.8rem var(--font-mono); }
.side .list .gain { color: var(--accent); font-weight: 800; }
@media (min-width: 1180px) {
  .game-layout { grid-template-columns: minmax(0, 1fr) clamp(560px, var(--vw) - 640px, 900px) minmax(360px, 1fr); }
  .side-col { width: 312px; margin-left: 32px; }
  .side { padding: 16px 20px; }
  .side .list .avatar { width: 36px; height: 36px; }
  .side .list li { grid-template-columns: 36px minmax(0, 1fr) auto; }
}
@media (min-width: 1180px) {
  .side { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 6px 0 var(--edge); }
  .side h2 { display: block; margin-bottom: 10px; font: 800 1.1rem/1.2 var(--font-title); letter-spacing: 0; text-align: left; color: var(--text); }
}
/* Téléphone : la liste en bandeau devient une rangée de cartes (même grille que sur grand écran). */
@media (max-width: 1179px) {
  .side .list li { border: 1px solid var(--border); border-radius: 14px; background: var(--edge); }
  .side .list li.is-found { border-color: var(--good); background: var(--edge); }
  .side .list li.is-wrong { border-color: var(--bad); background: var(--edge); box-shadow: none; }
}
