body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #e0f7fa; /* Light cyan background */
    color: #004d40; /* Dark teal text */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal scroll on small screens if game area is wide */
}

.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 77, 64, 0.2); /* Teal shadow */
    width: 100%;
    max-width: 800px; /* Wider for game area */
    text-align: center;
}

h1, h2 {
    color: #00796b; /* Main teal color */
}

label {
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
    font-weight: bold;
    text-align: left;
    color: #00796b;
}

input[type="text"],
input[type="password"] {
    width: calc(100% - 24px);
    padding: 12px;
    margin-bottom: 18px;
    border: 1px solid #b2dfdb; /* Light teal border */
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}
input[type="text"]:focus,
input[type="password"]:focus {
    border-color: #00796b; /* Teal on focus */
    box-shadow: 0 0 0 0.2rem rgba(0, 121, 107, 0.25); /* Teal glow */
    outline: none;
}

button {
    background-color: #00796b; /* Teal for buttons */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px 5px;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}
button:hover {
    background-color: #004d40; /* Darker teal on hover */
    transform: translateY(-1px);
}
button:active {
    transform: translateY(0px);
}
button:disabled {
    background-color: #b2dfdb; /* Light teal for disabled */
    color: #4db6ac;
    cursor: not-allowed;
    transform: translateY(0px);
}

.error-message { color: #d32f2f; margin-top: 10px; font-size: 0.9em; }
.success-message { color: #388e3c; margin-top: 10px; font-size: 0.9em; }
.info-message { color: #004d40; margin-top: 12px; font-size: 1em; }

/* CAPTCHA Styles */
#captcha-container { margin-bottom: 18px; text-align: left; }
.captcha-line { display: flex; align-items: center; }
#captchaInput { width: 100px; padding: 10px; margin-right: 10px; margin-bottom: 0; text-align: center; letter-spacing: 2px;}
.captcha-display { display: inline-block; padding: 10px 15px; background-color: #e0f2f1; border: 1px solid #b2dfdb; border-radius: 4px; font-size: 1.2em; font-weight: bold; letter-spacing: 3px; user-select: none; margin-right: 10px; }
.captcha-refresh-btn { padding: 8px 10px; font-size: 1.2em; background-color: #4db6ac; border: none; color: white; cursor: pointer; border-radius: 4px; }
.captcha-refresh-btn:hover { background-color: #26a69a; }

/* Game Section Specific Styles */
#game-section, #leaderboard-section {
    margin-top: 35px;
    padding-top: 30px;
    border-top: 2px solid #b2dfdb; /* Light teal separator */
}

.game-info {
    display: flex;
    justify-content: center; /* Center score if only one item */
    margin-bottom: 20px;
    font-size: 1.3em; /* Larger game info */
    font-weight: bold;
}
.game-info span {
    background-color: #e0f2f1; /* Very light teal background for info */
    padding: 10px 20px;
    border-radius: 8px;
    color: #00796b; /* Teal text */
}

#gameArea {
    width: 100%;
    height: 250px; /* Fixed height for the game viewport */
    background-color: #80deea; /* Sky blue background */
    border: 3px solid #00acc1; /* Cyan border */
    border-radius: 8px;
    margin: 20px auto;
    position: relative; /* For positioning player and obstacles */
    overflow: hidden; /* Crucial: hides parts of obstacles outside */
    cursor: pointer; /* Indicate it's clickable for jump */
}

#ground {
    width: 100%;
    height: 20px; /* Height of the ground */
    background-color: #4caf50; /* Green ground */
    position: absolute;
    bottom: 0;
    left: 0;
    border-top: 3px solid #388e3c; /* Darker green top border for ground */
}

#player {
    width: 30px;
    height: 30px;
    background-color: #ffeb3b; /* Yellow player */
    border: 2px solid #fbc02d; /* Darker yellow border */
    border-radius: 4px;
    position: absolute;
    bottom: 20px; /* Starts on the ground */
    left: 50px;   /* Starting horizontal position */
    transition: bottom 0.2s ease-out; /* For jump animation - can be controlled by JS for more precise jumps */
}

.player-jump {
    /* Animation will be handled by JS changing 'bottom' property */
}

.obstacle {
    width: 25px; /* Obstacle width */
    height: 50px; /* Obstacle height */
    background-color: #f44336; /* Red obstacle */
    border: 2px solid #d32f2f; /* Darker red border */
    border-radius: 3px;
    position: absolute;
    bottom: 20px; /* Sits on the ground */
    /* 'left' will be animated by JS */
}
.obstacle.tall {
    height: 70px; /* Example of a taller obstacle */
    background-color: #e53935;
}

/* Leaderboard Styles */
.leaderboard-filters button { background-color: #4db6ac; margin-bottom: 15px; }
.leaderboard-filters button:hover { background-color: #26a69a; }
#leaderboardTable { width: 100%; border-collapse: collapse; margin-top: 15px; }
#leaderboardTable th, #leaderboardTable td { border: 1px solid #e0f2f1; padding: 10px; text-align: left; }
#leaderboardTable th { background-color: #00796b; color: white; text-align: center; font-weight: bold; }
#leaderboardTable tbody tr:nth-child(even) { background-color: #e0f7fa; }