:root {
  --noir: #0b0809;
  --nuit: #151012;
  --velours: #2a0f16;
  --bordeaux: #6e1423;
  --bordeaux-vif: #a3233a;
  --or: #c9a45c;
  --or-pale: #e8d3a2;
  --texte: #efe7da;
  --texte-doux: #b9ad9c;
  --ligne: rgba(201, 164, 92, 0.25);
  --ok: #7fb38a;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--noir); color: var(--texte); font-family: var(--sans); font-size: 17px; line-height: 1.55; }
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -20%, rgba(110, 20, 35, 0.45), transparent 60%),
    repeating-linear-gradient(45deg, rgba(201, 164, 92, 0.025) 0 2px, transparent 2px 14px),
    var(--noir);
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--or-pale); line-height: 1.2; letter-spacing: 0.01em; }
h1 { font-size: 2.1rem; margin: 0.2em 0; }
h2 { font-size: 1.55rem; margin: 1.2em 0 0.4em; border-bottom: 1px solid var(--ligne); padding-bottom: 0.2em; }
h3 { font-size: 1.25rem; margin: 1em 0 0.3em; }
a { color: var(--or); }
strong { color: var(--or-pale); }
blockquote { margin: 0.8em 0; padding: 0.4em 1em; border-left: 3px solid var(--bordeaux-vif); background: rgba(110, 20, 35, 0.2); }
table { border-collapse: collapse; width: 100%; margin: 0.6em 0; font-size: 0.95rem; }
th, td { border: 1px solid var(--ligne); padding: 0.4em 0.6em; text-align: left; }
th { color: var(--or); font-weight: 600; }
code { background: rgba(201, 164, 92, 0.15); color: var(--or-pale); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.95em; letter-spacing: 0.04em; }

