/* Estilos para Tetris PvP Online - Soporte multijugador */

/* Importar fuente Press Start 2P y Roboto para combinar pixel art con legibilidad */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Roboto:wght@300;400;500;700&display=swap');

/* Variables globales */
:root {
    /* Paleta de colores mejorada */
    --primary: #00ffaa;
    --primary-dark: #00cc88;
    --primary-light: #7fffcf;
    --secondary: #00ccff;
    --secondary-dark: #0099cc;
    --secondary-light: #7fe9ff;
    --accent: #ff3366;
    --accent-dark: #cc1a4b;
    --accent-light: #ff6b8f;
    --background: #0a0a14;
    --background-light: #121220;
    --background-dark: #07070d;
    --text-light: #ffffff;
    --text-dark: #aaaaaa;
    --text-muted: #777777;
    --danger: #ff3366;
    --success: #00cc88;
    --warning: #ffcc00;
    --info: #00ccff;
    
    /* Sombras y brillos refinados */
    --neon-glow: 0 0 10px rgba(0, 255, 170, 0.7), 0 0 20px rgba(0, 255, 170, 0.4);
    --subtle-glow: 0 0 8px rgba(0, 255, 170, 0.3);
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
    --inset-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
    
    /* Bordes y esquinas */
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-sm: 4px;
    
    /* Transiciones */
    --transition-speed: 0.3s;
    --transition-function: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Tamaño de los bloques - Calculado dinámicamente */
    --block-size: 36px;
    
    /* Espaciado */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Z-index */
    --z-background: -1;
    --z-default: 1;
    --z-header: 10;
    --z-overlay: 100;
    --z-modal: 1000;
    --z-popup: 2000;
    --z-notification: 3000;
}

/* Estilos base y reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Press Start 2P', cursive;
}

body {
    background: linear-gradient(135deg, var(--background) 0%, var(--background-light) 100%);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}


/* Overlay principal - cubre toda la pantalla */
#main-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--background);
    z-index: 1000;
    overflow: hidden; /* Cambiado de overflow-y: auto a overflow: hidden */
}

/* Secciones del overlay */
.overlay-section {
    display: none;
    width: 100%;
    height: 100%;
    padding: 20px;
    animation: fadeIn 0.5s ease-out;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    background: var(--background); /* Asegurar que cada sección tenga su propio fondo */
}

.overlay-section.active {
    display: block;
    z-index: 10; /* Añadido z-index para asegurar que la sección activa esté por encima */
}

/* Contenedores principales */
.cyber-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* Contenedor de múltiples jugadores para la sala de espera */
.multi-player-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    width: 100%;
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
}

/* Encabezados de sección */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 255, 170, 0.3);
    position: relative;
}

/* Títulos con estilo cyberpunk */
.cyber-title {
    font-size: 2.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
    text-shadow: var(--neon-glow);
    margin: 0;
    text-align: center;
    flex-grow: 1;
}

/* Títulos con estilo cyberpunk */
.cyber-subtitle {
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
    text-shadow: var(--neon-glow);
    margin: 0;
    text-align: center;
    flex-grow: 1;
}


.highlight-text {
    color: var(--primary);
    /*animation: pulse 2s infinite;*/
}

/* Línea decorativa neón */
.neon-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    width: 100%;
    max-width: 100px;
    margin: 10px 0;
    box-shadow: var(--neon-glow);
}

/* Estilos para Login/Registro */
#login-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

#login-section .cyber-container {
    max-width: 800px;
    backdrop-filter: blur(10px);
    background: rgba(10, 10, 20, 0.7);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(0, 255, 170, 0.2);
    box-shadow: var(--box-shadow), inset 0 0 30px rgba(0, 204, 255, 0.1);
    padding: 40px;
}

.login-options {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 30px;
}

.login-form, .guest-login {
    padding: 20px;
    background: rgba(18, 18, 32, 0.6);
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 255, 170, 0.1);   
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dark);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.cyber-input {
    width: 100%;
    background: rgba(10, 10, 20, 0.6);
    border: 2px solid var(--primary-dark);
    color: var(--text-light);
    padding: 12px 15px;
    font-size: 1rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
    outline: none;
}

.cyber-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.4);
}

