.game {
    --color-principal: #009251;
    --color-secundario: #FFD83B;
    display: flex;
    flex-direction: column;
    justify-content: center;
    justify-items: center;
    margin-bottom: 30px;
    font-family: 'Roboto Condensed', sans-serif;
}

.game #startScreen {

    background-color: var(--color-principal);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 15px;
    padding: 20px;
    align-self: center;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

#startScreen h4 {
    font-size: 1.2rem;
    margin-top: 10px;
    margin-bottom: 0;
    color: var(--color-secundario);
    text-align: center;
}

#startScreen h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--color-secundario);
}

#gameScreen {
    display: none;
    justify-items: center;
}

#startScreen p {
    font-size: 1.1rem;
    line-height: 1.4;
    margin: 10px 0;
    color: #fff;
    text-align: center;
    margin: 5px;
}

@media (max-width: 992px) {
    #startScreen h2 {
        font-size: 1.8rem;
    }

    #startScreen p {
        font-size: 1.1rem;
    }

}

#startScreen .highlight {
    color: var(--color-secundario);
    font-weight: bold;
}

.keys {
    font-weight: bold;
    color: #fff;
    text-align: center;
}

#startButton {
    background: var(--color-secundario);
    color: var(--color-principal);
    border: none;
    padding: 10px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    margin: 1rem 0 0;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.6);
    position: relative;
    z-index: 9999;
    pointer-events: auto;
    /* Asegúrate de que el botón pueda recibir eventos */
    touch-action: manipulation;
}

#startButton:hover {
    background: var(--color-secundario);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.9);
}



#gameInfo {
    display: flex;
    justify-content: space-evenly;
    width: 100%;
    padding: 0 10px;
}


#endScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 10, 30, 0.95);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    border-radius: 15px;
    padding: 20px;
}

#endScreen h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: center;
}

#finalScore {
    font-size: 2rem;
    margin: 20px 0;
    color: #ffcc00;
}

#resultMessage {
    font-size: 2.2rem;
    margin-bottom: 30px;
    text-align: center;
    padding: 0 20px;
}

#restartButton {
    background: linear-gradient(to bottom, #4CAF50, #2E7D32);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
}

#restartButton:hover {
    background: linear-gradient(to bottom, #66BB6A, #388E3C);
    transform: scale(1.05);
}



.instructions {
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 10px;
    max-width: 600px;
    text-align: left;
}

.instructions h3 {
    color: #ffcc00;
    margin-bottom: 10px;
}

.instructions ul {
    padding-left: 25px;
}

.instructions li {
    margin: 8px 0;
    line-height: 1.5;
}

.key__button {
    box-sizing: border-box;
    font-size: 20px;
    text-align: center;
    width: 40px;
    height: 50px;
    color: var(--color-principal);
    cursor: pointer;
    margin: 0 8px;
    border-color: #f2f2f2;
    border-style: solid;
    text-shadow: 0 0.5px 1px #777, 0 2px 6px #f2f2f2;
    border-width: 1px;
    border-radius: 10px;
    background: -webkit-linear-gradient(top, #f7fab8 0%, #fee43e 80%, #faca3b 100%);
    display: inline-block;
    transition: box-shadow 0.3s ease, transform 0.15s ease;
    box-shadow: 0 0 1px #888, 0 1px 0 #fff, 0 6px 0 #C0C0C0, 0 8px 17px rgba(#444, 0.4), 2px 1px 4px rgba(#444, 0.25), -2px 1px 4px rgba(#444, 0.25), 0 9px 16px rgba(#444, 0.1);

    &:hover,
    &:focus {
        box-shadow: 0 0 1px #888, 0 1px 0 #fff, 0 4px 0 #C0C0C0, 0 2px 35px rgba(#444, 0.3), 2px 2px 4px rgba(#444, 0.25), -2px 2px 4px rgba(#444, 0.25), 0 7px 4px rgba(#444, 0.1);
        transform: translateY(2px);
    }

    &:active {
        box-shadow: 0 0 1px #888, 0 1px 0 #fff, 0 0 0 #C0C0C0, 0 0px 30px rgba(#444, 0.15), 2px 2px 4px rgba(#444, 0.25), -2px 2px 4px rgba(#444, 0.25), 0 0px 4px rgba(#444, 0.25);
        transform: translateY(4px);
    }
}

.spacebar {
    width: 50px;
    border-radius: 50%;
    background: -webkit-linear-gradient(top, #7fa440 0%, #4b8f58 80%, #55a72b 100%);
    border: 3px solid #fadc6b;
}

.keys-left,
.keys-right {
    display: flex;
}

.keys-pad {
    display: flex;
    width: 95%;
    justify-content: space-around;
    align-items: center;
    margin-top: 20px;
    flex-direction: row;
}

.no-zoom {
    touch-action: manipulation;
}

@media (min-width: 992px) {
    .keys-pad {
        display: none;
    }
}



.container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

header {
    text-align: center;
    margin-bottom: 10px;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #00f7ff, 0 0 20px #00b3ff;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.2rem;
    color: #a0d2eb;
    max-width: 600px;
    line-height: 1.6;
}

.game-container {
    position: relative;
    width: 800px;
    height: 450px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(74, 74, 243, 0.5);
}

/* Media query para pantallas móviles (hasta 850px de ancho) */
@media (max-width: 850px) {
    .game-container {
        height: 600px;
        /* Ajustar la altura del canvas a 600px en dispositivos móviles */
    }
}

canvas {
    background: radial-gradient(circle at center, #0d0d2e 0%, #000 70%);
}

.stats {
    display: flex;
    justify-content: space-between;
    width: 800px;
    background: rgba(10, 10, 40, 1);
    padding: 15px 25px;
    border-radius: 10px;
    border: 1px solid #009251;
    margin-bottom: 4px;
}

.stat-box {
    text-align: center;
    color: white;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffcc00;
}

.controls {
    display: flex;
    justify-content: space-between;
    width: 800px;
    margin-top: 10px;
}

.control-group {
    background: rgba(20, 20, 60, 0.7);
    border-radius: 10px;
    padding: 20px;
    width: 48%;
    border: 1px solid #009251;
}

.control-group h3 {
    color: #ffcc00;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.4rem;
}



.instructions {
    background: rgba(20, 20, 60, 0.7);
    border-radius: 10px;
    padding: 20px;
    width: 800px;
    margin-top: 10px;
    border: 1px solid #009251;
}

.instructions h3 {
    color: #ffcc00;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.4rem;
}

.instructions ul {
    padding-left: 20px;
    line-height: 1.8;
}

.instructions li {
    margin-bottom: 8px;
}

.highlight {
    color: #ffcc00;
    font-weight: bold;
}

@media (max-width: 850px) {

    .game-container,
    .stats,
    .controls,
    .instructions {
        width: 95%;
        max-width: 800px;
        height: auto;
    }


}

.canvas-wrapper {
    width: 100%;
    height: auto;
    margin: 0 auto;
    aspect-ratio: 16/9;
}

@media (max-width: 850px) {
    .canvas-wrapper {
        aspect-ratio: 4/3;
        /* Ajustar la altura del canvas a 600px en dispositivos móviles */
    }
}

.canvas-wrapper .vb-canvas {
    width: 100%;
    height: 100%;
}

.rediEncabezado {
    text-align: left !important;
}