/* ============================================================
   Chasse au trésor – feuille de style commune (admin + joueur)
   ============================================================ */
:root {
    --bg: #1b1230;
    --bg2: #2a1b4d;
    --card: #ffffff;
    --text: #22203a;
    --muted: #6f6a86;
    --primary: #ff6f61;
    --primary-dark: #e4574a;
    --primary-btn: #c2544a;   /* fond des boutons : texte blanc à 4,5:1 (calculé par thème côté joueur) */
    --accent: #ffca3a;
    --ok: #1f7a4f;            /* « bon code » : 5,3:1 sur blanc */
    --error: #c0303f;         /* « mauvais code » : 5,6:1 sur blanc */
    --border: #e6e2f2;
    --input-border: #8f8a9e;  /* contour des champs : 3:1 sur blanc */
    --focus: #1a73e8;         /* anneau de focus : lisible sur blanc comme sur le fond violet */
    --radius: 18px;
    --shadow: 0 10px 30px rgba(20, 10, 50, 0.25);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: radial-gradient(circle at 20% 10%, var(--bg2), var(--bg) 60%);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh; /* iOS : hauteur réellement visible, barre d'adresse comprise */
    -webkit-font-smoothing: antialiased;
    line-height: 1.45;
}
body.no-scroll { overflow: hidden; }