.cyber-input::placeholder {
    color: rgba(170, 170, 170, 0.5);
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.cyber-button {
    background: linear-gradient(to bottom, rgba(0, 255, 170, 0.2), rgba(0, 255, 170, 0.1));
    color: var(--text-light);
    border: 2px solid var(--primary);
    border-radius: var(--border-radius);
    padding: 12px 25px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
    outline: none;
    min-width: 150px;
    text-align: center;
}

.cyber-button::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    background: linear-gradient(45deg, var(--primary), transparent, var(--primary));
    z-index: -1;
    animation: glowing 5s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
}

.cyber-button:hover::before {
    opacity: 1;
}

.cyber-button:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 170, 0.4);
}

.cyber-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 255, 170, 0.4);
}

.cyber-button.primary {
    background: linear-gradient(to bottom, rgba(0, 255, 170, 0.5), rgba(0, 255, 170, 0.3));
    border-color: var(--primary);
}

.cyber-button.secondary {
    background: linear-gradient(to bottom, rgba(0, 204, 255, 0.5), rgba(0, 204, 255, 0.3));
    border-color: var(--secondary);
}

.cyber-button.accent {
    background: linear-gradient(to bottom, rgba(255, 51, 102, 0.5), rgba(255, 51, 102, 0.3));
    border-color: var(--accent);
}

.cyber-button.danger {
    background: linear-gradient(to bottom, rgba(255, 51, 102, 0.5), rgba(255, 51, 102, 0.3));
    border-color: var(--danger);
}

.cyber-button.icon-button {
    min-width: auto;
    width: 46px;
    height: 46px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-dark);
    font-size: 0.8rem;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider::before {
    margin-right: 15px;
}

.divider::after {
    margin-left: 15px;
}

/* Estilos para el Lobby */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    position: relative;
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.5);
}

.user-name {
    font-size: 0.9rem;
    font-weight: bold;
}

.user-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
}

.user-status.online {
    background: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.7);
    animation: pulse 2s infinite;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

/* Estilos para badges de rol de usuario */
.user-role-badge {
    margin-left: 10px;
    padding: 4px 8px;
    font-size: 0.6rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    font-weight: bold;
}

.role-guest {
    background-color: rgba(180, 180, 180, 0.3);
    color: var(--text-light);
    border: 1px solid rgba(180, 180, 180, 0.5);
}

.role-registered {
    background-color: rgba(0, 255, 170, 0.2);
    color: var(--primary);
    border: 1px solid rgba(0, 255, 170, 0.4);
}

.role-moderator {
    background-color: rgba(0, 204, 255, 0.2);
    color: var(--secondary);
    border: 1px solid rgba(0, 204, 255, 0.4);
}

.role-admin {
    background-color: rgba(255, 51, 102, 0.2);
    color: var(--accent);
    border: 1px solid rgba(255, 51, 102, 0.4);
    box-shadow: 0 0 8px rgba(255, 51, 102, 0.3);
    animation: pulse 3s infinite;
}

/* Notificaciones */
/* Sistema de notificaciones mejorado */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    max-width: 90%;
    z-index: var(--z-notification);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    background: rgba(18, 18, 32, 0.95);
    color: var(--text-light);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: var(--card-shadow), 0 0 15px rgba(0, 0, 0, 0.5);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s var(--transition-function), opacity 0.4s var(--transition-function);
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 100%;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--primary);
    pointer-events: auto;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-content {
    flex-grow: 1;
    overflow: hidden;
}

.notification-title {
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--primary);
}

.notification-message {
    font-size: 0.8rem;
    overflow-wrap: break-word;
    line-height: 1.3;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    padding: 5px;
    margin: -5px;
    transition: color 0.2s;
    font-size: 1.2rem;
    line-height: 1;
}

.notification-close:hover {
    color: var(--text-light);
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    width: 100%;
    transform-origin: left;
}

.notification.success {
    border-left-color: var(--success);
}

.notification.success .notification-title {
    color: var(--success);
}

