/* ==================== RETROGRADOS GAMING - PREMIUM DESIGN 2024 ==================== */

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Colores Principales */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.3);
    
    /* Colores de Servidores */
    --server-vip: #ff6b6b;
    --server-main: #6366f1;
    --server-2: #8b5cf6;
    --server-exeifer: #06d6a0;
    
    /* Acentos */
    --accent: #06d6a0;
    --accent-dark: #05b384;
    --accent-glow: rgba(6, 214, 160, 0.3);
    
    /* Backgrounds */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-elevated: #22223a;
    
    /* Surfaces */
    --surface: #1a1a24;
    --surface-light: #22223a;
    --surface-lighter: #2a2a40;
    --surface-dark: #12121a;
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-tertiary: #6b7280;
    --text-muted: #4b5563;
    
    /* Borders */
    --border: #2d2d3d;
    --border-light: #3a3a4f;
    --border-lighter: #4a4a5f;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== SCROLLBAR CUSTOM ==================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-lighter);
}

/* ==================== APP CONTAINER ==================== */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.app-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
    animation: rotateGlow 30s linear infinite;
    pointer-events: none;
}

.app-container::before {
  display: none !important;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== PREMIUM HEADER ==================== */
.premium-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(26, 26, 36, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 100;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.premium-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

/* Header Left */
.header-left {
    display: flex;
    align-items: center;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.3));
    transition: transform var(--transition-base);
}

.brand-logo:hover {
    transform: scale(1.05);
}

.brand-text {
    height: 28px;
    width: auto;
}

/* Header Center - Global Search */
.header-center {
    flex: 1;
    max-width: 600px;
    margin: 0 2rem;
}

.global-search {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.625rem 1rem;
    transition: all var(--transition-base);
}

.global-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--surface-light);
}

.search-icon {
    font-size: 1rem;
    margin-right: 0.75rem;
    opacity: 0.6;
}

.global-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.global-search-input::placeholder {
    color: var(--text-tertiary);
}

.search-shortcut {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info-container {
    display: flex;
    align-items: center;
}

.premium-login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.premium-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.premium-login-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1rem;
}

.btn-text {
    font-weight: 600;
}

/* ==================== MAIN CONTENT WRAPPER ==================== */
.main-content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* ==================== MODERN SIDEBAR ==================== */
.modern-sidebar {
    width: 320px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 50;
}

/* Sidebar Sections */
.sidebar-section {
    padding: 1.25rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.section-icon {
    font-size: 1rem;
}

.platform-count {
    background: var(--primary);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

/* Filter Chips */
.filter-chips {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-chip:hover {
    background: var(--surface-lighter);
    border-color: var(--border-light);
    transform: translateX(4px);
}

.filter-chip.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.chip-icon {
    font-size: 1rem;
}

.chip-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.chip-label {
    flex: 1;
}

/* Sidebar Divider */
.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 0 1rem;
}

/* Platforms Search */
.platforms-search-box {
    padding: 0 0 1rem 0;
}

.platforms-search-input {
    width: 100%;
    padding: 0.625rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: all var(--transition-base);
}

.platforms-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.platforms-search-input::placeholder {
    color: var(--text-tertiary);
}

/* Platforms List */
.platforms-list-container {
    overflow-y: auto !important;  /* Forzar scroll vertical */
    max-height: calc(100vh - 300px) !important;
    flex: 1;
}

.platforms-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.loading-platforms-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-tertiary);
}

.platform-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.platform-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform var(--transition-base);
}

.platform-item:hover {
    background: var(--surface-lighter);
    border-color: var(--border-light);
    transform: translateX(4px);
}

.platform-item:hover::before {
    transform: scaleY(1);
}

.platform-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-color: var(--primary);
}

.platform-item.active::before {
    transform: scaleY(1);
}

.platform-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.platform-info {
    flex: 1;
    min-width: 0;
}

.platform-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.platform-sources {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.server-badge-small {
    display: inline-block;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.platform-count {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ==================== PREMIUM CONTENT AREA ==================== */
.premium-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-secondary);
}

/* Platform Header Bar */
.platform-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    gap: 2rem;
}

.platform-header-left {
    flex: 1;
}

