:root {
    --bg-color: #0d0d12;
    --ui-text: #e0e0e0;
    --accent-color: #c41e3a;
    --accent-glow: rgba(196, 30, 58, 0.6);
    --dim-color: #3a1a1a;
    --special-color-1: #4CAF50;
    --special-color-2: #2196F3;
    --special-color-3: #9C27B0;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--ui-text);
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    user-select: none;
    -webkit-user-select: none;
}

/* Tela de Introdução */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    background-image: url('../assets/backgrounds/imagem_fundo.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 200;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.screen-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid var(--accent-color);
    border-radius: 15px;
    box-shadow: 0 0 40px var(--accent-glow);
    max-width: 500px;
}

.screen-title {
    font-size: 32px;
    color: var(--accent-color);
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 20px var(--accent-glow);
}

.screen-subtitle {
    font-size: 18px;
    color: #ccc;
    margin: 0 0 15px 0;
    line-height: 1.6;
}

.screen-hint {
    font-size: 14px;
    color: var(--accent-color);
    margin: 0 0 25px 0;
    font-style: italic;
}

.btn-image {
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    max-width: 220px;
    height: auto;
}

.btn-image:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.btn-image:active {
    transform: scale(0.98);
}

/* Wrapper com imagem de fundo */
#game-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('../assets/backgrounds/imagem_fundo.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

#game-container {
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    border: 3px solid #c41e3a;
    border-radius: 8px;
    background: rgba(8, 8, 8, 0.95);
}

canvas {
    display: block;
    border-radius: 6px;
    cursor: pointer;
    touch-action: none;
    /* Prevent scroll on mobile */
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    padding: 20px;
    box-sizing: border-box;
}

#overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.overlay-title {
    font-size: 28px;
    color: var(--accent-color);
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 20px var(--accent-glow);
}

.overlay-text {
    font-size: 16px;
    color: #ccc;
    margin: 0 0 10px 0;
}

.overlay-highlight {
    font-size: 18px;
    color: var(--accent-color);
    margin: 0 0 25px 0;
    font-weight: bold;
}

.overlay-buttons {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.overlay-buttons .btn-image {
    max-width: 180px;
}

.btn {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 15px 40px;
    font-size: 18px;
    font-family: inherit;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    box-shadow: 0 0 15px rgba(255, 87, 34, 0.2);
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 0 30px rgba(255, 87, 34, 0.6);
}

#status-msg {
    font-size: 32px;
    margin-bottom: 20px;
    color: #fff;
}

/* Modal para canos especiais */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.visible {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: linear-gradient(135deg, #1a0a0a 0%, #2a1515 100%);
    border: 3px solid var(--accent-color);
    border-radius: 20px;
    padding: 0;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow:
        0 0 60px var(--accent-glow),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    animation: modalPop 0.4s ease;
    overflow: hidden;
}

@keyframes modalPop {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(180deg, rgba(196, 30, 58, 0.3) 0%, transparent 100%);
    padding: 30px 20px 20px 20px;
    border-bottom: 1px solid rgba(196, 30, 58, 0.3);
}

.modal-icon {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px currentColor);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px currentColor);
    }

    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 30px currentColor);
    }
}

.modal-body {
    padding: 25px 30px;
}

.modal-title {
    font-size: 32px;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 20px var(--accent-glow);
}

.modal-text {
    font-size: 16px;
    line-height: 1.8;
    color: #ddd;
}

.modal-footer {
    padding: 20px 30px 30px 30px;
}

.modal-btn {
    max-width: 180px;
}