.notification.success .notification-progress {
    background: var(--success);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.error .notification-title {
    color: var(--danger);
}

.notification.error .notification-progress {
    background: var(--danger);
}

.notification.warning {
    border-left-color: var(--warning);
}

.notification.warning .notification-title {
    color: var(--warning);
}

.notification.warning .notification-progress {
    background: var(--warning);
}

.notification.info {
    border-left-color: var(--info);
}

.notification.info .notification-title {
    color: var(--info);
}

.notification.info .notification-progress {
    background: var(--info);
}

/* Lista de salas */
.room-list-container {
    margin-top: 20px;
}

.room-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    background: rgba(10, 10, 20, 0.6);
    border: 2px solid var(--secondary-dark);
    color: var(--text-light);
    padding: 12px 40px 12px 15px;
    font-size: 0.9rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

.search-box input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.4);
}

.search-box svg {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    stroke: var(--text-dark);
}

.filter-options {
    display: flex;
    gap: 10px;
}

.filter-button {
    background: rgba(10, 10, 20, 0.6);
    border: 1px solid rgba(0, 204, 255, 0.3);
    color: var(--text-dark);
    border-radius: var(--border-radius);
    padding: 10px 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.filter-button.active, .filter-button:hover {
    background: rgba(0, 204, 255, 0.2);
    color: var(--secondary);
    border-color: var(--secondary);
}

.room-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 10px;
}

.room-item {
    background: rgba(18, 18, 32, 0.6);
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 255, 170, 0.2);
    transition: all var(--transition-speed);
    overflow: hidden;
}

.room-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: var(--primary);
}

.room-header {
    background: rgba(10, 10, 20, 0.8);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 255, 170, 0.1);
}

.room-name {
    font-size: 1rem;
    margin: 0;
    color: var(--text-light);
}

.room-status {
    font-size: 0.7rem;
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(0, 255, 170, 0.2);
    color: var(--primary);
}

.room-item.playing .room-status {
    background: rgba(255, 51, 102, 0.2);
    color: var(--accent);
}

.room-info {
    padding: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.host-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.host-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--accent), var(--secondary));
}

.host-name {
    font-size: 0.8rem;
}

.room-details {
    grid-column: 1 / -1; /* Ocupa toda la fila */
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 10px;
}

.detail {
    font-size: 0.7rem;
    padding: 5px 10px;
    background: rgba(10, 10, 20, 0.4);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 5px;
}

.join-button, .spectate-button {
    grid-column: 1 / -1;
    background: linear-gradient(to bottom, rgba(0, 255, 170, 0.5), rgba(0, 204, 255, 0.3));
    color: var(--text-light);
    border: none;
    border-radius: var(--border-radius);
    padding: 10px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.spectate-button {
    background: linear-gradient(to bottom, rgba(255, 153, 0, 0.5), rgba(255, 102, 0, 0.3));
}

.join-button:hover, .spectate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Chat global del lobby */
.lobby-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    height: calc(100vh - 240px);
    overflow: hidden;
}

.global-chat-section {
    background: rgba(18, 18, 32, 0.6);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(0, 255, 170, 0.2);
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(100vh - 240px);
}

.global-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 255, 170, 0.2);
}

.global-chat-header h3 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--primary);
}

.online-count {
    font-size: 0.7rem;
    color: var(--text-dark);
}

#global-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: rgba(10, 10, 20, 0.4);
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}

.global-message {
    font-size: 0.8rem;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
    word-break: break-word;
}

.global-message.system {
    background: rgba(0, 204, 255, 0.1);
    border-left: 2px solid var(--secondary);
}

.global-message .message-author {
    font-weight: bold;
    color: var(--secondary);
    margin-right: 5px;
}

/* Media queries para responsive del lobby con chat */
@media (max-width: 992px) {
    .lobby-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        height: auto;
    }
    
    .global-chat-section {
        height: 300px;
        max-height: 300px;
    }
}

/* Estilos para creación de sala */
.create-room-form {
    background: rgba(18, 18, 32, 0.6);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    border: 1px solid rgba(0, 255, 170, 0.2);
}

.difficulty-options, .game-mode-options {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.difficulty-option, .game-mode-option {
    flex: 1;
    padding: 15px;
    background: rgba(10, 10, 20, 0.6);
    border: 2px solid rgba(0, 255, 170, 0.2);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-align: center;
}

.game-mode-option {
    padding: 20px 15px;
}

.difficulty-option:hover, .game-mode-option:hover {
    background: rgba(0, 255, 170, 0.1);
    border-color: var(--primary);
}

.difficulty-option input, .game-mode-option input {
    position: absolute;
    opacity: 0;
}

.difficulty-option input:checked + span, .game-mode-option input:checked + .mode-preview + span {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 255, 170, 0.7);
}

