/* General Body and Main styling */
body {
/* ... (existing body/main styles) ... */
  font-family: Arial, sans-serif;
  background-color: #282c34; /* Dark background */
  color: #f0f0f0; /* Light text */
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative; /* Needed for absolute positioning of header/dev menu */
}

main {
  width: 100%;
  max-width: 600px; /* Constrain content width */
  padding: 20px;
  box-sizing: border-box;
}

/* --- UPDATED HEADER AND ICON STYLES (Top Left) --- */
.page-header {
/* ... (existing header styles) ... */
    position: fixed; /* Pin to the top left */
    top: 20px;
    left: 20px; /* Changed from right: 20px */
    z-index: 1000;
}

.header-icon img {
/* ... (existing icon styles) ... */
    height: 40px; /* Logo size */
    width: auto;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.header-icon img:hover {
    opacity: 0.7;
}

/* --- UPDATED DEV MENU STYLES (Positioned under the logo) --- */
.dev-menu-container {
/* ... (existing dev menu styles) ... */
    position: fixed;
    top: 65px; /* Just below the logo */
    left: 20px; /* Changed from right: 20px */
    background-color: #1e1e1e; /* Even darker background */
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    z-index: 999;
    display: none; /* Hidden by default, JS will change this */
    flex-direction: column;
    gap: 8px;
    width: 250px;
    text-align: left; /* Aligned text to the left */
    font-size: 0.9em;
}

.dev-menu-container p {
    margin: 0;
    color: #4CAF50; /* Green highlight for dev mode */
}

.dev-menu-container input {
    background-color: #3a3f47;
    border: 1px solid #4f555f;
    color: #f0f0f0;
    padding: 5px;
    border-radius: 3px;
    width: 100%;
    box-sizing: border-box;
}

.dev-menu-container button {
    background-color: #ff6b6b; /* Red Go button */
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    align-self: flex-end; /* Push button to the right */
}

.dev-menu-container button:hover {
    background-color: #e55a5a;
}
/* ------------------------------------------- */


/* Game Selection */
.game-selection {
/* ... (existing game selection styles) ... */
  display: flex;
  flex-direction: column;
  gap: 15px; /* Space between game options */
}

/* Individual Game Option */
.game-option {
/* ... (existing game option styles) ... */
  position: relative; /* Important for positioning the game-details popup */
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 15px;
  background-color: #3a3f47; /* Darker button background */
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #4f555f;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}

.game-option h2 {
/* ... (existing h2 styles) ... */
  margin: 0;
  font-size: 1.2em;
  color: #f0f0f0;
}

.game-option img {
/* ... (existing img styles) ... */
  width: 50px;
  height: auto;
  border-radius: 5px; /* Slightly rounded icons */
}

/* PC Hover Effect for game options */
@media (min-width: 769px) { /* Applies only to larger screens (PC) */
  .game-option:hover {
    background-color: #4a4f57; /* Lighter hover background */
    border-color: #6a717d;
  }
}


/* Game Details GUI (The popup) */
.game-details {
/* ... (existing game details styles) ... */
  position: absolute;
  top: 0;
  left: 105%; /* Position to the right of the game-option */
  width: 300px; /* Fixed width for the popup */
  background-color: #3a3f47;
  border: 1px solid #4f555f;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 10;
  display: none; /* Hidden by default */
  flex-direction: column;
  color: #f0f0f0;
}

/* PC Specific: Show game-details on hover */
@media (min-width: 769px) {
  .game-option:hover > .game-details {
    display: flex; /* Show when parent .game-option is hovered */
  }
}

/* Mobile Specific: Hide close button by default on PC */
@media (min-width: 769px) {
  .game-details .mobile-only {
    display: none;
  }
}


/* Game Details Header (Icon, Name, Close button for mobile) */
.details-header {
/* ... (existing details header styles) ... */
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  position: relative;
}

.details-header .detail-icon {
  width: 40px; /* Smaller icon inside the popup */
  height: auto;
  margin-right: 10px;
}

.details-header h3 {
  margin: 0;
  font-size: 1.3em;
  flex-grow: 1; /* Allows name to take available space */
}

.details-header .close-btn {
  background: none;
  border: none;
  color: #f0f0f0;
  font-size: 1.5em;
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
}
.details-header .close-btn:hover {
    color: #ff6b6b;
}


/* Game Details Content (Description) */
.details-content .description {
/* ... (existing details content styles) ... */
  font-size: 0.9em;
  line-height: 1.5;
  margin-bottom: 15px;
  color: #cccccc;
}

/* Game Details Footer (Version and Play button) */
.details-footer {
/* ... (existing details footer styles) ... */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #4f555f;
}

.details-footer .version {
  font-size: 0.8em;
  color: #999999;
}

.details-footer .play-btn {
  background-color: #4CAF50; /* Green play button */
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
}

.details-footer .play-btn:hover {
  background-color: #45a049;
}

/* Mobile-specific styles for the popup:
   - When the game-details is active (shown via JS), position it differently.
   - Adjust width for better mobile viewing.
   - Center it on the screen.
*/
@media (max-width: 768px) { /* Applies only to smaller screens (Mobile) */
  .game-details {
    position: fixed; /* Fixed position relative to viewport */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center it precisely */
    width: 90%; /* Take up most of the screen width */
    max-width: 350px; /* But not too wide on tablets */
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  }

  /* Make sure the main game options don't have their details shown on hover */
  .game-option:hover > .game-details {
    display: none;
  }
}

/* --- MOBILE BLUR EFFECT STYLES --- */
@media (max-width: 768px) {
/* ... (existing blur styles) ... */
    /* Apply the blur to EVERYTHING inside the <main> wrapper */
    .blur-bg > * {
        filter: blur(5px);
        transition: filter 0.3s ease-in-out; 
    }
    
    /* UN-BLUR the specific game option containing the active pop-up */
    .blur-bg .game-option {
        filter: none;
        z-index: 100; /* Ensure it stays above the blurred background */
    }

    /* UN-BLUR the pop-up itself */
    .blur-bg .game-details[style*="display: flex"] {
        filter: none;
        z-index: 101; /* Ensure pop-up is above its own game-option */
        background-color: #3a3f47; /* Ensure pop-up has a solid background */
    }
    
    /* Ensure the body scroll is hidden when the blur is active to prevent scrolling blurred content */
    .blur-bg body {
        overflow: hidden;
    }
}
/* ---------------------------------- */


/* --- 404 Specific Styles (Keeping existing styles) --- */
/* ... (existing 404 styles) ... */


/* ========================================================== */
/* --- NEW MODAL STYLES FOR EXIT CONFIRMATION --- */
/* ========================================================== */

/* Full-screen overlay to dim the game */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75); /* Dark, translucent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Higher than everything, including the dev menu */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none; /* Default state: hidden and not clickable */
}

