/* --- 全局與佈局樣式 --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #0d1117; /* 深色背景 */
    color: #c9d1d9; /* 淺色文字 */
}

/* .game-container 的樣式現在主要由 index.html 中的 Tailwind class 控制
  (flex, padding, justify, etc.)
*/

.game-card {
    max-width: 800px; /* 維持最大寬度限制 */
    width: 100%;
    box-shadow: 0 0 30px rgba(88, 166, 255, 0.1); /* 藍色微光影 */
    transition: background-color 0.5s, box-shadow 0.5s;
}

/* --- 場景特定樣式 --- */
.scene-room {
    background-color: #1f2937; /* 房間場景基底色 */
    border: 4px solid #fcd34d;
    position: relative; /* 關鍵：為了讓思緒框能絕對定位 */
    display: flex;
    flex-direction: column;
    padding: 0;
}

.scene-corridor {
    background-color: #000; /* 黑暗走廊的黑色背景 */
    border: 4px solid #6b7280; /* 黑白邊框 */
}

/* --- 互動元素 --- */
.interactive-button {
    transition: all 0.2s;
    cursor: pointer;
}

.interactive-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.corridor-text {
    font-size: 1.2rem;
    color: #c9d1d9;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem;
    border-radius: 6px;
}

/* 視覺小說(VN)文本框 (現在也用於房間思緒框) */
.vn-textbox {
    min-height: 120px; 
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #58a6ff;
    cursor: pointer;
    text-shadow: 1px 1px 2px #000;
    position: relative;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    padding: 1.5rem; /* 增加內邊距，確保文字不會太靠邊 */
}

.continue-prompt {
    position: absolute;
    bottom: 1rem;  /* 稍微調整位置 */
    right: 1.5rem;
    font-size: 0.875rem; /* 縮小字體 (text-sm) */
    font-weight: normal; /* 移除粗體 */
}

/* --- 圖片與物件 --- */
.room-view-image, .vn-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: opacity 0.3s;
}

/* 房間內物件的透明點擊層 */
.object-overlay {
    background-color: transparent;
    border: 2px solid transparent; 
    z-index: 40;
    transition: all 0.2s ease-in-out;
    pointer-events: auto;
    cursor: pointer; 
}

/* 已移除 :hover 效果 */

/* --- 新增：道具欄格子樣式 --- */
.inv-slot {
    transition: all 0.2s;
    cursor: pointer;
}

.inv-slot:hover {
    border-color: #fcd34d; /* 懸停時黃色邊框 */
    transform: scale(1.05);
}

/* 讓道具圖片填滿格子並保持比例 */
.inv-slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px; /* 圖片內縮一點 */
}


/* --- 動畫 --- */
@keyframes flash {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.flash-text {
    color: rgba(156, 163, 175, 0.7);
    animation: flash 1.5s infinite ease-in-out;
}

/* --- 新增：畫廊樣式 --- */
.gallery-grid {
    display: grid;
    /* 響應式網格：
      - 手機: 2 欄
      - 平板 (sm): 3 欄
    */
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


.gallery-slot {
    position: relative;
    aspect-ratio: 4 / 3;
    border: 2px solid #6b7280; /* gray-500 */
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: #1f2937; /* gray-800 */
}

.gallery-slot:hover {
    transform: scale(1.05);
    border-color: #fcd34d; /* amber-300 */
    box-shadow: 0 0 15px rgba(252, 211, 77, 0.3);
}

.gallery-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-slot-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: bold;
    /* 防止文字溢出 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-slot-locked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #111827; /* gray-900 */
    cursor: not-allowed;
    color: #4b5563; /* gray-600 */
}

.gallery-slot-locked:hover {
    transform: none;
    border-color: #6b7280;
    box-shadow: none;
}

.gallery-slot-locked svg {
    width: 40%;
    height: 40%;
    fill: currentColor;
}

/* --- 新增：防止圖片複製 --- */
img {
    /* 防止圖片被滑鼠拖曳 */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;

    /* 防止滑鼠右鍵點擊圖片時跳出「儲存圖片」
      注意：這也會讓圖片無法被點擊！
      因此我們需要為可點擊的圖片 (道具欄、畫廊) 覆蓋此設定
    */
    pointer-events: none;

    /* 防止選取圖片 (雖然幫助不大) */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 覆蓋設定：讓道具欄和畫廊的圖片可以被點擊 */
.inv-slot img,
.gallery-slot img {
    pointer-events: auto;
}