/* =========================================================
   MA | HEAVEN — MOBILE RESPONSIVE LOCK V1
   HOME + POINT SHOP responsive hardening only.
   Desktop layout remains owned by ma-ui-core-v1.css / shop-v2.css.
   No JS / API / purchase / game logic.
   ========================================================= */

html,body{
  max-width:100%;
  overflow-x:hidden;
}

body.homeFinalV1,
body.shopV2.gameShellV5.finalUiV1{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

/* Notched iPhone / fold safe area */
@media(max-width:1100px){
  body.homeFinalV1 .siteHeader,
  body.shopV2.gameShellV5.finalUiV1 .siteHeader{
    padding-left:max(14px,env(safe-area-inset-left))!important;
    padding-right:max(14px,env(safe-area-inset-right))!important;
  }

  body.homeFinalV1 .mobileSheet,
  body.shopV2.gameShellV5.finalUiV1 .mobileSheet{
    padding-left:max(18px,env(safe-area-inset-left))!important;
    padding-right:max(18px,env(safe-area-inset-right))!important;
    padding-bottom:max(24px,env(safe-area-inset-bottom))!important;
  }

  body.homeFinalV1 .mobileWallet{
    left:max(10px,env(safe-area-inset-left))!important;
    right:max(10px,env(safe-area-inset-right))!important;
    bottom:max(10px,env(safe-area-inset-bottom))!important;
  }
}

/* Fold unfolded / compact tablet: keep useful two-column product density. */
@media(min-width:761px) and (max-width:1100px){
  body.shopV2 .gameShell{
    display:block!important;
    width:100%!important;
    max-width:none!important;
    padding:14px 18px!important;
  }

  body.shopV2 .userPanel,
  body.shopV2 .livePanel{
    display:none!important;
  }

  body.shopV2 .gameMain{
    width:100%!important;
    max-width:920px!important;
    margin:0 auto!important;
  }

  body.shopV2 .gameHeading{
    min-height:0!important;
    align-items:flex-end!important;
  }

  body.shopV2 .headingTools{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    width:min(390px,46vw)!important;
  }

  body.shopV2 .balanceBox{
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
  }

  body.shopV2 .productGrid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:10px!important;
  }

  body.shopV2 .productBody h3{font-size:12px!important}
  body.shopV2 .buyBtn{min-height:42px!important}
}

