* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.game-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.level-info {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.countdown {
    font-size: 1.5em;
    font-weight: bold;
    color: #ffdd59;
    margin-top: 10px;
}

.game-scene {
    background: #2c3e50;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    min-height: 300px;
    position: relative;
    overflow: hidden;
    border: 3px solid #34495e;
}

.alex {
    width: 80px;
    height: 120px;
    position: absolute;
    /* transition: all 0.3s ease; Keep for movement if needed */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    z-index: 2; /* Alex on top of chair and danger */
}

/* Alex on chair adjustment */
.alex-on-chair {
    bottom: 85px; /* Adjust based on chair height (chair height 35px + padding 50px = 85px) */
}


.alex.scared::before {
    content: '🧍‍♂️';
    animation: scared-shake 0.5s ease-in-out infinite alternate;
}

.alex.happy::before {
    content: '🕺';
    animation: happy-dance 1s ease-in-out infinite;
}

.alex.danger::before {
    content: '🏃‍♂️';
    animation: run-panic 0.3s ease-in-out infinite alternate;
}

.alex.dead::before {
    content: '💀';
    font-size: 80px;
    animation: none;
}

@keyframes scared-shake {
    0% { transform: translateX(-2px) rotate(-1deg); }
    100% { transform: translateX(2px) rotate(1deg); }
}

@keyframes happy-dance {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

@keyframes run-panic {
    0% { transform: translateX(-3px) scaleX(1); }
    100% { transform: translateX(3px) scaleX(-1); }
}

.chair {
    width: 60px;
    height: 35px; /* Height of the chair */
    background: #8B4513; /* Brown color for chair */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 50px; /* Aligns with Alex's initial bottom position */
    border-radius: 5px 5px 0 0;
    z-index: 1; /* Below Alex */
}

.chair::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 10px;
    background: #654321; /* Darker brown for seat */
    top: 0;
    border-radius: 5px 5px 0 0;
}

.chair::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 30px;
    background: #654321;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px 5px 0 0;
}


.danger-fluid {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 10px 10px 0 0;
    transition: height 0.5s linear; /* Smooth rise */
    z-index: 0; /* Below Alex and chair */
}

.lava {
    background: linear-gradient(90deg, #ff6b6b, #ff4757);
}

.water {
    background: linear-gradient(90deg, #3742fa, #2f3542);
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn {
    padding: 15px 25px;
    font-size: 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-red {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
}

.btn-green {
    background: linear-gradient(45deg, #51cf66, #40c057);
    color: white;
}

.btn-blue {
    background: linear-gradient(45deg, #339af0, #228be6);
    color: white;
}

.btn-yellow {
    background: linear-gradient(45deg, #ffd43b, #fab005);
    color: #333;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.status {
    text-align: center;
    margin-top: 20px;
    font-size: 1.3em;
    font-weight: bold;
    min-height: 30px;
}

.success {
    color: #51cf66;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.failure {
    color: #ff6b6b;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.rope {
    width: 4px;
    height: 150px;
    background: #8b4513;
    position: absolute;
    right: 50px;
    top: 0;
}

.platform {
    width: 80px;
    height: 20px;
    background: #654321;
    position: absolute;
    right: 20px;
    border-radius: 5px;
}

.cable {
    width: 4px;
    height: 100px;
    position: absolute;
    border-radius: 2px;
}

.cable-red {
    background: #ff4757;
    left: 100px;
    top: 50px;
}

.cable-blue {
    background: #3742fa;
    left: 150px;
    top: 50px;
}

.elevator {
    width: 60px;
    height: 80px;
    background: #34495e;
    position: absolute;
    right: 50px;
    border-radius: 5px;
    border: 2px solid #2c3e50;
}

.next-level {
    background: linear-gradient(45deg, #a8e6cf, #7fcdcd);
    color: #2c3e50;
}

.restart {
    background: linear-gradient(45deg, #ffd93d, #ff6b6b);
    color: white;
}

.instructions {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1em;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
