:root { --bg:#0f0f12; --fg:#f2f2f5; --muted:#9aa0a6; --accent:#7c5cff; }
*{ box-sizing:border-box; }
body{ margin:0; font:16px/1.4 system-ui, -apple-system, Segoe UI, Roboto; color:var(--fg); background:linear-gradient(120deg,#0f0f12,#121220); }
.wrap{ max-width:1100px; margin:40px auto; padding:20px; }
h1{ margin-top:0; }
.hidden{ display:none; }
.muted{ color:var(--muted); }

.row{ display:flex; gap:8px; align-items:center; }
.row + .row { margin-top:8px; }

input{
  outline: none; padding:10px 12px; border-radius:12px;
  border:1px solid #23232e; background:#161625; color:var(--fg);
  font-size: 24px; width: 100%;
}

button{
  font-size: 24px; padding:10px 14px; border-radius:12px;
  background:var(--accent); color:white; border:none; cursor:pointer;
  box-shadow:0 4px 18px rgba(124,92,255,.25);
  transition: 0.3s all ease;
}
button:hover { background:#6b47e0; }
button:disabled{ opacity:.5; cursor:not-allowed; }

.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:10px 12px; background:#161625; border:1px solid #23232e; border-radius:16px;
}

.stage{ margin:16px 0; padding:20px; background:#161625; border:1px solid #23232e; border-radius:16px; }
.now{ display:flex; gap:16px; align-items:center; }
#cover{ width:96px; height:96px; border-radius:12px; object-fit:cover; background:#0d0d18; border:1px solid #23232e; }

.guess{ display:flex; gap:8px; margin-top: 16px; }

.cols{ display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:16px; }
.cols-2{ grid-template-columns:1fr 1fr 1fr; }
.cols-3{ grid-template-columns:1fr 1fr 1fr; }

ul{ list-style:none; padding:0; margin:0; }
li{ padding:8px 10px; border-bottom:1px solid #23232e; }

.answer{ margin-top:16px; padding:12px; border-radius:12px; background:#0b2a17; border:1px solid #0f3; }

/* Historique */
.history .item{ display:flex; gap:10px; align-items:center; }
.history .cover{ width:40px; height:40px; border-radius:8px; object-fit:cover; background:#0d0d18; border:1px solid #23232e; }
.history .meta{ display:flex; flex-direction:column; gap:2px; }
.history .title{ font-weight:600; }
.history .theme{ color:var(--muted); font-size:12px; }

/* Contrôles son */
.soundctl { display:flex; align-items:center; gap:8px; }
#muteBtn { padding:8px 10px; border-radius:10px; background:#23232e; color:#f2f2f5; border:1px solid #2e2e3b; }
#muteBtn[aria-pressed="true"] { background:#3a2b2b; }
#volume { width:140px; }

/* Barre de progression (20s) */
.progress {
  height: 10px; background: #1b1b28;
  border: 1px solid #23232e; border-radius: 999px;
  margin-top: 10px; overflow: hidden;
}
#progressFill {
  height: 100%; width: 0%;
  background: #33dd66; /* sera mis à jour en JS du vert → rouge */
  transition: width 0.1s linear, background-color 0.1s linear;
}

/* Auth section tweaks */
#auth {
  input { border-radius:15px 15px 0 0; flex: 1; }
  .row { button { border-radius:0 0 15px 15px; flex: 1; } }
  .title { font-size: 24px; font-weight: bold; margin-bottom: 16px; text-align: center; }
  hr { margin: 36px 0; border: 1px solid #23232e; }
}

/* === FX +points au centre de l'écran === */
#fx {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  display: grid; place-items: center;
}
.pts-burst {
  font-size: 40px; font-weight: 800; color: #00f07a;
  text-shadow: 0 2px 16px rgba(0,255,120,.6);
  animation: burstUp 1.2s ease-out forwards;
}
@keyframes burstUp {
  0% { transform: translateY(20px) scale(.85); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-60px) scale(1.2); opacity: 0; }
}

/* Pulse sur le joueur qui marque */
#players li.scored { animation: scoredPulse .8s ease; }
@keyframes scoredPulse {
  0% { background: rgba(0,255,120,.16); }
  100% { background: transparent; }
}

/* Historique : items que moi j'ai trouvés */
.history .item.found {
  background: rgba(0,255,120,.10);
  border: 1px solid rgba(0,255,120,.35);
  border-radius: 10px;
}

/* === Modal podium === */
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 10000; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
}
.modal-card {
  position: relative; margin: 6vh auto; max-width: 720px;
  background: #161625; border: 1px solid #23232e; border-radius: 16px; padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
}
.modal-title { margin: 0 0 10px; }
.modal-close {
  position: absolute; top: 10px; right: 10px;
  background: #23232e; border: 1px solid #2e2e3b; color: var(--fg);
  border-radius: 10px; padding: 6px 10px; cursor: pointer;
}

.podium {
  display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 12px; align-items: end; margin: 16px 0 12px;
}
.podium .slot {
  background: #1a1a2b; border: 1px solid #23232e; border-radius: 14px; padding: 12px;
  display: grid; place-items: center; text-align: center; position: relative;
}
.podium .slot .rank { font-size: 20px; opacity: .8; margin-bottom: 6px; }
.podium .slot .name { font-weight: 700; }
.podium .slot .score { color: var(--muted); font-size: 14px; }

.podium .gold   { transform: translateY(-10px); border-color: rgba(255,215,0,.45); box-shadow: 0 6px 20px rgba(255,215,0,.15) inset; }
.podium .silver { transform: translateY(0);     border-color: rgba(192,192,192,.35); }
.podium .bronze { transform: translateY(6px);    border-color: rgba(205,127,50,.35); }

.podium .medal {
  position: absolute; top: -12px; left: 12px; font-size: 22px;
}

.podium-list-wrap { margin-top: 8px; }
.podium-list { margin: 6px 0 0; padding-left: 22px; }
.podium-list li { padding: 6px 0; border-bottom: 1px solid #23232e; }
.podium-list li:last-child { border-bottom: none; }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* Select multi-thèmes */
#themeSelect {
  min-width: 220px;
  max-width: 260px;
  background:#161625;
  color:var(--fg);
  border:1px solid #23232e;
  border-radius:10px;
  padding:6px 8px;
  outline: none;
}
#themeSelect option { padding:6px 8px; }
#themeSelect:focus { box-shadow:0 0 0 2px rgba(124,92,255,.35); }