.difficulty-option input:checked ~ *, .game-mode-option input:checked ~ * {
    color: var(--primary);
}

.difficulty-option input:checked ~ *, .game-mode-option input:checked ~ * {
    color: var(--primary);
}

.difficulty-option input:checked + span::before, .game-mode-option input:checked + .mode-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--primary);
    border-radius: var(--border-radius);
    box-shadow: 0 0 15px rgba(0, 255, 170, 0.4);
    pointer-events: none;
    animation: pulse 2s infinite;
}

.difficulty-option span, .game-mode-option span {
    font-size: 0.8rem;
    transition: all var(--transition-speed);
}

.mode-preview {
    width: 100%;
    height: 100px;
    background-size: cover;
    background-position: center;
    border-radius: var(--border-radius);
    position: relative;
}

.mode-preview.classic {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48cmVjdCB4PSIxMCIgeT0iMTAiIHdpZHRoPSIzMCIgaGVpZ2h0PSI4MCIgZmlsbD0icmdiYSgwLDI1NSwxNzAsMC4zKSIvPjxyZWN0IHg9IjYwIiB5PSIxMCIgd2lkdGg9IjMwIiBoZWlnaHQ9IjgwIiBmaWxsPSJyZ2JhKDAsMjA0LDI1NSwwLjMpIi8+PHRleHQgeD0iNTAiIHk9IjUwIiBmb250LWZhbWlseT0iQXJpYWwiIGZvbnQtc2l6ZT0iMjAiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IndoaXRlIj52czwvdGV4dD48L3N2Zz4=');
}

.mode-preview.battle {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48cmVjdCB4PSIxMCIgeT0iMTAiIHdpZHRoPSIzMCIgaGVpZ2h0PSI4MCIgZmlsbD0icmdiYSgwLDI1NSwxNzAsMC4zKSIvPjxyZWN0IHg9IjYwIiB5PSIxMCIgd2lkdGg9IjMwIiBoZWlnaHQ9IjgwIiBmaWxsPSJyZ2JhKDAsMjA0LDI1NSwwLjMpIi8+PGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgcj0iMTUiIGZpbGw9InJnYmEoMjU1LDUxLDEwMiwwLjUpIi8+PHRleHQgeD0iNTAiIHk9IjUwIiBmb250LWZhbWlseT0iQXJpYWwiIGZvbnQtc2l6ZT0iMTAiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IndoaXRlIj4hPC90ZXh0Pjwvc3ZnPg==');
}

#create-room-confirm {
    margin-top: 30px;
    width: 100%;
}

/* Estilos para el formulario de unirse por código */
.join-by-code {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    align-items: center;
}

.join-by-code input {
    flex-grow: 1;
    text-transform: uppercase;
}

#join-code-input {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 2px;
}

