/*
 * GamingSecrets — boutons premium du header mobile (V31.58.70)
 * Sélecteur de langue, bouton Collection/Connexion et menu burger.
 * Coins coupés façon HUD manga, liseré métal, micro-animations légères.
 * Chargé après les autres modules (priorité 40) : ne touche pas au header desktop.
 */

@media (max-width:900px){

  /* ---------- Sélecteur de langue ---------- */
  .gs-header .gs-mobile-language-trigger{
    --gs-cut:9px;
    isolation:isolate;
    overflow:hidden;
    border:0;
    border-radius:0;
    background:#1b1e27;
    box-shadow:none;
    clip-path:polygon(var(--gs-cut) 0,100% 0,100% calc(100% - var(--gs-cut)),calc(100% - var(--gs-cut)) 100%,0 100%,0 var(--gs-cut));
    transition:background-color .25s ease;
  }

  /* Liseré métal gris → rouge, coins coupés compris */
  .gs-header .gs-mobile-language-trigger::before{
    content:"";
    position:absolute;
    inset:0;
    z-index:-1;
    padding:1px;
    background:linear-gradient(135deg,#9aa0aa 0%,#3a3e48 38%,#2a2d36 62%,#d4203a 100%);
    clip-path:inherit;
    -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
    -webkit-mask-composite:xor;
    mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
    mask-composite:exclude;
    transition:filter .25s ease;
    pointer-events:none;
  }

  /* Chevron rouge qui pivote à l'ouverture */
  .gs-header .gs-mobile-language-trigger::after{
    right:4px;
    bottom:5px;
    border-color:#ff4d63;
    transition:transform .25s ease,bottom .25s ease;
  }

  .gs-header .gs-mobile-language-trigger:hover,
  .gs-header .gs-mobile-language-trigger[aria-expanded="true"]{
    border:0;
    background:#232733;
  }

  .gs-header .gs-mobile-language-trigger:hover::before,
  .gs-header .gs-mobile-language-trigger[aria-expanded="true"]::before{
    filter:brightness(1.35) saturate(1.2);
  }

  .gs-header .gs-mobile-language-trigger[aria-expanded="true"]::after{
    bottom:3px;
    transform:rotate(-135deg);
  }

  .gs-header .gs-mobile-language-trigger:focus-visible{
    outline:2px solid #ff6374;
    outline-offset:-4px;
  }

  /* Reflet qui traverse le drapeau toutes les ~6 s */
  .gs-header .gs-mobile-language-current-flag{
    border-color:rgba(255,255,255,.2);
  }

  .gs-header .gs-mobile-language-current-flag::after{
    content:""!important;
    position:absolute;
    inset:0;
    z-index:1;
    background:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.55) 50%,transparent 70%);
    transform:translateX(-130%);
    animation:gsHpFlagShine 6s ease-in-out infinite;
    pointer-events:none;
  }

  .gs-header .gs-mobile-language-code{
    color:#e9e6df;
    letter-spacing:.08em;
  }

  /* ---------- Bouton Collection / Connexion ---------- */
  .gs-header .gs-mobile-auth-btn{
    --gs-cut:10px;
    position:relative;
    isolation:isolate;
    gap:6px;
    min-height:36px;
    padding:0 14px 0 12px;
    border-radius:0;
    background:transparent;
    letter-spacing:.03em;
    transition:transform .2s ease;
  }

  /* Forme et éclat sur des calques : le badge d'alertes n'est jamais rogné */
  .gs-header .gs-mobile-auth-btn::before,
  .gs-header .gs-mobile-auth-btn::after{
    content:"";
    position:absolute;
    inset:0;
    z-index:-1;
    clip-path:polygon(var(--gs-cut) 0,100% 0,100% calc(100% - var(--gs-cut)),calc(100% - var(--gs-cut)) 100%,0 100%,0 var(--gs-cut));
    pointer-events:none;
  }

  .gs-header .gs-mobile-auth-btn::before{
    background:
      linear-gradient(180deg,rgba(255,255,255,.16) 0,rgba(255,255,255,0) 45%),
      linear-gradient(135deg,#e0193a 0%,#c8102e 55%,#9e0c24 100%);
    transition:filter .2s ease;
  }

  /* Icône dessinée dans le calque de fond : aucun changement de gabarit HTML */
  .gs-header .gs-mobile-auth-btn{
    padding-left:33px;
  }

  .gs-header .gs-mobile-auth-btn::before{
    background:
      var(--gs-auth-icon) no-repeat 12px 50% / 15px 15px,
      linear-gradient(180deg,rgba(255,255,255,.16) 0,rgba(255,255,255,0) 45%),
      linear-gradient(135deg,#e0193a 0%,#c8102e 55%,#9e0c24 100%);
  }

  /* Par défaut : icône Collection (membre connecté) */
  .gs-header .gs-mobile-auth-btn{
    --gs-auth-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='12' height='15' rx='1.5'/%3E%3Cpath d='M8 3h11.5A1.5 1.5 0 0 1 21 4.5V17'/%3E%3C/svg%3E");
  }

  /* Lien de connexion (redirect_to, wp-login ou page de connexion) : icône membre */
  .gs-header .gs-mobile-auth-btn:is([href*="redirect_to"],[href*="wp-login"],[href*="connexion"]){
    --gs-auth-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.6-4 4.5-6 8-6s6.4 2 8 6'/%3E%3C/svg%3E");
  }

  .gs-header .gs-mobile-auth-btn::after{
    background:linear-gradient(100deg,transparent 35%,rgba(255,255,255,.38) 50%,transparent 65%) no-repeat;
    background-size:60% 100%;
    background-position:-120% 0;
    animation:gsHpSweep 4.8s ease-in-out infinite;
  }

  .gs-header .gs-mobile-auth-btn:hover{
    filter:none;
    transform:translateY(-1px);
  }

  .gs-header .gs-mobile-auth-btn:hover::before{
    filter:brightness(1.12);
  }

  .gs-header .gs-mobile-auth-btn:active{
    transform:translateY(0) scale(.98);
  }

  .gs-header .gs-mobile-auth-btn:focus-visible{
    outline:2px solid #ff8a00;
    outline-offset:2px;
  }

  .gs-header .gs-mobile-alert-badge{
    z-index:1;
  }

  /* ---------- Menu burger ---------- */
  .gs-header .gs-burger{
    --gs-cut:9px;
    position:relative;
    isolation:isolate;
    align-items:flex-start;
    gap:5px;
    width:38px;
    height:38px;
    padding:0 10px;
    border:0;
    border-radius:0;
    background:transparent;
  }

  .gs-header .gs-burger::before{
    content:"";
    position:absolute;
    inset:0;
    z-index:-1;
    padding:1px;
    background:linear-gradient(135deg,#9aa0aa,#2a2d36 45%,#2a2d36);
    clip-path:polygon(var(--gs-cut) 0,100% 0,100% 100%,0 100%,0 var(--gs-cut));
    -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
    -webkit-mask-composite:xor;
    mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
    mask-composite:exclude;
    pointer-events:none;
  }

  .gs-header .gs-burger span{
    height:2px;
    border-radius:0;
    background:#c9ccd3;
    transition:width .25s ease,transform .25s ease,opacity .2s ease,background-color .25s ease;
  }

  .gs-header .gs-burger span:nth-child(2){
    width:70%;
    background:#d4203a;
  }

  .gs-header .gs-burger span:nth-child(3){
    width:45%;
  }

  .gs-header .gs-burger:hover span,
  .gs-header .gs-burger.open span,
  .gs-header .gs-burger[aria-expanded="true"] span{
    width:100%;
  }

  .gs-header .gs-burger:focus-visible{
    outline:2px solid #ff6374;
    outline-offset:2px;
  }
}

/* Très petits écrans : on garde la place pour le logo */
@media (max-width:400px){
  .gs-header .gs-mobile-auth-btn{
    padding:0 11px 0 10px;
  }

  .gs-header .gs-mobile-auth-btn::before{
    background:
      linear-gradient(180deg,rgba(255,255,255,.16) 0,rgba(255,255,255,0) 45%),
      linear-gradient(135deg,#e0193a 0%,#c8102e 55%,#9e0c24 100%);
  }
}

@keyframes gsHpSweep{
  0%,62%{background-position:-120% 0}
  100%{background-position:220% 0}
}

@keyframes gsHpFlagShine{
  0%,82%{transform:translateX(-130%)}
  100%{transform:translateX(130%)}
}

@media (prefers-reduced-motion:reduce){
  .gs-header .gs-mobile-auth-btn::after,
  .gs-header .gs-mobile-language-current-flag::after{
    animation:none;
    opacity:0;
  }

  .gs-header .gs-mobile-auth-btn,
  .gs-header .gs-mobile-language-trigger,
  .gs-header .gs-mobile-language-trigger::after,
  .gs-header .gs-burger span{
    transition:none;
  }
}
