/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Steam-inspired Color Palette - More Gray */
    --primary-bg: #1e2329;
    --secondary-bg: #171a21;
    --tertiary-bg: #2d3440;
    --surface-bg: #1a1f26;
    --hover-bg: #242a33;
    
    /* Muted blue-gray colors */
    --steam-blue: #7c8fa6;
    --steam-blue-dark: #5a6c7d;
    --steam-gradient-start: #6a7888;
    --steam-gradient-end: #2d3440;
    
    /* Accent Colors */
    --accent-primary: #8599ad;
    --accent-secondary: #c7d5e0;
    --accent-gold: #cdaa7d;
    --accent-green: #a4d007;
    
    /* Text Colors */
    --text-primary: #c7d5e0;
    --text-secondary: #8f98a0;
    --text-white: #ffffff;
    
    /* Status Colors */
    --success: #a4d007;
    --warning: #f48b42;
    --error: #d32f2f;
    
    /* UI Elements */
    --border-color: rgba(0, 0, 0, 0.5);
    --border-light: rgba(255, 255, 255, 0.08);
    --card-gradient-start: rgba(42, 71, 94, 0.6);
    --card-gradient-end: rgba(27, 40, 56, 0.8);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 20px rgba(102, 192, 244, 0.3);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 3px;
    --radius-md: 4px;
    --radius-lg: 6px;
    
    /* Fonts */
    --font-primary: 'Motiva Sans', 'Arial', sans-serif;
    --font-secondary: 'Arial', sans-serif;
}

body {
    font-family: var(--font-secondary);
    background: radial-gradient(ellipse at top, #2d3440 0%, #1e2329 50%, #171a21 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl) 0;
    background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(102,192,244,0.1) 50%, rgba(0,0,0,0) 100%);
    border-bottom: 1px solid var(--border-light);
}

.title {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--text-white);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 1px;
}

