/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    min-height: 100dvh;
    color: #ffffff;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    padding-top: calc(var(--safe-top) + 14px);
    padding-bottom: calc(var(--safe-bottom) + 10px);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Fondo misterioso con patrones sutiles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Patrones de espionaje sutiles */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 24px 18px 28px;
}

/* Pantallas */
.pantalla {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.pantalla.activa {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 64px 20px 36px 20px; /* más espacio arriba para status bar iOS */
    border-radius: 20px;
    border: 1px solid #333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.header h1 {
    font-size: clamp(2.2rem, 4vw + 1rem, 2.8rem);
    margin-bottom: 12px;
}

.header .subtitle {
    font-size: clamp(1.1rem, 3vw + 0.4rem, 1.4rem);
}

.header-top {
    position: absolute;
    top: 15px;
    right: 20px;
}

.btn-volver-inicio {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #0a0a0a;
    border: 1px solid rgba(0, 212, 255, 0.6);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(0, 212, 255, 0.35);
}

.btn-volver-inicio:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 212, 255, 0.45);
    background: linear-gradient(135deg, #00b8e6, #0088b3);
}

.btn-volver-inicio i {
    font-size: 1rem;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00d4ff, #0099cc, #00d4ff);
    background-size: 200% 100%;
    animation: headerGlow 3s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.header h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    font-weight: 800;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    letter-spacing: -2px;
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.8;
    color: #b0b0b0;
    font-weight: 500;
}

/* Configuración */
.configuracion {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid #333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.configuracion::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    opacity: 0.7;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #ffffff;
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #333;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #1a1a1a;
    color: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.input-group input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.3);
    background: #2a2a2a;
}

.input-group input::placeholder {
    color: #666;
}

/* Botones */
.btn-principal, .btn-secundario {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn-principal {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #0a0a0a;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
    border: 1px solid #00d4ff;
    position: relative;
    overflow: hidden;
}

.btn-principal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-principal:hover::before {
    left: 100%;
}

.btn-principal:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.6);
    background: linear-gradient(135deg, #00b8e6 0%, #0088b3 100%);
}

.btn-secundario {
    background: transparent;
    color: #00d4ff;
    border: 2px solid #00d4ff;
    position: relative;
    overflow: hidden;
}

.btn-secundario::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #00d4ff;
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-secundario:hover::before {
    width: 100%;
}

.btn-secundario:hover {
    color: #0a0a0a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

#btn-iniciar {
    width: 100%;
    margin-top: 20px;
    justify-content: center;
}

/* Pantalla de Juego */
.header-juego {
    position: relative;
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.btn-reinicio {
    position: fixed;
    bottom: max(18px, env(safe-area-inset-bottom, 0px) + 18px);
    right: max(14px, env(safe-area-inset-right, 0px) + 8px);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(0, 212, 255, 0.6);
    background: linear-gradient(135deg, #0e1a2b 0%, #12243a 100%);
    color: #00d4ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 26px rgba(0, 212, 255, 0.25);
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 1500;
    transform: translateZ(0);
}

.btn-reinicio:hover {
    color: #0a0a0a;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    box-shadow: 0 14px 26px rgba(0, 212, 255, 0.35);
    transform: translateY(-2px);
}

.btn-reinicio:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(0, 212, 255, 0.25);
}

@media (max-width: 600px) {
    .header {
        padding: 56px 16px 32px 16px;
    }
    
    .header h1 {
        font-size: clamp(2rem, 5vw + 1rem, 2.6rem);
    }
    
    .header .subtitle {
        font-size: clamp(1rem, 3.5vw + 0.35rem, 1.25rem);
    }
    
    .header-juego h2 {
        font-size: clamp(2rem, 5vw + 1rem, 2.5rem);
    }
    
    #estado-juego {
        font-size: 1.15rem;
    }
    
    #titulo-jugador {
        font-size: 2.2rem;
    }
    
    .tipo-identidad {
        font-size: clamp(2.4rem, 6vw + 1rem, 3rem);
    }
}

.header-juego h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

#estado-juego {
    font-size: 1.2rem;
    opacity: 0.9;
}

.pantalla-jugador {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid #333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    text-align: center;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.pantalla-jugador::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00d4ff, #0099cc, #00d4ff);
    background-size: 200% 100%;
    animation: headerGlow 3s ease-in-out infinite;
}

