/* Les Enquêtes du Phoenix — interface joueur v2 (smartphone d'abord).
   Palette « ranch » (cuir, parchemin, braise, feuille). Les couleurs d'un
   scénario (color1/color2/color3/titleColor, posées sur :root par
   core/theme via scenario.js) restent prioritaires en mode jour ; le mode nuit
   garde sa propre palette et ne reprend que la couleur d'accent. */

:root {
  --cuir: #2a1d15;
  --encre: #2b2118;
  --muted: #7a6a58;
  --page: var(--color1, #f1e4c8);
  --carte: var(--color3, #fbf3e2);
  --chip: #e6d3ae;
  --line: rgba(43, 33, 24, .14);
  --soft: rgba(43, 33, 24, .08);
  --accent: var(--color2, #ff934f);
  --accent-d: color-mix(in srgb, var(--accent) 78%, #000);
  --on-accent: #2a1d15;
  --danger: #d7263d;
  --ok: #4b967d;
  --nav-bg: #2a1d15;
  --nav-ink: #bfa98f;
  --timer-bg: #2a1d15;
  --timer-ink: #f1e4c8;
  --input-bg: #fffdf7;
  --font-display: "Amatic SC", "Segoe Print", cursive;
  --font-text: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 78px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cuir: #17100b; --encre: #f1e4c8; --muted: #b09d84;
    --page: #1b1410; --carte: #261c14; --chip: #33261c;
    --line: rgba(241, 228, 200, .14); --soft: rgba(241, 228, 200, .08);
    --nav-bg: #120c08; --timer-bg: #33261c; --input-bg: #1b1410;
    --danger: #ff6074; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --cuir: #17100b; --encre: #f1e4c8; --muted: #b09d84;
  --page: #1b1410; --carte: #261c14; --chip: #33261c;
  --line: rgba(241, 228, 200, .14); --soft: rgba(241, 228, 200, .08);
  --nav-bg: #120c08; --timer-bg: #33261c; --input-bg: #1b1410;
  --danger: #ff6074; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--encre);
  font-family: var(--font-text);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* --- Composants Bootstrap conservés, recolorés ------------------------------ */
.btn { font-family: var(--font-text); font-weight: 700; border-radius: 14px; min-height: 44px; }
.btn-primary, .btn-primary:hover, .btn-primary:active, .btn-primary:focus-visible {
  background-color: var(--accent) !important; border: 1px solid var(--accent) !important; color: var(--on-accent) !important;
}
.btn-primary:hover, .btn-primary:active { background-color: var(--accent-d) !important; border-color: var(--accent-d) !important; }
.btn-secondary { background-color: var(--chip); border-color: var(--chip); color: var(--encre); }
.btn-secondary:hover { background-color: var(--soft); color: var(--encre); }
.btn-danger { background-color: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--encre); }
.btn-success { background-color: var(--ok) !important; color: #fff; border: none; }
.btn-success:hover { filter: brightness(.92); }
.form-control {
  background-color: var(--input-bg); color: var(--encre);
  border: 1.5px solid var(--line); border-radius: 14px;
  min-height: 48px; font-size: 1rem;
}
.form-control:focus { background-color: var(--input-bg); color: var(--encre); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
.card {
  background: var(--carte); color: var(--encre);
  border: none; border-radius: 20px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .05);
}
.card-body { background: transparent; }
.toast { border-radius: 16px; overflow: hidden; }
.badge.text-bg-primary { background-color: var(--accent) !important; color: var(--on-accent) !important; }
.muted { color: var(--muted); font-size: .9rem; }

/* --- Écrans plein cadre : chargement, session verrouillée, bandeau de mise à jour --- */
.loading-screen {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--page); color: var(--encre);
  text-align: center; padding-top: 30vh;
}
.session-locked-screen {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; background: rgba(20, 12, 7, .85);
}
.session-locked-card {
  background: var(--carte); color: var(--encre);
  border-radius: 24px; padding: 2rem; max-width: 400px; text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
}
.session-locked-card h2 { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; color: var(--accent-d); margin-top: 0; line-height: 1; }
.session-locked-custom { background: var(--soft); border-radius: 14px; padding: .75rem 1rem; font-style: italic; white-space: pre-line; }
.update-banner {
  display: flex; align-items: center; justify-content: center; gap: .75rem; flex-wrap: wrap;
  padding: .6rem 1rem; background-color: var(--cuir); color: #f1e4c8; text-align: center; font-size: .95rem;
}

/* --- Structure de l'écran de jeu -------------------------------------------- */
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }

.app-hdr {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: var(--page);
}
.spacer { flex: 1; }

/* Anneau de progression : --p (0-100) posé par render.js (syncProgressBar). */
.ring {
  --p: 0;
  position: relative; width: 44px; height: 44px; flex: none;
  border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--soft) 0);
}
.ring::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--page); }
#myBar { position: relative; z-index: 1; width: auto !important; background: none !important; font-size: 11px; font-weight: 700; color: var(--encre); transition: none; }

