/* ============================================================
   BLINDTEST ÉTÉ 2026 — style néon / synthwave
   ============================================================ */

:root {
  --bg-0: #07060f;          /* fond le plus sombre */
  --bg-1: #0d0b1e;          /* fond panneaux */
  --bg-2: #141031;          /* cellules */
  --bg-3: #1b1540;          /* cellules survol */

  --neon-pink: #ff3fb4;
  --neon-cyan: #21e0d6;
  --neon-purple: #a24bff;
  --neon-blue: #4b6bff;

  --txt: #e9e6ff;
  --txt-dim: #8b86b8;

  --border: rgba(140, 110, 255, 0.35);
  --border-glow: rgba(255, 63, 180, 0.55);

  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg-0);
  color: var(--txt);
  font-family: var(--font);
  overflow: hidden;
}

/* Fond dégradé + grille synthwave subtile */
body {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(162, 75, 255, 0.25), transparent 60%),
    radial-gradient(900px 500px at 100% 10%, rgba(33, 224, 214, 0.12), transparent 60%),
    radial-gradient(900px 500px at 0% 20%, rgba(255, 63, 180, 0.12), transparent 60%),
    var(--bg-0);
}

/* ---------- Layout général ---------- */
.app {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
  padding: 14px 18px 18px;
  gap: 10px;
}

/* ---------- En-tête ---------- */
.header {
  position: relative;
  text-align: center;
  padding: 6px 0 2px;
}
.header .title {
  font-size: clamp(28px, 4.4vw, 58px);
  font-weight: 900;
  letter-spacing: 6px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink), var(--neon-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 63, 180, 0.55))
          drop-shadow(0 0 22px rgba(33, 224, 214, 0.35));
}
.header .subtitle {
  margin-top: -2px;
  font-size: clamp(12px, 1.6vw, 20px);
  font-weight: 700;
  letter-spacing: 10px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(33, 224, 214, 0.7);
}
.header .palm {
  position: absolute;
  right: 6px;
  top: 0;
  font-size: 40px;
  filter: drop-shadow(0 0 10px var(--neon-pink));
}

/* ---------- Corps 3 colonnes ---------- */
.stage {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 14px;
  min-height: 0;
}

/* ---------- Panneaux ---------- */
.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(20, 16, 49, 0.9), rgba(13, 11, 30, 0.9));
  border: 1px solid rgba(162, 120, 255, 0.55);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 0 24px rgba(162, 75, 255, 0.12) inset,   /* halo interne */
    0 0 10px rgba(162, 75, 255, 0.35),          /* contour lumineux proche */
    0 0 26px rgba(255, 63, 180, 0.22),          /* glow rose diffus */
    0 8px 30px rgba(0, 0, 0, 0.55);             /* ombre portée = profondeur */
  padding: 12px;
}
/* Liseré dégradé néon sur le bord de chaque box */
.panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg,
    var(--neon-cyan), rgba(162, 75, 255, 0.15) 45%, var(--neon-pink));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.55;
  pointer-events: none;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;         /* empêche la colonne de forcer la grille à grandir */
}
.card-title {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--txt-dim);
  text-align: center;
  margin-bottom: 8px;
}

/* ---------- Webcam ---------- */
.webcam {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 10px, transparent 10px 20px),
    var(--bg-2);
  display: grid;
  place-items: center;
  color: var(--txt-dim);
  font-size: 12px;
  position: relative;
  overflow: hidden;
}
.webcam .crown { position: absolute; top: 8px; right: 12px; font-size: 26px; filter: drop-shadow(0 0 8px var(--neon-cyan)); }

/* ---------- Scoreboard ---------- */
.scoreboard { flex: 1; min-height: 0; overflow: auto; }
.score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 6px;
  background: rgba(255,255,255,0.02);
}
.score-row .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-row .pts {
  font-size: 16px; font-weight: 800; min-width: 34px; text-align: center;
  color: var(--neon-cyan); text-shadow: 0 0 8px rgba(33,224,214,0.6);
}

/* ---------- Carte réponse ---------- */
.answer-card {
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 10px;
  text-align: center;
  box-shadow: 0 0 18px rgba(255, 63, 180, 0.18);
}
.answer-card .a-label {
  font-size: 9px; letter-spacing: 4px; color: var(--txt-dim); margin-bottom: 4px;
}
.answer-card .a-title { font-weight: 800; font-size: 15px; }
.answer-card .a-artist { font-size: 12px; color: var(--txt-dim); }
.answer-card.hidden-answer .a-title,
.answer-card.hidden-answer .a-artist { filter: blur(7px); user-select: none; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px 14px; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--neon-pink);
  background: linear-gradient(180deg, rgba(255,63,180,0.18), rgba(255,63,180,0.05));
  color: var(--txt); font-weight: 800; letter-spacing: 1.5px; font-size: 12px;
  text-transform: uppercase; transition: 0.15s;
  box-shadow: 0 0 14px rgba(255, 63, 180, 0.25);
}
.btn:hover { background: rgba(255,63,180,0.3); box-shadow: 0 0 22px rgba(255,63,180,0.5); }
.btn.cyan { border-color: var(--neon-cyan); box-shadow: 0 0 14px rgba(33,224,214,0.25);
  background: linear-gradient(180deg, rgba(33,224,214,0.18), rgba(33,224,214,0.05)); }
