/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Black+Ops+One&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Black+Ops+One&display=swap');

/* Global Styles */
:root {
    /* Apocalyptic color palette */
    --primary-color: #ff6b35; /* Rusty orange */
    --secondary-color: #c1292e; /* Blood red */
    --tertiary-color: #8a1c1c; /* Dark blood */
    --quaternary-color: #4a4238; /* Dusty brown */
    --quinary-color: #2e2b28; /* Ash gray */
    --background-color: #0f0f0f; /* Near black */
    --text-color: #e6e0d4; /* Faded parchment */
    --button-color: #c1292e; /* Blood red */
    --button-color-2: #346085; /* Rusty Blue */
    --button-hover: #ff6b35; /* Rusty orange */
    --button-hover-2: #3d719b; /* Rusty Blue */
    --button-text: #e6e0d4; /* Faded parchment */
    --stat-bar-bg: #1a1a1a; /* Dark gray */
    --radiation-color: #7fff00; /* Toxic green */
    --border-color: #3d3a34; /* Weathered metal */
    --ui-bg-color: rgba(15, 15, 15, 0.85); /* Semi-transparent dark background */
    --ui-glow: 0 0 8px rgba(193, 41, 46, 0.6); /* Red glow effect */
    --warning-color: #ffd100; /* Warning yellow */
    --bottom-ui-height: 120px; /* Height for bottom UI section */
}

html {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Apocalypse', 'Special Elite', 'Courier New', monospace;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    overflow: hidden;
    background-image: url('https://images.unsplash.com/photo-1635776062127-d379bfcba9f9?ixlib=rb-1.2.1&auto=format&fit=crop&w=2000&q=80');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
    height: 100vh;

    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Game Container */
.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#renderCanvas {
    width: 100vw;
    height: 100vh;
    touch-action: none;
    -ms-touch-action: none;
    filter: contrast(1.1) saturate(0.9); /* Slightly desaturated, post-apocalyptic look */
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
}

/* UI Overlay */
.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh; /* Full height to allow bottom positioning */
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Space between top stats and bottom actions */
    pointer-events: none; /* Allow clicks to pass through to canvas */
}

/* Make UI elements clickable */
.ui-overlay > * {
    pointer-events: auto;
}

/* CRT Screen Effect */
.ui-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: -1;
    opacity: 0.3;
}

/* Top UI Container */
.top-ui-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* pointer-events: none; */
}

/* Stats Container */
.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background-color: var(--ui-bg-color);
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 0 3px var(--secondary-color);
    border: 1px solid var(--border-color);
    position: relative;
    backdrop-filter: blur(5px);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.stats-container-2 {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background-color: transparent;
    width: auto;
    border-radius: 10px;
    width: 100%;
}

.stat {
    flex: 1;
    margin-bottom: 5px;
    min-width: 120px;
    position: relative;
}

.stat-label {
    font-size: 12px;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Wasteland', 'Black Ops One', sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    margin-right: 10px;
}

.stat-bar {
    height: 12px;
    background-color: var(--stat-bar-bg);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--border-color);
    position: relative;
}

.stat-fill {
    height: 100%;
    width: 100%;
    transition: width 0.3s ease;
    position: relative;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.1) 10px,
        transparent 10px,
        transparent 20px
    );
}

.health-fill {
    background-color: var(--secondary-color);
}

.hunger-fill {
    background-color: var(--primary-color);
}

.energy-fill {
    background-color: var(--warning-color);
}

.happiness-fill {
    background-color: var(--quaternary-color);
}

.hygiene-fill {
    background-color: #4ecdc4; /* Teal color for hygiene */
}

.money-value, .day-value, .radiation-value, .time-value {
    font-weight: bold;
    font-size: 20px;
    color: var(--text-color);
    font-family: 'Wasteland', 'Black Ops One', sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    margin-left: 0px;
}

@media (max-width: 768px) {
    .money-value, .day-value, .radiation-value, .time-value {
        font-size: 14px;
    }
}

.time-value {
    color: var(--warning-color);
}

.radiation-value {
    color: var(--radiation-color);
    /* text-shadow: 0 0 8px var(--radiation-color); */
}

/* Bottom UI Container */
.bottom-ui-container {
    width: 100%;
    padding: 15px;
    display: flex;
    flex-direction: row-reverse;
    gap: 10px;
    margin-top: auto; /* Push to bottom */
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action:none;
}

/* Action Buttons */
.action-buttons, .room-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    background-color: var(--ui-bg-color);
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    position: relative;
    backdrop-filter: blur(5px);
    width: 100%;
    margin-bottom: 5px;
}

/* Style for buttons outside delivery hours */
.action-btn.outside-hours {
    position: relative;
    overflow: hidden;
}

.action-btn.outside-hours::after {
    content: "9:00-21:00";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--warning-color);
    font-size: 9px;
    padding: 2px 0;
    text-align: center;
}