#timer.timer, .timer {
  background: var(--timer-bg) !important; color: var(--timer-ink) !important;
  border-radius: 999px; padding: 7px 14px;
  font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: .02em;
  width: auto; min-width: 0; text-align: center; margin: 0;
}

.iconbtn {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; border: 0;
  background: var(--soft); color: var(--encre); cursor: pointer;
  max-width: none;
}
.iconbtn.menu-btn { background: transparent; border: 1.5px solid var(--line); }
#chatUnreadDot {
  position: absolute; top: 8px; right: 9px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--danger); border: 2px solid var(--page);
}

.app-main { padding: 0 14px; }
.step-title {
  margin: 4px 2px 10px; font-family: var(--font-display); font-weight: 700; line-height: .95;
  font-size: 2.3rem; color: var(--title-color, var(--encre));
}
#stepName { color: var(--title-color, var(--encre)); font-size: 2.3rem; margin-bottom: 10px; }

/* Contenu de l'étape : image ou widget de cadenas. */
.hero { margin: 0 auto; }
#contentImg { margin: 0 auto; }
.stepImg, #contentImg img.stepImg {
  /* Image entière (jamais rognée) : une image portrait, comme les règles du jeu, défile avec la page. */
  display: block; width: 100%; height: auto;
  border-radius: 24px; margin: 0 auto;
}