#titulo-jugador {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.identidad {
    margin-bottom: 40px;
}

.tipo-identidad {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: bold;
}
.tipo-identidad i {
    margin-right: 8px;
}

.tipo-identidad.impostor {
    color: #e74c3c;
    text-shadow: 2px 2px 4px rgba(231, 76, 60, 0.3);
}

.tipo-identidad.normal {
    color: #27ae60;
    text-shadow: 2px 2px 4px rgba(39, 174, 96, 0.3);
}

.descripcion {
    font-size: 1.3rem;
    line-height: 1.6;
    color: #b0b0b0;
}
.palabra-clave {
    display: inline-block;
    margin-top: 6px;
    color: #2ee58d;
    font-weight: 800;
    font-size: clamp(1.4rem, 4vw + 0.5rem, 2.2rem);
    letter-spacing: 0.5px;
    text-shadow: 0 3px 10px rgba(46, 229, 141, 0.25);
}

.controles-jugador {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Pantalla Final */
.resumen-juego {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid #333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.resumen-juego::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    opacity: 0.7;
}

.info-juego, .instrucciones {
    margin-bottom: 25px;
}

.info-juego h3, .instrucciones h3 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 600;
}

.info-juego p {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #b0b0b0;
}

.instrucciones ul {
    list-style: none;
    padding-left: 0;
}

.instrucciones-juego {
    margin: 8px 0 4px;
    color: #e5e7eb;
    font-size: 0.8rem;
    line-height: 1.3;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 8px 10px;
}

.instrucciones li {
    margin-bottom: 10px;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 8px;
    border-left: 4px solid #00d4ff;
    color: #b0b0b0;
}

/* Categorías */
.categorias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.categoria-item {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    border: 2px solid #444;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.categoria-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.categoria-item:hover::before {
    transform: scaleX(1);
}

.categoria-item:hover {
    border-color: #00d4ff;
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.2);
}

.categoria-item.selected {
    border-color: #00d4ff;
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3);
}

.categoria-item.selected::before {
    transform: scaleX(1);
}

.categoria-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
}

.categoria-info {
    flex: 1;
}

.categoria-info h4 {
    margin: 0 0 5px 0;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
}

.categoria-info p {
    margin: 0;
    color: #b0b0b0;
    font-size: 0.9rem;
    line-height: 1.3;
}

.categoria-checkbox {
    position: relative;
}

.categoria-checkbox input[type="radio"] {
    display: none;
}

.categoria-checkbox label {
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.categoria-checkbox input[type="radio"]:checked + label {
    border-color: #667eea;
    background: #667eea;
}

.categoria-checkbox input[type="radio"]:checked + label::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 56px 16px 28px 16px; /* aún más espacio en móviles */
    }

    .header-top {
        top: 12px;
        right: 16px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .configuracion, .pantalla-jugador {
        padding: 20px;
    }
    
    .controles-jugador {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-principal, .btn-secundario {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .categorias-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .categoria-item {
        padding: 12px;
    }
}

/* Botones de edición */
.categoria-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-editar {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #0a0a0a;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.btn-editar:hover {
    background: linear-gradient(135deg, #00b8e6 0%, #0088b3 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

/* Contenedor de textarea con botón */
.textarea-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-borrar-palabras {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-borrar-palabras:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d84315 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.btn-borrar-palabras:active {
    transform: translateY(0);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid #333;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #f1f3f4;
}

.modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 600;
}

.btn-cerrar {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-cerrar:hover {
    background: #f1f3f4;
    color: #333;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 25px;
    border-top: 2px solid #f1f3f4;
}

/* Mensaje de error */
.mensaje-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    font-weight: 600;
    animation: fadeIn 0.3s ease-in;
}

/* Animaciones adicionales */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Información oculta y botones de revelar */
.info-oculta {
    color: #666;
    font-weight: bold;
    letter-spacing: 2px;
    margin-right: 10px;
}

.btn-revelar-info {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #0a0a0a;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
}

.btn-revelar-info:hover {
    background: linear-gradient(135deg, #00b8e6 0%, #0088b3 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

.btn-revelar-info:active {
    transform: translateY(0);
}

.btn-revelar-info.revelado {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    cursor: default;
}

.btn-revelar-info.revelado:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

/* Estados especiales */
.impostor-highlight {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
}

.normal-highlight {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
} 
