/* ============================================================
   gameschallenge.css — الأنماط الخاصة بصفحة gameschallenge.html
   يُحمَّل بعد الملفات المشتركة، فأي قاعدة هنا تتجاوزها.
   ============================================================ */

/* ============================================================
   gameschallenge.css — الأنماط الخاصة بصفحة gameschallenge.html
   يُحمَّل بعد الملفات المشتركة، فأي قاعدة هنا تتجاوزها.
   ============================================================ */

:root {
    --status-completed: #4ade80;
    --status-pending: #f87171;
    --star-gold: #FFD700;
    --star-empty: #3a3a3a;
}

[data-theme="light"] {
    --glow-cyan-intense: 0 4px 30px rgba(0, 168, 204, 0.3);
    --star-empty: #d0d0d0;
}

/* Page Header */

.page-header {
    padding: 140px 20px 80px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.page-title {
    font-family: var(--font-body);
    font-size: clamp(2.5rem, 6vw, 4rem);
    text-align: center;
    margin-bottom: 50px;
    color: #00D4FF;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5), 0 0 60px rgba(0, 212, 255, 0.3);
    letter-spacing: normal;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 0 0 20px rgba(0, 212, 255, 0.4), 0 0 40px rgba(0, 212, 255, 0.2); }
    to { text-shadow: 0 0 40px rgba(0, 212, 255, 0.8), 0 0 80px rgba(0, 212, 255, 0.4); }
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 50px;
}

/* Stats Dashboard */

.stats-dashboard {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Progress Bar */

/* Year Filter */

.year-filter {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.year-btn {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 1px;
    padding: 12px 30px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-normal);
}

.year-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-accent);
    transform: translateY(-2px);
}

.year-btn.active {
    color: var(--bg-primary);
    background: var(--gradient-neon);
    border-color: transparent;
    box-shadow: var(--glow-cyan);
}

.main-progress {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(0, 139, 139, 0.08) 100%);
    backdrop-filter: blur(15px);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid var(--border-accent);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.main-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-neon);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.progress-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.progress-percentage {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    color: var(--neon-cyan);
    text-shadow: var(--glow-text);
    white-space: nowrap;
}

.progress-bar-container {
    background: var(--bg-tertiary);
    border-radius: 15px;
    height: 30px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-neon);
    border-radius: 15px;
    transition: width 1.5s ease-out;
    width: 0%;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
    animation: shimmer 2s infinite;
}

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

.progress-fraction {
    text-align: center;
    margin-top: 15px;
    font-size: 1rem;
    color: var(--text-muted);
}

.progress-fraction span {
    color: var(--neon-cyan);
    font-weight: 700;
}

/* Stats Cards */

.stats-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 12px rgba(0, 212, 255, 0.35));
}

.stat-card.completed .stat-icon {
    filter: drop-shadow(0 0 12px rgba(74, 222, 128, 0.45));
}

.stat-card.remaining .stat-icon {
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.45));
}

.stat-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(0, 139, 139, 0.08) 100%);
    backdrop-filter: blur(15px);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    border: 1px solid var(--border-accent);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-neon);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-glow);
    box-shadow: var(--glow-cyan-intense);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card.completed {
    border-color: rgba(74, 222, 128, 0.4);
}

.stat-card.completed::before {
    background: linear-gradient(135deg, #4ade80, #22c55e);
}

.stat-card.completed:hover {
    box-shadow: 0 0 40px rgba(74, 222, 128, 0.3);
}

.stat-card.remaining {
    border-color: rgba(251, 191, 36, 0.4);
}

.stat-card.remaining::before {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.stat-card.remaining:hover {
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.3);
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.stat-card.completed .stat-value {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 20px rgba(74, 222, 128, 0.5));
}

.stat-card.remaining .stat-value {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5));
}

.stat-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Games Section */

.games-section {
    padding: 80px 20px 100px;
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--gradient-neon);
    border-radius: 2px;
}

.section-title .accent {
    color: var(--neon-cyan);
    text-shadow: var(--glow-text);
}

/* Games Grid */

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

/* Rating Groups */

.games-groups {
    display: block;
}

