.mobile-drawer-toggle,
.mobile-drawer {
  display: none;
}

@media screen and (max-width: 768px) {

  #wprmenu_bar,
  #mg-wprm-wrap,
  .wprmenu_bar {
    display: none !important;
    visibility: hidden !important;
  }

  .site-header .top-header {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    padding: 8px 54px;
  }

  .site-header .top-header>div[style*="position: relative"] {
    position: absolute !important;
    top: 50%;
    right: 12px;
    width: 42px;
    height: 42px;
    margin: 0;
    transform: translateY(-50%);
  }

  .site-header .site-logo {
    display: flex;
    justify-content: center;
  }

  .site-header .site-logo .custom-logo {
    width: min(210px, 54vw);
    max-width: min(210px, 54vw);
    max-height: none;
    height: auto;
  }

  .site-header.has-logo:not(.has-title-and-tagline).has-menu .site-logo img.custom-logo {
    max-width: min(210px, 54vw);
    max-height: none;
  }

  .site-header .site-branding,
  .site-header .search-form {
    margin: 0;
  }

  .site-header #real-time-search-form {
    display: block;
    width: 42px;
    height: 42px;
  }

  .site-header #real-time-search-input:not(.sp) {
    display: none !important;
  }

  .site-header #real-time-search-input.sp {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 10002;
    display: block !important;
    width: calc(100vw - 24px);
    min-width: 0;
    max-width: none;
    padding: 12px 44px 12px 14px;
    margin: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 26px rgba(8, 26, 58, .2);
  }

  .site-header #real-time-search-input.sp.inputting {
    border-radius: 12px 12px 0 0;
  }

  .site-header #search_icon {
    position: static !important;
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: var(--global--color-main);
    box-shadow: 0 8px 18px rgba(8, 26, 58, .14);
  }

  .site-header #close_icon {
    position: absolute;
    top: calc(100% + 15px);
    right: 4px;
    z-index: 10003;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #09234e;
  }

  .site-header #close_icon .fas {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .site-header #search-results {
    top: calc(100% + 61px);
    right: 0;
    z-index: 10002;
    width: calc(100vw - 24px);
    max-width: none;
    border-radius: 0 0 12px 12px;
    margin: 0;
  }

  .mobile-drawer-toggle {
    position: absolute;
    top: 50%;
    left: 12px;
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--global--color-main);
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    box-shadow: 0 8px 18px rgba(8, 26, 58, .18);
  }

  .mobile-drawer-toggle__line,
  .mobile-drawer-toggle__line::before,
  .mobile-drawer-toggle__line::after {
    content: "";
    display: block;
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-drawer-toggle__line {
    position: relative;
  }

  .mobile-drawer-toggle__line::before,
  .mobile-drawer-toggle__line::after {
    position: absolute;
    left: 0;
  }

  .mobile-drawer-toggle__line::before {
    top: -7px;
  }

  .mobile-drawer-toggle__line::after {
    top: 7px;
  }

  .mobile-drawer-toggle__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .mobile-drawer {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: block;
    pointer-events: none;
  }

  .mobile-drawer__backdrop {
    position: absolute;
    z-index: 0;
    inset: 0;
    background: rgba(3, 13, 31, .42);
    opacity: 0;
    transition: opacity .25s ease;
  }

  .mobile-drawer__panel {
    position: absolute;
    z-index: 1;
    inset: 0 auto 0 0;
    display: flex;
    width: min(100vw, 430px);
    height: 100dvh;
    flex-direction: column;
    overflow-y: auto;
    background: #fff url("../images/menu-background.webp") center top / cover no-repeat;
    color: var(--global--color-main);
    isolation: isolate;
    transform: translateX(-100%);
    transition: transform .32s cubic-bezier(.22, 1, .36, 1);
    box-shadow: 18px 0 40px rgba(7, 21, 48, .22);
  }

  .mobile-drawer__panel::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 82px;
    right: 20px;
    width: clamp(168px, 50vw, 208px);
    aspect-ratio: 778 / 843;
    background: url("../images/character/p_search.webp") center / contain no-repeat;
    pointer-events: none;
  }

  .mobile-drawer__header,
  .mobile-drawer__lead,
  .mobile-drawer__nav,
  .mobile-drawer__utility,
  .mobile-drawer__footer {
    position: relative;
    z-index: 1;
  }

  .mobile-drawer.is-open {
    pointer-events: auto;
  }

  .mobile-drawer.is-open .mobile-drawer__backdrop {
    opacity: 1;
  }

  .mobile-drawer.is-open .mobile-drawer__panel {
    transform: translateX(0);
  }

  body.mobile-drawer-is-open {
    overflow: hidden;
    touch-action: none;
  }

  body.mobile-drawer-is-open .mobile-bottom-nav {
    display: none;
  }

  .mobile-drawer__header {
    display: flex;
    min-height: 60px;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    background: linear-gradient(135deg, #071a3d 0%, #0c2b5e 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(6, 22, 50, .18);
  }

  .mobile-drawer__close {
    position: relative;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
  }

  .mobile-drawer__close::before,
  .mobile-drawer__close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 3px;
    width: 28px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-drawer__close::before {
    transform: rotate(45deg);
  }

  .mobile-drawer__close::after {
    transform: rotate(-45deg);
  }

  .mobile-drawer__title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: .04em;
  }

  .mobile-drawer__lead {
    position: absolute;
    top: 130px;
    left: 18px;
    z-index: 1;
    display: block;
    pointer-events: none;
  }

  .mobile-drawer__bubble {
    position: relative;
    display: grid;
    width: 142px;
    min-height: 64px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 11px 16px;
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 999px;
    background: #fff;
    color: #09234e;
    font-size: .84rem;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    box-shadow:
      0 10px 24px rgba(12, 31, 65, .12),
      inset 0 -2px 0 rgba(9, 35, 78, .05);
    isolation: isolate;
  }

  .mobile-drawer__bubble::before {
    content: "";
    position: absolute;
    right: -5px;
    top: 50%;
    z-index: -1;
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, .9);
    border-color: rgba(255, 255, 255, .9) rgba(255, 255, 255, .9) transparent transparent;
    background: #fff;
    box-shadow: 5px -5px 12px rgba(12, 31, 65, .07);
    rotate: 45deg;
    translate: 0 -50%;
  }

  .mobile-drawer__bubble::after {
    content: "";
    position: absolute;
    top: 13px;
    right: 17px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #78dff2;
    box-shadow:
      -28px 15px 0 -2px #ffd369,
      13px 18px 0 -3px #ff8db3;
  }

  .mobile-drawer__character {
    display: none;
  }

  .mobile-drawer__nav {
    display: grid;
    gap: 11px;
    padding: clamp(190px, 52vw, 230px) 20px 20px;
  }

  .mobile-drawer__link,
  .mobile-drawer__utility-link {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 14px;
    align-items: center;
    min-height: 56px;
    padding: 0 16px;
    border: 1px solid rgba(11, 39, 84, .08);
    border-radius: 14px;
    background: rgba(255, 255, 255, .92);
    color: #09234e;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(15, 38, 78, .07);
  }

  .mobile-drawer__link--orange,
  .mobile-drawer__link--blue,
  .mobile-drawer__link--green,
  .mobile-drawer__link--purple,
  .mobile-drawer__link--gold {
    grid-template-columns: 48px minmax(0, 1fr) 16px;
    min-height: 78px;
    padding: 0 20px;
    border: 2px solid rgba(255, 255, 255, .48);
    border-radius: 26px;
    color: #fff;
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, .26),
      0 12px 22px rgba(14, 36, 76, .18);
  }

  .mobile-drawer__link--orange {
    background: linear-gradient(180deg, #ff9839 0%, #ff6a1f 54%, #f45219 100%);
  }

  .mobile-drawer__link--blue {
    background: linear-gradient(180deg, #22a9ff 0%, #0788e8 55%, #0072d1 100%);
  }

  .mobile-drawer__link--green {
    background: linear-gradient(180deg, #24d695 0%, #13bd7b 55%, #08a765 100%);
  }

  .mobile-drawer__link--purple {
    background: linear-gradient(180deg, #9a7cff 0%, #7658f0 55%, #5d43d8 100%);
  }

  .mobile-drawer__link--gold {
    background: linear-gradient(180deg, #ffc94b 0%, #ffad18 55%, #f38f00 100%);
  }

  .mobile-drawer__link::after,
  .mobile-drawer__utility-link::after {
    content: "";
    width: 10px;
    height: 10px;
    border-top: 2px solid #7c8797;
    border-right: 2px solid #7c8797;
    transform: rotate(45deg);
  }

  .mobile-drawer__link--orange::after,
  .mobile-drawer__link--blue::after,
  .mobile-drawer__link--green::after,
  .mobile-drawer__link--purple::after,
  .mobile-drawer__link--gold::after {
    width: 12px;
    height: 12px;
    border-color: currentColor;
    border-width: 4px;
  }

  .mobile-drawer__link i,
  .mobile-drawer__utility-link i {
    color: #092c68;
    font-size: 1.35rem;
    text-align: center;
  }

  .mobile-drawer__link--orange i,
  .mobile-drawer__link--blue i,
  .mobile-drawer__link--green i,
  .mobile-drawer__link--purple i,
  .mobile-drawer__link--gold i {
    color: currentColor;
    font-size: 2rem;
  }

  .mobile-drawer__link span {
    min-width: 0;
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.35;
  }

  .mobile-drawer__link strong,
  .mobile-drawer__link small {
    display: block;
    min-width: 0;
  }

  .mobile-drawer__link--orange span,
  .mobile-drawer__link--blue span,
  .mobile-drawer__link--green span,
  .mobile-drawer__link--purple span,
  .mobile-drawer__link--gold span {
    line-height: 1.25;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .16);
    padding-left: 20px;
  }

  .mobile-drawer__link--orange strong,
  .mobile-drawer__link--blue strong,
  .mobile-drawer__link--green strong,
  .mobile-drawer__link--purple strong,
  .mobile-drawer__link--gold strong {
    font-size: 1.1rem;
    line-height: 1.2;
    text-align: left;
  }

  .mobile-drawer__link--orange small,
  .mobile-drawer__link--blue small,
  .mobile-drawer__link--green small,
  .mobile-drawer__link--purple small,
  .mobile-drawer__link--gold small {
    margin-top: 3px;
    color: rgba(255, 255, 255, .92);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
  }

  .mobile-drawer__section-title {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin: 8px 0 0;
    color: #09234e;
    font-size: .92rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
  }

  .mobile-drawer__section-title::before,
  .mobile-drawer__section-title::after {
    content: "";
    height: 1px;
    background: rgba(9, 35, 78, .24);
  }

  .mobile-drawer__utility {
    display: grid;
    gap: 10px;
    margin-top: auto;
    padding: 4px 20px 20px;
  }

  .mobile-drawer__utility-link {
    min-height: 72px;
    border-color: rgba(9, 35, 78, .18);
    box-shadow: none;
  }

  .mobile-drawer__utility-link strong,
  .mobile-drawer__utility-link small {
    display: block;
    min-width: 0;
    line-height: 1.35;
  }

  .mobile-drawer__utility-link strong {
    font-size: .98rem;
  }

  .mobile-drawer__utility-link small {
    margin-top: 2px;
    color: #6a7280;
    font-size: .78rem;
    font-weight: 600;
  }

  .mobile-drawer__footer {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 20px 20px calc(22px + env(safe-area-inset-bottom));
    background: linear-gradient(135deg, #071a3d 0%, #0c2b5e 100%);
    color: #fff;
    text-align: center;
  }

  .mobile-drawer__footer img {
    width: 174px;
    max-width: 62vw;
    height: auto;
  }

  .mobile-drawer__footer p {
    margin: 0;
    color: #fff;
    font-size: .78rem;
    line-height: 1.6;
  }

  .mobile-drawer__link:focus-visible,
  .mobile-drawer__utility-link:focus-visible,
  .mobile-drawer__close:focus-visible,
  .mobile-drawer-toggle:focus-visible {
    outline: 3px solid #0870F8;
    outline-offset: 3px;
  }
}
