
:root{--red:#b5121b;--ink:#272727;--paper:#f5f0e7;--card:#fff;--muted:#6f6f6f;--border:#ded8ce;--shadow:0 10px 28px rgba(0,0,0,.10)}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:linear-gradient(135deg,#f8f4ed,#ece3d6);color:var(--ink)}a{color:inherit}
header{background:linear-gradient(135deg,#8e0c14,#c11823);color:#fff;padding:18px}
.brand{max-width:980px;margin:auto;display:flex;align-items:center;justify-content:center;gap:16px;position:relative}
.brand img{height:72px;background:white;padding:4px;border-radius:8px}
h1{font-family:Georgia,serif;margin:0;font-size:clamp(2rem,7vw,3.7rem)}header p{margin:.35rem 0 0}.langs{position:absolute;right:0;top:0;display:flex;gap:4px}
.lang{border:1px solid #fff8;background:#ffffff22;color:white;border-radius:8px;padding:5px 7px;font-weight:800;cursor:pointer}.lang.active{background:white;color:#9d1018}
main{max-width:980px;margin:auto;padding:18px}.card{background:var(--card);border:1px solid var(--border);border-radius:18px;padding:20px;margin:16px 0;box-shadow:var(--shadow)}.center{text-align:center}.hero-icon{font-size:3.5rem}
.btn{appearance:none;border:0;border-radius:12px;padding:13px 17px;background:var(--red);color:#fff;font-weight:750;font-size:1rem;cursor:pointer;text-decoration:none;display:inline-block;margin:5px}.btn.secondary{background:#464646}.btn.ghost{background:#eee;color:#222}.btn:disabled{opacity:.42;cursor:not-allowed}
.video-wrap{aspect-ratio:16/9;background:#111;border-radius:14px;overflow:hidden;margin:12px 0}video{width:100%;height:100%;display:block;background:#111}.rules ol{padding-left:1.3rem;line-height:1.65}.rules li{margin:.35rem 0}
.route-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(235px,1fr));gap:14px}.route-card{border:2px solid var(--route);border-radius:17px;padding:18px;background:white}.route-card h2{margin:.15rem 0 .35rem}.route-chip{display:inline-block;background:var(--route);color:white;padding:6px 10px;border-radius:99px;font-size:.86rem;font-weight:800}
.progress{height:14px;background:#ddd;border-radius:99px;overflow:hidden;margin:.6rem 0}.progress>div{height:100%;background:var(--route);transition:.3s}
.map-shell{position:relative;border-radius:14px;overflow:hidden;border:1px solid #ccc;background:#eee}.map-shell>img{display:block;width:100%;height:auto}.map-actions{text-align:center;margin-top:8px}.zoom-btn{}
.legend{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:9px}.legend-item{padding:10px 12px;border-radius:10px;background:#f4f4f4;border:1px solid transparent;transition:.2s}.legend-item.done{background:#dedede;color:#777;text-decoration:none;border-color:#bbb}.legend-item.done strong::after{content:" ✓";color:#4a4a4a}
.notice{padding:14px;border-radius:12px;background:#fff6d6;border-left:5px solid #c99000}.success{padding:14px;border-radius:12px;background:#e9f7ec;border-left:5px solid #2c8c43}.locked{padding:18px;border-radius:14px;background:#f1f1f1;text-align:center}
.clue{font-size:clamp(2.1rem,12vw,4.8rem);font-family:Georgia,serif;font-weight:800;color:var(--route);letter-spacing:.04em;text-align:center;margin:.4rem 0}.discover{background:#f7f1e7;border-left:5px solid var(--route);padding:16px;border-radius:11px;white-space:pre-line;line-height:1.55}
input[type=text]{width:100%;padding:14px;border:2px solid #bbb;border-radius:11px;font-size:1.1rem;margin:8px 0}.carnet-route{border-left:7px solid var(--route);padding-left:14px}.clue-list{display:flex;flex-wrap:wrap;gap:8px}.clue-pill{border:1px solid var(--route);padding:8px 11px;border-radius:99px;background:white;font-weight:700}
footer{text-align:center;color:#666;padding:25px 15px}.small{font-size:.9rem;color:var(--muted)}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.94);z-index:1000;display:none;flex-direction:column}.modal.open{display:flex}.modal-bar{padding:10px;text-align:right}.modal-stage{flex:1;overflow:hidden;touch-action:none;position:relative}.modal-stage>img{position:absolute;left:50%;top:50%;max-width:none;transform-origin:center center;user-select:none;-webkit-user-drag:none}
.scan-stage{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px;color:white;text-align:center}.scan-stage video{max-width:700px;max-height:70vh;object-fit:cover;border-radius:16px}.scan-note{max-width:700px;margin:12px auto}
.gate-page main{max-width:650px}.gate-page .card{margin-top:40px}.address{font-size:1.2rem;font-weight:800;line-height:1.6}
@media(max-width:700px){.brand{justify-content:flex-start;padding-right:0;flex-wrap:wrap}.brand img{height:58px}.langs{width:100%;justify-content:center;margin-top:10px}.card{padding:16px}main{padding:12px}}


/* V4.1 — Sélecteur de langue sur une ligne dédiée, hors du titre */
header .head{
  position: static !important;
}
.lang-switch{
  position: static !important;
  top: auto !important;
  right: auto !important;
  transform: none !important;
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  margin: 10px auto 0 !important;
  padding: 8px 10px !important;
  box-sizing: border-box !important;
}
.lang-switch button{
  position: static !important;
  white-space: nowrap !important;
}
@media (max-width: 700px){
  .lang-switch{
    gap: 6px !important;
    margin-top: 8px !important;
    padding: 6px 4px !important;
  }
  .lang-switch button{
    font-size: 13px !important;
    padding: 7px 9px !important;
  }
}

/* V4.2 — langues séparées du titre sur ordinateur et téléphone */
.brand{padding-right:0;flex-wrap:wrap}
.brand>div:nth-child(2){min-width:0}
.langs{position:static!important;right:auto!important;top:auto!important;width:100%;display:flex;justify-content:center;align-items:center;gap:8px;margin-top:10px;order:3}
@media(min-width:701px){
  .brand{display:grid;grid-template-columns:auto 1fr;justify-content:center;max-width:980px}
  .brand img{grid-row:1;grid-column:1}
  .brand>div:nth-child(2){grid-row:1;grid-column:2}
  .langs{grid-row:2;grid-column:1 / -1;margin-top:8px}
}
@media(max-width:700px){
  header{padding:16px 14px}
  .brand{justify-content:center;gap:10px}
  .brand img{height:68px}
  .brand>div:nth-child(2){width:100%;order:2}
  .brand h1{text-align:center;font-size:clamp(2.2rem,12vw,3.3rem);line-height:1.03}
  .brand p{text-align:center;line-height:1.3}
  .langs{order:3;width:100%;margin-top:8px;gap:6px}
  .lang{font-size:.9rem;padding:7px 9px}
}
.final-clues{margin:14px 0;padding:14px;border-radius:14px;background:#f7f1e7;border:1px solid #ded8ce}
.final-clues h3{margin:.1rem 0 .7rem;text-align:center}
.final-clues .clue-list{justify-content:center}


/* V4.3 — en-tête robuste : aucun chevauchement langues/titre */
header .brand{display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;grid-template-areas:"logo title" "langs langs"!important;align-items:center!important;justify-content:center!important;gap:8px 16px!important;max-width:980px!important;margin:0 auto!important;position:static!important;}
header .brand>img{grid-area:logo!important;}
header .brand>div:nth-child(2){grid-area:title!important;min-width:0!important;}
header .brand .langs{grid-area:langs!important;position:static!important;width:100%!important;display:flex!important;justify-content:center!important;gap:8px!important;margin:6px 0 0!important;}
@media(max-width:700px){
 header .brand{grid-template-columns:1fr!important;grid-template-areas:"logo" "title" "langs"!important;text-align:center!important;}
 header .brand>img{justify-self:center!important;height:68px!important;}
 header .brand .langs{flex-wrap:nowrap!important;gap:5px!important;}
 header .brand .lang{font-size:.82rem!important;padding:7px 8px!important;}
}
.final-person{margin:16px 0;padding:16px;border-radius:14px;background:#f7f1e7;border-left:5px solid var(--route);line-height:1.55}
.final-person h3{margin:.1rem 0 .6rem}
