/* =====================================================================
   ESTILOS PREMIUM VTT - NARRADOR UNIVERSAL (GLASSMORPHISM / NEON-DARK THEME)
   ===================================================================== */

:root {
    --bg-main: #060913;
    --bg-darker: #03050a;
    --glass-bg: rgba(10, 16, 32, 0.45);
    --glass-bg-dark: rgba(5, 8, 18, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-glow: rgba(139, 92, 246, 0.2);
    
    /* Neon themed colors */
    --primary-color: #8b5cf6; /* Mystic violet */
    --primary-glow: rgba(139, 92, 246, 0.35);
    --success-color: #10b981; /* Emerald green */
    --success-glow: rgba(16, 185, 129, 0.3);
    --cyber-color: #06b6d4; /* Cyber cyan */
    --cyber-glow: rgba(6, 182, 212, 0.3);
    --danger-color: #ef4444; /* Blood red */
    --danger-glow: rgba(239, 68, 68, 0.4);
    --warning-color: #f59e0b; /* Amber warning */
    --warning-glow: rgba(245, 158, 11, 0.3);
    --gold-accent: #c5a059; /* Gold accent */
    
    /* Typography */
    --font-headers: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-code: 'Fira Code', monospace;
}

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

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(16, 185, 129, 0.05) 0px, transparent 60%);
    background-attachment: fixed;
    color: #e2e8f0;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    letter-spacing: -0.1px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* =====================================================================
   GLASSMORPHISM & PREMIUM COMPONENT STYLING
   ===================================================================== */

.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 18px;
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.glass:hover {
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: 0 12px 45px 0 rgba(139, 92, 246, 0.05);
}

.glass-dark {
    background: var(--glass-bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
}

.glass-dark-border {
    background: rgba(5, 8, 18, 0.85);
    border: 1px dashed rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
    backdrop-filter: blur(16px);
    border-radius: 14px;
}

/* Buttons styling with neomorphic hover */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6d28d9 100%);
    color: white;
    border: none;
    padding: 11px 22px;
    border-radius: 8px;
    font-family: var(--font-headers);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px var(--primary-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px var(--primary-color);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font-headers);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #047857 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: var(--font-headers);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--success-glow);
    transition: all 0.2s ease;
}
.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 18px var(--success-color);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #b45309 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: var(--font-headers);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--warning-glow);
    transition: all 0.2s ease;
}
.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 18px var(--warning-color);
}

.btn-danger-glow {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    font-family: var(--font-headers);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
    transition: all 0.3s ease;
}
.btn-danger-glow:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
    box-shadow: 0 0 20px var(--danger-color);
    transform: scale(1.03);
}

.btn-xs {
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 4px;
}
.btn-xs-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #64748b;
    border: none;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
}
.btn-xs-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.w-full { width: 100%; }

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    font-family: var(--font-headers);
    text-transform: uppercase;
}
.active-badge {
    background: rgba(6, 182, 212, 0.12);
    color: var(--cyber-color);
    border: 1px solid var(--cyber-color);
    box-shadow: 0 0 10px var(--cyber-glow);
}

/* Glow Text colors */
.text-glow-cyan {
    color: var(--cyber-color);
    text-shadow: 0 0 10px var(--cyber-glow);
}
.text-glow-green {
    color: var(--success-color);
    text-shadow: 0 0 10px var(--success-glow);
}
.text-glow-red {
    color: var(--danger-color);
    text-shadow: 0 0 10px var(--danger-glow);
}
.text-muted {
    color: #4b5563;
}
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }

.loading-spinner {
    text-align: center;
    color: #94a3b8;
    padding: 30px;
    font-style: italic;
    animation: pulse 1.5s infinite alternate;
}
@keyframes pulse {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* =====================================================================
   PANTALLAS GENERALES
   ===================================================================== */
.screen {
    display: none;
    opacity: 0;
    height: 100vh;
    width: 100%;
}
.screen.active {
    display: flex;
    opacity: 1;
    animation: fadeInScreen 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes fadeInScreen {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* =====================================================================
   PANTALLA 1: LOBBY DE CAMPAÑAS
   ===================================================================== */
#lobby-screen {
    align-items: center;
    justify-content: center;
    padding: 30px;
    overflow-y: auto;
}

.lobby-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px 0;
}

.lobby-header {
    text-align: center;
}

.glow-title {
    font-family: var(--font-headers);
    font-size: 46px;
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #ffffff 20%, #a78bfa 60%, var(--cyber-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(139, 92, 246, 0.25);
    margin-bottom: 6px;
}

.lobby-subtitle {
    color: #94a3b8;
    font-size: 16px;
}

.lobby-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 900px) {
    .lobby-grid {
        grid-template-columns: 1fr;
    }
}

.lobby-panel {
    padding: 35px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lobby-panel h2 {
    font-family: var(--font-headers);
    font-size: 22px;
    font-weight: 700;
    color: white;
    border-left: 4px solid var(--primary-color);
    padding-left: 12px;
}

.panel-desc-inline {
    font-size: 13px;
    color: #64748b;
    margin-top: -10px;
}

.campaigns-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 6px;
}

.campaign-item {
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.campaign-item:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.15);
}
.campaign-details h3 {
    font-family: var(--font-headers);
    font-size: 17px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}
.campaign-details p {
    font-size: 12px;
    color: #64748b;
}

/* WIZARD FORM */
.wizard-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-family: var(--font-headers);
    font-weight: 600;
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group input, .form-group select, .form-standard textarea {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
    color: white;
    font-family: var(--font-body);
    font-size: 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group select option {
    background: var(--bg-darker);
}
.form-group input:focus, .form-group select:focus, .form-standard textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow);
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.lobby-footer {
    text-align: center;
    font-size: 11px;
    color: #334155;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 20px;
}

/* =====================================================================
   PANTALLA 2: DASHBOARD VTT HÍBRIDO (CONTROL)
   ===================================================================== */
#dashboard-screen {
    flex-direction: column;
    overflow: hidden;
}

/* HEADER */
.main-header {
    height: 70px;
    width: calc(100% - 32px);
    margin: 16px 16px 0 16px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 14px;
    flex-shrink: 0;
    border-color: var(--glass-border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}
.btn-back {
    padding: 6px 14px !important;
}

.title-meta h1 {
    font-family: var(--font-headers);
    font-size: 18px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.2px;
}
.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: var(--success-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success-color);
    animation: blinkPulse 2s infinite;
}
@keyframes blinkPulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px var(--success-color); }
    100% { transform: scale(0.9); opacity: 0.6; }
}
.status-text {
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.5px;
}

.billing-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}
.billing-icon {
    font-size: 22px;
}
.billing-title {
    font-size: 9px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.billing-metrics {
    font-size: 13px;
    font-weight: 700;
    color: white;
    font-family: var(--font-headers);
}

/* BODY LAYOUT */
.dashboard-body {
    flex-grow: 1;
    display: flex;
    gap: 16px;
    padding: 16px;
    overflow: hidden;
    height: calc(100vh - 86px);
    position: relative; /* Absolute positions for floating sidebars */
}

/* SIDEBAR NAV */
.sidebar {
    width: 230px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 8px;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 0px !important;
    padding-left: 0px !important;
    padding-right: 0px !important;
    margin-left: -16px !important;
    opacity: 0 !important;
    pointer-events: none;
    overflow: hidden;
}

/* Floating Glassmorphic Collapse Buttons */
.hud-collapse-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 40px;
    background: rgba(10, 15, 30, 0.75);
    border: 1px solid rgba(139, 92, 246, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #a5b4fc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    font-size: 10px;
    padding: 0;
}

.hud-collapse-btn:hover {
    background: rgba(139, 92, 246, 0.35);
    border-color: rgba(139, 92, 246, 0.6);
    color: white;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}

#btn-collapse-left {
    left: 246px; /* 230px sidebar + 16px padding */
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-left: none;
}