.btn.ghost { border-color: var(--border); background: transparent; box-shadow: none; }
.btn.small { padding: 8px 10px; font-size: 10px; letter-spacing: 1px; }
.reveal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.tabs { display: flex; gap: 6px; }
.tab {
  flex: 1; text-align: center; padding: 7px; font-size: 11px; letter-spacing: 2px;
  border-radius: 8px; border: 1px solid var(--border); cursor: pointer; color: var(--txt-dim);
  text-transform: uppercase;
}
.tab.active { color: var(--txt); border-color: var(--neon-purple); box-shadow: 0 0 10px rgba(162,75,255,0.4); }

/* ============================================================
   GRILLE CENTRALE
   ============================================================ */
.grid-wrap {
  display: grid; place-items: center;
  padding: 8px;
}
.grid {
  --gap: 7px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  gap: var(--gap);
  /* Carré calé sur la hauteur dispo => les 100 cases tiennent toujours */
  height: 100%;
  width: auto;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
}
.cell {
  position: relative;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  color: var(--txt);
  font-weight: 800;
  font-size: clamp(11px, 1.1vw, 18px);
  cursor: pointer;
  transition: 0.15s;
  overflow: hidden;
  user-select: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
}
.cell:hover {
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(33, 224, 214, 0.45);
  transform: translateY(-1px);
}
/* Case révélée (thème visible) */
.cell.revealed {
  color: #0a0a12;
  font-size: clamp(8px, 0.8vw, 13px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.05;
  padding: 3px;
  border-color: transparent;
  background: var(--theme-color, var(--neon-pink));
  box-shadow: 0 0 18px var(--theme-color, var(--neon-pink));
  text-shadow: 0 1px 0 rgba(255,255,255,0.25);
}
.cell.current { outline: 3px solid var(--neon-cyan); outline-offset: 1px; }
.cell.done { opacity: 0.4; }
.cell .cell-theme { font-weight: 900; }

/* ============================================================
   PANNEAU DROIT
   ============================================================ */
.hero-img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-2);
}
.hero-caption {
  text-align: center; font-size: 10px; letter-spacing: 3px; margin-top: -22px;
  position: relative; color: #fff; text-shadow: 0 0 6px #000; font-weight: 800;
}

.mode-box {
  text-align: center; padding: 12px;
  border: 1px solid var(--neon-pink); border-radius: var(--radius);
  box-shadow: 0 0 16px rgba(255,63,180,0.2);
}
.mode-box .lbl { font-size: 9px; letter-spacing: 3px; color: var(--txt-dim); }
.mode-box .val {
  font-size: 24px; font-weight: 900; letter-spacing: 2px;
  color: var(--neon-cyan); text-shadow: 0 0 10px rgba(33,224,214,0.6);
}
.mode-box .sub { font-size: 9px; letter-spacing: 2px; color: var(--txt-dim); margin-top: 2px; }

/* Thème actuel + chrono */
.theme-live { text-align: center; }
.theme-live .cur-theme {
  font-size: 26px; font-weight: 900; margin: 4px 0 10px;
  text-shadow: 0 0 12px currentColor;
}
.chrono {
  display: inline-block; font-size: 30px; font-weight: 900; letter-spacing: 2px;
  padding: 6px 22px; border-radius: 12px;
  border: 1px solid var(--neon-pink); color: var(--neon-pink);
  box-shadow: 0 0 16px rgba(255,63,180,0.35); text-shadow: 0 0 10px rgba(255,63,180,0.6);
}
.chrono.low { border-color: #ff4d4d; color: #ff6b6b; animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 26px rgba(255,0,0,0.7); } }

/* Lecteur */
.player { margin-top: auto; }
.player .bar {
  height: 6px; border-radius: 4px; background: var(--bg-2); overflow: hidden; margin: 8px 0;
}
.player .bar > span { display: block; height: 100%; width: 30%;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-cyan)); }
.player .controls { display: flex; align-items: center; gap: 10px; justify-content: center; }
.player .pbtn {
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  display: grid; place-items: center; font-size: 16px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--txt);
}
.player .pbtn:hover { border-color: var(--neon-cyan); box-shadow: 0 0 12px rgba(33,224,214,0.4); }

/* Lecteur YouTube caché (audio only) */
#yt-player, .yt-hidden {
  position: fixed; left: -9999px; top: -9999px; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}

.hint { font-size: 10px; color: var(--txt-dim); text-align: center; }
.spacer { flex: 1; }