/* Texte de l'étape : feuille repliable. */
.desc {
  margin-top: 12px; padding: 12px 16px 14px;
  border-radius: 22px; background: var(--carte);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .05);
}
.desc .grab { width: 36px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 10px; }
.desc-text { font-size: 1rem; line-height: 1.55; overflow-wrap: anywhere; }
.desc-text p:last-child { margin-bottom: 0; }
.desc.collapsed .desc-text { max-height: 7.75em; overflow: hidden; }
/* Dégradé de fin de texte seulement quand le texte est réellement tronqué. */
.desc.collapsed.clamped .desc-text {
  -webkit-mask-image: linear-gradient(#000 62%, transparent);
  mask-image: linear-gradient(#000 62%, transparent);
}
#scoring { margin: .5rem 0 0; }
#scoring:empty { display: none; }
.more {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%; margin-top: 8px; padding: 6px 0; border: 0; background: none;
  font: inherit; font-size: .85rem; font-weight: 700; color: var(--accent-d); cursor: pointer; min-height: 40px;
}
.more[hidden] { display: none; }
.more .ico { width: 18px; height: 18px; transition: transform .2s; }
.more:not(.open) .ico { transform: rotate(180deg); }

/* --- Barre du bas ------------------------------------------------------------ */
.nav {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 30;
  width: min(100%, 560px); height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  background: var(--nav-bg); border-radius: 26px 26px 0 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px calc(8px + env(safe-area-inset-bottom));
}
.nav-side { flex: 1; display: flex; align-items: center; justify-content: space-around; min-width: 0; }
.tab {
  position: relative; background: none; border: 0; color: var(--nav-ink);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font: inherit; font-size: .68rem; font-weight: 600;
  min-width: 56px; min-height: 52px; padding: 6px 4px; cursor: pointer; max-width: none;
}
.tab:active, .tab:hover { color: #f1e4c8; }
.tab-ico { display: grid; place-items: center; }
.tab-ico svg { width: 24px; height: 24px; }
.tab-badge {
  position: absolute; top: 2px; left: calc(50% + 6px);
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: var(--on-accent);
  font-size: .65rem; font-weight: 700; display: grid; place-items: center;
}
#hintCountdown { padding: 0 !important; }
.fab {
  width: 62px; height: 62px; flex: none; border-radius: 50%; border: 0;
  margin: -34px 4px 0; display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent-d));
  color: var(--on-accent);
  box-shadow: 0 8px 18px -4px color-mix(in srgb, var(--accent-d) 70%, transparent), 0 0 0 6px var(--nav-bg);
}
.fab .ico { width: 28px; height: 28px; stroke-width: 2.1; }
.gameInterfaceButton:disabled { opacity: .45; }

/* --- Feuilles (les <dialog> natifs montent du bas de l'écran) --------------------- */
dialog.app-dialog {
  border: none; padding: 0; color: var(--encre);
  background: var(--page);
  position: fixed; inset: auto 0 0 0; margin: 0 auto;
  width: min(100%, 560px); max-width: 100%;
  max-height: 86vh; max-height: 86dvh; overflow: auto;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .35);
}
dialog.app-dialog::backdrop { background: rgba(20, 12, 7, .55); }
dialog.app-dialog .modal-dialog { margin: 0; max-width: none; width: 100%; height: auto; }
dialog.app-dialog .modal-content { background: transparent; border: 0; border-radius: 0; color: var(--encre); }
dialog.app-dialog .modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 18px 18px 6px; border: 0; position: relative;
}
dialog.app-dialog .modal-header::before {
  content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px;
  border-radius: 4px; background: var(--line);
}
dialog.app-dialog .modal-title, #itemListTitle, #locationListTitle {
  font-family: var(--font-display); font-weight: 700; line-height: 1; font-size: 2rem; margin: 0;
  color: var(--title-color, var(--encre));
}
dialog.app-dialog .modal-body { padding: 8px 18px 22px; }
dialog.app-dialog .modal-footer { padding: 0 18px 22px; border: 0; justify-content: flex-start; color: var(--muted); }
dialog.app-dialog .btn-close {
  flex-shrink: 0; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; opacity: 1;
  border-radius: 50%; background-color: var(--soft);
  background-image: none; position: relative; border: 0;
}
dialog.app-dialog .btn-close::before { content: "×"; font-size: 1.7rem; line-height: 44px; color: var(--encre); display: block; text-align: center; }
dialog.app-dialog .btn-close:hover { background-color: var(--line); }

@media (prefers-reduced-motion: no-preference) {
  dialog.app-dialog {
    transform: translateY(0);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), overlay .3s allow-discrete, display .3s allow-discrete;
  }
  dialog.app-dialog:not([open]) { transform: translateY(100%); }
  dialog.app-dialog::backdrop { transition: opacity .25s, overlay .25s allow-discrete, display .25s allow-discrete; }
  @starting-style {
    dialog.app-dialog[open] { transform: translateY(100%); }
    dialog.app-dialog[open]::backdrop { opacity: 0; }
  }
}