/* Style for buttons when communication system is down */
.action-btn.comm-failure {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--warning-color);
}

.action-btn.comm-failure::after {
    content: "COMM DOWN";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--warning-color);
    font-size: 9px;
    padding: 2px 0;
    text-align: center;
}

/* Style for buttons when communication system is down */
.action-btn.food-failure {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--warning-color);
}

.action-btn.food-failure::after {
    content: "NO MONEY";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--warning-color);
    font-size: 9px;
    padding: 2px 0;
    text-align: center;
}

/* Style for buttons when water system is down */
.action-btn.water-failure {
    position: relative;
    overflow: hidden;
    border: 1px solid #00a2ff; /* Blue color for water */
}

.action-btn.water-failure::after {
    content: "WATER DOWN";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: #00a2ff; /* Blue color for water */
    font-size: 9px;
    padding: 2px 0;
    text-align: center;
}

/* .action-buttons::before,
.room-buttons::before,
.stats-container::before {
    position: absolute;
    top: -10px;
    left: 15px;
    background-color: var(--secondary-color);
    padding: 2px 10px;
    font-size: 10px;
    font-family: 'Wasteland', 'Black Ops One', sans-serif;
    letter-spacing: 1px;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: visible;
    z-index: 5;
    display: inline-block;
    width: auto;
    height: auto;
    min-width: fit-content;
} */

.action-btn, .room-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 3px;
    background-color: var(--button-color);
    color: var(--button-text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Wasteland', 'Black Ops One', sans-serif;
    font-size: 16px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap; /* Prevent text wrapping */
    text-overflow: ellipsis; /* Add ellipsis for overflowing text */
    width: 32%;
    height: 55px;
}

.action-btn {
    background-color: var(--button-color-2);
}

.action-btn::before, .room-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
}

.action-btn:hover::before, .room-btn:hover::before {
    left: 100%;
}

.action-btn {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease, display 0s;
}

.action-btn[style*="display: none"] {
    opacity: 0;
    transform: scale(0.8);
}

.room-btn:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 5px var(--secondary-color);
}

.action-btn:hover {
    background-color: var(--button-hover-2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 5px var(--secondary-color);
}

.action-btn:active, .room-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.room-btn.active {
    background-color: var(--tertiary-color);
    color: white;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5), 0 0 3px var(--secondary-color);
}

/* Overlay Screens */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    background-image: radial-gradient(circle at center, rgba(15, 15, 15, 0.7) 0%, rgba(5, 5, 5, 0.95) 100%);
    overflow: hidden !important;
}


#start-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    overflow-y: hidden !important;
    padding-top: 0px !important;
    position: fixed;
    top: 0px;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding-top: 50px !important;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    user-select: none; 
    overflow-y: hidden !important;
}

#game-over-screen {
    overflow-y: hidden !important;
    padding-top: 0px !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

.start-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 95%;
    max-width: 900px;
    gap: 10px;
}

.start-buttons button {
    width: 300px;
}

.start-content, .game-over-content {
    background-color: var(--ui-bg-color);
    padding: 30px;
    border-radius: 5px;
    text-align: center;
    max-width: 900px;
    width: 95%;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6), inset 0 0 5px var(--secondary-color);
    border: 1px solid var(--border-color);
    position: relative;
    backdrop-filter: blur(10px);
    overflow-y: auto !important;
    max-height: 70%;
}

/* Custom scrollbar for start-content */
.start-content::-webkit-scrollbar {
    width: 4ch;
}

.start-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.start-content::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.start-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* For Firefox */
.start-content {
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) rgba(0, 0, 0, 0.2);
}


.game-over-content {
    max-width: 517px !important;
}

@media (max-width: 768px) {
    .game-over-content {
        max-width: 317px !important;
    }
}

.start-content::before, .game-over-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
    border-radius: 5px;
}

.start-content h1, .game-over-content h1 {
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(193, 41, 46, 0.7);
    font-family: 'Wasteland', 'Black Ops One', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    display: inline-block;
}

.start-content h1::after, .game-over-content h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
}

/* Establecer un tamaño de fuente fijo para estos elementos independientemente de la orientación */
.start-content p, .game-over-content p {
    margin-bottom: 25px;
    margin-top: 15px;
    line-height: 1.6;
    color: var(--text-color);
    font-size: 16px !important; /* Forzar tamaño fijo con !important */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    max-height: none !important; /* Evitar restricciones de altura que puedan afectar */
}

.game-tip {
    background-color: rgba(255, 209, 0, 0.1);
    border-left: 3px solid var(--warning-color);
    padding: 10px 15px;
    margin: 15px 0 25px;
    font-size: 0.9rem;
    color: var(--warning-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#start-game-btn, #continue-game-btn, #restart-game-btn, #main-menu-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 3px;
    background-color: var(--button-color);
    color: var(--button-text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: unset;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Wasteland', 'Black Ops One', sans-serif;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;

}

#main-menu-btn {
    margin-top: 20px;
}

#start-game-btn::before, #continue-game-btn::before, #restart-game-btn::before, #main-menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
}

