:root {
    --bg-color: #1a1a2e;
    --panel-color: #16213e;
    --text-color: #e94560;
    --accent-color: #0f3460;
    --border-color: #444;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: #fff;
    font-family: var(--font-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

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

header h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #fff;
    letter-spacing: 5px;
    text-shadow: 0 0 10px var(--text-color);
}

header h1 span {
    color: var(--text-color);
}

.game-layout {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Tablero */
.board-container {
    position: relative;
    border: 4px solid var(--border-color);
    background-color: #000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    line-height: 0;
}

canvas#game-board {
    display: block;
    max-width: 100%;
}

/* Overlay de Pausa/GameOver */
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s;
}

.hidden {
    display: none !important;
}

.overlay-content {
    text-align: center;
}

.overlay-content h2 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 20px;
}

/* Panel Lateral */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 200px;
}

.stat-box {
    background-color: var(--panel-color);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid var(--text-color);
}

.stat-box h3 {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.stat-box p {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.next-piece-container {
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.controls-info {
    font-size: 0.75rem;
    color: #888;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 5px;
}

/* Botones */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

button {
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    transition: all 0.2s;
    text-transform: uppercase;
}

#start-btn {
    background-color: var(--text-color);
    color: #fff;
}

#start-btn:hover {
    background-color: #ff5e78;
}

#pause-btn {
    background-color: var(--accent-color);
    color: #fff;
}

#pause-btn:disabled {
    background-color: #333;
    cursor: not-allowed;
}

#restart-btn-overlay {
    background-color: var(--text-color);
    color: #fff;
}

/* Responsive */
@media (max-width: 600px) {
    .game-layout {
        flex-direction: column;
        align-items: center;
    }
    
    .sidebar {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .stat-box:nth-child(1) { grid-column: span 2; }
    .controls-info { display: none; }
    
    header h1 {
        font-size: 2rem;
    }
}

/* Footer Compacto y Elegante */
footer {
    margin-top: 25px;
    padding: 15px;
    border-top: 1px solid rgba(233, 69, 96, 0.3);
    width: 100%;
    max-width: 800px;
    background: rgba(22, 33, 62, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-content p {
    margin: 0;
    font-size: 0.85rem;
}

.footer-content strong {
    color: var(--text-color);
}

.footer-content .subtitle {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 5px;
}

.contact-grid {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.contact-grid span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.contact-grid a {
    color: #aaa;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.contact-grid a:hover {
    color: var(--text-color);
    border-bottom-color: var(--text-color);
}

.license {
    font-size: 0.7rem;
    color: #666;
    margin-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

/* Ajuste general para evitar scroll excesivo */
.game-container {
    padding: 10px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}