/* Estilos para las opciones de tipo de juego */
.game-type-options {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.game-type-option {
    flex: 1;
    min-width: 200px;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background: rgba(30, 30, 40, 0.7);
    overflow: hidden;
}

.game-type-option:hover {
    border-color: #00aaff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 170, 255, 0.3);
}

.game-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.game-type-option input[type="radio"]:checked + .game-preview {
    box-shadow: 0 0 15px #00aaff, 0 0 30px #00aaff;
}

.game-type-option input[type="radio"]:checked ~ span:first-of-type {
    color: #00aaff;
    font-weight: bold;
}

.game-type-option input[type="radio"]:checked ~ span:last-of-type {
    color: #ffffff;
}

.game-type-option .game-preview {
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
    border-radius: 5px;
    background-size: cover;
    background-position: center;
    transition: all 0.3s ease;
}

.game-type-option .game-preview.tetris {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><rect x="30" y="30" width="20" height="20" fill="%2300f0f0"/><rect x="50" y="30" width="20" height="20" fill="%2300f0f0"/><rect x="70" y="30" width="20" height="20" fill="%2300f0f0"/><rect x="90" y="30" width="20" height="20" fill="%2300f0f0"/><rect x="30" y="50" width="20" height="20" fill="%230000f0"/><rect x="50" y="50" width="20" height="20" fill="%230000f0"/><rect x="70" y="50" width="20" height="20" fill="%230000f0"/><rect x="30" y="70" width="20" height="20" fill="%23f0a000"/></svg>');
}

.game-type-option .game-preview.columns {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><circle cx="60" cy="30" r="10" fill="%23ff0000"/><circle cx="60" cy="60" r="10" fill="%2300ff00"/><circle cx="60" cy="90" r="10" fill="%230000ff"/><circle cx="40" cy="50" r="10" fill="%23ffff00"/><circle cx="80" cy="40" r="10" fill="%23ff00ff"/><circle cx="40" cy="90" r="10" fill="%2300ffff"/><circle cx="40" cy="20" r="10" fill="%23ff00ff"/><circle cx="80" cy="70" r="10" fill="%23ffff00"/><circle cx="80" cy="100" r="10" fill="%23ff0000"/></svg>');
}

.game-type-option span:first-of-type {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.game-type-option span:last-of-type {
    font-size: 12px;
    text-align: center;
    color: #aaa;
    transition: color 0.3s ease;
}

/* Estilos para sala de espera */
.waiting-room-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.room-code {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    background: rgba(10, 10, 20, 0.6);
    padding: 8px 15px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 255, 170, 0.2);
}

#room-code {
    color: var(--primary);
    font-weight: bold;
    letter-spacing: 2px;
}

.players-section, .chat-section {
    background: rgba(18, 18, 32, 0.6);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    border: 1px solid rgba(0, 255, 170, 0.2);
}

.players-section h3, .chat-section h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 170, 0.2);
    color: var(--primary);
}

.players-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.player-slot {
    background: rgba(10, 10, 20, 0.5);
    border: 2px solid var(--primary-dark);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
    height: 100px;
}

.player-slot.host {
    border: 1px solid rgba(0, 255, 170, 0.3);
}

.player-slot.empty {
    opacity: 0.6;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.3);
}