.platform-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.platform-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.games-counter {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.platform-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Inline Search Box */
.search-box-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon-inline {
    position: absolute;
    left: 1rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

.inline-search-input {
    width: 300px;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: all var(--transition-base);
}

.inline-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    width: 350px;
}

.inline-search-input::placeholder {
    color: var(--text-tertiary);
}

/* Stats Pills */
.stats-pills {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
}

.stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-pill-separator {
    color: var(--border-light);
    font-weight: 300;
    margin: 0 0.25rem;
}

/* ==================== GAMES VIEWPORT ==================== */
.games-viewport {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
}

.games-grid-wrapper {
    max-width: 100%;
}

/* Premium Games Grid */
.premium-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Game Card Premium */
.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.game-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.game-card:hover::before {
    transform: scaleX(1);
}

.game-info {
    flex: 1;
}

.game-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.game-size {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.game-download-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.game-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--primary-glow);
}

.game-download-btn:active {
    transform: translateY(0);
}

/* ==================== PREMIUM WELCOME STATE ==================== */
.premium-welcome-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.welcome-animation {
    position: relative;
    margin-bottom: 2rem;
}

.welcome-icon-large {
    font-size: 5rem;
    animation: float 3s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.welcome-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, var(--primary-glow), transparent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

.welcome-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

.welcome-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    width: 100%;
    max-width: 800px;
}

.feature-card {
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--transition-base);
}

.feature-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    font-size: 2rem;
}

.feature-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.welcome-stats {
    display: flex;
    gap: 3rem;
}

.welcome-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-text {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==================== LOADING & EMPTY STATES ==================== */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-tertiary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-tertiary);
    text-align: center;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--error);
    text-align: center;
}

/* ==================== PREMIUM MODAL ==================== */
.premium-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.premium-modal-container {
    width: 90%;
    max-width: 500px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header-premium {
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--surface-light), var(--surface));
    border-bottom: 1px solid var(--border);
}

.modal-icon-badge {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    font-size: 1.75rem;
    box-shadow: 0 8px 16px var(--primary-glow);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.modal-content-premium {
    padding: 2rem;
}

.auth-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.auth-step {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.step-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.premium-textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: 'Inter', monospace;
    font-size: 0.875rem;
    resize: vertical;
    outline: none;
    transition: all var(--transition-base);
    margin-bottom: 1.5rem;
}

.premium-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.premium-textarea::placeholder {
    color: var(--text-tertiary);
}

.modal-actions-premium {
    display: flex;
    gap: 1rem;
}

.modal-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-btn.secondary {
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.modal-btn.secondary:hover {
    background: var(--surface-lighter);
    border-color: var(--border-light);
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

/* ==================== HISTORY PANEL ==================== */
.history-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: right var(--transition-base);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel.open {
    right: 0;
}

.history-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 16px;
}

.icon-btn:hover {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.05);
}

.history-stats {
    padding: 1rem 1.5rem;
    background: var(--surface-dark);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.history-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.history-platform-group {
    margin-bottom: 1.5rem;
}

.history-platform-group h4 {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.history-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

.history-item.completed {
    border-left: 3px solid var(--success);
}

.history-item.error {
    border-left: 3px solid var(--error);
}

.history-item-info {
    margin-bottom: 0.5rem;
}

.history-item-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.history-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-open-btn {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    width: 100%;
}

.history-open-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Floating History Button */
.floating-history-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--primary-glow);
    transition: all var(--transition-base);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-history-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px var(--primary-glow);
}

.history-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ==================== NOTIFICATIONS ==================== */
.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .premium-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .modern-sidebar {
        position: fixed;
        left: -320px;
        z-index: 200;
        transition: left var(--transition-base);
    }
    
    .modern-sidebar.open {
        left: 0;
    }
    
    .header-center {
        display: none;
    }
    
    .history-panel {
        width: 100%;
        right: -100%;
    }
    
    .premium-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}




/* ==================== GAME CARDS CON IMÁGENES (ESTILO NETFLIX) ==================== */

.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    height: 100%;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transition: transform var(--transition-base);
    z-index: 2;
}

.game-card:hover {
    border-color: var(--primary);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.game-card:hover::before {
    transform: scaleX(1);
}

/* Placeholder mientras carga la imagen */
.game-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--surface-dark), var(--surface-light));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
}

.game-image-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.image-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Contenedor de imagen con overlay */
.game-image-container {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    background: var(--surface-dark);
}

.game-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.game-card:hover .game-card-image {
    transform: scale(1.1);
}

/* Overlay con rating y metacritic */
.game-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.8) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    gap: 8px;
}

.game-card:hover .game-image-overlay {
    opacity: 1;
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: white;
}

.rating-stars {
    color: #ffd700;
    font-size: 0.75rem;
    letter-spacing: 2px;
}

.rating-number {
    font-weight: 700;
    background: rgba(0,0,0,0.6);
    padding: 2px 8px;
    border-radius: 4px;
}

