body.house-page {
    background: #f0f8ff;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    color: #333;
    padding: 15px;
}

.top-bar {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10; /* 【新增】提升堆疊層級，確保在最上層 */

}

.house-container {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.dog-display-house img {
    width: 50%;
    max-width: 200px;
    margin-top: 30px;
    background: white;
    padding: 10px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.dog-name-house {
    font-size: 1.5em;
    font-weight: 700;
    margin-top: 10px;
}

.stats-container {
    margin-top: 20px;
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.stat-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.stat-label {
    width: 90px;
    text-align: left;
    font-weight: 700;
}

.stat-bar {
    flex-grow: 1;
    height: 25px;
    background-color: #e0e0e0;
    border-radius: 25px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    width: 100%;
    border-radius: 25px;
    transition: width 0.5s ease;
}

#clean-bar { background: linear-gradient(to right, #87ceeb, #4682b4); }
#satiety-bar { background: linear-gradient(to right, #f08080, #cd5c5c); }
#energy-bar { background: linear-gradient(to right, #ffd700, #ffa500); }
#iq-bar { background: linear-gradient(to right, #dda0dd, #ba55d3); }
#health-bar { background: linear-gradient(to right, #90ee90, #3cb371); }


.stat-value {
    width: 70px;
    text-align: right;
    font-weight: bold;
}

.actions-container {
    margin-top: 25px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    width: 100%; /* 【新增】強制寬度為100% */
    box-sizing: border-box; /* 【新增】確保 padding 不會影響寬度 */
}
.action-btn-house {
    padding: 15px 10px;
    font-size: 1em;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn-house:active {
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* --- 【新增】回到樂園按鈕樣式 --- */
.back-btn {
    display: inline-block; /* 讓 a 標籤可以設定 padding 和 margin */
    background-color: #87ceeb; /* 使用一個柔和的天藍色 */
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none; /* 移除底線 */
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.back-btn:hover {
    transform: translateY(-2px); /* 滑鼠懸停時輕微上浮 */
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.video-gallery-container {
    margin-top: 30px;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    text-align: center;
    width: 100%; /* 【新增】強制寬度為100% */
    box-sizing: border-box; /* 【新增】確保 padding 不會影響寬度 */
}

.video-gallery-container h2 {
    margin-top: 0;
    color: #555;
}

#video-player-wrapper {
    margin: 15px 0;
    min-height: 50px; /* 避免在沒有影片時塌陷 */
}

.video-thumbnail-list {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap; /* 如果影片太多可以換行 */
    margin-top: 15px;
}

.video-thumbnail {
    width: 80px;
    height: 60px;
    background-color: #ccc;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M8 5v14l11-7z"/></svg>'); /* 預設的播放圖示 */
    background-size: 40%;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.video-thumbnail:hover, .video-thumbnail.selected {
    border-color: var(--sky-blue-dark);
    transform: scale(1.05);
}

#mood-bar { background: linear-gradient(to right, #ffafbd, #ffc3a0); } /* 粉橘色漸層 */



/* --- 【新增】頁面內提示樣式 --- */

/* 用於顯示冷卻時間等文字訊息的樣式 */
.feedback-text {
    min-height: 1.2em; /* 佔據一個高度，避免畫面跳動 */
    font-weight: bold;
    color: #ff6347; /* 番茄紅 */
    transition: opacity 0.3s;
}

/* 冒出動畫的文字樣式 */
.floating-text {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5em;
    font-weight: bold;
    pointer-events: none; /* 讓動畫不會擋到滑鼠點擊 */
    opacity: 0;
    animation: float-up 2s ease-out forwards;
}

/* 定義動畫關鍵影格 */
@keyframes float-up {
    0% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -80px); /* 向上漂浮 80px */
    }
}



/* --- 【新增】我的背包樣式 --- */
.inventory-container {
    margin-top: 30px;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.inventory-container h2 {
    margin-top: 0;
    color: #555;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    margin-top: 15px;
    min-height: 50px; /* 避免在沒有物品時塌陷 */
}

.inventory-item {
    background: #f9f9f9;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 10px;
    position: relative;
    aspect-ratio: 1 / 1; /* 讓格子保持正方形 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.item-icon {
    font-size: 36px;
}

.item-count {
    position: absolute;
    bottom: 2px;
    right: 5px;
    background-color: #e67e22;
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 20px; /* 讓文字垂直置中 */
    text-align: center;
}
/* house_style.css */
/* --- 【新增】傢俱裝飾層樣式 --- */
.decor-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* 讓裝飾不會擋到滑鼠 */
}

.decor-item {
    position: absolute;
    width: 25%; /* 傢俱的大小，可以微調 */
    height: auto;
}

/* 針對不同傢俱微調位置 */
.decor-item[data-item-id="fur_001"] { /* 舒適狗窩 */
    bottom: 0;
    left: 10%;
}

.decor-item [data-item-id="fur_002"] { /* 耐咬玩具球 */
    bottom: 5%;
    right: 15%;
    width: 15%; /* 球可以小一點 */
}

.decor-item:not([data-item-id="fur_002"]) { /* 除了玩具球以外的傢俱 */
    bottom: 0;
    left: 10%;
}

#house-decor-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* 讓裝飾不會擋到滑鼠 */
    z-index: 1; /* 將裝飾層放在較低的堆疊順序 */
}

/* 狗狗圖片的樣式 */
#house-dog-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    position: relative; /* 建立堆疊上下文 */
    z-index: 2; /* 確保狗狗在裝飾層之上 */
}