/* Misskiwize : Devine la chanson — styles.
   Couleurs du logo : vert kiwi, mauve, rose. Aucun coin carré, jamais. */

:root {
  --green: #79c94f;
  --green-dark: #4e9b2e;
  --purple: #8b5cf6;
  --purple-deep: #5b21b6;
  --pink: #ff5da2;
  --pink-dark: #e83e8c;
  --ink: #2b2140;
  --paper: #f7f3ff;
  --card: #ffffff;
  --radius: 24px;
}

* { box-sizing: border-box; }

/* L'attribut hidden gagne toujours, même sur les éléments en flex. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #241047;
}

button, input, select, textarea { font: inherit; }

/* ---------- Boutons et champs ---------- */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  background: var(--purple);
  color: #fff;
  font-weight: 700;
  padding: 0.7em 1.3em;
  border-radius: 999px;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 14px rgba(43, 16, 87, 0.35);
  transition: transform 0.08s ease, filter 0.15s ease;
}
/* Une icône SVG dans un bouton suit la grosseur du texte : sans cette
   règle, un SVG sans attributs de taille s'affiche à sa grandeur par
   défaut (300×150) et c'est LUI qui décide de la hauteur du bouton —
   c'est ce qui faisait du bouton « Suivante » un énorme bloc rond. */
.btn svg { width: 1.4em; height: 1.4em; vertical-align: -0.28em; flex: 0 0 auto; }
/* Les gros boutons de jeu (Suivante, Commencer) : des pilules dont la
   hauteur vient du texte et du rembourrage, jamais de la largeur.
   ≈ 3,1rem de haut, bien appuyables. */
#btn-skip, #btn-skip-show, #btn-start-show {
  font-size: 1.1rem; padding: 0.8em 1.5em;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.97); }