#start-game-btn:hover::before, #continue-game-btn:hover::before, #restart-game-btn:hover::before, #main-menu-btn:hover::before {
    left: 100%;
}

#start-game-btn:hover, #continue-game-btn:hover, #restart-game-btn:hover, #main-menu-btn:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 8px var(--secondary-color);
}

@media (max-width: 768px) {
    #start-game-btn:hover, #continue-game-btn:hover, #restart-game-btn:hover, #main-menu-btn:hover {
        background-color: var(--button-color);
        transform: translateY(0px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

/* Notification */
.notification {
    position: fixed;
    top: 170px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 95% !important;
    background-color: var(--ui-bg-color);
    padding: 15px 25px;
    border-radius: 3px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), 0 0 10px var(--secondary-color);
    z-index: 30;
    transition: all 0.3s ease;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-family: 'Apocalypse', 'Special Elite', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    max-width: 80%;
    font-size: 16px;
    backdrop-filter: blur(5px);
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
}

/* Notification list for desktop view */
.notification-list {
    position: fixed;
    top: 170px;
    left: 20px;
    width: 300px;
    overflow-y: auto;
    /* z-index: 30; */
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
    overflow: hidden;
    justify-content: flex-end;
    pointer-events: none;
}

.notification-list-item {
    background-color: var(--ui-bg-color);
    padding: 12px 15px;
    border-radius: 3px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), 0 0 10px var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-family: 'Apocalypse', 'Special Elite', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    backdrop-filter: blur(5px);
    transition: opacity 0.5s ease;
    opacity: 1;
    animation: fadeIn 0.3s ease-in-out;
}


@media (max-width: 1360px) {
    .notification {
        top: 170px !important;
        max-width: 400px !important;
    }
    .notification-list {
        top: 170px !important;
    }

    .bottom-ui-container {
        flex-direction: column !important;
        gap: 5px !important;
    }
}

@media (max-width: 768px) {
    .notification {
        width: 95%;
        max-width: 95% !important;
        top: unset !important;
        font-size: 14px;
        bottom: 140px;
    }
    
    .notification-list {
        display: none; /* Hide notification list on mobile */
    }
}

/* Notification types */
.notification-info {
    border-color: var(--warning-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), 0 0 10px var(--warning-color);
}

.notification-warning {
    border-color: #ffc107;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), 0 0 10px #ffc107;
    color: #ffc107;
}

.notification-danger {
    border-color: #dc3545;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), 0 0 10px #dc3545;
    color: #dc3545;
}

.notification-success {
    border-color: #28a745;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), 0 0 10px #28a745;
    color: #28a745;
}

.hidden {
    display: none !important;
}

.stats-additional-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}


