@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Press Start 2P', cursive;
    image-rendering: pixelated;
}

body {
    background-color: #000;
    color: #fff;
    overflow: hidden;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    padding-top: 60px; /* Espaço para o header fixo */
}

/* Identidade Visual Fixa e Controle de Áudio */
#fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 60px;
    background-color: rgba(0, 0, 0, 0.95);
    border-bottom: 4px solid #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    z-index: 1000;
}

#game-title {
    font-size: 1rem;
    color: #fff;
    text-shadow: 2px 2px #ff0000;
    flex-shrink: 0;
}

#audio-toggle {
    background: #fff;
    border: 2px solid #000;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 2px 2px #888;
    flex-shrink: 0;
}

#audio-toggle:hover {
    background-color: #ddd;
}

.instruction-text {
    font-size: 0.8rem;
    font-weight: bold;
    color: #ffff00;
    margin: 20px 0 10px 0;
    line-height: 1.4;
}

.screen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.0s ease, visibility 1.0s;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* Backgrounds */
#screen-menu {
    background-image: url('/images/menu.png');
}

/* Desktop Backgrounds */
@media (min-width: 769px) {
    #screen-welcome {
        background-image: url('/images/boas_vindas.png');
    }

    #screen-agenda, #screen-game, #screen-day-end, #screen-week-end {
        background-image: url('/images/mapa.png');
    }
}

/* Mobile Backgrounds */
@media (max-width: 768px) {
    #screen-welcome {
        background-image: url('/images/boas_vindas_mobile.png');
    }

    #screen-agenda, #screen-game, #screen-day-end, #screen-week-end {
        background-image: url('/images/mapa_mobile.png');
    }
}

.overlay {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border: 4px solid #fff;
    border-radius: 0;
    text-align: center;
    max-width: 80%;
    box-shadow: 0 0 0 4px #000, 0 0 0 8px #fff;
}

h1 {
    font-size: 3rem;
    margin-bottom: 40px;
    text-shadow: 4px 4px #ff0000;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

p {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

button {
    background-color: #fff;
    color: #000;
    border: 4px solid #000;
    padding: 15px 30px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 4px 4px #888;
    margin-top: 20px;
}

button:hover {
    background-color: #ddd;
    box-shadow: 2px 2px #555;
    transform: translate(2px, 2px);
}

button:active {
    box-shadow: 0 0;
    transform: translate(4px, 4px);
}

/* HUD Integrado */
#hud {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background-color: transparent;
    padding: 0;
    border: none;
    flex: 1;
}

.hud-item {
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    color: #fff;
}

.progress-bar {
    width: 150px;
    height: 15px;
    background-color: #444;
    border: 2px solid #fff;
    margin: 0 10px;
    position: relative;
    flex-shrink: 0;
}

#security-level-bar {
    height: 100%;
    background-color: #00ff00;
    transition: width 0.3s ease;
}

/* Dialog Box */
.dialog-box {
    background-color: rgba(0, 0, 0, 0.85);
    border: 4px solid #fff;
    padding: 30px;
    width: 80%;
    max-width: 800px;
    margin-top: 100px;
}

.dialog-box h3 {
    margin-bottom: 15px;
    color: #ffff00;
}

#checklist-container {
    margin: 20px 0;
    text-align: left;
    background-color: #222;
    padding: 15px;
    border: 2px dashed #fff;
}

#checklist-list {
    list-style: none;
    margin-top: 10px;
}

#checklist-list li {
    font-size: 0.7rem;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
}

#checklist-list li::before {
    content: '[ ] ';
    margin-right: 10px;
    color: #00ff00;
}

#agenda-list {
    list-style: none;
    text-align: left;
    margin-bottom: 20px;
}

#agenda-list li {
    font-size: 0.8rem;
    margin-bottom: 10px;
}

#choices-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.choice-button {
    background-color: #333;
    color: #fff;
    border: 2px solid #fff;
    padding: 10px;
    font-size: 0.7rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

.choice-button:hover {
    background-color: #555;
}

.feedback-box {
    margin-top: 20px;
    padding: 15px;
    border: 4px double #fff;
    background-color: #002200;
}

#feedback-text {
    font-size: 0.8rem;
    margin-bottom: 15px;
    color: #00ff00;
}

.final-score {
    font-size: 1.2rem;
    color: #00ff00;
    margin: 20px 0;
}

.evaluation-text {
    font-size: 1rem;
    color: #ffff00;
    margin-bottom: 30px;
    line-height: 1.4;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }

    #game-container {
        height: auto;
        min-height: 100vh;
    }

    .screen {
        height: auto;
        min-height: 100vh;
        position: relative; /* Mudança para permitir scroll natural */
        padding-bottom: 50px;
    }
    
    .screen:not(.active) {
        display: none; /* Evita que telas inativas ocupem espaço com position: relative */
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    p, .hud-item, button, .choice-button, #feedback-text, .instruction-text {
        font-size: 0.7rem;
    }

    .overlay {
        padding: 20px;
        width: 95%;
        max-width: none;
    }

    #fixed-header {
        flex-wrap: wrap;
        padding: 5px 10px;
        justify-content: space-between;
        align-items: center;
        gap: 5px;
    }

    #game-title {
        font-size: 0.7rem;
        flex: 1;
        text-align: center;
        margin-bottom: 5px;
        padding-left: 30px; /* Espaçamento para equilibrar com o botão de áudio à direita */
    }

    #hud {
        width: 100%;
        order: 3;
        padding: 5px 0;
        gap: 10px;
        justify-content: space-around;
        border-top: 1px solid rgba(255,255,255,0.2);
    }

    #audio-toggle {
        position: static;
        width: 30px;
        height: 30px;
        font-size: 1rem;
        order: 2;
    }

    .progress-bar {
        width: 100px;
    }

    .dialog-box {
        width: 95%;
        padding: 15px;
        margin-top: 130px; /* Ajustado para compensar header maior */
    }

    .choice-button {
        padding: 12px;
    }

    button {
        width: 100%;
        margin-top: 10px;
    }
}
