* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 900px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.game-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.game-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.game-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.level-info, .lives-info, .coins-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.hearts {
    display: flex;
    gap: 0.2rem;
}

.heart {
    font-size: 1.2rem;
    transition: opacity 0.3s ease;
}

.game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

.star:nth-child(1) {
    width: 3px;
    height: 3px;
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.star:nth-child(2) {
    width: 2px;
    height: 2px;
    top: 40%;
    left: 80%;
    animation-delay: 0.5s;
}

.star:nth-child(3) {
    width: 4px;
    height: 4px;
    top: 70%;
    left: 30%;
    animation-delay: 1s;
}

.star:nth-child(4) {
    width: 3px;
    height: 3px;
    top: 10%;
    left: 70%;
    animation-delay: 1.5s;
}

.star:nth-child(5) {
    width: 2px;
    height: 2px;
    top: 80%;
    left: 60%;
    animation-delay: 2s;
}

.star:nth-child(6) {
    width: 3px;
    height: 3px;
    top: 30%;
    left: 50%;
    animation-delay: 2.5s;
}

.star:nth-child(7) {
    width: 2px;
    height: 2px;
    top: 60%;
    left: 10%;
    animation-delay: 1.2s;
}

.star:nth-child(8) {
    width: 4px;
    height: 4px;
    top: 90%;
    left: 90%;
    animation-delay: 0.8s;
}

.game-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.juego {
    position: relative;
    overflow: hidden;
    margin: 2rem auto;
}

.fondo {
    table-layout: fixed;
    border-spacing: 0;
}

.fondo td {
    padding: 0;
}

.lava,
.actor {
    background: #e55;
}

.muro {
    background: #444;
    border: solid 3px #333;
    box-sizing: content-box;
}

.actor {
    position: absolute;
}

.moneda {
    background: #e2e838;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(226, 232, 56, 0.8);
}

.jugador {
    background: #335699;
    box-shadow: none;
    border-radius: 50%;
}

.perdido .jugador {
    background: #a04040;
}

.ganado .jugador {
    background: green;
}

.game-controls {
    display: none;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(78, 205, 196, 0.3);
    border: 2px solid #4ecdc4;
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:active {
    background: rgba(78, 205, 196, 0.6);
    transform: scale(0.95);
}

.game-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    font-size: 1.2rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
    pointer-events: none;
}

.game-message.show {
    opacity: 1;
}

.game-message.success {
    border: 2px solid #4ecdc4;
    color: #4ecdc4;
}

.game-message.warning {
    border: 2px solid #ff9f43;
    color: #ff9f43;
}

.game-message.error {
    border: 2px solid #ff6b6b;
    color: #ff6b6b;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .game-title {
        font-size: 1.2rem;
    }

    .game-info {
        gap: 1rem;
    }

    .level-info, .lives-info, .coins-info {
        font-size: 0.8rem;
    }

    .heart {
        font-size: 1rem;
    }

    .game-controls {
        display: flex;
    }
}