.sidebar.collapsed ~ #btn-collapse-left {
    left: 2px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.nav-item {
    width: 100%;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 11px 14px;
    text-align: left;
    font-family: var(--font-headers);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: white;
    transform: translateX(2px);
}
.nav-item.active {
    background: rgba(139, 92, 246, 0.12);
    color: white;
    box-shadow: inset 3px 0 0 var(--primary-color);
}
.nav-icon {
    font-size: 16px;
}

.sidebar-status-box {
    padding: 14px;
    font-size: 11px;
    border-radius: 8px;
}
.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.status-row:last-child {
    margin-bottom: 0;
}
.flex-col {
    flex-direction: column;
    align-items: flex-start;
}
.status-label-row {
    display: flex;
    justify-content: space-between;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--cyber-color) 100%);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* WORKSPACE CENTRAL */
.workspace {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    height: 100%;
    border-radius: 18px;
}

.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
    animation: fadeInPanel 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

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

.panel-title {
    font-family: var(--font-headers);
    font-size: 24px;
    font-weight: 800;
    color: white;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}
.panel-description {
    color: #64748b;
    font-size: 12px;
    margin-bottom: 24px;
}

.grid-2-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.card {
    padding: 22px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}
.card h3 {
    font-family: var(--font-headers);
    font-size: 15px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-list p {
    margin-bottom: 12px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.03);
    padding-bottom: 6px;
}
.info-list p strong {
    color: #94a3b8;
}

.bullet-list p {
    font-size: 13px;
    margin-bottom: 10px;
    padding-left: 16px;
    position: relative;
    color: #cbd5e1;
}
.bullet-list p::before {
    content: "⚡";
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-size: 11px;
}

.facts-container {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

/* COMBATE Y SALUD reactive rows */
.entities-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}
.entity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.2s ease;
}
.entity-row:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(139, 92, 246, 0.15);
}
.entity-name {
    font-weight: 700;
    color: white;
    font-family: var(--font-headers);
}
.entity-status {
    font-family: var(--font-code);
    font-size: 12px;
    font-weight: 600;
}

.iniciativa-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}
.iniciativa-row {
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.iniciativa-row.current-turn {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.15) 0%, rgba(59, 130, 246, 0.08) 100%);
    border-color: rgba(139, 92, 246, 0.8) !important;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.35), inset 0 0 10px rgba(139, 92, 246, 0.15);
    transform: scale(1.02);
    animation: neonGlowPulse 2.5s infinite alternate ease-in-out;
    position: relative;
    overflow: hidden;
}

.iniciativa-row.current-turn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--cyber-color));
    box-shadow: 0 0 10px var(--primary-color);
}

.active-badge {
    background: linear-gradient(135deg, #a78bfa 0%, #3b82f6 100%) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 20px;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
    animation: badgePulse 1.2s infinite alternate ease-in-out;
    display: inline-block;
}

@keyframes neonGlowPulse {
    0% {
        border-color: rgba(139, 92, 246, 0.5);
        box-shadow: 0 0 12px rgba(139, 92, 246, 0.25), inset 0 0 5px rgba(139, 92, 246, 0.1);
    }
    100% {
        border-color: rgba(167, 139, 250, 1);
        box-shadow: 0 0 25px rgba(139, 92, 246, 0.5), inset 0 0 15px rgba(139, 92, 246, 0.25);
    }
}

@keyframes badgePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
    }
    100% {
        transform: scale(1.06);
        box-shadow: 0 0 16px rgba(139, 92, 246, 0.8);
    }
}

.mini-form h4 {
    font-family: var(--font-headers);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-row {
    display: flex;
    gap: 8px;
}
.form-row input {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    font-family: var(--font-body);
    font-size: 12px;
    flex-grow: 1;
}
.form-row input:focus {
    border-color: var(--primary-color);
}

.form-standard {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.form-standard textarea {
    width: 100%;
    resize: none;
    font-family: var(--font-body);
}

.card-description {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 14px;
    margin-top: -10px;
}

/* DRAG & DROP BIBLIOTECA */
.drag-zone {
    height: 170px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
}
.drag-zone:hover, .drag-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(139, 92, 246, 0.04);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.08);
}
.drag-icon {
    font-size: 32px;
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}
.drag-zone:hover .drag-icon {
    transform: translateY(-4px);
}
.drag-zone h3 {
    font-family: var(--font-headers);
    font-size: 14px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}
.drag-zone p {
    font-size: 11px;
    color: #4b5563;
}

.progress-box {
    padding: 16px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}
.progress-box h4 {
    font-family: var(--font-headers);
    font-size: 12px;
    margin-bottom: 8px;
    color: white;
}

.logs-console {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 14px;
    font-family: var(--font-code);
    font-size: 11px;
    max-height: 170px;
    overflow-y: auto;
}
.log-line {
    margin-bottom: 5px;
}

/* FORJADOR DE NPCs */
.npc-result-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 18px;
    flex-grow: 1;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
}
.npc-result-box.empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ORÁCULO IA CONSOLE */
.panel-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.console-box {
    background: rgba(3, 5, 10, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 18px;
    height: 410px;
    overflow-y: auto;
}
.console-text {
    font-family: var(--font-code);
    font-size: 11px;
    white-space: pre-wrap;
    color: var(--cyber-color);
    line-height: 1.6;
}

/* LATERAL DERECHO: DIARIO Y CRÓNICAS CHAT */
.game-chat {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 18px;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-chat.collapsed {
    width: 0px !important;
    padding-left: 0px !important;
    padding-right: 0px !important;
    margin-right: -16px !important;
    opacity: 0 !important;
    pointer-events: none;
    overflow: hidden;
}

#btn-collapse-right {
    right: 396px; /* 380px game-chat + 16px padding */
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    border-right: none;
}

.game-chat.collapsed ~ #btn-collapse-right {
    right: 2px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 8px;
    margin-bottom: 12px;
    flex-shrink: 0;
}
.chat-title {
    font-family: var(--font-headers);
    font-size: 15px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.2px;
}