@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .top-ui-container {
        padding: 10px;
        /* pointer-events: all; */
    }

    .start-buttons {
        width: 95%;
        position: fixed;
        bottom: 10px;
    }
    
    .start-buttons button {
        width: 49%;
    }
    
    /* Compact stats for mobile */
    .stats-container {
        max-height: 180px;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
        position: relative;
        padding: 8px;
        margin: 0;
        background-color: rgba(15, 15, 15, 0.7);
        backdrop-filter: blur(5px);
        border-radius: 3px;
        padding-top: 25px;
        padding-bottom: 15px;
        margin-top: 15px;
    }
    
    /* Eliminar los ajustes que causan la banda negra */
    .game-container {
        width: 100vw;
        height: 100vh; /* Mantener altura completa */
        position: relative;
    }
    
    #renderCanvas {
        width: 100vw;
        height: 100vh;
        position: absolute;
        overflow: hidden;
    }
    
    /* Ajustar la interfaz para que no quede detrás de la barra de navegación */
    .ui-overlay {
        height: 100vh; /* Mantener altura completa */
        position: absolute;
        /* Usar padding-bottom en lugar de reducir la altura */
        padding-bottom: env(safe-area-inset-bottom, 80px); /* Usar safe-area-inset si está disponible */
    }
    
    /* Ajustar el contenedor inferior */
    .bottom-ui-container {
        flex-direction: column !important;
        gap: 0px !important;
        padding: 10px;
        flex-direction: column;
        position: fixed;
        bottom: 0px;
    }

    .action-btn, .room-btn {
        margin-bottom: 5px !important;
        padding: 6px !important;
        height: 30px !important;
        font-size: 10px !important;
    }
    
    /* Add a subtle pulsing effect to the toggle indicator to draw attention */
    @keyframes pulse {
        0% { opacity: 0.7; }
        50% { opacity: 1; }
        100% { opacity: 0.7; }
    }

    /* Compact view for stats */
    .stat {
        flex: none;
        width: 48%;
        margin-bottom: 1px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .stat-label {
        font-size: 10px;
        margin-bottom: 0;
        margin-right: 10px;
        margin-left: 10px;
        width: 72px;
    }
    
    /* In compact mode, only show health, hunger and energy by default */
    .stat:nth-child(n+7) {
        display: none;
    }

    /* Compact stat bars */
    .stat-bar {
        height: 8px;
        flex-grow: 1;
        border-radius: 3px;
    }
    
    /* Add value indicators in compact mode */
    .stat-bar:after {
        content: attr(data-value);
        position: absolute;
        right: 10px;
        font-size: 11px;
        opacity: 0;
        color: var(--text-color);
    }
    
    /* Compact layout for buttons */
    .action-buttons, .room-buttons {
        margin-bottom: 5px;
        padding: 6px;
        background-color: rgba(15, 15, 15, 0.7);
        backdrop-filter: blur(5px);
        border-radius: 3px;
        padding: 8px;
        overflow-x: auto; /* Allow horizontal scrolling if needed */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        scrollbar-width: none; /* Hide scrollbar in Firefox */
        display: flex;
        flex-wrap: nowrap; /* Don't wrap buttons */
        justify-content: center !important; /* Start from left */
        max-width: 100%; /* Ensure container doesn't exceed screen width */
        margin-top: 0px !important;
        margin-bottom: 5px !important;
        gap: 5px !important;
    }
    /* Custom scrollbar for start-content */
    .start-content {
        scrollbar-width: thin;
        scrollbar-color: var(--secondary-color) rgba(0, 0, 0, 0.2);
        -webkit-overflow-scrolling: touch; /* Enable momentum scrolling on iOS */
        overflow-y: auto; /* Enable scrolling */
    }

    /* Hide scrollbar on iOS while preserving functionality */
    @supports (-webkit-touch-callout: none) {
        .start-content {
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-color: var(--secondary-color) rgba(0, 0, 0, 0.2);
        }
        .start-content::-webkit-scrollbar {
            width: 6px;
            background: rgba(0, 0, 0, 0.2);
        }
        .start-content::-webkit-scrollbar-thumb {
            background-color: var(--secondary-color);
            border-radius: 3px;
        }
    }

    /* Scrollbar styles for other browsers */
    @supports not (-webkit-touch-callout: none) {
        .start-content::-webkit-scrollbar {
            width: 6px;
        }

        .start-content::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.2);
            border-radius: 3px;
        }

        .start-content::-webkit-scrollbar-thumb {
            background-color: var(--secondary-color);
            border-radius: 3px;
        }
    }
    
    .action-btn, .room-btn {
        min-width: 90px; /* Slightly wider to fit text */
        padding: 8px 10px;
        font-size: 10px;
        border-radius: 2px;
        flex: 0 0 auto; /* Don't grow or shrink */
        margin-right: 5px; /* Space between buttons */
        white-space: nowrap; /* Keep text on one line */
        overflow: visible; /* Allow text to be fully visible */
        text-overflow: clip; /* Don't add ellipsis in mobile view */
        word-break: keep-all; /* Prevent word breaking */
        width: 30%;
        height: auto;
    }
    
    .start-content h1, .game-over-content h1 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    

    /* Ajustar el contenedor para acomodar la etiqueta */
    .action-buttons,
    .room-buttons {
        margin-top: 15px;
        margin-bottom: 0px;
    }

    .overlay-screen {
        height: 100vh; /* Mantener altura completa */
        padding-bottom: env(safe-area-inset-bottom, 80px); /* Espacio para la barra de navegación */
        justify-content: flex-start !important; /* Alinear al inicio en lugar de centro */
        align-items: flex-start; /* Alinear al inicio en lugar de centro */
        padding-top: 50px;
        height: 100vh;
    }

    #game-over-screen {
        align-items: center; /* Alinear al inicio en lugar de centro */
        justify-content: center !important;
    }
    
    .start-content, .game-over-content {
        overflow-y: hidden;
        padding: 20px;
        max-height: calc(100% - 70px); /* Limitar altura máxima */
        overflow-y: auto; /* Permitir scroll si el contenido es demasiado largo */
    }
    
    .start-content h1, .game-over-content h1 {
        font-size: 1.5rem; /* Reducir tamaño de título */
        margin-bottom: 15px;
    }
    
    .start-content p, .game-over-content p {
        font-size: 17px !important;
        line-height: 1.4;
        margin-bottom: 15px;
        margin-top: 15px;
        -webkit-text-size-adjust: none !important; /* Prevenir ajuste automático de texto en iOS */
        text-size-adjust: none !important; /* Estándar */
    }
    
    .game-tip {
        font-size: 0.8rem;
        padding: 8px 12px;
        margin: 10px 0 15px;
    }
    
    #start-game-btn, #continue-game-btn, #restart-game-btn, #main-menu-btn {
        padding: 10px 20px;
        font-size: 12px;
    }
    
    /* Corregir la sombra degradada de los botones en móvil */
    .action-btn:active, .room-btn:active {
        transform: translateY(0) !important;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }

    .action-btn:hover, .room-btn:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 5px var(--secondary-color);
        transform: translateY(0) !important;
    }

    .action-btn.hover {
        background-color: var(--button-color-2);
    }
        
    .room-btn.active {
        box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5), 0 0 3px var(--secondary-color);
        transform: translateY(0) !important;
    }
    
    /* Ajustar la transición para que sea más suave en móvil */
    .action-btn, .room-btn {
        transition: all 0.2s ease;
    }
    
    /* Deshabilitar el efecto de brillo animado en móviles que causa el desplazamiento */
    .action-btn::before, .room-btn::before {
        display: none; /* Eliminar completamente el efecto en móviles */
    }
    
    /* Alternativa: mantener un brillo estático en lugar de animado */
    .action-btn, .room-btn {
        background-image: linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0) 100%
        );
    }
    
    /* Asegurar que los botones tengan un efecto de pulsación claro sin animaciones problemáticas */
    .action-btn:active, .room-btn:active {
        transform: translateY(0);
        opacity: 0.8;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 0 5px rgba(0, 0, 0, 0.3);
        background-image: none;
    }

}