.player-avatar.empty {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.player-info {
    flex: 1;
}

.player-name {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.player-status {
    font-size: 0.7rem;
    color: var(--primary);
}

.player-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    font-size: 0.6rem;
    padding: 5px 10px;
    background: rgba(0, 255, 170, 0.2);
    color: var(--primary);
    border-radius: 20px;
}

.ready-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.countdown {
    margin-top: 20px;
    text-align: center;
    font-size: 0.8rem;
}

.countdown-timer {
    display: block;
    font-size: 2rem;
    margin-top: 10px;
    color: var(--primary);
    /*animation: pulse 1s infinite;*/
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(10, 10, 20, 0.4);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    font-size: 0.8rem;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
    word-break: break-word;
}

.chat-message.system {
    background: rgba(0, 255, 170, 0.1);
    border-left: 2px solid var(--primary);
}

.message-author {
    font-weight: bold;
    color: var(--secondary);
    margin-right: 5px;
}

.message-time {
    color: var(--text-dark);
    font-size: 0.7rem;
    margin-right: 5px;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

.chat-input-container input {
    flex: 1;
    background: rgba(10, 10, 20, 0.6);
    border: 1px solid rgba(0, 255, 170, 0.3);
    color: var(--text-light);
    padding: 10px 15px;
    font-size: 0.8rem;
    border-radius: var(--border-radius);
}

.chat-input-container input:focus {
    border-color: var(--primary);
    outline: none;
}

/* Estilos para el juego principal */
#game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--background) 0%, var(--background-light) 100%);
}

#game-container.hidden {
    display: none;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(10, 10, 20, 0.8);
    border-bottom: 2px solid rgba(0, 255, 170, 0.2);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-one {
    flex-direction: row;
}

.player-two {
    flex-direction: row-reverse;
    text-align: right;
}

.player-name-container {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-size: 1rem;
    margin-bottom: 5px;
}

.player-stats {
    display: flex;
    gap: 15px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.label {
    font-size: 0.6rem;
    color: var(--text-dark);
}

.value {
    font-size: 0.8rem;
    color: var(--primary);
}

.match-info {
    text-align: center;
}

.match-timer {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 5px;
}

.match-status {
    font-size: 0.7rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-area {
    flex: 1;
    display: flex;
    padding: 20px;
    overflow: hidden;
    height: calc(100vh - 130px); /* Ajustado para aprovechar el máximo espacio vertical */
}

.sidebar {
    width: 180px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.next-piece-section, .attacks-section, .chat-section {
    background: rgba(18, 18, 32, 0.6);
    border-radius: var(--border-radius);
    padding: 15px;
    border: 1px solid rgba(0, 255, 170, 0.2);
}

.next-piece-section h3, .attacks-section h3, .chat-section h3 {
    font-size: 0.8rem;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(0, 255, 170, 0.2);
    color: var(--primary);
    text-align: center;
}

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

.attacks-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.attack-item {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.attack-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.3);
    transition: all var(--transition-speed);
    cursor: pointer;
}

.attack-icon:hover {
    transform: scale(1.1);
}

.attack-icon.shield {
    background-color: rgba(0, 255, 170, 0.3);
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDBmZmFhIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PHBhdGggZD0iTTEyIDIyczctOCA3LTExVjVsLTctMi02LjM5IDEuOEw1IDVsLjM5IDZMMTIgMjJ6Ii8+PC9zdmc+');
}

.attack-icon.bomb {
    background-color: rgba(255, 51, 102, 0.3);
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmYzMzY2IiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iOCIvPjxwYXRoIGQ9Ik0xMiAyVjQiLz48cGF0aCBkPSJNMTIgMjJWMjAiLz48cGF0aCBkPSJNNC45MyA0LjkzTDYuMzQgNi4zNCIvPjxwYXRoIGQ9Ik0xNy42NiAxNy42NkwxOS4wNyAxOS4wNyIvPjxwYXRoIGQ9Ik0yIDEySDQiLz48cGF0aCBkPSJNMjIgMTJIMjAiLz48cGF0aCBkPSJNNC45MyAxOS4wN0w2LjM0IDE3LjY2Ii8+PHBhdGggZD0iTTE3LjY2IDYuMzRMMTkuMDcgNC45MyIvPjwvc3ZnPg==');
}

.attack-count {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
}

.chat-section.minimized .chat-content {
    display: none;
}

.chat-section h3 {
    cursor: pointer;
}

.toggle-icon {
    float: right;
    transition: transform 0.3s;
}

.chat-section:not(.minimized) .toggle-icon {
    transform: rotate(45deg);
}

.boards-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    position: relative;
    height: 100%; /* Asegura que ocupa toda la altura disponible */
}

.board-wrapper {
    position: relative;
    height: 100%; /* Asegura que el wrapper ocupe toda la altura */
    display: flex;
    align-items: center;
    justify-content: center;
}

#player-one-canvas, #player-two-canvas {
    max-height: 100%;
    display: block;
    width: auto; /* Mantiene la relación de aspecto */
    height: auto;
}

.vs-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.vs-text {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent);
    text-shadow: 0 0 15px rgba(255, 51, 102, 0.7);
    /*animation: pulse 2s infinite;*/
    letter-spacing: 2px;
}

.attack-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 15px;
    background: rgba(255, 51, 102, 0.8);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: var(--border-radius);
    opacity: 0;
    animation: fadeInOut 1s forwards;
}

.attack-indicator.left {
    right: -60px;
}

.attack-indicator.right {
    left: -60px;
}

.attack-indicator.hidden {
    display: none;
}

.game-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(10, 10, 20, 0.8);
    border-top: 2px solid rgba(0, 255, 170, 0.2);
}

.controls-hint {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.hint-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.key-hint {
    padding: 5px 10px;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.7rem;
    min-width: 40px;
    text-align: center;
}

.hint-item span {
    font-size: 0.6rem;
    color: var(--text-dark);
}

/* Modal de Game Over */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(18, 18, 32, 0.95);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid rgba(0, 255, 170, 0.3);
    box-shadow: 0 0 30px rgba(0, 255, 170, 0.5);
    animation: modalAppear 0.5s forwards;
    display: flex;
    flex-direction: column;
}

/* Ajustes responsivos para el contenido del modal */
.result-animation {
    height: 20px; /* Reducido considerablemente de 200px */
    position: relative;
    margin-bottom: 10px; /* Reducido de 30px */
    flex-shrink: 0;
}

