:root {
  --bg: #07090d;
  --bg2: #0d1119;
  --panel: #131924;
  --panel2: #1a2230;
  --line: #2a3445;
  --gold: #d9ad4e;
  --gold-dim: #8a6f35;
  --red: #c9392e;
  --green: #4fae7b;
  --text: #ece5d3;
  --muted: #8d95a3;
  --radius: 14px;
  --title: 'Cinzel', Georgia, serif;
  --type: 'Special Elite', 'Courier New', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(217,173,78,.10), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(201,57,46,.10), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, 'Segoe UI', sans-serif;
}
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }

/* ---------- barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  background: rgba(7,9,13,.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; }
.brand-mark {
  font-family: var(--title); font-weight: 900; font-size: 13px; letter-spacing: 1px;
  color: var(--bg); background: var(--gold); padding: 4px 7px; border-radius: 6px;
}
.brand-name { font-family: var(--title); font-weight: 700; letter-spacing: 2px; font-size: 14px; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.agent { font-family: var(--type); font-size: 13px; color: var(--gold); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); font-size: 16px;
}
.icon-btn.off { opacity: .45; text-decoration: line-through; }

main { max-width: 980px; margin: 0 auto; padding: 24px 16px 80px; }
h1, h2, h3 { font-family: var(--title); letter-spacing: 1.5px; margin: 0 0 .4em; }
h1 { font-size: clamp(26px, 5vw, 40px); }
h2 { font-size: 22px; }
.kicker { font-family: var(--type); color: var(--gold); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }
.muted { color: var(--muted); }
.center { text-align: center; }

.btn {
  display: inline-block; padding: 12px 22px; border-radius: 10px;
  background: linear-gradient(180deg, #e6bd62, #b98d33); color: #1a1305;
  border: 0; font-family: var(--title); font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; font-size: 14px;
  box-shadow: 0 4px 18px rgba(217,173,78,.25);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(217,173,78,.4); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.small { padding: 8px 14px; font-size: 12px; }

.panel {
  background: linear-gradient(180deg, var(--panel), #0f141d);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.45);
}

/* ---------- intro ---------- */
.intro { max-width: 560px; margin: 6vh auto 0; text-align: center; }
.intro .stamp {
  display: inline-block; border: 2px solid var(--red); color: var(--red);
  font-family: var(--type); letter-spacing: 4px; padding: 4px 14px; transform: rotate(-4deg);
  margin-bottom: 22px; text-transform: uppercase;
}
.intro input {
  width: 100%; text-align: center; font-family: var(--title); font-size: 26px; letter-spacing: 2px;
  background: #0a0e15; color: var(--gold); border: 1px solid var(--gold-dim); border-radius: 10px; padding: 12px;
  margin: 14px 0 20px;
}