/* Asegurar que el media query para orientación landscape también mantenga el mismo tamaño */
@media (max-width: 768px) and (orientation: landscape) {
    .start-content p, .game-over-content p {
        font-size: 17px !important;
        -webkit-text-size-adjust: none !important;
        text-size-adjust: none !important;
    }
    
    /* Ajustar contenedores para mejor visualización en landscape */
    .start-content, .game-over-content {
        max-height: 80vh;
        overflow-y: auto;
        padding: 15px;
    }
}

/* Añadir regla específica para prevenir cambios de tamaño en cualquier orientación */
@media screen and (orientation: portrait), screen and (orientation: landscape) {
    .start-content p, .game-over-content p {
        font-size: 17px !important;
        -webkit-text-size-adjust: none !important;
        text-size-adjust: none !important;
    }
}

/* Toggle button for stats on mobile */
.stats-toggle {
    display: none;
    position: absolute;
    top: 10px;
    background-color: var(--button-color);
    color: var(--button-text);
    border: none;
    border-radius: 3px;
    width: 30px;
    height: 30px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    z-index: 11;
    font-family: 'Black Ops One';
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    padding: 0 10px;
    right: 30px; /* Position to the left of the stats toggle */
    display: block; /* Always show the music toggle button */
}

@media (max-width: 768px) {
    .stats-toggle {
        display: block;
        right: 15px; /* Position to the left of the stats toggle */
    }
    .game-conatiner {
        width: 100vw;
        height: 100vh;
    }
}

/* Glitch effect for titles */
@keyframes glitch {
    0% {
        transform: translate(0);
        text-shadow: 0 0 0 var(--secondary-color);
    }
    2% {
        transform: translate(-2px, 0);
        text-shadow: -2px 0 2px var(--secondary-color);
    }
    4% {
        transform: translate(2px, 0);
        text-shadow: 2px 0 2px var(--secondary-color);
    }
    6% {
        transform: translate(0, 2px);
        text-shadow: 0 2px 2px var(--secondary-color);
    }
    8% {
        transform: translate(0, -2px);
        text-shadow: 0 -2px 2px var(--secondary-color);
    }
    10% {
        transform: translate(0);
        text-shadow: 0 0 0 var(--secondary-color);
    }
    100% {
        transform: translate(0);
        text-shadow: 0 0 0 var(--secondary-color);
    }
}

.start-content h1, .game-over-content h1 {
    animation: glitch 10s infinite;
}

/* Añadir soporte específico para iOS */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        /* Usar variables CSS de iOS para safe areas */
        .ui-overlay {
            padding-bottom: env(safe-area-inset-bottom, 100px);
        }
        
        .bottom-ui-container {
            margin-bottom: env(safe-area-inset-bottom, 100px);
        }
        
        .overlay-screen {
            padding-bottom: env(safe-area-inset-bottom, 100px);
        }
        
        /* Asegurar que los botones no queden detrás de la barra de navegación */
        .action-buttons, .room-buttons {
            margin-bottom: 8px;
        }
    }
}

/* Añadir meta viewport para asegurar que se respeten las safe areas */
/* Esto debe ir en el HTML, pero lo incluyo como referencia:
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
*/

/* Añadir una clase para ocultar notificaciones inmediatamente sin animación */
.notification.immediate-hide {
    transition: none;
    opacity: 0;
    visibility: hidden;
}

/* Language Switcher Button */
.language-switcher {
    position: absolute;
    top: 30px;
    left: 10px;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    background-color: var(--button-color);
    color: var(--button-text);
    font-family: 'Black Ops One', cursive;
    font-size: 14px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--ui-glow);
    transition: all 0.3s ease;
}

.language-switcher:hover {
    background-color: var(--button-hover);
    transform: scale(1.05);
}

