@media (max-width:431px) {
    .main-content {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        position: relative;
        padding: 10px;
        box-sizing: border-box;
        z-index: 3;
        margin-right: auto;
    }

    .top-header {
        display: none;
    }

    .map-placeholder {
        display: none;
    }

    .left-container {
        width: 100%;
        height: calc(0% + 55px);
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        z-index: 2;
        box-sizing: border-box;
    }

    .sidebar {
        width: 60px;
        height: 100%;
        flex: 1;
        background-color: #ffffff;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin: 0px 0px 0px 0px;
        transition: background-color 0.3s ease-in-out;
    }

    .logo {
        width: 40px;
        padding: 10px 10px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .logo-image {
        width: 30px;
        height: auto;
        object-fit: contain;
    }

    .menu-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 3;
        box-sizing: border-box;
        width: 13%;
        height: 100%;
        padding: 0px 0px;
    }

    .hamburger-menu span {
        width: 25px;
        height: 3px;
        background-color: var(--color-orange);
    }

    .menu-popup.show {
        top: calc(60px);
        left: calc(10px);
    }

    .menu-popup-content {
        padding: 20px 20px;
        height: 100%;
        width: 100%;
        box-sizing: border-box;
        position: relative;
    }

    .menu-popup {
        position: fixed;
        top: 0px;
        height: calc(100dvh - 85px);
        width: calc(100% - 20px);
        background-color: var(--color-orange);
        z-index: 5;
        transition: top 0.3s ease-in-out;
        overflow-y: auto;
        margin: 15px 0px 15px 0px;
    }

    .menu-text {
        display: none;
    }

    .top-container {
        top: 0;
        width: 100%;
        height: calc(0% + 170px)
    }

    .page-text {
        position: absolute;
        top: 95px;
        right: 0px;
        left: 0px;
        bottom: 0px;
        text-align: left;
        margin-right: 0px;
        margin-left: 10px;
    }

    .page-title-small {
        color: var(--color-orange);
        font-size: 1rem;
        font-weight: bold;
        display: inline;
        margin-left: 0.6rem;
        vertical-align: middle;
    }

    .page-subtitle {
        color: var(--color-orange);
        font-size: 20px;
        font-weight: bold;
        margin-left: 10px;
    }

    .page-title {
        color: var(--color-orange);
        font-size: 50px;
        font-weight: bold;
        margin-top: -0.8rem;
        margin-left: 10px;
        /* サブタイトルとの間隔を詰める */
    }

    .middle-container {
        top: calc(0% + 170px);
        height: calc(100dvh - 200px);
        right: 0px;
        width: 100%;
        margin-top: 20px;
    }

    .services-scroll {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: scroll;
        gap: 0.5rem;
        padding: 0px 20px;
        scroll-snap-type: y mandatory;
        height: 100%;
    }

    .service-card {
        position: relative;
        width: 100%;
        box-sizing: border-box;
        height: auto;
        border: 1px solid var(--color-orange);
        border-radius: 10px;
        padding: 15px 20px 20px 20px;
        color: white;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .service-title {
        margin-bottom: 1.6rem;
    }

    .service-title h2 {
        font-size: 2rem;
        color: var(--color-orange);
        margin: 0;
        white-space: nowrap;
    }

    .service-content {
        padding: 0rem 0rem 0rem 0rem;
        height: auto;
        min-height: 200px;
        overflow-y: scroll;
        overflow-x: hidden;
        margin-top: 0.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    .trainer-content {
        display: flex;
        flex-direction: column;
        gap: 0rem;
        margin-top: 0;
        align-items: stretch;
        min-height: 220px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .trainer-image {
        flex: 0 0 auto;
        display: flex;
        align-items: stretch;
        align-self: stretch;
        height: 200px;
    }

    .trainer-photo {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
    }

    .service-content ul {
        list-style: none;
        padding: 0;
        margin: 0;
        flex: 1;
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        row-gap: 20px;
        column-gap: 40px;
    }

    .service-content h3 {
        font-size: 1.5rem;
        margin: 1.5rem 0 0.5rem 0;
        color: var(--color-orange);
    }

    .pronunciation {
        font-size: 1rem;
        color: var(--color-orange);
        margin-left: 0.8rem;
        position: absolute;
        top: 55px;
        left: 9px;
    }

    .pronunciation-right {
        font-size: 1rem;
        color: var(--color-orange);
        position: absolute;
        bottom: 11px;
        right: 20px;
    }

        /* 会社情報のグリッドレイアウト */
    .company-info-grid {
        display: grid;
        grid-auto-flow: column;
        grid-template-rows: repeat(2, 1fr);
        grid-auto-columns: minmax(200px, 300px);
        gap: 0rem;
        width: 100%;
        max-width: 100%;
        margin: 1rem;
        overflow-x: scroll;
        padding: 0;
        height: 100%;
        scrollbar-width: thin;
        -ms-overflow-style: auto;
        -webkit-overflow-scrolling: touch; /* スムーズスクロール for iOS */
    }

    .image-stack {
        position: relative;
        width: 70%;
        height: 70%;
    }

    /* スクロールバーのカスタマイズ */
    .company-info-grid::-webkit-scrollbar {
        height: 8px;
    }

    .company-info-grid::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .company-info-grid::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }

    .company-info-grid::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

    .middle-bottom-container {
        top: 60%;
        height: 7%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        z-index: 0;
    }
    
    .middle-bottom-left {
        color: #D7D5CA;
        font-size: 1.2rem;
        font-weight: bold;
        width: 50%;
        text-align: left;
        cursor: pointer;
    }
    
    .middle-bottom-right {
        color: #D7D5CA;
        font-size: 1.2rem;
        font-weight: bold;
        width: 50%;
        text-align: right;
        padding: 0 2rem;
    }
    
    .middle-bottom-right::after {
        content: "→";
        font-size: 1.4rem;
    }

    .service-content li {
        font-size: 1rem;
        margin-bottom: 0;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        width: 100%;
    }

    .service-content p {
        font-size: 1rem;
        line-height: 1.4;
        margin: 0;
        flex: 1;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        width: 100%;
    }

    .cinema-images {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(4, auto);
        gap: 1rem;
        margin-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .cinema-image {
        width: 100%;
        height: 120px;
        object-fit: contain;
        border-radius: 8px;
    }
    

    .bottom-container {
        position: fixed;
        top: calc(100% - 10px);
        height: calc(0vh + 0px);
        right: 0px;
        width: calc(100% - 20px);
        margin: 0px 10px 0px 10px;
        display: none;
    }

    .bottom-content {
        display: none;
    }

    .bottom-content2 {
        display: none;
    }

    .bottom-content-3 {
        display: none;
    }   


    .member-bar {
        box-sizing: border-box;
        width: calc(100% - 0vh);
        height: calc(100% - 65px);
        background-color: var(--color1);
        border-top-right-radius: 50px;
        border-bottom-right-radius: 0px;
        position: relative;
        z-index: 1000;
        transition: background-color 0.3s ease;
    }

    .member-popup {
        display: none;
        position: fixed;
        bottom: calc(0vh + 65px);
        right: 0%;
        width: calc(100% - 20px);
        height: 55%;
        background-color: #1a1a1a;
        border-top-right-radius: 0px;
        border-bottom-right-radius: 0px;
        box-sizing: border-box;
        z-index: 999;
        margin-bottom: 0px;
        padding: 20px;
        margin: 10px;
        overflow: visible;
    }

    .member-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        justify-items: center;
        width: 95%;
        height: 100%;
        padding: 0;
        z-index: 3;
        gap: 1rem;
        align-items: start;
        overflow-y: auto;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .members-text {
        color: var(--color2);
        font-size: 2rem;
        font-weight: bold;
        text-align: left;
        position: absolute;
        top: 50%;
        left: 2rem;
        transform: translateY(-50%);
        z-index: 1;
        transition: color 0.3s ease;
        cursor: pointer;
    }

    .member-card {
        text-align: left;
        width: 95%;
        z-index: 3;
        min-width: 0;
    }

    .member-close {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
        cursor: pointer;
        transition: opacity 0.3s ease;
        width: auto;
        height: auto;
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .footer-info {
        position: absolute;
        width: calc(100% - 20px);
        bottom: 0;
        background-color: rgba(255, 255, 255, 0.9);
        color: #333;
        padding: 15px 10px;
        margin-bottom: 0px;
        display: none;
        align-items: center;
        gap: 25px;
        font-size: 10px;
        font-weight: 700;
        white-space: nowrap;
    }

    .logo3 {
        margin: 0px 0px 0px 20px;
    }

    .contact-button-footer {
        background-color: #000;
        padding: 5px 20px;
        border-radius: 15px;
        /* 角丸 */
        text-decoration: none;
        font-weight: bold;
        margin-left: 0px;
        /* MEMBERとの間隔 */
    }

    .overlay.show {
        display: none;
    }

    .contact-slideout {
        position: fixed;
        top: 0;
        right: -100%;
        width: calc(100% - 20px);
        height: calc(100dvh - 20px);
        background-color: var(--color-orange);
        z-index: 6;
        transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        margin: 10px;
    }
    
    .contact-slideout.show {
        right:calc(0px);
    }

    .privacy-popup-content {
        padding: 0.5em;
        height: 100%;
        background-color: white;
        box-sizing: border-box;
        position: relative;
        flex: 1;
        border-bottom-right-radius: 10px;
    }

    .privacy-popup.show {
        left: calc(10px);
        height: calc(100dvh - 50px);
        width: calc(100% - 50px);
    }

    .privacy-popup {
        position: fixed;
        top: 0px;
        left: -500px;
        height: calc(100dvh - 60px);
        width: 70%;
        background-color: var(--color1);
        z-index: 1000;
        transition: left 0.5s ease-in-out;
        overflow-y: auto;
        margin: 10px 0px 10px 0px;
        display: flex;
        padding: 15px;
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;
    }

    .rotating-area {
        display: none;
    }

    .service-logo {
        position: absolute;
        top: 35px;
        right: 15px;
        left: auto;
        bottom: auto;
        width: auto;
        height: 280px;
        opacity: 0.4;
        z-index: -1;
        mix-blend-mode: normal;
    }

    .vicinia-content {
        display: flex;
        gap: 1rem;
        align-items: stretch;
        margin-top: 1rem;
    }

    .shop-images {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 1.5rem;
        width: 100%;
        margin-top: 1.5rem;
        padding-bottom: 0rem;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
    }


    .shop-image-container {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .trainer-credentials h4 {
        font-size: 1rem;
        color: white;
        margin: 0;
        white-space: nowrap;
    }
    
    .trainer-credentials h4 span {
        color: white;
        font-weight: normal;
    }

    .menu-items {
        display: flex;
        flex-direction: column;
        margin-bottom: 40px;
        gap: 15px;
    }

    .menu-nav {
        display: flex;
        flex-direction: column;
        padding-bottom: 20px;
    }

    .child {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* iOS向けの滑らかスクロール */
        touch-action: pan-y;
      }
}

@media (max-width:394px) {
    .footer-info {
        position: absolute;
        width: calc(100% - 20px);
        bottom: 0;
        background-color: rgba(255, 255, 255, 0.9);
        color: #333;
        padding: 15px 10px;
        margin-bottom: 0px;
        display: none;
        align-items: center;
        justify-content: center;
        gap: 40px;
        font-size: 10px;
        font-weight: 700;
        white-space: nowrap;
    }

    .logo3 {
        display: none;
        margin: 0px 0px 0px 20px;
    }

    .footer-info b {
        color: #333;
        text-decoration: none;
        font-weight: 700;
        cursor: pointer;
    }

    .service-card {
        position: relative;
        width: 100%;
        height: auto;
        border: 1px solid var(--color-orange);
        border-radius: 10px;
        padding: 15px 15px 15px 15px;
        color: white;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .service-logo {
        position: absolute;
        top: 35px;
        right: 15px;
        left: auto;
        bottom: auto;
        width: auto;
        height: 250px;
        opacity: 0.4;
        z-index: -1;
        mix-blend-mode: normal;
    }

    .service-content {
        height: auto;
        min-height: 200px;
    }

    .service-content p {
        font-size: 0.9rem;
        line-height: 1.4;
        margin: 0;  /* 上部マージンを削除 */
    }

    .page-title-small {
        color: var(--color-orange);
        font-size: 0.8rem;
        font-weight: bold;
        display: inline;
        margin-left: 0.6rem;
        vertical-align: middle;
    }
}

@media (max-width:376px) { 

    .main-content {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        position: relative;
        padding: 7px;
        box-sizing: border-box;
        z-index: 3;
        margin-right: auto;
    }

    .left-container {
        width: 100%;
        height: calc(0% + 45px);
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        z-index: 2;
        box-sizing: border-box;
    }

    .footer-info {
        position: absolute;
        width: calc(100% - 20px);
        bottom: 0;
        background-color: rgba(255, 255, 255, 0.9);
        color: #333;
        padding: 10px 10px;
        margin-bottom: 0px;
        display: none;
        align-items: center;
        justify-content: center;
        gap: 20px;
        font-size: 10px;
        font-weight: 700;
        white-space: nowrap;
    }

    .sidebar {
        width: 60px;
        height: 100%;
        flex: 1;
        background-color: #ffffff;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin: 0px 0px 0px 0px;
        transition: background-color 0.3s ease-in-out;
    }

    .logo {
        width: 40px;
        padding: 10px 3px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .logo-image {
        width: 30px;
        height: auto;
        object-fit: contain;
        margin-top: 7px;
    }

    .bottom-container {
        position: fixed;
        top: calc(100% - 57px);
        height: calc(0vh + 50px);
        right: 7px;
        width: calc(100% - 14px);
        margin: 0px 0px 0px 0px;
        display: none;
    }

    .middle-bottom-container {
        top: 83%;
        height: 7%;
        display: none;
        justify-content: space-between;
        align-items: center;
        z-index: 0;
    }

    .page-text {
        position: absolute;
        top: 69px;
        right: 0px;
        left: 0px;
        bottom: 0px;
        text-align: left;
        margin-right: 0px;
        margin-left: 10px;
    }

    .page-subtitle {
        color: var(--color-orange);
        font-size: 15px;
        font-weight: bold;
        margin-left: 10px;
    }

    .page-title {
        color: var(--color-orange);
        font-size: 35px;
        font-weight: bold;
        margin-top: -0.8rem;
        margin-left: 10px;
        /* サブタイトルとの間隔を詰める */
    }

    .page-title-small {
        color: var(--color-orange);
        font-size: 0.8rem;
        font-weight: bold;
        display: inline;
        margin-left: 0.6rem;
        vertical-align: middle;
    }

    .pronunciation {
        font-size: 0.8rem;
        color: var(--color-orange);
        margin-left: 0.8rem;
        position: absolute;
        top: 55px;
        left: 9px;
    }

    .middle-container {
        top: calc(0% + 120px);
        height: calc(100dvh - 145px);
        overflow-y: scroll;
        display: flex;
        align-items: center;
        overflow-x: hidden;
        right: 0;
        width: 100%;
        padding: 0rem;
        margin-top: 15px;
    }

    .company-popup-body2 {
        display: block;
        top: calc(0% + 120px);
        height: calc(100dvh - 200px);
        padding: 0rem 1rem;
        flex: 1;
        background-color: #1b1b1b;
        border-bottom-right-radius: 10px;
    }

    .company-popup-body2 h2 {
        display: none;
        color: var(--color-orange);
        margin: 0;
        margin-bottom: 1.5rem;
        font-size: 1.5rem;
    }

    .company-info-label {
        width: 120px;
        color: #ffffff;
        font-weight: bold;
        margin-right: 20px;
        font-size: 14px;
    }

    .company-info-value {
        flex: 1;
        color: #ffffff;
        font-size: 14px;
    }

    .company-info-row {
        display: flex;
        margin-bottom: 0.4rem;
        border-bottom: 1px solid #D7D5CA;
        padding: 0.5rem 0.5rem;
    }

    .menu-popup.show {
        top: calc(42px);
        left: calc(7px);
    }

    .menu-popup-content {
        padding: 15px 15px;
        height: 100%;
        width: 100%;
        box-sizing: border-box;
        position: relative;
    }

    .menu-popup {
        position: fixed;
        top: 0px;
        height: calc(100dvh - 67px);
        width: calc(100% - 14px);
        background-color: var(--color-orange);
        z-index: 5;
        transition: top 0.3s ease-in-out;
        overflow-y: auto;
        margin: 15px 0px 15px 0px;
    }

    .menu-popup-content::after {
        content: '';
        position: absolute;
        top: 25px;
        left: 25px;
        height: 1px;
        width: 0;
        background-color: #1b1b1b;
        transform-origin: left center;
        transition: width 0s;
    }

    .menu-popup-copyright {
        position: absolute;
        top: 30px;
        right: 25px;
        font-size: 0.6em;
        color: #1b1b1b;
        opacity: 0.7;
    }

    .menu-item-text {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin: 0px 9px;
    }

    .menu-item-arrow {
        color: #1a1a1a;
        font-size: 1.3em;
        margin-left: 0px;
    }

    .menu-items {
        display: flex;
        flex-direction: column;
        margin-bottom: 40px;
        gap: 10px;
    }

    .menu-item-logo {
        width: 31px;
        height: 31px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }

    .service-content ul {
        list-style: none;
        padding: 0;
        margin: 0;
        flex: 1;
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        row-gap: 5px;
        column-gap: 40px;
    }

    .services-scroll {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: scroll;
        gap: 0.5rem;
        padding: 0px 10px;
        scroll-snap-type: y mandatory;
        height: 100%;
    }

    .service-card {
        position: relative;
        width: 100%;
        height: auto;
        border: 1px solid var(--color-orange);
        border-radius: 10px;
        padding: 13px;
        color: white;
        display: flex;
        flex-direction: column;
        gap: 0px;
    }

    .service-logo {
        position: absolute;
        top: 35px;
        right: 15px;
        left: auto;
        bottom: auto;
        width: auto;
        height: 190px;
        opacity: 0.4;
        z-index: -1;
        mix-blend-mode: normal;
    }

    .service-content h3 {
        font-size: 1.1rem;
        margin: 1rem 0 0.5rem 0;
        color: var(--color-orange);
    }

    .service-content li {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }

    .service-title h2 {
        font-size: 1.8rem;
        color: var(--color-orange);
        margin: 0;
        white-space: nowrap;
    }

    .more-info {
        background-color: var(--color-orange);
        color: white;
        width: 100%;
        border: none;
        padding: 6px 48px;
        border-radius: 50px;
        font-size: 0.7rem;
        cursor: pointer;
        transition: opacity 0.3s ease;
        flex: 1;
        /* 同じ大きさになるよう追加 */
        max-width: 100%;
        /* 最大幅を設定 */
        white-space: nowrap;
        /* テキスト折り返しなし */
        text-align: center;
        /* テキストを中央揃え */
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .official-web {
        background-color: white;
        color: var(--color-orange);
        border: none;
        padding: 6px 48px;
        border-radius: 50px;
        font-size: 0.7rem;
        cursor: pointer;
        transition: opacity 0.3s ease;
        flex: 1;
        /* 同じ大きさになるよう追加 */
        max-width: 100%;
        /* 最大幅を設定 */
        white-space: nowrap;
        /* テキスト折り返しなし */
        text-align: center;
        /* テキストを中央揃え */
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 0.2rem;
    }

    .renewing {
        border: none;
        padding: 8px 48px;
        border-radius: 50px;
        font-size: 0.7rem;
        cursor: pointer;
        transition: opacity 0.3s ease;
        flex: 1;
        /* 同じ大きさになるよう追加 */
        max-width: 100%;
        /* 最大幅を設定 */
        white-space: nowrap;
        /* テキスト折り返しなし */
        text-align: center;
        /* テキストを中央揃え */
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .contact-slideout {
        position: fixed;
        top: 0;
        right: -100%;
        width: calc(100% - 14px);
        height: calc(100dvh - 14px);
        background-color: var(--color-orange);
        z-index: 6;
        transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        margin: 7px;
    }

    .privacy-popup.show {
        left: calc(7px);
        height: calc(100dvh - 44px);
        width: calc(100% - 44px);
    }

    .privacy-popup {
        position: fixed;
        top: -4px;
        left: -500px;
        height: calc(100dvh - 60px);
        width: 70%;
        background-color: var(--color1);
        z-index: 1000;
        transition: left 0.5s ease-in-out;
        overflow-y: auto;
        margin: 10px 0px 10px 0px;
        display: flex;
        padding: 15px;
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;
    }

    .store-image {
        display: none;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .face-image {
        flex: 0 0 100px;
        display: none;
        align-items: center;
    }

    .vicinia-content {
        display: flex;
        gap: 1rem;
        align-items: stretch;
        margin-top: 0rem;
    }
}

.card-arrow-narrow {
    width: 0;
    height: 0;
    border-top: 18px solid transparent;
    border-bottom: 18px solid transparent;
    border-left: 15px solid #fff;
    margin: 0 10px;
    display: inline-block;
    align-self: center;
}

/* モバイルだけ下向きに回転 */
@media (max-width: 768px) {
    .card-arrow-narrow {
        transform: rotate(90deg);
    }
}