.ornement { text-align: center; color: var(--or); letter-spacing: 0.6em; font-size: 0.8rem; opacity: 0.8; }
.carte {
  background: linear-gradient(180deg, rgba(42, 15, 22, 0.75), rgba(21, 16, 18, 0.9));
  border: 1px solid var(--ligne); border-radius: 14px; padding: 1.1rem 1.2rem; margin: 0.9rem 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.petit { font-size: 0.85rem; color: var(--texte-doux); }
.badge { display: inline-block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; padding: 0.15em 0.6em; border-radius: 99px; border: 1px solid var(--ligne); color: var(--or); }
.badge.enquete { color: #8fb7d8; border-color: rgba(143, 183, 216, 0.4); }
.badge.role { color: #d89bb0; border-color: rgba(216, 155, 176, 0.4); }
.badge.physique { color: #b8d08f; border-color: rgba(184, 208, 143, 0.4); }
.badge.placement { color: #e0b46c; border-color: rgba(224, 180, 108, 0.4); }

input, select, button { font: inherit; }
input[type=text], select {
  width: 100%; padding: 0.85em 1em; border-radius: 10px; border: 1px solid var(--ligne);
  background: rgba(0, 0, 0, 0.5); color: var(--texte); font-size: 1.1rem; letter-spacing: 0.08em;
}
input[type=text]:focus, select:focus { outline: 2px solid var(--or); outline-offset: 1px; }
button, .bouton {
  display: inline-block; padding: 0.8em 1.4em; border-radius: 10px; border: 1px solid var(--or);
  background: linear-gradient(180deg, #8a1c2e, var(--bordeaux)); color: var(--or-pale); cursor: pointer;
  font-family: var(--serif); font-size: 1.15rem; font-weight: 600; letter-spacing: 0.04em; text-decoration: none;
}
button:hover, .bouton:hover { filter: brightness(1.15); }
button.secondaire { background: transparent; border-color: var(--ligne); color: var(--texte-doux); font-family: var(--sans); font-size: 0.9rem; font-weight: 400; padding: 0.5em 0.9em; }
button:disabled { opacity: 0.45; cursor: default; }
.msg { min-height: 1.4em; margin-top: 0.6em; }
.msg.err { color: #f08c8c; }
.msg.ok { color: var(--ok); }

/* ---------------------------------------------------------- accueil */
.accueil { max-width: 460px; margin: 0 auto; padding: 12vh 16px 40px; text-align: center; }
.accueil .masque-deco { font-size: 3.2rem; filter: drop-shadow(0 0 18px rgba(201, 164, 92, 0.5)); }
.accueil form { margin-top: 2rem; display: grid; gap: 0.9rem; }

/* ---------------------------------------------------------- joueur */
.entete {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 0.6rem;
  padding: 0.6rem 16px; background: rgba(11, 8, 9, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ligne);
}
.entete .nom { font-family: var(--serif); font-size: 1.25rem; color: var(--or-pale); }
.entete .horloge { font-variant-numeric: tabular-nums; font-family: var(--serif); font-size: 1.3rem; color: var(--or); text-align: right; }
.entete .acte { font-size: 0.75rem; color: var(--texte-doux); display: block; }
main.joueur { max-width: 720px; margin: 0 auto; padding: 0 16px 110px; }
.onglets {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--noir); border-top: 1px solid var(--ligne); padding-bottom: env(safe-area-inset-bottom);
}
.onglets button {
  border: 0; border-radius: 0; background: transparent; color: var(--texte-doux); font-family: var(--sans); font-size: 0.72rem;
  padding: 0.6em 0 0.7em; display: flex; flex-direction: column; align-items: center; gap: 0.15em; position: relative;
}
.onglets button span.ico { font-size: 1.35rem; line-height: 1; }
.onglets button.actif { color: var(--or); }
.onglets button .pastille { position: absolute; top: 6px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--bordeaux-vif); display: none; }
.onglets button.nouveau .pastille { display: block; }
.panneau { display: none; }
.panneau.actif { display: block; animation: apparition 0.35s ease; }
@keyframes apparition { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.quete.faite { opacity: 0.6; }
.quete.faite h3::after { content: ' ✓'; color: var(--ok); }
.quete .actions { margin-top: 0.6em; display: flex; gap: 0.5em; align-items: center; flex-wrap: wrap; }
.objectif { display: flex; gap: 0.7em; align-items: flex-start; padding: 0.5em 0; border-bottom: 1px solid var(--ligne); }
.objectif input { width: 1.3em; height: 1.3em; accent-color: var(--or); margin-top: 0.2em; flex: none; }
.indice.revelation { border-color: var(--bordeaux-vif); }
.vote-form { display: grid; gap: 0.8rem; }
.vote-form label { font-family: var(--serif); color: var(--or); font-size: 1.1rem; }

/* annonce plein écran */
.annonce {
  position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(ellipse at center, rgba(110, 20, 35, 0.92), rgba(0, 0, 0, 0.97));
}
.annonce.visible { display: flex; animation: apparition 0.6s ease; }
.annonce .contenu { max-width: 560px; text-align: center; }
.annonce .type { color: var(--or); letter-spacing: 0.35em; text-transform: uppercase; font-size: 0.8rem; }
.annonce h2 { border: 0; font-size: 2.2rem; margin: 0.4em 0; }
.annonce p { font-size: 1.15rem; }

/* ---------------------------------------------------------- écran commun */
body.ecran { overflow: hidden; height: 100vh; }
.scene { position: fixed; inset: 0; display: grid; grid-template-columns: 1fr 420px; }
.scene .video { position: relative; background: #000; overflow: hidden; }
.scene .video .fond {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(201, 164, 92, 0.18), transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(110, 20, 35, 0.55), transparent 50%), #070506;
  animation: respire 18s ease-in-out infinite alternate;
}
@keyframes respire { from { filter: brightness(0.8); transform: scale(1); } to { filter: brightness(1.15); transform: scale(1.06); } }
.scene .video iframe, .scene .video .yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#yt-ambiance { pointer-events: none; }
#yt-clip-wrap { opacity: 0; transition: opacity 0.8s; z-index: 2; }
#yt-clip-wrap.visible { opacity: 1; }
.soustitres {
  position: absolute; inset: 0; z-index: 3; display: none; align-items: center; justify-content: center; padding: 6vw;
  background: rgba(0, 0, 0, 0.82); text-align: center;
}
.soustitres.visible { display: flex; animation: apparition 0.8s ease; }
.soustitres .voix { color: var(--or); letter-spacing: 0.35em; text-transform: uppercase; font-size: 1rem; }
.soustitres { padding-top: 24vh; }
.soustitres p { animation: apparition 0.9s ease; max-width: 60ch; margin-inline: auto; font-family: var(--serif); font-size: clamp(1.4rem, 2.4vw, 2.3rem); line-height: 1.45; white-space: pre-line; color: var(--or-pale); }
.horloge-geante { position: absolute; top: 3vh; left: 3vw; z-index: 4; text-shadow: 0 2px 20px #000; }
.horloge-geante .h { font-family: var(--serif); font-size: clamp(3rem, 7vw, 6.5rem); color: var(--or-pale); font-variant-numeric: tabular-nums; line-height: 1; }
.horloge-geante .a { font-family: var(--serif); font-size: clamp(1.1rem, 1.8vw, 1.7rem); color: var(--or); margin-top: 0.3em; }
.horloge-geante .prochain { font-size: 1rem; color: var(--texte-doux); margin-top: 0.4em; font-variant-numeric: tabular-nums; }
.titre-scene { position: absolute; bottom: 3vh; left: 3vw; z-index: 4; font-family: var(--serif); color: var(--or); letter-spacing: 0.3em; text-transform: uppercase; font-size: 0.95rem; opacity: 0.8; }
.colonne { overflow-y: auto; padding: 18px; border-left: 1px solid var(--ligne); background: rgba(11, 8, 9, 0.97); }
.colonne h2 { font-size: 1.3rem; margin-top: 0.6em; }
.evt { padding: 0.5em 0; border-bottom: 1px solid var(--ligne); }
.evt .t { color: var(--or); font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.ouvrir {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; gap: 1.5rem; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, var(--velours), #000); text-align: center; padding: 16px;
}
.regie { position: fixed; right: 12px; bottom: 12px; z-index: 40; }
.regie .tiroir { display: none; position: absolute; right: 0; bottom: 48px; width: 340px; max-width: calc(100vw - 24px); }
.regie.ouverte .tiroir { display: block; }
.regie .tiroir .carte { margin: 0; display: grid; gap: 0.6rem; }
.regie .ligne { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.revelation-ecran { position: absolute; inset: 0; z-index: 5; overflow-y: auto; padding: 4vh 4vw; background: rgba(5, 3, 4, 0.96); display: none; }
.revelation-ecran.visible { display: block; animation: apparition 1.2s ease; }
.revelation-ecran .contenu { max-width: 900px; margin: 0 auto; font-size: 1.2rem; }

@media (max-width: 900px) {
  body.ecran { overflow: auto; height: auto; }
  .scene { position: static; grid-template-columns: 1fr; }
  .scene .video { height: 60vh; }
  .colonne { border-left: 0; }
}