.language-switcher:active {
    transform: scale(0.95);
}

#time-advancement-container {
    top: unset;
    transform: translateY(0);
    bottom: 250px;
    width: 260px;
}

#time-advancement-label {
    font-size: 24px;
}

@media (max-width: 768px) {
    #time-advancement-container {
        top: 30%;
        width: 200px;
        bottom: unset;
        transform: translateY(-50%);
    }

    #time-advancement-label {
        font-size: 14px;
    }    

    .language-switcher {
        width: 35px !important;
        height: 35px !important;
        font-size: 12px;
        top: 5px;
        left: 5px;
        right: unset;
    }
}


.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--background-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.loading-screen h1 {
    color: var(--button-text);
    font-family: 'Black Ops One', cursive;
    font-size: 24px;
    text-align: center;
    margin-top: 30px;
}

.loading-screen p {
    color: var(--button-text);
    font-family: 'Apocalypse', 'Special Elite', 'Courier New', monospace;
    font-size: 24px;
    text-align: center;
}

.loader {
    width: 4px;
    height: 86px;
    background: #fff;
    margin: 0;
    position: relative;
    animation: shake 1s linear infinite alternate,
               lightup 1s linear infinite;
    transform-origin: 0 0;
  }
  
  .loader::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    width: 32px;
    height: 16px;
    box-sizing:border-box;
    border: 5px solid #FF3D00;
    border-top: none;
    border-radius: 0 0 20px 20px;
  }
  .loader::after {
    content: '';
    left: 50%;
    bottom: 0;
    position: absolute;
    transform: translateX(-50%);
    width: 64px;
    height: 32px;
    border-radius: 50px 50px 0 0;
    background: #fff;
  }
  
  @keyframes shake {
    0% { transform: rotate(10deg)  }
    100% { transform: rotate(-10deg)  }
  }
  @keyframes lightup {
    0% ,20% , 40% {
      opacity: 0
    }
    10%, 30% , 50% , 100% {
      opacity: 1
    }
  }
      

.retro-computer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.425);
    pointer-events: auto; /* Ensure pointer events work */
    opacity: 0;
    transition: all 0.4s ease;
    backdrop-filter: blur(0px);
}

.retro-computer.active {
    opacity: 1;
    backdrop-filter: blur(20px);
}

.main-computer {
    width: 100%;
    height: 100%;
    transform: scale(1);
    transition: all 0.4s ease;
    margin-top: 150vh;
    opacity: 0;
}

.main-computer.active {
    transform: scale(1);
    margin-top: 0;
    opacity: 1;
}


.computer-screen {
    position: absolute;
    top: 47%;
    left: 50%;
    transform: translate(-50%, -58%);
    width: 80%;
    height: 50%;
    max-width: 650px;
    line-height: 1.3rem;
    background-color: #000;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 
        /* Monitor interior glow */
        inset 0 0 20px rgba(0, 255, 0, 0.6),
        /* Plastic casing layers */
        0 0 0 15px #1a1a1a,
        0 0 0 16px #111,
        0 0 0 20px #2c2c2c,
        0 0 0 21px #333,
        /* Outer bevel effect */
        0 0 0 22px #222,
        0 0 0 23px #444,
        /* Screen curve effect */
        0 2px 30px rgba(0,0,0,0.8);
    overflow: hidden;
    border: 3px solid #555;
    /* Curved screen effect */
    background: 
        radial-gradient(
            circle at center,
            #000 40%,
            #111 100%
        );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: left;
}

.computer-screen-details {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 800px;
    height: 90%;
    background:
        /* Metallic base color */
        linear-gradient(45deg,
            #666768 0%,
            #bbbdc0 20%,
            #dddee0 40%,
            #bfc0c2 60%,
            #7e7e80 100%
        ),
        /* Brushed metal texture */
        repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.1) 0px,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px,
            transparent 5px
        ),
        /* Metal panel seams */
        repeating-linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.15) 0px,
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 30px
        ),
        /* Ventilation lines */
        repeating-linear-gradient(
            90deg,
            #555 0px,
            #555 2px,
            rgba(120, 130, 140, 0.8) 2px,
            rgba(120, 130, 140, 0.8) 10px
        );
    background-position:
        0 0,
        0 0,
        0 0,
        0 calc(100% - 20px); /* Position ventilation lines at bottom */
    background-size:
        100% 100%,
        100% 100%,
        100% 100%,
        100% 20px; /* Height of ventilation area */
    border-radius: 25px;
    /* Plastic texture effect */
    box-shadow:
        /* Outer plastic casing */
        inset 0 0 0 4px #4b4a4a,
        inset 0 0 0 10px #989999,
        /* Inner panel shadows */
        inset 5px 5px 25px rgba(0,0,0,0.2),
        inset -5px -5px 25px rgba(78, 78, 78, 0.5),
        /* Control panel LED lights */
        0 0 2px #000000,
        0 0 20px #000000,
        0 0 12px #0f0f0f;
    overflow: hidden;
    pointer-events: auto; /* Ensure pointer events work */
    text-align: left;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

