/* ============================================
   GLOBAL.CSS - ESTILOS GLOBALES
   Variables, Fuentes, Reset, Colores, Imágenes
   ============================================ */

/* ========== IMPORTAR GOOGLE FONTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@700;800;900&display=swap');

/* ========== RESET CSS ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* GAME SCREEN */
.game-screen {
    display: block;
    position: fixed;
    width: 100%;
    height: 100%;
    align-self: center;
    color: var(--color-text-light);
}

/* ========== VARIABLES GLOBALES ========== */
:root {
    /* ========== COLORES LEGACY (Para compatibilidad) ========== */
    --violeta-profundo: #2E004E;
    --cian: #00F0FF;
    --magenta: #FF0055;
    --amarillo: #FFD700;
    
    /* ========== COLORES MODERNOS (Nueva paleta) ========== */
    --color-bg-dark: #1a1a2e;
    --color-bg-darker: #16213e;
    --color-text-light: #e0e7ff;
    --color-text-muted: #c7d2fe;
    --color-accent-amber: #fbbf24;
    --color-accent-green: #22c55e;
    --color-accent-purple: #8b5cf6;
    --color-accent-cyan: #06b6d4;
    --color-accent-red: #ef4444;
    
    /* ========== SOMBRAS (SHADOWS) ========== */
    --sombra-xs: 1px 1px 0px #000;
    --sombra-sm: 2px 2px 0px #000;
    --sombra-media: 2px 2px 0px rgba(0,0,0,0.3);
    --sombra-dura: 4px 4px 0px #000;
    --sombra-mega: 6px 6px 0px #000;
    
    /* ========== ESPACIADO (SPACING) ========== */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-base: 15px;
    --space-lg: 20px;
    --space-xl: 25px;
    --space-2xl: 30px;
    --space-3xl: 35px;
    --space-4xl: 40px;
    
    /* ========== TAMAÑOS (SIZES) ========== */
    --size-sm: 8px;
    --size-md: 12px;
    --size-lg: 15px;
    --size-xl: 20px;
    --size-2xl: 25px;
    --size-3xl: 35px;
    
    /* ========== RADIO DE ESQUINAS (BORDER RADIUS) ========== */
    --radius-sm: 10px;
    --radius-md: 15px;
    --radius-lg: 20px;
    --radius-xl: 25px;
    --radius-full: 50px;
    --radius-modal: 16px;
    --radius-btn: 8px;
    --radius-input: 8px;
    --radius-card: 12px;
    
    /* ========== PADDING ESTÁNDAR ========== */
    --padding-sm: 8px 12px;
    --padding-md: 12px 18px;
    --padding-lg: 15px 25px;
    --padding-xl: 18px 35px;
    --padding-button: 15px 35px;
    --padding-input: 18px;
    --padding-modal: 35px;
    --padding-modal-content: 30px;
    --padding-input-field: 12px 16px;
    --padding-btn-control: 12px 24px;
    
    /* ========== FUENTES (FONTS) ========== */
    --font-primary: 'Nunito', sans-serif;
    --font-display: 'Fredoka One', cursive;
    --font-mono: 'Courier New', monospace;
    
    /* ========== TRANSICIONES (TRANSITIONS) ========== */
    --transition-fast: 0.1s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.5s ease;
    
    /* ========== BLUR & FILTERS ========== */
    --blur-standard: 10px;
    --blur-enhanced: 12px;
    
    /* ========== RESPONSIVE BREAKPOINTS ========== */
    /* Mobile: < 480px */
    /* Tablet: 480px - 1024px */
    /* Desktop: > 1024px */
}

/* ========== ESTILOS BASE BODY ========== */
body {
    font-family: var(--font-primary);
    font-weight: 700;
    background-color: var(--violeta-profundo);
    background-image: url('../images/bg.webp'); 
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    color: white;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ========== TIPOGRAFÍAS BASE ========== */
html {
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6,
.title, .logo-text, 
.ranking-title, .top-words-title {
    font-family: var(--font-display);
    letter-spacing: 1px;
    text-shadow: var(--sombra-dura);
}

h1 { font-size: 3em; }
h2 { font-size: 2.5em; }
h3 { font-size: 2em; }

p, .text {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.5;
}

small {
    font-size: 0.85em;
    font-weight: 600;
}

strong {
    font-weight: 900;
}

/* ========== LINKS ========== */
a {
    color: var(--cian);
    text-decoration: none;
    transition: all var(--transition-fast);
}

a:hover {
    text-decoration: underline;
}

/* ========== TABLAS ========== */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--sombra-dura);
}

table th {
    background: var(--violeta-profundo);
    color: white;
    padding: var(--space-lg);
    font-family: var(--font-display);
    text-align: left;
    border-bottom: 4px solid #000;
}

