/* Shared H5 chrome for offline mirror pages. PC styles untouched (only max-width:767px). */

.site_sp_menu_button,
.site_sp_drawer,
.site_sp_drawer_overlay {
  display: none;
}

@media (max-width: 767px) {
  :root {
    --drawer-width: 270px;
  }

  html,
  body {
    width: 100%;
    min-width: 0 !important;
    overflow-x: hidden;
  }

  body,
  body * {
    box-sizing: border-box;
  }

  /* Fluid classic .box (1080 / 950) */
  .box {
    width: 100% !important;
    max-width: 100%;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  /* —— Classic header (stories / challenge / legacy) —— */
  .global_header .box,
  .global_header .box.flex {
    align-items: center;
    height: 60px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    gap: 8px;
  }

  .global_header .logo,
  .global_header .pet_logo_symbol {
    width: 140px;
    flex: 0 0 auto;
  }

  .global_header .infos {
    display: none !important;
  }

  .global_header .account_menus {
    margin-left: auto;
    max-width: none;
  }

  .global_header .account_menus .account_menu:nth-child(2) {
    display: none;
  }

  .global_header .btn {
    font-size: 11px;
    height: 25px;
    line-height: 25px;
    padding: 0 8px;
  }

  .global_menus {
    display: none !important;
  }

  /* —— Tailwind / home-style header (shelter) —— */
  body.index_page {
    min-width: 0 !important;
  }

  body.index_page .ref_header_inner {
    box-sizing: border-box;
    width: 100%;
    height: 60px;
    padding-left: 15px;
  }

  body.index_page .ref_header_inner > div {
    display: none;
  }

  body.index_page .ref_header_inner > ul li:nth-child(2) {
    display: none;
  }

  body.index_page .global_pc_menu {
    display: none;
  }

  body.index_page .ref_main_contents {
    width: 100%;
    min-width: 0;
  }

  body.index_page .md\:min-w-\[1080px\],
  body.md\:min-w-\[1080px\] {
    min-width: 0 !important;
  }

  /* —— Hamburger —— */
  .site_sp_menu_button {
    position: relative;
    display: flex;
    flex: 0 0 44px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 60px;
    margin-left: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .site_sp_menu_button span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 1px;
    background: #333;
  }

  .site_sp_drawer,
  .site_sp_drawer_overlay {
    display: block;
  }

  .site_sp_drawer_overlay {
    position: fixed;
    z-index: 2000;
    inset: 0;
    background: rgb(0 0 0 / 10%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
  }

  .site_sp_drawer {
    position: fixed;
    z-index: 2001;
    top: 0;
    right: 0;
    width: min(var(--drawer-width), calc(100vw - 56px));
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    box-shadow: -3px 0 12px rgb(0 0 0 / 18%);
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.25, .1, .25, 1);
  }

  .site_sp_drawer__top {
    padding: 9px 10px 10px;
    border-bottom: 1px solid #ddd;
  }

  .site_sp_drawer__support {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 36px;
    border: 1px solid #eb4847;
    border-radius: 5px;
    color: #eb4847;
    font-size: 12px;
    text-decoration: none;
  }

  .site_sp_drawer__account {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-top: 5px;
  }

  .site_sp_drawer__account a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    border: 1px solid #333;
    border-radius: 5px;
    color: #333;
    font-size: 12px;
    text-decoration: none;
  }

  .site_sp_drawer__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    padding: 0 5px;
    font-size: 14px;
    font-weight: 700;
  }

  .site_sp_drawer__home {
    padding: 5px 8px;
    border: 1px solid #ddd;
    color: #999;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
  }

  .site_sp_drawer__primary,
  .site_sp_drawer__secondary {
    margin: 0;
    padding: 0 10px;
    list-style: none;
  }

  .site_sp_drawer__primary li,
  .site_sp_drawer__secondary li {
    border-bottom: 1px solid #eee;
  }

  .site_sp_drawer__primary a,
  .site_sp_drawer__secondary a {
    display: flex;
    align-items: center;
    min-height: 51px;
    padding: 0 5px;
    color: #333;
    font-size: 15px;
    text-decoration: none;
  }

  .site_sp_drawer__primary a::after,
  .site_sp_drawer__secondary a::before {
    margin-left: auto;
    color: #999;
    content: '›';
    font-size: 20px;
    line-height: 1;
  }

  .site_sp_drawer__secondary {
    padding-top: 8px;
    padding-bottom: 5px;
  }

  .site_sp_drawer__secondary a {
    min-height: 34px;
    font-size: 13px;
  }

  .site_sp_drawer__secondary a::before {
    order: -1;
    margin-right: 5px;
    margin-left: 0;
    font-size: 16px;
  }

  .site_sp_drawer__recruit {
    margin: 9px 10px 20px;
    border: 1px solid #ddd;
    text-align: center;
  }

  .site_sp_drawer__recruit a {
    display: block;
    padding: 12px 5px;
    color: #333;
    font-size: 13px;
    text-decoration: none;
  }

  .site_sp_drawer__share {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-top: 1px solid #ddd;
  }

  .site_sp_drawer__share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 66px;
    height: 21px;
    border-radius: 4px;
    color: #fff;
    font-size: 10px;
    text-decoration: none;
  }

  .site_sp_drawer__share a:first-child { background: #111; }
  .site_sp_drawer__share a:last-child { background: #2275d7; }

  body.site_sp_drawer_open {
    overflow: hidden;
  }

  body.site_sp_drawer_open .site_sp_drawer_overlay {
    opacity: 1;
    pointer-events: auto;
  }

  body.site_sp_drawer_open .site_sp_drawer {
    transform: translateX(0);
  }

  body.site_sp_drawer_open > .global_header,
  body.site_sp_drawer_open > .main_contents,
  body.site_sp_drawer_open > .global_conversions,
  body.site_sp_drawer_open > .global_sponsors,
  body.site_sp_drawer_open > .global_footer,
  body.site_sp_drawer_open > .ref_global_header,
  body.site_sp_drawer_open > .ref_main_contents,
  body.site_sp_drawer_open > .ref_global_footer,
  body.site_sp_drawer_open > .page_content_wrap,
  body.site_sp_drawer_open > #wrapper,
  body.site_sp_drawer_open > #page_top,
  body.site_sp_drawer_open > div[style*="background-color: #eb4847"],
  body.site_sp_drawer_open > div[style*="background-color: rgb(235, 72, 71)"] {
    transform: translateX(calc(-1 * var(--drawer-width, 270px)));
    transition: transform .3s cubic-bezier(.25, .1, .25, 1);
  }

  body.index_page.site_sp_drawer_open .slide_wrap {
    transform: translateX(calc(-1 * var(--drawer-width, 270px)));
  }

  /* Shared footer / conversions */
  .global_conversions .box.flex,
  .global_conversions .box {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .global_conversions .infos {
    width: 100% !important;
  }

  .global_conversions .page_top {
    right: 15px;
  }

  .offline_subscription_banner,
  .offline_footer_rectangle,
  .offline_ad_slot,
  .global_conversions .offline_subscription_banner,
  .global_conversions .offline_footer_rectangle {
    flex: none !important;
    width: 100% !important;
    max-width: 300px;
    height: auto !important;
    margin: 0 auto;
  }

  .offline_subscription_banner img,
  .offline_footer_rectangle img,
  .offline_ad_slot img {
    width: 100%;
    height: auto;
  }

  .common_sponsors_footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    width: 100% !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .common_sponsors_footer .title {
    border-right: 0;
    padding: 0;
  }

  .common_sponsors_300 {
    width: 100% !important;
  }

  .global_footer .box.grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 30px;
    padding-bottom: 20px;
  }

  .global_footer .footer_menus.l,
  .global_footer .footer_menus.r {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
  }

  .global_footer .footer_bottom .box.flex {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
  }

  .fixed_sponsor_results {
    display: none !important;
  }

  .breadcrumbs {
    padding: 10px 0;
  }

  .breadcrumb {
    font-size: 11px;
    flex-wrap: wrap;
  }

  .pc_none {
    display: inline;
  }

  .global_header img,
  .global_footer img,
  .common_sponsors_300 img,
  .common_sponsors_footer img {
    margin: 0;
  }
}