@media (max-width: 768px) {
    .computer-screen-details {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

/* Add blinking LED lights */
.computer-screen-details::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    top: 30px;
    right: 30px;
    background: #ff0000;
    border-radius: 50%;
    animation: blinkLED 2s infinite;
    box-shadow: 
        -20px 0 0 #00ff00,
        -40px 0 0 #ffff00;
}

.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 0, 0.1),
        rgba(0, 255, 0, 0.1) 1px,
        transparent 2px,
        transparent 5px
    );
    pointer-events: none;
    animation: opacityAnimation 1s linear infinite;
    opacity: 0.7;
    touch-action: none;
    user-select: none;  
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

@keyframes opacityAnimation {
    0% { opacity: 0.7; }
    50% { opacity: 0.9; }
    100% { opacity: 0.7; }
}

/* Add retro switches and knobs */
.computer-screen-details::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    bottom: 20px;
    right: 20px;
    background: #888;
    border-radius: 50%;
    border: 3px solid #666;
    box-shadow: 
        inset 2px 2px 5px rgba(255,255,255,0.5),
        inset -2px -2px 5px rgba(0,0,0,0.3);
}

@keyframes blinkLED {
    0%, 100% { 
        opacity: 1; 
        background: #ff0000;
        box-shadow: -20px 0 0 #00ff00, -40px 0 0 #ffff00;
    }
    50% { 
        opacity: 0.3; 
        background: #cc0000;
        box-shadow: -20px 0 0 #00cc00, -40px 0 0 #cccc00;
    }
}

.computer-screen-ventilation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.computer-screen-content {
    height: 90%;
    color: #0f0;
    font-family: 'Special Elite', monospace;
    font-size: 1.2em;
    display: flex;
    flex-direction: column;
    align-items: left;
    justify-content: center;
    gap: 20px;
    text-align: left;
    overflow-y: auto;
    padding: 5px;
    margin-bottom: 20px;
    line-height: 1.8rem;
}

.computer-screen-content::-webkit-scrollbar {
    width: 3px;
}

.computer-screen-content::-webkit-scrollbar-thumb {
    background-color: #0f0;
}

.computer-screen-content p {
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
    margin: 3px 0;
}

.computer-screen input {
    background: rgba(0, 50, 0, 0.3);
    border: 1px solid #0f0;
    color: #0f0;
    padding: 8px 15px;
    font-family: 'Special Elite', monospace;
    width: 100%;
    text-align: center;
    outline: none;
    height: 44px;
    border-radius: 10px;
    font-size: 1.3rem;
}

.computer-screen-content button {
    background: rgba(0, 50, 0, 0.3);
    border: 1px solid #0f0;
    border-radius: 2px;
    color: #0f0;
    padding: 8px 20px;
    font-family: 'Special Elite', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    width: 100%;
}

.assistant-message, .user-message {
    text-align: left;
}

.computer-screen-content button:hover {
    background: rgba(0, 100, 0, 0.3);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}


@media (max-width: 768px) {
    .computer-screen {
        width: 80%;
        padding: 12px;
        height: 55%;
    }

    .computer-screen-content {
        font-size: 1em;
        line-height: 1.3rem;
    }
}

.computer-dirt {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url(../images/dirt.jpg);
    background-size: 50%;
    background-position: center;
    background-repeat: repeat;
    opacity: 0.04;
}

.computer-lines {
    position: absolute;
    top: 78%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.computer-lines span {
        position: relative;
        width: 500px;
    height: 3px;
    background-color: black;
    border-radius: 3px;
    opacity: 0.3;
}

@media (max-width: 768px) {
    .computer-lines span {
        width: 300px;
    }
}

.close-computer-btn {
    position: absolute;
    top: 10px;
    left: 15px;
    background-color: transparent;
    color: var(--button-color);
    border: none;
    border-radius: 25px;
    padding: 0px 13px;
    font-family: 'Black Ops One', cursive;
    font-size: 40px;
    cursor: pointer;
}

.close-computer-btn:hover {
    color: var(--background-color);
}

.close-computer-btn:active {
    color: var(--background-color);
}

@media (max-width: 768px) {
    .close-computer-btn:hover {
        color: var(--background-color);
    }

    .close-computer-btn:active {
        color: var(--background-color);
    }   
}

.command-buttons-container {
    position: relative;
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: opacity 0.3s ease;
}

.command-btn {
    color: #0f0;
    background-color: transparent;
    border: 2px solid #0f0;
    border-radius: 5px;
    padding: 8px 13px;
    font-family: 'Special Elite', monospace;   
    font-size: 20px;
    cursor: pointer;
    width: 33%;
}

.command-btn:hover {
    background-color: #0f0;
    color: #000;
}

.command-btn:active {
    background-color: #0f0;
    color: #000;
}

@media (max-width: 768px) {
    .command-btn:hover {
        color: #0f0;
        background-color: transparent;
    }
}

.time-container {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #0f0;
    font-family: 'Special Elite', monospace;
    font-size: 1rem;
    background-color: #000000bd;
}

@media (max-width: 768px) {
    .time-container {
        font-size: 0.8rem;
        top: 10px;
        right: 10px;
    }

    .command-btn {
        width: 33%;
        height: 32px;
        font-size: 1rem;
    }
}

/* Estilos para mensajes de respuesta correcta e incorrecta */
.system-message {
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 4px;
    font-family: 'VT323', monospace;
    font-size: 17px;
    line-height: 1.3;
    text-shadow: 0 0 5px currentColor;
    animation: glowPulse 2s ease-in-out 1;
}

.correct-answer {
    background-color: rgba(0, 128, 0, 0.3);
    color: #00ff00;
    border-left: 3px solid #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.incorrect-answer {
    background-color: rgba(128, 0, 0, 0.3);
    color: #ff6666;
    border-left: 3px solid #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.system-message strong {
    font-weight: bold;
    font-size: 110%;
    letter-spacing: 1px;
}

/* Estilos para preguntas en formato JSON */
.json-question {
    margin: 10px 0;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border-left: 3px solid #00ccff;
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.2);
}