/* Écrans de connexion / inscription : plein écran sombre, un seul gros bouton. */
dialog.app-dialog-fullscreen {
  inset: 0; width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: none;
  border-radius: 0; box-shadow: none;
}
dialog.login-dialog { background: var(--cuir); color: #f1e4c8; }
dialog.login-dialog .modal-dialog { height: 100%; max-width: 480px; margin: 0 auto; }
dialog.login-dialog .modal-content { padding: calc(28px + env(safe-area-inset-top)) 22px 28px; min-height: 100%; display: flex; flex-direction: column; color: #f1e4c8; }
.login-logo { margin: 0 auto 14px; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #4a3426, #2a1d15); border: 1.5px solid rgba(218, 189, 145, .35); overflow: hidden; }
.login-logo img { width: 70%; height: auto; }
.login-title { text-align: center; font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; line-height: .95; margin: 0; }
.login-sub { text-align: center; margin: 8px 0 22px; font-size: .9rem; color: #c9b89d; }
dialog.login-dialog label { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #c9b89d; margin: 0 0 8px; font-weight: 600; }
dialog.login-dialog .form-control { background: rgba(241, 228, 200, .1); border-color: rgba(241, 228, 200, .22); color: #f1e4c8; margin-bottom: 18px; min-height: 52px; }
dialog.login-dialog .form-control::placeholder { color: rgba(241, 228, 200, .45); }
.code-input { font-size: 1.6rem !important; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; text-align: center; }
.form-error { color: #ff9aa6; min-height: 1.4em; font-size: .9rem; text-align: center; margin-bottom: 8px; }
.btn-lg-join { padding: 14px; font-size: 1.05rem; border-radius: 16px; width: 100%; }
.admin-link { align-self: center; margin-top: auto; padding: 18px 12px 4px; text-align: center; font-size: .75rem; color: #6a5645; text-decoration: none; }
.admin-link:hover, .admin-link:focus-visible { color: #a8977c; }
.login-foot { text-align: center; margin: 14px 0 0; font-size: .8rem; color: #a8977c; }

/* Plan des lieux : occupe tout l'écran, l'image est affichée en entier (sans rognage). */
dialog#mapModal {
  inset: 0; width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: none;
  border-radius: 0; box-shadow: none;
}
#mapModal .modal-dialog, #mapModal .modal-content { height: 100%; display: flex; flex-direction: column; }
#mapModal .modal-header { padding-top: calc(18px + env(safe-area-inset-top)); }
#mapModal .modal-body { flex: 1; min-height: 0; display: grid; place-items: center; padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); overflow: auto; }
#mapModal .lg-container { width: 100%; height: 100%; display: grid; place-items: center; }
#mapModal .stepImg { width: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 14px; }

/* Notification « plein écran activé » (affichée une seule fois). */
.fs-hint {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 3500;
  width: min(92vw, 520px); display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 16px; background: var(--cuir); color: #f1e4c8;
  font-size: .88rem; line-height: 1.35; box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.fs-hint span { flex: 1; }
.fs-hint-close { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(241, 228, 200, .12); color: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; }

/* Menu */
.menu-head { padding-top: 22px !important; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--cuir); display: grid; place-items: center; flex: none; overflow: hidden; }
.avatar img { width: 72%; height: auto; }
.menu-id { flex: 1; min-width: 0; line-height: 1.2; }
.menu-id b { display: block; font-size: 1rem; color: var(--title-color, var(--encre)); font-family: var(--font-text); font-weight: 700; }
.menu-id small { font-size: .78rem; color: var(--muted); }
.menu-id small[hidden] { display: none; }
.menu-body { display: flex; flex-direction: column; gap: 6px; }
.mrow {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px;
  padding: 6px 12px; border-radius: 16px; background: var(--carte); color: var(--encre);
  border: 0; font: inherit; font-weight: 600; font-size: .95rem; text-align: left; cursor: pointer;
}
.mrow[hidden] { display: none; }
.mrow .ico { width: 21px; height: 21px; color: var(--muted); }
.mrow .go { margin-left: auto; }
.mrow.danger { background: transparent; color: var(--danger); border: 1.5px solid color-mix(in srgb, var(--danger) 32%, transparent); }
.mrow.danger .ico { color: var(--danger); }
.tgl { margin-left: auto; width: 42px; height: 26px; border-radius: 14px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.tgl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
[aria-checked="true"] > .tgl { background: var(--accent); }
[aria-checked="true"] > .tgl::after { transform: translateX(16px); }
.reset-confirm { background: var(--carte); border-radius: 16px; padding: 14px; }
.reset-confirm p { margin: 0 0 12px; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }

/* Listes des lieux et des objets */
.item-row {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 58px; padding: 8px 10px 8px 8px; margin-bottom: 8px;
  border-radius: 18px; background: var(--carte);
}
.item-row .locationStatus { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--soft); flex: none; }
.item-name { flex: 1; min-width: 0; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.oneLocationtoView {
  background: none !important; color: var(--muted) !important; padding: 0 !important;
  display: grid; place-items: center; width: 32px; min-height: 44px; cursor: pointer; border-radius: 0;
}
/* La puce s'étire sur toute la ligne : un appui n'importe où ouvre le lieu. */
.oneLocationtoView::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }
.item-actions { display: flex; gap: 6px; flex: none; }
.oneObjectToView, .oneObjectToUse {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 12px !important; border-radius: 13px; margin: 0;
  font-size: .8rem; font-weight: 700; cursor: pointer;
}
.oneObjectToView { background: var(--chip) !important; color: var(--encre) !important; }
.oneObjectToUse { background: var(--cuir) !important; color: #f1e4c8 !important; }
.oneObjectToView svg, .oneObjectToUse svg { width: 16px; height: 16px; }
.oneObject { z-index: 1; }
.oneObjectLine { z-index: 0; }

/* Chat animateur <-> équipe */
.chat-thread {
  max-height: 50vh; min-height: 120px; overflow-y: auto;
  padding: 2px; margin-bottom: 12px;
  display: flex; flex-direction: column; gap: 7px;
}
.chat-message { padding: 8px 12px; border-radius: 16px; max-width: 84%; word-break: break-word; font-size: .95rem; line-height: 1.35; }
.chat-message.admin { align-self: flex-start; background: var(--carte); border-bottom-left-radius: 5px; }
.chat-message.team { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 5px; font-weight: 500; }
.chat-empty { align-self: center; color: var(--muted); font-size: .9rem; margin: auto; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; min-width: 0; }
.chat-form .btn { width: 48px; padding: 0; border-radius: 14px; flex: none; }

/* Classement : une carte par équipe, la première mise en avant. */
.leaderboard-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.leaderboard-row { padding: 12px 14px; border-radius: 20px; background: var(--carte); border: 0; }
.leaderboard-first { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent)); color: var(--on-accent); }
.leaderboard-rank-name { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .45rem; flex-wrap: wrap; }
.leaderboard-rank { font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1; color: var(--accent-d); }
.leaderboard-first .leaderboard-rank { color: var(--on-accent); }
.leaderboard-team { font-weight: 700; }
.leaderboard-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .3rem .8rem; }
.leaderboard-stats > div { display: flex; justify-content: space-between; gap: .5rem; font-size: .88em; }
.leaderboard-stat-label { opacity: .75; }
.leaderboard-stat-value { font-weight: 700; }

/* Chargement */
.spinner {
  border: 8px solid var(--soft); border-top: 8px solid var(--accent);
  border-radius: 50%; width: 60px; height: 60px; animation: spin 1s linear infinite; margin: 0 auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes stepFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: no-preference) { .step-transition { animation: stepFadeIn .25s ease; } }

/* --- Cadenas et lecteur de QR (widgets injectés par scripts/locks et qrScanner) ---- */
input[type=range] { accent-color: var(--accent); height: 32px; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { background-color: var(--chip); height: 6px; border-radius: 3px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; background-color: var(--accent); border: none; border-radius: 50%; width: 26px; height: 26px; margin-top: -10px; cursor: pointer; }
input[type=range]::-moz-range-track { background-color: var(--chip); height: 6px; border-radius: 3px; }
input[type=range]::-moz-range-thumb { background-color: var(--accent); border: none; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; }

#actualCode { margin: 8px auto 0; text-align: center; font-family: var(--font-display); font-size: 3rem; font-weight: 700; letter-spacing: .12em; line-height: 1.05; }
#actualCode:empty { display: none; }
#qrCodeReader { margin: auto; width: 100% !important; }
#qrCodeReader__scan_region { width: 100% !important; margin: auto; border-radius: 20px; overflow: hidden; }
#qrCodeReader video { border-radius: 20px; }
#qrCodeReaderForSonometer { margin: auto; width: 100% !important; max-width: 500px; }
#gameMap { width: 100%; }
.toClick { background-color: red !important; fill: red; display: block; opacity: 1 !important; }
.patternlock { width: 80%; max-width: 320px; margin: auto; }
.lockContainer { padding: 4px 0; }

#passZone { font-size: 2em; text-align: center; color: var(--accent-d); margin-left: auto; }
#message { margin: 20px auto 0; width: 80%; }
.passCard { margin: 24px auto 0; max-width: 800px; }
.passCardBody { margin-bottom: 24px; }
.passCardBody, .passCard { border: 0; }

/* Cadenas à chiffres, couleurs, flèches, interrupteurs : gros boutons tactiles. */
#digit .col, .oneDigit { padding: 0; text-align: center; max-width: 80px; }
.oneDigit { width: 52px; }
.oneDigitFromTrying { font-size: 2.5em; }
.digit {
  width: 100%; max-width: 76px; font-size: 42px; margin-top: 5px; min-height: 56px; line-height: 1.1;
  border-radius: 16px; font-family: var(--font-display); font-weight: 700;
}
/* Touches chiffrées / flèches : tuiles claires, le texte garde toujours le contraste du thème. */
.btn.digit.btn-primary:not(.colorButton), .btn.digit.btn-warning {
  background-color: var(--carte) !important; color: var(--encre) !important; border: 2px solid var(--line) !important;
}
.btn.digit.btn-primary:not(.colorButton):hover, .btn.digit.btn-primary:not(.colorButton):active, .btn.digit.btn-warning:hover {
  background-color: var(--chip) !important;
}
/* Les pictogrammes de ces boutons sont dimensionnés en em (2em, 1em) : avec la police de 42px des chiffres,
   ils débordaient du bouton. On les fixe en pixels et on ramène la police à une taille neutre. */
.btn.digit.orientationButton, .btn.digit.switch, #reset, #resetDirectionnal, #resetSwitch, .btn.digit.btn-success, .btn.digit.btn-warning { font-size: 1rem; }
.orientationButton svg, .digit.switch svg { width: 34px; height: 34px; }
#reset svg, #resetDirectionnal svg, #resetSwitch svg, .digit.btn-success svg, .digit.btn-warning svg { width: 28px; height: 28px; }
.btn.digit.colorButton { border: 2px solid var(--line) !important; }
#reset, #resetDirectionnal, #resetSwitch { background-color: var(--accent) !important; color: var(--on-accent) !important; border: 0 !important; }
#reset:hover, #resetDirectionnal:hover, #resetSwitch:hover { background-color: var(--accent-d) !important; }
.switch { color: var(--encre); }
.lock-dots circle { fill: var(--accent-d) !important; }
line { stroke: var(--accent-d) !important; }
#password { width: 100%; }
#loginSendSoluce { width: auto; min-width: 20%; }
#loginPasswordInput { margin-top: 20px; }
.input-group-append { cursor: pointer; }
.slidersRow { margin: 30px auto 0; }
.slidersValue { color: var(--accent-d) !important; font-size: 1.4em; }
.slidersName { color: var(--encre) !important; }
.sliderButtons { width: 20px; }
#listOfSymbols { margin: auto; text-align: center; }
.sonoMeterProgressBar { margin: auto; max-width: 70%; }
#hintCountdown { padding-left: 0; }

/* Plan et zones cliquables (hotspots responsive) */
.hotspot-container { position: relative; width: 100%; max-width: 100%; margin: 10px auto; display: block; }
.hotspot-container img { width: 100%; height: auto; display: block; border-radius: 20px; }
/* Les boutons DOIVENT être positionnés en pourcentages (style en ligne posé par le verrou). */
.hotspotButton {
  position: absolute; width: 44px; height: 44px; background: transparent; border: none; cursor: pointer;
  /* centre le hotspot sur le point exact */
  transform: translate(-50%, -50%); transition: all .3s ease; display: block; z-index: 10;
}
.hotspotButton:hover { transform: translate(-50%, -50%) scale(1.2); }
.hotspotButton svg { display: block; pointer-events: none; width: 44px; height: 44px; }
.lg-container { max-width: 100%; position: relative; margin: 0; padding: 0; }
.lg-image { display: block; height: 100%; width: 100%; object-fit: scale-down; }
.pin { margin-top: -10px; }

/* Grands écrans : la colonne de jeu reste celle d'un téléphone, centrée. */
@media (min-width: 700px) {
  body { background: color-mix(in srgb, var(--page) 88%, #000); }
  .app { background: var(--page); box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(0, 0, 0, .18); }
}
@media (max-width: 380px) {
  .step-title, #stepName { font-size: 2rem; }
  .tab { min-width: 48px; }
  .digit { width: 64px; font-size: 38px; }
}
