/* General styles - can be similar to bubble_pop_panic.css or define new ones */
body {
    font-family: 'Arial', 'Noto Sans TC', sans-serif; /* Example font */
    background-color: #2c3e50; /* Dark blue-grey background */
    color: #ecf0f1; /* Light grey text */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.container {
    background-color: rgba(52, 73, 94, 0.8); /* Semi-transparent darker background */
    border: 1px solid rgba(236, 240, 241, 0.3);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px; /* Adjusted for this game */
    text-align: center;
    margin: auto;
}

h1 {
    color: #e74c3c; /* Reddish title */
    font-weight: 700;
    font-size: 2em;
    text-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
    margin-bottom: 15px;
}
h2 {
    color: #e74c3c;
    font-weight: 600;
    font-size: 1.3em;
    text-shadow: 0 0 3px rgba(231, 76, 60, 0.4);
    margin-top: 20px;
    margin-bottom: 10px;
}

label {
    display: block;
    margin-top: 10px;
    margin-bottom: 4px;
    font-weight: 500;
    text-align: left;
    color: #bdc3c7; /* Lighter grey for labels */
    font-size: 0.9em;
}

input[type="text"],
input[type="password"] {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(189, 195, 199, 0.5);
    background-color: rgba(44, 62, 80, 0.9); /* Darker input background */
    color: #ecf0f1;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.3s, box-shadow 0.3s;
}
input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: rgba(189, 195, 199, 0.7);
}
input[type="text"]:focus,
input[type="password"]:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.25);
    outline: none;
}

button {
    background: linear-gradient(45deg, #e74c3c, #c0392b); /* Red gradient buttons */
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    margin: 10px 5px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}
button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}
button:active {
    transform: translateY(0px) scale(1);
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}
button:disabled {
    background: #7f8c8d; /* Grey for disabled */
    color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.error-message { color: #e74c3c; margin-top: 8px; font-size: 0.85em; }
.success-message { color: #2ecc71; margin-top: 8px; font-size: 0.85em; } /* Green for success */
.info-message { color: #3498db; margin-top: 10px; font-size: 0.9em; } /* Blue for info */

/* CAPTCHA Styles - same as bubble_pop_panic */
#captcha-container { margin-bottom: 15px; text-align: left; }
.captcha-line { display: flex; align-items: center; }
#captchaInput { width: 80px; padding: 8px; font-size: 0.9em; margin-right: 8px;}
.captcha-display { padding: 8px 12px; font-size: 1.1em; margin-right: 8px; background-color: #34495e; border-radius: 4px;}
.captcha-refresh-btn { padding: 6px 8px; font-size: 1.1em; background: #c0392b;}
.captcha-refresh-btn:hover { background-color: #a93226; }

/* Game Section Specific Styles */
#game-section, #leaderboard-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(236, 240, 241, 0.2);
}

.game-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1em;
    font-weight: 500;
    flex-wrap: wrap;
}
.game-info span {
    background-color: rgba(44, 62, 80, 0.7);
    border: 1px solid rgba(236, 240, 241, 0.2);
    padding: 6px 12px;
    border-radius: 14px;
    color: #ecf0f1;
    margin: 4px;
    min-width: 70px;
}

#gameArea {
    width: 100%;
    height: 350px; /* Adjust as needed */
    background-color: #34495e; /* Darker blue for game area */
    border: 2px solid #2c3e50;
    border-radius: 8px;
    margin: 15px auto;
    position: relative;
    overflow: hidden; /* Important for falling blocks */
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.falling-block {
    position: absolute;
    width: 50px; /* Adjust as needed */
    height: 50px; /* Adjust as needed */
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: 1px solid rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

#controlButtons {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding: 10px;
    background-color: rgba(44, 62, 80, 0.5);
    border-radius: 8px;
}

#controlButtons button {
    width: 60px; /* Adjust as needed */
    height: 60px;
    font-size: 1.2em; /* Make text/icon on button larger if needed */
    border-radius: 8px; /* Can be rounded or square */
    margin: 5px;
    border: 2px solid transparent; /* For focus/active states */
    transition: background-color 0.2s, transform 0.1s, border-color 0.2s;
}

#controlButtons button:focus, #controlButtons button:hover {
    border-color: #ecf0f1;
    transform: scale(1.05);
}
#controlButtons button:active {
    transform: scale(0.95);
}

/* Example colors for buttons - JS will set these based on gameColors */
/* .color-btn-red { background-color: #e74c3c; }
.color-btn-blue { background-color: #3498db; }
.color-btn-green { background-color: #2ecc71; }
.color-btn-yellow { background-color: #f1c40f; } */


#gameMessage.info-message {
    min-height: 1.5em; /* Ensure space for messages */
}

/* Deadline visual indicator */
#gameArea::after {
    content: '';
    position: absolute;
    bottom: 10px; /* Adjust based on where you want the deadline */
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #e74c3c;
    z-index: 0; /* Below blocks */
}


/* Leaderboard Styles - can be same as bubble_pop_panic */
.leaderboard-filters button { background: #c0392b; margin-bottom: 10px; }
.leaderboard-filters button:hover { background-color: #a93226; }
#leaderboardTable { width: 100%; border-collapse: collapse; margin-top: 10px; background-color: rgba(44, 62, 80,0.5); font-size: 0.85em; }
#leaderboardTable th, #leaderboardTable td { border: 1px solid rgba(236, 240, 241,0.2); padding: 6px; text-align: left; }
#leaderboardTable th { background-color: #c0392b; color: white; text-align: center; font-weight: 600; }
#leaderboardTable tbody tr:nth-child(even) { background-color: rgba(52, 73, 94,0.7); }


/* Media Queries for smaller screens */
@media (max-width: 380px) {
    .container {
        padding: 15px;
    }
    h1 {
        font-size: 1.6em;
    }
    h2 {
        font-size: 1.1em;
    }
    button {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    .game-info {
        font-size: 0.9em;
    }
    .game-info span {
        padding: 5px 10px;
    }
    #gameArea {
        height: 300px;
    }
    .falling-block {
        width: 40px;
        height: 40px;
    }
    #controlButtons button {
        width: 50px;
        height: 50px;
        font-size: 1em;
    }
     #leaderboardTable {
        font-size: 0.75em;
    }
    #leaderboardTable th, #leaderboardTable td {
        padding: 4px;
    }
}