@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --nuit: #170f38;
  --nuit-2: #201553;
  --carte: #2a1c63;
  --carte-2: #34237a;
  --bord: rgba(255, 255, 255, .10);

  --sable: #ffc93c;
  --orange: #ff8a3d;
  --corail: #ff5e7a;
  --menthe: #35e3b0;
  --cyan: #45d0ff;
  --violet: #a46bff;

  --blanc: #fdfbff;
  --doux: #b9aee6;

  --titre: 'Fredoka', system-ui, sans-serif;
  --texte: 'Nunito', system-ui, sans-serif;

  --r: 22px;
  --r-l: 30px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--nuit);
  background-image:
    radial-gradient(760px 520px at 8% -8%, rgba(164, 107, 255, .40), transparent 65%),
    radial-gradient(680px 460px at 98% 4%, rgba(255, 94, 122, .28), transparent 62%),
    radial-gradient(620px 520px at 55% 108%, rgba(69, 208, 255, .22), transparent 65%);
  background-attachment: fixed;
  color: var(--blanc);
  font-family: var(--texte);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: var(--titre);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 .35em;
  line-height: 1.1;
}

h1 { font-size: clamp(32px, 5.2vw, 56px); }
h2 { font-size: 26px; }

a { color: var(--sable); text-decoration: none; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 22px 18px 60px; }

/* ------------------------------------------------------------- barre haut */

.bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--titre);
  font-weight: 600;
  font-size: 24px;
  color: var(--blanc);
}

.logo img { width: 38px; height: 38px; }

.grow { flex: 1; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--titre);
  font-size: 14px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  color: var(--blanc);
  white-space: nowrap;
}

.chip.code { background: var(--sable); color: #3d2600; letter-spacing: .16em; font-weight: 600; }
.chip.round { background: var(--violet); }
.chip.live { background: var(--corail); }
.chip.privee { background: rgba(255, 255, 255, .09); color: var(--doux); }

/* ---------------------------------------------------------------- cartes */

.card {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--r-l);
  padding: 22px;
  box-shadow: 0 18px 40px rgba(10, 4, 32, .35);
}

.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: .3em; }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.colonnes { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }

@media (max-width: 900px) {
  .duo, .colonnes { grid-template-columns: 1fr; }
}

.sous { color: var(--doux); font-size: 15px; }
.petit { font-size: 13px; }
.centre { text-align: center; }
.hidden { display: none !important; }

/* ------------------------------------------------------------ formulaires */

label {
  display: block;
  font-family: var(--titre);
  font-size: 14px;
  color: var(--doux);
  margin: 14px 0 6px;
}

input[type=text], input[type=number], input[type=password], select, textarea {
  width: 100%;
  background: rgba(0, 0, 0, .25);
  border: 2px solid transparent;
  color: var(--blanc);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: var(--texte);
  font-weight: 700;
  font-size: 15px;
}

textarea { min-height: 150px; resize: vertical; font-weight: 600; }

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sable); }

.ligne { display: flex; gap: 12px; flex-wrap: wrap; }
.ligne > * { flex: 1; min-width: 110px; }

.coche {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 14px;
  color: var(--blanc);
}

.coche input { width: 20px; height: 20px; accent-color: var(--menthe); }

/* -------------------------------------------------------------- boutons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  background: rgba(255, 255, 255, .12);
  color: var(--blanc);
  font-family: var(--titre);
  font-weight: 600;
  font-size: 16px;
  padding: 13px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .1s ease, filter .15s ease;
}

.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .35; cursor: not-allowed; }

.btn.jaune { background: var(--sable); color: #3d2600; }
.btn.menthe { background: var(--menthe); color: #04361f; }
.btn.corail { background: var(--corail); color: #4a0512; }
.btn.cyan { background: var(--cyan); color: #04283b; }
.btn.violet { background: var(--violet); color: #fff; }
.btn.twitch { background: #9146ff; color: #fff; }
.btn.xl { font-size: 20px; padding: 17px 32px; }

.btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------------------------------------------------------------- scène */

.scene { display: grid; grid-template-columns: 1fr 96px; gap: 18px; }

.motbox {
  background: linear-gradient(150deg, var(--carte-2), var(--carte));
  border: 1px solid var(--bord);
  border-radius: var(--r-l);
  padding: 30px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 18px 40px rgba(10, 4, 32, .35);
}