/* Smartphone baseline */
@media(max-width:760px){
  body.homeFinalV1,
  body.shopV2.gameShellV5.finalUiV1{
    padding-bottom:calc(86px + env(safe-area-inset-bottom))!important;
  }

  body.homeFinalV1 .siteHeader,
  body.shopV2.gameShellV5.finalUiV1 .siteHeader{
    height:64px!important;
    min-height:64px!important;
    padding-top:env(safe-area-inset-top)!important;
  }

  body.homeFinalV1 .brand span,
  body.shopV2.gameShellV5.finalUiV1 .brand span{
    font-size:20px!important;
    letter-spacing:1.8px!important;
  }

  body.homeFinalV1 .headerTools,
  body.shopV2.gameShellV5.finalUiV1 .headerTools{
    gap:6px!important;
  }

  body.homeFinalV1 .iconBtn,
  body.shopV2.gameShellV5.finalUiV1 .iconBtn,
  body.homeFinalV1 .mobileMenuBtn,
  body.shopV2.gameShellV5.finalUiV1 .mobileMenuBtn{
    width:42px!important;
    min-width:42px!important;
    height:42px!important;
    min-height:42px!important;
  }

  body.homeFinalV1 .accountArea>.avatar,
  body.shopV2.gameShellV5.finalUiV1 .accountArea>.avatar{
    width:34px!important;
    height:34px!important;
    flex-basis:34px!important;
  }

  /* SHOP heading: two equal wallet cards, no horizontal squeeze */
  body.shopV2 .gameHeading{
    padding:8px 2px 6px!important;
    gap:10px!important;
  }

  body.shopV2 .gameHeading h1{
    font-size:28px!important;
    line-height:1.05!important;
  }

  body.shopV2 .gameHeading p{
    max-width:100%!important;
    line-height:1.55!important;
  }

  body.shopV2 .headingTools{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
    width:100%!important;
  }

  body.shopV2 .balanceBox,
  body.shopV2 .shopTicketBox{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:54px!important;
    min-height:54px!important;
    padding:8px 10px!important;
    text-align:left!important;
  }

  body.shopV2 .balanceBox b{
    font-size:14px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  /* Shared HOME + SHOP banner */
  body.homeFinalV1 .sharedBannerHost,
  body.shopV2 .sharedBannerHost{
    width:100%!important;
    min-height:0!important;
    margin:10px 0 16px!important;
    border-radius:12px!important;
  }

  body.homeFinalV1 .sharedBannerViewport,
  body.shopV2 .sharedBannerViewport{
    min-height:0!important;
    aspect-ratio:16/7!important;
  }

  body.homeFinalV1 .sharedBannerSlide img,
  body.shopV2 .sharedBannerSlide img{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    aspect-ratio:auto!important;
    object-fit:cover!important;
  }

  body.homeFinalV1 .sharedBannerCopy,
  body.shopV2 .sharedBannerCopy{
    left:16px!important;
    right:42px!important;
    max-width:none!important;
  }

  body.homeFinalV1 .sharedBannerCopy small,
  body.shopV2 .sharedBannerCopy small{
    font-size:7px!important;
    letter-spacing:2px!important;
    margin-bottom:4px!important;
  }

  body.homeFinalV1 .sharedBannerCopy b,
  body.shopV2 .sharedBannerCopy b{
    font-size:20px!important;
    line-height:1.08!important;
  }

  body.homeFinalV1 .sharedBannerCopy span,
  body.shopV2 .sharedBannerCopy span{
    margin-top:5px!important;
    font-size:9px!important;
    line-height:1.4!important;
    display:-webkit-box!important;
    -webkit-line-clamp:2!important;
    -webkit-box-orient:vertical!important;
    overflow:hidden!important;
  }

  body.homeFinalV1 .sharedBannerDots,
  body.shopV2 .sharedBannerDots{
    bottom:7px!important;
  }

  /* Shop controls / cards */
  body.shopV2 .shopSectionHead{
    align-items:center!important;
    gap:10px!important;
    margin-top:0!important;
  }

  body.shopV2 .shopRefresh{
    min-width:44px!important;
    min-height:44px!important;
    height:44px!important;
    padding:0 12px!important;
  }

  body.shopV2 .productGrid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }

  body.shopV2 .productCard{
    border-radius:12px!important;
  }

  body.shopV2 .productBody{
    padding:10px!important;
  }

  body.shopV2 .productBody h3{
    font-size:12px!important;
    line-height:1.35!important;
  }

  body.shopV2 .productBody p{
    height:32px!important;
    margin-bottom:10px!important;
  }

  body.shopV2 .productPrice strong{
    font-size:13px!important;
  }

  body.shopV2 .qty{
    height:44px!important;
    grid-template-columns:44px 1fr 44px!important;
  }

  body.shopV2 .qty button{
    min-width:44px!important;
    min-height:44px!important;
    font-size:18px!important;
  }

  body.shopV2 .qty input{
    font-size:16px!important; /* prevents iOS input zoom */
  }

  body.shopV2 .buyBtn{
    height:46px!important;
    min-height:46px!important;
    font-size:10px!important;
  }

  body.shopV2 .shopLoginNotice{
    margin:8px 0 14px!important;
    padding:13px!important;
  }

  body.shopV2 .shopLoginNotice a{
    min-height:44px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }

  body.shopV2 .shopToast{
    left:max(10px,env(safe-area-inset-left))!important;
    right:max(10px,env(safe-area-inset-right))!important;
    bottom:calc(82px + env(safe-area-inset-bottom))!important;
    width:auto!important;
    transform:translateY(20px)!important;
    text-align:center!important;
  }

  body.shopV2 .shopToast.show{
    transform:translateY(0)!important;
  }
}