.game-metacritic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 1.125rem;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Info del juego (debajo de la imagen) */
.game-info {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.game-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.game-size {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* Botón de descarga */
.game-download-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-top: auto;
}

.game-download-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--primary-glow);
}

.game-download-btn:active {
    transform: translateY(0);
}

/* Animación cuando se carga la imagen */
.game-card.has-image {
    animation: cardFadeIn 0.5s ease;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== MODAL DE DETALLE DEL JUEGO (ESTILO STEAM/NETFLIX) ==================== */

.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content-wrapper {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.modal-content-wrapper::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

.modal-content-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.game-modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    position: relative;
}

/* Botón de cerrar */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 10;
    backdrop-filter: blur(10px);
}

.modal-close-btn:hover {
    background: var(--error);
    border-color: var(--error);
    transform: rotate(90deg) scale(1.1);
}

/* Header del modal con imagen de fondo */
.modal-header {
    height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(10,10,15,0.95) 100%);
}

.modal-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 1;
    margin-bottom: 1rem;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9375rem;
    color: white;
    position: relative;
    z-index: 1;
}

.modal-meta span {
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

/* Header simple (cuando no hay imagen) */
.modal-header-simple {
    padding: 2rem;
    background: linear-gradient(135deg, var(--surface-light), var(--surface));
    border-bottom: 1px solid var(--border);
}

.modal-header-simple .modal-title {
    color: var(--text-primary);
    text-shadow: none;
    margin: 0;
}

/* Screenshots carousel */
.modal-screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding: 1.5rem;
    background: var(--surface-dark);
    border-bottom: 1px solid var(--border);
}