/* GLOW NARRATIVE PROPOSAL CARD */
.proposal-card {
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.1);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    flex-shrink: 0;
    animation: glowAlert 2s infinite alternate;
}
@keyframes glowAlert {
    from { border-color: rgba(139, 92, 246, 0.25); box-shadow: 0 0 10px rgba(139, 92, 246, 0.08); }
    to { border-color: rgba(139, 92, 246, 0.5); box-shadow: 0 0 20px rgba(139, 92, 246, 0.2); }
}
.proposal-badge {
    font-size: 9px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.proposal-action-line {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 8px;
}
.proposal-content {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    padding: 8px 10px;
    max-height: 130px;
    overflow-y: auto;
    font-size: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}
.proposal-content-title {
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.proposal-prose {
    color: #cbd5e1;
    font-style: italic;
    line-height: 1.4;
    margin-bottom: 6px;
}
.proposal-cot-title {
    font-size: 9px;
    font-weight: 700;
    color: var(--cyber-color);
    text-transform: uppercase;
    margin-top: 6px;
    margin-bottom: 2px;
}
.proposal-cot-text {
    font-family: var(--font-code);
    font-size: 10px;
    color: #64748b;
    white-space: pre-wrap;
}
.proposal-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mini-form-inline {
    display: flex;
    gap: 6px;
}
.mini-form-inline input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 6px 10px;
    color: white;
    font-size: 11px;
    flex-grow: 1;
}
.mini-form-inline button {
    padding: 6px 12px;
}

.chat-messages-container {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.chat-msg {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
    border: 1px solid rgba(255, 255, 255, 0.02);
    animation: fadeInMsg 0.3s ease forwards;
}
@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg-narrador {
    background: rgba(139, 92, 246, 0.05);
    border-left: 3px solid var(--primary-color);
}
.chat-msg-player {
    background: rgba(255, 255, 255, 0.01);
    border-left: 3px solid #4b5563;
}
.msg-author {
    font-family: var(--font-headers);
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
    display: block;
}
.msg-text {
    color: #cbd5e1;
}
.msg-text img {
    max-width: 100%;
    border-radius: 6px;
    margin-top: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* =====================================================================
   RUEDA DE DIÁLOGOS Y TONOS (DYNAMIC DIALOGUE WHEEL STYLE BG3/MASS EFFECT)
   ===================================================================== */
.dialogue-wheel-panel {
    background: rgba(10, 15, 30, 0.85);
    border: 1px solid rgba(0, 243, 255, 0.25);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    flex-shrink: 0;
    animation: pulseGlowBorder 3s infinite alternate;
}

@keyframes pulseGlowBorder {
    from { border-color: rgba(0, 243, 255, 0.15); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4); }
    to { border-color: rgba(0, 243, 255, 0.4); box-shadow: 0 4px 25px rgba(0, 243, 255, 0.2); }
}

.dialogue-wheel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 6px;
    text-transform: uppercase;
}

.dialogue-wheel-options-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.dialogue-wheel-option-row {
    position: relative;
    width: 100%;
}

.dialogue-btn-wheel {
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 14px;
    color: #cbd5e1;
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

.dialogue-btn-wheel::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    transition: all 0.2s;
}

.dialogue-btn-wheel-amistoso::before { background: #10b981; }
.dialogue-btn-wheel-amistoso:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
    color: white;
}

.dialogue-btn-wheel-hostil::before { background: #ef4444; }
.dialogue-btn-wheel-hostil:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
    color: white;
}

.dialogue-btn-wheel-astuto::before { background: #f59e0b; }
.dialogue-btn-wheel-astuto:hover {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
    color: white;
}

.dialogue-btn-wheel-romántico::before { background: #ec4899; }
.dialogue-btn-wheel-romántico:hover {
    background: rgba(236, 72, 153, 0.08);
    border-color: rgba(236, 72, 153, 0.35);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.15);
    color: white;
}

.dialogue-tone-badge {
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 1.5px 5px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.dialogue-tone-badge-amistoso { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.dialogue-tone-badge-hostil { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.dialogue-tone-badge-astuto { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.dialogue-tone-badge-romántico { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }

.dialogue-text {
    flex-grow: 1;
}

.dialogue-check-badge {
    font-family: monospace;
    font-size: 9.5px;
    background: rgba(167, 139, 250, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: #c084fc;
    padding: 1.5px 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.dialogue-btn-wheel:disabled {
    cursor: not-allowed;
    opacity: 0.35;
    transform: scale(0.98);
}

.chat-input-container {
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 10px;
}
.chat-input-form {
    display: flex;
    gap: 6px;
}
.chat-input-form input[type="text"] {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    font-size: 12px;
}
#input-chat-speaker {
    width: 90px;
    font-family: var(--font-headers);
    font-weight: 600;
}
#input-chat-action {
    flex-grow: 1;
}

/* =====================================================================
   TRAY FLOTANTE: DADOS NEOMÓRFICOS
   ===================================================================== */
.dice-tray {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 250px;
    padding: 16px;
    border-radius: 14px;
    z-index: 1000;
    border: 1px solid rgba(6, 182, 212, 0.2);
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: floatDice 3s infinite ease-in-out;
}
.shadow-cyan {
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.15);
}
@keyframes floatDice {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0px); }
}
.dice-tray-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-headers);
    font-size: 12px;
    font-weight: 700;
    color: white;
}
.dice-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.btn-dice {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    padding: 8px 0;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-family: var(--font-headers);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-dice:hover {
    background: rgba(6, 182, 212, 0.12);
    border-color: var(--cyber-color);
    color: white;
    box-shadow: 0 0 10px var(--cyber-glow);
    transform: scale(1.05);
}
.dice-custom-form {
    display: flex;
    gap: 6px;
}
.dice-custom-form input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 6px 10px;
    color: white;
    font-family: var(--font-code);
    font-size: 11px;
    flex-grow: 1;
}
.btn-roll-dice {
    padding: 6px 12px !important;
}

.dice-result-box-inner {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dotted rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 10px;
    font-size: 11px;
    text-align: center;
    font-family: var(--font-code);
    color: var(--cyber-color);
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* TRIGGER BOTÓN DADOS */
.btn-dice-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyber-color) 0%, #0891b2 100%);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 15px var(--cyber-glow);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-dice-trigger:hover {
    transform: rotate(30deg) scale(1.08);
    box-shadow: 0 0 25px var(--cyber-color);
}

/* =====================================================================
   MÚSICA, VOZ Y TAPETE DE DADOS DE ÚLTIMA GENERACIÓN
   ===================================================================== */

.mr-4 {
    margin-right: 16px;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* WIDGET DE AUDIO EN CABECERA */
.music-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.3s;
}
.music-widget:hover {
    background: rgba(255, 255, 255, 0.01);
}
.btn-music-control {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.btn-music-control:hover {
    transform: scale(1.2);
}
.music-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.music-track-title {
    font-size: 9px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
#slider-music-volume {
    width: 75px;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    -webkit-appearance: none;
    cursor: pointer;
}
#slider-music-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyber-color);
    box-shadow: 0 0 6px var(--cyber-color);
    transition: transform 0.1s ease;
}
#slider-music-volume::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

/* SWITCH TOGGLE PARA VOZ DEL ORÁCULO */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}
.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
}
.slider-round:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: #64748b;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}
.switch-toggle input:checked + .slider-round {
    background-color: rgba(139, 92, 246, 0.12);
    border-color: var(--primary-color);
}
.switch-toggle input:checked + .slider-round:before {
    transform: translateX(16px);
    background-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* TAPETE DE DADOS Canvas 2D */
.tapete-wrapper {
    background: radial-gradient(circle, rgba(13, 20, 38, 0.75) 0%, rgba(3, 5, 10, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 4px 15px rgba(0, 0, 0, 0.4);
    width: 100%;
}
#dice-tapete-canvas {
    display: block;
    cursor: pointer;
    background: transparent;
}

/* ANIMACIONES MAESTRAS */
.shake-animation {
    animation: shakeEffect 0.4s ease-in-out;
}
@keyframes shakeEffect {
    0% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-2px, 1px) rotate(-1deg); }
    20% { transform: translate(1px, -1px) rotate(1deg); }
    30% { transform: translate(-1px, 2px) rotate(0deg); }
    40% { transform: translate(2px, -1px) rotate(1deg); }
    50% { transform: translate(-2px, 1px) rotate(-1deg); }
    60% { transform: translate(1px, -1px) rotate(1deg); }
    70% { transform: translate(-1px, 2px) rotate(0deg); }
    80% { transform: translate(2px, -1px) rotate(1deg); }
    90% { transform: translate(-2px, 1px) rotate(-1deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.vision-img-render {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}
.vision-img-render:hover {
    transform: scale(1.02);
}

/* =====================================================================
   BÓVEDA DE DATOS NATIVOS & AUTONOMÍA SYSTEM STYLES
   ===================================================================== */

.boveda-tab-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-family: var(--font-headers);
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.boveda-tab-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}
.boveda-tab-btn.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.boveda-subtab {
    display: none;
}
.boveda-subtab.active {
    display: block;
    animation: fadeInPanel 0.3s ease forwards;
}

.fichas-list-container, .lore-list-container, .secretos-list-container {
    padding-right: 5px;
}

.boveda-pj-card, .boveda-lore-card, .boveda-secreto-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 14px;
    position: relative;
    transition: all 0.2s ease;
}
.boveda-pj-card:hover, .boveda-lore-card:hover, .boveda-secreto-card:hover {
    border-color: rgba(139, 92, 246, 0.25);
    background: rgba(139, 92, 246, 0.02);
}

.boveda-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: flex-end;
}

