/* FRAGMENTS — écrans : création, lobby, console MJ et serrure, onglets, surcouches, fin, vue joueur (suite de app.css). */
/* sélection du scénario */
.dossiers { display: grid; gap: 12px; }
.dossier {
  text-align: left; display: grid; grid-template-columns: 64px 1fr; gap: 0 14px; align-items: center; padding: 14px; border-radius: 12px;
  background: var(--desk-2); box-shadow: inset 0 0 0 1.5px var(--rule);
}
.dossier[aria-pressed='true'] { box-shadow: inset 0 0 0 2px var(--glow), 0 0 26px -10px var(--glow); background: var(--desk-3); }
.dossier .seal { grid-row: 1 / 4; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--ink); }
.dossier .seal svg { width: 34px; height: 34px; stroke: var(--ink); fill: none; stroke-width: 1.8; }
.dossier[data-theme='train'] .seal { background: #e2c88d; }
.dossier[data-theme='manoir'] .seal { background: #cfc0e0; }
.dossier b { font-family: var(--f-stencil); font-size: 26px; font-weight: 900; line-height: 1.05; }
.dossier i { font-style: normal; color: var(--chalk-dim); font-size: 16px; }
.dossier small { color: var(--glow); font-size: 15px; font-weight: 600; }
.counter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.counter button { height: 64px; border-radius: 12px; font-family: var(--f-stencil); font-size: 34px; font-weight: 900; background: var(--desk-2); box-shadow: inset 0 0 0 1.5px var(--rule); }
.counter button[aria-pressed='true'] { background: var(--glow); color: #241a08; box-shadow: 0 0 20px -6px var(--glow); }
.toggle { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 19px; }
.toggle span { flex: 1; }
.toggle small { display: block; color: var(--chalk-dim); font-size: 15px; }
.switch { position: relative; width: 58px; height: 32px; border-radius: 16px; background: var(--desk-3); box-shadow: inset 0 0 0 1.5px var(--rule); flex: none; }
.switch::after { content: ''; position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--chalk-dim); transition: transform .2s, background .2s; }
.switch[aria-checked='true'] { background: var(--glow-dim); }
.switch[aria-checked='true']::after { transform: translateX(26px); background: var(--glow); box-shadow: 0 0 10px var(--glow); }

.codefield {
  width: 100%; height: 72px; border-radius: 12px; border: 0; text-align: center; text-transform: uppercase;
  font-family: var(--f-stencil); font-weight: 900; font-size: 38px; letter-spacing: .12em;
  background: #0f130e; color: var(--glow); box-shadow: inset 0 3px 10px rgba(0, 0, 0, .7), inset 0 0 0 1.5px var(--rule);
  text-shadow: 0 0 12px var(--glow);
}
.codefield::placeholder { color: #7e5d2b; text-shadow: none; }
.err { color: #ff8f84; font-size: 16px; min-height: 22px; margin-top: 6px; }

/* ---------- lobby MJ ---------- */
.ticket-code { margin: 6px auto 0; text-align: center; }
.ticket-code .big { font-family: var(--f-stencil); font-weight: 900; font-size: 46px; letter-spacing: .08em; color: var(--glow); text-shadow: 0 0 18px var(--glow); }
.qr { width: 210px; height: 210px; margin: 10px auto; padding: 10px; background: var(--paper); border-radius: 6px; transform: rotate(-1.2deg); box-shadow: 0 16px 30px -14px #000; }
.qr svg { width: 100%; height: 100%; display: block; }
.intro { font-family: var(--f-type); font-size: 17px; line-height: 1.55; color: var(--paper); background: rgba(0, 0, 0, .22); padding: 16px; border-left: 3px solid var(--glow); border-radius: 0 8px 8px 0; }
.intro p { margin: 0 0 10px; }
.intro p:last-child { margin: 0; }

/* ---------- console MJ ---------- */
.vfd {
  position: relative; margin: 2px 0 12px; padding: 14px 16px 10px; border-radius: 14px;
  background: linear-gradient(180deg, #0e110d, #151a13); box-shadow: inset 0 2px 12px #000, 0 0 0 1.5px var(--rule), 0 1px 0 4px var(--desk-2);
}
body[data-theme='train'] .vfd { background: linear-gradient(180deg, #120a0d, #1b1014); }
body[data-theme='manoir'] .vfd { background: linear-gradient(180deg, #0f0b13, #17111c); }
.vfd .time { position: relative; text-align: center; font-family: var(--f-ui); font-weight: 800; font-size: 96px; line-height: .95; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.vfd .time .ghost { position: absolute; inset: 0; color: var(--glow-ghost); }
.vfd .time .live { position: relative; color: var(--glow); text-shadow: 0 0 6px var(--glow), 0 0 28px color-mix(in srgb, var(--glow) 60%, transparent); }
.vfd.low .time .live { color: #ff6a55; text-shadow: 0 0 6px #ff6a55, 0 0 28px #ff2a10; animation: pulse 1s infinite; }
.vfd.paused .time .live { animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }
@keyframes pulse { 50% { opacity: .7; } }
.vfd .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; color: var(--chalk-dim); font-size: 15px; }
.pips { display: flex; gap: 7px; }
.pip { width: 14px; height: 14px; border-radius: 50%; background: #2a2f27; box-shadow: inset 0 1px 2px #000; }
.pip.done { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.pip.now { background: var(--glow); box-shadow: 0 0 10px var(--glow); animation: pulse 1.6s infinite; }
.stage-head { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 2px; }
.stage-head .n { font-family: var(--f-stencil); font-weight: 900; font-size: 18px; color: var(--glow); }
.stage-head h3 { margin: 0; font-family: var(--f-stencil); font-weight: 900; font-size: 30px; line-height: 1.05; }
.prompt { color: var(--chalk-dim); font-size: 17px; margin: 0 0 10px; }
.prompt a.legal { display: inline-block; padding: 10px 0; color: var(--glow); }

/* serrure */
.lock { border-radius: 16px; padding: 14px; background: linear-gradient(180deg, #3b3f37, #2a2d27); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 18px 30px -18px #000; }
body[data-theme='train'] .lock { background: linear-gradient(180deg, #5a4630, #3c2e1f); }
body[data-theme='manoir'] .lock { background: linear-gradient(180deg, #403448, #2b2231); }
.slots { display: flex; justify-content: center; gap: 6px; padding: 12px 8px; border-radius: 10px; background: #0d0f0c; box-shadow: inset 0 2px 8px #000; min-height: 66px; flex-wrap: wrap; }
.slot { width: 34px; height: 44px; display: grid; place-items: center; border-bottom: 2px solid #3e4639; font-family: var(--f-stencil); font-weight: 900; font-size: 34px; color: var(--glow); text-shadow: 0 0 10px var(--glow); }
.slot.cur { border-color: var(--glow); }
.slots.wrong { animation: shake .4s; }
.slots.wrong .slot { color: #ff6a55; text-shadow: 0 0 10px #ff2a10; }
.slots.right .slot { color: var(--ok); text-shadow: 0 0 12px var(--ok); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.keys { display: grid; gap: 7px; margin-top: 12px; }
.keys.digits { grid-template-columns: repeat(3, 1fr); }
.keys.letters { grid-template-columns: repeat(10, 1fr); gap: 5px; }
.key {
  height: 58px; border-radius: 10px; font-family: var(--f-stencil); font-weight: 900; font-size: 28px; color: #e9e6da;
  background: linear-gradient(180deg, #5a5f55, #44483f); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 -3px 0 rgba(0, 0, 0, .35), 0 3px 4px -2px #000;
}
.keys.letters .key { height: 50px; font-size: 21px; border-radius: 7px; }
.key:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 2px #000; background: linear-gradient(180deg, #4b5047, #3a3e36); }
.key.fn { font-family: var(--f-ui); font-size: 17px; font-weight: 800; }
.key.go { background: linear-gradient(180deg, #e5a845, #b67d23); color: #241a08; }
.keys.letters .key.wide { grid-column: span 2; }
.keys.letters .key.wide3 { grid-column: span 3; }

.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tools .btn { min-height: 50px; font-size: 18px; }
.hintbox { margin-top: 12px; display: grid; gap: 8px; }
.hint { font-family: var(--f-type); font-size: 16px; color: var(--ink); background: #f3e7a6; padding: 12px 14px 12px 40px; position: relative; transform: rotate(-.4deg); box-shadow: 0 8px 14px -10px #000; }
.hint:nth-child(2) { transform: rotate(.5deg); }
.hint::before { content: attr(data-n); position: absolute; left: 12px; top: 10px; font-family: var(--f-stencil); font-weight: 900; color: var(--red); font-size: 20px; }

/* onglets mode MJ joueur / solo */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -18px 12px; padding: 0 18px 2px; scrollbar-width: none; }
.tabs button { flex: none; padding: 9px 16px; border-radius: 999px; font-weight: 800; font-size: 16px; color: var(--chalk-dim); box-shadow: inset 0 0 0 1.5px var(--rule); }
.tabs button[aria-selected='true'] { background: var(--chalk); color: var(--desk); box-shadow: none; }

/* ---------- surcouches ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5, 6, 4, .82); backdrop-filter: blur(3px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.card { width: 100%; max-width: 440px; border-radius: 16px; padding: 24px 20px; background: var(--desk-2); box-shadow: 0 0 0 1.5px var(--rule), 0 30px 60px -20px #000; }
.card h3 { margin: 0 0 8px; font-family: var(--f-stencil); font-weight: 900; font-size: 32px; }
.card p { margin: 0 0 14px; color: var(--chalk-dim); }
.password { margin: 8px 0 18px; padding: 18px 10px; text-align: center; background: var(--paper); color: var(--ink); font-family: var(--f-stencil); font-weight: 900; font-size: 40px; letter-spacing: .14em; transform: rotate(-1deg); box-shadow: 0 14px 24px -12px #000; position: relative; }
.password::after { content: ''; position: absolute; left: 50%; top: -10px; width: 80px; height: 22px; margin-left: -40px; background: rgba(240, 230, 200, .55); transform: rotate(3deg); }

/* ---------- fin ---------- */
.end { text-align: center; justify-content: center; gap: 4px; }
.end .verdict { font-family: var(--f-stencil); font-weight: 900; font-size: 54px; line-height: 1; margin: 10px 0 4px; }
.stars { display: flex; justify-content: center; gap: 10px; margin: 16px 0; }
.stars svg { width: 62px; height: 62px; }
.stars .on path { fill: var(--glow); stroke: var(--glow); }
.stars .on svg { overflow: visible; filter: drop-shadow(0 0 8px var(--glow)); }
.stars .off path { fill: none; stroke: var(--rule); stroke-width: 1.5; }
.stars span { animation: star-in .6s cubic-bezier(.2, 1.4, .4, 1) backwards; }
.stars span:nth-child(2) { animation-delay: .25s; }
.stars span:nth-child(3) { animation-delay: .5s; }
@keyframes star-in { from { transform: scale(0) rotate(-60deg); opacity: 0; } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 18px; }
.stats div { padding: 12px 6px; border-radius: 10px; background: var(--desk-2); }
.stats b { display: block; font-family: var(--f-stencil); font-weight: 900; font-size: 30px; color: var(--glow); }
.stats small { color: var(--chalk-dim); font-size: 15px; }
.share-text { font-family: var(--f-type); font-size: 15px; background: rgba(0, 0, 0, .3); padding: 12px; border-radius: 8px; margin-bottom: 14px; color: var(--paper); }

/* ---------- vue joueur ---------- */
.pl-head { display: flex; align-items: center; gap: 10px; }
.pl-head .badge { font-family: var(--f-stencil); font-weight: 900; font-size: 20px; color: #241a08; background: var(--glow); padding: 4px 10px; border-radius: 6px; }
.pl-head .what { flex: 1; min-width: 0; }
.pl-head .what small { display: block; color: var(--chalk-dim); font-size: 15px; }
.pl-head .what b { display: block; font-family: var(--f-stencil); font-weight: 900; font-size: 24px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; margin: 12px -18px 0; padding: 8px 18px 14px; scrollbar-width: none; flex: 1; align-items: flex-start; }
.deck::-webkit-scrollbar { display: none; }
.deck > .doc { scroll-snap-align: center; flex: 0 0 calc(100% - 8px); }
.dots { display: flex; justify-content: center; gap: 8px; min-height: 12px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); transition: background .2s, transform .2s; }
.dots i.on { background: var(--glow); transform: scale(1.3); }
.passbar { display: flex; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--rule); }
.passbar input { flex: 1; min-width: 0; height: 56px; padding: 0 14px; border-radius: 12px; border: 0; text-transform: uppercase; letter-spacing: .1em; font-family: var(--f-stencil); font-weight: 900; font-size: 24px; background: #0f130e; color: var(--glow); box-shadow: inset 0 2px 8px #000, inset 0 0 0 1.5px var(--rule); }
.passbar input::placeholder { color: var(--chalk-dim); letter-spacing: 0; font-family: var(--f-ui); font-weight: 600; font-size: 17px; text-transform: none; }
.passbar .btn { min-height: 56px; padding: 0 18px; width: auto; }