/* ---------- calendrier ---------- */
.cartouche {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  margin: 18px 0 30px; padding: 16px;
  border: 1px solid var(--gold-dim); border-radius: 40px;
  background: rgba(217,173,78,.05);
}
.cartouche .word { display: flex; gap: 4px; }
.cartouche .slot {
  width: 26px; height: 34px; display: grid; place-items: center;
  border-bottom: 2px solid var(--gold-dim);
  font-family: var(--title); font-weight: 700; font-size: 18px; color: var(--gold);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.card {
  position: relative; aspect-ratio: 5 / 7; border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; justify-content: space-between; text-align: left;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 6px, transparent 6px 12px),
    linear-gradient(160deg, #18202d, #0d121a);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card .num { font-family: var(--title); font-weight: 900; font-size: 44px; line-height: 1; color: #3a475c; }
.card .place { font-size: 13px; font-weight: 600; }
.card .state { font-family: var(--type); font-size: 11px; color: var(--muted); letter-spacing: .5px; }
.card.locked { cursor: not-allowed; }
.card.locked::after { content: '🔒'; position: absolute; right: 10px; top: 10px; opacity: .5; font-size: 14px; }
.card.open { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 30px rgba(217,173,78,.3); animation: pulse 2.4s infinite; }
.card.open .num { color: var(--gold); }
.card.open:hover, .card.done:hover { transform: translateY(-4px) rotate(-1deg); }
.card.done { border-color: #2f5c47; background: linear-gradient(160deg, #15251f, #0d1512); }
.card.done .num { color: var(--green); }
.card.done .letter {
  position: absolute; right: 10px; top: 8px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--gold); color: #1a1305; font-family: var(--title); font-weight: 900;
  padding: 0; font-style: normal; font-size: 16px; line-height: 1; border-radius: 50%;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 1px var(--gold), 0 0 46px rgba(217,173,78,.55); } }

.banner { background: #3a1512; border: 1px solid var(--red); color: #ffd9d4; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- mission ---------- */
.mission-head { margin-bottom: 18px; }
.dialog { display: flex; flex-direction: column; gap: 12px; margin: 18px 0; }
.bubble {
  max-width: 640px; padding: 12px 16px; border-radius: 4px 14px 14px 14px;
  background: var(--panel2); border: 1px solid var(--line);
  animation: rise .5s both;
}
.bubble .who { font-family: var(--type); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); margin-bottom: 2px; }
.bubble.faucon .who { color: #7fb4e0; }
.bubble.pixel .who, .bubble.bidouille .who { color: #6fd6a8; }
.bubble.inconnu { font-family: var(--type); background: #0a0e15; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.puzzle { margin-top: 8px; }
.puzzle h3 { font-size: 16px; color: var(--gold); }
.instr { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.answer { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.answer input {
  flex: 1; min-width: 180px; padding: 12px 14px; border-radius: 10px;
  background: #0a0e15; border: 1px solid var(--line); color: var(--text);
  font-family: var(--type); font-size: 18px; letter-spacing: 2px; text-transform: uppercase;
}
.answer input:focus { outline: none; border-color: var(--gold); }
.feedback { min-height: 24px; margin-top: 10px; font-family: var(--type); font-size: 14px; color: #ff8b80; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.hints { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 14px; }
.hint { font-size: 14px; background: #101a17; border: 1px solid #23463a; border-radius: 10px; padding: 10px 14px; margin: 8px 0; }
.hint b { color: #6fd6a8; font-family: var(--type); font-weight: 400; letter-spacing: 1px; }

.reward { text-align: center; margin: 26px 0; }
.reward .tile {
  width: 84px; height: 104px; margin: 10px auto; display: grid; place-items: center;
  font-family: var(--title); font-weight: 900; font-size: 54px; color: #1a1305;
  background: linear-gradient(160deg, #f0cc7a, #b98d33); border-radius: 12px;
  box-shadow: 0 0 60px rgba(217,173,78,.6); animation: flip 1s both;
}
@keyframes flip { from { transform: rotateY(90deg) scale(.6); opacity: 0; } }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- énigmes ---------- */
svg { max-width: 100%; height: auto; display: block; }
.stage { background: #0a0e15; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }

/* César */
.cesar { display: grid; gap: 16px; grid-template-columns: minmax(200px, 300px) 1fr; align-items: center; }
@media (max-width: 640px) { .cesar { grid-template-columns: 1fr; } }
.cesar .msg { font-family: var(--type); font-size: 18px; letter-spacing: 2px; line-height: 1.8; word-break: break-word; color: var(--gold); }
.cesar .inner { transition: transform .35s; transform-origin: 150px 150px; }

/* Différences */
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .diff { grid-template-columns: 1fr; } }
.diff figure { margin: 0; }
.diff figcaption { font-family: var(--type); font-size: 12px; color: var(--red); margin-bottom: 4px; }
.diff svg { border-radius: 8px; border: 1px solid var(--line); cursor: crosshair; }
.uv { position: relative; height: 240px; border-radius: 12px; background: #e9e2cf; color: #5a5446; overflow: hidden; cursor: none; touch-action: none; }
.uv .plain, .uv .secret { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; }
.uv .plain { font-family: var(--title); letter-spacing: 3px; }
.uv .secret {
  display: block; padding: 0; background: #1a0b33; color: #c9a0ff; font-family: var(--title); font-weight: 900; font-size: 30px;
  -webkit-mask-image: radial-gradient(circle 42px at var(--x, -200px) var(--y, -200px), #000 55%, transparent 100%);
  mask-image: radial-gradient(circle 42px at var(--x, -200px) var(--y, -200px), #000 55%, transparent 100%);
}

/* Course */
.clues { display: grid; gap: 8px; margin-bottom: 16px; }
.clue { background: var(--panel2); border-left: 3px solid var(--gold); padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.clue b { color: var(--gold); }
.race { display: grid; grid-template-columns: 1fr 1.3fr; gap: 14px; align-items: start; }
.tag { font-family: var(--type); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.paddock { display: grid; gap: 8px; min-height: 80px; padding: 8px; border: 1px dashed var(--line); border-radius: 10px; }
.lane { display: grid; gap: 6px; }
.slot { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 8px; border: 2px dashed var(--gold-dim); border-radius: 10px; background: rgba(217,173,78,.04); }
.slot .rank { font-family: var(--title); font-weight: 900; font-size: 20px; color: var(--gold); width: 22px; }
.slot .empty { font-size: 12px; color: var(--muted); font-family: var(--type); }
.slot .car { flex: 1; }
.car { display: flex; align-items: center; gap: 8px; border: 2px solid var(--line); border-radius: 10px; padding: 6px 8px; background: var(--panel2); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.car .body { height: 22px; width: 46px; border-radius: 11px 11px 5px 5px; border: 2px solid rgba(255,255,255,.3); flex: none; }
.car .name { font-size: 13px; font-weight: 600; }
.car.lifting { opacity: .3; }
.car.ghost { position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, -50%) rotate(-3deg); box-shadow: 0 10px 30px rgba(0,0,0,.6); border-color: var(--gold); }

/* Miroir */
.mirror .facade { background: #2a2f3a; padding: 14px 8px; border-radius: 10px 10px 0 0; text-align: center; }
.mirror .engraved { font-family: var(--title); font-weight: 700; letter-spacing: 3px; color: #c7b68a; transform: scaleY(-1); font-size: clamp(11px, 2.4vw, 17px); }
.mirror .water { background: linear-gradient(180deg, #0f2a44, #071522); padding: 18px 8px; text-align: center; border-radius: 0 0 10px 10px; }
.mirror .reflet { font-family: var(--title); font-weight: 700; letter-spacing: 3px; color: #8fb6d8; font-size: clamp(11px, 2.4vw, 17px); transition: filter 1s, transform 1s; }
.mirror .lvl3 { filter: blur(9px); transform: skewX(12deg); }
.mirror .lvl2 { filter: blur(5px); transform: skewX(-7deg); }
.mirror .lvl1 { filter: blur(2.5px); transform: skewX(3deg); }
.mirror .lvl0 { filter: none; }

/* Pavillons */
.flags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 16px; }
.flags svg { width: 62px; border: 1px solid #000; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; margin-top: 14px; }
.legend div { text-align: center; font-family: var(--title); font-weight: 700; font-size: 14px; }
.legend svg { width: 44px; margin: 0 auto 2px; border: 1px solid #000; }

/* Tuyaux */
.pipes-wrap { display: flex; align-items: stretch; justify-content: center; gap: 0; }
.pipes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; width: min(100%, 380px); }
.pipe { aspect-ratio: 1; background: #1b1410; border: 1px solid #3b2c20; border-radius: 6px; padding: 0; }
.pipe svg { transition: transform .2s; width: 100%; }
.pipe path { stroke: #7a5a3a; stroke-width: 22; fill: none; stroke-linecap: butt; }
.pipe.live path { stroke: #e8a53a; filter: drop-shadow(0 0 4px #e8a53a); }
.pipe-end { width: 54px; display: flex; flex-direction: column; font-size: 11px; font-family: var(--type); color: var(--muted); text-align: center; }
.pipe-end.src { justify-content: flex-start; padding-top: 18px; }
.pipe-end.dst { justify-content: flex-end; padding-bottom: 18px; }
.pipe-end span { font-size: 28px; }

/* Métro */
.metro text { font: 600 15px system-ui, sans-serif; fill: #dfe5ee; }
.metro .hit { cursor: pointer; }
.metro .st { fill: #0a0e15; stroke: #fff; stroke-width: 3; cursor: pointer; }
.metro .st.sel { fill: var(--gold); stroke: var(--gold); }
.steps { margin: 0 0 14px; padding-left: 20px; font-family: var(--type); font-size: 14px; }
.steps li { margin: 4px 0; }

/* Qui est-ce */
.faces { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (min-width: 720px) { .faces { grid-template-columns: repeat(8, 1fr); } }
.face { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.face.out { opacity: .22; filter: grayscale(1); }

/* ---------- téléphone ---------- */
.answer .q { flex-basis: 100%; font-size: 14px; color: var(--gold); }
.stage.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stage.scroll svg { min-width: 560px; }
button, .card, .pipe, .face, .car { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (max-width: 640px) {
  main { padding: 16px 12px 60px; }
  .brand-name { display: none; }
  .panel { padding: 14px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .card { padding: 8px; }
  .card .num { font-size: 30px; }
  .card .place { font-size: 11px; }
  .card .state { font-size: 9px; line-height: 1.25; }
  .cartouche { gap: 10px; padding: 12px 8px; border-radius: 24px; }
  .cartouche .slot { width: 17px; height: 26px; font-size: 14px; }
  .answer input { font-size: 16px; }
  .answer .btn { flex: 1; }
  .pipe-end { width: 34px; font-size: 0; }
  .pipe-end span { font-size: 22px; }
  .podium { gap: 4px; }
  .legend { grid-template-columns: repeat(6, 1fr); }
  .flags svg { width: 34px; }
  .flags { gap: 4px; padding: 10px 4px; flex-wrap: nowrap; }
}

.uv .secret span { position: absolute; }

/* ---------- étapes ---------- */
.stepbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.stepbar span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--title); font-weight: 700; font-size: 13px; border: 1px solid var(--line); color: var(--muted); }
.stepbar span.cur { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 12px rgba(217,173,78,.4); }
.stepbar span.ok { background: var(--green); border-color: var(--green); color: #06130d; }
.stepbar em { font-family: var(--type); font-style: normal; font-size: 12px; color: var(--muted); margin-left: 6px; letter-spacing: 1px; text-transform: uppercase; }
.stepintro { background: var(--panel2); border-left: 3px solid #6fd6a8; padding: 10px 14px; border-radius: 6px; font-size: 14px; margin: 0 0 16px; }
.feedback.info { color: #6fd6a8; }
.cesar .lbl { font-family: var(--type); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* Semelles */
.soles { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: start; }
.soles .trace { background: #3b2f25; border-radius: 10px; padding: 8px; text-align: center; }
.soles .trace .tag { color: #d8c9a8; }
.shoes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shoe { background: var(--panel2); border: 2px solid var(--line); border-radius: 10px; padding: 6px; font-size: 12px; }
.shoe.sel { border-color: var(--gold); box-shadow: 0 0 14px rgba(217,173,78,.5); }
.shoe svg, .trace svg { width: 100%; max-width: 70px; margin: 0 auto 4px; }

/* Bandes */
.strips { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.strip { flex: 1; padding: 0; border: 0; border-right: 1px solid #000; background: none; }
.strip svg { width: 100%; height: 150px; }
.strip.sel { outline: 3px solid var(--gold); outline-offset: -3px; }

/* Pavillons en lignes */
.flaglines .flags { justify-content: flex-start; padding: 6px 8px; }

/* Métro : trajet */
.trail { font-size: 13px; margin-top: 10px; color: var(--muted); line-height: 1.9; }
.trail b { color: var(--gold); font-weight: 600; }

/* Clavier */
.keyrow { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.typed { display: flex; flex-wrap: wrap; gap: 6px; }
.typed span { width: 34px; height: 44px; display: grid; place-items: center; background: #9fd2a0; color: #0c2a12; font-family: var(--type); font-size: 22px; border-radius: 6px; }
.keypad { display: grid; grid-template-columns: repeat(3, 54px); gap: 6px; }
.keypad div { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; text-align: center; padding: 5px 0; }
.keypad b { display: block; font-size: 18px; } .keypad i { font-style: normal; font-size: 10px; color: var(--gold); letter-spacing: 1px; min-height: 14px; display: block; }

/* Connexion */
.login label { display: block; text-align: left; font-family: var(--type); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-top: 12px; }
.login input { font-family: var(--type); font-size: 18px; letter-spacing: 1px; text-align: left; margin: 4px 0 0; color: var(--text); }
.login .btn { margin-top: 20px; width: 100%; }

@media (max-width: 640px) {
  .race { grid-template-columns: 1fr 1.25fr; gap: 8px; }
  .car .body { width: 30px; }
  .soles { grid-template-columns: 84px 1fr; gap: 8px; }
  .keyrow { grid-template-columns: 1fr; }
  .keypad { grid-template-columns: repeat(3, 1fr); max-width: 240px; }
  .strip svg { height: 110px; }
  .flaglines .flags svg { width: 30px; }
}

/* Course : file à insertion */
.lane { min-height: 120px; padding: 8px; border: 2px dashed var(--gold-dim); border-radius: 10px; background: rgba(217,173,78,.04); align-content: start; }
.lane .car .rank { font-family: var(--title); font-weight: 900; font-size: 18px; color: var(--gold); width: 18px; }
.drophint { font-family: var(--type); font-size: 12px; color: var(--muted); padding: 12px 6px; text-align: center; }
.insert { height: 4px; border-radius: 2px; background: var(--gold); box-shadow: 0 0 10px var(--gold); }

/* ---------- missions 9 à 24 ---------- */
.doc { font-size: 15px; } .doc blockquote { margin: 10px 0; padding: 10px 14px; border-left: 3px solid var(--gold); background: var(--panel2); font-family: var(--type); }
.kitnote { background: rgba(217,173,78,.08); border: 1px dashed var(--gold-dim); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 14px 0 0; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.lock { display: grid; gap: 8px; } .lock div { display: flex; align-items: center; gap: 14px; background: var(--panel2); border-radius: 8px; padding: 8px 12px; }
.lock b { font-family: var(--type); font-size: 22px; letter-spacing: 6px; color: var(--gold); white-space: nowrap; } .lock span { font-size: 14px; }
.letter { background: #e9e2cf; color: #2a2118; border-radius: 6px; padding: 14px; font-family: Georgia, serif; font-style: italic; }
.letter p { margin: 4px 0; } .letter i { font-style: normal; font-family: var(--type); color: #a0522d; margin-right: 8px; font-size: 12px; }
.codeline { font-family: var(--type); font-size: 20px; letter-spacing: 3px; color: var(--gold); text-align: center; word-spacing: 6px; }
.alpha { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; margin-top: 10px; }
.alpha span { background: var(--panel); border-radius: 6px; text-align: center; padding: 3px 0; font-family: var(--title); font-weight: 700; }
.alpha i { display: block; font-style: normal; font-family: var(--type); font-size: 11px; color: var(--gold); font-weight: 400; }
.quotes { padding-left: 22px; font-size: 14px; } .quotes li { margin: 6px 0; }
.evidence { background: var(--panel2); border-left: 3px solid var(--red); border-radius: 6px; padding: 10px 12px; margin: 8px 0; display: grid; gap: 6px; font-size: 14px; }
.evidence select { font: inherit; padding: 10px; border-radius: 8px; background: #0a0e15; color: var(--text); border: 1px solid var(--line); font-size: 16px; }
.soles.noref { grid-template-columns: 1fr; } .trace.light { background: var(--panel2); }
.isle { fill: #7a9a4a; stroke: #d8c58a; stroke-width: 3; cursor: pointer; } .isle.sel { fill: var(--gold); stroke: #fff; }
.jig { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #000; }
.jig .tile { padding: 0; border: 0; background: none; } .jig .tile.sel { outline: 3px solid var(--gold); outline-offset: -3px; }
.mm-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; flex-wrap: wrap; } .mm-row b { width: 20px; font-family: var(--title); color: var(--muted); }
.mm-row em { font-style: normal; font-family: var(--type); font-size: 12px; color: var(--muted); margin-left: 6px; }
.peg { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); display: inline-block; padding: 0; }
.peg.empty { background: #0a0e15; border-style: dashed; } .mm-cur { border-top: 1px dashed var(--line); margin-top: 6px; }
.mm-pal { display: flex; gap: 10px; justify-content: center; margin: 14px 0 0; } .mm-pal .peg { width: 44px; height: 44px; }
.pen-score, .pen-seq { display: flex; gap: 6px; flex-wrap: wrap; } .pen-score { margin-bottom: 12px; }
.pen-score span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font-family: var(--title); font-size: 13px; color: var(--muted); }
.pen-score .cur { border-color: var(--gold); color: var(--gold); }
.pen-seq span { width: 34px; height: 34px; display: grid; place-items: center; background: var(--panel2); border-radius: 6px; font-size: 16px; } .pen-seq .next { background: var(--gold); color: #1a1305; font-weight: 900; }
.goal { display: grid; grid-template-columns: repeat(3, 1fr); border: 4px solid #eee; border-bottom: 0; border-radius: 6px 6px 0 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 2px, transparent 2px 12px), repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 2px, transparent 2px 12px), #16351f; }
.goal button { background: none; border: 0; border-right: 1px dashed rgba(255,255,255,.2); padding: 22px 4px; font-size: 26px; } .goal button:last-child { border: 0; }
.goal button span { display: block; font-size: 12px; font-family: var(--type); margin-top: 4px; } .goal button:hover { background: rgba(217,173,78,.15); }
.lantern { display: grid; place-items: center; padding: 20px; background: #0a0e15; border-radius: 12px; }
.lamp { width: 90px; height: 90px; border-radius: 50%; background: #2a2418; border: 4px solid #4a3f28; transition: background .04s, box-shadow .04s; }
.lamp.on { background: #ffe9a0; box-shadow: 0 0 60px 20px rgba(255,220,120,.7); }
.slow { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.morse-tab { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 4px 10px; font-size: 12px; } .morse-tab b { font-family: var(--title); color: var(--gold); display: inline-block; width: 16px; }
.sudo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; max-width: 300px; margin: auto; }
.sudo button { aspect-ratio: 1; font-size: 30px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 0; } .sudo .fix { background: #0a0e15; cursor: default; }
.sudo .br { margin-right: 8px; } .sudo .bb { margin-bottom: 8px; }
.hanoi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hpeg { height: 170px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; padding: 6px 4px; border: 1px solid var(--line); border-bottom: 6px solid #8a6f35; border-radius: 8px;
  background: linear-gradient(90deg, transparent calc(50% - 3px), #4a3f28 calc(50% - 3px), #4a3f28 calc(50% + 3px), transparent calc(50% + 3px)), var(--panel2); }
.hpeg.sel { border-color: var(--gold); } .disc { height: 20px; border-radius: 10px; background: linear-gradient(180deg, #f0cc7a, #b98d33); border: 1px solid #5a4a1a; transition: transform .15s; } .disc.up { transform: translateY(-14px); }
.syms { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 8px; } .syms svg { width: 34px; } .legend svg { max-width: 44px; }
.glyph { font-size: 26px; line-height: 1.2; display: inline-block; }
.maze { max-width: 420px; margin: auto; }
.dpad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: 56px 56px; gap: 6px; justify-content: center; margin: 12px 0; }
.dpad button { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; font-size: 20px; } .dpad button:first-child { grid-column: 2; }
.dpad button:nth-child(2) { grid-column: 1; grid-row: 2; } .dpad button:nth-child(3) { grid-column: 2; grid-row: 2; } .dpad button:nth-child(4) { grid-column: 3; grid-row: 2; }
.river { display: grid; grid-template-columns: 1fr 1.2fr 1fr; min-height: 150px; border-radius: 10px; overflow: hidden; }
.bank { background: #6b5a34; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; }
.bank button, .boat { font-size: 30px; background: rgba(0,0,0,.25); border: 2px solid transparent; border-radius: 10px; padding: 4px 8px; } .bank button:disabled { opacity: .55; }
.river .water { background: linear-gradient(180deg, #1d5a86, #0f3a5c); display: flex; align-items: center; padding: 8px; border-radius: 0; } .river .water.left { justify-content: flex-start; } .river .water.right { justify-content: flex-end; }
.jugs { display: flex; gap: 30px; justify-content: center; align-items: flex-end; margin: 10px 0 16px; }
.jug { width: 80px; border: 3px solid #b98d33; border-top: 0; border-radius: 0 0 14px 14px; position: relative; overflow: hidden; background: #0a0e15; }
.jug .lvl { position: absolute; bottom: 0; left: 0; right: 0; background: #2f7fb5; transition: height .3s; } .jug b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--type); }
.jug-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.blk { cursor: grab; } .mi { cursor: pointer; }
.newitem { display: flex; gap: 12px; align-items: center; background: rgba(79,174,123,.1); border: 1px solid #2f5c47; border-radius: 12px; padding: 12px 14px; margin: 12px auto; max-width: 560px; font-size: 14px; }
.newitem span { font-size: 30px; }
.diploma { max-width: 560px; margin: 24px auto; padding: 26px 20px; text-align: center; background: #e9e2cf; color: #2a2118; border: 6px double #8a6f35; border-radius: 6px; }
.diploma h1 { color: #8a2a2a; } .diploma .kicker { color: #8a6f35; } .diploma .sign { font-family: var(--type); margin-top: 18px; }
/* Mission 4 : texte à lire dans un vrai miroir */
.mirrortext { transform: scaleX(-1); background: #2a2f3a; border-radius: 10px; padding: 18px 12px; text-align: center; font-family: var(--title); font-weight: 700; letter-spacing: 2px; line-height: 1.7; font-size: clamp(16px, 4.6vw, 22px); color: #e0cf9f; }
.mirror .stage .tag { margin-top: 6px; }
.metro text { font-size: 14px; }

/* ---------- trousse ---------- */
.kit-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.72); display: flex; justify-content: center; align-items: flex-start; padding: 60px 12px 20px; overflow-y: auto; }
.kit { width: 100%; max-width: 560px; } .kit-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } .kit-head h2 { margin: 0; font-size: 18px; }
.kit details { border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; background: var(--panel2); }
.kit summary { padding: 12px 14px; cursor: pointer; font-weight: 600; list-style: none; display: flex; gap: 10px; align-items: center; } .kit summary span { font-size: 22px; }
.kit summary::-webkit-details-marker { display: none; }
.kit details[open] summary { border-bottom: 1px solid var(--line); color: var(--gold); }
.kit-body { padding: 12px 14px; font-size: 14px; } .kit-body .page { background: #e9e2cf; color: #2a2118; border-radius: 6px; padding: 10px 14px; margin: 8px 0; font-family: Georgia, serif; }
.kit-body .page h4 { margin: 0 0 6px; font-family: var(--type); color: #a0522d; font-weight: 400; } .kit-body .page .muted { color: #8a7a5a; font-style: italic; }
.kit-body .page .legend svg path { stroke: #5a3a12; } .kit-body .page .legend svg circle { fill: #5a3a12; }
.kin { width: 100%; padding: 10px; border-radius: 8px; background: #0a0e15; border: 1px solid var(--line); color: var(--text); font-family: var(--type); font-size: 16px; letter-spacing: 2px; text-transform: uppercase; margin-top: 4px; }
.kout { min-height: 28px; margin-top: 8px; font-family: var(--type); font-size: 18px; letter-spacing: 2px; color: var(--gold); word-break: break-word; }
/* lampe à ultraviolets */
.uv-only { visibility: hidden; }
body.uv .uv-only { visibility: visible; color: #8a4dff !important; text-shadow: 0 0 8px rgba(138,77,255,.6); }
body.uv .uv-only .codeline, body.uv .uv-only b { color: #c9a8ff; }
body.uv::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 60; box-shadow: inset 0 0 120px 30px rgba(120,60,255,.35); }
@media (max-width: 640px) { .choices { grid-template-columns: 1fr; } .jug-btns { grid-template-columns: 1fr; } .topbar-right { gap: 6px; } .agent { display: none; } .legend svg { max-width: 36px; } }

/* ---------- ESSAI : lieux à fouiller, trousseau, cadenas ---------- */
.scene-view { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.6); background: #000; }
.scene-view svg { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: manipulation; }
.scene .ping { fill: none; stroke: var(--gold); stroke-width: 3; stroke-dasharray: 6 5; animation: ping 1.4s ease-out forwards; pointer-events: none; }
@keyframes ping { from { opacity: 1; r: 8px; } to { opacity: 0; r: 40px; } }
.scene .ring { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0 0; }
.scene .slot { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; font-size: 12px; line-height: 1.2; border-radius: 10px; border: 1px solid var(--gold-dim); background: var(--panel2); color: var(--text); }
.scene .slot span { font-size: 26px; line-height: 1.1; }
.scene .slot.empty { border-style: dashed; border-color: var(--line); color: var(--muted); } .scene .slot.empty span { opacity: .4; font-family: var(--title); }
.scene .slot.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(217,173,78,.4); }
.scene .slot.gone { border-style: dashed; border-color: var(--line); color: var(--muted); text-decoration: line-through; } .scene .slot.gone span { filter: grayscale(1); opacity: .35; }
.said { min-height: 3em; margin: 12px 0 0; font-size: 14px; }
.said .note { display: block; background: #e9e2cf; color: #2a2118; font-family: Georgia, serif; border-radius: 4px; padding: 10px 14px; margin: 0 0 8px; transform: rotate(-.6deg); }
.said .note.tiny { font-size: 5px; line-height: 1.3; filter: blur(.6px); user-select: none; }
.zoom-box { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.padlock { display: grid; justify-items: center; }
.padlock .shackle { width: 120px; margin-bottom: -14px; transition: transform .5s cubic-bezier(.3,1.6,.5,1); transform-origin: 78% 100%; }
.padlock.open .shackle { transform: translateY(-16px) rotate(24deg); }
.padlock .body { position: relative; display: flex; gap: 8px; padding: 16px 18px; border-radius: 14px; margin-bottom: 14px;
  background: linear-gradient(100deg, #5a4210, #e8cc7c 35%, #b08a32 60%, #4a360c); box-shadow: inset 0 2px 0 rgba(255,255,255,.4), inset 0 -6px 12px rgba(0,0,0,.4), 0 10px 24px rgba(0,0,0,.5); }
.wheel { display: grid; justify-items: center; }
.wheel b { width: 44px; padding: 6px 0; text-align: center; font: 700 28px/1 var(--type); color: #f3ead2; background: linear-gradient(#000, #2a2a2a 50%, #000); border-radius: 6px; box-shadow: inset 0 0 6px #000; }
.wheel button { width: 44px; height: 34px; border: 0; background: none; color: #2a1e08; font-size: 16px; }
.wheel button:disabled { opacity: .3; }
.scene-view { position: relative; }
.scene-view svg { touch-action: pan-y; }
.scene-view svg.zoomed { touch-action: none; cursor: grab; }
.scene-view svg.zoomed:active { cursor: grabbing; }
.zoombar { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.zoombar button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--gold-dim); background: rgba(7,9,13,.75); color: var(--gold); font-size: 18px; line-height: 1; backdrop-filter: blur(4px); }
.zoomtip { font-size: 12px; margin: 6px 0 0; }
/* casiers + objets à usage unique */
.kit summary .once, .once { font-style: normal; font-size: 11px; font-weight: 400; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 1px 8px; margin-left: auto; }
.newitem.used { background: rgba(141,149,163,.08); border-color: var(--line); } .newitem.used span { filter: grayscale(1); opacity: .6; }
.lockers { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 14px 10px 10px; border-radius: 12px;
  background: linear-gradient(#20262f, #12161c); box-shadow: inset 0 -10px 18px rgba(0,0,0,.5); }
.locker { position: relative; aspect-ratio: 1 / 2.6; border-radius: 4px; border: 1px solid #0b0e12; padding: 0;
  background: linear-gradient(90deg, #3d5468, #7d97ad 30%, #58718a 60%, #2c3d4d); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 8px rgba(0,0,0,.5); transition: transform .5s; transform-origin: left center; }
.locker .vent { position: absolute; left: 22%; right: 22%; top: 8%; height: 16%; background: repeating-linear-gradient(#1b2631 0 2px, transparent 2px 5px); border-radius: 2px; }
.locker .num { position: absolute; left: 0; right: 0; top: 30%; font: 700 14px var(--type); color: #f3ead2; text-shadow: 0 1px 0 #000; }
.locker .handle { position: absolute; right: 14%; top: 52%; width: 5px; height: 18%; border-radius: 3px; background: linear-gradient(90deg, #6b4e16, #f0d98c, #6b4e16); }
.locker.open { transform: perspective(300px) rotateY(-62deg); }
.locker:disabled { opacity: 1; cursor: default; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pk { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); font-size: 13px; }
.pk span { font-size: 20px; } .pk.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.lockers-wrap .said { min-height: 2.5em; font-size: 14px; }
.scene .letterslot span { font-family: var(--title); font-weight: 900; color: var(--gold); }
.scene .slot.empty.letterslot span { color: var(--muted); }
@media (max-width: 420px) { .scene .slot { font-size: 11px; padding: 6px 2px; } .scene .slot span { font-size: 22px; } }
.targets { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.target { display: grid; justify-items: center; gap: 4px; padding: 14px 6px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(var(--panel2), var(--panel)); font-size: 13px; line-height: 1.25; transition: transform .2s, border-color .2s; }
.target span { font-size: 34px; line-height: 1; }
.target.open { border-color: var(--green); box-shadow: 0 0 0 2px var(--green), 0 0 22px rgba(79,174,123,.35); transform: scale(1.04); }
.target:disabled { opacity: 1; cursor: default; }
/* trousse en tuiles compactes dans les épreuves « utiliser un objet » */
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.pk { flex-direction: column; justify-content: flex-start; gap: 2px; padding: 6px 4px; font-size: 11px; line-height: 1.2; text-align: center; }
.pk span { font-size: 22px; }
.scene .slot.kitem { border-color: #3d6a8a; } .scene .slot.kitem::after { content: 'trousse'; font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.scene .ring { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
/* fil de mission : programme, objectif, transitions */
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 0 auto 14px; max-width: 560px; }
.plan ol { margin: 6px 0 0; padding-left: 22px; } .plan li { margin: 3px 0; }
.goal { display: flex; gap: 10px; align-items: baseline; background: rgba(217,173,78,.08); border: 1px solid var(--gold-dim); border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; font-size: 15px; }
.goal b { flex: none; font-family: var(--type); font-weight: 400; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); }
.transition { display: grid; gap: 12px; }
.tr-ok { margin: 0; font-family: var(--title); font-weight: 700; color: #6fd6a8; letter-spacing: 1px; }
.transition .dialog { margin: 0; } .transition .bubble { animation: none; opacity: 1; }
.tr-said { margin: 0; background: var(--panel2); border-left: 3px solid #6fd6a8; padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.tr-next { border: 1px dashed var(--gold-dim); border-radius: 10px; padding: 10px 14px; }
.tr-next span { display: block; font-family: var(--type); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.tr-next b { font-family: var(--title); color: var(--gold); } .tr-next p { margin: 4px 0 0; font-size: 14px; }
.stepbar { flex-wrap: wrap; } .stepbar em { flex-basis: 100%; margin: 4px 0 0; }
@media (min-width: 560px) { .stepbar em { flex-basis: auto; margin: 0 0 0 6px; } }
/* carte UV : morceaux de message qui restent allumés */
.uv2 { height: 260px; touch-action: none; }
.uv2 .words { position: absolute; inset: 0; pointer-events: none; }
.uv2 .words span { position: absolute; font-family: var(--title); font-weight: 900; letter-spacing: 1px; white-space: nowrap; color: transparent; transition: color .4s, text-shadow .4s; }
.uv2 .words span.seen { color: #b98aff; text-shadow: 0 0 10px rgba(160,100,255,.8); }
.uv2 .beam { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle 46px at var(--x, -200px) var(--y, -200px), rgba(150,90,255,.28), transparent 70%); }
.note-uv { background: #1a0b33; color: #d9c2ff; border-radius: 8px; padding: 12px 14px; font-family: Georgia, serif; font-size: 16px; margin: 12px 0 0; }
.note-uv span { font-size: 13px; color: #a88bd6; }
@media (max-width: 420px) { .uv2 .words span { font-size: 15px !important; } }
.uv2 .secret { background: rgba(70,25,150,.22); }
.uv2 .words span.seen { color: #6a2cf0; text-shadow: 0 0 6px rgba(140,80,255,.9), 0 0 16px rgba(140,80,255,.5); }
.uv2 .beam { background: radial-gradient(circle 52px at var(--x, -200px) var(--y, -200px), rgba(140,80,255,.35), rgba(140,80,255,.12) 55%, transparent 75%); }
[hidden] { display: none !important; }

/* ---------- Mode immersif des lieux à fouiller ---------- */
.room-enter { position: relative; display: grid; place-items: end start; width: 100%; aspect-ratio: 16 / 9; max-height: 260px; padding: 16px; border: 1px solid var(--gold-dim); border-radius: 14px; overflow: hidden; background: #000; text-align: left; }
.room-enter .room-thumb { position: absolute; inset: 0; } .room-enter .room-thumb svg { width: 100%; height: 100%; object-fit: cover; filter: brightness(.55) blur(1px); }
.room-enter b, .room-enter > span:last-child { position: relative; text-shadow: 0 2px 8px #000; }
.room-enter b { font-family: var(--title); font-size: 18px; color: var(--gold); }
.room-enter > span:last-child { font-family: var(--type); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; }
body.in-room { overflow: hidden; }
.room { position: fixed; inset: 0; z-index: 40; background: #000; display: grid; grid-template-rows: 1fr auto; animation: roomIn .6s ease-out; }
@keyframes roomIn { from { opacity: 0; } to { opacity: 1; } }
.room-stage { position: relative; min-height: 0; }
.room-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.room-stage svg:active { cursor: grabbing; }
.room-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px;
  background: linear-gradient(rgba(0,0,0,.75), transparent); pointer-events: none; }
.room-title { font-family: var(--title); color: var(--gold); letter-spacing: 1.5px; font-size: 14px; text-shadow: 0 1px 6px #000; }
.room-btns { display: flex; gap: 6px; pointer-events: auto; }
.room-btns button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(217,173,78,.5); background: rgba(10,12,18,.7); color: var(--gold); font-size: 16px; backdrop-filter: blur(4px); }
.room-sub { position: absolute; left: 50%; bottom: calc(var(--tray, 104px) + 12px); transform: translateX(-50%); width: min(92vw, 640px); margin: 0; padding: 10px 14px; border-radius: 10px;
  background: rgba(8,10,16,.82); border: 1px solid rgba(217,173,78,.25); font-size: 14px; line-height: 1.45; opacity: 0; pointer-events: none; backdrop-filter: blur(6px); }
.room-sub.show { animation: sub .5s ease-out forwards; }
@keyframes sub { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.room-sub .note { margin-bottom: 4px; }
.room-tray { --tray: 104px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(#1a140c, #0d0a06); border-top: 2px solid #5a4422; box-shadow: 0 -10px 30px rgba(0,0,0,.6); }
.room-tray .ring { display: flex; gap: 8px; overflow-x: auto; margin: 0; padding-bottom: 2px; scrollbar-width: none; }
.room-tray .slot { flex: none; width: 76px; display: grid; justify-items: center; gap: 2px; padding: 8px 4px; font-size: 11px; line-height: 1.2; border-radius: 10px;
  border: 1px solid #6a5230; background: radial-gradient(circle at 50% 30%, #2a2014, #120d07); color: var(--text); box-shadow: inset 0 2px 6px rgba(0,0,0,.6); }
.room-tray .slot span { font-size: 26px; line-height: 1.1; }
.room-tray .slot.empty { border-style: dashed; border-color: #3a2e1c; color: #6a5d48; } .room-tray .slot.empty span { opacity: .35; font-family: var(--title); }
.room-tray .slot.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(217,173,78,.5); transform: translateY(-4px); }
.room-tray .slot.gone { opacity: .45; text-decoration: line-through; } .room-tray .slot.gone span { filter: grayscale(1); }
.room-tray .slot.kitem { border-color: #3d6a8a; }
.room-tray .letterslot span { font-family: var(--title); font-weight: 900; color: var(--gold); }
.room-modal { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.72); backdrop-filter: blur(3px); animation: roomIn .35s ease-out; }
.room-modal .zoom { width: min(100%, 460px); background: linear-gradient(#1a2230, #0d121a); border: 1px solid var(--gold-dim); border-radius: 16px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.8); max-height: 90vh; overflow-y: auto; }
.room-modal .zoom h3 { color: var(--gold); }
.kit-overlay { z-index: 60; }
/* cadenas qu'on fait rouler au doigt */
.padlock .wheel .drum { display: grid; justify-items: center; width: 50px; height: 92px; overflow: hidden; border-radius: 8px; cursor: ns-resize; touch-action: none; user-select: none;
  background: linear-gradient(#000, #3a3a3a 30%, #555 50%, #3a3a3a 70%, #000); box-shadow: inset 0 0 8px #000, 0 1px 0 rgba(255,255,255,.3); }
.padlock .wheel .drum b { width: auto; padding: 0; background: none; box-shadow: none; font: 700 30px/1.2 var(--type); color: #f3ead2; }
.padlock .wheel .drum span { font: 700 18px/1.4 var(--type); color: #8a8578; opacity: .6; }
.padlock .wheel button { height: 30px; }
.padlock.open .body { box-shadow: inset 0 2px 0 rgba(255,255,255,.4), 0 0 40px rgba(111,214,168,.6); }
.padhint { font-size: 12px; margin: 0; }
#padclose { margin-top: 10px; }
.room-sub .sub-todo { display: inline-block; margin-top: 6px; color: var(--gold); font-size: 13px; }
.room .ping { fill: none; stroke: var(--gold); stroke-width: 3; stroke-dasharray: 6 5; animation: ping 1.4s ease-out forwards; pointer-events: none; }
/* carnet de route */
.route { max-width: 560px; margin: 16px auto; background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 14px; padding: 14px 16px; }
.route h3 { color: var(--gold); margin: 2px 0 10px; }
.route p { font-size: 14px; margin: 8px 0 0; } .route p b { color: var(--gold); font-weight: 600; }
.route-map { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; border: 1px solid var(--line); background: #071019; }
.route-map .leg { stroke-dasharray: 100; stroke-dashoffset: 100; animation: leg 2.2s .4s ease-in-out forwards; }
@keyframes leg { to { stroke-dashoffset: 0; } }
.route-map .pulse { transform-box: fill-box; transform-origin: center; animation: rpulse 1.8s ease-out infinite; }
@keyframes rpulse { from { transform: scale(1); opacity: 1; } to { transform: scale(3.5); opacity: 0; } }
.arrival { max-width: 640px; margin: 0 0 14px; background: rgba(217,173,78,.07); border: 1px solid var(--gold-dim); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.arrival summary { cursor: pointer; } .arrival summary b { color: var(--gold); } .arrival p { margin: 8px 0 2px; }
.route-list { font-size: 13px; padding-left: 20px; margin: 10px 0 0; } .route-list li { margin: 3px 0; }
.cesar .stage { transition: box-shadow .5s, border-color .5s; }
.cesar .stage.readable { border-color: var(--green); box-shadow: 0 0 0 2px var(--green), 0 0 30px rgba(79,174,123,.45); }
.cesar .stage.readable .msg { color: #b8f0d2; }
.uv2:not(.lamp-on) .beam, .uv2:not(.lamp-on) .secret { display: none; }
.uv2:not(.lamp-on) { cursor: pointer; }
.pk.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.uvsaid { min-height: 1.6em; font-size: 14px; margin: 10px 0 0; }
/* v2 : encre invisible, gros plans, molettes à symboles, boussole */
.uvink { display: none; }
.room svg.uvmode .uvink { display: inline; }
.room svg .uvveil { fill: #3a0c7a; opacity: 0; mix-blend-mode: multiply; transition: opacity .4s; }
.room svg.uvmode .uvveil { opacity: .45; }
.room svg.uvmode { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='20' cy='20' r='16' fill='%23a070ff' fill-opacity='.35'/%3E%3C/svg%3E") 20 20, crosshair; }
.puzzle .closeup, #pz.closeup { position: relative; }
#pz.closeup { isolation: isolate; }
#pz .backdrop { position: absolute; inset: -18px; z-index: -1; border-radius: var(--radius); overflow: hidden; }
#pz .backdrop svg { width: 100%; height: 100%; filter: blur(2px) brightness(.45) saturate(1.1); }
#pz.closeup .step > div, #pz.closeup .lockstep, #pz.closeup .compass { background: rgba(10,14,22,.72); border-radius: 12px; padding: 12px; backdrop-filter: blur(3px); }
.lockstep h3, .compass h3 { color: var(--gold); }
.padlock.symbols .drum b { font-size: 26px; } .padlock.symbols .drum span { font-size: 16px; }
.padlock.many .body { gap: 4px; padding: 12px 10px; } .padlock.many .wheel .drum { width: 34px; } .padlock.many .drum b { font-size: 22px; } .padlock.many .wheel button { width: 34px; }
.compass .cp-svg { display: block; width: min(100%, 380px); margin: 0 auto; }
.compass .cp-slot { cursor: pointer; }
.room-modal .closeup .pz > div { max-width: 100%; }
.room-modal .zoom:has(.closeup) { width: min(100%, 640px); }
.padlock.dial .shackle { display: none; }
.padlock.dial .body { border-radius: 50%; padding: 34px; background: radial-gradient(circle at 40% 35%, #f3d98a, #b08a32 45%, #5a4210 80%); box-shadow: 0 0 0 6px #3a2a08, 0 10px 30px rgba(0,0,0,.6), inset 0 0 20px rgba(0,0,0,.4); }
.padlock.dial .padhint::before { content: '⚙ '; }
#lidgo { display: block; margin: 12px auto 0; }
.cesar.onlid svg { filter: drop-shadow(0 0 0 transparent); transition: filter .4s; }
.cesar svg.set { filter: drop-shadow(0 0 18px rgba(111,214,168,.8)); }
.cesar.onlid .stage .msg { font-size: 1.05em; }
/* croix de retour vers le lieu, sur les gros plans */
.cu-close { position: absolute; top: 10px; right: 10px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(217,173,78,.6);
  background: rgba(10,12,18,.8); color: var(--gold); font-size: 18px; line-height: 1; backdrop-filter: blur(4px); }
.cu-close:hover { border-color: var(--gold); box-shadow: 0 0 14px rgba(217,173,78,.4); }
#pz.closeup .stepbar { padding-right: 52px; }
.zoom-box { position: relative; } .zoom-box .cu-close.in-modal { top: -6px; right: -6px; width: 34px; height: 34px; font-size: 15px; }
.zoom-box h3 { padding-right: 36px; }
.room-view .room-title { display: none; }
.lidnote { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: rgba(111,214,168,.12); border: 1px solid var(--green); font-size: 15px; animation: sub .5s ease-out; }
.room-tray .slot.empty.wanted { border-color: var(--gold); color: var(--gold); animation: pulse 2s infinite; }
/* console de surveillance */
.cctv-screen { position: relative; border-radius: 10px; overflow: hidden; border: 3px solid #1a1d22; box-shadow: inset 0 0 40px #000; background: #000; }
.cctv-screen svg { display: block; width: 100%; aspect-ratio: 16 / 10; filter: grayscale(.85) contrast(1.15) brightness(.85) sepia(.15) hue-rotate(60deg); }
.cctv-screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 2px, transparent 2px 4px); }
.cctv-screen.frozen svg { filter: grayscale(.4) contrast(1.2) brightness(.95) sepia(.2); }
.cctv-hud { position: absolute; top: 8px; left: 10px; right: 10px; display: flex; gap: 12px; align-items: center; font: 12px/1 var(--type); color: #d8f0d8; text-shadow: 0 0 4px #000; }
.cctv-hud .rec { color: #ff5a4a; animation: pulse 1.2s infinite; } .cctv-hud b { margin-left: auto; font-size: 16px; }
.cctv-slider { width: 100%; margin: 12px 0 4px; accent-color: var(--gold); }
.cctv-nav { justify-content: center; }
.cctv-export { margin-top: 14px; }
.padlock.console .shackle { display: none; }
.padlock.console .body { background: linear-gradient(#2a2f38, #14171c); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 8px 20px rgba(0,0,0,.5); }
/* messages des lieux : réductibles en bulle */
.room-subwrap { position: absolute; left: 50%; bottom: calc(var(--tray, 104px) + 12px); transform: translateX(-50%); width: min(92vw, 640px); }
.room-subwrap .room-sub { position: relative; left: auto; bottom: auto; transform: none; width: auto; padding-right: 44px; }
.room-subwrap .room-sub.show { animation: subin .5s ease-out forwards; }
@keyframes subin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sub-min { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(217,173,78,.5); background: rgba(10,12,18,.8); color: var(--gold); font-size: 16px; line-height: 1; }
.room-subwrap:has(.room-sub:empty), .room-subwrap:not(:has(.room-sub.show)) .sub-min { display: none; }
.sub-pill { position: absolute; left: 12px; bottom: calc(var(--tray, 104px) + 12px); width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--gold); background: rgba(10,12,18,.85); font-size: 20px; box-shadow: 0 0 14px rgba(217,173,78,.35); }
/* éclat discret sur les objets à ramasser */
.room svg .glint { opacity: 0; transform-box: fill-box; animation: glint 7s ease-in-out infinite; }
@keyframes glint { 0%, 88%, 100% { opacity: 0; } 92% { opacity: .95; } 95% { opacity: .2; } }
/* le message laisse passer les touchers vers le décor ; seul son bouton ▾ est cliquable */
.room-subwrap { pointer-events: none; }
.room-subwrap .sub-min { pointer-events: auto; }
/* trousseau : flèches quand il déborde */
.room-tray { position: relative; }
.tray-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 30px; height: 56px; border: 1px solid #6a5230; border-radius: 10px;
  background: rgba(26,20,12,.95); color: var(--gold); font-size: 26px; line-height: 1; box-shadow: 0 0 14px rgba(0,0,0,.8); }
.tray-arrow.left { left: 4px; } .tray-arrow.right { right: 4px; }
.room-tray .ring { cursor: grab; scroll-behavior: smooth; }
/* le trousseau ne doit jamais dépasser l'écran : il défile à l'intérieur */
.room { grid-template-columns: minmax(0, 1fr); }
.room-tray { min-width: 0; }
.room-tray .ring { min-width: 0; max-width: 100%; }
/* écran de fin de mission */
.brief-fold { max-width: 640px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--panel); }
.brief-fold summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.brief-fold[open] summary { margin-bottom: 8px; }
.done-head { text-align: center; margin: 8px 0 12px; } .done-head h2 { color: #6fd6a8; margin: 2px 0 0; }
.found { max-width: 560px; margin: 0 auto 18px; display: grid; gap: 8px; }
.found .kicker, .debrief { text-align: center; margin: 4px 0; }
.reward.inline { display: flex; align-items: center; gap: 14px; text-align: left; background: rgba(217,173,78,.08); border: 1px solid var(--gold-dim); border-radius: 12px; padding: 10px 14px; margin: 0; }
.reward.inline .tile { width: 48px; height: 48px; font-size: 26px; flex: none; }
.found .newitem { width: 100%; max-width: none; margin: 0; }