/* ORÁCULO WIDGET STYLES */
.btn-autonomy {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-autonomy:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}
.btn-autonomy.active[data-autonomy="0"] {
    background: rgba(239, 68, 68, 0.15);
    border-color: #f87171;
    color: #f87171;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}
.btn-autonomy.active[data-autonomy="50"] {
    background: rgba(245, 158, 11, 0.15);
    border-color: #fbbf24;
    color: #fbbf24;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}
.btn-autonomy.active[data-autonomy="100"] {
    background: rgba(16, 185, 129, 0.15);
    border-color: #34d399;
    color: #34d399;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

/* CIRCULAR PROGRESS SVG LOADER */
.countdown-circle-container svg {
    width: 28px;
    height: 28px;
}

/* SUPER-ADMIN FLOATING BAR ANIMATION */
#super-admin-float-bar {
    animation: slideUpFloat 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}
@keyframes slideUpFloat {
    from { transform: translate(-50%, 50px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* =====================================================================
   VTT DYNAMIC THEMES & PREMIUM MICRO-ANIMATIONS (UX)
   ===================================================================== */

/* Theme overrides for body */
body.theme-fantasy {
    --primary-color: #f59e0b; /* Amber/Mystic Gold */
    --primary-glow: rgba(245, 158, 11, 0.35);
    --glass-border-glow: rgba(245, 158, 11, 0.25);
    background-image: 
        radial-gradient(at 0% 0%, rgba(245, 158, 11, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
}
body.theme-scifi {
    --primary-color: #06b6d4; /* Cyber Cyan */
    --primary-glow: rgba(6, 182, 212, 0.35);
    --glass-border-glow: rgba(6, 182, 212, 0.25);
    background-image: 
        radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.08) 0px, transparent 50%);
}
body.theme-lovecraft {
    --primary-color: #10b981; /* Toxic green / Eldritch emerald */
    --primary-glow: rgba(16, 185, 129, 0.35);
    --glass-border-glow: rgba(16, 185, 129, 0.25);
    background-image: 
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(30, 41, 59, 0.3) 0px, transparent 50%);
}

/* Screenshake class for dice rolling and combat events */
.screenshake-active {
    animation: screenshake-kf 0.3s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes screenshake-kf {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(3px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-5px, -2px, 0); }
    40%, 60% { transform: translate3d(5px, 2px, 0); }
}

/* Floating animated neon particle bubbles underbody */
.body-glow-particles {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}
.body-glow-particles span {
    position: absolute;
    display: block;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatUp 15s linear infinite;
    bottom: -150px;
}
@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* RADIAL COMBAT ACTION WHEEL STYLING */
#radial-action-wheel {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(10, 15, 32, 0.95);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 20px var(--primary-glow), inset 0 0 10px rgba(0,0,0,0.8);
    backdrop-filter: blur(12px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transform: scale(0);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#radial-action-wheel.active {
    display: flex;
    transform: scale(1);
}

.radial-btn {
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.95);
    border: 1.5px solid var(--primary-color);
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}
.radial-btn:hover {
    transform: scale(1.2) translateY(-2px);
    box-shadow: 0 0 15px var(--primary-color);
    background: var(--primary-color);
}
.radial-btn:active {
    transform: scale(1.0);
}

/* =====================================================================
   FASE 9: PERSONALIZACIÓN DEL JUGADOR, MOCHILA INTERACTIVA Y LEVEO
   ===================================================================== */

:root {
    --user-accent: #8b5cf6; /* Por defecto violeta */
    --user-glow: rgba(139, 92, 246, 0.4);
}

/* TEXTURAS DEL TAPETE CANVAS DE DADOS */
.texture-wood-pattern {
    background-image: radial-gradient(circle, rgba(120, 53, 4, 0.15) 0%, rgba(67, 20, 7, 0.95) 100%) !important;
}
.texture-felt-pattern {
    background-image: radial-gradient(circle, rgba(4, 120, 87, 0.15) 0%, rgba(6, 78, 59, 0.95) 100%) !important;
}
.texture-carbon-pattern {
    background-image: linear-gradient(45deg, #111827 25%, #1f2937 25%, #1f2937 50%, #111827 50%, #111827 75%, #1f2937 75%, #1f2937 100%) !important;
    background-size: 20px 20px !important;
}
.texture-obsidian-pattern {
    background-image: radial-gradient(circle, rgba(88, 28, 135, 0.15) 0%, rgba(15, 23, 42, 0.98) 100%) !important;
}

/* BARRAS DE ESTADO HUD DEL JUGADOR */
.hud-status-bar {
    height: 10px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
    margin-top: 3px;
}
.hud-bar-fill {
    height: 100%;
    width: 100%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.hud-bar-life {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}
.hud-bar-sanity {
    background: linear-gradient(90deg, #a78bfa 0%, #7c3aed 100%);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}
.hud-bar-mana {
    background: linear-gradient(90deg, #06b6d4 0%, #0891b2 100%);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

/* MOCHILA INTERACTIVA DE INVENTARIO WIDGET */
.backpack-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.4);
}
.backpack-slot {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
}
.backpack-slot:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--user-accent) !important;
    box-shadow: 0 0 10px var(--user-glow) !important;
    transform: translateY(-2px);
}
.backpack-slot.equipped {
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}
.backpack-slot.consumable {
    border-color: #10b981 !important;
}
.backpack-slot.weapon {
    border-color: #ef4444 !important;
}
.backpack-item-qty {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 9px;
    font-weight: 700;
    color: white;
    background: rgba(15, 23, 42, 0.85);
    padding: 1px 3px;
    border-radius: 4px;
    border: 0.5px solid rgba(255,255,255,0.1);
}

/* WIDGETS DE RECURSOS ESPECÍFICOS DE REGLAS */
.resource-badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}
.resource-badge {
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}
.resource-badge:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}
.resource-badge.spell-slot {
    border-color: rgba(139, 92, 246, 0.3);
    color: #c084fc;
}
.resource-badge.spell-slot.consumed {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
    text-decoration: line-through;
    opacity: 0.6;
}
.resource-badge.ammo-clip {
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

/* CELEBRACIÓN DE LEVEL UP EN PANTALLA */
.levelup-splash-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(6, 9, 19, 0.85);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.levelup-splash-screen.active {
    opacity: 1;
    pointer-events: auto;
}
.levelup-banner-title {
    font-size: 48px;
    font-weight: 900;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 30px rgba(245, 158, 11, 0.6);
    animation: levelup-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.levelup-banner-subtitle {
    font-size: 16px;
    color: #e2e8f0;
    margin-top: 10px;
    font-style: italic;
    opacity: 0;
    animation: fade-in 0.4s ease 0.4s forwards;
}

@keyframes levelup-pop {
    0% { transform: scale(0.3); opacity: 0; filter: blur(5px); }
    100% { transform: scale(1); opacity: 1; filter: blur(0); }
}

@keyframes fade-in {
    100% { opacity: 1; }
}

/* ELEMENTOS DE PERSONALIZACIÓN Y SELECCIÓN ESTÉTICA (SETTINGS GEAR) */
.customizer-btn-gear {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.customizer-btn-gear:hover {
    transform: rotate(45deg);
    border-color: var(--user-accent);
    box-shadow: 0 0 8px var(--user-glow);
}

/* =====================================================================
   CODEX ZERO BRANDING, LOGO RINGS AND AUTH ANIMATIONS
   ===================================================================== */

.codex-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 40px auto;
    text-align: center;
    perspective: 1000px;
    animation: floating-codex 6s ease-in-out infinite;
}

.codex-logo-container {
    position: relative;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}

.codex-title {
    font-size: 68px !important;
    font-weight: 900 !important;
    letter-spacing: 5px !important;
    background: linear-gradient(135deg, #ffffff 10%, #c084fc 40%, #06b6d4 80%, #a855f7 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: 
        0 0 20px rgba(139, 92, 246, 0.5),
        0 0 50px rgba(6, 182, 212, 0.3),
        0 8px 16px rgba(0, 0, 0, 0.5) !important;
    position: relative;
    z-index: 5;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: default;
}

.codex-brand-wrapper:hover {
    transform: translateZ(30px) scale(1.05) rotateX(5deg) rotateY(-5deg);
}

.codex-brand-wrapper:hover #codex-vector-logo {
    transform: translateZ(15px) rotate(12deg) scale(1.1);
    filter: drop-shadow(0 0 15px rgba(192, 132, 252, 0.6));
}

/* Glowing Spinning Rings behind title */
.codex-ring {
    position: absolute;
    width: 280px;
    height: 120px;
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 50%;
    box-shadow: 
        0 0 15px rgba(139, 92, 246, 0.3),
        inset 0 0 15px rgba(139, 92, 246, 0.2);
    transform: rotateX(70deg) rotateY(15deg);
    animation: ring-spin-ccw 10s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.codex-ring-inner {
    position: absolute;
    width: 220px;
    height: 90px;
    border: 2px dashed rgba(6, 182, 212, 0.4);
    border-radius: 50%;
    box-shadow: 
        0 0 20px rgba(6, 182, 212, 0.3),
        inset 0 0 10px rgba(6, 182, 212, 0.2);
    transform: rotateX(70deg) rotateY(-15deg);
    animation: ring-spin-cw 7s linear infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes floating-codex {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes ring-spin-cw {
    from { transform: rotateX(70deg) rotateY(-15deg) rotateZ(0deg); }
    to { transform: rotateX(70deg) rotateY(-15deg) rotateZ(360deg); }
}

@keyframes ring-spin-ccw {
    from { transform: rotateX(70deg) rotateY(15deg) rotateZ(360deg); }
    to { transform: rotateX(70deg) rotateY(15deg) rotateZ(0deg); }
}

/* SESSION BAR & WIDGETS */
.user-session-bar {
    width: 100%;
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.session-section {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #94a3b8;
}

.user-meta-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-email-badge {
    color: white;
    font-weight: 500;
}

.user-tokens-badge {
    color: var(--cyber-color);
    font-weight: 700;
    text-shadow: 0 0 8px var(--cyber-glow);
}

.user-ref-badge {
    font-size: 11px;
    color: var(--success-color);
    font-weight: 600;
    transition: all 0.2s ease;
}

.user-ref-badge:hover {
    color: white;
    background: rgba(16, 185, 129, 0.2) !important;
    transform: scale(1.02);
}

/* TABLES FOR SUPER ADMIN PANEL */
#modal-admin-dashboard table th {
    font-family: var(--font-headers);
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#modal-admin-dashboard table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #cbd5e1;
}

#modal-admin-dashboard table tbody tr {
    transition: background 0.2s ease;
}

#modal-admin-dashboard table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

#modal-admin-dashboard table tbody tr.active-edit {
    background: rgba(245, 158, 11, 0.08);
    border-left: 2px solid var(--warning-color);
}

/* =====================================================================
   ESTILOS PREMIUM FASE 12: TOOLTIP PREVISIÓN & PERFIL
   ===================================================================== */

/* TOOLTIP DE PREVISIÓN DE TOKENS ELEGANTE CYBERPUNK */
.forecast-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 15px);
    right: 0;
    width: 280px;
    background: rgba(8, 12, 24, 0.95);
    border: 1px solid var(--cyber-color);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.25), inset 0 0 10px rgba(0, 243, 255, 0.1);
    border-radius: 12px;
    padding: 14px;
    z-index: 10000;
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
    color: white;
}

#lobby-tokens-badge:hover #token-forecast-tooltip-lobby,
#widget-master-tokens:hover #token-forecast-tooltip {
    display: block;
    animation: fadeInUpTooltip 0.25s forwards;
}

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

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 243, 255, 0.15);
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.tooltip-title {
    font-family: var(--font-headers);
    font-size: 13px;
    font-weight: 700;
    color: var(--cyber-color);
    text-shadow: 0 0 5px var(--cyber-glow);
}

.tooltip-body {
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    line-height: 1.4;
}

.forecast-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
}

