:root {
    /* ADN CROMÁTICO (Talk.Me V41 Official) */
    --primary-bg: #0A0A0F;
    --secondary-bg: #151522;
    --modal-bg: #11111A;
    --accent-blue: #7B68EE;
    --accent-orange: #FF6B35;
    --logo-white: #FFFFFF;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --border-color: rgba(123, 104, 238, 0.15);
    --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.5);
    --glass: rgba(30, 41, 59, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    user-select: none;
}

body {
    background: #000;
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Starfield Canvas */
canvas#starfieldCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.blur-fx {
    filter: blur(8px) brightness(2.5);
    transition: filter 0.5s ease;
}

/* ──────────────────────────────────────────────────────────────────────────
   TOP-RIGHT ACTIONS (Aestética Login Original)
   ────────────────────────────────────────────────────────────────────────── */

.login-header-actions {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 1000;
    display: flex;
    gap: 15px;
    animation: fadeIn 1.5s ease;
}

.lang-switcher-mini {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

/* ──────────────────────────────────────────────────────────────────────────
   PANTALLA 1: STARTUP (LOGIN CLONE)
   ────────────────────────────────────────────────────────────────────────── */

.centered-ui {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    animation: fadeIn 1s ease;
}

.main-logo-large {
    font-size: 100px;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 20px;
    display: flex;
    align-items: baseline;
    text-shadow: 0 0 1px rgba(123, 104, 238, 0.5);
}

.logo-talk {
    color: var(--logo-white);
}

.logo-me {
    color: var(--accent-orange);
}

.logo-dot {
    color: var(--accent-blue);
    margin: 0 0.1em;
}

.startup-subtitle {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 50px;
    letter-spacing: 4px;
    max-width: 450px;
    text-align: center;
    opacity: 0.8;
    text-transform: uppercase;
}

.btn-talk-large {
    background: var(--accent-blue);
    border: none;
    width: 320px;
    height: 65px;
    border-radius: 40px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: wait;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 0 30px rgba(123, 104, 238, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-talk-large:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(123, 104, 238, 0.7);
}

.btn-talk-large:active {
    transform: scale(0.98);
}

.btn-talk-large .btn-glow-cycle {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: slideGlow 2.5s infinite;
}

@keyframes slideGlow {
    0% {
        left: -100%;
    }

    30% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

.startup-v-label {
    position: absolute;
    bottom: 30px;
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 4px;
    opacity: 0.5;
}

/* ──────────────────────────────────────────────────────────────────────────
   PANTALLA 2: APP INTEGRADA (FULL IFRAME)
   ────────────────────────────────────────────────────────────────────────── */

#app-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    /* Asegurar que esté sobre todo */
    animation: appReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    background: #0A0A0F;
    /* Fondo sólido para evitar parpadeos negros */
}

#app-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Overlay de Control Flotante */
.server-control-overlay {
    position: absolute;
    bottom: 25px;
    right: 25px;
    width: 280px;
    background: rgba(15, 15, 25, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 15px;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.4s ease, opacity 0.4s ease;
    z-index: 100;
}

.server-control-overlay.minimized {
    transform: translateY(15vh);
    opacity: 0.5;
}

.overlay-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    font-weight: 800;
    color: #10b981;
}

.dot.online {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
}

.overlay-ips {
    font-family: monospace;
    font-size: 11px;
    color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 8px;
    max-height: 80px;
    overflow-y: auto;
}

.overlay-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.overlay-btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.overlay-btn-icon:hover {
    background: var(--accent-blue);
}

/* Generic Helpers */
.hidden {
    display: none !important;
}

.fade-out {
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes appReveal {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Select Styling */
.talkme-select-container {
    position: relative;
}

.talkme-select {
    background: transparent;
    border: none;
    color: white;
    padding: 2px 22px 2px 8px;
    border-radius: 8px;
    appearance: none;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.talkme-select:focus {
    outline: none;
}

.talkme-select-arrow {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Reducción del tamaño del logo en versiones móviles */
@media (max-width: 768px) {
    .main-logo-large {
        font-size: 60px;
    }

    .startup-subtitle {
        font-size: 12px;
        font-weight: 500;
        margin-bottom: 30px;
        max-width: 350px;
    }
}