:root {
    --bg-color: #f0f9ff;
    --primary-font: 'Kanit', sans-serif;
}

body, html {
    margin: 0; padding: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    font-family: var(--primary-font);
    background: var(--bg-color);
}

/* === Overlays (Start & Game Over) === */
.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); /* พื้นหลังสีดำโปร่งแสง */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100; /* อยู่บนสุดเสมอ */
    backdrop-filter: blur(5px); /* เบลอฉากหลัง */
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content h1 {
    margin: 0 0 20px 0;
    color: #FF4081;
    font-size: 3rem;
}

.modal-content p {
    font-size: 1.5rem;
    color: #333;
}

.game-btn {
    padding: 15px 40px;
    font-size: 1.5rem;
    background: linear-gradient(to right, #FF4081, #FF5252);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: var(--primary-font);
    margin-top: 20px;
}

.game-btn:hover {
    transform: scale(1.05);
}

.new-high-score {
    color: #FFC107 !important;
    font-weight: bold;
}

/* === Main Game UI === */
#game-container {
    width: 100%; height: 100vh;
    display: flex; flex-direction: column;
}

#hud {
    padding: 15px 25px;
    display: flex; justify-content: space-between;
    align-items: center;
    font-size: 1.4rem;
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    z-index: 10;
}

.stat-group { display: flex; gap: 20px; }

.high-score-container {
    font-size: 1rem; color: #777;
    background: #eee; padding: 5px 15px; border-radius: 20px;
}

#timer-container {
    width: 80%; height: 10px;
    background: #ddd; margin: 0 auto;
    border-radius: 5px; overflow: hidden;
    margin-top: 10px;
}

#timer-bar {
    width: 100%; height: 100%;
    background: linear-gradient(to right, #4caf50, #f44336);
    transition: width 0.1s linear;
}

#question-area { text-align: center; padding: 20px; z-index: 5; }
#question-text { font-size: 3rem; font-weight: bold; background: #ffffff; padding: 10px 40px; border-radius: 100px; box-shadow: 0 8px 20px rgba(0,0,0,0.1); color: #333; border: 4px solid #ffeb3b; }
#play-area { flex-grow: 1; position: relative; background: linear-gradient(to bottom, #f0f9ff 0%, #cbebff 100%); }
.balloon { position: absolute; width: 90px; height: 110px; border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; font-weight: bold; color: white; cursor: pointer; box-shadow: inset -8px -8px 15px rgba(0,0,0,0.2); user-select: none; }
.balloon::after { content: ''; position: absolute; bottom: -8px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 12px solid inherit; }
footer { text-align: center; padding: 10px; font-size: 0.8rem; background: white; }