/* FRBC V36.11 — PANNEAUX CENTRAUX / MOBILE PAYSAGE
 * Une seule zone fluide entre les deux colonnes V28.
 * Agit seulement pendant une partie compacte paysage; aucune modification JS,
 * des vues, du portrait, du PC, du contenu ou des modèles 3D.
 */
@media screen and (orientation:landscape) and (max-width:1100px) and (max-height:455px),
       screen and (orientation:landscape) and (max-width:1100px) and (max-height:600px) and (pointer:coarse) {
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro) {
   --frbc-frame-gap: clamp(8px, 1.35vw, 16px);
   --frbc-frame-left: calc(max(5px, env(safe-area-inset-left)) + var(--v36-left-width, 124px) + var(--frbc-frame-gap));
   --frbc-frame-right: calc(max(5px, env(safe-area-inset-right)) + var(--v36-right-width, 132px) + var(--frbc-frame-gap));
   --frbc-frame-top: max(6px, env(safe-area-inset-top));
   --frbc-frame-bottom: max(6px, env(safe-area-inset-bottom));
   --frbc-frame-width: calc(100dvw - var(--frbc-frame-left) - var(--frbc-frame-right));
   --frbc-frame-height: calc(100dvh - var(--frbc-frame-top) - var(--frbc-frame-bottom));
 }

 /* SHOP, PARTIES, CHAT: the backdrop itself occupies ONLY the central lane.
    Clicks on the V28 side menus are not intercepted by a fullscreen overlay. */
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 :is(#shop-modal#shop-modal,#frbc-lobby-modal#frbc-lobby-modal):not([hidden]),
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 #frbc-chat-modal#frbc-chat-modal:not([hidden]):not(.is-collapsed) {
   position:fixed!important;
   inset:var(--frbc-frame-top) var(--frbc-frame-right) var(--frbc-frame-bottom) var(--frbc-frame-left)!important;
   top:var(--frbc-frame-top)!important;right:var(--frbc-frame-right)!important;
   bottom:var(--frbc-frame-bottom)!important;left:var(--frbc-frame-left)!important;
   width:var(--frbc-frame-width)!important;max-width:var(--frbc-frame-width)!important;
   height:var(--frbc-frame-height)!important;max-height:var(--frbc-frame-height)!important;
   min-width:0!important;min-height:0!important;
   transform:none!important;margin:0!important;
   display:flex!important;flex-flow:column nowrap!important;align-items:stretch!important;justify-content:center!important;
   padding:0!important;box-sizing:border-box!important;
   border:0!important;border-radius:12px!important;
   overflow:hidden!important;overscroll-behavior:contain!important;
   background:rgba(3,18,32,.48)!important;
   backdrop-filter:blur(5px)!important;-webkit-backdrop-filter:blur(5px)!important;
   pointer-events:auto!important;
   z-index:16000!important;
 }

 /* Full-width scrollable interior; no separate detail panel, cards keep their
    real Three.js previews. Shop's existing responsive layout is retained. */
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 #shop-modal#shop-modal:not([hidden]) > .shop-card {
   position:relative!important;inset:auto!important;transform:none!important;
   width:100%!important;min-width:0!important;max-width:100%!important;
   height:100%!important;min-height:0!important;max-height:100%!important;
   margin:0!important;padding:clamp(8px,1.65dvh,14px)!important;
   overflow-x:hidden!important;overflow-y:auto!important;
   overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch;
   box-sizing:border-box!important;border-radius:12px!important;
 }
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 #shop-modal#shop-modal .shop-card > :is(.shop-heading,.shop-tabs,.shop-grid,.frbc-shop-selection,#shop-grid) {
   min-width:0!important;max-width:100%!important;
 }
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 #shop-modal#shop-modal #shop-grid {min-width:0!important;width:100%!important;max-width:100%!important;}
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 #shop-modal#shop-modal #shop-close {min-width:44px!important;min-height:44px!important;z-index:5!important;}

 /* PARTIES uses the native lobby. Keep its refresh, invited members and join
    controls fully operable; only the outer geometry and scroll area change. */
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 #frbc-lobby-modal#frbc-lobby-modal:not([hidden]) > .frbc-lobby {
   position:relative!important;inset:auto!important;transform:none!important;
   width:100%!important;min-width:0!important;max-width:100%!important;
   height:100%!important;max-height:100%!important;min-height:0!important;
   margin:0!important;padding:clamp(9px,2dvh,15px)!important;
   box-sizing:border-box!important;overflow-x:hidden!important;overflow-y:auto!important;
   overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch;
   border-radius:12px!important;
 }
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 #frbc-lobby-modal#frbc-lobby-modal .frbc-lobby-list{grid-template-columns:minmax(0,1fr)!important;max-height:none!important;}
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 #frbc-lobby-modal#frbc-lobby-modal :is(.frbc-lobby-join,.frbc-lobby-tools,.frbc-lobby-player){min-width:0!important;max-width:100%!important;flex-wrap:wrap!important;}
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 #frbc-lobby-modal#frbc-lobby-modal :is(#frbc-lobby-close,button){min-height:44px!important;}

 /* CHAT: neutralize the old floating/docked width, but reuse all native form,
    message thread, scroll state, close button and chat service. */
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 #frbc-chat-modal#frbc-chat-modal:not([hidden]):not(.is-collapsed) > .frbc-chat-card {
   position:relative!important;inset:auto!important;transform:none!important;
   width:100%!important;max-width:100%!important;min-width:0!important;
   height:100%!important;max-height:100%!important;min-height:0!important;
   margin:0!important;padding:clamp(8px,1.7dvh,14px)!important;
   display:flex!important;flex-direction:column!important;
   overflow:hidden!important;box-sizing:border-box!important;
   border-radius:12px!important;
 }
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 #frbc-chat-modal#frbc-chat-modal:not([hidden]):not(.is-collapsed) #frbc-chat-thread {
   flex:1 1 auto!important;min-height:36px!important;max-height:none!important;overflow-y:auto!important;
 }
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 #frbc-chat-modal#frbc-chat-modal:not([hidden]):not(.is-collapsed) #frbc-chat-close {min-width:44px!important;min-height:44px!important;}

 /* Moves/sessions are transient V28 panels: align with the same central lane. */
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 :is(#moves-panel#moves-panel,#v28-sessions-panel#v28-sessions-panel):not([hidden]) {
   position:fixed!important;inset:auto!important;
   top:50%!important;left:var(--frbc-frame-left)!important;right:auto!important;bottom:auto!important;
   transform:translateY(-50%)!important;
   width:var(--frbc-frame-width)!important;max-width:var(--frbc-frame-width)!important;
   min-width:0!important;max-height:var(--frbc-frame-height)!important;
   box-sizing:border-box!important;overflow-y:auto!important;
 }

 /* Strict native visibility: never resurrect a modal hidden by game logic. */
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 :is(#shop-modal,#frbc-lobby-modal,#frbc-chat-modal,#moves-panel,#v28-sessions-panel)[hidden]{display:none!important;}
 html.frbc-v28-demo:not(.frbc-mobile-vertical):not(.frbc-pc-horizontal):not(.mobile-intro)
 #frbc-chat-modal.is-collapsed{display:none!important;}
}

/* Port conservatoire de la correction V13 du chat Visuel shop FRBC V36.
   Charge en dernier pour conserver la priorite sur les regles PC fluides. */
/* FRBC V36 — Mac en fenêtre réduite.
   Le layout desktop natif prend le relais à 980 px CSS. Entre 700 et 979 px,
   le rail V28 reste actif : on masque les anciens compteurs latéraux et on
   garde le bouton d'action dans le style bleu du dock validé. */
@media screen and (orientation:landscape) and (min-width:700px) and (max-width:979.99px) and (pointer:fine) {
  html.frbc-v28-demo:not(.frbc-mobile-ui):not(.frbc-mobile-vertical) #side-stats {
    display:none!important;
  }
  html.frbc-v28-demo:not(.frbc-mobile-ui):not(.frbc-mobile-vertical) #game-dock .dock-actions .primary:not([hidden]) {
    background:linear-gradient(120deg,#f2f8ff,#9dd5ff)!important;
    color:#092744!important;
    border:1px solid #c8edff!important;
    border-radius:9px!important;
    min-height:44px!important;
  }
}