h1, h2 { margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 12px; }
a { color: var(--primary-btn); }
code { background: #f1eefa; padding: 1px 5px; border-radius: 4px; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.big-emoji { font-size: 3.2rem; margin: 0 0 6px; line-height: 1; }
.empty { color: var(--muted); text-align: center; padding: 20px; }
.badge { display: inline-block; background: var(--accent); color: #3a2a00; font-size: 0.8rem; border-radius: 999px; padding: 1px 9px; vertical-align: middle; margin-left: 6px; }

/* ---------- Cartes ---------- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 20px;
    margin: 0 0 18px;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 60px; }

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 600; margin: 0 0 14px; font-size: 0.95rem; }
label .muted { font-weight: 400; }
input[type=text], input[type=password], textarea, input[type=file] {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    font: inherit;
    font-size: 1rem;
    border: 1.5px solid var(--input-border);
    border-radius: 12px;
    background: #faf9fe;
    color: var(--text);
}
input[type=file] { padding: 10px; }
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--primary-btn); box-shadow: 0 0 0 3px rgba(255, 111, 97, 0.2); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.search-box:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme-opt:has(input:focus-visible) .theme-swatch { outline: 3px solid var(--focus); outline-offset: 2px; }
/* iPhone : un champ en dessous de 16 px déclenche un zoom automatique au toucher */
@media (pointer: coarse) { input, select, textarea { font-size: max(16px, 1rem); } }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 8px 0 14px; }
.check input { width: 20px; height: 20px; margin: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; gap: 0; } }
.code-input { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.15em; font-weight: 700; }
img.preview { display: block; max-width: 100%; max-height: 240px; border-radius: 12px; margin: 8px 0; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 20px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    background: #ece8f7;
    color: var(--text);
    font: inherit; font-weight: 600; font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.1s, filter 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(0.96); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.primary { background: var(--primary-btn, var(--primary)); color: #fff; }
.btn.primary:hover { background: var(--primary-btn, var(--primary)); filter: brightness(0.92); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.danger { background: #fde8ea; color: var(--error); }
.btn.small { padding: 8px 14px; font-size: 0.85rem; }
.btn.tiny { padding: 5px 10px; font-size: 0.8rem; }
.btn.big { width: 100%; padding: 16px; font-size: 1.1rem; margin-top: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
form.inline { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Messages ---------- */
.flash { padding: 12px 14px; border-radius: 12px; margin: 0 0 14px; font-weight: 500; }
.flash.ok { background: #e2f6ec; color: #17603f; }
.flash.error { background: #fde8ea; color: #8f1f2b; }
.flash.warn { background: #fff4d6; color: #6b4d00; }

/* ============================================================
   ADMIN
   ============================================================ */
.topbar {
    position: sticky; top: 0; z-index: 10;
    display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
    padding: 10px 12px;
    background: rgba(27, 18, 48, 0.85);
    backdrop-filter: blur(10px);
    color: #fff;
}
.topbar h1 { font-size: 1.05rem; text-align: center; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar a { color: #fff; text-decoration: none; font-size: 1.4rem; text-align: center; }
.login { max-width: 380px; margin: 60px auto; text-align: center; }
.login label { text-align: left; }
.login .btn { width: 100%; }

.hunt-list { list-style: none; padding: 0; margin: 0; }
.hunt-item { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.hunt-title { font-size: 1.15rem; font-weight: 700; color: var(--text); text-decoration: none; }
.hunt-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h2 { margin: 0; }

.qr-card { text-align: center; }
.qr { display: inline-block; padding: 12px; background: #fff; border-radius: 12px; border: 1.5px solid var(--border); margin: 6px 0 10px; }
.qr img { display: block; }
.url { word-break: break-all; font-size: 0.85rem; }
.qr-card .btn-row { justify-content: center; }

.step-list { list-style: none; padding: 0; margin: 10px 0; }
.step-item {
    display: grid; grid-template-columns: 34px 64px 1fr; gap: 12px; align-items: center;
    padding: 12px 0; border-top: 1px solid var(--border);
}
.step-num { width: 34px; height: 34px; border-radius: 50%; background: var(--bg); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: #f1eefa; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.step-body { min-width: 0; }
.step-title { font-weight: 700; }
.clamp { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.code-pill { display: inline-block; margin-top: 4px; font-size: 0.85rem; background: #fff4d6; color: #6b4d00; padding: 2px 10px; border-radius: 999px; }
.code-pill strong { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.1em; }
.step-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (min-width: 600px) {
    .step-item { grid-template-columns: 34px 64px 1fr auto; }
    .step-actions { grid-column: auto; }
}

table.players { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.players th, table.players td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
table.players th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ============================================================
   JOUEUR
   ============================================================ */
body.play { display: flex; flex-direction: column; align-items: center; padding: 16px 16px 40px; overflow-x: hidden; }
.stars {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 70% 20%, #fff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 40% 80%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 85% 65%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 10% 70%, #fff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 60% 50%, #fff 50%, transparent 51%);
    opacity: 0.4;
}
.preview-banner { position: relative; z-index: 2; width: 100%; max-width: 520px; text-align: center; background: var(--accent); color: #3a2a00; font-size: 0.8rem; font-weight: 600; padding: 6px 10px; border-radius: 10px; margin-bottom: 10px; }
.screen { display: none; width: 100%; max-width: 520px; position: relative; z-index: 1; }
.screen.active { display: block; animation: fadein 0.35s ease; }
.recipient { font-size: 1.15rem; color: var(--primary-dark); font-weight: 600; }
.intro { font-size: 1.05rem; }
.name-field { text-align: left; margin-top: 12px; }

.progress { display: flex; align-items: center; gap: 6px; margin: 4px 0 14px; padding: 0 4px; flex-wrap: wrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); transition: background 0.3s, transform 0.3s; }
.dot.done { background: var(--ok); }
.dot.current { background: var(--accent); transform: scale(1.25); box-shadow: 0 0 0 4px rgba(255, 202, 58, 0.3); }
.progress-label { margin-left: auto; color: #fff; font-size: 0.85rem; font-weight: 600; opacity: 0.85; }

.step-card h2 { font-size: 1.35rem; }
.step-card figure, .game-card figure { margin: 0 0 14px; }
.step-card figure img, .final-card figure img, .game-card figure img {
    display: block; width: 100%; max-height: 60vh; object-fit: contain;
    border-radius: 14px; background: #f1eefa; cursor: zoom-in;
}
.step-card figcaption { text-align: center; margin-top: 4px; }
.clue { font-size: 1.1rem; white-space: pre-line; background: #faf9fe; border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 0 12px 12px 0; }
#code-form label { margin-bottom: 6px; }
.code-row { display: flex; gap: 8px; }
.code-row input {
    margin: 0; flex: 1; text-align: center;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1.5rem; font-weight: 700; letter-spacing: 0.25em; text-transform: uppercase;
}
.code-row .btn { padding: 12px 18px; }
.feedback { min-height: 1.4em; margin: 10px 0 0; font-weight: 600; text-align: center; }
.feedback.ok { color: var(--ok); }
.feedback.error { color: var(--error); }
.hint { margin: 10px 0 0; background: #fff4d6; color: #6b4d00; padding: 10px 14px; border-radius: 12px; font-weight: 500; }

.final-card h1 { color: var(--primary-dark); }
.final-message { font-size: 1.15rem; white-space: pre-line; }
.final-card figure { margin: 0 0 14px; }

.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.92); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100vw; max-height: 100vh; max-height: 100dvh; object-fit: contain; }
.lightbox .close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 1.3rem; cursor: pointer; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; display: none; }

/* ---------- Animations ---------- */
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.94); opacity: 0.6; } 60% { transform: scale(1.02); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
.pop { animation: pop 0.4s ease; }
.shake { animation: shake 0.4s ease; }
@media (prefers-reduced-motion: reduce) { .pop, .shake, .screen.active { animation: none; } }

/* ============================================================
   PRISE DE PHOTO INTÉGRÉE (organisateur)
   ============================================================ */
.photo-field { margin-top: 6px; }
.photo-field .photo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.photo-field .pf-preview { margin-top: 8px; }
.photo-field .pf-existing { margin-bottom: 6px; }
.photo-field .pf-existing .check { margin: 4px 0 8px; }
.cam-overlay { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; flex-direction: column; }
.cam-overlay[hidden] { display: none; }
.cam-overlay.flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0.8; }
.cam-video { flex: 1; width: 100%; min-height: 0; object-fit: cover; background: #000; }
.cam-error { position: absolute; top: 40%; left: 16px; right: 16px; text-align: center; color: #fff; }
.cam-bar { display: flex; align-items: center; justify-content: space-around; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); background: rgba(0,0,0,0.85); }
.cam-btn { width: 52px; height: 52px; border-radius: 50%; border: none; background: rgba(255,255,255,0.15); color: #fff; font-size: 1.3rem; cursor: pointer; }
.cam-shutter { width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; background: var(--primary); cursor: pointer; box-shadow: 0 0 0 4px rgba(255,255,255,0.25); }
.cam-shutter:active { transform: scale(0.92); }
.field-label { font-weight: 600; font-size: 0.95rem; margin: 0 0 4px; }
.field-label .muted { font-weight: 400; }
[hidden] { display: none !important; }

/* ---------- Tableau de bord admin ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #fff; padding: 2px 4px 10px; font-size: 0.95rem; }
.dash-head .live { color: var(--accent); }
/* Boutons posés sur le fond sombre : le style « ghost » par défaut est prévu pour un fond blanc */
.dash-head .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.08); }
.dash-head .btn.ghost:hover { background: rgba(255, 255, 255, 0.18); filter: none; }
.hunt-main { flex: 1 1 260px; min-width: 0; }
.hunt-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.status { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.status.encours { background: #e2f6ec; color: #17603f; }
.status.prete { background: #fff4d6; color: #6b4d00; }
.status.terminee { background: #e7eefb; color: #24467f; }
.status.brouillon { background: #f1eefa; color: var(--muted); }
.status.pause { background: #fde8ea; color: #8f1f2b; }
.live-list { list-style: none; margin: 10px 0 0; padding: 0; }
.live-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--border); font-size: 0.88rem; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; animation: pulse 1.8s ease-in-out infinite; }
.live-name { font-weight: 600; }
.live-bar { flex: 1 1 80px; height: 7px; min-width: 60px; border-radius: 999px; background: #f1eefa; overflow: hidden; }
.live-bar span { display: block; height: 100%; background: var(--ok); border-radius: 999px; transition: width 0.4s; }
.live-step { font-weight: 600; color: var(--muted); white-space: nowrap; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
details.new-hunt summary { cursor: pointer; font-size: 1.05rem; }
details.new-hunt[open] summary { margin-bottom: 14px; }

/* ---------- Bibliothèque d'idées ---------- */
.ideas summary { cursor: pointer; font-weight: 700; }
.ideas .idea-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 10px; }
.idea-cat { padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: #fff; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.idea-cat.on { background: var(--bg); color: #fff; border-color: var(--bg); }
.idea-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.idea-list li { border-top: 1px solid var(--border); padding: 10px 0; }
.idea-lieu { font-weight: 700; font-size: 0.95rem; }
.idea-txt { color: var(--muted); font-size: 0.87rem; margin: 2px 0 6px; white-space: pre-line; }
.idea-use { padding: 5px 12px; font-size: 0.8rem; }

/* ============================================================
   FUN JOUEUR : déverrouillage, mini-jeux, audio, classement, diplôme
   ============================================================ */
.sound-note { margin-top: 10px; }
.unlock { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(10, 5, 25, 0.72); backdrop-filter: blur(3px); }
.unlock[hidden] { display: none; }
.unlock svg { filter: drop-shadow(0 10px 30px rgba(0,0,0,0.5)); }
.unlock .shackle { transform-origin: 40px 62px; }
.unlock.go svg { animation: lock-pop 1.1s ease forwards; }
.unlock.go .shackle { animation: shackle-open 1.1s ease forwards; }
.unlock-text { color: #fff; font-weight: 800; font-size: 1.5rem; margin-top: 10px; opacity: 0; }
.unlock.go .unlock-text { animation: text-in 1.1s ease forwards; }
@keyframes lock-pop { 0% { transform: scale(0.6); opacity: 0; } 25% { transform: scale(1.05); opacity: 1; } 35% { transform: rotate(-6deg); } 45% { transform: rotate(6deg); } 55% { transform: rotate(0); } 100% { transform: scale(1.15); opacity: 0; } }
@keyframes shackle-open { 0%, 50% { transform: translateY(0) rotate(0); } 70% { transform: translateY(-14px) rotate(0); } 100% { transform: translateY(-14px) rotate(-35deg); } }
@keyframes text-in { 0%, 55% { opacity: 0; transform: translateY(8px); } 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.reveal-wrap { border-radius: 14px; overflow: hidden; transition: filter 0.8s ease; }
#reveal-btn { display: block; margin: 8px auto 0; }

.audio-wrap { text-align: center; margin: 0 0 14px; }
.audio-wrap .btn { width: 100%; }

.game-card h2 { font-size: 1.25rem; }
.puzzle { position: relative; width: 100%; aspect-ratio: 3 / 2; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 3px; border-radius: 14px; overflow: hidden; background: #ddd; }
.puzzle .tile { position: relative; cursor: pointer; background-repeat: no-repeat; transition: transform 0.15s, box-shadow 0.15s; }
.puzzle .tile.sel { transform: scale(0.92); box-shadow: inset 0 0 0 4px var(--accent); z-index: 1; }
.puzzle.solved { gap: 0; box-shadow: 0 0 0 4px var(--ok); }
.quiz-q { font-size: 1.1rem; font-weight: 600; margin: 0 0 12px; }
.quiz-options { display: grid; gap: 8px; }
.quiz-opt { width: 100%; text-align: left; justify-content: flex-start; padding: 13px 16px; }
.quiz-opt.good { background: #e2f6ec; color: #17603f; }
.quiz-opt.bad { background: #fde8ea; color: #8f1f2b; }

.hint-2 { background: #e2f6ec; color: #17603f; }

.board-card h2 { font-size: 1.05rem; }
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 0.95rem; }
.board li.me { font-weight: 700; }
.board li.done { color: var(--ok); }
.b-pos { width: 28px; text-align: center; }
.b-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-step { color: var(--muted); font-size: 0.85rem; }
.board li.done .b-step { color: var(--ok); }

.stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; }
.stats div { background: #faf9fe; border: 1px solid var(--border); border-radius: 12px; padding: 8px 14px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.center-row { justify-content: center; }

.diploma { flex-direction: column; padding: 16px; overflow: auto; }
.diploma-inner { width: min(92vw, 420px); }
.diploma canvas { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); display: block; }
.diploma .btn-row { margin-top: 14px; }
.diploma .btn.ghost { color: #fff; border-color: rgba(255,255,255,0.4); }

/* ============================================================
   ADMIN : checklist, thèmes, glisser-déposer, audio, mini-jeux
   ============================================================ */
.checklist ul { list-style: none; margin: 0; padding: 0; }
.checklist li { padding: 7px 0 7px 30px; position: relative; border-top: 1px solid var(--border); }
.checklist li:first-child { border-top: none; }
.checklist li::before { position: absolute; left: 0; top: 6px; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 800; }
.checklist li.ok::before { content: "✓"; background: #e2f6ec; color: #17603f; }
.checklist li.todo::before { content: "!"; background: #fff4d6; color: #6b4d00; }
.checklist li a { color: var(--text); text-decoration: none; }
.checklist li.todo a { font-weight: 600; }
.checklist.ready { border: 2px solid var(--ok); }
.sub-h2 { margin-top: 22px; }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 600; background: #f1eefa; color: var(--muted); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }

.theme-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.theme-opt { margin: 0; cursor: pointer; text-align: center; font-weight: 500; font-size: 0.78rem; }
.theme-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.theme-swatch { display: flex; align-items: center; justify-content: center; height: 58px; border-radius: 14px; background: linear-gradient(135deg, var(--tbg), var(--tp)); border: 3px solid transparent; font-size: 1.6rem; box-shadow: inset 0 -6px 0 var(--ta); transition: transform 0.1s; }
.theme-opt input:checked + .theme-swatch { border-color: var(--text); transform: scale(1.05); }
.theme-name { display: block; margin-top: 4px; }

.step-item { grid-template-columns: 22px 34px 64px 1fr; }
@media (min-width: 600px) { .step-item { grid-template-columns: 22px 34px 64px 1fr auto; } }
.step-handle { cursor: grab; color: #b9b2d0; font-size: 1.3rem; text-align: center; touch-action: none; user-select: none; }
.step-item.dragging { opacity: 0.55; background: #faf9fe; }
.step-list.saved .step-num { background: var(--ok); }
.btn.placed { background: #e2f6ec; color: #17603f; }

.audio-field { margin-top: 6px; }
.audio-field audio { width: 100%; margin: 8px 0; }
.af-rec.recording { background: var(--error); color: #fff; animation: pulse 1.2s infinite; }
.af-timer { font-family: ui-monospace, Consolas, monospace; font-weight: 700; align-self: center; }

.game-picker { display: grid; gap: 8px; margin: 6px 0 14px; }
.game-opt { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; font-weight: 600; }
.game-opt input { margin-top: 3px; }
.game-opt small { display: block; font-weight: 400; color: var(--muted); }
.game-opt:has(input:checked) { border-color: var(--primary); background: #fff6f5; }
.quiz-fields { background: #faf9fe; border-radius: 12px; padding: 12px 14px 4px; margin-bottom: 14px; }
.quiz-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.quiz-row input[type=text] { margin: 0; }
.quiz-row input[type=radio] { width: 20px; height: 20px; }

/* ============================================================
   MINI-JEUX (assets/games.js)
   ============================================================ */
.solver { margin: 0 0 14px; }
.clue-wrap { position: relative; }
.scratch-host { min-height: 90px; }
.scratch-layer { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 14px; cursor: crosshair; z-index: 2; }

.puzzle.slide .tile.blank { background: #e9e4f5 !important; cursor: default; }

canvas.maze, canvas.tilt { display: block; width: 100%; border-radius: 14px; background: #faf9fe; }

.memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mcard { aspect-ratio: 1; perspective: 600px; cursor: pointer; }
.mcard .inner { position: relative; width: 100%; height: 100%; transition: transform 0.35s; transform-style: preserve-3d; }
.mcard.flip .inner, .mcard.ok .inner { transform: rotateY(180deg); }
.mcard .face { position: absolute; inset: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.mcard .front { background: var(--bg); color: #fff; font-weight: 800; }
.mcard .back { background: #faf9fe; border: 2px solid var(--border); transform: rotateY(180deg); background-size: cover; background-position: center; }
.mcard.ok .back { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(46,158,107,0.3); }

.lights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 320px; margin: 0 auto; }
.light { aspect-ratio: 1; border-radius: 14px; background: #d8d3e8; cursor: pointer; transition: background 0.15s, box-shadow 0.15s; }
.light.on { background: var(--accent); box-shadow: 0 0 18px rgba(255, 202, 58, 0.8); }

.simon { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 300px; margin: 0 auto; }
.pad { aspect-ratio: 1; border-radius: 18px; opacity: 0.45; cursor: pointer; transition: opacity 0.1s, transform 0.1s; }
.pad.lit { opacity: 1; transform: scale(1.05); box-shadow: 0 0 24px rgba(255,255,255,0.6); }

.timer-display { font-family: ui-monospace, Consolas, monospace; font-size: 3rem; font-weight: 800; text-align: center; margin: 10px 0; letter-spacing: 0.05em; }

.globe { display: flex; justify-content: center; }
.globe canvas { width: min(100%, 300px); height: auto; cursor: pointer; }
.shake-bar { height: 10px; border-radius: 999px; background: #eee; overflow: hidden; margin: 10px 0; }
.shake-bar span { display: block; height: 100%; width: 0; background: var(--ok); transition: width 0.2s; }

.compass-dial { width: 180px; height: 180px; margin: 6px auto; border-radius: 50%; border: 6px solid var(--border); background: radial-gradient(circle, #fff, #f1eefa); display: flex; align-items: center; justify-content: center; }
.compass-dial .needle { font-size: 5rem; color: var(--primary); transition: transform 0.2s; line-height: 1; }
.compass-txt { text-align: center; font-weight: 700; font-size: 1.2rem; margin: 6px 0; }

.free-input { flex: 1; margin: 0; }

.hangman-word { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0 8px; }
.hangman-word .slot { min-width: 26px; height: 34px; border-bottom: 3px solid var(--text); text-align: center; font-weight: 800; font-size: 1.3rem; line-height: 34px; }
.hangman-word .slot.fixed { border-bottom-color: transparent; color: var(--muted); }
.hangman-word .space { width: 16px; }
.keyboard { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.btn.key { padding: 8px 0; width: 34px; font-size: 0.95rem; border-radius: 8px; }
.btn.key.good { background: #e2f6ec; color: #17603f; }
.btn.key.bad { background: #fde8ea; color: #8f1f2b; }
.numpad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; max-width: 320px; margin: 10px auto 0; }
.numpad .btn.key { width: auto; }

.anagram-slots, .mm-current { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 6px 0 12px; }
.anagram-slots .slot, .mm-current .slot { width: 36px; height: 42px; border: 2px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; cursor: pointer; }
.anagram-slots .slot.filled, .mm-current .slot.filled { border-style: solid; border-color: var(--text); background: #faf9fe; }
.anagram-pool { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.btn.tile-letter { width: 40px; height: 44px; padding: 0; font-size: 1.15rem; font-weight: 800; border-radius: 10px; background: var(--accent); color: #3a2a00; }

.cipher-text { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: 0.06em; background: #faf9fe; border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 0 12px 12px 0; white-space: pre-wrap; word-break: break-word; }
.cipher-key { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 4px; font-size: 0.8rem; }
.cipher-key span { background: #f1eefa; border-radius: 6px; padding: 3px 6px; text-align: center; }
.cipher-key b { display: block; font-size: 1rem; }
.cipher-range { width: 100%; }

.hotspot-wrap { position: relative; border-radius: 14px; overflow: hidden; cursor: crosshair; }
.hotspot-wrap img { display: block; width: 100%; }
.hotspot-mark, .hotspot-miss { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.hotspot-mark { background: rgba(46,158,107,0.85); color: #fff; border: 2px solid #fff; }
.hotspot-miss { border: 3px solid rgba(217,65,79,0.8); animation: miss 0.6s ease forwards; }
@keyframes miss { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }

.timeline { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.tl-item { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; cursor: pointer; border: 3px solid transparent; }
.tl-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-item.sel { border-color: var(--accent); }
.tl-num { position: absolute; left: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }

.mm-history { max-height: 220px; overflow-y: auto; margin-bottom: 8px; }
.mm-row { display: flex; justify-content: space-between; padding: 5px 8px; border-top: 1px solid var(--border); font-family: ui-monospace, Consolas, monospace; }
.mm-guess { font-weight: 800; letter-spacing: 0.15em; }

.sequence { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.seq-term { background: #faf9fe; border: 2px solid var(--border); border-radius: 10px; padding: 8px 12px; font-weight: 800; font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; }
.seq-term.q { background: var(--accent); border-color: var(--accent); color: #3a2a00; }

/* Admin : sélecteur de jeu, éditeur d'objets cachés, chronologie, boussole */
.hs-editor { position: relative; display: inline-block; max-width: 100%; cursor: crosshair; }
.hs-editor img { display: block; max-width: 100%; border-radius: 12px; }
.hs-pin { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--primary-btn, var(--primary)); color: #fff; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.hs-list { list-style: none; padding: 0; margin: 8px 0; }
.hs-list li { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.hs-list input { margin: 0; flex: 1; }
.game-select { width: 100%; padding: 12px 14px; font: inherit; border: 1.5px solid var(--border); border-radius: 12px; background: #faf9fe; margin-top: 6px; }
.game-desc { margin: 6px 0 12px; }
.game-config { background: #faf9fe; border-radius: 12px; padding: 12px 14px 4px; margin-bottom: 14px; }
.tl-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tl-fields .photo-field { margin: 0 0 10px; }
.af-note.rec { color: var(--error); font-weight: 600; }
.af-note.ok { color: #17603f; font-weight: 600; }
.af-note.error { color: var(--error); }
.test-list { list-style: none; margin: 0; padding: 0; }
.test-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.test-list li:first-child { border-top: none; }
.test-main { min-width: 0; }
.test-title { font-weight: 700; }
.test-list .btn { flex: none; }
.game-try { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.game-try .game-select { margin-top: 0; flex: 1; }
.howto { text-align: left; background: #faf9fe; border-radius: 14px; padding: 14px 16px 8px; margin: 4px 0 14px; }
.howto h2 { font-size: 1rem; margin: 0 0 8px; }
.howto ol { margin: 0 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 0.93rem; }
.howto p { margin: 0 0 4px; }
#btn-resume + #btn-start.ghost { margin-top: 8px; }
/* Menu admin */
.topbar details.menu { position: relative; text-align: right; }
.topbar details.menu summary { list-style: none; cursor: pointer; color: #fff; font-size: 1.4rem; padding: 0 4px; }
.topbar details.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: 36px; min-width: 200px; background: #fff; color: var(--text); border-radius: 12px; box-shadow: var(--shadow); padding: 6px 0; display: flex; flex-direction: column; text-align: left; z-index: 20; }
.menu-list a { color: var(--text); text-decoration: none; padding: 10px 16px; font-size: 0.95rem; }
.menu-list a:hover { background: #f1eefa; }
.menu-user { padding: 8px 16px 6px; font-size: 0.8rem; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
/* Étape : options avancées, assistant IA, import en rafale, mode caché guidé */
details.advanced { margin: 0 0 14px; }
details.advanced summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.ai-box { background: #f5f0ff; border: 1px solid #e0d4fb; border-radius: 12px; padding: 12px 14px; margin: -6px 0 14px; }
.ai-box .btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-idea { border-top: 1px solid var(--border); padding: 10px 0; }
.ai-idea .idea-txt { white-space: pre-line; }
details.bulk { margin-top: 14px; }
details.bulk summary { cursor: pointer; font-weight: 600; }
.bulk-form { padding-top: 8px; }
.hide-bar { height: 10px; border-radius: 999px; background: #eee; overflow: hidden; }
.hide-bar span { display: block; height: 100%; background: var(--ok); transition: width 0.3s; }
.hide-card.placed { opacity: 0.55; }
.hide-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.hide-photo { max-height: 200px; }
.hide-code { font-family: ui-monospace, Consolas, monospace; font-size: 2.4rem; font-weight: 800; letter-spacing: 0.2em; text-align: center; background: #fff4d6; color: #6b4d00; border-radius: 14px; padding: 10px; margin: 8px 0 12px; }
.hide-note { background: #e2f6ec; color: #17603f; border-radius: 12px; padding: 10px 14px; margin: 8px 0 12px; }
.live-form input[type=text] { display: inline-block; width: auto; }
/* Messages en direct, géolocalisation, coopératif */
.toasts { position: fixed; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); z-index: 70; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: #fff; color: var(--text); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); border-left: 5px solid var(--accent); animation: fadein 0.3s ease; max-width: 520px; margin: 0 auto; width: 100%; }
.toast strong { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 2px; }
.toast.unlock-msg { border-left-color: var(--ok); }
.toast.gone { opacity: 0; transition: opacity 0.4s; }
.geo-box { text-align: center; margin: 0 0 14px; }
.geo-box h3 { margin: 0 0 6px; font-size: 1.15rem; }
.compass-dial.small { width: 120px; height: 120px; }
.compass-dial.small .needle { font-size: 3.2rem; }
.coop-fragment { font-family: ui-monospace, Consolas, monospace; font-size: 2.6rem; font-weight: 800; letter-spacing: 0.25em; text-align: center; background: #fff4d6; color: #6b4d00; border-radius: 14px; padding: 12px; margin: 8px 0 14px; }
/* Cartes (Leaflet) : étape géolocalisée et parcours extérieur */
.geo-map { width: 100%; height: 420px; border-radius: 12px; border: 1.5px solid var(--border); background: #eef0f4; z-index: 0; }
.route-pin span { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--bg); color: #fff; font-weight: 800; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.leaflet-container { font: inherit; }
#geo-open { margin-top: 8px; }
@media (max-width: 600px) { .geo-map { height: 360px; } }
/* Carte en plein écran */
.geo-map.map-fullscreen { position: fixed !important; top: 0 !important; left: 0 !important; right: 0; bottom: 0; width: 100vw !important; margin: 0; z-index: 2000; border-radius: 0; border: none; }
.map-fs a { width: auto !important; padding: 0 10px; font-weight: 700; font-size: 13px; white-space: nowrap; background: #fff; color: var(--text) !important; }
.map-fullscreen .map-fs a { background: var(--primary-btn, var(--primary)); color: #fff !important; }

.map-fs { clear: both; }
.leaflet-control-layers-expanded { padding: 6px 10px; font-size: 13px; border-radius: 10px !important; }
.leaflet-control-layers-base label { margin: 2px 0; font-weight: 600; font-size: 13px; }
.leaflet-control-layers-base input { margin: 0 6px 0 0; width: auto; height: auto; }
.af-meter { flex: 1 1 80px; min-width: 60px; max-width: 160px; height: 10px; border-radius: 999px; background: #eee; overflow: hidden; align-self: center; }
.af-meter span { display: block; height: 100%; width: 0; background: var(--ok); transition: width 0.08s; }
.geo-map.player-map { height: 300px; margin: 6px 0 12px; }
/* Boussole : vraie flèche + repère nord */
.geo-dial { position: relative; width: 170px; height: 170px; }
.geo-dial .arrow { width: 70%; height: 70%; transition: transform 0.25s ease-out; filter: drop-shadow(0 3px 4px rgba(0,0,0,0.25)); }
.geo-dial .dial-n { position: absolute; inset: 0; text-align: center; font-weight: 800; font-size: 0.85rem; color: var(--muted); padding-top: 4px; transition: transform 0.25s ease-out; pointer-events: none; }
.geo-status { margin: 0 0 10px; }
#geo-compass-btn { margin-bottom: 10px; }

/* Carte joueur : zone à atteindre */
.geo-map-legend { font-size: .82rem; color: var(--muted, #6f6a86); margin: -4px 0 12px; line-height: 1.35; }
.leaflet-tooltip.zone-label { background: #ff3d71; color: #fff; border: 0; border-radius: 999px; font-weight: 800; font-size: .8rem; padding: 3px 9px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.leaflet-tooltip.zone-label::before { border-top-color: #ff3d71; }
.leaflet-tooltip.zone-label.inside { background: #10b981; }
.leaflet-tooltip.zone-label.inside::before { border-top-color: #10b981; }

/* ============================================================
   PAGE D'INVITATION (écran d'accueil du lien de partage)
   ============================================================ */
.screen.invite { max-width: 1040px; }
.inv-hero { padding: 4px 0 18px; }
.inv-photos { position: relative; width: 100%; max-width: 440px; aspect-ratio: 44 / 37; margin: 0 auto 10px; }
.polaroid {
    --r: 0deg;
    position: absolute; margin: 0; width: 43%;
    background: #fff; padding: 7px 7px 0; border-radius: 6px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    transform: rotate(var(--r));
    animation: inv-float 6s ease-in-out infinite;
}
.polaroid img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 2px; background: #eee; }
.polaroid figcaption { color: #3c325a; font-family: "Fraunces", Georgia, serif; font-weight: 700; text-align: center; font-size: 0.95rem; padding: 7px 4px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-left { --r: -9deg; left: 3%; top: 16%; animation-delay: -2s; }
.p-right { --r: 8deg; right: 3%; top: 13%; animation-delay: -4s; }
.p-center { --r: -2deg; left: 28.5%; top: 0; z-index: 2; }
.has-cover .p-center { width: 52%; left: 24%; }
@keyframes inv-float { 0%, 100% { transform: translateY(0) rotate(var(--r)); } 50% { transform: translateY(-8px) rotate(var(--r)); } }
.inv-seal {
    position: absolute; z-index: 3; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 64px; height: 64px; border-radius: 50%;
    display: grid; place-items: center; font-size: 30px;
    background: var(--primary); border: 4px solid #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    animation: inv-pulse 2.6s ease-in-out infinite;
}
@keyframes inv-pulse { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.08); } }

.inv-head { text-align: center; color: #fff; }
.inv-kicker {
    display: inline-block; margin: 0 0 12px; padding: 6px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
    color: var(--accent); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
}
.inv-title { font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: clamp(2rem, 8vw, 3.2rem); line-height: 1.06; letter-spacing: -0.01em; margin: 0 0 10px; text-wrap: balance; }
.inv-hunt { color: rgba(255, 255, 255, 0.75); font-style: italic; font-size: 1.05rem; margin: 0 0 16px; }
.inv-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.inv-chips li {
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px; padding: 6px 13px; font-weight: 700; font-size: 0.88rem; color: #fff;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

.inv-ticket, .inv-how { background: #fff; color: var(--text); border-radius: 22px; box-shadow: var(--shadow); }
.inv-ticket { padding: 22px 20px 16px; margin: 0 0 22px; border-top: 6px solid var(--accent); }
.inv-letter-label { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary-dark); margin: 0 0 6px; }
.inv-letter { margin: 0 0 16px; padding: 0 0 16px; border-bottom: 2px dashed var(--border); font-family: "Fraunces", Georgia, serif; font-weight: 500; font-size: 1.14rem; line-height: 1.5; color: #2d2748; }
.inv-ticket .name-field { margin-top: 0; }
.inv-ticket #btn-start.primary, .inv-ticket #btn-resume, #btn-go2 { font-size: 1.15rem; padding: 18px; font-weight: 800; box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22); animation: inv-glow 2.8s ease-in-out infinite; }
@keyframes inv-glow { 0%, 100% { box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22); } 50% { box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22), 0 0 0 6px rgba(255, 255, 255, 0.25); } }

.inv-how { padding: 24px 20px 20px; margin: 0 0 22px; }
.inv-how h2 { font-family: "Fraunces", Georgia, serif; font-size: 1.7rem; margin: 0 0 4px; }
.inv-how-sub { color: var(--muted); margin: 0 0 18px; }
.inv-steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 12px; }
.inv-steps li { display: flex; gap: 14px; align-items: center; background: #faf9fe; border-radius: 16px; padding: 12px; }
.inv-steps h3 { margin: 0 0 2px; font-size: 1.05rem; }
.inv-steps p { margin: 0; font-size: 0.92rem; color: var(--muted); }
.inv-thumb { position: relative; flex: 0 0 78px; height: 78px; }
.inv-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; box-shadow: 0 6px 14px rgba(20, 10, 50, 0.18); }
.inv-thumb b {
    position: absolute; top: -8px; left: -8px; width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center; background: var(--primary-btn, var(--primary)); color: #fff; font-size: 0.9rem; border: 3px solid #fff;
}
.inv-thumb.emoji { display: grid; place-items: center; font-size: 2.1rem; border-radius: 14px; background: linear-gradient(135deg, var(--bg2), var(--bg)); }
.inv-tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.inv-tips li { font-size: 0.9rem; background: #fffbea; border-left: 4px solid var(--accent); border-radius: 10px; padding: 9px 12px; }

.inv-go { text-align: center; margin: 0 0 24px; }
.inv-ready { font-family: "Fraunces", Georgia, serif; font-size: 1.7rem; font-weight: 700; color: #fff; margin: 0 0 4px; }
#btn-go2 { max-width: 440px; }

.inv-foot {
    display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
    background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px; padding: 18px 20px; color: #fff;
}
.inv-foot strong { font-size: 1.05rem; }
.inv-foot p { margin: 4px 0 0; color: rgba(255, 255, 255, 0.78); font-size: 0.9rem; max-width: 520px; }
.inv-foot .btn { background: #fff; color: var(--bg); font-weight: 800; white-space: nowrap; }

@media (min-width: 880px) {
    .screen.invite.active {
        display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; align-items: start;
        grid-template-areas: "photos head" "photos ticket" "how how" "go go" "foot foot";
        padding-top: 24px;
    }
    .inv-hero { display: contents; }
    .inv-photos { grid-area: photos; align-self: center; max-width: 480px; margin: 0; justify-self: center; }
    .inv-head { grid-area: head; text-align: left; padding: 10px 0 20px; }
    .inv-chips { justify-content: flex-start; }
    .inv-ticket { grid-area: ticket; }
    .inv-how { grid-area: how; padding: 32px; }
    .inv-steps { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .inv-steps li { flex-direction: column; align-items: flex-start; padding: 14px; }
    .inv-thumb { flex: none; width: 100%; height: auto; aspect-ratio: 16 / 10; }
    .inv-thumb.emoji { font-size: 3rem; }
    .inv-tips { grid-template-columns: repeat(3, 1fr); }
    .inv-go { grid-area: go; }
    .inv-foot { grid-area: foot; }
}
@media (prefers-reduced-motion: reduce) {
    .polaroid, .inv-seal, .inv-ticket #btn-start.primary, .inv-ticket #btn-resume, #btn-go2 { animation: none; }
}
/* Avec une photo de couverture : légende centrale lisible, sceau en coin */
.has-cover .inv-seal { bottom: auto; top: -3%; left: 76%; }
.has-cover .p-left figcaption, .has-cover .p-right figcaption { visibility: hidden; }

/* ============================================================
   MODE ÉQUIPES : inscription, salle d'attente, rassemblement, barre d'équipe, podium
   ============================================================ */
.selfie-field { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 14px; }
.selfie-frame {
    width: 132px; height: 132px; border-radius: 50%; overflow: hidden; cursor: pointer;
    background: #f1eefa; border: 4px solid var(--accent); display: grid; place-items: center; font-size: 3rem;
    box-shadow: 0 8px 22px rgba(20, 10, 50, 0.18);
}
.selfie-frame img { width: 100%; height: 100%; object-fit: cover; }
#btn-edit-reg { display: block; margin: 8px auto 0; }

.avatar-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 8px; margin-top: 12px; }
.avatar-wall.small { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); }
.avatar { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; position: relative; animation: pop 0.35s ease; }
.avatar-pic {
    width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, var(--bg2), var(--bg));
    color: #fff; font-weight: 800; font-size: 1.4rem; display: grid; place-items: center; border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(20, 10, 50, 0.2);
}
.avatar-wall.small .avatar-pic { width: 52px; height: 52px; font-size: 1.1rem; }
.avatar-pic img { width: 100%; height: 100%; object-fit: cover; }
.avatar-name { font-size: 0.78rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.me .avatar-pic { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 202, 58, 0.45); }
.avatar.done .avatar-pic, .avatar.in .avatar-pic { border-color: var(--ok); }
.avatar.absent { opacity: 0.4; }
.avatar-badge { position: absolute; top: -4px; right: calc(50% - 38px); background: var(--ok); color: #fff; font-size: 0.7rem; font-weight: 800; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #fff; }
.lobby-count { font-size: 1.4rem; font-weight: 800; color: var(--primary-dark); margin: 0 0 4px; }

.chain-target { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 8px 0 14px; }
.chain-target img { width: 220px; height: 220px; object-fit: cover; border-radius: 22px; border: 5px solid #fff; box-shadow: 0 14px 30px rgba(20, 10, 50, 0.3); }
.chain-name { font-size: 1.5rem; font-weight: 800; }
.my-code { margin-top: 18px; padding: 14px; border-radius: 16px; background: #faf9fe; text-align: center; border: 2px dashed var(--border); }
.my-code-val { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 2.6rem; font-weight: 800; letter-spacing: 0.3em; color: var(--primary-dark); margin: 4px 0; }
.rally-waiting { font-size: 1.15rem; font-weight: 800; color: var(--ok); margin: 0 0 4px; }
/* ---------- Rassemblement aux cris d'animaux ---------- */
/* ---------- Qui crie ? / Qui est-ce ? ---------- */
.whocries { display: flex; flex-direction: column; gap: 12px; }
.cry-play { width: 100%; }
.cry-play.on { animation: cryPulse 0.7s ease-in-out 2; }
.cries-choices { grid-template-columns: 1fr 1fr; }
.cry-opt { font-size: 1.05rem; justify-content: center; text-align: center; }
.whois { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.whois-frame { width: min(260px, 70vw); aspect-ratio: 1; border-radius: 24px; overflow: hidden; border: 5px solid #fff; box-shadow: var(--shadow); background: #ddd; }
.whois-frame img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.08); transition: filter 0.25s linear; }
.whois-clock { margin: 0; min-height: 1.2em; }
.whois-names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.whois-name { justify-content: center; }
.whois-name.good { background: #e2f6ec; color: #17603f; }
.whois-name.bad { background: #fde8ea; color: #8f1f2b; opacity: 0.6; }
/* ---------- Orchestre des animaux ---------- */
.orch-box { text-align: center; background: #faf9fe; border: 2px dashed var(--border); border-radius: 16px; padding: 14px 12px 8px; margin: 0 0 12px; }
.orch-box h3 { margin: 0 0 4px; }
.orch-seq { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 6px; }
.orch-note { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; background: #fff; border: 2px solid var(--border); opacity: 0.55; transition: transform 0.15s, opacity 0.15s; }
.orch-note.done { opacity: 1; border-color: var(--ok); background: #e2f6ec; }
.orch-note.now { opacity: 1; border-color: var(--primary); transform: scale(1.15); box-shadow: 0 0 0 3px rgba(255, 111, 97, 0.25); animation: cryPulse 0.9s ease-in-out infinite; }
.orch-note.mine { box-shadow: inset 0 -4px 0 var(--accent); }
.orch-note.lit { opacity: 1; transform: scale(1.2); background: #fff3c4; }
.orch-status { font-weight: 800; margin: 4px 0 10px; min-height: 1.3em; }
.orch-status.me { color: var(--primary-dark); font-size: 1.15rem; }
.orch-mine { padding: 6px 0 2px; }
.orch-mine-emoji { font-size: 3.4rem; line-height: 1.1; }
.orch-mine-name { font-weight: 800; font-size: 1.15rem; }
.orch-btn { width: 100%; margin: 8px 0 4px; }
.orch-tools { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 6px; }
.orch-who { margin-top: 8px; font-size: 0.82rem; color: var(--muted); }
.orch-who summary { cursor: pointer; }
.orch-who ul { list-style: none; margin: 6px 0 0; padding: 0; }
.cry-card { text-align: center; padding: 14px 12px 12px; border-radius: 20px; background: linear-gradient(135deg, #fff7e6, #ffe9f0); border: 2px solid #ffd79a; margin: 6px 0 12px; }
.cry-label { display: block; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary-dark); }
.cry-emoji { font-size: 4.6rem; line-height: 1.15; }
.cry-card.on .cry-emoji { animation: cryPulse 0.9s ease-in-out infinite; }
.cry-name { font-size: 1.5rem; font-weight: 800; }
.cry-sound { font-size: 1.15rem; font-weight: 800; color: var(--primary-dark); margin-top: 2px; }
@keyframes cryPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14) rotate(-4deg); } }
.cry-btn { width: 100%; margin: 0 0 10px; }
.link-btn { display: block; margin: 6px auto 0; padding: 6px; background: none; border: none; color: var(--muted); text-decoration: underline; font: inherit; font-size: 0.88rem; cursor: pointer; }
.cry-credits { margin-top: 10px; font-size: 0.78rem; color: var(--muted); }
.cry-credits summary { cursor: pointer; }
.cry-credits ul { margin: 6px 0 0; padding-left: 18px; }
.sound-tip { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: #fff7e6; border: 2px solid #ffd79a; border-radius: 16px; padding: 12px; margin: 12px 0; }
.sound-tip-ico { font-size: 2rem; line-height: 1; }
.sound-tip p { margin: 4px 0 8px; }
.volume-sheet { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); background: rgba(20, 12, 40, 0.72); }
.volume-card { width: 100%; max-width: 460px; background: #fff; color: var(--text); border-radius: 24px; padding: 20px 20px 14px; text-align: center; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3); animation: fadein 0.3s ease; }
.volume-ico { font-size: 3.4rem; line-height: 1.1; animation: cryPulse 1s ease-in-out infinite; }
.volume-card h2 { margin: 4px 0 6px; }
.volume-steps { list-style: none; margin: 10px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; font-size: 0.95rem; }
.volume-steps li { background: #faf9fe; border-radius: 12px; padding: 8px 12px; }
.volume-card .btn { width: 100%; margin-top: 6px; }
/* ---------- Salle de contrôle : cris par équipe ---------- */
.cry-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cry-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: 0.85rem; padding: 6px 8px; border-left: 4px solid var(--team, #DDD8EA); background: #F8F6FC; border-radius: 8px; }
.cry-list .cry-of { font-weight: 700; white-space: nowrap; }
.cry-bank { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cry-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; border: 1px solid #E6E2F2; border-radius: 12px; background: #fff; font: inherit; color: var(--text); cursor: pointer; transition: background .15s, border-color .15s; }
.cry-tile:hover { border-color: var(--primary); background: #FFF6F4; }
.cry-tile.playing { border-color: var(--primary); background: #FFE9E5; box-shadow: 0 0 0 2px rgba(255, 111, 97, 0.25); }
.cry-tile .ct-emoji { font-size: 1.6rem; line-height: 1.1; }
.cry-tile.playing .ct-emoji { animation: cryPulse 0.8s ease-in-out infinite; }
.cry-tile .ct-name { font-size: 0.74rem; font-weight: 700; text-align: center; line-height: 1.15; }
.cry-tile .ct-play { position: absolute; top: 4px; right: 6px; font-size: 0.66rem; color: var(--primary-dark); }
.cry-tile .ct-team { position: absolute; top: 3px; left: 5px; font-size: 0.72rem; }
.team-reveal .team-name { font-size: 2.2rem; font-weight: 900; margin: 0 0 6px; }

.team-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-left: 6px solid var(--team, var(--accent));
    border-radius: 14px; padding: 8px 12px; margin: -6px 0 14px; color: #fff;
}
.team-badge { font-weight: 800; font-size: 0.95rem; }
.team-bar-avatars { display: flex; gap: 4px; margin-left: auto; }
.mini-avatar { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: var(--bg2); display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; border: 2px solid rgba(255, 255, 255, 0.5); }
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mini-avatar.done { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok); }
.mini-avatar.me { border-color: var(--accent); }
.mini-avatar.absent { opacity: 0.35; }
.team-wait { text-align: center; }
.team-wait h2 { color: var(--ok); }

.podium { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.podium li { display: grid; grid-template-columns: 34px 30px 1fr auto auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #faf9fe; border-left: 6px solid var(--team, var(--border)); font-size: 0.95rem; }
.podium li.me { background: #fff4d6; font-weight: 700; }
.podium li.top1 { background: #fff8dc; }
.podium .p-rank { font-size: 1.2rem; text-align: center; }
.podium .p-pts { font-weight: 800; color: var(--primary-dark); white-space: nowrap; }
.podium .p-time { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.team-result { font-weight: 700; text-align: center; margin: 0 0 10px; }

/* ============================================================
   ADMIN SUR ÉCRAN D'ORDINATEUR : navigation, colonnes, salle de contrôle
   ============================================================ */
.topnav { display: none; }
.status.team { background: #e7eefb; color: #24467f; }
.team-cta { border: 2px solid var(--accent); }
@media (min-width: 1000px) {
    body.admin .wrap { max-width: 1000px; padding: 24px 24px 80px; }
    body.admin.wide .wrap { max-width: 1360px; }
    .topbar { grid-template-columns: 44px auto 1fr; padding: 10px 24px; }
    .topbar h1 { text-align: left; font-size: 1.15rem; }
    .topbar .menu { display: none; }
    .topnav { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
    .topnav a { font-size: 0.9rem; padding: 6px 12px; border-radius: 999px; color: #fff; text-decoration: none; }
    .topnav a:hover, .topnav a.on { background: rgba(255, 255, 255, 0.14); }
    .topnav a.logout { opacity: 0.7; margin-left: 8px; }
    .hunt-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 22px; align-items: start; }
    .col-side { position: sticky; top: 70px; }
    .hunt-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .hunt-item { margin: 0; align-content: start; }
    .console-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 22px; align-items: start; }
    .login { margin-top: 90px; }
}

/* ---------- Salle de contrôle ---------- */
.phase-steps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.phase-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: #E6F0F3; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.phase-steps li.on { background: var(--bg); color: #fff; }
.phase-steps li.done { background: #e2f6ec; color: #17603f; }
.ph-num { width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, 0.6); color: inherit; display: grid; place-items: center; font-size: 0.8rem; }
.phase-steps li.on .ph-num { background: var(--accent); color: #3a2a00; }
.phase-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.phase-clock { margin-left: auto; font-weight: 700; }
.teams-board { margin-top: 6px; }
.c-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.c-card { position: relative; text-align: center; padding: 12px 8px 8px; border-radius: 14px; background: #F5FAFB; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.c-card.absent { opacity: 0.45; }
.c-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, var(--bg2), var(--bg)); color: #fff; font-weight: 800; display: grid; place-items: center; flex: none; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(14, 42, 71, 0.2); }
.c-avatar img { width: 100%; height: 100%; object-fit: cover; }
.c-avatar.absent { filter: grayscale(1); opacity: 0.5; }
.c-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.c-col { border-radius: 14px; background: #F5FAFB; border-top: 6px solid var(--team, var(--border)); padding: 10px 10px 8px; min-height: 120px; }
.c-col.unassigned { --team: #B8CCD8; border-style: dashed; border-width: 2px; border-color: #B8CCD8; background: #fff; }
.c-col.over { outline: 3px dashed var(--primary); outline-offset: -3px; background: #fff6f5; }
.c-col h3 { margin: 0 0 4px; font-size: 1rem; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.c-team-title { cursor: pointer; }
.c-team-count { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.c-team-status { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); font-weight: 600; margin-bottom: 8px; min-height: 24px; }
.c-player { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-top: 1px solid var(--border); cursor: grab; }
.c-player.dragging { opacity: 0.4; }
.c-player.absent .c-player-name { text-decoration: line-through; color: var(--muted); }
.c-player-info { flex: 1; min-width: 0; }
.c-player-name { font-weight: 700; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-done { font-size: 1rem; }
.c-menu { position: relative; }
.c-menu summary { list-style: none; cursor: pointer; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.c-menu summary::-webkit-details-marker { display: none; }
.c-menu summary:hover { background: #E3EDF0; }
.c-menu-list { position: absolute; right: 0; top: 30px; z-index: 5; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); min-width: 180px; padding: 4px; display: flex; flex-direction: column; }
.c-menu-btn { text-align: left; background: none; border: none; font: inherit; font-size: 0.88rem; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.c-menu-btn:hover { background: #E6F0F3; }
.c-menu-btn.danger { color: var(--error); }
.ranking-table td, .ranking-table th { white-space: nowrap; }
.ranking { overflow-x: auto; }
.rally-place-row { border-left: 6px solid var(--team); padding: 6px 0 6px 10px; margin-bottom: 12px; }
.rally-place-row textarea { margin: 6px 0; }
.rally-place-row .code-input { margin-bottom: 0; }
.team-pin span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; font-size: 1.15rem; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); position: relative; }
.team-pin span b { position: absolute; right: -6px; bottom: -6px; background: #fff; color: #22203a; font-size: 0.7rem; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; }
dialog.dialog { border: none; border-radius: 18px; padding: 22px; box-shadow: var(--shadow); max-width: 420px; width: 92vw; }
dialog.dialog::backdrop { background: rgba(14, 42, 71, 0.5); }
dialog.dialog h2 { margin-top: 0; }

/* ---------- Jeux d'équipe : rôles, énigme éclatée, photo en morceaux, clé à plusieurs mains ---------- */
.team-role { font-size: 0.8rem; font-weight: 700; background: rgba(255, 255, 255, 0.16); border-radius: 999px; padding: 2px 9px; }
.avatar-role { font-size: 0.68rem; color: var(--muted); font-weight: 600; }
.team-note { background: #fff4d6; color: #6b4d00; border-radius: 12px; padding: 10px 14px; font-size: 0.92rem; font-weight: 500; margin: 0 0 12px; }
.tile-box { margin: 0 0 14px; }
.tile-view { width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; background: #f1eefa center / cover no-repeat; border: 4px dashed var(--accent); box-shadow: inset 0 0 0 4px #fff; }
.tile-box p { text-align: center; margin: 8px 0 0; }
.keys-box { text-align: center; background: #faf9fe; border: 2px dashed var(--border); border-radius: 16px; padding: 14px 14px 8px; margin: 0 0 12px; }
.keys-box h3 { margin: 0 0 4px; }
.keys-status { font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); margin: 10px 0 2px; }
.c-bot { font-size: 0.7rem; background: #e7eefb; color: #24467f; border-radius: 999px; padding: 1px 7px; font-weight: 700; }
.codes-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.codes-table th, .codes-table td { padding: 4px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
.codes-table input { width: 78px; margin: 0; padding: 5px 6px; text-align: center; font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
.codes-table td:first-child { text-align: left; }

/* ============================================================
   ADMIN : refonte (barre latérale, cartes, onglets, salle de contrôle)
   ============================================================ */
body.admin { background: #EEF5F7; color: var(--text); font-family: "Nunito Sans", -apple-system, "Segoe UI", Roboto, sans-serif; }
body.admin .shell { display: flex; min-height: 100vh; }
body.admin .sidebar { display: none; }
body.admin .content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
body.admin .wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 16px 60px; box-sizing: border-box; }
body.admin h1, body.admin h2 { font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; }
body.admin h2 { font-size: 1.25rem; }
body.admin .card { border: 1px solid #D5E3E8; box-shadow: none; border-radius: 16px; }
body.admin .btn { border-radius: 10px; padding: 10px 16px; font-weight: 700; gap: 8px; }
body.admin .btn.primary { background: var(--primary-btn); }
body.admin .btn.primary:hover { background: var(--primary-dark); }
body.admin .btn.dark { background: var(--bg); color: #fff; }
body.admin .btn.ghost { background: #fff; border-color: #C9DBE2; }
body.admin .btn.small { padding: 7px 12px; font-size: 0.85rem; }
body.admin .btn.tiny { padding: 5px 10px; font-size: 0.8rem; border-radius: 8px; }
body.admin .btn.big { border-radius: 12px; }
body.admin .empty { color: var(--muted); }
body.admin label { font-weight: 700; }
body.admin .flash { border-radius: 12px; }
body.admin details.new-hunt summary { cursor: pointer; }

/* Barre du haut (téléphone) */
body.admin .topbar { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 10px 12px; background: var(--bg); color: #fff; }
body.admin .topbar h1 { font-size: 1.05rem; text-align: center; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: "Nunito Sans", sans-serif; font-weight: 800; }
body.admin .topbar .back { display: flex; align-items: center; justify-content: center; color: #fff; }
body.admin .topnav { display: none; }

/* Pastilles */
.pill { display: inline-block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: #E6F0F3; color: #24415E; }
.pill.encours { background: #E2F6EC; color: #17603F; }
.pill.prete { background: #FFF4D6; color: #6B4D00; }
.pill.terminee { background: #E7EEFB; color: #24467F; }
.pill.brouillon { background: #E6F0F3; color: #4A6076; }
.pill.pause { background: #FDE8EA; color: #8F1F2B; }
.pill.mode.group { background: #E7EEFB; color: #24467F; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }

/* En-tête de page, fil d'Ariane, onglets */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); margin: 0 0 10px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs svg { width: 14px; height: 14px; }
.crumbs strong { color: var(--text); font-weight: 700; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 18px; }
.page-title-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.9rem; line-height: 1.1; }
.page-sub { font-size: 0.9rem; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid #C9DBE2; margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; font-weight: 700; font-size: 0.92rem; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--text); border-bottom-color: var(--primary); }
.tabs .count { margin-left: 6px; font-size: 0.72rem; padding: 1px 7px; border-radius: 999px; background: var(--bg); color: #fff; }
.hunt-nav a[data-tab="console"], .hunt-nav a[data-tab="players"] { margin-left: auto; }
.phase-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: 0 0 12px; }
.phase-settings a { color: var(--primary-dark); font-weight: 700; }
.dlg { border: none; border-radius: 20px; padding: 22px 24px; max-width: 460px; width: calc(100vw - 32px); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3); }
.dlg::backdrop { background: rgba(20, 12, 40, 0.55); }
.dlg h2 { margin: 0 0 6px; }
.tab-panel[hidden] { display: none !important; }

/* Tableau de bord : filtres et cartes */
.chips-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid #C9DBE2; background: #fff; color: var(--text); font: inherit; font-weight: 600; font-size: 0.82rem; cursor: pointer; }
.chip.on { background: var(--bg); color: #fff; border-color: var(--bg); }
.search-box { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid #C9DBE2; background: #fff; color: var(--muted); margin: 0 0 0 auto; width: 240px; max-width: 100%; box-sizing: border-box; font-weight: 400; }
.search-box input { border: none; outline: none; background: transparent; font: inherit; color: var(--text); width: 100%; margin: 0; padding: 0; }
.hunt-cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
.hunt-card { background: #fff; border: 1px solid #D5E3E8; border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.hunt-card[hidden] { display: none !important; }
.hunt-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hunt-card-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hunt-card-title > a { font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-weight: 700; font-size: 1.25rem; line-height: 1.15; color: var(--text); text-decoration: none; }
.hunt-card-meta { margin: 0; font-size: 0.85rem; color: var(--muted); }
.card-live { display: flex; flex-direction: column; gap: 7px; }
.live-row { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.live-num { width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 0.7rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.live-row .live-name { font-weight: 700; width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-row .live-bar { flex: 1 1 60px; }
.live-row .live-step { width: 84px; text-align: right; font-weight: 600; }
.card-hint { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #F5FAFB; border: 1px dashed #C9DBE2; color: var(--muted); font-size: 0.85rem; }
.card-hint.ok { border-style: solid; color: #17603F; }
.card-hint svg { flex: none; }
.hunt-card-actions { display: flex; gap: 8px; margin-top: auto; }
.hunt-card-actions .btn { flex: 1 1 auto; justify-content: center; }
.create-card { border-style: dashed; border-color: #B8CCD8; justify-content: center; }
.create-title { font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-weight: 700; font-size: 1.25rem; }
.kebab { position: relative; }
.kebab summary { list-style: none; cursor: pointer; width: 34px; height: 34px; border-radius: 8px; border: 1px solid #D5E3E8; background: #fff; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.kebab summary::-webkit-details-marker { display: none; }
.kebab-list { position: absolute; right: 0; top: 38px; z-index: 6; min-width: 200px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 4px; display: flex; flex-direction: column; }
.kebab-list a, .kebab-list button { text-align: left; background: none; border: none; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; width: 100%; box-sizing: border-box; }
.kebab-list a:hover, .kebab-list button:hover { background: #E6F0F3; }
.kebab-list button.danger { color: var(--error); }
.kebab-list form { display: contents; }
dialog.dialog { border: none; border-radius: 18px; padding: 22px; box-shadow: var(--shadow); max-width: 520px; width: 92vw; }
dialog.dialog::backdrop { background: rgba(14, 42, 71, 0.5); }
dialog.dialog h2 { margin-top: 0; }

/* Page d'une chasse : colonnes, table des étapes, colonne latérale */
.hunt-grid { display: flex; flex-direction: column; gap: 18px; }
.hunt-grid .col-side { display: flex; flex-direction: column; gap: 14px; order: -1; }
.hunt-grid .col-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.steps-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.steps-toolbar .muted { flex: 1 1 260px; }
.step-table { background: #fff; border: 1px solid #D5E3E8; border-radius: 16px; overflow: hidden; }
.step-table .step-head { display: none; }
.step-table ol { list-style: none; margin: 0; padding: 0; }
.step-row { display: grid; grid-template-columns: 24px 32px 56px minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px 14px; border-top: 1px solid #E3EDF0; }
.step-row:first-child { border-top: none; }
.step-row.dragging { opacity: 0.5; background: #F5FAFB; }
.step-handle { color: #9FB6C6; cursor: grab; touch-action: none; user-select: none; display: flex; justify-content: center; }
.step-num { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); color: #fff; font-weight: 800; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; }
.step-list.saved .step-num { background: var(--ok); }
.step-thumb { width: 56px; height: 50px; object-fit: cover; border-radius: 10px; background: #E6F0F3; display: flex; align-items: center; justify-content: center; color: #6E8797; }
.step-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.step-title { font-weight: 800; font-size: 0.98rem; }
.step-clue { font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-place { font-size: 0.8rem; color: var(--muted); }
.step-tags { display: flex; gap: 6px; flex-wrap: wrap; grid-column: 3 / -1; }
.step-tag { font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #E6F0F3; color: #24415E; }
.step-tag.team { background: #E7EEFB; color: #24467F; }
.step-tag.geo { background: #E2F6EC; color: #17603F; }
.step-tag.paper { background: #FBF1DC; color: #6B4A12; }
.step-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: 0.12em; font-size: 0.9rem; padding: 3px 9px; border-radius: 8px; background: #FFF4D6; color: #6B4D00; white-space: nowrap; }
.step-code.none { font-family: inherit; letter-spacing: 0; font-weight: 700; background: #E2F6EC; color: #17603F; }
.step-actions { grid-column: 3 / -1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.step-actions form { display: inline-flex; gap: 6px; margin: 0; }
.step-actions .btn.placed { background: #E2F6EC; color: #17603F; border-color: #A9DFC4; }
.step-actions .icon-btn { width: 30px; height: 30px; padding: 0; justify-content: center; }
.step-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid #E3EDF0; background: #F5FAFB; font-size: 0.85rem; color: var(--muted); }
.side-card { background: #fff; border: 1px solid #D5E3E8; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.side-card h2 { margin: 0; font-size: 1.1rem; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-head .score { font-size: 0.75rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #FFF4D6; color: #6B4D00; }
.side-head .score.ok { background: #E2F6EC; color: #17603F; }
.progress-bar { height: 8px; border-radius: 999px; background: #E6F0F3; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 0.85rem; }
.check-list li { display: flex; align-items: center; gap: 10px; }
.check-list li a { color: var(--text); text-decoration: none; }
.check-list li.todo a { font-weight: 700; }
.check-ico { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: #E2F6EC; color: #17603F; }
.check-list li.todo .check-ico { background: #FFF4D6; color: #6B4D00; font-weight: 800; font-size: 0.75rem; }
.side-card.dark { background: var(--bg); color: #fff; border-color: var(--bg); }
.side-card.dark .muted { color: #D7E4EE; }
.side-card.dark h2 { color: #fff; }
.side-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.side-stats div { background: rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; }
.side-stats b { font-size: 1.25rem; }
.side-stats b.txt { font-size: 0.95rem; line-height: 1.3; padding-top: 4px; }
.side-stats small { font-size: 0.72rem; color: #9FB6C6; }
.side-card.dark .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.qr-mini { display: flex; gap: 14px; align-items: center; }
.qr-mini .qr { margin: 0; padding: 6px; border-radius: 10px; }
.qr-mini .qr img, .qr-mini .qr canvas { width: 88px !important; height: 88px !important; }
.qr-mini-txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.qr-mini-txt .url { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.share-panel { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.share-grid { display: grid; gap: 24px; }
@media (min-width: 900px) { .share-grid { grid-template-columns: 340px minmax(0, 1fr); align-items: start; } }
.invite-panel h2 { margin-top: 0; }
.invite-panel textarea { width: 100%; min-height: 150px; font: inherit; font-size: 0.95rem; line-height: 1.45; }
.invite-channels { display: flex; flex-wrap: wrap; gap: 8px; }
.invite-channels .btn { flex: 1 1 150px; justify-content: center; }
.btn.inv-wa { background: #188741; color: #fff; border-color: #188741; } /* vert WhatsApp assombri : 4,6:1 */
.btn.inv-sms { background: #23873d; color: #fff; border-color: #23873d; }
.btn.inv-mail { background: #4A5568; color: #fff; border-color: #4A5568; }
.btn.inv-tg { background: #229ED9; color: #fff; border-color: #229ED9; }
.btn.inv-wa:hover, .btn.inv-sms:hover, .btn.inv-mail:hover, .btn.inv-tg:hover { filter: brightness(0.94); color: #fff; }
.inv-forward { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
/* ---------- QR code à scanner ---------- */
.qr-box { text-align: center; margin: 0 0 12px; }
.qr-box .btn { width: 100%; }
.qr-box p { margin: 8px 0 0; }
.scan-overlay { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.scan-overlay[hidden] { display: none; }
#scan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: relative; width: min(70vw, 320px); aspect-ratio: 1; border: 3px solid #fff; border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45); }
.scan-msg { position: relative; color: #fff; margin: 18px 24px 0; font-weight: 700; text-align: center; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.scan-close { position: absolute; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); }
.share-panel .qr { margin: 0; }
.share-panel .url { max-width: 100%; }

/* Salle de contrôle */
.phase-track { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 0; }
.phase-track li { display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; background: #fff; border: 1px solid #C9DBE2; color: var(--muted); font-weight: 700; font-size: 0.82rem; white-space: nowrap; }
.phase-track li.on { background: var(--bg); color: #fff; border-color: var(--bg); }
.phase-track li.done { background: #E2F6EC; color: #17603F; border-color: #E2F6EC; }
.phase-track .ph-num { width: 22px; height: 22px; border-radius: 50%; background: #E6F0F3; color: var(--text); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; }
.phase-track li.on .ph-num { background: var(--accent); color: #3A2A00; }
.phase-track li.done .ph-num { background: var(--ok); color: #fff; }
.phase-track .ph-link { width: 18px; height: 2px; background: #C9DBE2; }
.phase-track .ph-link.done { background: var(--ok); }
.phase-help { font-size: 0.85rem; color: var(--muted); margin: 0 0 14px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.kpi { background: #fff; border: 1px solid #D5E3E8; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi .k-label { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.kpi .k-value { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.kpi .k-value.ok { color: #1F7A4F; }
.kpi .k-value.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.kpi .k-sub { font-size: 0.75rem; color: var(--muted); }
.kpi.dark { background: var(--bg); color: #fff; border-color: var(--bg); }
.kpi.dark .k-label, .kpi.dark .k-sub { color: #9FB6C6; }
.console-grid { display: flex; flex-direction: column; gap: 18px; }
.console-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.console-side { display: flex; flex-direction: column; gap: 12px; }
.console-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.console-head h2 { margin: 0; }
.panel { background: #fff; border: 1px solid #D5E3E8; border-radius: 16px; overflow: hidden; }
.panel > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #F5FAFB; font-weight: 800; font-size: 0.92rem; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary .p-sum { margin-left: auto; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.panel > summary .p-arrow { color: var(--muted); transition: transform 0.15s; }
.panel[open] > summary .p-arrow { transform: rotate(180deg); }
.panel-body { padding: 12px 16px 16px; }
.panel-body label { font-size: 0.9rem; }
.rally-mode-form { margin: 0 0 12px; padding: 0 0 12px; border-bottom: 1px dashed #D5E3E8; }
/* Menu d'un participant dans le mur : centré sous le bouton (sinon il sort de l'écran sur la première colonne) */
.c-card .kebab-list { right: auto; left: 50%; transform: translateX(-50%); }
.msg-log { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px dashed #D5E3E8; display: flex; flex-direction: column; gap: 6px; }
.msg-log li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-size: 0.82rem; }
.msg-log .msg-to { font-weight: 800; color: var(--text); white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.msg-log .msg-txt { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-log .msg-at { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.74rem; }
/* ---------- Défi photo d'équipe : téléphone ---------- */
.photo-box { text-align: center; background: #F5FAFB; border: 2px dashed var(--border); border-radius: 16px; padding: 14px 14px 8px; margin: 0 0 12px; }
.photo-box h3 { margin: 0 0 4px; }
.photo-preview { margin: 8px auto 10px; max-width: 320px; border-radius: 14px; overflow: hidden; border: 3px solid #fff; box-shadow: var(--shadow); background: #000; }
.photo-preview img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-status { font-size: 1rem; }
.photo-status.refused { color: var(--error); }
/* ---------- Défi photo d'équipe : console ---------- */
.chip-photo { font-size: 0.72rem; font-weight: 800; background: #FFF1C2; color: #7A5A00; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.ph-item { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 10px 0 10px 10px; border-top: 1px solid #E3EDF0; border-left: 4px solid var(--team, #C9DBE2); }
.ph-item:first-child { border-top: none; }
.ph-thumb img { display: block; width: 110px; height: 82px; object-fit: cover; border-radius: 10px; background: #000; }
.ph-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ph-actions { display: flex; gap: 6px; margin-top: 4px; }
.ph-gal-title { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
.ph-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ph-cell { position: relative; display: block; border-radius: 10px; overflow: hidden; border: 2px solid var(--team, #C9DBE2); background: #000; }
.ph-cell img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ph-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 6px; background: rgba(27, 18, 48, 0.6); color: #fff; font-size: 0.68rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg-label { display: block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: #E6F0F3; border-radius: 12px; }
.seg label { flex: 1 1 0; position: relative; margin: 0; text-align: center; padding: 8px 6px; border-radius: 9px; font-size: 0.82rem; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg label input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.seg label:has(input:checked) { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(27, 18, 48, 0.12); }
.seg label:has(input:disabled) { cursor: default; opacity: 0.75; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 1px; }
.danger-strip { border: 1px solid #F3C0BA; border-radius: 16px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #FFF7F6; font-size: 0.82rem; color: #8F2A1F; font-weight: 700; }
.danger-strip form { display: flex; gap: 6px; margin-left: auto; }
.danger-strip .btn { border-color: #F3C0BA; color: #B83A2C; background: #fff; }
.tcards { display: grid; grid-template-columns: 1fr; gap: 12px; }
.tcard { background: #fff; border: 1px solid #D5E3E8; border-radius: 16px; overflow: hidden; border-top: 5px solid var(--team, #C9DBE2); }
.tcard.unassigned { border-style: dashed; border-top-style: solid; --team: #B8CCD8; }
.tcard.over { outline: 3px dashed var(--primary); outline-offset: -3px; background: #FFF6F5; }
.tcard-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.tcard-num { width: 34px; height: 34px; border-radius: 50%; background: var(--team, #6E8797); color: #fff; font-weight: 800; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; flex: none; }
.tcard-title { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.tcard-title b { font-size: 0.98rem; cursor: pointer; }
.tcard-title small { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.tcard-title small.ok { color: #17603F; }
.tcard-count { font-size: 0.78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tcard-body { padding: 0 14px 8px; }
.trow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid #E3EDF0; cursor: grab; }
.trow.dragging { opacity: 0.4; }
.trow.absent { opacity: 0.5; }
.trow .c-avatar { width: 34px; height: 34px; }
.trow .c-avatar.in { border-color: var(--ok); }
.trow-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.trow-name { font-weight: 700; font-size: 0.88rem; display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-sub { font-size: 0.75rem; color: var(--muted); }
.trow-state { font-size: 0.75rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.trow-state.ok { color: #17603F; }
.c-bot { font-size: 0.65rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: #E7EEFB; color: #24467F; }
.icon-btn { width: 32px; height: 32px; padding: 0 !important; justify-content: center; }
.codes-table input { border-radius: 8px; }

.ready-bar { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #D5E3E8; border-radius: 12px; padding: 10px 12px; text-decoration: none; color: var(--text); font-size: 0.85rem; font-weight: 700; margin: -6px 0 4px; }
.ready-bar .progress-bar { flex: 1 1 auto; }
.ready-bar .score { font-size: 0.75rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #FFF4D6; color: #6B4D00; }
.ready-bar .score.ok { background: #E2F6EC; color: #17603F; }
@media (max-width: 999px) {
    body.admin.own-head .page-head h1, body.admin.own-head .crumbs { display: none; }
    .hunt-grid .col-side { order: 2; }
    .step-actions .btn.tiny { padding: 5px 8px; }
}

/* Connexion */
body.admin .login { max-width: 400px; margin: 40px auto; text-align: center; }

/* ---------- Ordinateur ---------- */
@media (min-width: 1000px) {
    body.admin .sidebar { display: flex; flex-direction: column; width: 236px; flex: none; box-sizing: border-box; background: var(--bg); color: #fff; padding: 22px 14px; position: sticky; top: 0; height: 100vh; }
    body.admin.console .sidebar { width: 72px; padding: 22px 12px; align-items: center; }
    .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; color: #fff; text-decoration: none; }
    .brand-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
    .brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
    .brand-txt b { font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-size: 1.05rem; }
    .brand-txt small { font-size: 0.68rem; color: #9FB6C6; letter-spacing: 0.08em; text-transform: uppercase; }
    .nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #D7E4EE; text-decoration: none; font-weight: 600; font-size: 0.9rem; border-left: 3px solid transparent; }
    .nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
    .nav-item.on { background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 700; border-left-color: var(--primary); }
    .nav-sub { margin: 2px 0 4px 26px; display: flex; flex-direction: column; gap: 2px; }
    .nav-sub a { padding: 7px 12px; border-radius: 10px; color: #9FB6C6; text-decoration: none; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid transparent; }
    .nav-sub a.on { background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 700; border-left-color: var(--primary); }
    .nav-sec { font-size: 0.68rem; color: #6E8797; letter-spacing: 0.08em; text-transform: uppercase; padding: 14px 12px 6px; border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 10px; }
    .nav-grow { flex: 1 1 auto; }
    .nav-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); }
    .nav-avatar { width: 32px; height: 32px; border-radius: 50%; background: #6A4C93; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; flex: none; }
    .nav-user-txt { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
    .nav-user-txt b { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .nav-user-txt small { font-size: 0.7rem; color: #9FB6C6; }
    .nav-user a { color: #9FB6C6; display: flex; }
    body.admin.console .brand-txt, body.admin.console .nav-item span, body.admin.console .nav-sub, body.admin.console .nav-sec, body.admin.console .nav-user-txt, body.admin.console .nav-user a { display: none; }
    body.admin.console .brand { padding: 0 0 16px; }
    body.admin.console .nav-item { padding: 12px; border-left: none; justify-content: center; border-radius: 12px; }
    body.admin.console .nav-user { background: transparent; padding: 0; }

    body.admin .topbar { background: #fff; color: var(--text); border-bottom: 1px solid #D5E3E8; padding: 12px 32px; grid-template-columns: 36px 1fr 36px; }
    body.admin .topbar h1 { text-align: left; font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-size: 1.3rem; }
    body.admin .topbar .back { color: var(--text); }
    body.admin .topbar .menu { display: none; }
    body.admin.own-head .topbar { display: none; }
    body.admin .wrap { max-width: 1000px; padding: 28px 32px 80px; margin: 0; }
    body.admin.wide .wrap { max-width: 1360px; }
    .page-head h1 { font-size: 2.1rem; }

    .hunt-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .hunt-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 22px; }
    .ready-bar { display: none; }
    .hunt-grid .col-side { order: 2; position: sticky; top: 24px; }
    .step-table .step-head { display: grid; grid-template-columns: 24px 36px 64px minmax(0, 1fr) 132px 92px 168px; gap: 12px; padding: 10px 18px; background: #F5FAFB; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
    .step-row { grid-template-columns: 24px 36px 64px minmax(0, 1fr) 132px 92px 168px; gap: 12px; padding: 12px 18px; }
    .step-actions { flex-wrap: nowrap; }
    .step-thumb { width: 64px; height: 56px; }
    .step-tags, .step-actions { grid-column: auto; }
    .step-tags { flex-direction: column; align-items: flex-start; }
    .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .console-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; gap: 20px; }
    .tcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1400px) {
    .hunt-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Accessibilité et mobile ---------- */
@media (min-width: 1000px) { body.admin .sidebar { height: 100dvh; } }
.toast { pointer-events: auto; cursor: pointer; } /* toucher un message le ferme */
@media (prefers-reduced-motion: reduce) {
    .cry-play.on, .cry-card.on .cry-emoji, .volume-ico, .cry-tile.playing .ct-emoji, .af-rec.recording, .live-dot,
    .unlock.go svg, .unlock.go .shackle, .unlock.go .unlock-text { animation: none !important; }
    .orch-note.now { transform: none; }
}
/* Dernier message de l'organisateur : reste affiché tant qu'on ne l'a pas fermé */
.last-msg { position: sticky; top: max(8px, env(safe-area-inset-top)); z-index: 60; display: flex; align-items: flex-start; gap: 10px;
    margin: 8px auto 0; max-width: 560px; padding: 12px 14px; border-radius: 14px; background: #fff; color: var(--text);
    box-shadow: var(--shadow); border-left: 5px solid var(--accent); }
.last-msg[hidden] { display: none; }
.last-msg .lm-body { flex: 1; min-width: 0; }
.last-msg .lm-from { display: block; font-size: .8rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.last-msg .lm-text { display: block; margin-top: 2px; font-weight: 700; overflow-wrap: anywhere; }
.last-msg .lm-close { flex: none; width: 44px; height: 44px; margin: -8px -8px -8px 0; border: none; background: none; font-size: 1.1rem; color: var(--muted); cursor: pointer; }
/* Photo d'indice : s'agrandit aussi au clavier */
#step-photo[role=button], #final-photo[role=button], #game-photo[role=button] { cursor: zoom-in; }
/* Réglages : un seul bouton d'enregistrement, toujours à portée */
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; margin-top: 12px; padding: 12px 0;
    background: rgba(245, 243, 251, 0.94); backdrop-filter: blur(4px); border-top: 1px solid var(--border); }
.save-bar[hidden] { display: none; }

/* ---------- Check-up du téléphone ---------- */
.checkup-entry { margin: 10px 0 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.checkup-state.ok { color: var(--ok); font-weight: 700; }
.checkup-state.warn { color: var(--error); font-weight: 700; }
body.play .checkup-entry .checkup-state.ok { color: #7ee2b0; }
body.play .checkup-entry .checkup-state.warn { color: #ffb4a8; }
.checkup-sheet { position: fixed; inset: 0; z-index: 95; display: flex; align-items: flex-end; justify-content: center;
    padding: 16px 16px max(16px, env(safe-area-inset-bottom)); background: rgba(20, 12, 40, 0.72); }
.checkup-sheet[hidden] { display: none; }
.checkup-card { width: 100%; max-width: 520px; max-height: calc(100dvh - 32px); overflow-y: auto; background: #fff; color: var(--text);
    border-radius: 24px; padding: 20px; box-shadow: var(--shadow); }
.checkup-card h2 { margin: 0 0 6px; }
.checkup-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.ck-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #F5FAFB; }
.ck-row .ck-ico { font-size: 1.2rem; line-height: 1.3; width: 1.5em; text-align: center; flex: none; }
.ck-row .ck-body { min-width: 0; }
.ck-row strong { display: block; }
.ck-row .ck-detail { display: block; font-size: .92rem; color: var(--muted); overflow-wrap: anywhere; }
.ck-row.ck-warn { background: #fff5e0; }
.ck-row.ck-fail { background: #fdecee; }
.ck-row.ck-warn .ck-detail, .ck-row.ck-fail .ck-detail { color: var(--text); }
.checkup-ask { margin-top: 12px; padding: 12px; border-radius: 12px; background: #eef4ff; }
.checkup-ask p { margin: 0 0 8px; font-weight: 700; }
.checkup-summary { margin: 14px 0 0; font-weight: 800; }
.checkup-summary.ok { color: var(--ok); }
.checkup-summary.warn { color: var(--error); }
.c-avatar { position: relative; }
.c-check { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
    font-size: 11px; font-weight: 900; line-height: 1; color: #fff; background: #c0303f; border: 2px solid #fff; }

/* ---------- Tuto « Comment ça va se passer » (chasses en groupe) ---------- */
.tuto-entry { margin: 14px 0 4px; text-align: center; }
.tuto-sheet { position: fixed; inset: 0; z-index: 96; display: flex; align-items: flex-end; justify-content: center;
    padding: 16px 16px max(16px, env(safe-area-inset-bottom)); background: rgba(20, 12, 40, 0.78); }
.tuto-sheet[hidden] { display: none; }
@media (min-width: 700px) { .tuto-sheet { align-items: center; } }
.tuto-card { width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); overflow-y: auto; background: #fff; color: var(--text);
    border-radius: 26px; padding: 16px 18px 18px; box-shadow: var(--shadow); }
.tuto-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tuto-kicker { margin: 0; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tuto-skip { min-height: 44px; padding: 0 6px; border: none; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.tuto-viewport { overflow: hidden; margin: 6px -18px 0; touch-action: pan-y; }
.tuto-slides { display: flex; margin: 0; padding: 0; list-style: none; transition: transform .38s cubic-bezier(.2, .8, .2, 1); }
.tuto-slide { flex: 0 0 100%; box-sizing: border-box; padding: 8px 22px 4px; text-align: center; min-height: 290px; }
.tuto-emoji { width: 96px; height: 96px; margin: 6px auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 2.9rem;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .55), transparent 55%), linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 10px 26px rgba(0, 0, 0, .18); }
.tuto-slide h2 { margin: 0 0 10px; font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-size: 1.5rem; line-height: 1.15; }
.tuto-slide p { margin: 0 auto 8px; max-width: 36ch; line-height: 1.5; color: #3b3854; }
.tuto-dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 12px; }
.tuto-dots span { width: 8px; height: 8px; border-radius: 99px; background: #CFDFE6; transition: width .25s, background .25s; }
.tuto-dots span.done { background: var(--primary-btn, var(--primary)); opacity: .45; }
.tuto-dots span.on { width: 22px; background: var(--primary-btn, var(--primary)); }
.tuto-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tuto-nav .btn { min-height: 48px; min-width: 110px; }
.tuto-count { font-size: .85rem; font-weight: 700; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .tuto-slides, .tuto-dots span { transition: none; } }

/* ---------- Papier froissé parlant (Voixy) : encart d'étape et lecteur plein écran ---------- */
.paper-box { text-align: center; margin: 0 0 12px; padding: 14px 14px 16px; border: 2px dashed #e0d3b8; border-radius: 16px; background: #fffaf0; }
.paper-box h3 { margin: 4px 0 4px; }
.paper-box p { margin: 0 0 12px; }
.paper-box .btn { width: 100%; }
.paper-ball { width: 78px; height: 66px; margin: 0 auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 70'%3E%3Cpath d='M12 31 21 12 38 5 57 9 71 22 75 41 64 59 43 66 23 62 8 47Z' fill='%23f7efdc' stroke='%23a2906f' stroke-width='2.2' stroke-linejoin='round'/%3E%3Cpath d='M31 29 38 5 57 9 45 37Z' fill='%23eadcbf'/%3E%3Cpath d='M45 37 75 41 64 59Z' fill='%23e0cfae'/%3E%3Cpath d='M8 47 31 29 23 62Z' fill='%23ece0c6'/%3E%3Cpath d='M21 12 31 29 12 31M57 9 71 22 45 37 75 41M45 37 43 66M31 29 45 37M23 62 31 29 8 47M64 59 45 37' fill='none' stroke='%23c4b28f' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; animation: paper-wobble 3.4s ease-in-out infinite; }
@keyframes paper-wobble { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(6deg) translateY(-3px); } }
.paper-replay { display: block; margin: 10px auto 0; }

html.pr-open, html.pr-open body { overflow: hidden; }
.paper-reader { position: fixed; inset: 0; z-index: 110; background: #120c08; color: #fff; }
.paper-reader[hidden], .pr-scan[hidden], .pr-letter[hidden], .pr-wave[hidden], .pr-text[hidden] { display: none; }
.pr-scan { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#pr-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pr-top { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; z-index: 2; }
.pr-pill { background: rgba(0, 0, 0, 0.55); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; }
.pr-x { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 1.1rem; cursor: pointer; }
.pr-frame { position: relative; width: min(82vw, 54vh); aspect-ratio: 1; margin-bottom: 12vh; border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.4); }
.paper-reader:not(.live) .pr-frame { box-shadow: none; }
.pr-frame i { position: absolute; width: 36px; height: 36px; border: 4px solid rgba(255, 255, 255, 0.85); transition: border-color 0.2s, transform 0.2s; }
.pr-frame i:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.pr-frame i:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 12px 0 0; }
.pr-frame i:nth-child(3) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; }
.pr-frame i:nth-child(4) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 12px; }
.pr-frame i.on { border-color: #5fd39a; transform: scale(1.1); }
.pr-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 18px max(18px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, 0.78) 40%); text-align: center; }
.pr-msg { min-height: 2.8em; max-width: 30em; margin: 0 auto 10px; font-weight: 700; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.pr-msg.go { color: #9df0c4; }
.pr-msg.bad { color: #ffb9ad; }
.pr-meter { height: 6px; max-width: 320px; margin: 0 auto 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.pr-meter span { display: block; width: 0; height: 100%; background: #5fd39a; transition: width 0.25s; }
.pr-tools { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pr-tool { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.1); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.pr-tool[aria-pressed="true"] { background: #fff; color: #222; }

.pr-letter { position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 30%, #3c2b1d, #120c08 72%); }
.pr-sheet { position: relative; width: min(100%, 440px); padding: 24px 22px 22px; color: #2c2216; text-align: center; background: #fbf6ea; border-radius: 4px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); transform: rotate(-1.2deg); }
/* Plis du papier : facettes claires et sombres qui s'estompent quand il se déplie */
.pr-sheet::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0.5; background:
    linear-gradient(118deg, transparent 31%, rgba(120, 90, 50, 0.13) 31.5%, transparent 46%),
    linear-gradient(64deg, transparent 52%, rgba(255, 255, 255, 0.55) 52.5%, transparent 64%),
    linear-gradient(161deg, transparent 63%, rgba(120, 90, 50, 0.12) 63.4%, transparent 80%),
    linear-gradient(23deg, transparent 18%, rgba(120, 90, 50, 0.1) 18.4%, transparent 30%),
    linear-gradient(97deg, transparent 72%, rgba(255, 255, 255, 0.5) 72.4%, transparent 86%); }
.pr-sheet.unfold { animation: paper-unfold 0.95s cubic-bezier(0.2, 0.9, 0.25, 1.12) both; }
.pr-sheet.unfold::before { animation: crease-fade 1.8s ease both; }
@keyframes paper-unfold {
    0% { transform: scale(0.16) rotate(-42deg); border-radius: 46%; filter: brightness(0.8); }
    55% { transform: scale(1.04) rotate(3deg); border-radius: 12px; filter: none; }
    100% { transform: rotate(-1.2deg); border-radius: 4px; }
}
@keyframes crease-fade { from { opacity: 1; } to { opacity: 0.5; } }
.pr-kicker { margin: 0 0 14px; font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-weight: 600; font-size: 1.3rem; }
.pr-play { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--primary-btn, #c2544a); color: #fff; font-size: 1.5rem; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.pr-play.ask { animation: pr-pulse 1.1s ease-in-out infinite; }
@keyframes pr-pulse { 50% { transform: scale(1.1); box-shadow: 0 0 0 12px rgba(194, 84, 74, 0.22); } }
.pr-wave { margin: 14px 0 4px; }
.pr-wave canvas { display: block; width: 100%; height: 54px; }
.pr-text { position: relative; margin: 12px 0 0; font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-size: 1.22rem; line-height: 1.5; white-space: pre-line; text-align: left; }
.pr-text .w { color: rgba(44, 34, 22, 0.3); transition: color 0.25s; }
.pr-text .w.said { color: #2c2216; }
.pr-text .w.now { color: var(--primary-btn, #c2544a); }
.paper-reader.played .pr-text .w { color: #2c2216; }
.pr-status { max-width: 440px; margin: 16px auto 0; }
.pr-status.ok { color: #9df0c4; }
.pr-status.error { color: #ffb9ad; }
.pr-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.btn.ghost-light { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.45); }
@media (prefers-reduced-motion: reduce) { .paper-ball, .pr-play.ask, .pr-sheet.unfold, .pr-sheet.unfold::before { animation: none; } }

/* Papier froissé parlant : section du formulaire d'étape */
.paper-field { margin: 18px 0 14px; padding: 12px 14px; border: 1.5px solid #EAD9B5; border-radius: 14px; background: #FFFAF0; }
.paper-toggle { margin: 0; align-items: flex-start; }
.paper-toggle input { flex: none; margin-top: 2px; }
.paper-body { margin-top: 10px; }
.paper-modes { margin-bottom: 4px; }
.paper-preview { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-top: 12px; }
.paper-preview canvas { width: 210px; max-width: 100%; height: auto; border: 1px solid #DDD; border-radius: 3px; background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); }
.paper-side { flex: 1; min-width: 200px; }
.paper-side .badge { margin: 0 0 6px; }
.badge.ok { background: #E2F6EC; color: #17603F; }
.badge.warn { background: #FDE8E4; color: #9A2E1E; }

/* ============================================================
   COMPAGNIE : logo, nom et navire en tête du jeu (réglages de la chasse)
   ============================================================ */
.brand-bar { position: relative; z-index: 2; width: 100%; max-width: 520px; display: flex; align-items: center; gap: 10px; margin: 0 0 12px; color: #fff; }
.brand-logo { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: contain; background: #fff; border: 2px solid rgba(255, 255, 255, 0.6); }
.brand-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-txt strong { font-size: 0.95rem; }
.brand-txt span { font-size: 0.82rem; opacity: 0.85; }
.brand-fields { border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 14px 4px; margin: 0 0 16px; }
.brand-color input { display: block; width: 72px; height: 42px; padding: 2px; margin-top: 6px; border: 1.5px solid var(--input-border); border-radius: 10px; background: #fff; cursor: pointer; }
.brand-logo-preview { width: 72px; height: 72px; border-radius: 50%; object-fit: contain; background: #fff; border: 1px solid var(--border); }

/* ============================================================
   THÈME « CARTE MARINE » (navires) : fond clair de carte, rose des vents, route en pointillés, tampons.
   --bg et --bg2 restent bleu nuit (pastilles, écran de projection, diplôme) : le fond clair de la page
   joueur est posé ici. La couleur de la compagnie arrive par --primary (réglages de la chasse).
   ============================================================ */
body.play.theme-marine {
    --text: #0e2a47; --muted: #4a6076; --border: #d5e3e8; --shadow: none; --radius: 22px;
    --soft: color-mix(in srgb, var(--primary) 12%, #fff);
    background: #eef5f7; color: var(--text);
    font-family: "Nunito Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.theme-marine .stars {
    opacity: 1;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300' fill='none' stroke='%230e2a47' stroke-opacity='.13' stroke-width='1.2'%3E%3Ccircle cx='150' cy='150' r='60'/%3E%3Ccircle cx='150' cy='150' r='96'/%3E%3Cpath d='M150 0V300M0 150H300M44 44L256 256M256 44L44 256M93 12L207 288M207 12L93 288M12 93L288 207M12 207L288 93'/%3E%3Cpath d='M150 70l14 66 66 14-66 14-14 66-14-66-66-14 66-14z' fill='%230e2a47' fill-opacity='.06'/%3E%3C/svg%3E") no-repeat right -110px top 30px / 300px 300px,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300' fill='none' stroke='%230e2a47' stroke-opacity='.1' stroke-width='1.2'%3E%3Ccircle cx='150' cy='150' r='60'/%3E%3Ccircle cx='150' cy='150' r='96'/%3E%3Cpath d='M150 0V300M0 150H300M44 44L256 256M256 44L44 256M93 12L207 288M207 12L93 288M12 93L288 207M12 207L288 93'/%3E%3C/svg%3E") no-repeat left -150px bottom -110px / 300px 300px;
}
.theme-marine h1, .theme-marine h2, .theme-marine h3 { font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-weight: 800; letter-spacing: -0.01em; }
.theme-marine .card, .theme-marine .inv-ticket, .theme-marine .inv-how { border: 2px solid var(--border); box-shadow: none; }
.theme-marine .inv-ticket { border-top: 6px solid var(--primary-btn); }
.theme-marine .btn { border-radius: 999px; }
.theme-marine .inv-ticket #btn-start.primary, .theme-marine .inv-ticket #btn-resume, .theme-marine #btn-go2 { box-shadow: none; animation: none; }
.theme-marine input:focus, .theme-marine textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.theme-marine .brand-bar { color: var(--text); }
.theme-marine .brand-logo { border: 2px dashed var(--primary-btn); }
.theme-marine .brand-txt span { color: var(--muted); opacity: 1; }

/* Accueil : le tampon à la rose des vents remplace les photos de maison */
.theme-marine .inv-head { color: var(--text); }
.theme-marine .inv-title { font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-weight: 800; letter-spacing: -0.02em; }
.theme-marine .inv-hunt { color: #24415e; font-style: normal; font-weight: 600; }
.theme-marine .inv-kicker { background: var(--soft); border-color: transparent; color: var(--primary-dark); }
.theme-marine .inv-chips li { background: #fff; border: 2px solid var(--border); color: var(--text); -webkit-backdrop-filter: none; backdrop-filter: none; }
.theme-marine .inv-photos:not(.has-cover) { aspect-ratio: auto; height: 104px; }
.theme-marine .inv-photos:not(.has-cover) .polaroid { display: none; }
.theme-marine .inv-seal { width: 84px; height: 84px; font-size: 38px; background: #fff; border: 3px dashed var(--primary-btn); box-shadow: none; animation: none; transform: translateX(-50%) rotate(-8deg); }
.theme-marine .inv-letter, .theme-marine .polaroid figcaption { font-family: "Nunito Sans", sans-serif; }
.theme-marine .inv-how h2, .theme-marine .inv-ready, .theme-marine .btn.primary.big { font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; }
.theme-marine .inv-letter { font-weight: 600; color: var(--text); }
.theme-marine .inv-letter-label { color: var(--primary-dark); }
.theme-marine .inv-ready { color: var(--text); font-weight: 800; }
.theme-marine .inv-steps li { background: #f4f9fa; }
.theme-marine .inv-thumb, .theme-marine .inv-thumb.emoji { flex-basis: 54px; height: 54px; }
.theme-marine .inv-thumb img { display: none; }
.theme-marine .inv-thumb b { position: static; width: 54px; height: 54px; border: 0; background: var(--soft); color: var(--primary-dark); font-size: 1.3rem; }
.theme-marine .inv-thumb.emoji { border-radius: 50%; background: var(--soft); font-size: 1.6rem; }
.theme-marine .inv-tips li { background: var(--soft); border-left-color: var(--primary-btn); }
.theme-marine .inv-foot { background: #fff; border: 2px solid var(--border); color: var(--text); }
.theme-marine .inv-foot p { color: var(--muted); }
.theme-marine .inv-foot .btn { background: var(--bg); color: #fff; }
body.play.theme-marine .checkup-entry .checkup-state.ok { color: var(--ok); }
body.play.theme-marine .checkup-entry .checkup-state.warn { color: var(--error); }

/* Étapes : la progression devient une route en pointillés, de repère en repère */
.theme-marine .progress { gap: 0; row-gap: 10px; padding: 0 6px; }
.theme-marine .dot { position: relative; width: 14px; height: 14px; background: #fff; border: 2px solid #9fb6c0; }
.theme-marine .dot + .dot { margin-left: 18px; }
.theme-marine .dot + .dot::before { content: ""; position: absolute; right: calc(100% + 5px); top: 50%; width: 12px; margin-top: -1px; border-top: 2px dotted rgba(14, 42, 71, 0.45); }
.theme-marine .dot.done { background: var(--primary-btn); border-color: var(--primary-btn); }
.theme-marine .dot.current { background: #fff; border: 4px solid var(--primary-btn); box-shadow: none; transform: scale(1.2); }
.theme-marine .progress-label { color: var(--text); opacity: 1; }
.theme-marine .clue { background: var(--soft); border-left-color: var(--primary-btn); font-weight: 600; }
.theme-marine .step-card figure img, .theme-marine .final-card figure img, .theme-marine .game-card figure img { background: #e3edf0; }
.theme-marine .paper-box { background: #fff; border-color: var(--primary-btn); }
.theme-marine .team-bar { background: var(--bg); border-color: var(--bg); }
.theme-marine .stats div { background: #f4f9fa; }

/* Arrivée : le symbole final devient un tampon */
.theme-marine .final-card .big-emoji { display: grid; place-items: center; width: 108px; height: 108px; margin: 0 auto 12px; border-radius: 50%; border: 3px dashed var(--primary-btn); font-size: 3rem; transform: rotate(-8deg); }

/* ============================================================
   CONSOLE DE L'ÉQUIPAGE AU STYLE « CARTE MARINE »
   Mêmes couleurs et polices que la vitrine (index.php) : fond de carte clair, encre bleu nuit, accent brique,
   ambre pour l'élément actif sur fond sombre. Les teintes violettes des sections « Salle de contrôle » et
   « ADMIN : refonte » ont été remplacées par les bleus de la carte ; ce bloc pose le reste.
   ============================================================ */
body.admin {
    --bg: #0e2a47; --bg2: #16416b; --text: #0e2a47; --muted: #4a6076;
    --primary: #c7431e; --primary-dark: #a83617; --primary-btn: #c7431e;
    --accent: #f2b441; --border: #d5e3e8; --input-border: #6e8a9a;
    --shadow: 0 10px 30px rgba(14, 42, 71, 0.18);
}
body.admin h1, body.admin h2 { font-weight: 800; letter-spacing: -0.01em; }
body.admin h3 { font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-weight: 700; }
body.admin .card, body.admin .hunt-card, body.admin .side-card:not(.dark) { border-width: 2px; border-color: var(--border); }
body.admin .btn, body.admin .btn.tiny, body.admin .btn.big { border-radius: 999px; }
body.admin .btn.primary, body.admin .btn.dark { font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; }
body.admin input:focus, body.admin textarea:focus, body.admin select:focus { box-shadow: 0 0 0 3px rgba(199, 67, 30, 0.18); }
body.admin .chip.on { background: var(--bg); border-color: var(--bg); }

/* Écran de connexion : la rose des vents en filigrane, le nom de la marque en grand */
body.admin .login { position: relative; overflow: hidden; border: 2px solid var(--border); border-radius: 26px; padding: 30px 26px 26px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300' fill='none' stroke='%230e2a47' stroke-opacity='.10' stroke-width='1'%3E%3Ccircle cx='150' cy='150' r='60'/%3E%3Ccircle cx='150' cy='150' r='96'/%3E%3Ccircle cx='150' cy='150' r='140'/%3E%3Cpath d='M150 0V300M0 150H300M44 44L256 256M256 44L44 256M93 12L207 288M207 12L93 288M12 93L288 207M12 207L288 93'/%3E%3Cpath d='M150 70l14 66 66 14-66 14-14 66-14-66-66-14 66-14z' fill='%230e2a47' fill-opacity='.05' stroke='none'/%3E%3C/svg%3E") no-repeat right -120px top -120px / 300px 300px; }
body.admin .login .login-mark { display: flex; justify-content: center; margin: 0 0 10px; }
body.admin .login h2 { font-size: 2.1rem; margin-bottom: 4px; }
body.admin .login .btn { min-height: 50px; font-size: 1.05rem; }

@media (min-width: 1000px) {
    body.admin .sidebar { background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300' fill='none' stroke='%23fff' stroke-opacity='.13' stroke-width='1'%3E%3Ccircle cx='150' cy='150' r='60'/%3E%3Ccircle cx='150' cy='150' r='96'/%3E%3Ccircle cx='150' cy='150' r='140'/%3E%3Cpath d='M150 0V300M0 150H300M44 44L256 256M256 44L44 256M93 12L207 288M207 12L93 288M12 93L288 207M12 207L288 93'/%3E%3Cpath d='M150 70l14 66 66 14-66 14-14 66-14-66-66-14 66-14z' fill='%23fff' fill-opacity='.07' stroke='none'/%3E%3C/svg%3E") no-repeat right -120px bottom -110px / 320px 320px; }
    body.admin .brand-ico { background: none; border-radius: 0; }
    body.admin .brand-txt b { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; }
    body.admin .nav-item.on, body.admin .nav-sub a.on { border-left-color: var(--accent); }
    body.admin .nav-sec { color: #9fb6c6; }
}
/* Boutons secondaires, champs et avatar : les teintes violettes de la base cèdent la place aux bleus de la carte */
body.admin .btn { background: #e3edf0; }
body.admin input[type=text], body.admin input[type=password], body.admin input[type=email], body.admin input[type=number],
body.admin input[type=url], body.admin input[type=tel], body.admin textarea { background: #f5fafb; }
@media (min-width: 1000px) {
    body.admin .nav-avatar { background: var(--accent); color: var(--bg); }
}
body.admin .quiz-fields, body.admin .game-config, body.admin .howto, body.admin .step-item.dragging { background: #f5fafb; }

/* ============================================================
   « LA CARTE PERDUE » (jeu de bord) : la carte qui se reconstitue lieu après lieu, le bon de récompense
   ============================================================ */
.map-card { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 10px; }
.map-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.map-head h2 { margin: 0; }
.map-count { font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.map-svg svg { display: block; width: 100%; height: auto; border-radius: 16px; }
.map-svg .map-flash { animation: map-flash 1.2s ease-in-out 3; }
@keyframes map-flash { 50% { stroke-opacity: 0.15; } }
@media (prefers-reduced-motion: reduce) { .map-svg .map-flash { animation: none; } }
.map-new { margin: 0; padding: 10px 14px; border-radius: 12px; background: #fff4d6; color: #6b4d00; font-weight: 700; }
.map-notes summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.map-notes ol { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.map-notes li b { display: block; }
.map-notes li span { color: var(--muted); }
.map-switch { margin: 0; font-size: 0.9rem; text-align: right; }
.final-map { margin: 6px 0 4px; }
.reward { margin: 12px 0; padding: 14px; border: 3px dashed var(--primary-btn, #c7431e); border-radius: 18px; text-align: center; }
.reward p { margin: 0; }
.reward-label { font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.reward-code { font-family: ui-monospace, Consolas, monospace; font-size: 2.2rem; font-weight: 800; letter-spacing: 0.25em; margin: 6px 0 !important; }

/* Console : jeux de bord « La carte perdue » (admin.php, jeu.php, step.php) */
body.admin .boards { margin: 0 0 26px; }
body.admin .boards-title { font-size: 1.3rem; margin: 6px 0 14px; }
body.admin .board-card { border-color: #0e2a47; }
body.admin .board-parcours { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
body.admin .board-route { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 16px; border-radius: 16px; background: #f5fafb; border: 2px solid var(--border); }
body.admin .board-route h3 { margin: 0 0 2px; font-size: 1.15rem; }
body.admin .board-route p { margin: 0; }
body.admin .board-route-actions { display: flex; flex-wrap: wrap; gap: 6px; }
body.admin .place-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
body.admin .place-row input[type=text] { width: auto; flex: 1 1 160px; margin: 0; padding: 8px 10px; }
body.admin .place-row input.deck { flex: 0 1 110px; }
body.admin .add-place { margin-top: 14px; }
body.admin .add-place summary { list-style: none; display: inline-flex; }
body.admin .add-place summary::-webkit-details-marker { display: none; }
body.admin .add-place-form { margin-top: 12px; }
body.admin .reward-form { display: flex; gap: 8px; }
body.admin .reward-form input { margin: 0; text-transform: uppercase; }
body.admin dialog.wide-dialog { max-width: 640px; }
body.admin fieldset.levels, body.admin fieldset.board-step { border: 2px solid var(--border); border-radius: 14px; padding: 10px 14px 4px; margin: 0 0 16px; }
body.admin fieldset legend { font-weight: 800; padding: 0 6px; }
body.admin .side-card .qr { display: flex; justify-content: center; background: #fff; padding: 10px; border-radius: 12px; }

/* Solution d'un mini-jeu pour l'animateur (step.php, liste des étapes de hunt.php) */
body.admin .solution-box { margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; border: 2px dashed #b8ccd8; background: #f5fafb; }
body.admin .solution-box summary { cursor: pointer; font-weight: 800; }
body.admin .solution-box dl { margin: 10px 0 6px; display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); gap: 6px 14px; }
body.admin .solution-box dt { font-weight: 700; color: var(--muted); font-size: 0.88rem; }
body.admin .solution-box dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 560px) { body.admin .solution-box dl { grid-template-columns: 1fr; } body.admin .solution-box dd { margin-bottom: 6px; } }
body.admin .step-solution { display: block; margin-top: 4px; font-size: 0.8rem; font-weight: 700; color: var(--ink2, #24415e); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Liste des étapes sur un écran moyen (1000 à 1499 px) : le jeu passe sous l'indice, l'indice garde de la place */
@media (min-width: 1000px) and (max-width: 1499px) {
    .step-table .step-head { grid-template-columns: 24px 36px 64px minmax(0, 1fr) 92px 168px; }
    .step-table .step-head span:nth-child(5) { display: none; }
    .step-row { grid-template-columns: 24px 36px 64px minmax(0, 1fr) 92px 168px; }
    .step-row .step-tags { grid-column: 4; grid-row: 2; flex-direction: row; flex-wrap: wrap; margin-top: -4px; }
    .step-row .step-body { grid-row: 1; }
    .step-row > .step-handle, .step-row > .step-num, .step-row > .step-thumb { grid-row: 1 / span 2; }
}

/* Flotte : compagnies, navires, ponts et lieux (flotte.php, navire.php) et choix des lieux à la création d'un jeu */
body.admin .fleet-import { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; border-color: #0e2a47; }
body.admin .fleet-import h2 { margin: 0 0 4px; }
body.admin .fleet-company-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body.admin .fleet-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
body.admin .fleet-inline input[type=text] { width: auto; flex: 1 1 200px; margin: 0; }
body.admin .fleet-inline .deck-number-new { flex: 0 0 80px; }
body.admin .deck-card { scroll-margin-top: 80px; }
body.admin .deck-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
body.admin .deck-head .deck-num { display: flex; align-items: center; gap: 6px; margin: 0; font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-size: 1.2rem; font-weight: 800; }
body.admin .deck-head .deck-num input { width: 64px; margin: 0; text-align: center; font-weight: 800; }
body.admin .deck-head > input[type=text] { flex: 1 1 200px; width: auto; margin: 0; font-weight: 700; }
body.admin .venue-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
body.admin .venue-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
body.admin .venue-row input[type=text] { width: auto; flex: 1 1 220px; margin: 0; padding: 8px 10px; }
body.admin .venue-row input.venue-detail { flex: 1.3 1 220px; font-size: 0.9rem; }
body.admin .venue-new { margin-top: 10px; padding-top: 10px; border-top: 2px dashed var(--border); }
body.admin .deck-index { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow: auto; }
body.admin .deck-index a { padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 0.9rem; }
body.admin .deck-index a:hover { background: #e6f0f3; }
body.admin .venue-picker { max-height: 300px; overflow: auto; border: 2px solid var(--border); border-radius: 14px; padding: 8px 12px; margin: 0 0 14px; }
body.admin .venue-picker fieldset { border: 0; padding: 0; margin: 0 0 8px; }
body.admin .venue-picker legend { font-weight: 800; padding: 0; margin: 4px 0; }
body.admin .venue-picker .check { margin: 2px 0; }

/* Miniatures des classes de navires (assets/ships/) : en vue dans le jeu et dans la console */
.ship-hero { margin: 0 auto 6px; max-width: 520px; width: 100%; padding: 12px; box-sizing: border-box; border-radius: 22px; background: #fff; border: 2px solid var(--border, #d5e3e8); position: relative; z-index: 1; }
.ship-hero img { display: block; width: 100%; height: auto; border-radius: 14px; }
.ship-hero figcaption { margin-top: 6px; text-align: center; font-weight: 800; color: var(--text, #0e2a47); }
.map-ship { display: block; width: 100%; height: auto; max-height: 120px; object-fit: contain; }
.final-ship { display: block; width: 100%; max-width: 420px; height: auto; margin: 4px auto 8px; }
body.admin .ship-thumb-cell { width: 120px; }
body.admin .ship-thumb { display: block; width: 110px; height: auto; border-radius: 8px; }
body.admin .ship-banner { margin: 0 0 14px; padding: 12px; border-radius: 18px; background: #fff; border: 2px solid var(--border); max-width: 760px; }
body.admin .ship-banner img { display: block; width: 100%; height: auto; }
body.admin .ship-banner figcaption { margin-top: 4px; text-align: center; font-weight: 800; }
body.admin .board-ship { display: block; width: 100%; height: auto; max-height: 130px; object-fit: contain; }

/* Création d'un jeu : fiche du navire trouvé par complétion */
body.admin .ship-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: -4px 0 14px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--border); background: #f5fafb; }
body.admin .ship-card img { width: 200px; max-width: 100%; height: auto; border-radius: 8px; background: #fff; }
body.admin .ship-card-info { display: flex; flex-direction: column; gap: 2px; flex: 1 1 200px; min-width: 0; }
body.admin .ship-card-info strong { font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-size: 1.15rem; }

/* Espaces compagnies (espaces.php) */
body.admin .space-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
body.admin .space-head h2 { margin: 0; }
body.admin .space-swatches { display: flex; gap: 4px; }
body.admin .space-swatches i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); }
body.admin .space-url { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
body.admin .space-url input { flex: 1 1 320px; width: auto; margin: 0; font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; }
body.admin .space-card details > summary { list-style: none; display: inline-flex; }
body.admin .space-card details > summary::-webkit-details-marker { display: none; }
body.admin .space-form { margin-top: 12px; }
body.admin .space-colors { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0 0 14px; }
body.admin .space-colors label { margin: 0; font-size: 0.85rem; }
body.admin .space-colors input[type=color] { display: block; width: 72px; height: 40px; padding: 2px; margin-top: 4px; border: 1.5px solid var(--input-border); border-radius: 10px; background: #fff; }

/* Nouveau jeu de bord : grande fenêtre, le navire à gauche, ses lieux et le parcours à droite */
body.admin dialog#create-dialog { max-width: 1180px; width: 96vw; max-height: 94vh; }
body.admin .board-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 0 28px; align-items: start; }
body.admin #create-dialog .venue-picker { max-height: 44vh; }
body.admin #create-dialog textarea[name=places] { min-height: 180px; }
@media (max-width: 900px) {
    body.admin .board-cols { grid-template-columns: 1fr; }
    body.admin #create-dialog .venue-picker { max-height: 300px; }
}

/* Espaces compagnies : page d'accueil (photo, logo) */
body.admin .space-hero { border: 2px solid var(--border); border-radius: 14px; padding: 12px 16px 4px; margin: 0 0 14px; }
body.admin .space-hero legend { font-weight: 800; padding: 0 6px; }
body.admin .space-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 14px; }
body.admin .space-pick-label { font-weight: 700; min-width: 52px; }
body.admin .space-thumb { position: relative; display: inline-flex; align-items: center; margin: 0; cursor: pointer; }
body.admin .space-thumb input { position: absolute; opacity: 0; }
body.admin .space-thumb img, body.admin .space-thumb span { display: flex; align-items: center; height: 64px; min-width: 64px; padding: 0 8px; border-radius: 10px; border: 2px solid var(--border); background: #fff; font-size: 0.85rem; }
body.admin .space-thumb img { width: auto; max-width: 140px; padding: 2px; object-fit: contain; }
body.admin .space-thumb input:checked + img, body.admin .space-thumb input:checked + span { border-color: var(--accent, #c7431e); box-shadow: 0 0 0 2px var(--accent, #c7431e); }
body.admin .space-thumb input:focus-visible + img, body.admin .space-thumb input:focus-visible + span { outline: 3px solid #0e2a47; outline-offset: 2px; }
body.admin .space-upload { margin: 0; font-size: 0.85rem; }
body.admin .space-upload input { display: block; margin-top: 4px; }

/* Animateurs : compagnie d'un compte */
body.admin .user-company select { margin: 0; padding: 6px 30px 6px 10px; min-height: 0; width: auto; max-width: 190px; font-size: 0.85rem; }

/* Agent IA : encadré de la demande, journal, grille de photos du Web */
body.admin .agent-box { border: 2px solid var(--border); border-radius: 14px; padding: 12px 16px 6px; margin: 0 0 14px; background: #fbfdfe; }
body.admin .agent-box legend { font-weight: 800; padding: 0 6px; }
body.admin .agent-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
body.admin .chip-btn { padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: #fff; color: inherit; font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
body.admin .chip-btn:hover:not(:disabled) { border-color: #0e2a47; }
body.admin .chip-btn:disabled { opacity: 0.5; cursor: default; }
body.admin .agent-langs, body.admin .agent-hunts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0 0 12px; }
body.admin .agent-langs .field-label, body.admin .agent-hunts .field-label { width: 100%; margin: 0; }
body.admin .agent-langs .check, body.admin .agent-hunts .check { margin: 0; }
body.admin .agent-log { margin: 12px 0; padding: 12px 14px 12px 34px; border-radius: 12px; background: #f1f6f8; font-size: 0.9rem; max-height: 300px; overflow: auto; }
body.admin .agent-log li { margin: 2px 0; }
body.admin .agent-log li.ok { color: #1c6b3a; }
body.admin .agent-log li.err { color: #a12a12; font-weight: 700; }
body.admin .web-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
body.admin .web-img { display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 12px; border: 2px solid var(--border); background: #fff; font: inherit; font-size: 0.72rem; color: inherit; text-align: left; cursor: pointer; }
body.admin .web-img:hover:not(:disabled) { border-color: #0e2a47; }
body.admin .web-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }

/* Jeu de bord : bouton de langue (drapeau + code), en haut à droite du jeu */
.lang-switch { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 10px; z-index: 30; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px; background: rgba(14, 42, 71, 0.88); color: #fff; font-weight: 800; font-size: 14px; text-decoration: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.lang-switch:focus-visible { outline: 3px solid #f2b441; outline-offset: 2px; }

/* Carte d'un jeu de bord : bouton de suppression */
body.admin .board-delete { margin: 0; flex: 0 0 auto; }
body.admin .board-delete .btn { min-width: 0; padding-left: 14px; padding-right: 14px; }

/* Agent IA au travail : boussole qui tourne, tâche en cours, barre de progression */
body.admin .agent-busy { display: flex; align-items: center; gap: 18px; margin: 14px 0 8px; padding: 16px 18px; border-radius: 16px; background: linear-gradient(120deg, #0e2a47, #1d4a72); color: #fff; box-shadow: 0 8px 24px rgba(14, 42, 71, 0.25); }
body.admin .agent-busy[hidden] { display: none; }
body.admin .agent-rose { flex: none; width: 64px; height: 64px; color: #f2b441; animation: agent-turn 2.4s linear infinite; filter: drop-shadow(0 0 10px rgba(242, 180, 65, 0.55)); }
body.admin .agent-rose svg { display: block; width: 100%; height: 100%; }
body.admin .agent-busy-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
body.admin .agent-task { font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-size: 1.05rem; }
body.admin .agent-tip { color: #c9d8e4; font-size: 0.9rem; min-height: 1.3em; animation: agent-fade 4.5s ease-in-out infinite; }
body.admin .agent-meta { color: #a9bfd1; font-size: 0.8rem; }
body.admin .agent-bar { position: relative; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); overflow: hidden; margin: 4px 0 2px; }
body.admin .agent-bar i { position: absolute; inset: 0 auto 0 0; width: 4%; border-radius: inherit; background: linear-gradient(90deg, #f2b441, #e8673f); transition: width 0.6s ease; }
body.admin .agent-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); animation: agent-shine 1.4s linear infinite; }
body.admin .agent-bar.indeterminate i { width: 35%; animation: agent-slide 1.3s ease-in-out infinite; }
body.admin .agent-busy.done { background: linear-gradient(120deg, #1c6b3a, #2a8a50); }
body.admin .agent-busy.done .agent-rose { animation: agent-lock 0.7s cubic-bezier(0.3, 1.6, 0.5, 1) forwards; }
body.admin .agent-busy.done .agent-bar i::after { animation: none; }
body.admin .agent-busy.small { gap: 12px; padding: 10px 14px; margin: 8px 0 0; }
body.admin .agent-busy.small .agent-rose { width: 40px; height: 40px; }
body.admin .agent-busy.small .agent-task { font-size: 0.95rem; }
body.admin .agent-log li.run { color: #0e2a47; font-weight: 700; }
body.admin .agent-log li.run::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -1px; animation: agent-turn 0.8s linear infinite; }
body.admin .btn.is-busy, body.admin .web-img.is-busy { cursor: progress; }
body.admin .mini-rose { display: inline-block; width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; animation: agent-turn 1.6s linear infinite; }
body.admin .mini-rose svg { display: block; width: 100%; height: 100%; }
body.admin .web-img.is-busy { border-color: #f2b441; animation: agent-pulse 1s ease-in-out infinite; }
@keyframes agent-turn { to { transform: rotate(360deg); } }
@keyframes agent-lock { from { transform: rotate(0deg) scale(1); } to { transform: rotate(0deg) scale(1.15); } }
@keyframes agent-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes agent-slide { 0% { left: -35%; } 100% { left: 100%; } }
@keyframes agent-fade { 0%, 100% { opacity: 0.35; } 20%, 80% { opacity: 1; } }
@keyframes agent-pulse { 50% { box-shadow: 0 0 0 4px rgba(242, 180, 65, 0.45); } }
@media (prefers-reduced-motion: reduce) {
    body.admin .agent-rose, body.admin .mini-rose, body.admin .agent-tip, body.admin .agent-bar i::after, body.admin .agent-log li.run::after, body.admin .web-img.is-busy { animation: none; }
    body.admin .agent-bar.indeterminate i { animation: none; width: 100%; opacity: 0.5; }
}

/* Page d'un jeu : vignette de chaque parcours */
body.admin .board-route .route-thumb { flex: none; width: 72px; height: 72px; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #eef5f7; color: #c7431e; border: 2px dashed #d5e3e8; }
body.admin .board-route .route-thumb img { width: 100%; height: 100%; object-fit: cover; }
body.admin .board-route .route-thumb.is-busy { border-color: #f2b441; animation: agent-pulse 1s ease-in-out infinite; }
body.admin .board-route > div:nth-child(2) { flex: 1 1 220px; min-width: 0; }

/* Plaques du navire (navireplaques.php) */
body.admin .plaque-list { display: flex; flex-direction: column; gap: 12px; }
body.admin .plaque-card { display: flex; flex-wrap: wrap; gap: 14px 18px; padding: 14px; border-radius: 16px; border: 2px solid var(--border); background: #f5fafb; }
body.admin .plaque-photo { position: relative; flex: 0 0 150px; height: 150px; border-radius: 12px; overflow: hidden; background: #e6eef1; display: flex; align-items: center; justify-content: center; }
body.admin .plaque-photo img { display: block; width: 150px; height: 150px; object-fit: cover; }
body.admin .plaque-nophoto { color: #6b8194; font-size: 0.85rem; font-weight: 700; }
body.admin .plaque-num { position: absolute; left: 6px; top: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(14, 42, 71, 0.85); color: #fff; font-size: 0.75rem; font-weight: 800; }
body.admin .plaque-fields { flex: 1 1 320px; min-width: 0; }
body.admin .plaque-fields label { margin-bottom: 8px; }
body.admin .plaque-file { font-size: 0.85rem; }
body.admin .plaque-file input { display: block; margin-top: 4px; font-size: 0.85rem; }
body.admin .plaque-venues { max-height: 420px; }
body.admin .plaque-how { margin: 0; padding-left: 20px; font-size: 0.9rem; display: flex; flex-direction: column; gap: 6px; }
body.admin .plaque-check { display: flex; align-items: center; gap: 8px; }
body.admin .plaque-check img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; flex: none; }

/* Jeu : photo de la plaque en dernier recours */
.help-photo { margin-top: 10px; }
.help-photo figure { margin: 10px 0 0; }
.help-photo img { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: 14px; }

/* Pose des plaques au téléphone : photo en un geste */
body.admin .shot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
body.admin .shot-btn, body.admin .pose-shot { cursor: pointer; margin: 0; }
body.admin .shot-status.ok { color: #1c6b3a; font-weight: 700; }
body.admin .shot-status.err { color: #a12a12; font-weight: 700; }
body.admin .shot-status.busy { color: #0e2a47; font-weight: 700; }
body.admin .plaque-photo.is-busy { outline: 3px solid #f2b441; animation: agent-pulse 1s ease-in-out infinite; }
body.admin .plaque-card.has-photo { border-color: #9fd3b4; }
body.admin .pose-card { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
body.admin .pose-card h1 { margin: 0; font-size: 1.9rem; line-height: 1.1; }
body.admin .pose-kicker { margin: 0; font-size: 0.85rem; font-weight: 800; color: #24415e; }
body.admin .pose-deck { margin: -6px 0 0; font-weight: 700; color: #24415e; }
body.admin .pose-photo { flex: none; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 16px; }
body.admin .pose-photo img { width: 100%; height: 100%; object-fit: cover; }
body.admin .pose-shot { display: flex; align-items: center; justify-content: center; min-height: 58px; font-size: 1.1rem; }
body.admin .pose-note { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
body.admin .pose-nav { display: flex; flex-direction: column; gap: 8px; }
body.admin .pose-nav .btn { justify-content: center; text-align: center; white-space: normal; min-height: 48px; }

/* Plaques à QR code : choix du navire */
body.admin .ship-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
body.admin .ship-pick-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--border); background: #f5fafb; color: inherit; text-decoration: none; }
body.admin .ship-pick-item:hover { border-color: #0e2a47; }
body.admin .ship-pick-item.has { border-color: #9fd3b4; background: #f1faf4; }

/* Suivi en direct d'un jeu de bord (suivi.php) */
body.admin .live-dot { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 0.8rem; font-weight: 700; color: #1c6b3a; }
body.admin .live-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #2a8a50; animation: agent-fade 1.8s ease-in-out infinite; }
body.admin .live-dot.off { color: #a12a12; }
body.admin .live-dot.off::before { background: #a12a12; animation: none; }
body.admin .kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
body.admin .kpi { display: flex; flex-direction: column; padding: 14px 16px; border-radius: 16px; background: #fff; border: 2px solid var(--border); }
body.admin .kpi b { font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-size: 2rem; line-height: 1; color: #0e2a47; }
body.admin .kpi span { font-weight: 800; margin-top: 4px; }
body.admin .kpi small { color: #5b7286; font-size: 0.78rem; }
body.admin .route-live { padding: 12px 0; border-top: 1.5px solid var(--border); }
body.admin .route-live:first-child { border-top: 0; }
body.admin .route-live-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
body.admin .route-bars { display: flex; align-items: flex-end; gap: 6px; height: 110px; }
body.admin .route-bar { position: relative; flex: 1 1 0; max-width: 64px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
body.admin .route-bar i { width: 100%; min-height: 3px; border-radius: 6px 6px 0 0; background: #24415e; }
body.admin .route-bar.end i { background: #c7431e; }
body.admin .route-bar b { position: absolute; top: 0; font-size: 0.85rem; }
body.admin .route-bar span { font-size: 0.75rem; color: #5b7286; margin-top: 2px; }
body.admin .card-head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
body.admin .card-head-row h2 { margin: 0; }
body.admin .card-head-row input { width: auto; flex: 0 1 260px; margin: 0; }
body.admin .mini-progress { width: 90px; height: 8px; border-radius: 999px; background: #e6eef1; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
body.admin .mini-progress i { display: block; height: 100%; background: #c7431e; border-radius: inherit; }
body.admin #players .pill { margin-left: 6px; }
body.admin .top-list, body.admin .recent-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
body.admin .top-list { counter-reset: rk; }
body.admin .top-list li { counter-increment: rk; display: flex; flex-direction: column; padding-left: 34px; position: relative; }
body.admin .top-list li::before { content: counter(rk); position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 50%; background: #0e2a47; color: #fff; font-weight: 800; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }
body.admin .top-list li.muted { padding-left: 0; }
body.admin .top-list li.muted::before { display: none; }
body.admin .recent-list li { font-size: 0.88rem; line-height: 1.3; }
body.admin .recent-list small { display: block; }
body.admin .lang-row { display: grid; grid-template-columns: 78px 1fr 28px; align-items: center; gap: 8px; font-size: 0.88rem; margin-bottom: 6px; }
body.admin .lang-bar { height: 8px; border-radius: 999px; background: #e6eef1; overflow: hidden; }
body.admin .lang-bar i { display: block; height: 100%; background: #24415e; }
body.admin .lang-row b { text-align: right; }
body.admin .hours { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
body.admin .hour { flex: 1 1 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; font-size: 0.68rem; color: #5b7286; }
body.admin .hour i { width: 100%; min-height: 3px; border-radius: 4px 4px 0 0; background: #f2b441; }
/* Suivi en direct : toutes les chasses sur un même écran (suivis.php) */
body.admin .game-live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
body.admin .game-live { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: #fff; border: 2px solid var(--border); color: inherit; text-decoration: none; }
body.admin .game-live.open { border-color: #9fd3b4; }
body.admin .game-live:hover, body.admin .game-live:focus-visible { border-color: #0e2a47; }
body.admin .game-live-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
body.admin .game-live-head strong { display: block; font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-size: 1.15rem; line-height: 1.15; }
body.admin .game-live-head small { display: block; font-size: 0.8rem; }
body.admin .game-live-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
body.admin .game-live-nums div { display: flex; flex-direction: column; }
body.admin .game-live-nums b { font-family: "Bricolage Grotesque", "Nunito Sans", sans-serif; font-size: 1.5rem; line-height: 1; color: #0e2a47; white-space: nowrap; }
body.admin .game-live-nums span { font-size: 0.74rem; color: #5b7286; }
body.admin .game-live-bar { height: 8px; border-radius: 999px; background: #e6eef1; overflow: hidden; }
body.admin .game-live-bar i { display: block; height: 100%; background: #c7431e; border-radius: inherit; }
body.admin .game-live-route { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: 0.85rem; padding-top: 6px; border-top: 1.5px solid var(--border); }
body.admin .game-live-more { margin-top: auto; font-weight: 800; font-size: 0.85rem; color: #c7431e; }
/* Image de l'étape pendant le mini-jeu : plus basse, pour garder le jeu à l'écran */
.game-card figure img { max-height: 34vh; }
.game-card figcaption { text-align: center; margin-top: 4px; }