.forecast-campaign-name {
    font-weight: bold;
    color: #f8fafc;
}

.forecast-campaign-cost {
    font-family: var(--font-code);
    color: var(--success-color);
}

.forecast-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-weight: bold;
    color: var(--user-accent);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 6px;
}

.loading-spinner.mini {
    font-size: 10px;
    color: #64748b;
    padding: 10px 0;
    text-align: center;
}

/* ESTILOS DEL MODAL DE PERFIL Y BOTONES */
.profile-tab-btn {
    transition: all 0.25s ease;
}

.profile-tab-btn:hover {
    color: var(--cyber-color) !important;
}

.profile-tab-btn.active {
    color: var(--cyber-color) !important;
    border-bottom-color: var(--cyber-color) !important;
}

.friend-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    transition: background 0.2s ease;
}

.friend-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.friend-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.friend-email {
    font-weight: 600;
    color: #f1f5f9;
}

.friend-role {
    font-size: 9px;
    color: var(--cyber-color);
    text-transform: uppercase;
}

.friend-actions {
    display: flex;
    gap: 6px;
}

.btn-friend-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-friend-action:hover {
    background: white;
    color: black;
    transform: scale(1.05);
}

.btn-friend-accept:hover {
    background: var(--success-color) !important;
    border-color: var(--success-color) !important;
    color: white !important;
}

.btn-friend-decline:hover {
    background: var(--critical-color) !important;
    border-color: var(--critical-color) !important;
    color: white !important;
}

.btn-friend-remove:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #f87171 !important;
}

/* =====================================================================
   FASE 13: ADVANCED ADMIN SUITE STYLES (PESTAÑAS, METRICAS, EDITOR)
   ===================================================================== */

.admin-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    flex-shrink: 0;
}

.admin-tab-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 12px;
    border-bottom: 2px solid transparent;
    outline: none;
    transition: all 0.3s ease;
}

.admin-tab-btn:hover {
    color: #cbd5e1;
}

.admin-tab-btn.active {
    color: var(--warning-color) !important;
    font-weight: 700 !important;
    border-bottom: 2px solid var(--warning-color) !important;
}

.admin-tab-panel {
    display: none;
    height: 100%;
}

.admin-tab-panel.active {
    display: flex !important;
}

.metric-progress-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.metric-progress-ring svg {
    transform: rotate(-90deg);
}

#admin-editor-textarea {
    box-sizing: border-box;
    font-family: 'Fira Code', 'Courier New', monospace;
    tab-size: 4;
    background: #020617;
    color: #38bdf8;
    border: none;
    outline: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.05) transparent;
}

#admin-editor-textarea::selection {
    background: rgba(56, 189, 248, 0.25);
    color: white;
}

#admin-editor-textarea::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#admin-editor-textarea::-webkit-scrollbar-track {
    background: transparent;
}

#admin-editor-textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#admin-editor-textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.3);
}

#admin-editor-console-output {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.05) transparent;
}

#admin-editor-console-output::-webkit-scrollbar {
    width: 4px;
}

#admin-editor-console-output::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

/* Portal pulse animation */
.pulse-animation {
    animation: textPulse 2s infinite ease-in-out;
}
@keyframes textPulse {
    0% { opacity: 0.3; transform: scale(0.95); text-shadow: 0 0 5px rgba(255,255,255,0.1); }
    50% { opacity: 1; transform: scale(1.05); text-shadow: 0 0 25px var(--cyber-color); }
    100% { opacity: 0.3; transform: scale(0.95); text-shadow: 0 0 5px rgba(255,255,255,0.1); }
}

/* Cinematic FX: Keyframes spin */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Premium Narrative Cards of Destiny Styling */
.destiny-card {
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    background: rgba(6, 9, 19, 0.7);
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    animation: fadeInMsg 0.4s ease;
}