table td {
    background: white;
    color: #000;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 2px solid #eee;
    font-weight: 700;
}

table tr:last-child td {
    border-bottom: none;
}

/* ========== BADGES ========== */
.badge {
    display: inline-block;
    background: var(--amarillo);
    color: #000;
    padding: var(--space-xs) var(--space-lg);
    border-radius: var(--radius-full);
    font-size: 0.9em;
    font-weight: 800;
    box-shadow: var(--sombra-media);
    margin: 0 var(--space-xs);
}

.badge.cian {
    background: var(--cian);
    color: #000;
}

.badge.magenta {
    background: var(--magenta);
    color: white;
}

/* ========== AURAS (Generadas dinámicamente) ========== */
.has-aura {
    transition: background var(--transition-slow);
}

/* ========== STATUS INDICATORS ========== */
.status-connected { 
    color: var(--color-accent-green);
}
.status-ready { 
    color: #3b82f6;
}
.status-answered { 
    color: var(--color-accent-amber);
}
.status-waiting { 
    color: var(--color-accent-purple);
}
.status-disconnected { 
    opacity: 0.4;
}

/* ========== LANDING PAGE ========== */
.landing-container {
    text-align: center;
    max-width: 500px;
    width: 100%;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: var(--space-lg);
}

.logo-header {
    margin-bottom: var(--space-2xl);
}

.logo-header img {
    max-width: 300px;
    width: 100%;
    height: auto;
    filter: drop-shadow(4px 4px 8px rgba(0,0,0,0.5));
}

.logo-header h1 {
    margin-top: var(--space-lg);
    color: var(--cian);
    font-size: 2.5em;
}

/* Subtitle landing */
.subtitle {
    font-size: 1.3em;
    margin-bottom: var(--space-2xl);
    color: var(--amarillo);
    text-shadow: var(--sombra-media);
    font-weight: 800;
}

/* Grupo de botones landing */
.btn-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    width: 100%;
    max-width: 350px;
    margin-bottom: auto;
}

/* Botones específicos del landing */
.btn-create,
.btn-join {
    width: 100%;
    padding: var(--space-lg) var(--space-2xl);
    font-size: 1.4em;
    font-family: var(--font-display);
    font-weight: 900;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--sombra-dura);
    transition: all var(--transition-normal);
    text-align: center;
    display: block;
    cursor: pointer;
    text-transform: none;
}

.btn-create {
    background: var(--cian);
    color: #000;
}

.btn-join {
    background: var(--magenta);
    color: white;
}

.btn-create:hover,
.btn-join:hover {
    transform: translateY(-3px);
    box-shadow: var(--sombra-mega);
    text-decoration: none;
}

.btn-create:active,
.btn-join:active {
    transform: translateY(1px);
    box-shadow: var(--sombra-sm);
}

/* Versión - footer del landing */
.version {
    margin-top: var(--space-3xl);
    font-size: 0.9em;
    opacity: 0.7;
    color: white;
    text-shadow: var(--sombra-xs);
}

/* ========== BOTÓN HOME (Unificado) ========== */
.btn-home {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 60px;
    height: 60px;
    background: rgba(139, 92, 246, 0.2);
    backdrop-filter: blur(var(--blur-standard));
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    color: white;
    text-decoration: none;
    box-shadow: var(--sombra-media);
    transition: all var(--transition-normal);
    z-index: 100;
}

.btn-home:hover {
    background: rgba(139, 92, 246, 0.4);
    border-color: rgba(139, 92, 246, 0.8);
    transform: scale(1.1);
    box-shadow: var(--sombra-dura);
    text-decoration: none;
}

.btn-home:active {
    transform: scale(0.95);
}

/* ========== CLASES DE UTILIDAD ========== */
.text-center { text-align: center; }
.hidden { display: none !important; }
.visible { display: block !important; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-col-gap { display: flex; flex-direction: column; gap: var(--space-md); }
.flex-center { display: flex; justify-content: center; align-items: center; }
.custom-scrollbar { scrollbar-width: thin; scrollbar-color: rgba(139, 92, 246, 0.5) rgba(0, 0, 0, 0.2); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .btn-home {
        width: 55px;
        height: 55px;
        font-size: 1.6em;
    }
}

@media (max-width: 768px) {
    .logo-header h1 {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1.1em;
    }
    
    .btn-create,
    .btn-join {
        font-size: 1.2em;
        padding: var(--space-md) var(--space-xl);
    }
    
    .btn-home {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .btn-home {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
        bottom: var(--space-md);
        right: var(--space-md);
    }
    
    .logo-header h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .btn-create,
    .btn-join {
        font-size: 1em;
    }
}