.question-text {
    font-size: 17px;
    margin-bottom: 15px;
    color: #00ccff;
    text-shadow: 0 0 5px rgba(0, 204, 255, 0.5);
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.question-option {
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.question-option strong {
    color: #00ccff;
    margin-right: 8px;
}

@keyframes glowPulse {
    0% { opacity: 0; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

/* Settings Screen Styles */
.settings-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.settings-content {
    background-color: #1a1a1a;
    border: 2px solid #00ccff;
    border-radius: 8px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 0 20px rgba(0, 204, 255, 0.4);
    color: #ffffff;
    font-family: 'Apocalypse', 'Special Elite', 'Courier New', monospace;
}

.settings-content h1 {
    text-align: center;
    color: #00ccff;
    margin-bottom: 25px;
    font-family: 'Wasteland', 'Black Ops One', sans-serif;
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.7);
    font-size: 1.3rem;
}

.settings-options {
    margin-bottom: 30px;
}

.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.settings-option label {
    font-size: 0.8rem;
    color: #ffffff;
    font-family: 'Wasteland', 'Black Ops One', sans-serif;
}

.language-toggle {
    display: flex;
    gap: 10px;
}

.lang-btn {
    background-color: #333333;
    color: #ffffff;
    border: 1px solid #555555;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-family: 'Wasteland', 'Black Ops One', sans-serif;
}

.lang-btn.active {
    background-color: #00ccff;
    color: #000000;
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.7);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333333;
    transition: .4s;
    border-radius: 34px;
}

.toggle-switch label:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + label {
    background-color: #00ccff;
}

.toggle-switch input:checked + label:before {
    transform: translateX(26px);
}

.settings-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-buttons button {
    padding: 12px;
    border: none;
    border-radius: 5px;
    background-color: #333333;
    color: #ffffff;
    font-family: 'Wasteland', 'Black Ops One', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-buttons button:hover {
    background-color: #00ccff;
    color: #000000;
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.7);
}

#end-game-btn {
    background-color: #990000;
}

#end-game-btn:hover {
    background-color: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
}

/* Menu icon styles */
.menu-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

.menu-line {
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.stats-toggle {
    background-color: var(--button-color);
    border: none;
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stats-toggle:hover {
    background-color: var(--button-hover);
}

@media (max-width: 768px) {
    .stats-toggle:hover {
        background-color: var(--button-color);
    }
}

.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url(../images/bg.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    opacity: 0.8;
}

/* Add support for dynamic viewport units */
@supports (width: 1dvw) and (height: 1dvh) {
    body {
        height: 100dvh;
    }

    .game-container {
        width: 100dvw;
        height: 100dvh;
    }

    #renderCanvas {
        width: 100dvw;
        height: 100dvh;
    }

    .ui-overlay {
        width: 100dvw;
        height: 100dvh;
    }

    .overlay-screen {
        width: 100dvw;
        height: 100dvh;
    }

    #start-screen {
        width: 100dvw;
        height: 100dvh;
    }

    #game-over-screen {
        width: 100dvw;
        height: 100dvh;
    }

    .loading-screen {
        width: 100dvw;
        height: 100dvh;
    }

    .retro-computer {
        width: 100dvw;
        height: 100dvh;
    }

    .bg-image {
        width: 100dvw;
        height: 100dvh;
    }

    @media (max-width: 768px) {
        .game-container {
            width: 100dvw;
            height: 100dvh;
        }

        #renderCanvas {
            width: 100dvw;
            height: 100dvh;
        }

        .overlay-screen {
            height: 100dvh;
        }
    }
}