body {
    background: #1a1a1a;
    background: radial-gradient(circle, #2c3e50 0%, #000 100%);
    color: #fff;
    font-family: 'Segoe UI', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

.main-container {
    display: flex;
    gap: 20px;
    align-items: stretch;
    background: rgba(44, 62, 80, 0.4);
    padding: 25px;
    border-radius: 20px;
    border: 4px solid #555;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
    transition: transform 0.1s;
}

/* Paneles laterales */
.panel {
    background: #111;
    border: 2px solid #666;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 140px;
    box-shadow: inset 0 0 15px #000;
}

.panel h2 {
    font-size: 0.8rem;
    margin: 0 0 8px 0;
    color: #3498db;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: bold;
    color: #fff;
}

#next-canvas {
    background: #000;
    border-radius: 8px;
    margin-top: 5px;
}

/* Ranking */
.ranking-list {
    width: 100%;
    font-size: 0.8rem;
    padding: 0;
    margin: 10px 0 0 0;
    list-style: none;
}

.ranking-list li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #333;
}

.ranking-list li span {
    color: #f1c40f;
}

/* Área de Juego */
.canvas-container {
    position: relative;
    line-height: 0;
}

#tetris {
    border: 4px solid #888;
    border-radius: 8px;
    background: #000;
    transition: background-color 0.2s;
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 4px;
    text-align: center;
}

.flex {
    display: flex;
}

/* Botones y Menú */
.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
    width: 100%;
}

button {
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #27ae60;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
    font-size: 0.8rem;
}

button:hover {
    background: #2ecc71;
    transform: scale(1.05);
}

button.secondary {
    background: #2980b9;
}

button.multi {
    background: #8e44ad;
}

button.danger {
    background: #c0392b;
}

input {
    padding: 12px;
    border-radius: 5px;
    border: 2px solid #555;
    margin-bottom: 15px;
    text-align: center;
    background: #111;
    color: #fff;
    width: 200px;
    outline: none;
}

input:focus {
    border-color: #2ecc71;
}

.error-msg {
    color: #e74c3c;
    font-size: 0.8rem;
    margin-bottom: 10px;
    display: none;
}

/* Guía Controles */
.controls-list {
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.controls-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.7rem;
    color: #ccc;
    border-bottom: 1px solid #222;
    padding-bottom: 3px;
}

.key {
    display: inline-block;
    background: #333;
    border: 1px solid #555;
    border-bottom: 2px solid #000;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    color: #fff;
    font-size: 0.7rem;
}

/* TEXTO FLOTANTE (Feedback) */
.feedback-text {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 40%;
    font-size: 2rem;
    font-weight: 900;
    color: #f1c40f;
    text-shadow: 0 0 10px #000, 0 0 20px #f39c12;
    pointer-events: none;
    z-index: 200;
    animation: popOut 1s forwards;
    display: none;
}

@keyframes popOut {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    20% {
        transform: scale(1.2);
        opacity: 1;
    }

    80% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.flash {
    background-color: rgba(255, 255, 255, 0.3) !important;
}

.shake {
    animation: shake 0.2s;
}

@keyframes shake {
    0% {
        transform: translate(0);
    }

    25% {
        transform: translate(5px, 5px);
    }

    50% {
        transform: translate(-5px, -5px);
    }

    75% {
        transform: translate(5px, -5px);
    }

    100% {
        transform: translate(0);
    }
}