.destiny-card-danger {
    border: 1px solid rgba(239, 68, 68, 0.35);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
    background: linear-gradient(135deg, rgba(6, 9, 19, 0.8) 0%, rgba(239, 68, 68, 0.03) 100%);
}

.destiny-card-success {
    border: 1px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
    background: linear-gradient(135deg, rgba(6, 9, 19, 0.8) 0%, rgba(245, 158, 11, 0.03) 100%);
}

.destiny-card-magic {
    border: 1px solid rgba(139, 92, 246, 0.35);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
    background: linear-gradient(135deg, rgba(6, 9, 19, 0.8) 0%, rgba(139, 92, 246, 0.03) 100%);
}

/* Premium Glassmorphic Challenge Container */
.chat-challenges-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.05);
    border: 1px dashed rgba(139, 92, 246, 0.3);
    box-shadow: inset 0 0 10px rgba(139, 92, 246, 0.05);
    animation: pulseBorder 3s infinite ease-in-out;
}

@keyframes pulseBorder {
    0%, 100% { border-color: rgba(139, 92, 246, 0.3); }
    50% { border-color: rgba(139, 92, 246, 0.6); }
}

.chat-challenge-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-challenge-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5), 0 0 12px rgba(139, 92, 246, 0.3);
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.chat-challenge-btn:active {
    transform: translateY(1px);
}

.chat-challenge-btn:disabled {
    cursor: not-allowed;
    background: rgba(31, 41, 55, 0.6) !important;
    color: rgba(156, 163, 175, 0.6) !important;
    border: 1px solid rgba(75, 85, 99, 0.4) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* BG3 Dialogue Choices CSS */
.chat-challenges-header {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #a78bfa;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 0 8px rgba(167, 139, 250, 0.4);
}

.chat-challenge-option-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.chat-challenge-option-card:hover {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
}

.chat-challenge-btn-bg3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(109, 40, 217, 0.4) 100%);
    color: #e9d5ff;
    border: 1px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.chat-challenge-btn-bg3:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.chat-challenge-btn-bg3:disabled {
    cursor: not-allowed;
    background: rgba(31, 41, 55, 0.6) !important;
    color: rgba(156, 163, 175, 0.5) !important;
    border: 1px solid rgba(75, 85, 99, 0.4) !important;
    box-shadow: none !important;
    transform: none !important;
}

.chat-challenge-consequences {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
    padding-left: 6px;
    line-height: 1.3;
    font-style: italic;
    border-left: 2px solid rgba(139, 92, 246, 0.4);
}

/* DIABLO-STYLE VISUAL GRID INVENTORY */
.diablo-inventory-wrapper {
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
}
.diablo-equipment-container {
    display: grid;
    grid-template-areas:
        ". head ."
        "weapon chest shield"
        "bag bag bag";
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: rgba(0, 0, 0, 0.35);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.5);
    margin-bottom: 12px;
}
.diablo-slot {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    font-size: 9px;
    color: #cbd5e1;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.diablo-slot:hover {
    border-color: var(--user-accent);
    background: rgba(139, 92, 246, 0.04);
    box-shadow: 0 0 10px var(--user-glow);
    transform: translateY(-2px);
}
.diablo-slot span.icon {
    font-size: 20px;
    margin-bottom: 1px;
}
.diablo-slot.active {
    border-style: solid;
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.1) !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4) !important;
    color: white;
}
.diablo-slot-head { grid-area: head; }
.diablo-slot-chest { grid-area: chest; }
.diablo-slot-weapon { grid-area: weapon; border-color: rgba(239, 68, 68, 0.3); }
.diablo-slot-shield { grid-area: shield; border-color: rgba(16, 185, 129, 0.3); }

/* D3 MEMORY GRAPH STYLES */
.d3-node {
    cursor: pointer;
    stroke-width: 1.5px;
    transition: all 0.3s ease;
}
.d3-node:hover {
    stroke-width: 3px !important;
    filter: drop-shadow(0 0 8px currentColor);
}
.d3-link {
    stroke-opacity: 0.25;
    stroke-dasharray: 4, 3;
    animation: d3-dash 45s linear infinite;
}
@keyframes d3-dash {
    to {
        stroke-dashoffset: -1000;
    }
}
.d3-text {
    font-family: 'Outfit', sans-serif;
    font-size: 9px;
    font-weight: 500;
    fill: #f1f5f9;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

/* QUEST TIMELINE & CLOCK */
.quest-timeline-container {
    position: relative;
    padding-left: 20px;
}
.quest-node {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}
.quest-node:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.85);
    transform: translateX(4px);
}
.quest-node::before {
    content: '';
    position: absolute;
    left: -19px;
    top: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #475569;
    border: 2px solid #060913;
    box-shadow: 0 0 4px rgba(255,255,255,0.2);
    z-index: 2;
    transition: all 0.3s ease;
}
.quest-node.active {
    border-color: rgba(6, 182, 212, 0.3);
}
.quest-node.active::before {
    background: #06b6d4;
    box-shadow: 0 0 8px #06b6d4;
}
.quest-node.completed {
    border-color: rgba(16, 185, 129, 0.3);
}
.quest-node.completed::before {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}
.quest-node.locked {
    border-color: rgba(239, 68, 68, 0.3);
}
.quest-node.locked::before {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

.npc-routine-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}
.npc-routine-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

/* COMBAT TURN TRACKER WHEEL */
.turn-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #cbd5e1;
    min-width: 100px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.turn-card:hover {
    border-color: rgba(255,255,255,0.15);
    background: rgba(15, 23, 42, 0.9);
    transform: translateY(-1px);
}
.turn-card.active {
    border-color: #06b6d4 !important;
    background: rgba(6, 182, 212, 0.12) !important;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.5) !important;
    color: white;
    font-weight: 700;
    transform: scale(1.05);
}
.turn-card-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid currentColor;
}

/* LORE FACTS TOOLTIP HIGHLIGHTING */
.lore-highlight-link {
    color: #67e8f9 !important;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1.5px dashed #06b6d4;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 2px;
    border-radius: 2px;
}
.lore-highlight-link:hover {
    background: rgba(6, 182, 212, 0.12);
    color: white !important;
    text-shadow: 0 0 8px #06b6d4;
    border-bottom-style: solid;
}

/* CYBER-SKIN PRESETS (THEME OVERWRITES) */
:root[data-theme="cyan"] {
    --primary-color: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.35);
    --cyber-color: #06b6d4;
    --cyber-glow: rgba(6, 182, 212, 0.3);
}
:root[data-theme="gold"] {
    --primary-color: #d97706;
    --primary-glow: rgba(217, 119, 6, 0.35);
    --cyber-color: #fbbf24;
    --cyber-glow: rgba(251, 191, 36, 0.3);
}
:root[data-theme="purple"] {
    --primary-color: #db2777;
    --primary-glow: rgba(219, 39, 119, 0.35);
    --cyber-color: #a855f7;
    --cyber-glow: rgba(168, 85, 247, 0.3);
}
:root[data-theme="green"] {
    --primary-color: #059669;
    --primary-glow: rgba(5, 150, 105, 0.35);
    --cyber-color: #22c55e;
    --cyber-glow: rgba(34, 197, 94, 0.3);
}

