/* レスポンシブ対応 */

/* タブレット対応 */
@media screen and (max-width: 1024px) {
    .department-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .intro-title {
        font-size: 1.5rem;
    }
    
    .intro-subtitle {
        font-size: 1.3rem;
    }
    
    .department-title {
        font-size: 2rem;
    }
}

/* スマートフォン対応 */
@media screen and (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 15px;
    }
    
    .audio-settings-content {
        max-width: 90%;
    }
    
    .audio-settings-title {
        /* font-size: 1.2rem; */
    }
    
    .audio-settings-note {
        /* font-size: 0.75rem; */
        margin-bottom: 30px;
    }
    
    .audio-toggle-buttons {
        gap: 40px;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .audio-toggle-button {
        width: 120px;
        height: 120px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .button-icon {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .button-label {
        font-size: 1rem;
    }
    
    /* スマートフォン用の雲の調整 */
    .cloud-1 { width: 180px; height: 80px; top: 5%; left: -30px; }
    .cloud-2 { width: 220px; height: 100px; bottom: 8%; right: -40px; }
    
    .intro-title {
        margin-bottom: 30px;
    }

    .intro-character-container {
        width: 220px;
        height: 220px;
    }
    
    .intro-container {
        padding-top: 0px;
    }

    .welcome-message-container {
        width: 90%;
    }

    .peek-inside-button {
        width: 220px;
        height: 65px;
        margin-top: -125px;
    }

    .bottom-dialogue-box {
        padding: 35px 25px 25px;
        margin-bottom: 30px;
    }

    .dialogue-box-content {
        font-size: 0.95rem;
        min-height: 50px;
    }

    .next-indicator {
        width: 24px;
        height: 24px;
    }

    .menu-title-box {
        padding: 10px 25px;
    }

    .menu-title-box h2 {
        /* font-size: 1.2rem; */
    }

    .stall-cards-container {
        gap: 10px;
    }

    .stall-card {
        border-width: 0;
    }

    .menu-footer-note p {
        /* font-size: 0.8rem; */
    }
    
    .menu-title {
        font-size: 1.5rem;
    }
    
    .department-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .department-card {
        padding: 20px;
    }
    
    .department-title {
        font-size: 1.5rem;
    }
    
    .department-description {
        font-size: 1rem;
    }
    
    
    .selection-content,
    .staff-content,
    .connect-content {
        padding: 20px;
    }
    
    .global-menu-item-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .global-menu-item-buttons {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
    }
    
    .global-menu-button {
        width: 100%;
    }

    /* 全体メニューのレスポンシブ */
    .back-to-menu-button {
        font-size: 0.85rem;
    }
    .back-to-menu-button img {
        height: 50px;
    }

    .back-button-text {
        font-size: 0.8rem;
    }

    .back-icon {
        width: 20px;
        height: 20px;
    }

    .close-menu-button {
        width: 35px;
        height: 35px;
    }



    .footer-button {
        font-size: 1rem;
        padding: 12px 25px;
    }


    .dialogue-box{
        width: 90%;
    }
}

/* 小さなスマートフォン対応 */
@media screen and (max-width: 480px) {
    html {
        font-size: 12px;
    }
    
    .audio-settings-content {
        max-width: 95%;
        padding: 0 10px;
    }
    
    .audio-settings-title {
        /* font-size: 1rem; */
        margin-bottom: 8px;
    }
    
    .audio-settings-note {
        /* font-size: 0.7rem; */
        margin-bottom: 25px;
    }
    
    .audio-toggle-buttons {
        gap: 30px;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .audio-toggle-button {
        width: 80px;
        height: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .button-icon {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 0;
    }
    
    .button-label {
        font-size: 0.8rem;
    }
    
    /* 小さなスマートフォン用の雲の調整 */
    .cloud-1 { width: 150px; height: 60px; top: 5%; left: -40px; }
    .cloud-2 { width: 180px; height: 80px; bottom: 5%; right: -50px; }
    
    .intro-title {
        margin-bottom: 20px;
    }

    /* .intro-character-container {
        width: 180px;
        height: 180px;
    } */
    
    .intro-container {
        padding-top: 0px;
    }

    .welcome-message-container {
        width: 100%;
    }

    .peek-inside-button {
        width: 45%;
        height: 58px;
        margin: -30% auto 0;
    }

    .bottom-dialogue-box {
        padding: 30px 20px 20px;
        margin-bottom: 20px;
    }

    .bottom-dialogue-box::before {
        height: 32px;
        width: 85px;
        font-size: 0.8rem;
    }

    .dialogue-box-content {
        font-size: 0.85rem;
        min-height: 40px;
    }

    .next-indicator {
        width: 20px;
        height: 20px;
    }

    .menu-title-box h2 {
        /* font-size: 1rem; */
    }

    .menu-footer-note p {
        /* font-size: 0.75rem; */
    }
    
    .menu-title,
    .global-menu-title {
        font-size: 1.2rem;
    }
    
    .department-title {
        font-size: 1.3rem;
    }
    
    .department-card-title,
    .global-menu-item-title {
        font-size: 1.2rem;
    }
    
    .connect-title {
        font-size: 1.4rem;
    }
    
    .nav-button,
    .start-button,
    .department-card-button,
    .global-menu-button,
    .connect-button {
        font-size: 0.9rem;
    }

    /* 全体メニューの小型スマホ対応 */
    .back-to-menu-button {
        font-size: 0.75rem;
        border-radius: 20px;
    }
    .back-to-menu-button img {
        height: 45px;
    }

    .back-button-text {
        font-size: 0.7rem;
    }

    .back-icon {
        width: 18px;
        height: 18px;
    }

    .close-menu-button {
        width: 30px;
        height: 30px;
    }

    .global-menu-header {
        padding: 15px;
    }

    .global-menu-container {
        padding: 70px 15px 30px;
    }

    .global-menu-title-banner {
        padding: 15px 20px;
    }

    .global-menu-title-banner h1 {
        font-size: 1.1rem;
    }

    .global-menu-title-banner {
        max-width: 440px;
        padding: 10px 18px;
        border-radius: 16px;
        margin: 14px auto 6px;
    }

    .global-menu-item {
        grid-template-columns: 60px 1fr;
        column-gap: 10px;
        row-gap: 6px;
        padding: 12px 15px;
    }

    .menu-item-icon {
        width: 55px;
        height: 55px;
    }

    .menu-item-title {
        font-size: 0.95rem;
        min-width: 70px;
    }

    .menu-item-buttons {
        place-content: space-evenly;
        flex-wrap: wrap;
    }

    .menu-item-button img {
        width: 95px;
    }

    .global-menu-footer {
        padding: 0 18px 0px;
        margin: 0 auto 0;
        gap: 12px;
        width: 90%;
    }

    .footer-button {
        font-size: 0.9rem;
        padding: 12px 20px;
    }


    .global-menu-divider {
        margin: 0 18px;
    }

    .intro-image-container {
        width: 100%;
    }
    .selection-container{
        width: 98%;
    }
    .selection-btn.image-btn img {
        width: 100%;
        height: auto;
    }

    .ipponjime-button {
        width: 45%;
        margin: -30% auto 0;
    }

    #smartphone-animation-info{
        bottom: 15%;
        right: -8%;
    }
    .stall-card-smartphone-icon{
        right: -19%;
        bottom: 26%;
    }
}

/* タッチ操作の最適化 */
@media (hover: none) and (pointer: coarse) {
    .department-card,
    .selection-option,
    .nav-button,
    .start-button,
    .department-card-button,
    .global-menu-button,
    .connect-button {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    .department-card:active {
        transform: scale(0.98);
    }
}

/* 横画面対応 */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .audio-settings-content {
        max-width: 600px;
    }
    
    .audio-settings-title {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }
    
    .audio-settings-note {
        font-size: 0.75rem;
        margin-bottom: 20px;
    }
    
    .audio-toggle-buttons {
        gap: 20px;
    }
    
    .audio-toggle-button {
        width: 110px;
        height: 110px;
    }
    
    .cloud-1,
    .cloud-2 {
        width: 70px;
        height: 70px;
    }
    
    .intro-content,
    .menu-content {
        padding: 20px;
    }


    .global-menu-container {
        padding: 70px 20px 20px;
    }

    .global-menu-item {
        padding: 12px 15px;
    }

    .menu-item-icon {
        width: 55px;
        height: 55px;
    }

    .menu-item-title {
        font-size: 0.95rem;
    }

    .menu-item-button img {
        width: 90px;
    }

    .global-menu-footer {
        padding: 15px;
    }
    
}