/* Mantener solo los estilos de los títulos */

#result-title.victory {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(0, 255, 170, 0.8);
    animation: victory-pulse 1s infinite alternate;
    font-size: 2.8rem;
    transform: perspective(500px) rotateX(10deg);
    letter-spacing: 5px;
}

#result-title.defeat {
    color: var(--danger);
    text-shadow: 0 0 20px rgba(255, 51, 102, 0.8);
    animation: defeat-pulse 1s infinite alternate;
    font-size: 2.8rem;
    transform: perspective(500px) rotateX(10deg);
    letter-spacing: 5px;
}

@keyframes victory-pulse {
    0% { text-shadow: 0 0 10px rgba(0, 255, 170, 0.5), 0 0 20px rgba(0, 255, 170, 0.2); transform: perspective(500px) rotateX(10deg) scale(1); }
    100% { text-shadow: 0 0 20px rgba(0, 255, 170, 1), 0 0 30px rgba(0, 255, 170, 0.7), 0 0 40px rgba(0, 255, 170, 0.4); transform: perspective(500px) rotateX(10deg) scale(1.05); }
}

@keyframes defeat-pulse {
    0% { text-shadow: 0 0 10px rgba(255, 51, 102, 0.5), 0 0 20px rgba(255, 51, 102, 0.2); transform: perspective(500px) rotateX(10deg) scale(1); }
    100% { text-shadow: 0 0 20px rgba(255, 51, 102, 1), 0 0 30px rgba(255, 51, 102, 0.7), 0 0 40px rgba(255, 51, 102, 0.4); transform: perspective(500px) rotateX(10deg) scale(1.05); }
}

/* Ajustes responsivos */
@media (max-width: 500px) {
    #result-title.victory,
    #result-title.defeat {
        font-size: 2rem;
        letter-spacing: 3px;
    }
}

/* Ajustes para el desplazamiento dentro del modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Ajustes adicionales para el modal de final de juego */
.match-statistics {
    flex-shrink: 0;
}

.chat-section {
    flex-shrink: 1;
    min-height: 150px;
    max-height: 375px;
    display: flex;
    flex-direction: column;
}

/* Asegurar que el chat ocupe el espacio disponible pero permita scroll */
#end-game-chat-messages {
    flex: 1;
    min-height: 80px;
    max-height: 250px;
}

.modal-actions {
    margin-top: 15px;
    flex-shrink: 0;
}

/* Asegurar que los botones tengan un tamaño adecuado en móvil */
@media (max-width: 500px) {
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-actions .cyber-button {
        width: 100%;
    }
}

.result-header {
    text-align: center;
    /*margin-bottom: 30px;*/
    position: relative;
}

#result-title {
    font-size: 2.5rem;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(0, 255, 170, 0.8);
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.match-statistics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.player-stats-column {
    background: rgba(10, 10, 20, 0.6);
    border-radius: var(--border-radius);
    padding: 15px;
}

.player-stats-column h3 {
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(0, 255, 170, 0.2);
    font-size: 0.9rem;
}

.player-stats-column.player-one h3 {
    color: var(--primary);
}

.player-stats-column.player-two h3 {
    color: var(--secondary);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.8rem;
}

.stat-label {
    color: var(--text-dark);
}

.stat-value {
    font-weight: bold;
    color: var(--text-light);
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* Estado del servidor */
.server-status-indicator {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.server-status-small {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    background: rgba(10, 10, 20, 0.6);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.server-status-small:hover {
    background: rgba(18, 18, 32, 0.8);
}

.server-status-small .status-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.server-status-small .status-text {
    font-size: 0.7rem;
}

.server-status-small .latency-indicator {
    margin-left: 8px;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
}

.server-status-small.online .status-icon {
    background: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.7);
    animation: pulse 2s infinite;
}

.server-status-small.offline .status-icon {
    background: var(--danger);
    box-shadow: 0 0 10px rgba(255, 51, 102, 0.7);
}

.server-status-small.reconnecting .status-icon {
    background: var(--secondary);
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.7);
    animation: pulse 1s infinite;
}

.latency-good {
    color: var(--primary);
}

.latency-medium {
    color: #ffcc00;
}

.latency-bad {
    color: var(--danger);
}

/* Popup de estado del servidor */
.server-status-popup {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 300px;
    background: rgba(18, 18, 32, 0.95);
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 255, 170, 0.3);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 2100;
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.server-status-popup.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 255, 170, 0.2);
}

