body, html {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #000;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
}

.screen.active {
    display: flex;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image covers the entire area */
    z-index: 0;
    display: none; /* Hidden by default */
}

#main-menu-bg {
    /* background-image is now set via src in HTML */
}

#game-play-bg {
    /* background-image is now set via src in HTML */
}

.title {
    font-size: 4rem;
    font-weight: bold;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    margin-bottom: 50px;
}

.animated-title {
    animation: color-change 3s infinite alternate, scale-bounce 2s infinite alternate;
}

@keyframes color-change {
    0% { color: white; }
    50% { color: #ff6700; } /* Xiaomi orange */
    100% { color: white; }
}

@keyframes scale-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent gray */
    z-index: -1; /* Below the content, above the background image */
}

.menu-buttons {
    display: flex;
    flex-direction: column;
}

.ui-button {
    background-color: #333;
    border: 2px solid #ff6700;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    width: 300px;
    padding: 15px 30px;
    cursor: pointer;
    margin: 10px;
    border-radius: 10px;
    transition: background-color 0.3s, color 0.3s;
}

.ui-button:hover {
    background-color: #ff6700;
    color: white;
}

.disclaimer {
    position: absolute;
    bottom: 20px;
    font-size: 0.8rem;
    color: #ccc;
}

/* How to Play */
.how-to-play-content {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 15px;
    max-width: 600px;
}

.how-to-play-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.how-to-play-content p {
    font-size: 1.2rem;
    line-height: 1.6;
    text-align: left;
    margin-bottom: 20px;
}

/* Dialogue */
#technician {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 500px; /* Adjust based on image */
    height: 833px; /* Adjust based on image */
    background-image: url('assets/images/technician-character.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom center;
    /* New: For shake animation */
    transform-origin: 50% 100%; /* Rotate from bottom center */
}

#technician-red-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 0, 0, 0); /* Red overlay, initially transparent */
    mix-blend-mode: multiply; /* Blends with the technician image */
    transition: background-color 0.1s linear; /* Smooth transition for color change */
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(var(--shake-amount)); }
    50% { transform: translateX(0); }
    75% { transform: translateX(calc(-1 * var(--shake-amount))); }
    100% { transform: translateX(0); }
}

#dialogue-box {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 800px;
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff6700;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

#dialogue-text {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

#dialogue-options {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Space between buttons */
    margin-top: 20px;
}

.dialogue-option-button {
    width: 100%; /* Make buttons fill the container */
    padding: 15px 20px;
    font-size: 1.2rem;
    border-radius: 8px;
    background-color: #555; /* Slightly different background for options */
    border: 1px solid #ff6700;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.dialogue-option-button:hover {
    background-color: #ff6700;
    border-color: white;
}

/* Flashing */
#phone-container {
    background-image: url('assets/images/phone-screen.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 400px; /* Adjust */
    height: 800px; /* Adjust */
    display: flex;
    justify-content: center;
    align-items: center;
}

#phone-screen-ui {
    width: 170px; /* Inner screen width */
    height: 700px; /* Inner screen height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #0f0;
    font-family: 'Courier New', Courier, monospace;
}

#progress-bar-container {
    width: 80%;
    height: 30px;
    background-color: #333;
    border: 1px solid #0f0;
    margin-bottom: 20px;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: #0f0;
}

#flash-status {
    font-size: 1.2rem;
}

#pull-cable-btn {
    position: absolute;
    bottom: 50px;
}

/* Escape */
#escape-canvas {
    background-color: #3a3a3a; /* Pavement color */
    border: 2px solid white;
}

/* Game Over / Victory */
.game-over-content, .victory-content, .about-content {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
}

.game-over-content h2, .victory-content h2, .about-content h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.game-over-content p, .victory-content p, .about-content p {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

#game-over-title {
    color: #ff4d4d;
}

.victory-content h2 {
    color: #4dff4d;
}

#victory-animation {
    width: 300px;
    height: 200px;
    background-image: url('assets/images/target-ebike.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0 auto;
    animation: ride-off 2s forwards;
}

@keyframes ride-off {
    0% { transform: translateX(0); }
    100% { transform: translateX(100vw); }
}

/* About Screen Specific Styles */
#about-screen {
    display: none; /* Hidden by default */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent overlay */
    z-index: 1000; /* Ensure it's on top */
    justify-content: center;
    align-items: center;
}

#about-screen.active {
    display: flex;
}

.about-content {
    max-width: 700px;
    color: white;
}

.about-content a {
    color: #ff6700; /* Xiaomi orange for links */
    text-decoration: none;
}

.about-content a:hover {
    text-decoration: underline;
}
