@import url('help_styles.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', monospace;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #0a1a2e 100%);
    min-height: 100vh;
    overflow: hidden;
    color: #fff;
}

/* === CONTENEDOR PRINCIPAL === */
#game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* === PANTALLA DE INICIO === */
#start-screen {
    background:
        radial-gradient(ellipse at center, rgba(255, 0, 128, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(0, 255, 255, 0.1) 0%, transparent 40%),
        linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #0a1a2e 100%);
}

.neon-title h1 {
    font-size: clamp(1rem, 4vw, 2.5rem);
    color: #ff00ff;
    text-shadow:
        0 0 5px #ff00ff,
        0 0 10px #ff00ff,
        0 0 20px #ff00ff,
        0 0 40px #ff00ff;
    animation: neon-pulse 2s infinite alternate;
    margin-bottom: 10px;
}

.neon-title h2 {
    font-size: clamp(0.8rem, 3vw, 1.8rem);
    color: #00ffff;
    text-shadow:
        0 0 5px #00ffff,
        0 0 10px #00ffff,
        0 0 20px #00ffff;
    animation: neon-pulse 2s infinite alternate-reverse;
}

@keyframes neon-pulse {
    from {
        opacity: 1;
        filter: brightness(1);
    }

    to {
        opacity: 0.8;
        filter: brightness(1.3);
    }
}

.subtitle {
    font-size: clamp(0.5rem, 2vw, 0.9rem);
    color: #ffaa00;
    margin: 20px 0;
    font-style: italic;
}

.instructions {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #ff00ff;
    border-radius: 10px;
    padding: 15px 25px;
    margin: 20px 0;
    max-width: 500px;
}

.instructions p {
    font-size: clamp(0.4rem, 1.5vw, 0.7rem);
    margin: 8px 0;
    color: #eee;
    line-height: 1.8;
}

.controls-info {
    margin: 15px 0;
}

.controls-info p {
    font-size: clamp(0.4rem, 1.2vw, 0.6rem);
    color: #aaa;
    margin: 5px 0;
}

/* === BOTONES NEÓN === */
.neon-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.6rem, 2vw, 1rem);
    padding: 15px 40px;
    margin-top: 20px;
    background: transparent;
    border: 3px solid #00ff00;
    color: #00ff00;
    cursor: pointer;
    text-shadow: 0 0 10px #00ff00;
    box-shadow:
        0 0 5px #00ff00,
        0 0 10px #00ff00,
        inset 0 0 5px rgba(0, 255, 0, 0.3);
    transition: all 0.3s ease;
    border-radius: 5px;
}

.neon-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    transform: scale(1.05);
    box-shadow:
        0 0 10px #00ff00,
        0 0 20px #00ff00,
        0 0 30px #00ff00,
        inset 0 0 10px rgba(0, 255, 0, 0.5);
}

.neon-btn.rainbow {
    animation: rainbow-border 3s linear infinite;
}

@keyframes rainbow-border {
    0% {
        border-color: #ff0000;
        color: #ff0000;
        text-shadow: 0 0 10px #ff0000;
        box-shadow: 0 0 10px #ff0000;
    }

    25% {
        border-color: #ffff00;
        color: #ffff00;
        text-shadow: 0 0 10px #ffff00;
        box-shadow: 0 0 10px #ffff00;
    }

    50% {
        border-color: #00ff00;
        color: #00ff00;
        text-shadow: 0 0 10px #00ff00;
        box-shadow: 0 0 10px #00ff00;
    }

    75% {
        border-color: #00ffff;
        color: #00ffff;
        text-shadow: 0 0 10px #00ffff;
        box-shadow: 0 0 10px #00ffff;
    }

    100% {
        border-color: #ff0000;
        color: #ff0000;
        text-shadow: 0 0 10px #ff0000;
        box-shadow: 0 0 10px #ff0000;
    }
}

/* === PANTALLA DEL JUEGO === */
#game-screen {
    padding: 0;
    background: #000;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    z-index: 10;
    flex-wrap: wrap;
    gap: 10px;
}

#score {
    font-size: clamp(0.5rem, 1.5vw, 0.8rem);
    color: #ffff00;
    text-shadow: 0 0 5px #ffff00;
}

#high-score {
    font-size: clamp(0.5rem, 1.5vw, 0.8rem);
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

#beer-level {
    display: flex;
    align-items: center;
    gap: 10px;
}

.beer-label {
    font-size: clamp(0.4rem, 1.2vw, 0.6rem);
    color: #ff9900;
}

