/* Carte « Influence des studios et de leurs jeux » — styles de la tuile (page Statistiques).
   Tout est cantonné à #studios-map ; les couleurs viennent des variables du site (style.css),
   donc le thème clair / sombre suit automatiquement le bouton du site. */
#studios-map { --st-n:#2f6fdb; --st-a:#2f9e5a; --st-r:#c28a2c; --st-c:#7c1a22; position:relative; color:var(--ink); font-size:0.75rem; line-height:1.4; }
#studios-map *, #studios-map *::before, #studios-map *::after { box-sizing:border-box; }
#studios-map .sm-head { padding:4px 0 14px; }
#studios-map .sm-loading { position:absolute; inset:0; z-index:3; display:grid; place-items:center; background:var(--surface); color:var(--ink-soft); font-size:0.75rem; }
#studios-map .sm-placeholder { position:relative; inset:auto; min-height:360px; border:1px dashed var(--line); border-radius:10px; background:transparent; }
#studios-map .sm-err { display:none; margin:0 0 12px; padding:12px 14px; border:1px solid #c0392b; border-radius:10px; background:rgba(192,57,43,.1); font-size:0.75rem; line-height:1.5; }
#studios-map .sm-err button { margin-left:8px; padding:4px 12px; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--ink); font:inherit; font-weight:600; cursor:pointer; }
#studios-map details.all > summary { display:flex; align-items:center; gap:6px; cursor:pointer; font-weight:600; list-style:none; }
#studios-map details.all > summary::-webkit-details-marker { display:none; }
#studios-map details.all > summary::before { content:"▸"; color:var(--ink-soft); font-size:0.75rem; }
#studios-map details.all[open] > summary::before { content:"▾"; }
:root[data-theme="dark"] #studios-map { --st-c:#b02f3a; --st-n:#5b9bff; }
.studios-map-grid { margin-top:18px; }
.studios-map-card .sm-subtitle { margin:10px 0 16px; max-width:900px; color:var(--ink-soft); font-size:0.875rem; line-height:1.5; }
.studios-map-card .sm-hint { color:var(--ink-faint); font-size:0.75rem; white-space:normal; }
/* Page Statistiques : la tuile « Rappel et repère des générations » est maintenant entre deux grilles : on garde l'espacement habituel */
.generation-key + .dashboard-grid { margin-top:18px; }
#studios-map * { box-sizing:border-box; }
#studios-map .controls { display:flex; flex-wrap:wrap; align-items:flex-end; gap:16px 26px; }
#studios-map .control-group { display:flex; flex-direction:column; gap:6px; }
#studios-map .control-group > label, #studios-map .control-group > .label { font-size:0.75rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-soft); }
#studios-map .year-row { display:flex; align-items:center; gap:8px; }
#studios-map input[type="range"] { width:150px; accent-color:var(--accent); }
#studios-map .value { font-size:0.75rem; font-weight:700; min-width:38px; text-align:left; font-variant-numeric:tabular-nums; }
#studios-map .chip-row { display:flex; gap:8px; flex-wrap:wrap; }
#studios-map .chip { height:30px; padding:0 12px; line-height:1; border:1px solid var(--line); border-radius:999px; background:var(--night); color:var(--ink); font-size:0.75rem; font-weight:600; cursor:pointer; user-select:none; display:inline-flex; align-items:center; gap:7px; font-family:inherit; }
#studios-map .chip.is-active { background:var(--accent); border-color:var(--accent); color:#fff; }
#studios-map .chip.is-disabled { opacity:.35; pointer-events:none; }
#studios-map #sm-provGroup { display:none; }
#studios-map .chip .dot { width:10px; height:10px; border-radius:50%; display:inline-block; flex:0 0 auto; }
#studios-map .chip--flag:not(.is-active) img, #studios-map .chip--flag:not(.is-active) svg { opacity:.55; filter:grayscale(.35); }
#studios-map .chip--flag svg { fill:none; stroke:currentColor; stroke-width:1.6; }
#studios-map .icon-btn { width:30px; height:30px; display:inline-grid; place-items:center; padding:0; flex:0 0 auto; border-radius:999px; border:1px solid var(--line); background:var(--night); color:var(--ink); cursor:pointer; font-size:0.75rem; font-weight:700; }
#studios-map .icon-btn svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; display:block; }
#studios-map .icon-btn:hover:not(:disabled), #studios-map .icon-btn:focus-visible { border-color:var(--ink-soft); outline:none; }
#studios-map .icon-btn:disabled { opacity:.35; cursor:default; }
#studios-map #sm-errBox { display:none; margin:12px 18px 0; padding:12px 14px; border:1px solid #c0392b; border-radius:10px; background:rgba(192,57,43,.1); font-size:0.75rem; line-height:1.5; }
#studios-map .map-wrap { position:relative; display:flex; width:100%; aspect-ratio:16/9; min-height:420px; max-height:78vh; background:var(--surface); overflow:hidden; }
#studios-map .chart-wrap { position:relative; flex:1 1 auto; min-width:0; height:100%; }
#studios-map #sm-chartdiv { width:100%; height:100%; }
#studios-map .map-wrap.has-panel .panel-btn { background:var(--accent); border-color:var(--accent); color:#fff; }
#studios-map .side-panel h3 { margin:0 0 2px; font-size:1rem; }
#studios-map .side-panel h4 { display:flex; align-items:center; gap:7px; margin:16px 0 4px; font-size:0.75rem; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-soft); }
#studios-map .side-panel h4 .dot { width:10px; height:10px; border-radius:50%; display:inline-block; }
#studios-map .side-panel .muted { color:var(--ink-soft); font-size:0.75rem; margin:2px 0 6px; }
#studios-map .side-panel ul { list-style:none; margin:0; padding:0; }
#studios-map .side-panel li.sm-row { display:flex; flex-wrap:wrap; gap:0 6px; align-items:baseline; padding:4px 0; }
#studios-map .side-panel a { color:var(--accent); text-decoration:underline; text-underline-offset:2px; font-weight:700; cursor:pointer; }
#studios-map .side-panel a:hover, #studios-map .side-panel a:focus-visible { text-decoration-thickness:2px; outline:none; }
#studios-map .side-panel a.studio-link { display:inline-flex; align-items:center; gap:5px; text-decoration:none; }
#studios-map .side-panel a.studio-link .nm { text-decoration:underline; text-underline-offset:2px; }
#studios-map .side-panel a.studio-link:hover .nm, #studios-map .side-panel a.studio-link:focus-visible .nm { text-decoration-thickness:2px; }
#studios-map .pin-ic { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; flex:0 0 auto; }
#studios-map .side-panel .sm-meta { display:flex; align-items:center; gap:8px; color:var(--ink-soft); margin:6px 0; }
#studios-map .side-panel .sm-meta img { width:20px; height:20px; flex:0 0 auto; }
#studios-map .side-panel .state { font-weight:700; margin:6px 0; }
#studios-map .side-panel .trust { color:var(--ink-soft); font-size:0.75rem; margin:6px 0; }
#studios-map .side-panel .trust.ok { color:#2f7d4f; }
#studios-map .side-panel .variants { color:var(--ink-soft); font-size:0.75rem; margin:6px 0; }
#studios-map .side-panel .links a { margin-right:14px; font-weight:600; }
#studios-map .side-panel p { margin:6px 0; }
#studios-map .side-panel details.all { margin-top:10px; border-bottom:0; }
#studios-map .side-panel ul.glist { margin:4px 0; padding-left:18px; list-style:disc; }
#studios-map .side-panel ul.glist li i { color:var(--ink-soft); font-style:normal; font-size:0.75rem; }
#studios-map .side-panel .desc { color:var(--ink-soft); font-size:0.75rem; margin:0 0 2px; }
#studios-map .side-panel li small { color:var(--ink-soft); }
#studios-map .side-panel details { border-bottom:1px solid var(--line); padding:6px 0; }
#studios-map .side-panel summary { cursor:pointer; list-style:none; display:grid; grid-template-columns:1fr auto; gap:2px 8px; align-items:center; }
#studios-map .side-panel summary::-webkit-details-marker { display:none; }
#studios-map .side-panel .g-name { display:flex; align-items:center; gap:7px; font-weight:700; }
#studios-map .side-panel .g-name img { width:16px; height:16px; }
#studios-map .side-panel .g-val { font-weight:700; color:var(--accent); }
#studios-map .side-panel .sm-bar { grid-column:1 / -1; height:4px; border-radius:2px; background:rgba(127,127,127,.18); }
#studios-map .side-panel .sm-bar span { display:block; height:100%; border-radius:2px; background:#f0b84a; }
#studios-map .side-panel .studio { margin-top:6px; }
#studios-map .side-panel details ul { margin:2px 0 2px 2px; padding-left:14px; list-style:disc; }
#studios-map .scrim { display:none; }
@media (max-width: 820px), (orientation: landscape) and (max-height: 600px) and (max-width: 1180px) {
  #studios-map .side-panel { display:block; position:absolute; top:0; right:0; bottom:0; flex:none; width:min(80vw, calc(100% - 40px)); max-width:none; z-index:20; transform:translateX(100%); visibility:hidden; pointer-events:none; box-shadow:-18px 0 30px color-mix(in srgb, var(--ink) 12%, transparent); transition:transform 240ms ease, visibility 240ms ease; }
  #studios-map .map-wrap.has-panel .side-panel { transform:translateX(0); visibility:visible; pointer-events:auto; }
  #studios-map .scrim { display:block; position:absolute; inset:0; z-index:19; padding:0; border:0; background:rgba(16, 17, 18, 0.58); cursor:pointer; opacity:0; visibility:hidden; pointer-events:none; transition:opacity 240ms ease, visibility 240ms ease; }
  #studios-map .map-wrap.has-panel .scrim { opacity:1; visibility:visible; pointer-events:auto; }
}
#studios-map .counts { position:absolute; left:14px; top:14px; display:flex; flex-wrap:wrap; align-items:center; gap:2px 8px; max-width:calc(100% - 128px); padding:5px 12px; border-radius:999px; background:var(--surface); border:1px solid var(--line); font-size:0.75rem; line-height:1.5; z-index:4; color:var(--ink); }
#studios-map .counts .lbl { font-weight:700; }
#studios-map .counts .it { display:inline-flex; align-items:center; gap:5px; color:var(--ink-soft); white-space:nowrap; }
#studios-map .counts .it b { color:var(--ink); font-size:0.75rem; }
#studios-map .counts .it i { width:9px; height:9px; border-radius:50%; display:inline-block; flex:0 0 auto; }
#studios-map .counts .sep { color:var(--ink-soft); opacity:.55; }
#studios-map .sm-tooltip { position:absolute; pointer-events:none; background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:9px 12px; font-size:0.75rem; box-shadow:0 10px 24px rgba(0,0,0,.22); max-width:290px; display:none; z-index:7; line-height:1.45; }
#studios-map .sm-tooltip .tt-title { font-weight:700; font-size:0.75rem; margin-bottom:4px; }
#studios-map .sm-tooltip .tt-title span { font-weight:500; color:var(--ink-soft); }
#studios-map .sm-tooltip .tt-sub { color:var(--ink-soft); margin-bottom:4px; }
#studios-map .sm-tooltip .tt-studio { font-weight:700; margin-top:6px; color:var(--accent); }
#studios-map .sm-tooltip ul { margin:2px 0 0; padding-left:16px; }
#studios-map .sm-tooltip li { margin:1px 0; }
#studios-map .sm-tooltip li i { color:var(--ink-soft); font-style:normal; font-size:0.75rem; }
#studios-map .sm-tooltip .more { color:var(--ink-soft); font-size:0.75rem; margin-top:4px; }
#studios-map .fs-btn { position:absolute; right:54px; top:14px; width:32px; height:32px; display:grid; place-items:center; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--surface); color:var(--ink-soft); cursor:pointer; z-index:5; transition:background-color 180ms ease, border-color 180ms ease, color 180ms ease; }
#studios-map .fs-btn:hover, #studios-map .fs-btn:focus-visible { border-color:var(--ink-soft); color:var(--ink); outline:none; }
#studios-map .fs-btn.panel-btn { right:14px; }
#studios-map .fs-btn svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; display:block; }
#studios-map #sm-stage.is-fs { position:fixed; inset:0; z-index:9999; display:flex; flex-direction:column; width:100vw; height:100vh; height:100dvh; overflow:hidden; background:var(--night); }
#studios-map #sm-stage.is-fs .map-wrap { flex:1 1 auto; aspect-ratio:auto; max-height:none; min-height:0; }
#studios-map #sm-stage.is-fs .sm-legend { padding:8px 14px; flex:0 0 auto; }
#studios-map #sm-stage.is-fs #sm-errBox { margin:8px 14px 0; }
#studios-map .sm-legend { display:flex; flex-wrap:wrap; gap:8px 22px; padding:12px 18px 0; font-size:0.75rem; color:var(--ink-soft); align-items:center; }
#studios-map .sm-legend span { display:inline-flex; align-items:center; gap:7px; }
#studios-map .sm-legend svg { width:16px; height:16px; }
@media (max-width:640px) {
  #studios-map input[type="range"] { width:150px; }
}

