/* Escape game « Mission : sauver l'entreprise » */
.esc { --esc-ink: #0f172a; --esc-muted: #64748b; --esc-line: #e2e8f0; --esc-accent: #0891b2; --esc-accent-dark: #0e7490;
  --esc-ok: #15803d; --esc-ok-bg: #f0fdf4; --esc-ko: #b91c1c; --esc-ko-bg: #fef2f2; --esc-night: #0b1220;
  color: var(--esc-ink); font-size: 1rem; background: var(--site-bg, #f1f5f9); min-height: 70vh; }   /* fond : dégradé de Typographie */
.esc *, .esc *::before, .esc *::after { box-sizing: border-box; }
.esc-wrap { max-width: 1320px; margin: 0 auto; padding: 0 2rem; }   /* même largeur que l'en-tête du site (.nav-inner) */
.esc-hero { background: radial-gradient(circle at 80% 0%, #164e63 0%, var(--esc-night) 60%); color: #e2e8f0; padding: 2.2rem 0 1.6rem; }
.esc-kicker { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: #67e8f9; margin: 0 0 .4rem; font-weight: 700; }
.esc-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; margin: 0; color: #fff; }
.esc-hud { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; margin-top: 1.1rem; font-size: .9rem; }
.esc-hud > div { display: flex; align-items: center; gap: .35rem; }
.esc-hud strong { font-variant-numeric: tabular-nums; font-size: 1.05rem; color: #fff; }
.esc-hud span { color: #94a3b8; }
.esc-hud .is-short strong { color: #fbbf24; }
.esc-hud .is-late strong { color: #f87171; }
.esc-inv { margin-left: auto; display: flex; gap: .4rem; }
.esc-inv-item { display: inline-flex; align-items: center; gap: .3rem; background: rgba(103, 232, 249, .12); border: 1px solid rgba(103, 232, 249, .35); border-radius: 8px; padding: .2rem .5rem; color: #a5f3fc; }
.esc-inv-item b { color: #fff; font-size: 1rem; }
.esc-body { padding-top: 1.5rem; padding-bottom: 3rem; }
.esc-card { background: #fff; border: 1px solid var(--esc-line); border-radius: 16px; padding: clamp(1.2rem, 3vw, 2rem); box-shadow: 0 6px 24px rgba(15, 23, 42, .06); }
.esc-h, .esc-q { font-size: 1.3rem; font-weight: 800; margin: 0 0 .6rem; }
.esc-q { margin-top: 1rem; }
.esc-muted { color: var(--esc-muted); }
.esc .small { font-size: .85rem; }
.esc-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.esc-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .7rem 1.2rem; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff;
  color: var(--esc-ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.esc-btn:hover { border-color: var(--esc-accent); color: var(--esc-accent-dark); }
.esc-btn.primary { background: var(--esc-accent); border-color: var(--esc-accent); color: #fff; }
.esc-btn.primary:hover { background: var(--esc-accent-dark); color: #fff; }
.esc-btn.ghost { background: transparent; }
.esc button:focus-visible, .esc a:focus-visible, .esc input:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }

/* Intro */
.esc-intro { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 860px) { .esc-intro { grid-template-columns: 1.5fr 1fr; } }
.esc-intro h2 { font-size: 1.5rem; font-weight: 800; margin: 0 0 .8rem; }
.esc-rules { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .5rem; }
.esc-rules i { color: var(--esc-accent); margin-right: .35rem; }
.esc-best { margin: 1rem 0 .3rem; }
.esc-best i { color: #d97706; }
.esc-ransom { background: #111827; color: #f87171; border-radius: 14px; padding: 2rem 1rem; text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace;
  display: flex; flex-direction: column; align-items: center; gap: .6rem; box-shadow: inset 0 0 0 2px #7f1d1d; }
.esc-ransom i { font-size: 3rem; animation: esc-blink 1.6s infinite; }
.esc-ransom span { font-weight: 700; letter-spacing: .06em; }
.esc-ransom small { color: #fca5a5; }
@keyframes esc-blink { 50% { opacity: .35; } }

/* Plan */
.esc-map { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); margin-top: 1rem; }
.esc-room { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; text-align: left; padding: 1rem; border-radius: 14px;
  border: 2px solid var(--esc-line); background: #fff; font: inherit; color: inherit; cursor: pointer; min-height: 130px; }
.esc-room-num { position: absolute; top: .6rem; right: .8rem; font-weight: 800; color: #cbd5e1; }
.esc-room-icon { font-size: 1.6rem; }
.esc-room small { color: var(--esc-muted); }
.esc-room.is-open { border-color: var(--esc-accent); box-shadow: 0 0 0 4px rgba(8, 145, 178, .12); }
.esc-room.is-open .esc-room-icon { color: var(--esc-accent); }
.esc-room.is-solved { border-color: #86efac; background: var(--esc-ok-bg); }
.esc-room.is-solved .esc-room-icon { color: var(--esc-ok); }
.esc-room.is-locked { background: #f8fafc; color: #94a3b8; cursor: not-allowed; }
.esc-exit.is-open { background: var(--esc-night); color: #fff; border-color: var(--esc-night); }
.esc-exit.is-open small { color: #a5f3fc; }
.esc-exit.is-open .esc-room-icon { color: #fbbf24; }

/* Pièce */
.esc-room-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.esc-chip { display: inline-flex; align-items: center; gap: .4rem; background: #ecfeff; color: var(--esc-accent-dark); border-radius: 999px; padding: .3rem .8rem; font-weight: 700; font-size: .85rem; margin: 0; }
.esc-time { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--esc-muted); }
.esc-step { margin-left: auto; font-size: .85rem; color: var(--esc-muted); }
.esc-story { margin: 1rem 0 0; padding: .9rem 1rem; border-left: 4px solid var(--esc-accent); background: #f8fafc; border-radius: 0 10px 10px 0; line-height: 1.6; }
.esc-feedback { margin-top: 1rem; border-radius: 10px; line-height: 1.55; }
.esc-feedback:empty { display: none; }
.esc-feedback.is-ok { background: var(--esc-ok-bg); color: #14532d; border: 1px solid #bbf7d0; padding: .9rem 1rem; }
.esc-feedback.is-ko { background: var(--esc-ko-bg); color: #7f1d1d; border: 1px solid #fecaca; padding: .9rem 1rem; }
.esc-room-foot { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .6rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--esc-line); }
.esc-hint-box { flex: 1 1 260px; }
.esc-hint { margin: 0 0 .4rem; background: #fffbeb; border: 1px solid #fde68a; color: #78350f; border-radius: 8px; padding: .5rem .75rem; font-size: .92rem; }
.esc-hint i { color: #d97706; }
.esc-progress { margin: .8rem 0 0; font-weight: 600; }

/* Zones cliquables */
.esc-spot { font: inherit; color: inherit; background: transparent; border: 1px dashed transparent; border-radius: 6px; padding: .1rem .3rem; cursor: pointer; text-align: left; }
.esc-spot:hover { border-color: #94a3b8; background: #f8fafc; }
.esc-spot.is-found { border: 2px solid var(--esc-ok); background: var(--esc-ok-bg); }
.esc-spot.is-wrong { border: 2px solid #fca5a5; background: var(--esc-ko-bg); }
.esc-spot.block { display: block; width: 100%; }
.esc .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
.esc-mail { border: 1px solid var(--esc-line); border-radius: 12px; overflow: hidden; margin-top: .5rem; }
.esc-mail-row { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; padding: .55rem .9rem; border-bottom: 1px solid var(--esc-line); background: #f8fafc; }
.esc-mail-lbl { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--esc-muted); width: 3.2rem; }
.esc-mail-date { margin-left: auto; color: var(--esc-muted); font-size: .85rem; }
.esc-mail-body { padding: 1rem; display: grid; gap: .6rem; justify-items: start; line-height: 1.6; }
.esc-mail-cta .esc-spot { display: flex; flex-direction: column; gap: .3rem; }
.esc-fake-btn { display: inline-block; background: #1d4ed8; color: #fff; font-weight: 700; padding: .55rem 1.1rem; border-radius: 6px; }
.esc-url { color: var(--esc-muted); font-size: .8rem; }
.esc-mail-att .esc-spot { border: 1px solid var(--esc-line); background: #f8fafc; padding: .4rem .7rem; }
.esc-mail-att .esc-spot.is-found { border: 2px solid var(--esc-ok); }
.esc-desk { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); margin-top: .5rem; }
.esc-obj { display: flex; flex-direction: column; gap: .25rem; border: 1px solid var(--esc-line); border-radius: 12px; padding: .8rem; background: #fff; }
.esc-obj small { color: var(--esc-muted); line-height: 1.4; }
.esc-emoji { font-size: 1.8rem; line-height: 1; }

/* Ordre, choix, cases */
.esc-seq { margin: .6rem 0 1rem; padding-left: 1.4rem; display: grid; gap: .35rem; }
.esc-seq li { padding: .45rem .7rem; border-radius: 8px; border: 1px dashed var(--esc-line); }
.esc-seq li.is-set { border: 1px solid #86efac; background: var(--esc-ok-bg); font-weight: 600; }
.esc-pool, .esc-choices { display: grid; gap: .55rem; }
.esc-opt { font: inherit; text-align: left; padding: .8rem 1rem; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; color: inherit; cursor: pointer; line-height: 1.45; }
.esc-opt:hover:not(:disabled) { border-color: var(--esc-accent); background: #f0fdff; }
.esc-opt.is-found { border: 2px solid var(--esc-ok); background: var(--esc-ok-bg); }
.esc-opt.is-wrong { border-color: #fca5a5; background: var(--esc-ko-bg); color: #991b1b; text-decoration: line-through; }
.esc-opt:disabled { cursor: default; }
.esc-multi { display: grid; gap: .5rem; }
.esc-check { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .9rem; border: 1px solid #cbd5e1; border-radius: 10px; cursor: pointer; line-height: 1.45; }
.esc-check input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.esc-check.is-found { border: 2px solid var(--esc-ok); background: var(--esc-ok-bg); }
.shake { animation: esc-shake .35s; }
@keyframes esc-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Pièce résolue */
.esc-done { text-align: center; }
.esc-done .esc-chip { margin-bottom: 1rem; }
.esc-digit { display: inline-flex; flex-direction: column; align-items: center; background: var(--esc-night); color: #fff; border-radius: 18px; padding: 1rem 2.2rem; margin: .5rem 0 1rem; animation: esc-pop .5s ease; }
.esc-digit small { color: #67e8f9; text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; }
.esc-digit span { font-size: 3.4rem; font-weight: 800; line-height: 1.1; font-family: ui-monospace, Menlo, Consolas, monospace; }
@keyframes esc-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.esc-item i { color: var(--esc-accent); }
.esc-lesson { text-align: left; max-width: 680px; margin: 1rem auto 0; background: #f8fafc; border: 1px solid var(--esc-line); border-radius: 12px; padding: 1rem 1.2rem; }
.esc-lesson h3 { font-size: 1rem; font-weight: 800; margin: 0 0 .4rem; }
.esc-lesson p { margin: 0 0 .5rem; line-height: 1.6; }
.esc-done .esc-actions { justify-content: center; }

/* Porte */
.esc-door { text-align: center; }
.esc-pad { display: inline-block; background: var(--esc-night); border-radius: 18px; padding: 1.2rem; margin-top: .5rem; }
.esc-slots { display: flex; justify-content: center; gap: .4rem; margin-bottom: 1rem; }
.esc-slots span { width: 2.6rem; height: 3.2rem; border-radius: 8px; background: #111827; border: 1px solid #334155; color: #67e8f9; font: 800 1.8rem/3.2rem ui-monospace, Menlo, Consolas, monospace; }
.esc-keys { display: grid; grid-template-columns: repeat(3, 4rem); gap: .5rem; }
.esc-key { height: 3.2rem; border-radius: 10px; border: 1px solid #334155; background: #1e293b; color: #fff; font: 700 1.3rem system-ui, sans-serif; cursor: pointer; }
.esc-key:hover { background: #334155; }
.esc-key.ok { background: var(--esc-ok); border-color: var(--esc-ok); font-size: 1rem; }
.esc-key.clr { background: #475569; }
.esc-door .esc-room-foot { justify-content: center; }

/* Fin */
.esc-end-head { display: flex; gap: 1rem; align-items: center; }
.esc-end-head > i { font-size: 3rem; color: var(--esc-ok); }
.esc-end-head h2 { font-size: 1.6rem; font-weight: 800; margin: 0; }
.esc-end-head p { margin: .3rem 0 0; }
.esc-end .esc-kicker { color: var(--esc-ok); }
.esc-score { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 1.4rem 0 .6rem; }
.esc-score > div { background: #f8fafc; border: 1px solid var(--esc-line); border-radius: 12px; padding: .8rem 1rem; }
.esc-score strong { display: block; font-size: 1.25rem; font-weight: 800; }
.esc-score span { font-size: .78rem; color: var(--esc-muted); text-transform: uppercase; letter-spacing: .06em; }
.esc-record { color: #b45309; }
.esc-end h3 { font-size: 1.1rem; font-weight: 800; margin: 1.4rem 0 .6rem; }
.esc-recap { display: grid; gap: .6rem; padding-left: 1.2rem; line-height: 1.55; }

@media (max-width: 600px) {
  .esc-inv { margin-left: 0; width: 100%; }
  .esc-keys { grid-template-columns: repeat(3, 3.6rem); }
  .esc-slots span { width: 2.3rem; }
}
@media (prefers-reduced-motion: reduce) { .esc-ransom i, .esc-digit, .shake { animation: none; } }

/* ── QG, profil d'agent, missions ─────────────────────────────── */
.esc-profile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.5rem; }
.esc-agent { display: flex; align-items: center; gap: 1rem; min-width: min(100%, 320px); flex: 1 1 320px; }
.esc-agent > div { flex: 1; }
.esc-agent small { color: var(--esc-muted); display: block; }
.esc-agent strong { font-size: 1.2rem; font-weight: 800; }
.esc-agent-lvl { flex-shrink: 0; width: 3.4rem; height: 3.4rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.4rem;
  color: #fff; background: conic-gradient(from 200deg, #0891b2, #7c3aed, #0891b2); box-shadow: 0 0 0 4px #ecfeff; }
.esc-xpbar { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin: .35rem 0; }
.esc-xpbar span { display: block; height: 100%; background: linear-gradient(90deg, #0891b2, #7c3aed); }
.esc-profile-stats { display: flex; flex-wrap: wrap; gap: .6rem; }
.esc-stat { display: flex; flex-direction: column; align-items: center; min-width: 96px; padding: .6rem .9rem; border-radius: 12px; border: 1px solid var(--esc-line); background: #f8fafc; font: inherit; color: inherit; }
button.esc-stat { cursor: pointer; }
button.esc-stat:hover { border-color: var(--esc-accent); }
.esc-stat i { color: var(--esc-accent); font-size: 1.2rem; }
.esc-stat strong { font-size: 1.1rem; font-weight: 800; }
.esc-stat span { font-size: .72rem; color: var(--esc-muted); text-transform: uppercase; letter-spacing: .06em; }
.esc-section-title { font-size: 1.15rem; font-weight: 800; margin: 0 0 .8rem; }
.esc-missions { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.esc-mission { --m: var(--esc-accent); background: #fff; border: 1px solid var(--esc-line); border-top: 5px solid var(--m); border-radius: 16px; padding: 1.3rem; display: flex; flex-direction: column; box-shadow: 0 6px 24px rgba(15, 23, 42, .06); }
.esc-mission h2 { font-size: 1.25rem; font-weight: 800; margin: .8rem 0 .4rem; }
.esc-mission .esc-actions { margin-top: auto; padding-top: .8rem; }
.esc-mission .esc-btn.primary, .esc-intro .esc-btn.primary, .esc-end .esc-btn.primary, .esc-done .esc-btn.primary { background: var(--m, var(--esc-accent)); border-color: var(--m, var(--esc-accent)); }
.esc-mission-top { display: flex; align-items: center; gap: .6rem; }
.esc-mission-icon { width: 2.8rem; height: 2.8rem; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; color: var(--m); background: color-mix(in srgb, var(--m) 12%, #fff); }
.esc-tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--esc-muted); }
.esc-mission-top .esc-stars, .esc-mission-top .esc-new { margin-left: auto; }
.esc-new { font-size: .72rem; font-weight: 700; color: #fff; background: #f59e0b; border-radius: 999px; padding: .15rem .6rem; }
.esc-stars { color: #f59e0b; letter-spacing: .1em; white-space: nowrap; }
.esc-mission-meta { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .85rem; color: var(--esc-muted); }
.esc-login { margin-top: 1rem; }
.esc-sub { font-size: 1rem; font-weight: 800; margin: 1.2rem 0 .5rem; }
.esc-qmini { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; font-size: .9rem; }
.esc-qmini i { color: var(--m, var(--esc-accent)); }
.esc-qmini li.is-done { color: var(--esc-ok); }
.esc-qmini li.is-done i { color: var(--esc-ok); }
.esc-xp { display: inline-block; font-size: .72rem; font-weight: 700; color: #6d28d9; background: #f5f3ff; border-radius: 999px; padding: .05rem .5rem; white-space: nowrap; }
.esc-intro .esc-ransom { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--m, #7f1d1d) 60%, #000); }

/* Objet caché */
.esc-secret { margin-left: auto; background: none; border: 1px dashed transparent; border-radius: 8px; font-size: 1.1rem; line-height: 1; padding: .2rem .35rem; cursor: pointer; opacity: .35; filter: grayscale(1); transition: opacity .2s, filter .2s; }
.esc-secret:hover, .esc-secret:focus-visible { opacity: 1; filter: none; border-color: #f59e0b; }

/* Formulaire */
.esc-form { border: 1px solid var(--esc-line); border-radius: 12px; overflow: hidden; margin-top: .5rem; }
.esc-form-head { background: #f1f5f9; padding: .5rem .9rem; font-size: .82rem; color: var(--esc-muted); font-family: ui-monospace, Menlo, Consolas, monospace; border-bottom: 1px solid var(--esc-line); }
.esc-form-row { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr; gap: .8rem; align-items: center; width: 100%; padding: .65rem .9rem; border-radius: 0; border: 0; border-bottom: 1px solid var(--esc-line); }
.esc-form-row:last-child { border-bottom: 0; }
.esc-form-lbl { font-weight: 600; font-size: .92rem; }
.esc-form-field { border: 1px solid #cbd5e1; border-radius: 6px; padding: .4rem .6rem; color: var(--esc-muted); font-size: .88rem; background: #fff; }
.esc-form-row.is-found, .esc-form-row.is-wrong { border-radius: 0; }
@media (max-width: 600px) { .esc-form-row { grid-template-columns: 1fr; gap: .3rem; } }

/* Association, tri, devinette, chiffre */
.esc-match { display: grid; gap: .7rem; }
.esc-match-row { display: grid; gap: .5rem; padding: .8rem 1rem; border: 1px solid #cbd5e1; border-radius: 10px; }
@media (min-width: 760px) { .esc-match-row { grid-template-columns: 1fr 1.2fr; align-items: center; } }
.esc-match-row p { margin: 0; font-weight: 600; line-height: 1.45; }
.esc-match-row.is-found { border: 2px solid var(--esc-ok); background: var(--esc-ok-bg); }
.esc-select { width: 100%; font: inherit; font-size: .9rem; padding: .5rem; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; color: inherit; }
.esc-sort { display: grid; gap: .55rem; }
.esc-sort-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .6rem .9rem; border: 1px solid #cbd5e1; border-radius: 10px; }
.esc-sort-row p { margin: 0; flex: 1 1 240px; line-height: 1.45; }
.esc-sort-row.is-found { border-color: #86efac; background: var(--esc-ok-bg); }
.esc-sort-btns { display: flex; flex-wrap: wrap; gap: .4rem; }
.esc-opt.sm { padding: .4rem .7rem; font-size: .85rem; }
.esc-sort-cat { font-weight: 700; color: var(--esc-ok); font-size: .88rem; }
.esc-riddle { margin: .5rem 0 1rem; padding: 1rem 1.2rem; border-radius: 12px; background: #faf5ff; border: 1px solid #e9d5ff; color: #4c1d95; font-style: italic; line-height: 1.6; }
.esc-riddle i { font-style: normal; color: #7c3aed; }
.esc-cipher { margin: .5rem 0 1rem; text-align: center; }
.esc-cipher code { display: inline-block; background: var(--esc-night); color: #67e8f9; font: 700 clamp(1rem, 3vw, 1.5rem) ui-monospace, Menlo, Consolas, monospace; letter-spacing: .25em; padding: .8rem 1.2rem; border-radius: 10px; word-break: break-word; }
.esc-abc { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin-top: .6rem; }
.esc-abc span { width: 1.6rem; padding: .15rem 0; font: 600 .8rem ui-monospace, Menlo, Consolas, monospace; background: #f1f5f9; border-radius: 4px; }
.esc-answer > div { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .3rem; }
.esc-input { flex: 1 1 220px; font: inherit; padding: .7rem .9rem; border-radius: 10px; border: 1px solid #cbd5e1; }
.esc-tiles { display: flex; justify-content: center; gap: .5rem; margin-top: .5rem; }
.esc-tiles .esc-key { width: 3.4rem; }
.esc-key:disabled { opacity: .3; cursor: default; }

/* Cartes à collectionner */
.esc-album-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.esc-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.esc-filters button { font: inherit; font-size: .85rem; font-weight: 600; padding: .4rem .9rem; border-radius: 999px; border: 1px solid #cbd5e1; background: #fff; color: inherit; cursor: pointer; }
.esc-filters button.is-active { background: var(--esc-ink); border-color: var(--esc-ink); color: #fff; }
.esc-rars { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.esc-rar { font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .15rem .6rem; text-transform: capitalize; }
.esc-rar.r1, .esc-tcg.r1 { --rc: #64748b; } .esc-rar.r2, .esc-tcg.r2 { --rc: #2563eb; } .esc-rar.r3, .esc-tcg.r3 { --rc: #7c3aed; } .esc-rar.r4, .esc-tcg.r4 { --rc: #d97706; }
.esc-rar { color: var(--rc); background: color-mix(in srgb, var(--rc) 12%, #fff); }
.esc-album-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); margin: 1rem 0; }
.esc-tcg { position: relative; display: flex; flex-direction: column; border-radius: 14px; border: 3px solid var(--rc); background: #fff; padding: .7rem .8rem; min-height: 280px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--rc) 25%, transparent); overflow: hidden; }
.esc-tcg.r4 { background: linear-gradient(160deg, #fffbeb, #fff 40%, #fef3c7); }
.esc-tcg.r3 { background: linear-gradient(160deg, #faf5ff, #fff 45%); }
.esc-tcg.r4::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .7) 45%, transparent 60%); animation: esc-shine 3.5s infinite; pointer-events: none; }
@keyframes esc-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.esc-tcg-top { display: flex; justify-content: space-between; gap: .4rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--esc-muted); }
.esc-tcg-rar { color: var(--rc); }
.esc-tcg-art { font-size: 2.8rem; text-align: center; margin: .6rem 0; padding: .6rem 0; border-radius: 10px; background: color-mix(in srgb, var(--rc) 10%, #fff); }
.esc-tcg-name { font-weight: 800; font-size: 1rem; text-align: center; }
.esc-tcg-text { font-size: .8rem; line-height: 1.45; color: #334155; margin: .4rem 0; flex: 1; }
.esc-tcg-foot { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--rc); font-weight: 700; text-align: right; }
.esc-tcg.is-locked { background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 10px, #f1f5f9 10px, #f1f5f9 20px); box-shadow: none; border-style: dashed; }
.esc-tcg-back { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; text-align: center; color: var(--esc-muted); }
.esc-tcg-back i { font-size: 2.6rem; color: var(--rc); opacity: .6; }
.esc-tcg-back small { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--rc); }
.esc-tcg-back span { font-size: .78rem; line-height: 1.4; }

/* Révélation d'une carte */
.esc-reveal { position: fixed; inset: 0; z-index: 10040; background: rgba(2, 6, 23, .75); display: flex; align-items: center; justify-content: center; padding: 16px; }
.esc-reveal[hidden] { display: none; }
.esc-reveal-box { text-align: center; width: min(100%, 300px); }
.esc-reveal-kicker { color: #fde68a; font-weight: 800; font-size: 1.2rem; margin: 0 0 1rem; text-transform: capitalize; }
.esc-reveal-card { perspective: 900px; margin-bottom: 1.2rem; text-align: left; }
.esc-reveal-card .esc-tcg { animation: esc-flip .8s ease both; min-height: 320px; }
@keyframes esc-flip { from { transform: rotateY(90deg) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

/* Notifications */
.esc-toasts { position: fixed; top: 80px; right: 16px; z-index: 10045; display: grid; gap: .4rem; width: min(300px, calc(100vw - 32px)); font-size: .9rem; }
.esc-toast { display: flex; gap: .7rem; align-items: flex-start; background: var(--esc-night); color: #e2e8f0; border-radius: 12px; padding: .8rem 1rem; box-shadow: 0 10px 30px rgba(2, 6, 23, .3);
  border-left: 4px solid #fbbf24; padding: .6rem .8rem; animation: esc-in .3s ease; transition: opacity .4s, transform .4s; }
.esc-toast.out { opacity: 0; transform: translateX(20px); }
.esc-toast i { color: #fbbf24; font-size: 1.3rem; }
.esc-toast strong { display: block; color: #fff; }
.esc-toast span { font-size: .85rem; }
@keyframes esc-in { from { opacity: 0; transform: translateY(-10px); } }

/* Journal de quêtes et fin */
.esc-qlog { --m: var(--esc-accent); margin-top: 1.2rem; }
.esc-qlog h3 { font-size: 1.05rem; font-weight: 800; margin: 0 0 .6rem; }
.esc-qlog h3 i { color: var(--m); }
.esc-qrow { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border: 1px solid var(--esc-line); border-radius: 10px; margin-bottom: .45rem; }
.esc-qrow > i { font-size: 1.2rem; color: var(--m); }
.esc-qrow > div { flex: 1; }
.esc-qrow strong { display: block; }
.esc-qrow span { font-size: .88rem; color: var(--esc-muted); }
.esc-qrow.is-done { background: var(--esc-ok-bg); border-color: #bbf7d0; }
.esc-qrow.is-done > i { color: var(--esc-ok); }
.esc-end-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); margin-top: 1rem; }
.esc-end-grid h3 { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .esc-tcg.r4::after, .esc-reveal-card .esc-tcg, .esc-toast { animation: none; } }

/* Classement */
.esc-board { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .92rem; }
.esc-board th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--esc-muted); padding: .5rem .6rem; border-bottom: 2px solid var(--esc-line); }
.esc-board td { padding: .6rem; border-bottom: 1px solid var(--esc-line); }
.esc-board tr.top1 td { background: #fffbeb; }
.esc-board tr.is-me td { background: #ecfeff; font-weight: 700; }
.esc-board td:first-child { width: 3rem; font-weight: 800; }
.esc-empty { margin: 1rem 0; padding: 1.2rem; border: 1px dashed var(--esc-line); border-radius: 12px; text-align: center; color: var(--esc-muted); }
.esc-board-me { margin-top: 1rem; padding: 1rem 1.2rem; border-radius: 12px; background: #f8fafc; border: 1px solid var(--esc-line); }
.esc-board-me p { margin: 0 0 .6rem; }
.esc-board-form { display: grid; gap: .5rem; }
.esc-board-form .esc-check { border: 0; padding: 0; }
.esc-answer-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.esc-error { color: var(--esc-ko); }
@media (max-width: 600px) { .esc-board th:nth-child(4), .esc-board td:nth-child(4) { display: none; } }

/* ── Mode animateur (projection) ─────────────────────────────── */
.esc-anim-promo { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 1.5rem; background: linear-gradient(120deg, #ecfeff, #fff 60%); }
.esc-anim-promo > i { font-size: 2.4rem; color: var(--esc-accent); }
.esc-anim-promo > div { flex: 1 1 300px; }
.esc-anim-promo h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 .3rem; }
.esc-anim-promo p { margin: 0; }
.esc-anim-form fieldset { border: 1px solid var(--esc-line); border-radius: 12px; padding: 1rem 1.2rem; margin: 0 0 1rem; }
.esc-anim-form legend { font-weight: 800; font-size: 1rem; padding: 0 .4rem; width: auto; float: none; margin: 0; }
.esc-anim-missions { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.esc-anim-mission { --m: var(--esc-accent); display: flex; gap: .6rem; align-items: flex-start; border: 2px solid var(--esc-line); border-radius: 12px; padding: .8rem; cursor: pointer; }
.esc-anim-mission:has(input:checked) { border-color: var(--m); background: color-mix(in srgb, var(--m) 8%, #fff); }
.esc-anim-mission i { color: var(--m); }
.esc-anim-mission small { display: block; color: var(--esc-muted); }
.esc-anim-durations { display: flex; flex-wrap: wrap; gap: 1rem; }
.esc-anim-durations label { cursor: pointer; }
.esc-anim-team { display: flex; gap: .5rem; margin-bottom: .5rem; }
.esc-anim-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; margin-top: 1rem; }
.esc-anim-bar .esc-inv { margin-left: 0; }
.esc-anim-timer { font-variant-numeric: tabular-nums; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; color: #fff; }
.esc-anim-timer.is-short { color: #fbbf24; }
.esc-anim-timer.is-late { color: #f87171; }
.esc-paused { font-size: .9rem; vertical-align: middle; background: #f59e0b; color: #111827; border-radius: 6px; padding: .1rem .5rem; animation: esc-blink 1.2s infinite; }
.esc-anim-tools { display: flex; flex-wrap: wrap; gap: .4rem; margin-left: auto; }
.esc-tool { font: inherit; font-size: .85rem; font-weight: 600; color: #e2e8f0; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); border-radius: 8px; padding: .45rem .8rem; cursor: pointer; }
.esc-tool:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.esc-teams { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.esc-team { display: flex; align-items: center; gap: .7rem; background: rgba(255, 255, 255, .06); border: 2px solid rgba(255, 255, 255, .15); border-radius: 12px; padding: .5rem .8rem; color: #e2e8f0; }
.esc-team strong { font-size: 1.5rem; color: #fff; font-variant-numeric: tabular-nums; }
.esc-team.is-active { border-color: #fbbf24; background: rgba(251, 191, 36, .14); box-shadow: 0 0 0 4px rgba(251, 191, 36, .15); }
.esc-team.is-active .esc-team-name { color: #fde68a; font-weight: 700; }
.esc-team-adj { display: inline-flex; gap: .2rem; }
.esc-team-adj button { width: 1.7rem; height: 1.7rem; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: #cbd5e1; font-weight: 800; cursor: pointer; line-height: 1; }
.esc-team-adj button:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.esc-turn { display: inline-flex; align-items: center; gap: .5rem; margin: 1rem 0 0; padding: .5rem 1rem; border-radius: 999px; background: #fef3c7; color: #78350f; font-size: 1.1rem; }
.esc-award { margin: .7rem 0 0; padding: .6rem .8rem; border-radius: 8px; background: #fff; border: 1px solid #fde68a; color: #78350f; }
.esc-feedback ul, .esc-feedback ol { margin: .4rem 0; padding-left: 1.3rem; }
.esc-podium { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 1rem; margin: 1.5rem 0; }
.esc-podium-step { display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 150px; padding: 1rem 1.2rem; border-radius: 14px 14px 0 0; background: #f1f5f9; border: 1px solid var(--esc-line); }
.esc-podium-step.p1 { order: 2; min-height: 190px; background: linear-gradient(180deg, #fef3c7, #fff); border-color: #fcd34d; }
.esc-podium-step.p2 { order: 1; min-height: 150px; }
.esc-podium-step.p3 { order: 3; min-height: 120px; }
.esc-podium-step:nth-child(n+4) { order: 4; min-height: 0; border-radius: 14px; }
.esc-podium-medal { font-size: 2.2rem; }
.esc-podium-step strong { font-size: 1.1rem; }
/* Lisibilité de loin */
.esc.is-anim .esc-body { max-width: 1280px; }
.esc.is-anim .esc-q { font-size: clamp(1.4rem, 2.6vw, 2rem); }
.esc.is-anim .esc-story, .esc.is-anim .esc-opt, .esc.is-anim .esc-check, .esc.is-anim .esc-sort-row, .esc.is-anim .esc-match-row, .esc.is-anim .esc-spot, .esc.is-anim .esc-feedback { font-size: 1.12rem; }
.esc.is-anim .esc-hero h1 { font-size: clamp(1.4rem, 3vw, 2rem); }
.esc:fullscreen { overflow-y: auto; background: var(--site-bg, #f1f5f9); }
.esc:fullscreen .esc-toasts { top: 16px; }

/* Héros : même style que le tableau de bord (réglages admin/dashboard_hero.php, champs vides = Typographie) */
.esc-hero.esh { color: var(--td-hero-text, #e2e8f0); }
.esc-hero.esh.is-light { --td-hero-text: var(--c-title, #111c2d); }
.esh h1, .esh .esc-hud strong, .esh .esc-inv-item b { color: var(--td-hero-text, #fff); }
.esh .esc-kicker { color: var(--td-acc1, var(--c-eyebrow, var(--gold, #67e8f9))); }
.esh .esc-hud span { color: var(--td-hero-text, #94a3b8); opacity: .65; }
.esh-stats { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.1rem 0 0; }
.esh-stats > div, .esh-stats > button { min-width: 96px; text-align: center; padding: .6rem .9rem; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
  font: inherit; color: inherit; }
.esh-stats > button { cursor: pointer; transition: border-color .15s, transform .15s; }
.esh-stats > button:hover { border-color: var(--td-acc1, var(--gold, #67e8f9)); transform: translateY(-1px); }
.esh-stats > button:focus-visible { outline: 2px solid var(--td-acc1, var(--gold, #67e8f9)); outline-offset: 2px; }
.esh-stats strong { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--td-hero-text, #fff); }
.esh-stats strong small { font-size: .9rem; font-weight: 700; opacity: .6; }
.esh-stats > * > span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; opacity: .6; margin-top: .35rem; }
.esh-prog { margin: 1.2rem 0 0; max-width: 640px; }
.esh-prog-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.esh-prog-row > span { opacity: .6; }
.esh-prog-row b { font-size: 1.25rem; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.esh-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .15); overflow: hidden; margin: .45rem 0 .4rem; }
.esh-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--td-acc1, var(--gold, #38bdf8)), var(--td-acc2, var(--gold-lt, #a78bfa))); transition: width 1.2s cubic-bezier(.22, 1, .36, 1); }
.esh-sub { font-size: .8rem; opacity: .65; margin: 0; }
.esh.is-light .esh-stats > div, .esh.is-light .esh-stats > button { background: rgba(15, 23, 42, .04); border-color: rgba(15, 23, 42, .1); }
.esh.is-light .esh-bar { background: rgba(15, 23, 42, .1); }
.esh.is-light .esc-inv-item { background: rgba(15, 23, 42, .05); border-color: rgba(15, 23, 42, .15); color: var(--td-hero-text); }
@media (max-width: 600px) { .esh-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } .esh-stats > div, .esh-stats > button { min-width: 0; } }
/* Mode animateur sur un héros clair (fond Typographie) : chrono, outils et équipes en sombre */
.esh.is-light .esc-anim-timer { color: var(--td-hero-text); }
.esh.is-light .esc-anim-timer.is-short { color: #b45309; }
.esh.is-light .esc-anim-timer.is-late { color: #b91c1c; }
.esh.is-light .esc-tool { color: var(--td-hero-text); background: rgba(15, 23, 42, .05); border-color: rgba(15, 23, 42, .18); }
.esh.is-light .esc-tool:hover { background: rgba(15, 23, 42, .1); color: var(--td-hero-text); }
.esh.is-light .esc-team { color: var(--td-hero-text); background: rgba(15, 23, 42, .04); border-color: rgba(15, 23, 42, .14); }
.esh.is-light .esc-team strong { color: var(--td-hero-text); }
.esh.is-light .esc-team.is-active { border-color: #d97706; background: rgba(251, 191, 36, .18); }
.esh.is-light .esc-team.is-active .esc-team-name { color: #92400e; }
.esh.is-light .esc-team-adj button { color: var(--td-hero-text); border-color: rgba(15, 23, 42, .2); }
.esh.is-light .esc-hud .is-short strong { color: #b45309; }
.esh.is-light .esc-hud .is-late strong { color: #b91c1c; }

/* QG en onglets (Missions, Cartes, Quêtes, Classement) */
.esc-tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 2px solid var(--esc-line); margin: 0 0 1.4rem; }
.esc-tabs button { display: inline-flex; align-items: center; gap: .45rem; padding: .7rem 1rem; font: inherit; font-weight: 700; color: var(--esc-muted); background: none; border: 0;
  border-bottom: 3px solid transparent; margin-bottom: -2px; border-radius: 8px 8px 0 0; cursor: pointer; }
.esc-tabs button:hover { color: var(--esc-ink); background: rgba(15, 23, 42, .04); }
.esc-tabs button.is-active { color: var(--td-acc1, var(--gold, var(--esc-accent))); border-bottom-color: var(--td-acc1, var(--gold, var(--esc-accent))); }
.esc-tabs button:focus-visible { outline: 2px solid var(--td-acc1, var(--gold, var(--esc-accent))); outline-offset: 2px; }