.btn-pink { background: var(--pink); }
.btn-green { background: var(--green-dark); }
.btn-small { padding: 0.45em 1em; font-size: 0.92rem; }
.btn-big { font-size: 1.15rem; padding: 0.85em 1.6em; width: 100%; }
.btn-round {
  width: 3rem; height: 3rem; padding: 0;
  font-size: 1.5rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.file-btn { cursor: pointer; }
.file-btn input { display: none; }

input[type="text"], input[type="search"], input[type="password"], input[type="email"],
input[type="number"], select, textarea {
  border: 2px solid #d9cdf5;
  border-radius: 16px;
  padding: 0.6em 0.9em;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}
textarea { resize: vertical; }

.field { display: flex; flex-direction: column; gap: 0.35em; font-weight: 600; }
.field.grow { flex: 1 1 12rem; }
fieldset.field { border: none; padding: 0; margin: 0; }
fieldset.field legend { font-weight: 600; margin-bottom: 0.35em; }

.row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end; margin: 0.6rem 0; }
.hint { color: #6d6390; font-size: 0.95rem; margin: 0.4rem 0; }
.msg { color: #b00040; font-weight: 600; min-height: 1.2em; margin: 0.4rem 0; }
.msg.ok { color: var(--green-dark); }
.checkline { display: flex; gap: 0.5em; align-items: center; font-weight: 600; margin: 0.4rem 0; }

/* ---------- Verrou ---------- */
#gate {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.2rem;
  background:
    radial-gradient(55vmin 55vmin at 12% 14%, rgba(121, 201, 79, 0.35), rgba(121, 201, 79, 0) 62%),
    radial-gradient(65vmin 65vmin at 88% 88%, rgba(255, 93, 162, 0.32), rgba(255, 93, 162, 0) 62%),
    linear-gradient(160deg, #2b1055 0%, #5b21b6 55%, #1d2b64 100%);
}
.gate-card {
  background: var(--paper);
  border-radius: 36px;
  padding: 2rem 1.8rem;
  max-width: 26rem; width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.gate-logo { width: 10rem; height: 10rem; object-fit: contain; border-radius: 50%; }
.gate-card h1 { font-size: 1.5rem; margin: 0.6rem 0 0.3rem; color: var(--purple-deep); }
.gate-card p { margin: 0.3rem 0 1rem; }
.gate-card form { display: flex; flex-direction: column; gap: 0.9rem; text-align: left; }
.gate-card label { display: flex; flex-direction: column; gap: 0.35em; font-weight: 600; }
.gate-card.shake { animation: shake 0.4s ease; }
.gate-alt { margin-top: 1rem; font-size: 0.95rem; }
.linklike {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--purple-deep); font-weight: 800; text-decoration: underline;
  font-size: inherit;
}
.gate-loading { font-weight: 700; color: var(--purple-deep); font-size: 1.1rem; margin: 1rem 0 0.4rem; }
.gate-privacy { margin-top: 1.1rem; font-size: 0.9rem; }
.gate-privacy a { color: #6d6390; }

/* ---------- Connexion au serveur (note « pas de connexion ») ---------- */
.sync-note {
  max-width: 62rem; margin: 0 auto 1rem;
  background: #fff7e0; border: 2px dashed #c99a00; color: #6d5200;
  border-radius: 999px; padding: 0.55em 1.2em;
  font-weight: 700; text-align: center;
}

/* ---------- Barre « Passer à la suivante » (panneau) ---------- */
.skip-bar { max-width: 62rem; margin: 0 auto 1.2rem; text-align: center; }
.skip-bar .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
}
.skip-bar .btn svg { width: 1.5rem; height: 1.5rem; flex: 0 0 auto; }
.skip-bar .msg { margin-top: 0.5rem; }

/* ---------- Jeux de son (panneau) ---------- */
.sg-picked { font-weight: 800; color: var(--purple-deep); margin: 0.4rem 0; }

/* ---------- Comptes (Réglages) ---------- */
.code-box {
  background: #eef7e4; border: 2px solid var(--green);
  border-radius: 18px; padding: 1rem 1.1rem; margin-top: 1rem;
}
.code-title { font-weight: 700; margin: 0 0 0.3rem; }
.code-text {
  font-size: 1.7rem; font-weight: 800; letter-spacing: 0.14em;
  color: var(--purple-deep); margin: 0.2rem 0 0.6rem;
}
.settings-privacy { max-width: 62rem; margin: 0.4rem auto 0; text-align: center; }
.settings-privacy a { color: #6d6390; font-weight: 600; }

/* Note discrète sur l'écran du jeu quand un son n'a pas pu jouer là
   (par exemple : l'ordinateur n'a pas le fichier de la chanson). */
.show-audionote {
  margin-top: 2vmin;
  font-size: 3vmin; font-weight: 700;
  background: rgba(0, 0, 0, 0.45); color: #ffe9a8;
  border: 2px solid #ffd166;
  border-radius: 999px; padding: 0.3em 1.1em;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* ---------- Vue spectacle ---------- */
.view-show {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(62vmin 62vmin at 12% 16%, rgba(121, 201, 79, 0.38), rgba(121, 201, 79, 0) 62%),
    radial-gradient(74vmin 74vmin at 88% 12%, rgba(255, 93, 162, 0.34), rgba(255, 93, 162, 0) 62%),
    radial-gradient(95vmin 95vmin at 50% 112%, rgba(139, 92, 246, 0.5), rgba(139, 92, 246, 0) 62%),
    linear-gradient(165deg, #2b1055 0%, #5b21b6 48%, #274690 100%);
  color: #fff;
}
/* Deux halos doux qui dérivent lentement, aux couleurs du logo. */
.view-show::before,
.view-show::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(46px); pointer-events: none; z-index: 0;
}
.view-show::before {
  width: 46vmin; height: 46vmin; left: -10vmin; top: -8vmin;
  background: rgba(121, 201, 79, 0.4);
  animation: glow-drift-a 17s ease-in-out infinite alternate;
}
.view-show::after {
  width: 52vmin; height: 52vmin; right: -12vmin; bottom: -14vmin;
  background: rgba(255, 93, 162, 0.36);
  animation: glow-drift-b 21s ease-in-out infinite alternate;
}
@keyframes glow-drift-a {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(9vmin, 6vmin) scale(1.18); }
}
@keyframes glow-drift-b {
  from { transform: translate(0, 0) scale(1.1); }
  to { transform: translate(-8vmin, -7vmin) scale(0.95); }
}
.show-curves {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0;
  fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 0.5;
  animation: curves-drift 26s ease-in-out infinite alternate;
}
@keyframes curves-drift {
  from { transform: translateX(-1.2%) scale(1.04); }
  to { transform: translateX(1.2%) scale(1.04); }
}
.show-inner {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: 1.6vmin 4vmin 2vmin;
  text-align: center;
}
/* Le bloc du jeu se centre dans l'espace libre, entre le haut et les gagnants. */
.show-main {
  flex: 1 1 auto; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.show-logo {
  width: 14.5vmin; height: 14.5vmin; object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.show-title {
  font-size: 5.6vmin; margin: 0.6vmin 0 0;
  color: #fff; letter-spacing: 0.01em;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.45);
}
.show-level {
  font-size: 6.2vmin; font-weight: 800; line-height: 1.05; margin-top: 1vmin;
  color: var(--green);
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.45);
}
.show-clue {
  font-size: 8.8vmin; font-weight: 800; line-height: 1.08;
  color: #ffd7ea;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.45);
}
.show-rules {
  list-style: none; margin: 0.9vmin 0 0; padding: 0;
  font-size: 2.6vmin; color: rgba(255, 255, 255, 0.85);
}
.show-rules li::before { content: "• "; color: var(--pink); font-weight: 800; }

.show-card {
  margin-top: 2vmin;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 4vmin;
  padding: 2.2vmin 4vmin;
  width: min(92%, 60rem);
  backdrop-filter: blur(3px);
  transition: box-shadow 0.7s ease;
}
/* Au moment de la révélation, la carte rayonne : c'est la fête. */
.view-show.revealed .show-card {
  box-shadow: 0 0 55px rgba(121, 201, 79, 0.5), 0 0 130px rgba(255, 93, 162, 0.3);
  border-color: rgba(255, 255, 255, 0.55);
}
.show-idle-text { font-size: 4.5vmin; font-weight: 700; margin: 0; }
.show-idle-notes { font-size: 5vmin; color: var(--green); margin: 1vmin 0 0; letter-spacing: 0.4em; }

.acr-top {
  /* Jamais d'enroulement de la rangée : si l'étiquette et l'écusson
     ne tiennent pas côte à côte, c'est le texte de l'étiquette qui
     passe sur deux lignes (coût borné), jamais l'écusson qui tombe
     sur une deuxième rangée (voir passe v2-2). */
  display: flex; justify-content: center; align-items: center; gap: 1.2rem; flex-wrap: nowrap;
}
.acr-label { flex: 0 1 auto; min-width: 0; font-size: 3.4vmin; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: #ffd7ea; }
.acr-decade {
  flex: 0 0 auto;
  font-size: 3vmin; font-weight: 800;
  background: var(--pink); color: #fff;
  border-radius: 999px; padding: 0.25em 0.9em;
}
.acr-letters {
  margin-top: 1.2vmin;
  font-size: 6.2vmin; font-weight: 800;
  letter-spacing: 0.14em; line-height: 1.26;
  word-break: break-word;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}
.acr-letters .acr-line { display: block; }

.rev-badge {
  display: inline-block;
  font-size: 3.4vmin; font-weight: 800;
  background: var(--green-dark); color: #fff;
  border-radius: 999px; padding: 0.25em 1.1em;
}
.rev-lines { margin-top: 2vmin; font-size: 4.2vmin; font-weight: 600; line-height: 1.45; }
.rev-lines .rev-line { display: block; }
.rev-title { margin-top: 2.2vmin; font-size: 6vmin; font-weight: 800; color: var(--green); }
.rev-artist { font-size: 4vmin; color: #ffd7ea; font-weight: 700; }
.show-card.pop { animation: pop 0.6s ease; }
@keyframes pop {
  0% { transform: scale(0.92); }
  55% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* État révélé : tout se resserre un peu pour que la réponse au complet
   entre dans l'écran (1080p) sans avoir à défiler. */
.view-show.revealed .show-logo { width: 10vmin; height: 10vmin; }
.view-show.revealed .show-title { font-size: 4.6vmin; }
.view-show.revealed .show-level { font-size: 2.9vmin; margin-top: 1vmin; }
.view-show.revealed .show-clue { font-size: 4.2vmin; }
.view-show.revealed .show-rules { display: none; }
.view-show.revealed .show-card { margin-top: 2vmin; padding: 2.4vmin 3.5vmin; }
.view-show.revealed .rev-badge { font-size: 2.8vmin; }
.view-show.revealed .rev-lines { font-size: 3.6vmin; line-height: 1.35; margin-top: 1.4vmin; }
.view-show.revealed .rev-title { font-size: 5vmin; margin-top: 1.6vmin; }
.view-show.revealed .rev-artist { font-size: 3.4vmin; }

.show-audioreveal {
  margin-top: 3vmin;
  font-size: 4.6vmin; font-weight: 800;
  background: var(--pink); color: #fff;
  border-radius: 999px; padding: 0.4em 1.2em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.show-winners {
  padding-top: 2.5vmin;
  font-size: 3.6vmin; font-weight: 700; color: #fff;
}
.show-winners .win-label { color: var(--green); }

/* Moment gagnant (vue spectacle) : les noms en grand, joyeux, pour
   quelques secondes quand le panneau annonce de nouveaux gagnants.
   En flux normal sous les gagnants habituels ; la carte de test de
   son est volontairement neutre — aucun titre, aucune réponse. */
.show-celebrate {
  margin-top: 3vmin;
  text-align: center;
  animation: pop 0.45s ease;
}
.show-celebrate-label {
  font-size: 3vmin; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--green);
}
.show-celebrate-names {
  font-size: 8vmin; font-weight: 800; line-height: 1.15; color: #fff;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.45);
}
.show-celebrate-sub { font-size: 3.4vmin; font-weight: 700; color: var(--pink, #ff5da2); }
.show-testcard {
  margin-top: 3vmin;
  text-align: center;
  font-size: 3vmin; font-weight: 600; color: #fff;
  opacity: 0.85;
}

/* La liste de ce soir : une chanson faite se calme visuellement. */
.nl-done { opacity: 0.55; }
.nl-done .deck-title { text-decoration: line-through; }

/* Le résumé de la soirée : une carte propre, faite pour la capture
   d'écran — fond uni, rien que la soirée. */
.recap-body {
  margin-top: 0.8rem;
  border: 2px solid var(--green);
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  background: linear-gradient(160deg, rgba(121, 201, 79, 0.12), rgba(139, 92, 246, 0.10));
}
.recap-head { text-align: center; margin-bottom: 0.7rem; }
.recap-brand { font-size: 1.5rem; font-weight: 800; }
.recap-sub { opacity: 0.8; font-size: 0.95rem; }
.recap-h { margin: 0.8rem 0 0.35rem; font-size: 1.05rem; }
.recap-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.28rem 0; border-bottom: 1px dashed rgba(127, 127, 127, 0.35);
}
.recap-row:last-child { border-bottom: none; }
.recap-row em { font-style: normal; opacity: 0.75; text-align: right; }

/* Barre d'activation du son (vue spectacle) : un onglet que personne n'a
   touché garde son audio en pause (règle des navigateurs). Plutôt qu'un
   écran muet sans explication, une petite barre bien visible en bas de
   l'écran invite à toucher une fois ; elle disparaît dès que le son
   marche et revient si un son arrive pendant que l'audio est en pause.
   En flux normal (jamais par-dessus le jeu ni le classement). */
.show-soundbar {
  flex: 0 0 auto;
  margin-top: 1.1vmin;
  display: inline-flex; align-items: center; gap: 0.9vmin;
  max-width: 88%;
  font-family: inherit; font-size: 2.4vmin; font-weight: 700; color: #fff;
  background: var(--pink);
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  padding: 0.75vmin 2.4vmin;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: soundbar-pulse 1.6s ease-in-out infinite;
}
.show-soundbar svg { width: 3vmin; height: 3vmin; flex: 0 0 auto; }
.show-soundbar:hover, .show-soundbar:focus-visible { background: var(--purple); outline: none; }
@keyframes soundbar-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}
/* Quand le classement occupe l'écran, on serre un peu la barre pour que
   les 10 rangs et la barre entrent toujours dans le cadre 1080p. */
#show-ranking:not([hidden]) ~ .show-soundbar {
  margin-top: 0.7vmin; padding: 0.55vmin 2.2vmin; font-size: 2.1vmin;
}

#confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.confetti-piece {
  position: absolute; top: -4vh;
  border-radius: 40%;
  animation-name: confetti-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(112vh) rotate(640deg); opacity: 0.9; }
}

.show-corner {
  position: absolute; right: 1rem; bottom: 0.8rem; z-index: 3;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem; text-decoration: none;
  padding: 0.4em 0.9em; border-radius: 999px;
}
.show-corner:hover { color: #fff; background: rgba(255, 255, 255, 0.15); }

/* ---------- Panneaux (animatrice + réglages) ---------- */
.view-panel {
  min-height: 100dvh;
  background: linear-gradient(170deg, #efe9ff 0%, #fdeef7 100%);
  padding: 0 1rem 3rem;
}
.bar {
  max-width: 62rem; margin: 0 auto;
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  padding: 1rem 0 0.4rem;
}
.bar-logo { width: 3.4rem; height: 3.4rem; object-fit: contain; border-radius: 50%; }
.bar-title { font-size: 1.45rem; font-weight: 800; color: var(--purple-deep); flex: 1 1 auto; }
.bar-nav { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.panel-note { max-width: 62rem; margin: 0.3rem auto 1rem; color: #6d6390; }

.card {
  max-width: 62rem; margin: 0 auto 1.2rem;
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem 1.5rem;
  box-shadow: 0 10px 30px rgba(91, 33, 182, 0.12);
}
.card h2 { margin: 0 0 0.5rem; color: var(--purple-deep); font-size: 1.3rem; }

.level-input { width: 6rem !important; text-align: center; font-size: 1.3rem; font-weight: 800; }

/* La liste coule dans la page (aucune boîte à défilement interne) :
   rien n'est coupé, et le contour vert de la chanson choisie reste
   toujours à l'intérieur, avec la petite marge prévue pour lui. */
.deck-list { display: flex; flex-direction: column; gap: 0.55rem; margin: 0.8rem 0; padding: 0.35rem; }
.deck-item {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  background: var(--paper); border-radius: 18px; padding: 0.65rem 0.9rem;
}
.deck-item.active { outline: 3px solid var(--green); background: #eef7e4; }
.deck-item.played { opacity: 0.68; }
.played-badge { color: #8a6d00; font-weight: 700; font-size: 0.85rem; }
.btn:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
.btn:disabled:hover { filter: none; }
.btn:disabled:active { transform: none; }
.btn-armed { background: #8f1030 !important; outline: 3px solid #ffd166; }
.deck-info { flex: 1 1 14rem; }
.deck-title { font-weight: 800; }
.deck-meta { color: #6d6390; font-size: 0.9rem; }
.audio-dot { color: var(--green-dark); font-weight: 700; font-size: 0.85rem; }
.current-line { font-weight: 700; color: var(--purple-deep); }

.clue-picker { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 0.6rem 0; border: none; padding: 0; }
.clue-pill {
  display: inline-flex; align-items: center; gap: 0.4em;
  background: var(--paper); border: 2px solid #d9cdf5;
  border-radius: 999px; padding: 0.45em 1em; cursor: pointer; font-weight: 700;
}
.clue-pill:has(input:checked) { background: var(--purple); border-color: var(--purple); color: #fff; }
.clue-pill input { accent-color: var(--pink); }
.lang-field .clue-pill { margin-right: 0.4rem; }

.winners-row .field { flex: 1 1 11rem; min-width: 10rem; }
.field-label { white-space: nowrap; }
label { overflow-wrap: break-word; hyphens: none; }

.set-list { display: flex; flex-direction: column; gap: 0.55rem; }
.set-item {
  display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
  background: var(--paper); border-radius: 18px; padding: 0.6rem 0.9rem;
}
.set-item .deck-info { flex: 1 1 12rem; }
.btn-danger { background: #c21847; }

/* ---------- Interrupteurs (Réglages) ---------- */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 2px solid #efe9ff;
}
.toggle-label { font-weight: 600; flex: 1 1 auto; }
.switch { position: relative; display: inline-block; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  display: block; width: 3.6rem; height: 2rem;
  background: #cfc4ea; border-radius: 999px;
  transition: background 0.18s ease;
  position: relative;
}
.switch .track::after {
  content: ""; position: absolute; top: 0.25rem; left: 0.25rem;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(43, 16, 87, 0.35);
  transition: left 0.18s ease;
}
.switch input:checked + .track { background: var(--green-dark); }
.switch input:checked + .track::after { left: 1.85rem; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.35); }
.subhead { color: var(--purple-deep); margin: 1.1rem 0 0.3rem; font-size: 1.05rem; }

/* ---------- Minuteur (vue spectacle) ---------- */
.show-timer {
  margin-top: 1.4vmin;
  font-size: 5vmin; font-weight: 800;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #fff; border-radius: 999px; padding: 0.15em 0.9em;
}
.show-timer.done { background: var(--pink); border-color: var(--pink); }

/* ---------- Grosseur du texte (vue spectacle) ---------- */
#view-show.text-grand .show-title { font-size: 7.8vmin; }
#view-show.text-grand .show-level { font-size: 7vmin; }
#view-show.text-grand .show-clue { font-size: 10vmin; }
#view-show.text-grand .show-rules { font-size: 3.3vmin; }
#view-show.text-grand .show-idle-text { font-size: 5.6vmin; }
#view-show.text-grand .show-idle-notes { font-size: 6.3vmin; }
#view-show.text-grand .acr-label { font-size: 4.3vmin; }
#view-show.text-grand .acr-decade { font-size: 3.8vmin; }
#view-show.text-grand .acr-letters { font-size: 8.5vmin; }
#view-show.text-grand .rev-badge { font-size: 4.3vmin; }
#view-show.text-grand .rev-lines { font-size: 5.3vmin; }
#view-show.text-grand .rev-title { font-size: 7.5vmin; }
#view-show.text-grand .rev-artist { font-size: 5vmin; }
#view-show.text-grand .show-audioreveal { font-size: 5.8vmin; }
#view-show.text-grand .show-winners { font-size: 4.5vmin; }
#view-show.text-grand .show-timer { font-size: 6.3vmin; }

#view-show.text-tres .show-title { font-size: 9.3vmin; }
#view-show.text-tres .show-level { font-size: 7.5vmin; }
#view-show.text-tres .show-clue { font-size: 11.5vmin; }
#view-show.text-tres .show-rules { font-size: 3.9vmin; }
#view-show.text-tres .show-idle-text { font-size: 6.8vmin; }
#view-show.text-tres .show-idle-notes { font-size: 7.5vmin; }
#view-show.text-tres .acr-label { font-size: 5.1vmin; }
#view-show.text-tres .acr-decade { font-size: 4.5vmin; }
#view-show.text-tres .acr-letters { font-size: 10.2vmin; }
#view-show.text-tres .rev-badge { font-size: 5.1vmin; }
#view-show.text-tres .rev-lines { font-size: 6.3vmin; }
#view-show.text-tres .rev-title { font-size: 9vmin; }
#view-show.text-tres .rev-artist { font-size: 6vmin; }
#view-show.text-tres .show-audioreveal { font-size: 6.9vmin; }
#view-show.text-tres .show-winners { font-size: 5.4vmin; }
#view-show.text-tres .show-timer { font-size: 7.5vmin; }

/* Révélé + gros texte : on garde des grandeurs qui entrent dans l'écran. */
#view-show.text-grand.revealed .show-logo { width: 12vmin; height: 12vmin; }
#view-show.text-grand.revealed .rev-lines { font-size: 4.4vmin; }
#view-show.text-grand.revealed .rev-title { font-size: 6vmin; }
#view-show.text-tres.revealed .show-logo { width: 13vmin; height: 13vmin; }
#view-show.text-tres.revealed .rev-lines { font-size: 5vmin; }
#view-show.text-tres.revealed .rev-title { font-size: 6.8vmin; }

/* ---------- Tenue dans l'écran (passe 3) ----------
   L'écran du jeu au complet — en-tête, carte du sigle (3 lignes) et
   barre de son — doit entrer dans 100vh sans défiler, aux trois
   grosseurs de texte. Les grandeurs sont budgétées en vmin : à 16:9,
   100vmin = 100vh, donc un total ≤ ~97vmin laisse une marge réelle.
   En Grand et Très grand, l'état sigle (non révélé) se resserre :
   c'est le sigle qui doit rester grand, pas tout le reste. */
#view-show.text-grand:not(.revealed) .show-logo { width: 13.5vmin; height: 13.5vmin; }
#view-show.text-grand:not(.revealed) .show-title { font-size: 7.2vmin; }
#view-show.text-grand:not(.revealed) .show-level { font-size: 6vmin; }
#view-show.text-grand:not(.revealed) .show-clue { font-size: 8.6vmin; }
#view-show.text-grand:not(.revealed) .show-rules { font-size: 2.9vmin; }
#view-show.text-grand:not(.revealed) .show-card { padding: 1.8vmin 4vmin; }
#view-show.text-grand:not(.revealed) .acr-label { font-size: 4vmin; }
#view-show.text-grand:not(.revealed) .acr-decade { font-size: 3.4vmin; }
#view-show.text-grand:not(.revealed) .acr-letters { font-size: 6.2vmin; line-height: 1.25; }

#view-show.text-tres:not(.revealed) .show-logo { width: 13.5vmin; height: 13.5vmin; }
#view-show.text-tres:not(.revealed) .show-title { font-size: 7.2vmin; }
#view-show.text-tres:not(.revealed) .show-level { font-size: 6.2vmin; }
#view-show.text-tres:not(.revealed) .show-clue { font-size: 8.8vmin; }
#view-show.text-tres:not(.revealed) .show-rules { font-size: 3vmin; }
#view-show.text-tres:not(.revealed) .show-card { padding: 1.8vmin 4vmin; }
#view-show.text-tres:not(.revealed) .acr-label { font-size: 4.4vmin; }
#view-show.text-tres:not(.revealed) .acr-decade { font-size: 3.4vmin; }
#view-show.text-tres:not(.revealed) .acr-letters { font-size: 6.1vmin; line-height: 1.24; }

/* Une chanson ajoutée à la main peut avoir 4 lignes de paroles
   (le jeu de départ en a 2 ou 3) : le sigle rapetisse un peu pour
   que la 4e ligne entre elle aussi dans l'écran. */
.acr-letters.lines-4 { font-size: 5vmin; line-height: 1.2; }
#view-show.text-grand .acr-letters.lines-4 { font-size: 4.8vmin; }
#view-show.text-tres .acr-letters.lines-4 { font-size: 4.6vmin; }

/* Pendant qu'un extrait joue (minuteur visible), les deux lignes de
   règles — du texte fixe, pas du jeu — se cachent pour laisser toute
   la place au sigle et au minuteur, comme dans l'état révélé. */
.view-show.timing .show-rules { display: none; }
#view-show.text-grand .show-timer { font-size: 5.6vmin; }
#view-show.text-tres .show-timer { font-size: 5.6vmin; }
/* Pendant un extrait minuté, le sigle rapetisse un peu aussi : avec le
   minuteur en plus, la pile complète doit rester dans l'écran. */
#view-show.timing .acr-letters { font-size: 5.2vmin; }
#view-show.text-grand.timing .acr-letters { font-size: 5vmin; }
#view-show.text-tres.timing .acr-letters { font-size: 5vmin; }

/* ---------- Tenue dans l'écran (passe v2-2) ----------
   Trois états débordaient encore après la passe v2-1 (audit en vrai
   navigateur, 1919×998, bouton « Suivante » coupé en bas) : le sigle
   traduit, l'extrait minuté à Très grand, et l'écran libre à Très
   grand. Correctifs ciblés ci-dessous ; budgets recomptés au complet
   dans BUILD-LOG.md (« Fix pass v2-2 »). */

/* 1. Sigle traduit : l'étiquette de direction (« Paroles traduites
   en anglais ») est bien plus longue que « Paroles en sigle ». En
   majuscules dans la carte, elle poussait l'écusson des années sur
   une deuxième rangée (+≈6vmin) et l'écran débordait. Elle rapetisse
   un peu, son espacement se resserre, et l'écusson rapetisse un peu
   en Grand / Très grand : les deux tiennent sur la même rangée. */
.view-show.translated .acr-label { font-size: 2.7vmin; letter-spacing: 0.05em; }
#view-show.text-grand.translated .acr-label { font-size: 2.8vmin; letter-spacing: 0.05em; }
#view-show.text-tres.translated .acr-label { font-size: 2.8vmin; letter-spacing: 0.05em; }
#view-show.text-grand.translated .acr-decade { font-size: 3.1vmin; }
#view-show.text-tres.translated .acr-decade { font-size: 3.1vmin; }

/* 2. Extrait minuté : le minuteur reçoit une hauteur de ligne fixe
   (sa hauteur ne dépend plus de l'héritage) et rapetisse un peu, sa
   marge aussi, et la carte perd un peu de rembourrage vertical.
   Les règles restent cachées pendant ce temps (.timing plus haut),
   et l'état dans l'indice (audioNow : le nom du mode, ou « Je
   prépare les miaous… ») tient sur une ligne, comme l'indice
   ordinaire — aucun coût de plus. */
#view-show.timing .show-timer { font-size: 4.6vmin; line-height: 1.1; margin-top: 1vmin; }
#view-show.text-grand.timing .show-timer { font-size: 5vmin; }
#view-show.text-tres.timing .show-timer { font-size: 5vmin; }
#view-show.timing .show-card { padding-top: 1.8vmin; padding-bottom: 1.8vmin; }
#view-show.text-grand.timing .show-card { padding-top: 1.5vmin; padding-bottom: 1.5vmin; }
#view-show.text-tres.timing .show-card { padding-top: 1.5vmin; padding-bottom: 1.5vmin; }
/* Chanson à 4 lignes pendant un extrait minuté : le sigle rapetisse
   assez pour que la 4e ligne entre elle aussi. */
#view-show.timing .acr-letters.lines-4 { font-size: 4.4vmin; line-height: 1.2; }

/* 3. Écran libre : en Grand et Très grand, le texte d'attente et les
   notes de musique rapetissent — à Très grand, « La partie commence
   bientôt ! » passait sur deux lignes dans la carte (+≈8vmin) et
   tout débordait. */
#view-show.text-grand:not(.revealed) .show-idle-text { font-size: 5.2vmin; }
#view-show.text-grand:not(.revealed) .show-idle-notes { font-size: 5.8vmin; }
#view-show.text-tres:not(.revealed) .show-idle-text { font-size: 5.4vmin; }
#view-show.text-tres:not(.revealed) .show-idle-notes { font-size: 6vmin; }

/* ---------- Pad de sons (panneau) ---------- */
.sfx-row .btn { flex: 1 1 11rem; }
.sfx-btn { font-size: 1.02rem; }

/* ---------- Classement à l'aveugle (vue spectacle) ---------- */
/* La liste EST l'écran : les 10 rangs entrent au complet dans le cadre
   (1080p) sans défiler, avec la chanson à classer en haut. Aucun espace
   n'est laissé pour un encadré par-dessus la liste. */
#show-ranking {
  width: min(96%, 110rem);
  margin: 0 auto;
  flex: 1 1 auto;
  display: flex; flex-direction: column; justify-content: center;
}
.rank-show-title {
  font-size: 4.8vmin; font-weight: 800; margin: 0 0 1vmin;
  color: #fff; text-shadow: 0 4px 22px rgba(0, 0, 0, 0.45);
}
.rank-show-current {
  font-size: 3.9vmin; font-weight: 800; color: var(--green);
  margin-bottom: 1.2vmin; text-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}
.rank-show-current .rank-cur-label { color: #ffd7ea; }
.rank-show-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.5vmin;
  text-align: left;
}
.rank-show-list li {
  display: flex; align-items: center; gap: 1.8vmin;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0.36vmin 2.6vmin;
  font-size: 3.5vmin; font-weight: 700; color: #fff;
}
.rank-show-list li.filled { background: rgba(255, 255, 255, 0.17); border-color: rgba(255, 255, 255, 0.45); }
.rank-show-list li.empty { opacity: 0.5; }
.rank-show-num {
  flex: 0 0 auto;
  width: 4.8vmin; height: 4.8vmin; border-radius: 50%;
  background: var(--purple); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 3vmin;
}
.rank-show-list li.filled .rank-show-num { background: var(--pink); }
/* Jamais de titre coupé avec des points de suspension : le texte
   passe sur deux lignes au besoin, et les très longs titres
   rapetissent un peu (classe .long posée par app.js). */
.rank-show-entry { flex: 1 1 auto; line-height: 1.15; overflow-wrap: break-word; }
.rank-show-entry.long { font-size: 0.84em; }

#view-show.text-grand .rank-show-title { font-size: 5.6vmin; }
#view-show.text-grand .rank-show-current { font-size: 4.5vmin; }
#view-show.text-grand .rank-show-list li { font-size: 3.9vmin; padding: 0.32vmin 2.6vmin; }
#view-show.text-grand .rank-show-num { width: 4.8vmin; height: 4.8vmin; font-size: 3.3vmin; }
#view-show.text-tres .rank-show-title { font-size: 5.2vmin; }
#view-show.text-tres .rank-show-current { font-size: 4vmin; }
#view-show.text-tres .rank-show-list li { font-size: 3.7vmin; padding: 0.28vmin 2.6vmin; }
#view-show.text-tres .rank-show-num { width: 4.6vmin; height: 4.6vmin; font-size: 3.3vmin; }

/* ---------- Classement à l'aveugle (panneau) ---------- */
.rank-grid { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.7rem 0; }
.rank-slot {
  display: flex; align-items: center; gap: 0.8rem;
  width: 100%; text-align: left;
  background: var(--paper); color: var(--ink);
  border: 2px solid #d9cdf5; box-shadow: none;
  padding: 0.55em 1em;
}
.rank-slot:hover { filter: none; border-color: var(--purple); }
.rank-slot .rank-num {
  flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--purple); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
}
.rank-slot.filled { background: #eef7e4; border-color: var(--green); }
.rank-slot.filled .rank-num { background: var(--green-dark); }
.rank-slot .rank-entry { font-weight: 700; }
.rank-slot .rank-free { color: #6d6390; font-weight: 600; }
.rank-slot.btn-armed { color: #fff; }
.rank-slot.btn-armed .rank-num { background: #ffd166; color: #8f1030; }
.rank-slot.btn-armed .rank-entry { color: #fff; }

/* ---------- Petit écran (téléphone, ~400 px) ---------- */
@media (max-width: 560px) {
  .view-panel { padding: 0 0.6rem 2.5rem; }
  .card { padding: 1.05rem 0.95rem 1.2rem; border-radius: 20px; }
  .card h2 { font-size: 1.18rem; }
  .bar { gap: 0.6rem; }
  .bar-title { font-size: 1.2rem; }
  .bar-logo { width: 2.8rem; height: 2.8rem; }
  .bar-nav .btn { flex: 1 1 auto; }
  .deck-item { padding: 0.6rem 0.7rem; gap: 0.6rem; }
  .deck-item .btn { flex: 1 1 auto; }
  .set-item { padding: 0.55rem 0.7rem; gap: 0.55rem; }
  .row { gap: 0.6rem; }
  .winners-row .field { flex: 1 1 100%; min-width: 0; }
  .level-input { width: 4.6rem !important; }
  .gate-card { padding: 1.5rem 1.1rem; border-radius: 28px; }
  .gate-logo { width: 8rem; height: 8rem; }
}

/* ---------- Mouvement réduit (si l'appareil le demande) ---------- */
@media (prefers-reduced-motion: reduce) {
  .show-logo, .show-curves, .view-show::before, .view-show::after { animation: none; }
  .show-card.pop { animation: none; }
  .show-soundbar { animation: none; }
  .btn { transition: none; }
}

/* ---------- Timbre « Made by Misskiwize » (bas des Réglages) ---------- */
.stamp {
  max-width: 62rem; margin: 1.8rem auto 0;
  text-align: center;
}
.stamp-img {
  width: 140px; max-width: 60vw; height: auto;
  border-radius: 50%;
  transform: rotate(-2deg);
  box-shadow: 0 8px 18px rgba(91, 33, 182, 0.3);
}

/* Boutons de jeu sur l'écran du spectacle (Commencer / Suivante) */
.show-next-btn { align-self: center; width: min(92%, 30rem); margin-top: 0.9rem; }
/* Quand le classement occupe l'écran, la Suivante se fait plus mince
   (mais reste une vraie pilule appuyable) pour que les 10 rangs, la
   barre de son et le bouton entrent ensemble dans le cadre. */
#show-ranking:not([hidden]) ~ #btn-skip-show {
  font-size: 1rem; padding: 0.5em 1.4em; margin-top: 0.6rem;
}
.show-next-btn[hidden], #btn-start-show[hidden] { display: none !important; }
#btn-start-show { margin-top: 1.2rem; }

/* Message personnalisé de l'animatrice + ligne des abonnés (réglages) */
.show-notice {
  margin: 1.4vmin auto 0; max-width: 92%;
  background: var(--pink); color: #fff;
  font-size: 3.6vmin; font-weight: 700; line-height: 1.2;
  padding: 0.9vmin 2.8vmin; border-radius: 999px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.show-notice[hidden], #show-subs-rule[hidden] { display: none !important; }

/* Formats de capture TikTok Live Studio : l'écran du jeu remplit la
   fenêtre au complet, en large (ordinateur, 16:9) comme en hauteur
   (téléphone, 9:16), et l'important reste au centre, là où les boutons
   et le clavardage de TikTok ne couvrent pas l'image. */
@media (max-aspect-ratio: 1/1) {
  #view-show .show-logo { width: 21vmin; height: 21vmin; }
  #view-show .show-title { font-size: 6.6vmin; }
  #view-show .show-level { font-size: 6.8vmin; }
  #view-show .show-clue { font-size: 9.8vmin; }
}
@media (min-aspect-ratio: 19/9) {
  #view-show .show-inner { max-width: 125vh; margin-inline: auto; }
}
