@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
    margin: 0;
    overflow: hidden;
    background-color: #000; 
    color: #00ff00; 
    font-family: 'Press Start 2P', cursive; 
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    flex-direction: column;
    text-transform: uppercase; 
    background-image: radial-gradient(circle at top left, rgba(0, 255, 0, 0.1), rgba(0, 0, 0, 0.8) 50%),
                      radial-gradient(circle at bottom right, rgba(255, 0, 0, 0.1), rgba(0, 0, 0, 0.8) 50%);
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

#game-container {
    position: relative;
    border: 2px solid #f00;
    box-sizing: border-box;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

#menu-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #00ffff; 
    background-color: #1a0000; 
    border: 1px solid #f00; 
    padding: 5px 10px;
    font-size: 0.8em;
    cursor: pointer;
    z-index: 50; 
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
    transition: color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

#menu-icon:hover {
    color: #fff;
    border-color: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

#gameCanvas {
    display: block;
    background-color: #111;
}

#day-night-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent; 
    pointer-events: none; 
}

#journal {
    margin-top: 20px;
    width: 80%;
    max-width: 600px;
    height: 150px;
    overflow-y: auto;
    border: 1px solid #f00; 
    padding: 10px;
    font-size: 0.9em;
    background-color: #1a0000; 
    box-sizing: border-box;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.3); 
    scrollbar-width: none; 
    -ms-overflow-style: none;  
}

#journal::-webkit-scrollbar {
    display: none; 
}

.journal-entry {
    margin-bottom: 5px;
    line-height: 1.3;
    color: #00ffff; 
}

.glitch-effect {
    position: relative;
    border: 5px solid #f00;
    box-shadow: 0 0 20px #f00, 0 0 30px #0ff, 0 0 40px #f0f;
    animation: glitch-flicker 0.5s infinite linear alternate;
}

@keyframes glitch-flicker {
    0% { opacity: 1; transform: skewX(0); }
    50% { opacity: 0.8; transform: skewX(5deg); }
    100% { opacity: 1; transform: skewX(-5deg); }
}

/* Modal (Reward Popup) styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 100; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.8); 
    backdrop-filter: blur(5px); 
    justify-content: center; 
    align-items: center; 
    flex-direction: column; 
}

.modal-content {
    background-color: #040910; 
    color: #9ca3af; 
    margin: auto; 
    padding: 30px;
    border: 2px solid #f00; 
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.7); 
    width: 80%; 
    max-width: 700px; 
    height: 80%; 
    max-height: 600px; 
    text-align: center;
    position: relative; 
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    display: flex; 
    flex-direction: column; 
    align-items: center;
    box-sizing: border-box; 
}

/* Specific styles for the Web Icon Modal content */
#web-icon-popup .modal-content {
    padding: 20px; 
}

#web-icon-title {
     color: #9ca3af;
     margin-top: 0;
     margin-bottom: 15px;
     font-size: 1.2em;
}

#web-icon-iframe {
    width: 100%; 
    flex-grow: 1; 
    border: 1px solid #00ffff; 
    background-color: #fff; 
    margin-bottom: 15px; 
    box-sizing: border-box;
    min-height: 200px; 
}

/* Specific styles for the Settings Modal content */
#settings-popup .modal-content {
     padding: 30px;
     max-width: 400px; 
     max-height: 400px;
     height: auto; 
}

#settings-title {
    color: #9ca3af;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.settings-options {
    display: flex;
    flex-direction: column;
    gap: 15px; 
    width: 100%; 
    margin-bottom: 20px;
    align-items: center;
}

.close-button {
    color: #f00; 
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: #fff; 
    text-decoration: none;
}

#reward-title {
    color: #9ca3af; 
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
}

#reward-message {
    margin-bottom: 20px;
    font-size: 0.9em;
    line-height: 1.5;
}

/* Style the button container */
.button-container {
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    width: 100%; 
    margin-top: auto; 
    flex-wrap: wrap;
}

#reward-continue,
#web-icon-close,
#web-icon-visit,
#settings-close-button,
#sound-toggle-button 
{
    background-color: #00ff00; 
    color: #000; 
    border: none;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9em; 
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5); 
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    flex-shrink: 0; 
}

#reward-continue:hover,
#web-icon-close:hover,
#web-icon-visit:hover,
#settings-close-button:hover,
#sound-toggle-button:hover 
{
    background-color: #33ff33;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.8);
}