:root {
    --game-primary-bg: #E6FFFA; /* สีฟ้าเขียวอ่อน */
    --game-secondary-bg: #FFFFFF;
    --game-text-color: #333;
    --game-accent-color1: #2E7D32; /* เขียวเข้ม */
    --game-accent-color2: #FFB300; /* เหลืองเข้ม */
    --game-button-color: #0277BD; /* น้ำเงินเข้ม */
    --font-family-game: 'Kanit', sans-serif;
}

body {
    font-family: var(--font-family-game);
    margin: 0;
    background-color: var(--game-primary-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--game-text-color);
    overflow: hidden; /* ป้องกัน scrollbar ที่ body */
}

.game-container {
    width: 100%;
    max-width: 960px;
    height: calc(100vh - 40px); /* Full height with some margin */
    max-height: 700px;
    background-color: var(--game-secondary-bg);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.game-header {
    padding: 12px 20px;
    background-color: var(--game-accent-color1);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}
.game-header h1 { margin: 0; font-size: 1.6em; }
.back-to-activities-btn {
    color: white; text-decoration: none; font-size: 0.9em;
    padding: 7px 10px; background-color: rgba(255,255,255,0.15);
    border-radius: 5px; transition: background-color 0.3s;
}
.back-to-activities-btn:hover { background-color: rgba(255,255,255,0.3); }

.game-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.mascot-feedback-area {
    padding: 10px;
    background-color: #F1F8E9; /* พื้นหลังเขียวอ่อน */
    text-align: center;
    border-bottom: 2px solid var(--game-accent-color2);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}
.mascot-container { margin-right: 15px; }
.mascot-container img { height: 50px; margin: 0 5px; vertical-align: middle; }
#feedbackText { margin: 0; font-size: 1em; color: var(--game-accent-color1); font-weight: 500; }

.main-content-area {
    flex-grow: 1;
    position: relative; /* For switching views */
}

.village-map-container, .minigame-view {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow-y: auto; /* Scroll if content overflows */
    padding: 15px;
    box-sizing: border-box;
}
.village-map-container.active-view, .minigame-view.active-view {
    opacity: 1; visibility: visible;
}

.village-map-bg {
    width: 100%; height: 100%;
    object-fit: contain; /* Show full map, might have letterboxing */
    border-radius: 10px;
}

.problem-hotspot, .coop-building-spot {
    position: absolute;
    background-color: rgba(255, 255, 0, 0.7); /* สีเหลืองโปร่งใส */
    border: 2px solid var(--game-accent-color2);
    border-radius: 50%;
    padding: 5px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px; height: 80px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.problem-hotspot:hover, .coop-building-spot:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--game-accent-color2);
}
.problem-hotspot img, .coop-building-spot img {
    width: 40px; height: 40px; margin-bottom: 3px;
}
.problem-hotspot span, .coop-building-spot span {
    font-size: 0.7em; color: #333; font-weight: 500;
}
.problem-hotspot.solved { /* สไตล์เมื่อปัญหาถูกแก้แล้ว */
    background-color: rgba(76, 175, 80, 0.7); /* สีเขียวโปร่งใส */
    border-color: var(--game-accent-color1);
    cursor: default;
}
.solved-indicator { /* รูปชาวบ้านยิ้มเมื่อแก้ปัญหาได้ */
    width: 60px; height: auto;
    pointer-events: none; /* ไม่ให้บัง hotspot */
}


/* Mini-game specific UI elements (general) */
.minigame-title {
    text-align: center;
    font-size: 1.8em;
    color: var(--game-accent-color1);
    margin-bottom: 15px;
}
.minigame-instructions {
    text-align: center;
    font-size: 1em;
    margin-bottom: 20px;
    color: #555;
}
.minigame-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 10px;
}
.minigame-button-area { text-align: center; margin-top: 20px; }

/* Example Farmer Minigame Elements */
.farmer-options { display: flex; justify-content: space-around; width: 100%; }
.farmer-option {
    border: 2px solid #ccc; padding: 15px; border-radius: 10px;
    text-align: center; cursor: pointer; width: 40%;
}
.farmer-option.selected { border-color: var(--game-accent-color1); background-color: #E8F5E9; }
.farmer-option img { max-width: 80px; margin-bottom: 10px; }
.tool-sharing-ui img { margin: 0 10px; height: 60px; }

/* Example Weaver Minigame Elements */
.market-stall-area {
    width: 80%; min-height: 200px;
    background-image: url('images/market_stall_empty.png');
    background-size: contain; background-repeat: no-repeat; background-position: center;
    border: 2px dashed #ccc; border-radius: 10px;
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; padding: 10px; gap: 10px;
}
.craft-item {
    width: 60px; height: 60px; cursor: grab;
    background-size: contain; background-repeat: no-repeat; background-position: center;
}
.craft-item[data-item="fabric"] { background-image: url('images/weaver_fabric_icon.png'); }
.craft-item[data-item="pottery"] { background-image: url('images/pottery_icon.png'); }
/* ... add more craft items ... */

.game-progress-bar-footer {
    padding: 10px 20px; background-color: #E0E0E0;
    border-bottom-left-radius: 20px; border-bottom-right-radius: 20px;
    display: flex; align-items: center; justify-content: space-between;
}
.progress-info { display: flex; align-items: center; font-size: 0.9em; flex-grow: 1; }
.progress-info span { margin-right: 10px; }
.progress-bar-container {
    width: 70%; height: 20px; background-color: #BDBDBD;
    border-radius: 10px; overflow: hidden;
}
.progress-bar-fill {
    width: 0%; height: 100%; background-color: var(--game-accent-color2);
    border-radius: 10px; text-align: center; color: white; font-size: 0.8em; line-height: 20px;
    transition: width 0.5s ease;
}

.game-btn {
    background-color: var(--game-button-color); color: white; border: none;
    padding: 8px 15px; border-radius: 8px; font-size: 0.9em; cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}
.game-btn:hover { background-color: #0267a8; transform: translateY(-1px); }
.game-btn:active { transform: translateY(0px); }

/* Utility */
.hidden { display: none !important; }