.beer-bar {
    width: 150px;
    height: 20px;
    background: #333;
    border: 2px solid #ff9900;
    border-radius: 10px;
    overflow: hidden;
}

.beer-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6600, #ffcc00, #ff6600);
    transition: width 0.5s ease;
    box-shadow: 0 0 10px #ff9900;
}

.copa-count {
    font-size: clamp(0.5rem, 1.5vw, 0.7rem);
    color: #ffcc00;
}

#vision-status {
    font-size: clamp(0.4rem, 1.2vw, 0.6rem);
    color: #ff66ff;
    text-shadow: 0 0 5px #ff66ff;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.7;
    }
}

#game-canvas {
    display: block;
    background: #1a0a2e;
}

/* === CONTROLES TÁCTILES === */
#touch-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    z-index: 20;
}

.touch-row {
    display: flex;
    gap: 5px;
}

.touch-btn {
    width: 60px;
    height: 60px;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.touch-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

/* Mostrar controles táctiles en móvil */
@media (max-width: 768px),
(pointer: coarse) {
    #touch-controls {
        display: flex;
    }
}

/* === GAME OVER === */
#gameover-screen {
    background:
        radial-gradient(ellipse at center, rgba(255, 0, 0, 0.2) 0%, transparent 60%),
        linear-gradient(135deg, #1a0a0a 0%, #2e0a0a 50%, #1a0a0a 100%);
}

.gameover-title {
    font-size: clamp(1.2rem, 5vw, 3rem);
    color: #ff0000;
    text-shadow:
        0 0 10px #ff0000,
        0 0 20px #ff0000,
        0 0 40px #ff0000;
    animation: shake 0.5s infinite;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.gameover-msg {
    font-size: clamp(0.6rem, 2vw, 1rem);
    color: #ff6666;
    margin: 20px 0;
}

.final-score,
.final-copas {
    font-size: clamp(0.5rem, 1.5vw, 0.8rem);
    color: #ffcc00;
    margin: 10px 0;
}

/* === VICTORIA === */
#victory-screen {
    background:
        radial-gradient(ellipse at center, rgba(0, 255, 128, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse at 30% 70%, rgba(255, 215, 0, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #0a1a0a 0%, #0a2e1a 50%, #1a2e0a 100%);
}

.victory-title {
    font-size: clamp(1.2rem, 5vw, 3rem);
    color: #00ff00;
    text-shadow:
        0 0 10px #00ff00,
        0 0 20px #00ff00,
        0 0 40px #ffd700;
    animation: celebration 1s infinite;
}

@keyframes celebration {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.05) rotate(-2deg);
    }

    75% {
        transform: scale(1.05) rotate(2deg);
    }
}

.victory-msg {
    margin: 30px 0;
}

.victory-msg p {
    font-size: clamp(0.6rem, 2vw, 1rem);
    color: #ffff00;
    margin: 10px 0;
}

.quote {
    color: #ff66ff !important;
    font-style: italic;
}

.quote-end {
    color: #66ffff !important;
    font-size: clamp(0.5rem, 1.5vw, 0.8rem) !important;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .instructions {
        padding: 10px 15px;
    }

    .beer-bar {
        width: 80px;
        height: 15px;
    }

    #hud {
        justify-content: center;
        text-align: center;
    }

    .touch-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* === STORY SCREEN === */
#story-screen {
    background: #000;
    z-index: 100;
}

.story-content {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(20, 20, 50, 0.9) 100%);
    border: 4px solid #fff;
    border-radius: 15px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

#level-title {
    color: #ffcc00;
    font-size: clamp(1.5rem, 4vw, 3rem);
    text-shadow: 2px 2px 0px #ff0000;
    margin-bottom: 10px;
}

#level-subtitle {
    color: #aaa;
    font-family: sans-serif;
    text-transform: uppercase;
    letter-spacing: 5px;
    margin-bottom: 30px;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}

.story-text-container {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
}

#story-text {
    font-family: 'Courier New', monospace;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    line-height: 1.6;
    color: #fff;
    white-space: pre-wrap;
}

.objective-box {
    background: rgba(255, 0, 0, 0.2);
    border: 1px dashed #ff0000;
    padding: 15px;
    margin-top: 20px;
}

.objective-box p {
    color: #ff0000;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

#level-objective {
    color: #fff;
    font-size: 1.2rem;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.05);
    }
}

/* Level Start Button */
#start-level-btn {
    width: 100%;
    margin-top: 30px;
    font-size: 1.5rem;
}

/* Action Button */
.touch-btn.action {
    margin-left: 20px;
    width: 70px;
    height: 70px;
    font-size: 30px;
}