/* DIABLO SLOT SPECIAL OVERLAYS */
.diablo-slot-broken {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.08) !important;
    animation: diablo-broken-glowing 2s infinite alternate;
}
.diablo-slot-broken::after {
    content: '⚠️';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 8px;
}
.diablo-slot-cooldown {
    border-color: #3b82f6 !important;
    background: rgba(15, 23, 42, 0.85) !important;
    cursor: not-allowed !important;
}
.diablo-slot-cooldown::before {
    content: '';
    position: absolute;
    inset: 0;
    background: conic-gradient(rgba(59, 130, 246, 0.4) 0%, transparent 100%);
    border-radius: inherit;
    animation: diablo-cooldown-spin 3s linear infinite;
    pointer-events: none;
}
@keyframes diablo-broken-glowing {
    0% { box-shadow: inset 0 0 4px rgba(239, 68, 68, 0.2), 0 0 2px rgba(239, 68, 68, 0.1); }
    100% { box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.4), 0 0 8px rgba(239, 68, 68, 0.25); }
}
@keyframes diablo-cooldown-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* PIE DE PÁGINA LEGAL & COMPLIANT PREMIUM GLASSMORPHISM */
.glass-neon-footer {
    background: rgba(5, 8, 18, 0.42);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1.5px solid rgba(255, 255, 255, 0.04) !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}
.glass-neon-footer:hover {
    border-top-color: rgba(255, 255, 255, 0.08) !important;
    background: rgba(5, 8, 18, 0.55);
}
.legal-link {
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    font-size: 11px;
    letter-spacing: 0.2px;
}
.legal-link:hover {
    color: var(--user-accent, #8b5cf6);
    text-shadow: 0 0 8px var(--user-glow, rgba(139, 92, 246, 0.3));
}
.legal-links-row span {
    color: rgba(255, 255, 255, 0.12);
    user-select: none;
}

/* TEXTAREAS DE ADMINISTRACIÓN LEGAL CYBERPUNK */
#tab-admin-legal textarea {
    transition: all 0.25s ease;
}
#tab-admin-legal textarea:focus {
    border-color: var(--warning-color) !important;
    background: rgba(0, 0, 0, 0.5) !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

/* ==========================================================================
   FASE 8: ESTILOS PREMIUM PARA PASARELA DE STRIPE, MONETIZACIÓN E IA
   ========================================================================== */

/* Cards de Planes de Checkout */
.checkout-plan-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(8, 12, 24, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 280px;
    overflow: hidden;
}

.checkout-plan-card:hover {
    transform: translateY(-4px);
    border-color: var(--cyber-color, #00f3ff);
    box-shadow: 0 8px 25px rgba(0, 243, 255, 0.12);
}

/* Plan con Oferta Activa */
.checkout-plan-card.has-promo {
    border-color: var(--warning-color, #f59e0b);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.08);
}

.checkout-plan-card.has-promo:hover {
    border-color: var(--warning-color, #f59e0b);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.2);
}

/* Badge de Oferta */
.promo-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: black;
    font-size: 8px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    gap: 4px;
}

.countdown-text {
    font-family: monospace;
    font-weight: 700;
    color: #4b0000;
    background: rgba(255, 255, 255, 0.3);
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 8px;
}

/* Plan Header y Cuerpo */
.plan-header {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.plan-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: 'Outfit', sans-serif;
    color: white;
}

.plan-desc {
    margin: 0;
    font-size: 10px;
    color: #94a3b8;
    line-height: 1.4;
}

/* Precios */
.plan-pricing-box {
    margin: 12px 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.plan-price-original {
    font-size: 11px;
    text-decoration: line-through;
    color: #64748b;
    font-family: monospace;
}

.plan-price-current {
    font-size: 22px;
    font-weight: 800;
    color: var(--cyber-color, #00f3ff);
    font-family: monospace;
}

.plan-price-current.promo-active {
    color: var(--warning-color, #f59e0b);
}

.plan-price-period {
    font-size: 9px;
    color: #64748b;
}

/* Características / Features */
.plan-features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.plan-feature-item {
    font-size: 10px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-feature-item i {
    color: var(--cyber-color, #00f3ff);
    font-size: 8px;
}

.checkout-plan-card.has-promo .plan-feature-item i {
    color: var(--warning-color, #f59e0b);
}

/* Botón de Pago */
.btn-plan-purchase {
    width: 100%;
    padding: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    font-family: 'Outfit', sans-serif;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.btn-plan-purchase.primary {
    background: linear-gradient(135deg, #00f3ff 0%, #0d9488 100%);
    color: black;
}

.btn-plan-purchase.primary:hover {
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.4);
    opacity: 0.95;
}

.btn-plan-purchase.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: black;
}

.btn-plan-purchase.warning:hover {
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
    opacity: 0.95;
}

/* Historial de Recibos */
#profile-receipts-table-body tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: background 0.2s ease;
}

#profile-receipts-table-body tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

#profile-receipts-table-body td {
    padding: 8px;
    vertical-align: middle;
}

/* Tabla de Configuración de Planes Admin */
#admin-payment-plans-table-body tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s ease;
}

#admin-payment-plans-table-body tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

#admin-payment-plans-table-body td {
    padding: 8px;
    vertical-align: middle;
}

/* Custom Scrollbar Premium */
.scroll-premium::-webkit-scrollbar {
    width: 6px;
}

.scroll-premium::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

.scroll-premium::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
}

.scroll-premium::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.12);
}

/* ==========================================================================
   CODEX ZERO: VIDEOGAME MAIN MENU & SUB-PANELS STYLING
   ========================================================================== */

.videogame-menu-layout {
    display: flex;
    gap: 24px;
    align-items: stretch;
    margin-top: 30px;
    min-height: 420px;
    width: 100%;
}

.videogame-main-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 32%;
    border-right: 1.5px solid rgba(255, 255, 255, 0.05);
    padding-right: 20px;
    justify-content: flex-start;
}

.game-menu-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    padding: 12px 20px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.game-menu-item .menu-pointer {
    font-size: 9px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.25s ease;
    color: var(--cyber-color, #00f3ff);
}

.game-menu-item:hover, .game-menu-item.active {
    color: white;
    background: rgba(139, 92, 246, 0.08);
    border-color: var(--cyber-color, #00f3ff);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.15), inset 0 1px 2px rgba(255,255,255,0.05);
    transform: translateX(6px);
}

.game-menu-item:hover .menu-pointer, .game-menu-item.active .menu-pointer {
    opacity: 1;
    transform: translateX(0);
}

.game-menu-item.text-danger:hover {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.08) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15) !important;
}

.game-menu-item.text-danger .menu-pointer {
    color: #ef4444 !important;
}

/* Panel de Detalles Derecho */
.videogame-details-panel {
    flex: 1;
    min-height: 400px;
    padding: 28px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: linear-gradient(135deg, rgba(6, 9, 21, 0.9) 0%, rgba(15, 23, 42, 0.98) 100%);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
}

.sub-panel {
    display: none;
    flex-direction: column;
    height: 100%;
    animation: fadeInGamePanel 0.35s ease;
}

.sub-panel.active {
    display: flex;
}

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

.panel-neon-title {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    color: white;
    letter-spacing: 1.5px;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1.5px solid var(--cyber-color, #00f3ff);
    padding-bottom: 8px;
    text-shadow: 0 0 12px rgba(0, 243, 255, 0.35);
}

.welcome-stat-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 100px;
}

.welcome-stat-box .stat-num {
    font-size: 20px;
    font-weight: 800;
    font-family: monospace;
}

.welcome-stat-box .stat-lbl {
    font-size: 9px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: bold;
}

.game-version-tag {
    margin-top: auto;
    font-size: 8.5px;
    font-family: monospace;
    color: rgba(255, 255, 255, 0.15);
    align-self: flex-end;
}

/* Ajustes Grid */
.settings-sections-wrapper {
    max-height: 310px;
    overflow-y: auto;
    padding-right: 5px;
}

.setting-block {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 12px;
}

.setting-row-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.setting-row-inline:last-child {
    margin-bottom: 0;
}