.rating-group {
    margin-bottom: 65px;
}

.rating-group:last-child {
    margin-bottom: 0;
}

.rating-group-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 32px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

.rating-group-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: 0;
    width: 120px;
    height: 2px;
    background: var(--gradient-neon);
    border-radius: 2px;
}

.rating-group-badge {
    flex-shrink: 0;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.7rem;
    line-height: 1;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(0, 139, 139, 0.10));
    border: 1px solid var(--border-accent);
    color: var(--neon-cyan);
    box-shadow: 0 0 18px rgba(0, 212, 255, 0.15);
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.rating-group-badge .badge-max {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.rating-group-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rating-group-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rating-group-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Gold tier highlight for 10/10 */

.rating-group[data-tier="gold"] .rating-group-header::after {
    background: linear-gradient(135deg, var(--star-gold), #ffae00);
}

.rating-group[data-tier="gold"] .rating-group-badge {
    border-color: rgba(255, 215, 0, 0.5);
    color: var(--star-gold);
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.18);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.14), rgba(255, 165, 0, 0.08));
}

.rating-group[data-tier="gold"] .rating-group-badge .badge-max {
    color: rgba(255, 215, 0, 0.6);
}

/* Game Card */

.game-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-neon);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
    z-index: 2;
}

.game-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-8px);
    box-shadow: var(--glow-cyan);
}

.game-card:hover::before {
    transform: scaleX(1);
}

/* Game Image */

.game-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.game-card:hover .game-image img {
    transform: scale(1.08);
}

/* Portrait covers for 2023 & 2025 sections (3:4 images) */

#gamesGrid[data-year="2023"] .game-image, #gamesGrid[data-year="2025"] .game-image {
    aspect-ratio: 3 / 4;
}

/* Smaller poster-style grid for 2023 & 2025 */

#gamesGrid[data-year="2023"] .games-grid, #gamesGrid[data-year="2025"] .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.game-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
}

.game-image-placeholder svg {
    width: 60px;
    height: 60px;
    color: var(--text-muted);
    opacity: 0.5;
}

/* Game Content */

.game-content {
    padding: 25px;
}

/* Update: Centered Game Name */

.game-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
    text-align: center;
}

/* Star Rating */

/* Update: Centered Rating */

.game-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-bottom: 15px;
}

/* Update: Smaller Stars for 10-star Layout */

.star {
    width: 17px;
    height: 17px;
    position: relative;
}

.star svg {
    width: 100%;
    height: 100%;
    fill: var(--star-empty);
    transition: all var(--transition-fast);
}

.star.full svg {
    fill: var(--star-gold);
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
}

.star.half {
    position: relative;
    overflow: hidden;
}

.star.half::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: var(--star-gold);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    z-index: 1;
}

.rating-value {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--star-gold);
    margin-right: 8px;
    font-weight: 600;
}

/* Game Review */

.game-review {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
}

.game-review.expanded {
    -webkit-line-clamp: unset;
}

.review-toggle {
    background: none;
    border: none;
    color: var(--neon-cyan);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 15px;
    font-family: var(--font-body);
    transition: all var(--transition-fast);
}

.review-toggle:hover {
    text-shadow: var(--glow-text);
}

/* Game Date */

/* Update: Increased Font Size */

.game-date {
    font-size: 0.95rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 15px;
    border-top: 1px solid var(--border-subtle);
}

.game-date svg {
    width: 16px;
    height: 16px;
    color: var(--neon-cyan);
}

/* Loading State */

.loading-container {
    text-align: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Empty State */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Responsive */

@media (max-width: 1024px) {
    .stats-cards {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 120px 20px 60px;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 3.5rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    /* 2023 & 2025 posters stay 2-up on mobile so they don't fill the screen */

    #gamesGrid[data-year="2023"] .games-grid, #gamesGrid[data-year="2025"] .games-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .games-section {
        padding: 60px 15px 80px;
    }
}

@media (max-width: 480px) {
    .page-title {
        letter-spacing: normal;
    }

    .stat-card {
        padding: 30px 20px;
    }

    .stat-value {
        font-size: 3rem;
    }
}
