/* COSM-GAME exact shared mobile shell v11.
   This component is now used by Homepage AND every other route.
   It intentionally does not inherit page-specific nav/button/font rules. */

@media (max-width:860px){
  html,body{max-width:100%;overflow-x:clip}
  body{padding-bottom:calc(86px + env(safe-area-inset-bottom,0px))!important}
  .cg-desktop-header-zone{display:none!important}

  /* Hide the Homepage's original navigation chrome only. Its content/hero/
     rails remain untouched and continue using homepage-mockup-final.js. */
  #mobile-view .screen>header,
  #mobile-view #searchBar,
  #mobile-view .tabbar,
  #mobile-view .sheet-backdrop,
  #mobile-view .sheet{
    display:none!important;
  }

  .cg-mobile-global-header,
  .cg-mobile-global-header *,
  .cg-mobile-global-search,
  .cg-mobile-global-search *,
  .cg-mobile-global-bottom,
  .cg-mobile-global-bottom *,
  .cg-mobile-global-backdrop,
  .cg-mobile-global-sheet,
  .cg-mobile-global-sheet *{
    box-sizing:border-box;
  }

  .cg-mobile-global-header{
    position:sticky;top:0;z-index:1200;
    display:flex!important;align-items:center;justify-content:space-between;
    width:100%;height:58px;min-height:58px;padding:11px 14px;margin:0;
    background:rgba(14,19,29,.96);
    border:0;border-bottom:1px solid #232b3d;
    border-radius:0;
    box-shadow:0 6px 22px rgba(0,0,0,.16);
    backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important;
    color:#e8ebf1;
  }
  .cg-mobile-global-brand{
    all:unset;
    box-sizing:border-box;
    display:flex;align-items:center;gap:9px;
    color:#e8ebf1!important;text-decoration:none!important;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important;
    font-size:15px!important;font-weight:700!important;line-height:1!important;
    letter-spacing:0!important;white-space:nowrap;cursor:pointer;
  }
  .cg-mobile-global-brand img{
    all:unset;
    box-sizing:border-box;
    display:block;width:27px!important;height:27px!important;flex:0 0 27px;
    border-radius:8px!important;object-fit:cover;
  }
  .cg-mobile-global-search-toggle{
    all:unset;
    box-sizing:border-box;
    width:34px!important;height:34px!important;flex:0 0 34px;
    display:flex!important;align-items:center;justify-content:center;
    border-radius:50%!important;background:transparent!important;
    color:#98a2b8!important;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important;
    font-size:16px!important;line-height:1!important;cursor:pointer;
    touch-action:manipulation;
  }
  .cg-mobile-global-search-toggle:active{background:#1c2436!important;color:#e8ebf1!important}

  .cg-mobile-global-search{
    display:none;
    position:sticky;top:58px;z-index:1190;width:100%;
    padding:10px 12px 12px;margin:0;
    background:rgba(14,19,29,.96);
    border-bottom:1px solid #232b3d;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important;
  }
  .cg-mobile-global-search.is-open{display:block}
  .cg-mobile-global-search form{all:unset;display:block}
  .cg-mobile-global-search input{
    all:unset;box-sizing:border-box;
    display:block;width:100%;height:38px;padding:9px 12px;
    border:1px solid #232b3d!important;border-radius:10px!important;
    background:#151b28!important;color:#e8ebf1!important;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important;font-size:13px!important;
    font-weight:400!important;line-height:1.2!important;
  }
  .cg-mobile-global-search input::placeholder{color:#666f85!important;opacity:1}

  .cg-mobile-global-bottom{
    position:fixed;left:0;right:0;bottom:0;z-index:1300;
    display:flex!important;align-items:stretch;width:100%;min-height:59px;
    margin:0;padding:0 0 env(safe-area-inset-bottom,0px);
    background:rgba(14,19,29,.97);
    border:0;border-top:1px solid #232b3d;border-radius:0;
    box-shadow:0 -8px 24px rgba(0,0,0,.28);
    backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important;
  }
  .cg-mobile-global-bottom>a,
  .cg-mobile-global-bottom>button{
    all:unset;
    box-sizing:border-box;
    flex:1 1 20%;width:20%;min-width:0;
    padding:7px 0 8px!important;margin:0!important;
    display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:3px;
    color:#666f85!important;background:transparent!important;
    border:0!important;border-radius:0!important;text-decoration:none!important;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important;font-size:9.5px!important;
    font-weight:400!important;line-height:1!important;letter-spacing:0!important;
    cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;
    text-align:center;
  }
  .cg-mobile-global-bottom .cg-mobile-tab-ic{
    all:unset;
    box-sizing:border-box;
    display:flex!important;align-items:center;justify-content:center;
    width:40px!important;height:25px!important;min-width:40px;
    border-radius:14px!important;background:transparent!important;
    color:#666f85!important;font-size:15px!important;line-height:1!important;
    transition:background .15s ease,color .15s ease;
  }
  .cg-mobile-global-bottom .cg-mobile-tab-ic i{
    font-size:15px!important;line-height:1!important;
    color:inherit!important;
  }
  .cg-mobile-global-bottom .cg-mobile-tab-label{
    all:unset;
    display:block;
    color:inherit!important;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important;font-size:9.5px!important;
    font-weight:400!important;line-height:1!important;letter-spacing:0!important;
  }
  .cg-mobile-global-bottom>a.active,
  .cg-mobile-global-bottom>button.active{color:#4b8bf4!important}
  .cg-mobile-global-bottom>a.active .cg-mobile-tab-ic,
  .cg-mobile-global-bottom>button.active .cg-mobile-tab-ic{
    background:rgba(75,139,244,.15)!important;color:#4b8bf4!important;
  }

  /* Same interaction model as the Homepage: backdrop fades in and sheet
     slides up. No hidden-attribute dependency, so page CSS cannot defeat it. */
  .cg-mobile-global-backdrop{
    display:block!important;
    position:fixed;inset:0 0 calc(59px + env(safe-area-inset-bottom,0px));
    z-index:1270;background:rgba(3,5,9,.55);
    opacity:0;pointer-events:none;transition:opacity .2s ease;
  }
  .cg-mobile-global-backdrop.is-open{opacity:1;pointer-events:auto}

  .cg-mobile-global-sheet{
    display:block!important;
    position:fixed;left:0;right:0;
    bottom:calc(59px + env(safe-area-inset-bottom,0px));z-index:1280;
    max-height:min(70vh,520px);overflow-y:auto;
    padding:8px 16px 14px;margin:0;
    background:#151b28;border:0;border-top:1px solid #232b3d;
    border-radius:16px 16px 0 0;
    box-shadow:0 -12px 30px -10px rgba(0,0,0,.5);
    transform:translateY(105%);pointer-events:none;
    transition:transform .25s ease;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important;
  }
  .cg-mobile-global-sheet.is-open{transform:translateY(0);pointer-events:auto}
  .cg-mobile-global-sheet-handle{
    width:36px;height:4px;border-radius:2px;background:#232b3d;
    margin:8px auto 12px;
  }
  .cg-mobile-global-sheet a{
    all:unset;box-sizing:border-box;
    display:flex!important;align-items:center;gap:12px;
    padding:12px 2px!important;margin:0;
    border-bottom:1px solid #232b3d!important;
    color:#e8ebf1!important;text-decoration:none!important;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important;font-size:13.5px!important;
    font-weight:400!important;line-height:1.2!important;cursor:pointer;
  }
  .cg-mobile-global-sheet a:last-child{border-bottom:0!important}
  .cg-mobile-global-sheet i{
    width:18px;text-align:center;font-size:14.5px!important;color:#98a2b8!important
  }
}

@media (min-width:861px){
  .cg-mobile-global-header,.cg-mobile-global-search,.cg-mobile-global-bottom,
  .cg-mobile-global-backdrop,.cg-mobile-global-sheet{display:none!important}
}