/* Guiado de Beta de Prueba (Tutorial Card/Overlay) */
.guided-tutorial-overlay {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 320px;
    background: linear-gradient(135deg, rgba(8, 12, 28, 0.97) 0%, rgba(13, 20, 48, 0.99) 100%);
    border: 2px solid var(--cyber-color, #00f3ff);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.4), inset 0 2px 4px rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
    z-index: 9999;
    font-family: 'Outfit', sans-serif;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideInTutorial 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes slideInTutorial {
    from { transform: translateY(100px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.tutorial-step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}

.tutorial-step-title {
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--cyber-color, #00f3ff);
    letter-spacing: 0.5px;
}

.tutorial-step-badge {
    font-size: 9px;
    background: rgba(0, 243, 255, 0.15);
    border: 1px solid rgba(0, 243, 255, 0.3);
    padding: 1px 6px;
    border-radius: 4px;
    color: #00f3ff;
}

.tutorial-step-body {
    font-size: 11.5px;
    line-height: 1.45;
    color: #cbd5e1;
}

.tutorial-step-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.tutorial-step-btn {
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-family: 'Outfit';
    text-transform: uppercase;
}

.tutorial-step-btn-primary {
    background: var(--cyber-color, #00f3ff);
    color: black;
}

.tutorial-step-btn-primary:hover {
    box-shadow: 0 0 10px var(--cyber-color, #00f3ff);
}

/* PANIC BUTTON & AUTONOMY STYLES */
.btn-danger-glow {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: white;
    border: 1px solid #f87171;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.btn-danger-glow:hover {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
    transform: translateY(-1px);
}

@keyframes panic-pulse {
    0% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
        border-color: rgba(239, 68, 68, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
        border-color: rgba(239, 68, 68, 1);
    }
    100% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
        border-color: rgba(239, 68, 68, 0.5);
    }
}

.pending-action-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 8px;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}
.pending-action-item:hover {
    background: rgba(0, 243, 255, 0.04);
    border-color: rgba(0, 243, 255, 0.2);
}
.pending-action-content {
    flex: 1;
    margin-right: 10px;
    line-height: 1.3;
    color: #e2e8f0;
}

/* CODEX ZERO CRYSTAL PRISM SYSTEM */
.prism-container-visual {
    position: relative;
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px auto;
    overflow: hidden;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.laser-beam {
    position: absolute;
    height: 2px;
    top: 50%;
    transform: translateY(-50%);
}

.white-laser {
    left: 0;
    width: 45%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), #ffffff 100%);
    box-shadow: 0 0 8px #ffffff, 0 0 15px rgba(255,255,255,0.5);
    animation: laser-pulse 1.5s infinite alternate;
}

.prism-glass {
    position: absolute;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.03) 100%);
    border: 1.5px solid rgba(255,255,255,0.25);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2), inset 0 0 10px rgba(255,255,255,0.1);
    transform: rotate(45deg);
    z-index: 10;
    animation: prism-glow-internal 3s infinite ease-in-out alternate;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.prism-glass-inner {
    position: absolute;
    inset: 4px;
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 2px;
}

.rainbow-laser {
    right: 0;
    width: 45%;
    background: linear-gradient(90deg, 
        #ffffff 0%, 
        #00f3ff 20%, 
        #a855f7 40%, 
        #ec4899 60%, 
        #fbbf24 80%, 
        transparent 100%
    );
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4), 0 0 20px rgba(168, 85, 247, 0.3);
    animation: laser-pulse 1.5s infinite alternate-reverse;
}

@keyframes laser-pulse {
    0% { opacity: 0.8; height: 1.5px; }
    100% { opacity: 1; height: 3.5px; }
}

@keyframes prism-glow-internal {
    0% {
        transform: rotate(45deg) scale(0.98);
        border-color: rgba(255,255,255,0.2);
        box-shadow: 0 0 15px rgba(0, 243, 255, 0.15);
    }
    100% {
        transform: rotate(45deg) scale(1.02);
        border-color: rgba(0, 243, 255, 0.5);
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
    }
}

/* =====================================================================
   SISTEMA DE MODALES Y COMPONENTES PREMIUM (LIMPUESTA DE ESTILOS INLINE)
   ===================================================================== */
.vtt-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10020;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}
.vtt-modal-overlay.blur-heavy {
    backdrop-filter: blur(12px);
}
.vtt-modal-overlay.blur-ultra {
    backdrop-filter: blur(15px);
    background: rgba(5, 8, 18, 0.92);
}
.vtt-modal-container {
    width: 500px;
    max-width: 90%;
    height: 600px;
    max-height: 85vh;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    color: white;
}
.vtt-modal-container.wide {
    width: 820px;
    max-width: 95%;
    max-height: 90vh;
    border-radius: 16px;
}
.vtt-modal-container.card-style {
    width: 420px;
    padding: 30px;
    border-radius: 16px;
}
.vtt-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
    flex-shrink: 0;
}
.vtt-modal-subtitle {
    margin: 0;
    font-size: 10px;
    color: #94a3b8;
    flex-shrink: 0;
}
.vtt-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 12px;
    flex-shrink: 0;
    font-size: 10px;
    color: #64748b;
}
.vtt-modal-footer.light {
    border-top: 1.5px solid rgba(255, 255, 255, 0.03);
    padding-top: 8px;
    margin-top: 2px;
}
.cookie-banner-container {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 380px;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(0, 243, 255, 0.25);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.15);
    z-index: 99999;
    flex-direction: column;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    background: rgba(5, 8, 18, 0.95);
    backdrop-filter: blur(10px);
}

/* RESPONSIVE MOBILE COMPANION VIEW */
@media (max-width: 768px) {
    /* Hide floating collapse buttons */
    .hud-collapse-btn {
        display: none !important;
    }
    
    /* Layout: Stacking the components in columns/rows */
    .dashboard-body {
        flex-direction: column !important;
        height: auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 10px !important;
        gap: 16px !important;
    }
    
    /* Sidebar: Convert the vertical navigation to a stacked or horizontal navigation card */
    .sidebar {
        width: 100% !important;
        height: auto !important;
        padding: 12px !important;
        box-sizing: border-box !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        justify-content: center !important;
        width: 100% !important;
    }
    
    .sidebar-nav .nav-item {
        flex: 1 1 30% !important; /* Stack neatly on row */
        justify-content: center !important;
        font-size: 11px !important;
        padding: 8px !important;
    }
    
    .sidebar-status-box {
        width: 100% !important;
        margin-top: 10px !important;
        box-sizing: border-box !important;
    }

    /* Workspace: Stretched to full width and scrolled locally or in main wrapper */
    .workspace {
        width: 100% !important;
        height: auto !important;
        padding: 16px !important;
        box-sizing: border-box !important;
        overflow: visible !important; /* Allow natural scrolling */
        border-radius: 12px !important;
    }
    
    /* Game Chat: Convert to full width below the workspace */
    .game-chat {
        width: 100% !important;
        height: 480px !important;
        padding: 14px !important;
        box-sizing: border-box !important;
        border-radius: 12px !important;
    }
    
    /* Form groups & Grid inputs on mobile */
    .grid-2-columns, .grid-3-columns {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    /* Canvases on mobile: Keep them from stretching or breaking layouts */
    #battlemap-canvas {
        display: none !important; /* Hide tactical map canvas on mobile as it requires precise mouse drag */
    }
    .battlemap-wrapper {
        height: 60px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(6, 9, 19, 0.9) !important;
    }
    .battlemap-wrapper::after {
        content: "Mapa táctico oculto en móvil. Usa el chat y fichas." !important;
        color: #64748b !important;
        font-size: 11px !important;
        font-family: sans-serif !important;
        display: block !important;
        text-align: center !important;
    }
    .battlemap-info-bar {
        display: none !important;
    }
    
    #dice-tapete-canvas {
        width: 100% !important;
        height: 180px !important; /* Shorter dice tapete on mobile */
    }
    
    /* Modals should be full screen on mobile */
    .vtt-modal-container {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto !important;
        padding: 16px !important;
    }
    
    /* Checkout plans grid: stack options vertically */
    #checkout-plans-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
}









