/* Chasse aux trésors (assets/chasse.js) */
.ch { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.ch-panneau { display: flex; flex-direction: column; gap: 12px; }
.ch-tete { display: flex; justify-content: space-between; align-items: center; }
.ch-etape { font: 600 13px var(--f-titre); letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.ch-etape b { display: inline-grid; place-items: center; min-width: 28px; height: 28px; margin-left: 6px; padding: 0 6px; border-radius: 9px;
  background: rgba(245,166,35,.16); color: var(--or-hi); font-size: 15px; }
.ch-lien { background: none; border: none; color: var(--mut); font-size: 13px; font-weight: 700; cursor: pointer; padding: 4px 0; }
.ch-lien:hover { color: var(--or-hi); }

.ch-bloc { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 16px; }
.ch-bloc h4 { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font: 600 14px var(--f-titre); }
.ch-bloc h4 i { font-style: normal; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--inset); color: var(--or-hi); font-size: 12px; }
.ch-bloc h4 span { margin-left: auto; font: 700 12px var(--f-txt); color: var(--mut); }
.ch-astuce { margin: 10px 0 0; font-size: 12px; color: var(--mut2); }
.ch-astuce kbd { font: 700 11px ui-monospace, monospace; padding: 1px 5px; border-radius: 5px; background: var(--inset); color: var(--txt); }

.ch-pos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ch-pas { display: flex; align-items: stretch; background: var(--inset); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.ch-pas:focus-within { border-color: rgba(245,166,35,.5); }
.ch-pas button { width: 34px; flex: none; border: none; background: rgba(255,255,255,.04); color: var(--or); font: 700 18px var(--f-titre); cursor: pointer; }
.ch-pas button:hover { background: rgba(245,166,35,.15); }
.ch-pas label { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 4px 0 6px; }
.ch-pas small { font-size: 10px; font-weight: 800; color: var(--mut2); }
.ch-pas input { width: 100%; text-align: center; border: none; background: none; color: var(--txt); font: 700 22px/1.1 var(--f-titre); padding: 0; -moz-appearance: textfield; }
.ch-pas input:focus { outline: none; }
.ch-pas input::-webkit-inner-spin-button, .ch-pas input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Croix de direction : losange de 4 boutons */
.ch-dirs-l { display: flex; align-items: center; gap: 18px; }
.ch-dirs { position: relative; width: 120px; height: 120px; flex: none; }
.ch-dir { position: absolute; width: 50px; height: 50px; border-radius: 12px; border: 1px solid var(--line); background: var(--inset); color: var(--txt);
  cursor: pointer; transform: rotate(45deg); transition: background .15s, box-shadow .15s, transform .15s; }
.ch-dir span { display: block; transform: rotate(-45deg); font: 700 24px/1 var(--f-titre); }
.ch-dir:hover { background: rgba(245,166,35,.15); }
.ch-dir.on { background: var(--or); color: #1a1004; border-color: var(--or); box-shadow: 0 0 0 4px rgba(245,166,35,.2), 0 6px 18px rgba(245,166,35,.35); }
.ch-d6 { left: 35px; top: 0; } .ch-d4 { left: 0; top: 35px; } .ch-d0 { left: 70px; top: 35px; } .ch-d2 { left: 35px; top: 70px; }
.ch-dirs.attend .ch-dir { animation: ch-attend 1.4s ease-in-out infinite; }
@keyframes ch-attend { 50% { border-color: rgba(245,166,35,.7); } }

.ch-q { width: 100%; padding: 11px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--inset); color: var(--txt); font-size: 15px; }
.ch-q:focus { outline: none; border-color: rgba(245,166,35,.5); }
.ch-q:disabled { opacity: .6; }
.ch-liste { margin-top: 8px; max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.ch-ind { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: none;
  background: none; color: #c3cdd8; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; }
.ch-ind em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--mut2); white-space: nowrap; }
.ch-ind:hover, .ch-ind.actif { background: rgba(255,255,255,.06); color: #fff; }
.ch-ind.on { background: rgba(74,222,128,.14); color: #fff; } .ch-ind.on em { color: var(--ok); }
.ch-vide { margin: 8px 2px 0; font-size: 13px; color: var(--mut); }

.ch-res { border-radius: 16px; padding: 16px; background: linear-gradient(150deg, rgba(74,222,128,.16), rgba(74,222,128,.04)); border: 1px solid rgba(74,222,128,.35);
  animation: ch-apparait .25s ease-out; }
@keyframes ch-apparait { from { opacity: 0; transform: translateY(6px); } }
.ch-res-h { display: flex; align-items: center; gap: 14px; }
.ch-fleche { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: rgba(74,222,128,.2); color: var(--ok); font: 700 26px var(--f-titre); flex: none; }
.ch-res-h small { display: block; font-size: 13px; color: #a7d9b8; font-weight: 700; }
.ch-res-h b { font: 700 30px/1.1 var(--f-titre); }
.ch-res-a { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ch-res-a .ad12-btn { flex: 1; white-space: nowrap; }
#ch-copier code { font: 700 13px ui-monospace, monospace; }
#ch-copier span { color: var(--mut); margin-left: 4px; }
#ch-copier.fait span { color: var(--ok); }
.ch-auto { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--mut); cursor: pointer; }
.ch-auto input { accent-color: var(--or); width: 16px; height: 16px; }
.ch-auto code { font: 700 12px ui-monospace, monospace; color: var(--txt); }

.ch-trace { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ch-trace li { font-size: 13px; color: var(--mut); padding: 6px 10px; border-radius: 9px; background: rgba(255,255,255,.03); }
.ch-trace li b { color: var(--or-hi); margin-right: 4px; } .ch-trace li span { color: var(--txt); } .ch-trace em { font-style: normal; color: var(--txt); }
.ch-trace .ch-retour { background: none; padding: 2px 0; }
.ch-co { position: relative; padding: 0 2px; border: none; border-radius: 5px; background: none; color: var(--txt); font: inherit; cursor: copy; }
.ch-co:hover { background: rgba(245,166,35,.15); color: var(--or-hi); }
.ch-co.fait { color: var(--ok); }
.ch-co.fait::after { content: 'Copié'; position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); padding: 2px 6px; border-radius: 5px;
  background: var(--ok); color: #06210f; font: 800 10px var(--f-txt); white-space: nowrap; pointer-events: none; }

/* Carte */
.ch-carte-l { position: sticky; top: calc(16px + var(--barre-wp)); }
.ch-carte { height: calc(100vh - 150px - var(--barre-wp)); min-height: 420px; border-radius: 16px; border: 1px solid var(--line); background: #0a121b; overflow: hidden; }
.ch-carte .leaflet-container { background: #0a121b; }
.ch-carte .leaflet-tooltip { font: 600 12px var(--f-txt); }
.ch-num { display: grid !important; place-items: center; border-radius: 50%; background: rgba(12,21,32,.85); color: var(--or-hi); font: 700 11px var(--f-titre); }
.ch-num.on { background: var(--ok); color: #06210f; }
.ch-moi span { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--or); border: 3px solid #fff; box-shadow: 0 0 0 0 rgba(245,166,35,.7); animation: ch-pouls 1.8s infinite; }
@keyframes ch-pouls { 70% { box-shadow: 0 0 0 14px rgba(245,166,35,0); } 100% { box-shadow: 0 0 0 0 rgba(245,166,35,0); } }
.ch-cible { animation: ch-cible 1.2s ease-in-out infinite; }
@keyframes ch-cible { 50% { fill-opacity: .15; } }
.ch-pop { display: flex; align-items: center; gap: 10px; font: 700 14px var(--f-titre); }
.ch-pop .ad12-btn { padding: 7px 12px; font-size: 13px; }

/* Boutons sous le zoom : volet, plein écran */
.ch-outils a { display: grid !important; place-items: center; color: #333; }
.ch-outils svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ch-outils a.on { background: var(--or); color: #1a1004; }
.ch-outils [data-outil="grand"] svg + svg, .ch-outils [data-outil="grand"].on svg:first-child { display: none; }
.ch-outils [data-outil="grand"].on svg + svg { display: block; }

/* Volet masqué : la carte prend toute la largeur */
.ch.ch-replie { grid-template-columns: minmax(0, 1fr); }
.ch.ch-replie .ch-panneau { display: none; }

/* Plein écran : l'outil (volet compris) couvre la fenêtre */
.ch.ch-grand { position: fixed; inset: 0; z-index: 9999; margin: 0; padding: 12px; background: var(--bg); align-items: stretch; }
.ch.ch-grand .ch-panneau { max-height: calc(100vh - 24px); overflow: auto; scrollbar-width: thin; }
.ch.ch-grand .ch-carte-l { position: static; }
.ch.ch-grand .ch-carte { height: calc(100vh - 24px); }
html.ch-plein, html.ch-plein body { overflow: hidden; }

@media (pointer: coarse) { .ch-clavier { display: none; } }
@media (max-width: 1000px) {
  .ch { grid-template-columns: 1fr; }
  .ch-carte-l { position: static; }
  .ch-carte { height: 300px; min-height: 0; }
  .ch.ch-replie .ch-panneau { display: flex; }
  .ch-outils [data-outil="volet"] { display: none !important; }
  /* Plein écran sur téléphone : la carte en haut, le volet défile dessous. */
  .ch.ch-grand { display: flex; flex-direction: column; gap: 10px; padding: 0 0 10px; overflow: auto; }
  .ch.ch-grand .ch-carte-l { order: -1; position: sticky; top: 0; z-index: 2; }
  .ch.ch-grand .ch-carte { height: 45vh; height: 45dvh; border-radius: 0; border: 0; }
  .ch.ch-grand .ch-panneau { max-height: none; overflow: visible; padding: 0 12px; }
}