.title i {
    margin-right: var(--spacing-md);
    color: var(--steam-blue);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Platform Navigation */
.platform-nav {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.platform-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-secondary);
    font-weight: 400;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.platform-btn:hover {
    background: rgba(124, 143, 166, 0.15);
    color: var(--steam-blue);
}

.platform-btn.active {
    background: linear-gradient(to bottom, #5a6875 0%, #3d4752 100%);
    color: var(--text-white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Tag Filters */
.tag-filters {
    margin-bottom: var(--spacing-xl);
    background: rgba(0, 0, 0, 0.15);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
}

.tag-filters-label {
    display: block;
    color: var(--text-secondary);
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.tag-btn {
    background: rgba(42, 71, 94, 0.3);
    border: 1px solid rgba(124, 143, 166, 0.3);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-secondary);
    font-size: 13px;
    font-weight: 400;
}

.tag-btn:hover {
    background: rgba(42, 71, 94, 0.5);
    border-color: var(--steam-blue);
    color: var(--steam-blue);
    transform: translateY(-1px);
}

.tag-btn.active {
    background: var(--steam-blue);
    border-color: var(--steam-blue);
    color: var(--text-white);
    box-shadow: 0 2px 6px rgba(102, 192, 244, 0.3);
}


/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: linear-gradient(135deg, rgba(42, 71, 94, 0.3) 0%, rgba(27, 40, 56, 0.5) 100%);
    border: 1px solid rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    min-width: 0;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(42, 71, 94, 0.5) 0%, rgba(27, 40, 56, 0.7) 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.stat-icon {
    font-size: 2rem;
    color: var(--steam-blue);
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.stat-content {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    min-width: 0;
    flex: 1;
}

.stat-number {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Filters */
.filters {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.filter-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-group input,
.filter-group select {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-family: var(--font-secondary);
    min-width: 200px;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.2);
}

/* Tag Filter Dropdown */
.filter-group-tags {
    position: relative;
}

.tag-filter-container {
    position: relative;
}

.tag-filter-toggle {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-family: var(--font-secondary);
    min-width: 200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-filter-toggle:hover {
    border-color: var(--steam-blue);
}

.tag-filter-toggle i {
    margin-left: var(--spacing-sm);
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.tag-filter-dropdown.show .tag-filter-toggle i {
    transform: rotate(180deg);
}

.tag-filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 300px;
    max-height: 400px;
    overflow: hidden;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.tag-filter-dropdown.show {
    display: block;
}

.tag-search {
    width: 100%;
    background: var(--tertiary-bg);
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: var(--spacing-sm);
    font-family: var(--font-secondary);
    font-size: 0.9rem;
}

.tag-search:focus {
    outline: none;
    background: rgba(42, 71, 94, 0.5);
}

.tag-list {
    max-height: 350px;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.tag-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.tag-item:hover {
    background: rgba(124, 143, 166, 0.1);
}

.tag-mode-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    background: var(--tertiary-bg);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.tag-mode-btn:hover {
    border-color: var(--steam-blue);
    color: var(--steam-blue);
}

.tag-mode-btn.include-btn.active {
    background: #5cb85c;
    border-color: #5cb85c;
    color: white;
}

.tag-mode-btn.exclude-btn.active {
    background: #d9534f;
    border-color: #d9534f;
    color: white;
}

.tag-name {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: default;
}

/* Scrollbar for tag list */
.tag-list::-webkit-scrollbar {
    width: 8px;
}

.tag-list::-webkit-scrollbar-track {
    background: var(--tertiary-bg);
}

.tag-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.tag-list::-webkit-scrollbar-thumb:hover {
    background: var(--steam-blue);
}

/* Game Stats */
.game-stats {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--secondary-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.game-stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.9rem;
}

.game-stat .stat-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.game-stat .stat-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.game-stat.completed .stat-text {
    color: var(--success);
}

.game-stat.in-progress .stat-text {
    color: var(--warning);
}

/* Game Detail Stats */
.game-detail-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md);
    background: var(--secondary-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.detail-stat {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.detail-stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-stat-value {
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 700;
}

.detail-stat-value.completed {
    color: var(--success);
}

.detail-stat-value.in-progress {
    color: var(--warning);
}

/* Games Grid */
.games-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: var(--spacing-xl);
    align-items: flex-start; /* Align cards to top */
}

.game-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    overflow: visible; /* Allow ribbon to show outside */
    transition: all 0.15s ease;
    cursor: pointer;
    height: auto; /* Auto height to accommodate header + progress bar */
    width: 230px; /* Steam header at 50% (460/2) */
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    margin-bottom: 20px; /* Extra space for floating ribbon */
}

/* Platform-specific widths */
.game-card[data-platform="retroachievements"] {
    width: 96px; /* Square */
}

.game-card[data-platform="gog"] {
    width: 230px;
}

.game-card:hover,
.game-card:focus {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.8);
    background: rgba(124, 143, 166, 0.08);
}

.game-card:focus {
    outline: 2px solid var(--steam-blue);
    outline-offset: 2px;
}

.game-card:focus-visible {
    outline: 2px solid var(--steam-blue);
    outline-offset: 2px;
}

.game-header {
    position: relative;
    height: 96px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Default: fill for Steam headers */
    object-position: center top; /* Show more of the top of Steam headers */
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    background: var(--secondary-bg);
}

/* RetroAchievements: contain to show full square icon */
.game-card[data-platform="retroachievements"] .game-image {
    object-fit: contain;
    background: var(--secondary-bg);
}

.game-image-bg {
    background: linear-gradient(135deg, 
        #667eea 0%, 
        #764ba2 25%, 
        #f093fb 50%, 
        #667eea 75%, 
        #764ba2 100%);
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
}

.game-image-fallback {
    width: 100%;
    height: 100%;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    background: linear-gradient(135deg, 
        #667eea 0%, 
        #764ba2 25%, 
        #f093fb 50%, 
        #667eea 75%, 
        #764ba2 100%);
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
}

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

/* Game Tooltip - appears at mouse position */
.game-tooltip {
    position: absolute;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    max-width: 280px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 6px;
    line-height: 1.3;
}

.tooltip-line {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Legacy styles kept for compatibility */
.completion-percentage {
    font-size: 0.75rem;
    font-weight: 500;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
    margin-bottom: 0.2rem;
    font-family: var(--font-secondary);
    color: var(--text-secondary);
    line-height: 1.2;
}

.completion-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 2px;
}

/* ============================================
   Achievement Progress Bar
   ============================================ */

/* Progress bar container - below header */
.game-progress-overlay {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to right, rgba(42, 71, 94, 0.95), rgba(58, 91, 114, 0.95), rgba(42, 71, 94, 0.95));
    border: 1px solid rgba(124, 143, 166, 0.5);
    padding: 4px 10px;
    border-radius: var(--radius-md);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

/* Single row layout */
.achievement-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Achievement count text */
.achievement-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: #c7d5e0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Platform icon in progress overlay */
.progress-platform-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    filter: brightness(1.2);
}

/* Console icon in progress overlay */
.progress-console-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    filter: brightness(1.2);
}

/* Percentage text */
.progress-percentage {
    font-size: 0.75rem;
    font-weight: 700;
    color: #FFFFFF;
    min-width: 36px;
    text-align: right;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    font-variant-numeric: tabular-nums;
}

/* Ribbon icon for 100% completion */
.progress-ribbon-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

/* ============================================
   Floating Ribbon Badge (100% Complete)
   ============================================ */

.floating-ribbon {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to right, rgba(42, 71, 94, 0.95), rgba(58, 91, 114, 0.95), rgba(42, 71, 94, 0.95));
    border: 1px solid rgba(124, 143, 166, 0.5);
    color: #c7d5e0;
    padding: 4px 9px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

.ribbon-platform-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    filter: brightness(1.2);
}

.ribbon-console-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    filter: brightness(1.2);
}

.ribbon-badge-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    filter: brightness(1.2);
}

.ribbon-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.ribbon-text {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    color: #c7d5e0;
}

/* ============================================
   100% Completion Ribbon
   ============================================ */

.completion-ribbon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #5CB85C 0%, #4A9D4A 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 3;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.completion-ribbon::before {
    content: '🏆';
    font-size: 18px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Pulse animation for completed games */
@keyframes ribbon-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.completion-ribbon {
    animation: ribbon-pulse 2s ease-in-out infinite;
}

/* Hover effects */
@media (hover: hover) {
    .game-card:hover .progress-fill {
        filter: brightness(1.2);
    }
    
    .game-card:hover .completion-ribbon {
        transform: scale(1.1);
        animation: none;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .game-progress-overlay {
        padding: 10px 12px;
    }
    
    .progress-bar {
        height: 10px;
    }
    
    .progress-percentage {
        font-size: 0.8rem;
        min-width: 40px;
    }
    
    .achievement-count {
        font-size: 0.75rem;
        left: 8px;
    }
    
    .completion-ribbon {
        width: 36px;
        height: 36px;
    }
    
    .completion-ribbon::before {
        font-size: 20px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .progress-fill {
        transition: none;
    }
    
    .completion-ribbon {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .progress-bar {
        border: 1px solid #FFFFFF;
    }
    
    .progress-fill {
        background: #FFFFFF;
    }
    
    .game-progress-overlay {
        background: #000000;
    }
}

.completion-date {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: nowrap;
}

.game-platform {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 40px 40px 0;
    border-color: transparent rgba(0, 0, 0, 0.85) transparent transparent;
    z-index: 2;
}

.game-platform::before {
    content: '';
    position: absolute;
    top: 1px;
    right: -38px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 36px 36px 0;
    border-color: transparent rgba(0, 0, 0, 0.3) transparent transparent;
    z-index: 1;
}

.platform-icon {
    position: absolute;
    top: 5px;
    right: -34px;
    width: auto;
    height: 12px;
    object-fit: contain;
    display: block;
    z-index: 3;
    filter: brightness(1.2);
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

.game-platform i {
    position: absolute;
    top: 10px;
    right: -34px;
    font-size: 16px;
    color: var(--text-white);
    z-index: 3;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.game-platform.retroachievements { 
    border-color: transparent rgba(255, 140, 66, 0.9) transparent transparent;
}

.game-platform.retroachievements i {
    color: #fff;
}

.game-platform.steam {
    border-color: transparent rgba(45, 95, 180, 0.9) transparent transparent;
}

.game-platform.steam .platform-icon {
    filter: brightness(1.2) contrast(1.1);
}

.game-platform.gog {
    border-color: transparent rgba(138, 43, 226, 0.9) transparent transparent;
}

.game-platform.gog .platform-icon {
    filter: brightness(1.2) contrast(1.1);
}

.achievement-link {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--steam-blue);
    padding: 6px 8px;
    border-radius: 2px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    z-index: 2;
}

.achievement-link:hover {
    background: var(--steam-blue);
    color: var(--primary-bg);
    transform: scale(1.05);
}

.game-content {
    display: none; /* Hide since we're using overlays now */
}

.game-title {
    font-family: var(--font-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-white);
    line-height: 1.3;
    margin-bottom: 4px;
    white-space: nowrap;
}

.game-progress {
    display: none; /* Moved to overlay */
}

.progress-bar {
    background: var(--secondary-bg);
    height: 8px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-gold));
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.achievements-preview {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.achievement-badge {
    width: 40px;
    height: 40px;
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.achievement-badge:hover {
    transform: scale(1.1);
    border-color: var(--accent-primary);
}

.achievement-badge.unlocked {
    background: var(--accent-primary);
    border-color: var(--accent-gold);
    color: var(--text-primary);
}

.achievement-badge.rare {
    box-shadow: 0 0 10px var(--accent-gold);
}

/* Loading and No Results */
.loading,
.no-results {
    text-align: center;
    padding: var(--spacing-xxl);
    color: var(--text-secondary);
}

.loading i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    color: var(--accent-primary);
}

.no-results i {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

/* Modal */
.achievement-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--tertiary-bg);
    margin: 5% auto;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-lg);
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close-modal:hover {
    color: var(--accent-primary);
}

.modal-body {
    padding: var(--spacing-xl);
}

/* Footer */
.footer {
    background: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-xl);
    text-align: center;
    margin-top: var(--spacing-xxl);
}

.footer p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .platform-nav {
        gap: var(--spacing-sm);
    }
    
    .platform-btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
    }
    
    .filters {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .filter-group input,
    .filter-group select {
        min-width: 100%;
    }
    
    .games-grid {
        justify-content: center;
        gap: 10px;
    }
    
    .game-card {
        height: 96px;
        width: 230px;
    }
    
    .game-card[data-platform="retroachievements"] {
        width: 96px;
    }
    
    .completion-text {
        font-size: 0.75rem;
    }
    
    .game-title {
        font-size: 0.9rem;
    }
    
    .game-platform {
        border-width: 0 32px 32px 0;
    }
    
    .game-platform::before {
        top: 2px;
        right: -30px;
        border-width: 0 28px 28px 0;
    }
    
    .platform-icon {
        top: 4px;
        right: -26px;
        width: 14px;
        height: 14px;
    }
    
    .game-platform i {
        top: 4px;
        right: -26px;
        font-size: 14px;
    }
    
    .achievement-link {
        font-size: 0.8rem;
        padding: var(--spacing-xs);
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .game-detail-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .game-stats {
        padding: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--spacing-sm);
    }
    
    .title {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }
}

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

.game-card {
    animation: fadeIn 0.4s ease forwards;
    opacity: 0;
}

/* Staggered animation for cards */
.game-card:nth-child(1) { animation-delay: 0.02s; }
.game-card:nth-child(2) { animation-delay: 0.04s; }
.game-card:nth-child(3) { animation-delay: 0.06s; }
.game-card:nth-child(4) { animation-delay: 0.08s; }
.game-card:nth-child(5) { animation-delay: 0.1s; }
.game-card:nth-child(6) { animation-delay: 0.12s; }
.game-card:nth-child(n+7) { animation-delay: 0.14s; }

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .game-card {
        animation: none;
        opacity: 1;
    }
    .game-image,
    .game-image-fallback {
        animation: none;
    }
}

/* Rarity indicators */
.rarity-common { border-left: 3px solid var(--text-secondary); }
.rarity-uncommon { border-left: 3px solid var(--success); }
.rarity-rare { border-left: 3px solid var(--warning); }
.rarity-very-rare { border-left: 3px solid var(--accent-primary); }
.rarity-legendary { border-left: 3px solid var(--accent-gold); }