body, html {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    height: 100%;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 100vh; /* Usamos vh para el alto total */
    height: calc(var(--vh, 1vh) * 100); /* Fallback para navegadores que no soporten CSS variables */
    margin: 0 auto;
    background: linear-gradient(to bottom, #4a90e2, #7e57c2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#falling-letters {
    flex: 2;
    position: relative;
    overflow: hidden;
}

.falling-letter {
    position: absolute;
    font-size: 1.8em;
    color: #000000;
    background-color: #f0e68c;
    border: 2px solid #8b4513;
    border-radius: 5px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#virtual-keyboard {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: rgba(51, 51, 51, 0.9);
    padding: 10px 0;
    min-height: 33.33vh; /* Aseguramos que ocupe al menos 1/3 de la pantalla */
    min-height: calc(var(--vh, 1vh) * 33.33);
}

#info-bar {
    width: 100%;
    background-color: rgba(68, 68, 68, 0.9);
    color: #ffffff;
    text-align: center;
    padding: 5px;
    font-size: 1.2em;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-around;
}

#info-bar span {
    flex: 1;
}

.info-item {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 5px 10px;
}

.info-item .icon {
    margin-right: 5px;
}

#game-over-modal .modal-content {
    max-width: 400px;
}

#final-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(74, 144, 226, 0.1);
    border-radius: 10px;
    padding: 10px;
    min-width: 80px;
}

.stat-item .icon {
    margin-bottom: 5px;
}

#keyboard {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 5px 0;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    margin: 2px 0;
}

.key {
    background-color: #ffffff;
    border: none;
    margin: 2px;
    padding: 10px 15px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.key:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.key:active {
    background-color: #e0e0e0;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 80%;
}

.modal-content h2, .modal-content h3 {
    color: #333333;
    margin-bottom: 20px;
}

.modal-content p {
    margin-bottom: 20px;
    text-align: left;
    font-size: 1em;
    line-height: 1.5;
}

.modal-content ul {
    text-align: left;
    padding-left: 20px;
}

.modal-content li {
    margin-bottom: 10px;
}

.modal-content .highlight {
    font-weight: bold;
    color: #4a90e2;
}

.modal-content button {
    background-color: #4a90e2;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    margin-top: 20px;
    cursor: pointer;
    font-size: 1.1em;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.modal-content button:hover {
    background-color: #3a7bc8;
}

.use-vh {
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
}

@media (max-width: 768px) {
    .key {
        padding: 10px 15px;
        font-size: 1em;
    }

    #info-bar {
        font-size: 1em;
    }
    
    .info-item {
        padding: 3px 6px;
    }

    .info-item .icon {
        width: 20px;
        height: 20px;
    }

    .key {
        padding: 8px 12px;
        font-size: 0.9em;
    }

    .falling-letter {
        font-size: 1.5em;
        width: 30px;
        height: 30px;
    }
}