/* Make it visible and clickable */
.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* The actual pop-up box */
.modal-content {
    background-color: #2c2f34; /* Dark gray background */
    color: #ecf0f1; /* Light text */
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease-in-out;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 1.5rem;
    color: #F6AA09; /* Your primary accent color */
    margin-bottom: 20px;
}

.modal-message p {
    margin-bottom: 10px;
    line-height: 1.4;
}

.modal-message .warning {
    color: #e74c3c; /* Red color for warning */
    font-weight: bold;
    margin-top: 15px;
    padding: 10px;
    border: 1px dashed #e74c3c;
    border-radius: 5px;
}

.modal-actions {
    margin-top: 30px;
    display: flex;
    justify-content: space-around;
    gap: 15px;
}

.button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cancel-btn {
    background-color: #3a3f47; /* Neutral button */
    color: #ecf0f1;
}

.cancel-btn:hover {
    background-color: #4a4f57;
}

.confirm-btn {
    background-color: #e74c3c; /* Destructive action color */
    color: white;
}

.confirm-btn:hover {
    background-color: #c0392b;
}

.hidden {
    display: none;
}
/* ========================================================== */

/* --- NEW DEV MODE MESSAGE STYLES --- */
.dev-message-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5000; /* Ensure it's on top of everything */
    padding: 15px 30px;
    background-color: rgba(76, 175, 80, 0.9); /* Semi-transparent Green */
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    opacity: 0; /* Start hidden */
    visibility: hidden; /* Hide from screen readers/taps when invisible */
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.dev-message-overlay.show {
    opacity: 1;
    visibility: visible;
}