/* Narrow phones / folded fold devices */
@media(max-width:479px){
  body.homeFinalV1 .siteHeader,
  body.shopV2.gameShellV5.finalUiV1 .siteHeader{
    padding-left:max(10px,env(safe-area-inset-left))!important;
    padding-right:max(10px,env(safe-area-inset-right))!important;
  }

  body.homeFinalV1 .brand span,
  body.shopV2.gameShellV5.finalUiV1 .brand span{
    font-size:18px!important;
    letter-spacing:1.4px!important;
  }

  body.homeFinalV1 .brand small,
  body.shopV2.gameShellV5.finalUiV1 .brand small{
    letter-spacing:2px!important;
  }

  body.homeFinalV1 .accountArea>.avatar,
  body.shopV2.gameShellV5.finalUiV1 .accountArea>.avatar{
    display:none!important;
  }

  body.shopV2 .gameHeading h1{
    font-size:25px!important;
  }

  body.shopV2 .productGrid{
    grid-template-columns:1fr!important;
    gap:10px!important;
  }

  body.shopV2 .productImage{
    aspect-ratio:16/10!important;
  }

  body.shopV2 .productBody{
    padding:12px!important;
  }

  body.shopV2 .productBody h3{
    font-size:14px!important;
  }

  body.shopV2 .productBody p{
    height:auto!important;
    min-height:30px!important;
    font-size:9px!important;
  }

  body.shopV2 .productPrice strong{
    font-size:15px!important;
  }

  body.homeFinalV1 .sharedBannerViewport,
  body.shopV2 .sharedBannerViewport{
    aspect-ratio:16/8.4!important;
  }

  body.homeFinalV1 .sharedBannerCopy,
  body.shopV2 .sharedBannerCopy{
    left:14px!important;
    right:30px!important;
  }

  body.homeFinalV1 .sharedBannerCopy b,
  body.shopV2 .sharedBannerCopy b{
    font-size:18px!important;
  }

  body.homeFinalV1 .sharedBannerCopy span,
  body.shopV2 .sharedBannerCopy span{
    font-size:8px!important;
  }

  body.homeFinalV1 .mobileWallet{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) 66px!important;
    gap:6px!important;
    padding:8px!important;
  }

  body.homeFinalV1 .mobileWallet a{
    min-width:66px!important;
    padding:0 8px!important;
  }
}

/* Very narrow 320–359 CSS px devices */
@media(max-width:359px){
  body.homeFinalV1 .brand span,
  body.shopV2.gameShellV5.finalUiV1 .brand span{
    font-size:16px!important;
  }

  body.homeFinalV1 .iconBtn,
  body.shopV2.gameShellV5.finalUiV1 .iconBtn,
  body.homeFinalV1 .mobileMenuBtn,
  body.shopV2.gameShellV5.finalUiV1 .mobileMenuBtn{
    width:40px!important;
    min-width:40px!important;
    height:40px!important;
  }

  body.shopV2 .headingTools{
    gap:6px!important;
  }

  body.shopV2 .balanceBox,
  body.shopV2 .shopTicketBox{
    padding:7px 8px!important;
  }

  body.shopV2 .balanceBox b{
    font-size:12px!important;
  }

  body.homeFinalV1 .sharedBannerCopy span,
  body.shopV2 .sharedBannerCopy span{
    display:none!important;
  }

  body.shopV2 .shopSectionHead h2{
    font-size:19px!important;
  }
}

/* Landscape phones: reduce vertical occupation while retaining tap targets. */
@media(max-height:520px) and (orientation:landscape) and (max-width:950px){
  body.homeFinalV1 .siteHeader,
  body.shopV2.gameShellV5.finalUiV1 .siteHeader{
    height:56px!important;
    min-height:56px!important;
  }

  body.homeFinalV1 .sharedBannerViewport,
  body.shopV2 .sharedBannerViewport{
    aspect-ratio:4/1!important;
  }

  body.homeFinalV1 .sharedBannerCopy b,
  body.shopV2 .sharedBannerCopy b{
    font-size:17px!important;
  }

  body.homeFinalV1 .sharedBannerCopy span,
  body.shopV2 .sharedBannerCopy span{
    display:none!important;
  }
}

/* Touch devices should not depend on hover transforms. */
@media(hover:none){
  body.shopV2 .productCard:hover{
    transform:none!important;
    box-shadow:none!important;
  }
}
