body {
    margin: 0;
    overflow: hidden;
    background-color: #1a1a1a;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
    transition: background-color 2s;
    /* Transição suave de cor de fundo */
}

#gameCanvas {
    display: block;
}

/* HUD */
#ui-layer {
    position: absolute;
    top: 10px;
    left: 10px;
    pointer-events: none;
    text-shadow: 2px 2px 2px #000;
    display: none;
    /* Hidden by default, shown by JS */
}

.bar-container {
    width: 220px;
    height: 22px;
    background: #222;
    border: 2px solid #444;
    margin-bottom: 5px;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 100%;
    transition: width 0.2s;
}

#hp-bar {
    background-color: #e74c3c;
}

#xp-bar {
    background-color: #3498db;
    width: 0%;
}

.stat-text {
    position: absolute;
    top: 0;
    left: 8px;
    font-size: 13px;
    line-height: 22px;
    font-weight: bold;
}

.info-box {
    font-size: 18px;
    font-weight: bold;
    margin-top: 5px;
    display: flex;
    gap: 15px;
}

/* Telas de Menu (Level Up, Game Over, Vitória) */
.overlay-screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 900px;
}

.card {
    background: #2c3e50;
    border: 2px solid #95a5a6;
    padding: 15px;
    width: 180px;
    height: 140px;
    cursor: pointer;
    text-align: center;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.card:hover {
    transform: scale(1.05);
    background: #34495e;
    border-color: #f1c40f;
}

.card h3 {
    color: #f1c40f;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.card p {
    font-size: 13px;
    color: #bdc3c7;
    margin: 0;
}

h1 {
    font-size: 50px;
    margin-bottom: 10px;
}

.btn {
    padding: 15px 40px;
    font-size: 22px;
    background: #27ae60;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    margin-top: 20px;
}

.btn:hover {
    background: #2ecc71;
}

/* Cores específicas para fases */
.stage-notice {
    position: absolute;
    top: 20%;
    width: 100%;
    text-align: center;
    font-size: 60px;
    color: white;
    text-shadow: 0 0 20px gold;
    opacity: 0;
    pointer-events: none;
}

.anim-stage {
    animation: fadeOut 4s forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    20% {
        opacity: 1;
        transform: scale(1.2);
    }

    80% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}