/* Cartogether — panneaux de jeu cohérents sur PC.
   4 écrans concernés : France, Pays, Plus près/plus loin, Entre amis.
   Conserve la barre de navigation commune et ne touche pas au mobile.
   Les options et les règles propres à chaque jeu restent inchangées. */
@media (min-width:900px) and (min-height:560px) {
  :root {
    --ct-game-header:76px;
    --ct-game-panel-top:98px;
    --ct-game-panel-left:clamp(18px,2.7vw,52px);
    --ct-game-panel-width:min(405px,calc(100vw - 36px));
    --ct-game-panel-bottom:18px;
    --ct-game-panel-bg:rgba(255,255,255,.97);
    --ct-game-panel-border:rgba(230,238,245,.95);
    --ct-game-panel-shadow:0 16px 34px rgba(5,18,38,.20);
  }

  /* Entre amis : supprimer la boîte centrée qui tranche avec Entraînement.
     La carte est plein espace sous le bandeau, même au choix des modes. */
  body.ct-screen-friends .game {
    position:relative;
    height:100dvh;
    min-height:0;
    width:100%;
    overflow:hidden;
    display:block;
    background:#cfe8f4;
  }
  body.ct-screen-friends .game::before {display:none!important;}
  body.ct-screen-friends #map,
  body.ct-screen-friends.ct-friends-immersive #map {
    position:absolute;
    z-index:1;
    display:block;
    top:var(--ct-game-header);
    left:0;
    right:0;
    bottom:0;
    width:100%;
    height:calc(100dvh - var(--ct-game-header));
    min-height:0;
    max-height:none;
    flex:none;
    border-radius:0;
    box-shadow:none;
    background:#cfe8f4;
  }

  /* Même largeur, même position et même traitement pour tous les panneaux. */
  body.ct-screen-friends .game > .panel,
  body.ct-screen-friends.ct-friends-immersive .game > .panel,
  body.ct-screen-training #setupPanel,
  body.ct-screen-training #finishPanel,
  body.ct-screen-solo-map .game > .setup,
  body.ct-screen-solo-map .game > .hud,
  body.ct-screen-solo-map .game > .finish {
    box-sizing:border-box;
    position:absolute;
    z-index:630;
    top:var(--ct-game-panel-top);
    left:var(--ct-game-panel-left);
    right:auto;
    bottom:auto;
    transform:none;
    width:var(--ct-game-panel-width);
    max-width:none;
    height:auto;
    max-height:calc(100dvh - var(--ct-game-panel-top) - var(--ct-game-panel-bottom));
    margin:0;
    padding:20px;
    border-radius:19px;
    border:1px solid var(--ct-game-panel-border);
    background:var(--ct-game-panel-bg);
    box-shadow:var(--ct-game-panel-shadow);
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior:contain;
    scrollbar-width:thin;
  }
  /* France encapsule son HUD dans un conteneur distinct. */
  body.ct-screen-training #quizPanel {
    left:var(--ct-game-panel-left);
    top:var(--ct-game-panel-top);
    width:var(--ct-game-panel-width);
    max-height:calc(100dvh - var(--ct-game-panel-top) - var(--ct-game-panel-bottom));
    transform:none;
    border-radius:19px;
  }
  body.ct-screen-training #quizPanel .hud {
    background:var(--ct-game-panel-bg);
    box-shadow:var(--ct-game-panel-shadow);
    border:1px solid var(--ct-game-panel-border);
    border-radius:19px;
    padding:20px;
  }
  body.ct-screen-friends .game > .panel.hidden {display:none!important;}

  /* Teinte cartographique identique sur tous les jeux. */
  body.ct-screen-training #map,
  body.ct-screen-solo-map #map,
  body.ct-screen-friends #map,
  body.ct-screen-training #map.leaflet-container,
  body.ct-screen-solo-map #map.leaflet-container,
  body.ct-screen-friends #map.leaflet-container {
    background:#cfe8f4!important;
  }

  /* Titres, paragraphes, libellés et contrôles partagent les mêmes proportions. */
  body.ct-screen-friends .game > .panel h1,
  body.ct-screen-training #setupPanel h2,
  body.ct-screen-training #setupPanel h1,
  body.ct-screen-solo-map .game > .setup h1 {
    font-size:24px;
    line-height:1.17;
    letter-spacing:-.025em;
    color:#152b45;
    font-weight:850;
    margin-top:0;
  }
  body.ct-screen-friends .game > .panel p,
  body.ct-screen-solo-map .game > .setup p {
    font-size:12px;
    line-height:1.5;
  }
  body.ct-screen-friends .game > .panel label:not(.mode-card),
  body.ct-screen-solo-map .game > .setup > label,
  body.ct-screen-training #setupPanel .setup-row > label {
    font-size:12px;
    font-weight:750;
    color:#344961;
  }
  body.ct-screen-friends .game > .panel select,
  body.ct-screen-friends .game > .panel input:not([type='radio']),
  body.ct-screen-solo-map .game > .setup select,
  body.ct-screen-training #setupPanel select {
    box-sizing:border-box;
    min-height:42px;
    border:1px solid #d2dfec;
    background:#fff;
    color:#172b45;
    border-radius:11px;
    font-size:13px;
  }
  body.ct-screen-friends .game > .panel button:not(.room-back):not(.quit),
  body.ct-screen-solo-map .game > .setup #start,
  body.ct-screen-training #startBtn {
    border-radius:11px;
  }

  /* Le panneau Entre amis est un vrai panneau de jeu, pas une page marketing. */
  body.ct-screen-friends .room-home {padding:20px;text-align:left;}
  body.ct-screen-friends .room-home-icon {
    width:43px;height:43px;display:grid;place-items:center;
    font-size:24px;background:#eaf6f3;border-radius:12px;margin:0 0 12px;
  }
  body.ct-screen-friends .room-home h1 {margin:0 0 8px;}
  body.ct-screen-friends .room-home > p {margin-bottom:13px;text-align:left;}
  body.ct-screen-friends .room-home-actions {gap:9px;margin-top:14px;}
  body.ct-screen-friends .room-home-actions button {min-height:47px;font-size:13px;}
  body.ct-screen-friends .room-home .room-home-caption {margin:13px 0 8px;}
  body.ct-screen-friends .room-home .training-link {display:inline-block;margin-top:5px;}
  body.ct-screen-friends .simple-setup .mode-card {min-height:75px;padding:9px;}
  body.ct-screen-friends .simple-setup .mode-copy strong {font-size:12px;}
  body.ct-screen-friends .simple-setup .mode-copy small {font-size:10px;}

  /* Onglets des trois entraînements : proportions identiques sur PC. */
  body.ct-screen-training .ct-training-switcher,
  body.ct-screen-solo-map .ct-training-switcher {margin-bottom:13px;}

  /* Préserver le style de la navigation universelle, au-dessus de Leaflet. */
  body.ct-screen-friends .topbar.ct-site-nav,
  body.ct-screen-training .topbar.ct-site-nav,
  body.ct-screen-solo-map .topbar.ct-site-nav {
    z-index:1500!important;
  }
}