/* Volet latéral : ouverture / fermeture animées avec les durées de l'accordéon de « Complétion des jeux » (max-height 0,5 s, opacité 0,4 s, ease) */
/* Le contenu (.sp-inner) a une largeur et un remplissage fixes : seul le cadre du volet s'élargit, le contenu glisse donc d'un bloc
   avec son bord gauche (comme le tiroir mobile) au lieu de se décaler pendant l'animation. */
#studios-map .side-panel { display:block; flex:0 0 0; width:0; min-width:0; max-width:40%; padding:0; border-left:0 solid var(--line); overflow:hidden; opacity:0; visibility:hidden; background:var(--surface); font-size:0.75rem; line-height:1.5;
  transition:flex-basis .5s ease, width .5s ease, border-left-width .5s ease, opacity .4s ease, visibility 0s linear .5s; }
#studios-map .map-wrap.has-panel .side-panel { flex-basis:340px; width:340px; border-left-width:1px; opacity:1; visibility:visible;
  transition:flex-basis .5s ease, width .5s ease, border-left-width .5s ease, opacity .4s ease, visibility 0s; }
#studios-map .side-panel .sp-inner { box-sizing:border-box; width:339px; height:100%; padding:14px 16px 20px; overflow-x:hidden; overflow-y:auto; }
@media (prefers-reduced-motion: reduce) { #studios-map .side-panel { transition:none !important; } }
#studios-map #sm-stage.is-fs .sm-head { padding:12px 18px 6px; }
#studios-map .map-wrap { border:1px solid var(--line); border-radius:10px; }
#studios-map #sm-stage.is-fs .map-wrap { border-radius:0; border-width:1px 0; }
/* Filtres repliés par défaut, sur tous les écrans : « Mode » reste visible, avec « Filtres » et un chevron pour déplier */
#studios-map #sm-modeGroup, #studios-map #sm-modeGroup .mode-row { width:100%; }
/* « Vue : » sur la même ligne que Studios / Jeux, quel que soit l'écran */
#studios-map #sm-modeGroup { flex-direction:row; align-items:center; gap:12px; }
#studios-map #sm-modeGroup > .label { white-space:nowrap; }
#studios-map #sm-modeGroup .mode-row { flex:1 1 auto; width:auto; min-width:0; }
#studios-map .mode-row { align-items:center; }
#studios-map .ctrl-toggle { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:32px; margin-left:auto; padding:0 10px 0 14px; border:1px solid var(--line); border-radius:999px; background:transparent; color:var(--ink-soft); font:inherit; font-size:0.75rem; font-weight:600; cursor:pointer; transition:border-color 180ms ease, color 180ms ease; }
#studios-map .ctrl-toggle:hover, #studios-map .ctrl-toggle:focus-visible { border-color:var(--ink-soft); color:var(--ink); outline:none; }
#studios-map .ctrl-toggle svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; display:block; transition:transform 200ms ease; }
#studios-map .controls.is-open .ctrl-toggle svg { transform:rotate(180deg); }
/* Filtres : même animation que les accordéons du site (hauteur 0,5 s, opacité 0,4 s, ease) */
#studios-map .controls { row-gap:0; }
#studios-map .ctrl-more { display:grid; grid-template-rows:0fr; width:100%; opacity:0; visibility:hidden; transition:grid-template-rows .5s ease, opacity .4s ease, visibility 0s linear .5s; }
#studios-map .controls.is-open .ctrl-more { grid-template-rows:1fr; opacity:1; visibility:visible; transition:grid-template-rows .5s ease, opacity .4s ease, visibility 0s; }
#studios-map .ctrl-more-inner { min-height:0; overflow:hidden; }
#studios-map .ctrl-more-body { display:flex; flex-wrap:wrap; align-items:flex-start; gap:16px 22px; padding:16px 0 2px; }
/* chaque rangée de commandes fait 30 px de haut et centre son contenu : les groupes sont alignés sur la même ligne, quelle que soit la taille de leurs boutons */
#studios-map .ctrl-more-body .control-group > :not(.label):not(label):not(.seg) { min-height:30px; align-items:center; }
@media (prefers-reduced-motion: reduce) { #studios-map .ctrl-more, #studios-map .controls.is-open .ctrl-more { transition:none; } }
@media (max-width: 820px), (orientation: landscape) and (max-height: 600px) and (max-width: 1180px) {
  #studios-map .side-panel { padding:0; overflow:hidden; border-left-width:1px; opacity:1; width:min(80vw, calc(100% - 40px)); max-width:none; flex:none; transition:transform 240ms ease, visibility 240ms ease; }
  #studios-map .side-panel .sp-inner { width:auto; }
  #studios-map .map-wrap.has-panel .side-panel { width:min(80vw, calc(100% - 40px)); flex-basis:auto; transition:transform 240ms ease, visibility 240ms ease; }
  #studios-map .ctrl-toggle { width:32px; padding:0; }
  #studios-map .ctrl-toggle-label { display:none; }
  #studios-map .ctrl-more-body { align-items:flex-start; gap:16px 22px; }
  #studios-map .counts { display:block; max-width:calc(100% - 100px); padding:6px 12px; border-radius:18px; }
}

/* Carte (MapLibre) */
#studios-map .sm-citymap { position:absolute; inset:0; z-index:2; background:var(--surface); }
#studios-map .sm-citymap-map { position:absolute; inset:0; }
#studios-map .sm-cz { position:absolute; right:14px; bottom:14px; display:flex; flex-direction:column; gap:8px; z-index:3; }
#studios-map .sm-cz button { width:32px; height:32px; display:grid; place-items:center; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--surface); color:var(--accent); cursor:pointer; transition:background-color 180ms ease, border-color 180ms ease; }
#studios-map .sm-cz button:hover, #studios-map .sm-cz button:focus-visible { border-color:var(--ink-soft); outline:none; }
#studios-map .sm-cz button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
#studios-map .sm-cz svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#studios-map .sm-citymap .maplibregl-ctrl-attrib { font-size:0.75rem; }

/* Légende vide (mode Studios) : aucune place réservée */
#studios-map .sm-legend:empty { display:none; }

/* Mention « i » (© CARTO, © OpenStreetMap contributors) : couleurs inversées en mode nuit */
:root[data-theme="dark"] #studios-map .maplibregl-ctrl-attrib.maplibregl-compact,
:root[data-theme="dark"] #studios-map .maplibregl-ctrl-attrib.maplibregl-compact-show { background:rgba(24,26,30,.88); color:#e9e9ea; }
:root[data-theme="dark"] #studios-map .maplibregl-ctrl-attrib a { color:#e9e9ea; }
:root[data-theme="dark"] #studios-map .maplibregl-ctrl-attrib-button { filter:invert(1); }
:root[data-theme="dark"] #studios-map .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button { background-color:transparent; }

/* Détail d'un studio (volet latéral) */
#studios-map .back-btn { display:inline-flex; align-items:center; gap:6px; margin:0 0 12px; padding:0; border:0; background:none; color:var(--accent); font:inherit; font-size:0.875rem; font-weight:500; cursor:pointer; }
#studios-map .back-btn svg { width:20px; height:20px; fill:currentColor; display:block; }
#studios-map .back-btn:hover span, #studios-map .back-btn:focus-visible span { text-decoration:underline; text-underline-offset:2px; }
#studios-map .back-btn:focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:4px; }
#studios-map .side-panel h3.detail-title { margin:0 0 10px; font-size:1.5rem; line-height:1.2; font-weight:700; }
#studios-map .side-panel .sm-meta { gap:9px; margin:0 0 8px; font-size:0.875rem; font-weight:600; color:var(--ink-soft); }
#studios-map .side-panel .sm-meta img { width:24px; height:auto; border-radius:3px; }
#studios-map .side-panel .d-state, #studios-map .side-panel .d-line, #studios-map .side-panel .variants { margin:6px 0; font-size:0.875rem; line-height:1.45; color:var(--ink-soft); }
#studios-map .side-panel .st-n { color:var(--st-n); font-weight:600; }
#studios-map .side-panel .st-a { color:#1e9e47; font-weight:600; }
#studios-map .side-panel .st-r { color:var(--st-r); font-weight:600; }
#studios-map .side-panel .st-c { color:var(--st-c); font-weight:600; }
:root[data-theme="dark"] #studios-map .side-panel .st-a { color:#4cc37c; }
#studios-map .side-panel .trust { font-size:0.75rem; }
#studios-map .side-panel p.links { display:flex; flex-wrap:wrap; gap:6px 22px; margin:14px 0 0; }
#studios-map .side-panel .links a { display:inline-flex; align-items:center; gap:6px; margin:0; font-weight:700; font-size:0.875rem; }
#studios-map .side-panel .links a svg { width:18px; height:18px; fill:currentColor; flex:0 0 auto; }
#studios-map .side-panel .games-title { margin:0 0 8px; font-size:0.875rem; font-weight:700; color:var(--ink); }

/* Choix exclusifs (Studios / Jeux, Carte / Globe, Plan / Satellite) : bouton segmenté, coche sur l'option active */
#studios-map .seg { display:inline-flex; align-items:stretch; height:30px; border:1px solid var(--line); border-radius:999px; overflow:hidden; background:var(--night); }
#studios-map .seg .chip { height:auto; padding:0 12px; border:0; border-radius:0; background:transparent; color:var(--ink); font-size:0.75rem; gap:6px; }
#studios-map .seg .chip + .chip { border-left:1px solid var(--line); }
#studios-map .seg .chip.is-active { background:var(--accent); color:#fff; }
#studios-map .seg .chip.is-active::before { content:""; width:14px; height:14px; flex:0 0 auto; background:currentColor; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.0007 15.1709L19.1931 5.97852L20.6073 7.39273L10.0007 17.9993L3.63672 11.6354L5.05093 10.2212L10.0007 15.1709Z'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.0007 15.1709L19.1931 5.97852L20.6073 7.39273L10.0007 17.9993L3.63672 11.6354L5.05093 10.2212L10.0007 15.1709Z'/%3E%3C/svg%3E") center/contain no-repeat; }
#studios-map .seg .chip:focus-visible { outline:2px solid var(--accent); outline-offset:-3px; }
#studios-map .mode-row .seg { flex:0 1 auto; }

/* Big Four : drapeaux ronds ; actif = fin anneau d'accent autour du drapeau (plus de pastille rouge pleine) */
#studios-map .chip--flag { position:relative; box-sizing:border-box; width:24px; height:24px; padding:0; justify-content:center; border:2px solid transparent; border-radius:50%; background:transparent; }
#studios-map .chip--flag::after { content:""; position:absolute; inset:-3px; }                      /* zone de clic un peu plus grande que le picto */
#studios-map .chip--flag.is-active { background:transparent; border-color:var(--accent); color:var(--ink); }
#studios-map .flag-round { position:relative; display:block; width:20px; height:20px; border-radius:50%; overflow:hidden; flex:0 0 auto; }   /* 24 px au total, anneau de 2 px compris : le drapeau touche l'anneau, sans liseré blanc */
#studios-map .flag-round img { position:absolute; left:-25%; top:-25%; width:150%; height:150%; max-width:none; }   /* le drapeau (30×24 dans un cadre de 32) déborde un peu du disque : son liseré d'origine (blanc en haut, gris en bas) est rogné */
#studios-map .flag-round--globe { overflow:visible; background:var(--night); }   /* disque plein : plus de blanc entre le globe et l'anneau */
/* icône Remix « earth-line » : agrandie à 24 px dans un disque de 20 px (rogné) pour que son contour touche l'anneau d'activation */
#studios-map .flag-round--globe svg { position:absolute; left:50%; top:50%; width:28.8px; height:28.8px; transform:translate(-50%,-50%); fill:currentColor; stroke:none; }   /* centré sur le disque, même quand il dépasse */
#studios-map .chip--flag.is-active .flag-round--globe { color:var(--accent); }

@media (max-width: 820px), (orientation: landscape) and (max-height: 600px) and (max-width: 1180px) {
  #studios-map .seg .chip { padding:0 10px; gap:5px; }
  #studios-map .ctrl-more-body { column-gap:16px; }
}

/* Détail d'un studio : l'en-tête reste fixe, seule la liste des jeux défile (ascenseur). Un jeu = 2 lignes : titre (… si trop long), puis support · année. */
#studios-map .side-panel .sp-inner--split { display:flex; flex-direction:column; overflow-x:hidden; overflow-y:auto; }
#studios-map .side-panel .sp-scroll { flex:1 1 auto; min-height:72px; margin-right:-8px; padding-right:8px; overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; }   /* ascenseur fin, comme la liste des jeux */
#studios-map .side-panel .sp-head { flex:0 0 auto; }
#studios-map .side-panel .sp-games { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; margin-top:16px; padding-top:14px; border-top:1px solid var(--line); }
#studios-map .side-panel .games-title { flex:0 0 auto; }
#studios-map .side-panel ul.glist { flex:0 1 auto; min-height:72px; margin:0; padding:0 8px 0 0; list-style:none; overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; }
#studios-map .side-panel ul.glist li { position:relative; margin:0 0 9px; padding:0 0 0 14px; min-width:0; }
/* puce dessinée à la main : son bord gauche est aligné sur le texte « N jeux dans la collection » */
#studios-map .side-panel ul.glist li::before { content:""; position:absolute; left:0; top:.58em; width:5px; height:5px; border-radius:50%; background:var(--ink); }
#studios-map .side-panel ul.glist .g-title { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:0.875rem; line-height:1.35; font-weight:700; color:var(--ink); }
#studios-map .side-panel ul.glist .g-meta { display:block; font-size:0.75rem; line-height:1.35; color:var(--ink-soft); }
#studios-map .chip--flag:not(.is-active) .flag-round--globe svg { width:24px; height:24px; }   /* désactivé : même taille que les drapeaux atténués */

/* Icônes des boutons de la carte : trait rouge en mode jour, blanc en mode nuit */
#studios-map .fs-btn, #studios-map .sm-cz button { color:var(--accent); }
:root[data-theme="dark"] #studios-map .fs-btn, :root[data-theme="dark"] #studios-map .sm-cz button { color:#fff; }
:root[data-theme="dark"] #studios-map .fs-btn:hover, :root[data-theme="dark"] #studios-map .fs-btn:focus-visible { color:#fff; }
#studios-map .fs-btn:hover, #studios-map .fs-btn:focus-visible { color:var(--accent); }
/* Chevron après le nombre de jeux */
#studios-map .side-panel summary { grid-template-columns:1fr auto auto; }
#studios-map .side-panel summary .g-chev { display:grid; place-items:center; color:var(--ink-soft); }
#studios-map .side-panel summary .g-chev svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; transition:transform .18s ease; }
#studios-map .side-panel details[open] > summary .g-chev svg { transform:rotate(180deg); }
@media (prefers-reduced-motion: reduce) { #studios-map .side-panel summary .g-chev svg { transition:none; } }
/* État actif : rouge plein, picto blanc (comme le choix « Studios / Jeux ») */
#studios-map .map-wrap.has-panel .panel-btn, :root[data-theme="dark"] #studios-map .map-wrap.has-panel .panel-btn,
#studios-map .sm-cz button[aria-pressed="true"], :root[data-theme="dark"] #studios-map .sm-cz button[aria-pressed="true"] { background:var(--accent); border-color:var(--accent); color:#fff; }

/* Croix de fermeture du volet : même pictogramme que les contrôles de la carte, collée en haut à droite pendant le défilement */
#studios-map .sp-close { position:sticky; top:0; z-index:3; align-self:flex-end; flex:0 0 auto; width:32px; height:32px; margin:0 0 -32px; display:grid; place-items:center; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--surface); color:var(--ink-soft); cursor:pointer; transition:background-color 180ms ease, border-color 180ms ease, color 180ms ease; }
#studios-map .sp-close:hover, #studios-map .sp-close:focus-visible { border-color:var(--ink-soft); color:var(--ink); outline:none; }
#studios-map .sp-close:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
#studios-map .sp-close svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; display:block; }
#studios-map .sp-close + * { padding-right:40px; box-sizing:border-box; }

/* ---------- Bouton « Filtres » : état actif quand le panneau est ouvert (même rendu que « Studios / Jeux ») ---------- */
#studios-map .ctrl-toggle[aria-expanded="true"],
#studios-map .ctrl-toggle[aria-expanded="true"]:hover,
#studios-map .ctrl-toggle[aria-expanded="true"]:focus-visible,
:root[data-theme="dark"] #studios-map .ctrl-toggle[aria-expanded="true"] { background:var(--accent); border-color:var(--accent); color:#fff; }

/* ---------- Recherche d'un jeu (à droite du choix de la vue) ---------- */
#studios-map .sm-head { position:relative; z-index:30; }
#studios-map .sm-search { position:relative; flex:1 1 260px; max-width:340px; min-width:0; margin-left:6px; }
#studios-map .sm-search-btn, #studios-map .sm-search-close { display:none; }
#studios-map .sm-search-box { position:relative; display:flex; align-items:center; gap:8px; height:32px; padding:0 8px 0 12px; border:1px solid var(--line); border-radius:999px; background:var(--night); transition:border-color 180ms ease; }
#studios-map .sm-search-box:focus-within { border-color:var(--accent); }
#studios-map .sm-search-ic { display:grid; place-items:center; flex:0 0 auto; width:16px; height:16px; color:var(--ink-soft); }
#studios-map .sm-search-ic svg { width:16px; height:16px; display:block; }
#studios-map .sm-search input { flex:1 1 auto; min-width:0; height:100%; padding:0; border:0; background:transparent; color:var(--ink); font:inherit; font-size:0.8125rem; outline:none; }
#studios-map .sm-search input::placeholder { color:var(--ink-soft); opacity:1; }
#studios-map .sm-search-list { position:absolute; left:0; right:0; top:calc(100% + 6px); z-index:40; margin:0; padding:4px; list-style:none; max-height:min(50vh, 360px); overflow-y:auto; overscroll-behavior:contain; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 10px 24px rgba(0,0,0,.22); }
#studios-map .sm-search-list[hidden] { display:none; }
#studios-map .sm-search-list li { display:block; padding:7px 10px; border-radius:8px; cursor:pointer; }
#studios-map .sm-search-list li.is-sel { background:color-mix(in srgb, var(--accent) 14%, transparent); }
#studios-map .sm-search-list .sg-title { display:block; font-size:0.8125rem; font-weight:700; line-height:1.3; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#studios-map .sm-search-list .sg-meta { display:block; font-size:0.75rem; line-height:1.35; color:var(--ink-soft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#studios-map .sm-search-list li.sg-none { cursor:default; font-size:0.75rem; color:var(--ink-soft); }

/* Jeu cherché, mis en évidence dans le volet */
#studios-map .side-panel li.is-hit { background:color-mix(in srgb, var(--accent) 14%, transparent); border-radius:6px; font-weight:700; }
#studios-map .side-panel details li.is-hit { margin-left:-6px; padding:1px 6px; }
#studios-map .side-panel ul.glist li.is-hit { box-shadow:inset 3px 0 0 var(--accent); padding-top:3px; padding-bottom:3px; margin-left:-4px; padding-left:18px; }
#studios-map .side-panel ul.glist li.is-hit::before { left:4px; }

/* Mobile : le champ est fermé (loupe) ; ouvert, il prend la place du choix de la vue */
@media (max-width: 820px), (orientation: landscape) and (max-height: 600px) and (max-width: 1180px) {
  #studios-map .sm-search { flex:0 0 auto; max-width:none; margin-left:auto; }
  #studios-map .ctrl-toggle { margin-left:8px; }
  #studios-map .sm-search-btn { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; padding:0; border:1px solid var(--line); border-radius:999px; background:transparent; color:var(--ink-soft); cursor:pointer; }
  #studios-map .sm-search-btn:hover, #studios-map .sm-search-btn:focus-visible { border-color:var(--ink-soft); color:var(--ink); outline:none; }
  #studios-map .sm-search-btn svg { width:18px; height:18px; display:block; }
  #studios-map .sm-search-box { display:none; }
  #studios-map .sm-search.is-open { flex:1 1 auto; min-width:0; margin-left:0; }
  #studios-map .sm-search.is-open .sm-search-btn { display:none; }
  #studios-map .sm-search.is-open .sm-search-box { display:flex; }
  #studios-map .sm-search input { font-size:16px; }          /* 16 px : évite le zoom automatique de Safari sur iPhone */
  #studios-map .sm-search-close { display:grid; place-items:center; flex:0 0 auto; width:24px; height:24px; padding:0; border:0; border-radius:50%; background:transparent; color:var(--ink-soft); cursor:pointer; }
  #studios-map .sm-search-close svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; display:block; }
  #studios-map #sm-modeGroup.is-searching > .label, #studios-map #sm-modeGroup.is-searching .seg { display:none; }
}
@keyframes smSearchOpen { from { clip-path:inset(0 0 0 100% round 999px); opacity:.35; } to { clip-path:inset(0 0 0 0 round 999px); opacity:1; } }
@keyframes smSearchClose { from { clip-path:inset(0 0 0 0 round 999px); opacity:1; } to { clip-path:inset(0 0 0 100% round 999px); opacity:0; } }
@keyframes smFadeIn { from { opacity:0; transform:translateX(-6px); } to { opacity:1; transform:none; } }
@media (max-width: 820px), (orientation: landscape) and (max-height: 600px) and (max-width: 1180px) {
  #studios-map .sm-search.is-open .sm-search-box { animation:smSearchOpen .26s cubic-bezier(.2,.7,.2,1) backwards; }
  #studios-map .sm-search.is-open.is-closing .sm-search-box { animation:smSearchClose .19s ease-in forwards; }
  #studios-map #sm-modeGroup.is-restoring > .label, #studios-map #sm-modeGroup.is-restoring .seg, #studios-map #sm-modeGroup.is-restoring .sm-search-btn { animation:smFadeIn .24s ease-out backwards; }
}
@media (prefers-reduced-motion: reduce) { #studios-map .sm-search-box { transition:none; } #studios-map .sm-search-box, #studios-map #sm-modeGroup > .label, #studios-map #sm-modeGroup .seg, #studios-map #sm-modeGroup .sm-search-btn { animation:none !important; } }
#studios-map .sp-focus { margin:0 0 10px; padding:8px 10px; border-radius:8px; background:color-mix(in srgb, var(--accent) 10%, transparent); font-size:0.75rem; line-height:1.45; color:var(--ink-soft); }
