#game-frame {
    margin-bottom: 48px;
}

#game-wrapper {
    width: 85%;
    margin: 0 auto;
    position: relative;
    border: 6px solid #141414;
}

/* ============================================================
   部屋表示
============================================================ */

.room {
    display: none;
    flex-direction: column;
}

.room.active {
    display: block;
}

.room-bg {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 6;
    overflow: hidden;
    background: #0d0820;
}

.room-bg img {
    width: 100%;
    height: auto;
    display: block;
}


/* ============================================================
   メッセージボックス
============================================================ */

#dialogue-box {
    background: rgba(15, 15, 35, 0.9);
    padding: 5px 20px;
    font-size: 12px;
    color: #e0e8ff;
    line-height: 1.7;
    height: 100px;
}

#dialogue-name {
    font-family: 'DotGothic16', sans-serif;
    font-size: 10px;
    color: #F5C800;
    margin: 0 0 4px 0;
    border-bottom: 1px solid #555;
}

#dialogue-text {
    white-space: pre-line;
}


/* ============================================================
   メッセージ送りアニメ
============================================================ */

#nursery-tap-hint {
    display: none;
    position: absolute;
    bottom: 8%;
    right: 8%;
    font-size: 40px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1000;
    animation: tapBounce 1.4s ease-in-out infinite;
}

#nursery-tap-hint.visible {
    display: block;
    opacity: 1;
}

@keyframes tapBounce {

    0%,
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }

    40%,
    60% {
        transform: scale(0.75) translateY(4px);
        opacity: 0.8;
    }
}


/* ============================================================
   ホットスポット（共通基底）
   位置・サイズは各部屋のCSSで上書き
============================================================ */

.hotspot {
    position: absolute;
    cursor: pointer;
    /* 開発中は枠を表示。完成時はコメントアウト */
    /* border: 5px dashed rgba(200, 169, 110, 0.5); */
    border-radius: 10px;
}

/* ============================================================
   アイテムボックス
============================================================ */

#item-box {
    background: rgba(10, 10, 28, 0.92);
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 10px;
    height: 50px;
    overflow-x: auto;
    flex-wrap: nowrap;
}

#item-box::-webkit-scrollbar {
    display: none;
}

#item-box-label {
    font-size: 11px;
    color: #555;
}

#item-box img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.item-slot.selected {
    outline: 2px solid #F5C800;
    background: rgba(245, 200, 0, 0.2);
}


/* ============================================================
   アイテムポップアップ
============================================================ */

#item-popup {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 60;
    cursor: pointer;
    padding-bottom: 40%;
}

#item-popup>img {
    width: min(60vw, 400px);
    animation: popIn 0.3s ease;
}

#item-popup p {
    margin-top: 14px;
    font-size: 13px;
    color: #ffe066;
    letter-spacing: 1px;
}

@keyframes popIn {
    from {
        transform: scale(0.4);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}


/* ============================================================
   PCレイアウト
============================================================ */

.room-nav-btn {
    display: none;
}

@media (min-width: 600px) {
    #game-frame {
        background-color: black;
        background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.315) 0%, transparent 25%);
        display: flex;
        justify-content: center;
        min-height: calc(100vh - 600px);
    }

    #game-wrapper {
        width: 300px;
        margin: 0 auto;
        position: relative;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
    }

    .room-nav-btn {
        display: block;
        background: black;
        border: 2px solid #555;
        color: #aaa;
        font-family: 'DotGothic16', sans-serif;
        font-size: 50px;
        padding: 16px 30px;
        cursor: pointer;
        transition: color 0.2s, border-color 0.2s;
    }

    .room-nav-btn:hover {
        color: #F5C800;
        border-color: #F5C800;
    }

    #dialogue-box {
        padding: 5px 20px;
        font-size: 11px;
    }

    #dialogue-name {
        font-size: 10px;
    }

    #item-popup>img {
        width: min(40vw, 200px);
    }

    #item-box img {
        width: 40px;
    }
}