body {
    font-family: 'Rubik', sans-serif;
    background-color: #2c3e50; /* Dark blue/grey */
    color: #ecf0f1; /* Light grey */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 0; /* Removed padding for proper 16:9 wrapper sizing */
    box-sizing: border-box;
    direction: rtl; /* Right-to-left for Hebrew */
    text-align: right; /* Align text to the right for Hebrew */
}

/* New wrapper to enforce 16:9 aspect ratio for the entire game area */
.main-wrapper {
    width: 90vw; /* Take 90% of viewport width */
    max-width: 1600px; /* Cap at a reasonable large desktop resolution width */
    aspect-ratio: 16 / 9; /* Enforce 16:9 aspect ratio */
    background-image: url('background_map.png'); /* Map background here */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex; /* To center the game-container inside */
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Important: prevents content from spilling out of 16:9 frame */
    border-radius: 15px; /* Round the corners of the overall presentation area */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); /* Add a shadow to the overall presentation area */
}

.game-container {
    background-color: rgba(30, 40, 50, 0.95); /* Slightly darker with transparency over the map */
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); /* Keep individual shadow for container content */
    padding: 30px;
    text-align: center;
    width: 100%; /* Fill the main-wrapper's width */
    height: 100%; /* Fill the main-wrapper's height */
    border: 2px solid #f39c12; /* Orange border */
    box-sizing: border-box; /* Ensure padding is included in width/height */
    overflow-y: auto; /* Enable vertical scrolling if content overflows the 16:9 area */
}

header h1 {
    font-family: 'Rubik', sans-serif;
    color: #f39c12; /* Orange for title */
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-area {
    margin-top: 20px;
}

#intro-screen p {
    font-size: 1.1em;
    margin-bottom: 25px;
    line-height: 1.6;
}

#intro-screen #carmen-illustration {
    max-width: 250px; /* Adjust size as needed */
    height: auto;
    margin-bottom: 20px;
    border-radius: 10px; /* Slightly rounded corners */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

button {
    background-color: #e67e22; /* Brighter orange */
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 10px;
}

button:hover {
    background-color: #d35400; /* Darker orange on hover */
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.hidden {
    display: none;
}

.status-bar {
    display: flex;
    justify-content: space-around;
    background-color: #34495e; /* Darker blue */
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.clue-section, .investigation-section {
    background-color: #34495e;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #2c3e50;
}

h2 {
    color: #f39c12;
    margin-top: 0;
    font-family: 'Rubik', sans-serif;
    font-size: 1.8em;
}

#clues-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

#clues-list li {
    background-color: #2c3e50;
    margin: 8px 0;
    padding: 10px;
    border-radius: 5px;
    text-align: right; /* Align clue text to the right */
    font-size: 1.05em;
    display: flex; /* Use flexbox for image and text alignment */
    align-items: center;
    gap: 15px; /* Space between image and text */
}

#clues-list li img {
    max-width: 120px; /* Increased size for clue images */
    height: auto;
    border-radius: 5px;
    border: 1px solid #f39c12;
    order: 2; /* Put image after text for RTL */
}

#clues-list li span {
    order: 1; /* Put text before image for RTL */
    flex-grow: 1;
}

#city-guess-input {
    width: calc(100% - 30px);
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #5a7b9e;
    border-radius: 8px;
    font-size: 1.1em;
    background-color: #2c3e50;
    color: #ecf0f1;
    box-sizing: border-box;
    text-align: right; /* Align input text to the right */
}

#city-guess-input::placeholder {
    color: #95a5a6;
}

.message-box {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 1.1em;
    border: 1px solid #f39c12;
}

#win-screen, #lose-screen {
    padding: 30px;
    font-size: 1.2em;
}

#win-screen h2 {
    color: #27ae60; /* Green for win */
}

#win-screen #millennium-diamond {
    max-width: 150px;
    height: auto;
    margin: 20px auto;
    display: block; /* Center the image */
}

.carmen-win-illustration-container {
    margin-bottom: -75px; /* Adjust to overlap with the diamond */
    position: relative;
    z-index: 10; /* Ensure it's above the diamond */
}

#carmen-win-smile {
    width: 150px; /* Size of the circular image */
    height: 150px;
    border-radius: 50%; /* Make it a circle */
    object-fit: cover; /* Ensure the image covers the circle */
    border: 5px solid #f39c12; /* Orange border */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    display: block;
    margin: -75px auto 0; /* Adjust negative margin to position it above the diamond, accounting for its own height */
    background-color: #34495e; /* Background for the circular image, if needed */
}

#lose-screen h2 {
    color: #e74c3c; /* Red for lose */
}

/* New Intermediate Screen Styles */
#success-transition-screen {
    position: fixed; /* Overlay the entire screen */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85); /* Dark semi-transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Make sure it's on top of everything */
    opacity: 0; /* Start hidden for fade-in effect */
    visibility: hidden;
    transition: opacity 0.5s ease;
}

#success-transition-screen.visible {
    opacity: 1;
    visibility: visible;
}

.success-content {
    background-color: #34495e; /* Darker blue background */
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid #f39c12; /* Orange border */
    max-width: 80%; /* Limit width */
    color: #ffffff; /* Changed to white */
}

#lottie-hourglass-animation {
    margin-bottom: 20px;
}

#carmen-hourglass-smile {
    width: 240px; /* Size for Carmen's face, increased by 2x */
    height: 240px; /* Size for Carmen's face, increased by 2x */
    border-radius: 50%; /* Make it circular */
    object-fit: cover;
    border: 3px solid #f39c12;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

#success-message {
    font-size: 1.5em;
    font-weight: bold;
    color: #ffffff; /* Changed to white */
    margin-top: 15px;
}