.mot {
  font-family: var(--titre);
  font-weight: 600;
  font-size: clamp(36px, 7vw, 88px);
  line-height: 1;
  overflow-wrap: anywhere;
  background: linear-gradient(92deg, var(--sable), var(--corail) 60%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mot.cache {
  background: none;
  color: var(--doux);
  letter-spacing: .1em;
  font-size: clamp(30px, 4.6vw, 58px);
}

.categorie {
  font-family: var(--titre);
  font-size: 14px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .1em;
}

/* Sablier vertical */

.sablier {
  border-radius: var(--r-l);
  background: rgba(0, 0, 0, .3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}

.sablier .sable {
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, var(--orange), var(--sable));
  transition: height .3s linear;
  border-radius: 18px 18px 0 0;
}

.sablier.chaud .sable { background: linear-gradient(to top, #d81f3d, var(--corail)); }

.chrono {
  font-family: var(--titre);
  font-weight: 600;
  font-size: 46px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.chrono.chaud { color: var(--corail); }

/* --------------------------------------------------------------- listes */

.liste { display: flex; flex-direction: column; gap: 8px; }

.item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, .06);
  border-radius: 16px;
  font-size: 15px;
}

.item.actif { background: linear-gradient(90deg, rgba(255, 201, 60, .3), rgba(255, 201, 60, .06)); }
.item .nom { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .pts { font-family: var(--titre); color: var(--sable); font-size: 17px; }
.item .rang { font-family: var(--titre); color: var(--doux); width: 20px; }
.item.or .pts { color: var(--sable); }

.mini {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: var(--doux);
}

.mini.joker { background: var(--cyan); color: #04283b; }

/* ----------------------------------------------------------------- flux */

.flux { display: flex; flex-direction: column-reverse; gap: 8px; max-height: 400px; overflow-y: auto; }

.evt {
  padding: 11px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
  font-size: 14px;
  animation: monte .3s ease;
}

.evt.trouve { background: linear-gradient(90deg, rgba(53, 227, 176, .28), rgba(53, 227, 176, .06)); }
.evt.trouve b { color: var(--menthe); }
.evt.joker { background: linear-gradient(90deg, rgba(69, 208, 255, .3), rgba(69, 208, 255, .06)); }
.evt.conteste { background: linear-gradient(90deg, rgba(255, 94, 122, .28), rgba(255, 94, 122, .06)); }
.evt.sys { color: var(--doux); font-size: 13px; background: transparent; padding: 4px 14px; }

@keyframes monte {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* -------------------------------------------------------- joker : alerte */

.joker-alerte {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 90;
}

.joker-carte {
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  color: #fff;
  padding: 26px 40px;
  border-radius: var(--r-l);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  animation: joker-pop 2.6s cubic-bezier(.2, 1.2, .3, 1) forwards;
}

.joker-carte .titre { font-family: var(--titre); font-size: clamp(30px, 5vw, 54px); line-height: 1; }
.joker-carte .qui { font-size: 17px; opacity: .9; margin-bottom: 6px; }
.joker-carte .desc { font-size: 15px; opacity: .85; margin-top: 8px; }

@keyframes joker-pop {
  0% { opacity: 0; transform: scale(.6) rotate(-8deg); }
  12% { opacity: 1; transform: scale(1.08) rotate(2deg); }
  20% { transform: scale(1) rotate(-1deg); }
  26% { transform: scale(1.02) rotate(1deg); }
  32% { transform: scale(1) rotate(0); }
  82% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.92) translateY(-24px); }
}

.confetti {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  animation: chute 2.4s ease-in forwards;
}

@keyframes chute {
  0% { opacity: 1; transform: translateY(-40px) rotate(0); }
  100% { opacity: 0; transform: translateY(60vh) rotate(540deg); }
}

/* ------------------------------------------------------------- sondage */

.sondage { text-align: center; }

.sondage .question {
  font-family: var(--titre);
  font-size: clamp(24px, 3.6vw, 38px);
  line-height: 1.15;
  margin-bottom: 6px;
}

.jauge {
  display: flex;
  height: 46px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, .3);
  margin: 18px 0 10px;
}

.jauge .oui, .jauge .non {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--titre);
  font-size: 17px;
  transition: width .4s cubic-bezier(.3, 1, .4, 1);
  min-width: 0;
  overflow: hidden;
}

.jauge .oui { background: linear-gradient(90deg, var(--menthe), #17c78f); color: #04361f; }
.jauge .non { background: linear-gradient(90deg, #ff7d93, var(--corail)); color: #4a0512; }

.vote-consigne {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tape {
  font-family: var(--titre);
  font-size: 20px;
  padding: 10px 24px;
  border-radius: 999px;
}

.tape.oui { background: var(--menthe); color: #04361f; }
.tape.non { background: var(--corail); color: #4a0512; }

/* ---------------------------------------------------------- contestation */

.contestable {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
  font-size: 15px;
}

.contestable.marque { background: rgba(255, 94, 122, .2); }

.alerte {
  background: rgba(255, 94, 122, .18);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 14px;
  margin-top: 14px;
}

.info {
  background: rgba(69, 208, 255, .14);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