.popup-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--primary);
}

.close-button {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-button:hover {
    color: var(--danger);
}

.popup-content {
    padding: 15px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.status-label {
    font-size: 0.8rem;
    color: var(--text-dark);
}

.status-value {
    font-size: 0.8rem;
    font-weight: bold;
}

.server-actions {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
}

#reconnect-button {
    font-size: 0.7rem;
    padding: 8px 12px;
}

/* Estilos para adaptar los tableros en vista móvil/estrecha */
.boards-container.mobile-view {
    flex-direction: column;
    gap: 50px; /* Más espacio entre los tableros cuando están apilados */
}

.boards-container.mobile-view .vs-indicator {
    top: auto; /* Anula la posición top previa */
    left: 50%;
    transform: translateX(-50%); /* Solo centrar horizontalmente */
    margin: 15px 0; /* Espacio entre los tableros */
}

.boards-container.mobile-view .attack-indicator.left {
    right: auto;
    left: 50%;
    bottom: -40px;
    top: auto;
    transform: translateX(-50%);
}

.boards-container.mobile-view .attack-indicator.right {
    left: 50%;
    top: -40px;
    bottom: auto;
    transform: translateX(-50%);
}

/* Ajustar dimensiones del área de juego en modo responsivo */
@media (max-width: 768px) {
    .game-area {
        height: auto; /* Permitir que crezca según el contenido en pantallas pequeñas */
        flex-direction: column;
        padding: 10px;
    }
    
    .boards-container {
        height: auto;
        min-height: 60vh; /* Al menos 60% de la altura visible */
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        justify-content: space-around;
        padding: 10px 0;
    }
    
    .next-piece-section, .attacks-section, .chat-section {
        width: 30%;
        min-width: 100px;
    }
}

/* Animaciones */
@keyframes modalAppear {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

@keyframes glowing {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(90deg);
    }
    50% {
        transform: rotate(180deg);
    }
    75% {
        transform: rotate(270deg);
    }
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translateY(-50%) scale(1.05);
    }
    30% {
        transform: translateY(-50%) scale(1);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Estilos para los estados del botón de revancha */
#rematch-button.waiting {
    background-color: #555;
    cursor: not-allowed;
}

#rematch-button.accept {
    background-color: #00b300;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 179, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 179, 0, 0.0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 179, 0, 0.0);
    }
}

/* Estilos para el overlay de cuenta regresiva de la revancha */
.rematch-countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.rematch-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    animation: pulse 0.5s infinite alternate;
}

.rematch-countdown-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 24px;
    margin-bottom: 20px;
    color: #ffcc00;
    text-shadow: 0 0 10px #ff6600;
}

.rematch-countdown-number {
    font-family: 'Press Start 2P', cursive;
    font-size: 72px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 15px #00ffff;
}

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

/* Media queries para responsive */
@media (max-width: 1200px) {
    .waiting-room-content {
        grid-template-columns: 1fr;
    }
    
    .game-area {
        padding: 10px;
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0 10px;
    }
    
    .next-piece-section, .attacks-section, .chat-section {
        width: 150px;
    }
    
    .boards-container {
        gap: 15px;
    }
    
    .game-header {
        padding: 10px;
    }
    
    .player-stats {
        gap: 8px;
    }
    
    .match-timer {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .cyber-title {
        font-size: 1.8rem;
    }
    
    .room-list {
        grid-template-columns: 1fr;
    }
    
    .game-mode-options, .difficulty-options {
        flex-direction: column;
    }
    
    .game-header {
        flex-wrap: wrap;
    }
    
    .player-info {
        width: 48%;
    }
    
    .match-info {
        width: 100%;
        order: -1;
        margin-bottom: 10px;
    }
    
    .boards-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .vs-indicator {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .vs-text {
        font-size: 1.8rem;
    }
    
    .controls-hint {
        display: none;
    }
    
    .match-statistics {
        grid-template-columns: 1fr;
    }
}