.screenshot-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.screenshot-thumb:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* Body del modal */
.modal-body {
    padding: 2rem;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-description {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Grid de información */
.info-grid {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--surface-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.info-item:hover {
    background: var(--surface-lighter);
    border-color: var(--primary);
}

.info-label {
    font-weight: 600;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.info-value {
    color: var(--text-primary);
    font-size: 0.9375rem;
}

/* Acciones del modal */
.modal-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: var(--surface-dark);
    border-top: 1px solid var(--border);
}

.modal-btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-btn.secondary {
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.modal-btn.secondary:hover {
    background: var(--surface-lighter);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.modal-btn.primary:active {
    transform: translateY(0);
}

/* Loading y Error states en modal */
.modal-loading,
.modal-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    text-align: center;
}

.modal-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1.5rem;
}

.modal-error h3 {
    color: var(--error);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* ==================== AJUSTES PARA GRID DE JUEGOS ==================== */

.premium-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.5s ease;
}

/* Ajuste para cards más altas con imagen */
@media (min-width: 1400px) {
    .premium-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* ==================== RESPONSIVE PARA MODAL ==================== */

@media (max-width: 768px) {
    .modal-content-wrapper {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        height: 300px;
        padding: 1.5rem;
    }
    
    .modal-title {
        font-size: 1.75rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-screenshots {
        grid-template-columns: repeat(2, 1fr);
        padding: 1rem;
    }
    
    .screenshot-thumb {
        height: 100px;
    }
    
    .info-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .modal-actions {
        flex-direction: column;
        padding: 1rem;
    }
    
    .modal-btn {
        width: 100%;
    }
    
    .game-card {
        height: auto;
    }
    
    .game-image-container,
    .game-image-placeholder {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .modal-header {
        height: 250px;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-screenshots {
        grid-template-columns: 1fr;
    }
    
    .premium-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
}

/* ==================== ANIMACIONES ADICIONALES ==================== */

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ==================== MEJORAS VISUALES EXTRA ==================== */

/* Efecto de brillo en hover de cards con imagen */
.game-card.has-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.game-card.has-image:hover::after {
    left: 100%;
}

/* Badge animado para nuevos juegos */
.new-game-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s ease-in-out infinite;
    z-index: 2;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Indicador de carga de más juegos */
.load-more-indicator {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-tertiary);
}

.load-more-indicator .spinner {
    margin-right: 1rem;
}

/* Tooltip para información rápida */
.game-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8125rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.game-card:hover .game-tooltip {
    opacity: 1;
}

/* Efecto de skeleton loading mejorado */
.skeleton-loading {
    background: linear-gradient(90deg, var(--surface-dark) 25%, var(--surface-light) 50%, var(--surface-dark) 75%);
    background-size: 200% 100%;
    animation: skeleton-wave 1.5s ease-in-out infinite;
}

@keyframes skeleton-wave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}




/* ==================== ESTILOS ADICIONALES PARA SCREENSCRAPER ==================== */

/* Badge de región con bandera */
.game-region {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.8);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Status indicator de ScreenScraper */
#scraper-status-indicator {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Indicador de carga de imágenes mejorado */
.image-loading-spinner {
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Placeholder con texto específico de ScreenScraper */
.game-image-placeholder span {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

/* Mejora visual cuando se carga imagen desde ScreenScraper */
.game-card.has-image .game-image-container {
    position: relative;
}

.game-card.has-image .game-image-container::before {
    content: '✓ ScreenScraper';
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--success);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
    backdrop-filter: blur(10px);
}

.game-card.has-image:hover .game-image-container::before {
    opacity: 1;
}

/* Badge de jugadores en modal */
.modal-meta span:has([aria-label="players"]) {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: var(--primary);
    font-weight: 700;
}

/* Mejora de screenshots en modal */
.modal-screenshots {
    position: relative;
}

.modal-screenshots::before {
    content: '📸 Screenshots';
    position: absolute;
    top: -30px;
    left: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Información ROM adicional (CRC, MD5, SHA1) */
.rom-hash-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    background: var(--surface-darker);
    border-radius: var(--radius-md);
    margin-top: 1rem;
    border: 1px solid var(--border);
}

.rom-hash-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rom-hash-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rom-hash-value {
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    color: var(--accent);
    word-break: break-all;
}

/* Indicador de fuente de datos */
.data-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(0, 255, 204, 0.1), rgba(0, 255, 204, 0.05));
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 1rem;
}

.data-source-badge::before {
    content: '🎮';
    font-size: 1rem;
}

/* Estado de "No encontrado" mejorado */
.game-card.no-scraper-data .game-image-placeholder {
    background: linear-gradient(135deg, rgba(255, 100, 100, 0.1), rgba(255, 100, 100, 0.05));
    border: 1px dashed rgba(255, 100, 100, 0.3);
}

.game-card.no-scraper-data .game-image-placeholder span {
    color: rgba(255, 100, 100, 0.8);
}

/* Animación de búsqueda activa */
@keyframes searching {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.game-card.searching-image .image-loading-spinner {
    animation: spin 0.8s linear infinite, searching 2s ease-in-out infinite;
}

/* Tooltip informativo para juegos sin imagen */
.no-image-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

.game-card:hover .no-image-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* Mejora del modal header con información de ScreenScraper */
.modal-header .screenscraper-credit {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 10px;
    border-radius: 6px;
    backdrop-filter: blur(10px);
    z-index: 2;
}

/* Botón para recargar imágenes */
.reload-images-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--primary-glow);
    transition: all var(--transition-base);
    z-index: 999;
    display: none; /* Mostrar solo cuando sea necesario */
}

.reload-images-btn:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: 0 12px 32px var(--primary-glow);
}

.reload-images-btn.visible {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Contador de imágenes cargadas */
.images-counter {
    position: fixed;
    bottom: 100px;
    left: 30px;
    padding: 12px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    z-index: 999;
    display: none;
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.images-counter.visible {
    display: block;
}

.images-counter .counter-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 1.125rem;
}

.images-counter .counter-text {
    color: var(--accent);
}

/* Mejora de grid cuando hay imágenes */
.premium-games-grid.has-images {
    gap: 2rem;
}

.premium-games-grid.has-images .game-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efecto de reveal mejorado para imágenes */
@keyframes imageReveal {
    0% {
        opacity: 0;
        transform: scale(0.8) rotateY(90deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) rotateY(0deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.game-card.has-image .game-image-container {
    animation: imageReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Badge de "NEW" para juegos recién agregados */
.game-card .new-release-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    animation: newBadgePulse 2s ease-in-out infinite;
}

@keyframes newBadgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(255, 107, 107, 0.6);
    }
}

/* Mensaje de "Cargando más imágenes" */
.loading-more-images {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    background: var(--surface-light);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
}

.loading-more-images .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Responsive adicional */
@media (max-width: 768px) {
    #scraper-status-indicator {
        display: none;
    }
    
    .reload-images-btn {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
        bottom: 20px;
        left: 20px;
    }
    
    .images-counter {
        bottom: 80px;
        left: 20px;
        font-size: 0.8125rem;
        padding: 10px 16px;
    }
    
    .game-region {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

/* Efecto de shimmer para placeholder */
.game-image-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 255, 204, 0.1),
        transparent
    );
    animation: shimmerMove 2s infinite;
}

@keyframes shimmerMove {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Estados de calidad de imagen */
.game-image-container.high-quality::after {
    content: 'HD';
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    z-index: 3;
}

/* Info adicional en hover del modal */
.modal-section.expandable {
    cursor: pointer;
    transition: all var(--transition-base);
}

.modal-section.expandable:hover {
    background: var(--surface-lighter);
}

.modal-section.expandable h3::after {
    content: '▼';
    float: right;
    font-size: 0.875rem;
    transition: transform var(--transition-base);
}

.modal-section.expandable.expanded h3::after {
    transform: rotate(180deg);
}

/* Mensaje cuando ScreenScraper está ocupado */
.scraper-busy-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 24px;
    background: rgba(255, 159, 64, 0.95);
    color: white;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(255, 159, 64, 0.4);
    z-index: 10000;
    display: none;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.scraper-busy-message.visible {
    display: block;
}
/* ==================== RAWG ON-DEMAND PLACEHOLDER STYLES ==================== */
.game-image-placeholder {
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-image-placeholder:hover {
    background: linear-gradient(135deg, #1a1b26, #24283b);
    transform: scale(1.02);
}

.placeholder-icon {
    font-size: 3rem;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.game-image-placeholder:hover .placeholder-icon {
    opacity: 0.7;
    transform: scale(1.1);
}

.placeholder-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.game-image-placeholder:hover .placeholder-text {
    opacity: 1;
    color: var(--primary);
}

/* Mejorar game-card para indicar que es clickeable */
.game-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}




/* ==================== GLOBAL SEARCH RESULTS PANEL ==================== */

.global-search-results {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-results-container {
    background: var(--surface-dark);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { 
        opacity: 0;
        transform: translateY(-30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.search-results-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, var(--surface-light), var(--surface-dark));
}

.search-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-results-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.search-results-count {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.close-search-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-search-btn:hover {
    background: var(--surface-light);
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Body */
.search-results-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

/* Platform Groups */
.search-platform-group {
    margin-bottom: 32px;
}

.search-platform-group:last-child {
    margin-bottom: 0;
}

.search-platform-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 8px;
}

.search-platform-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.platform-game-count {
    background: var(--surface-light);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Games List */
.search-games-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-game-item {
    background: var(--surface-light);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
}

.search-game-item:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    transform: translateX(4px);
}

.search-game-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.search-game-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    background: var(--surface-dark);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-game-details {
    flex: 1;
    min-width: 0;
}

.search-game-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-game-name mark {
    background: var(--primary);
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
}

.search-game-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
}

.game-size-small {
    color: var(--text-tertiary);
}

.server-badge-mini {
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.7rem;
    color: white;
}

.search-game-action {
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.search-game-item:hover .search-game-action {
    opacity: 1;
}

.action-hint {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results-icon {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 20px;
}

.no-results h4 {
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.no-results p {
    margin: 8px 0;
    color: var(--text-secondary);
}

.no-results-hint {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* Scrollbar para el panel */
.search-results-body::-webkit-scrollbar {
    width: 8px;
}

.search-results-body::-webkit-scrollbar-track {
    background: var(--surface-dark);
    border-radius: 4px;
}

.search-results-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.search-results-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Responsive */
@media (max-width: 768px) {
    .search-results-container {
        width: 95%;
        max-height: 85vh;
    }
    
    .search-results-header {
        padding: 16px 20px;
    }
    
    .search-results-body {
        padding: 16px;
    }
    
    .search-game-item {
        padding: 10px 12px;
    }
    
    .search-game-icon {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
}

/* Loading state (optional) */
.search-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.search-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}



/* ==================== CACHE REFRESH BUTTON ==================== */

.cache-refresh-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 12px;
}

.cache-refresh-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.cache-refresh-btn:active {
    transform: translateY(0);
}

/* Animación de rotating cuando está refrescando */
.cache-refresh-btn.refreshing {
    pointer-events: none;
    opacity: 0.6;
}

.cache-refresh-btn.refreshing::before {
    content: '🔄';
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 6px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Tooltip para el botón */
.cache-refresh-btn::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-dark);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.cache-refresh-btn:hover::after {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .cache-refresh-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .cache-refresh-btn span {
        display: none; /* Solo mostrar icono en móvil */
    }
}


/* ==================== PLATFORM DETECTION UI ==================== */

/* Contenedor principal */
.platform-detected,
.platform-not-detected {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
}

/* ==================== DETECTADO ==================== */

.platform-detected {
    border-left: 4px solid var(--success);
}

.platform-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.platform-details {
    flex: 1;
}

.platform-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.emulator-name {
    font-size: 0.875rem;
    color: var(--success);
    font-weight: 600;
    margin-bottom: 4px;
}

.emulator-path {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'Courier New', monospace;
    padding: 4px 8px;
    background: var(--surface-dark);
    border-radius: 4px;
    display: inline-block;
}

.change-path-btn {
    padding: 8px 16px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.change-path-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ==================== NO DETECTADO ==================== */

.platform-not-detected {
    border-left: 4px solid var(--warning);
    flex-direction: column;
    align-items: stretch;
}

.warning-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 12px;
}

.warning-message {
    text-align: center;
}

.warning-message h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.warning-message p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.manual-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.manual-actions button {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: var(--surface-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-dark);
    border-color: var(--primary);
    color: var(--primary);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .platform-detected,
    .platform-not-detected {
        flex-direction: column;
        text-align: center;
    }
    
    .platform-details {
        text-align: center;
    }
    
    .change-path-btn {
        width: 100%;
    }
    
    .manual-actions {
        flex-direction: column;
    }
}

/* ==================== ANIMACIONES ==================== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.platform-detected,
.platform-not-detected {
    animation: slideIn 0.3s ease-out;
}

/* ==================== ESTADOS ==================== */

.platform-detected.loading {
    opacity: 0.6;
    pointer-events: none;
}

.platform-detected.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== VARIANTES DE COLOR ==================== */

/* Steam Deck variant */
.platform-detected.steam-deck {
    background: linear-gradient(135deg, rgba(26, 159, 255, 0.1) 0%, rgba(26, 159, 255, 0.05) 100%);
    border-left-color: #1a9fff;
}

.platform-detected.steam-deck .emulator-name {
    color: #1a9fff;
}

/* Windows variant */
.platform-detected.windows {
    background: linear-gradient(135deg, rgba(0, 120, 215, 0.1) 0%, rgba(0, 120, 215, 0.05) 100%);
    border-left-color: #0078d7;
}

.platform-detected.windows .emulator-name {
    color: #0078d7;
}

/* Linux variant */
.platform-detected.linux {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    border-left-color: #ffc107;
}

.platform-detected.linux .emulator-name {
    color: #ffc107;
}





/* ==================== BIOS MANAGER STYLES ==================== */

/* Botón trigger en header */
.bios-trigger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.bios-trigger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.bios-trigger-btn .btn-icon {
  font-size: 1.125rem;
}

/* Modal overlay */
.bios-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

/* Modal container */
.bios-modal-container {
  background: var(--surface-dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.bios-modal-header {
  padding: 32px 32px 24px 32px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, var(--surface-light), var(--surface-dark));
  border-radius: 20px 20px 0 0;
  text-align: center;
}

.bios-icon-badge {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 16px auto;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.bios-title {
  margin: 0 0 8px 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.bios-subtitle {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* Content */
.bios-modal-content {
  padding: 28px 32px;
  overflow-y: auto;
  flex: 1;
}

/* Info Section */
.bios-info-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bios-info-card {
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}

.bios-info-card:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

.bios-info-card .info-icon {
  font-size: 1.75rem;
  width: 48px;
  height: 48px;
  background: var(--surface-dark);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bios-info-card .info-content {
  flex: 1;
  min-width: 0;
}

.bios-info-card .info-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.bios-info-card .info-value {
  font-size: 0.9375rem;
  color: var(--text-primary);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Progress Section */
.bios-progress-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 0;
}

.progress-stage {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-icon {
  font-size: 2rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.stage-label {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.progress-bar-container {
  position: relative;
}

.progress-bar {
  width: 100%;
  height: 40px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6 0%, #6366f1 100%);
  transition: width 0.3s ease;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.progress-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.detail-item {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Success Section */
.bios-success-section {
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.bios-success-section h4 {
  margin: 0 0 12px 0;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.bios-success-section p {
  margin: 8px 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.success-hint {
  font-size: 0.875rem !important;
  color: var(--text-tertiary) !important;
  font-style: italic;
}

/* Error Section */
.bios-error-section {
  text-align: center;
  padding: 40px 20px;
}

.error-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.bios-error-section h4 {
  margin: 0 0 12px 0;
  font-size: 1.5rem;
  color: #ef4444;
}

.bios-error-section p {
  margin: 8px 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* Actions */
.bios-modal-actions {
  padding: 20px 32px 32px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.bios-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.bios-btn.secondary {
  background: var(--surface-light);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.bios-btn.secondary:hover {
  background: var(--surface-hover);
  border-color: var(--text-tertiary);
}

.bios-btn.primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.bios-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.bios-btn.danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.bios-btn.danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.bios-btn .btn-icon {
  font-size: 1.125rem;
}

/* Responsive */
@media (max-width: 768px) {
  .bios-modal-container {
    width: 95%;
    max-height: 90vh;
  }
  
  .bios-modal-header {
    padding: 24px 20px 20px 20px;
  }
  
  .bios-modal-content {
    padding: 20px;
  }
  
  .bios-modal-actions {
    padding: 16px 20px 24px 20px;
    flex-direction: column;
  }
  
  .bios-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Scrollbar */
.bios-modal-content::-webkit-scrollbar {
  width: 8px;
}

.bios-modal-content::-webkit-scrollbar-track {
  background: var(--surface-dark);
  border-radius: 4px;
}

.bios-modal-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.bios-modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}





/* download-queue-styles.css - Estilos Premium para Download Queue */

/* ==================== BADGE FLOTANTE ==================== */
#download-queue-badge {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#download-queue-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

#download-queue-badge:active {
  transform: scale(0.95);
}

.queue-badge-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.queue-icon {
  font-size: 24px;
}

.queue-count {
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* Animación pulse para cuando está descargando */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 8px 48px var(--primary), 0 8px 32px rgba(0, 0, 0, 0.4);
  }
}

/* ==================== PANEL DE COLA ==================== */
#download-queue-panel {
  position: fixed;
  top: 0;
  right: -450px;
  width: 450px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
}

.queue-panel-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ==================== HEADER ==================== */
.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-light);
}

.queue-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.queue-title-icon {
  font-size: 24px;
}

.queue-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.queue-item-count {
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.queue-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.queue-close-btn:hover {
  background: var(--surface);
  color: var(--text-primary);
}

/* ==================== CONTROLES ==================== */
.queue-controls {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-light);
}

.queue-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  font-family: inherit;
}

.queue-btn span {
  font-size: 16px;
}

.queue-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.queue-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.queue-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.queue-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.queue-btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.queue-btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
}

.queue-btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.queue-btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
}

/* ==================== PROGRESO TOTAL ==================== */
.queue-progress-total {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-light);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-current {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-percentage {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.progress-bar-container {
  height: 6px;
  background: var(--surface);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 6px;
  transition: width 0.3s ease;
}

/* ==================== LISTA DE ITEMS ==================== */
.queue-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

/* Scrollbar personalizado */
.queue-items-container::-webkit-scrollbar {
  width: 8px;
}

.queue-items-container::-webkit-scrollbar-track {
  background: transparent;
}

.queue-items-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.queue-items-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Empty state */
.queue-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 40px 20px;
}

.empty-icon {
  font-size: 64px;
  opacity: 0.5;
}

.queue-empty-state p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.queue-empty-state span {
  font-size: 13px;
}

/* ==================== QUEUE ITEM ==================== */
.queue-item {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 16px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.queue-item:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  transform: translateX(-4px);
}

.queue-item.downloading {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--surface-light), rgba(var(--primary-rgb), 0.05));
}

.queue-item.completed {
  border-color: #10b981;
  opacity: 0.7;
}

.queue-item.failed {
  border-color: #ef4444;
}

/* Drag handle */
.queue-item-drag-handle {
  display: flex;
  align-items: center;
  color: var(--text-tertiary);
  font-size: 16px;
  cursor: grab;
  padding: 0 4px;
  user-select: none;
}

.queue-item-drag-handle:active {
  cursor: grabbing;
}

/* Content */
.queue-item-content {
  flex: 1;
  min-width: 0;
}

.queue-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.queue-item-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item-remove {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 18px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.queue-item-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Meta info */
.queue-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.queue-item-platform {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  background: var(--surface);
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.queue-item-size {
  font-size: 12px;
  color: var(--text-secondary);
}

.queue-item-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.queue-item-status-badge.pending {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.queue-item-status-badge.downloading {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.queue-item-status-badge.completed {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.queue-item-status-badge.failed {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Progress */
.queue-item-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.progress-bar-container-small {
  flex: 1;
  height: 4px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-small {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text-small {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  min-width: 35px;
  text-align: right;
}

/* Error */
.queue-item-error {
  margin-top: 8px;
  padding: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  font-size: 11px;
  color: #ef4444;
  word-break: break-word;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  #download-queue-panel {
    width: 100%;
    right: -100%;
  }
  
  .queue-controls {
    flex-wrap: wrap;
  }
  
  .queue-btn {
    min-width: 45%;
  }
}

/* ==================== ANIMACIONES ==================== */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.queue-item {
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== DARK MODE ADJUSTMENTS ==================== */
@media (prefers-color-scheme: dark) {
  .queue-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .queue-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
  }
}



/* ==================== DOWNLOAD QUEUE - GAME ACTIONS ==================== */

.game-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.game-download-btn {
  flex: 1;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.game-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.game-download-btn:active {
  transform: translateY(0);
}

.game-queue-btn {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  min-width: 44px;
}

.game-queue-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.game-queue-btn:active {
  transform: scale(0.95);
}

.game-queue-btn span {
  font-size: 16px;
}

/* Responsive para cards más pequeñas */
@media (max-width: 768px) {
  .game-actions {
    flex-direction: column;
  }
  
  .game-queue-btn {
    min-width: 100%;
  }
}


/* ==================== PROGRESO GLOBAL ==================== */

.global-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.progress-modal {
    background: var(--surface-dark);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.progress-modal h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.progress-modal .download-name {
    margin: 0 0 24px 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-bar-container {
    height: 12px;
    background: var(--surface-light);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
    border-radius: 6px;
}

.progress-text {
    text-align: center;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 12px 0 8px 0;
}

.progress-details {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin: 0;
}


/* ==================== GLOBAL SEARCH LOADER ==================== */
.global-search-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.loader-content {
    background: var(--surface);
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loader-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid var(--surface-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text h3 {
    margin: 0 0 10px;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.loader-status {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 10px 0;
    min-height: 24px;
}

.loader-progress-container {
    background: var(--surface-light);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.loader-details {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin: 10px 0;
}

.loader-details span {
    color: var(--primary);
    font-weight: 600;
}

.loader-hint {
    background: var(--surface-light);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.loader-cancel-btn {
    background: var(--error);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.loader-cancel-btn:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}



/* Floating BIOS Button */
.floating-bios-btn {
  position: fixed;
  bottom: 90px; /* Arriba del botón de historial */
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  line-height: 1;
}

.floating-bios-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
  background: linear-gradient(135deg, #764ba2, #667eea);
}

.floating-bios-btn:active {
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
  .floating-bios-btn {
    width: 56px;
    height: 56px;
    font-size: 20px;
    bottom: 80px;
    right: 20px;
  }
}



/* ==================== FIX: SCROLL EN MODALES ==================== */
/* Los fixes de scroll bloquearon también los modales */

/* ⭐ RESTAURAR SCROLL EN MODALES ⭐ */

/* Modal de juego - DEBE scrollear */
.game-modal,
.modal-overlay,
.search-overlay {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Contenedor del modal - DEBE scrollear */
.modal-content-wrapper {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: 90vh !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
}

/* Contenido del modal - altura automática */
.game-modal-content,
.modal-content {
  overflow: visible !important;
  height: auto !important;
  min-height: auto !important;
}

/* Scrollbar visible en modal */
.modal-content-wrapper::-webkit-scrollbar {
  width: 8px !important;
  display: block !important;
}

.modal-content-wrapper::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3) !important;
  border-radius: 4px !important;
}

.modal-content-wrapper::-webkit-scrollbar-thumb {
  background: var(--primary, #6366f1) !important;
  border-radius: 4px !important;
}

.modal-content-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark, #4f46e5) !important;
}

/* Info del juego dentro del modal */
.game-info,
.modal-body,
.modal-description {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
}

/* Imagen del juego */
.game-image,
.modal-image {
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
}

/* Botones de acción en modal */
.modal-actions,
.modal-footer {
  position: relative !important;
  bottom: auto !important;
  overflow: visible !important;
}

/* BIOS Modal también */
.bios-modal-overlay {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.bios-modal-content {
  overflow-y: auto !important;
  max-height: 90vh !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Search overlay */
.global-search-overlay {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* ⭐ IMPORTANTE: Prevenir que el body se bloquee cuando modal está abierto */
body.modal-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
}

/* Pero permitir scroll en el modal mismo */
body.modal-open .modal-content-wrapper {
  overflow-y: auto !important;
  position: relative !important;
}

/* ⭐ Mobile: Asegurar que scroll funcione */
@media (max-width: 768px) {
  .modal-content-wrapper {
    max-height: 95vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .game-modal-content {
    max-height: none !important;
  }
}

/* ⭐ Fix específico para contenido largo */
.modal-content-wrapper > * {
  flex-shrink: 0 !important;
}