* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #080303;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 100%;
    max-height: 500px;
    background-color: #000;
    box-shadow: 0 0 35px rgba(255, 69, 0, 0.5);
    overflow: hidden;
    border-radius: 12px;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Modales y Pantallas */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 8, 4, 0.88);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    padding: 15px;
}

.overlay-screen.hidden {
    display: none !important;
}

.card {
    background: linear-gradient(145deg, #2b120a, #421808);
    border: 2px solid #ff6600;
    border-radius: 16px;
    padding: 22px 28px;
    width: 100%;
    max-width: 500px;
    text-align: center;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.title-main {
    font-size: 1.9rem;
    color: #ff6600;
    text-shadow: 0 0 12px rgba(255, 102, 0, 0.6);
    margin-bottom: 4px;
}

.title-sub {
    font-size: 1.5rem;
    color: #ffaa00;
    margin-bottom: 12px;
}

.title-dead {
    font-size: 1.7rem;
    color: #ff3300;
    margin-bottom: 8px;
}

.title-win {
    font-size: 1.7rem;
    color: #00ffcc;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

.inspiring-phrase {
    font-style: italic;
    color: #ffd2a6;
    background: rgba(0, 0, 0, 0.35);
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 3px solid #ffaa00;
    margin: 12px 0;
    font-size: 0.92rem;
    line-height: 1.4;
}

.subtitle {
    font-size: 0.9rem;
    color: #ffd2a6;
    margin-bottom: 18px;
}

/* Créditos */
.credits-box {
    background: rgba(0, 0, 0, 0.45);
    border-left: 4px solid #ff6600;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: left;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.credits-box strong {
    color: #ffaa00;
}

/* Instrucciones */
.instructions-content {
    background: rgba(0, 0, 0, 0.4);
    padding: 12px 15px;
    border-radius: 10px;
    text-align: left;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.instructions-content ul {
    list-style: none;
    margin-top: 6px;
}

.instructions-content li {
    margin-bottom: 6px;
}

.highscore-badge {
    background: #ffaa00;
    color: #1a0a00;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

/* Botones */
.btn-main {
    background: linear-gradient(90deg, #ff4500, #ff8700);
    color: white;
    border: none;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 69, 0, 0.5);
    transition: transform 0.15s;
}

.btn-main:hover {
    transform: scale(1.04);
}

.btn-main:active {
    transform: scale(0.96);
}

/* HUD Superior */
#hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    background: rgba(15, 5, 2, 0.75);
    border: 1px solid rgba(255, 102, 0, 0.4);
    padding: 8px 14px;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 5;
}

.hud-item span {
    color: #ffcc00;
}

.final-stats {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 8px;
    margin: 12px 0 18px 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.highlight-score {
    color: #00e5ff;
    font-weight: bold;
}

/* Botón Flotante para Celulares */
#mobile-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 6;
}

.touch-btn {
    background: rgba(255, 69, 0, 0.85);
    color: white;
    border: 2px solid #ffffff;
    padding: 16px 28px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.touch-btn:active {
    background: rgba(255, 120, 0, 1);
    transform: scale(0.95);
}

.hidden {
    display: none !important;
}