/* =========================================================
   🎮 GAMES HUB THEME
   منصة العلوم والرياضيات
   متوافق مع games/index.html الحالي
   ========================================================= */

:root {
    --games-primary: #8b5cf6;
    --games-primary-dark: #6d28d9;
    --games-secondary: #4f46e5;
    --games-accent: #06b6d4;
    --games-pink: #ec4899;
    --games-yellow: #f59e0b;

    --games-bg: #f8fafc;
    --games-text: #0f172a;
    --games-muted: #64748b;

    --games-card: rgba(255, 255, 255, 0.92);
    --games-border: rgba(148, 163, 184, 0.22);

    --games-radius: 24px;
}

/* =========================================================
   RESET
   ========================================================= */

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    position: relative;

    background:
        radial-gradient(
            circle at 8% 12%,
            rgba(139, 92, 246, 0.16),
            transparent 28%
        ),
        radial-gradient(
            circle at 92% 15%,
            rgba(6, 182, 212, 0.13),
            transparent 26%
        ),
        radial-gradient(
            circle at 50% 90%,
            rgba(236, 72, 153, 0.08),
            transparent 30%
        ),
        #f8fafc !important;

    color: var(--games-text);

    overflow-x: hidden;
}

/* =========================================================
   DARK MODE
   ========================================================= */

html:not(.games-light) body {
    background:
        radial-gradient(
            circle at 8% 10%,
            rgba(124, 58, 237, 0.22),
            transparent 30%
        ),
        radial-gradient(
            circle at 92% 15%,
            rgba(6, 182, 212, 0.14),
            transparent 28%
        ),
        radial-gradient(
            circle at 50% 90%,
            rgba(236, 72, 153, 0.10),
            transparent 32%
        ),
        #020617 !important;

    color: #f8fafc;
}

/* =========================================================
   GAMING BACKGROUND
   ========================================================= */

.games-background {
    position: fixed;
    inset: 0;

    pointer-events: none;

    overflow: hidden;

    z-index: 0;
}

.games-background::before,
.games-background::after {
    content: "";

    position: absolute;

    width: 420px;
    height: 420px;

    border-radius: 50%;

    filter: blur(70px);

    opacity: 0.18;

    animation:
        games-floating-orb 12s ease-in-out infinite alternate;
}

.games-background::before {
    top: -160px;
    left: -100px;

    background:
        radial-gradient(
            circle,
            rgba(139, 92, 246, 0.85),
            transparent 68%
        );
}

.games-background::after {
    right: -120px;
    bottom: -170px;

    background:
        radial-gradient(
            circle,
            rgba(6, 182, 212, 0.75),
            transparent 68%
        );

    animation-delay: -5s;
}

@keyframes games-floating-orb {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(45px, 35px) scale(1.12);
    }
}

/* =========================================================
   SMALL GAMING PARTICLES
   ========================================================= */

.games-page::before,
.games-page::after {
    content: "";

    position: fixed;

    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--games-accent);

    box-shadow:
        0 0 12px rgba(6, 182, 212, 0.75);

    opacity: 0.55;

    pointer-events: none;

    z-index: 0;

    animation:
        games-particle 7s ease-in-out infinite;
}

.games-page::before {
    top: 30%;
    left: 4%;
}

.games-page::after {
    top: 55%;
    right: 4%;

    background: var(--games-pink);

    box-shadow:
        0 0 12px rgba(236, 72, 153, 0.75);

    animation-delay: -3s;
}

@keyframes games-particle {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-35px) scale(1.5);
    }
}

/* =========================================================
   MAIN PAGE
   ========================================================= */

.games-page {
    position: relative;

    z-index: 1;

    width: 100%;
    max-width: 1500px;

    margin: 0 auto;

    padding:
        0 28px 35px;

    box-sizing: border-box;
}

/* =========================================================
   TOP BAR
   ========================================================= */

.games-topbar {
    position: sticky;

    top: 0;

    z-index: 100;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding:
        17px 24px;

    background:
        rgba(255, 255, 255, 0.78);

    border-bottom:
        1px solid rgba(148, 163, 184, 0.25);

    box-shadow:
        0 8px 30px rgba(15, 23, 42, 0.07);

    backdrop-filter:
        blur(18px);

    -webkit-backdrop-filter:
        blur(18px);

    border-radius:
        0 0 var(--games-radius) var(--games-radius);
}

html:not(.games-light) .games-topbar {
    background:
        rgba(2, 6, 23, 0.78);

    border-bottom-color:
        rgba(71, 85, 105, 0.32);

    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.35);
}

/* =========================================================
   BRAND
   ========================================================= */

.games-brand {
    display: flex;

    align-items: center;

    gap: 14px;

    min-width: 0;
}

.games-brand-icon {
    position: relative;

    width: 58px;
    height: 58px;

    flex: 0 0 58px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            var(--games-primary),
            var(--games-secondary)
        );

    font-size: 30px;

    box-shadow:
        0 10px 28px rgba(124, 58, 237, 0.30);

    animation:
        games-brand-float 4s ease-in-out infinite;
}

.games-brand-icon::after {
    content: "";

    position: absolute;

    inset: -4px;

    border-radius: 21px;

    border:
        1px solid rgba(139, 92, 246, 0.25);

    animation:
        games-brand-pulse 2.5s ease-in-out infinite;
}

@keyframes games-brand-float {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-4px) rotate(-2deg);
    }
}

@keyframes games-brand-pulse {
    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.08);
    }
}

.games-brand-text {
    min-width: 0;
}

.games-brand-text h1 {
    margin: 0;

    color: #0f172a;

    font-size: 1.45rem;

    font-weight: 900;

    letter-spacing: -0.035em;
}

.games-brand-text p {
    margin:
        4px 0 0;

    color: #64748b;

    font-size: 0.88rem;
}

html:not(.games-light) .games-brand-text h1 {
    color: #f8fafc;
}

html:not(.games-light) .games-brand-text p {
    color: #94a3b8;
}

/* =========================================================
   TOP ACTION
   ========================================================= */

.games-top-actions {
    display: flex;

    align-items: center;

    gap: 10px;
}

.games-action-btn {
    position: relative;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 44px;

    padding:
        0 16px;

    border:
        1px solid rgba(148, 163, 184, 0.25);

    border-radius: 14px;

    background:
        rgba(255, 255, 255, 0.68);

    color: #334155;

    font-family: inherit;

    font-size: 0.9rem;

    font-weight: 800;

    cursor: pointer;

    overflow: hidden;

    backdrop-filter:
        blur(10px);

    -webkit-backdrop-filter:
        blur(10px);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.games-action-btn::before {
    content: "";

    position: absolute;

    top: 0;
    left: -120%;

    width: 70%;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.35),
            transparent
        );

    transform: skewX(-20deg);

    transition:
        left 0.6s ease;
}

.games-action-btn:hover {
    transform: translateY(-2px);

    border-color:
        rgba(124, 58, 237, 0.4);

    box-shadow:
        0 10px 25px rgba(124, 58, 237, 0.12);
}

.games-action-btn:hover::before {
    left: 140%;
}

html:not(.games-light) .games-action-btn {
    background:
        rgba(15, 23, 42, 0.75);

    color: #e2e8f0;

    border-color:
        rgba(71, 85, 105, 0.35);
}

/* =========================================================
   HERO
   ========================================================= */

.games-hero {
    position: relative;

    max-width: 900px;

    margin:
        48px auto 34px;

    text-align: center;

    animation:
        games-hero-enter 0.75s ease both;
}

@keyframes games-hero-enter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.games-hero::before {
    content: "★";

    position: absolute;

    top: 5px;
    left: 4%;

    color:
        rgba(124, 58, 237, 0.55);

    font-size: 25px;

    animation:
        games-star 3s ease-in-out infinite;
}

.games-hero::after {
    content: "✦";

    position: absolute;

    top: 55px;
    right: 5%;

    color:
        rgba(6, 182, 212, 0.65);

    font-size: 30px;

    animation:
        games-star 3.5s ease-in-out infinite reverse;
}

@keyframes games-star {
    0%,
    100% {
        transform:
            translateY(0)
            rotate(0deg)
            scale(1);

        opacity: 0.5;
    }

    50% {
        transform:
            translateY(-10px)
            rotate(15deg)
            scale(1.2);

        opacity: 1;
    }
}

.games-hero-content {
    position: relative;

    z-index: 2;
}

.games-hero h2 {
    margin: 0;

    background:
        linear-gradient(
            90deg,
            #7c3aed,
            #4f46e5,
            #06b6d4,
            #ec4899,
            #7c3aed
        );

    background-size: 250% auto;

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;

    font-size:
        clamp(2.15rem, 5vw, 3.5rem);

    font-weight: 950;

    letter-spacing: -0.055em;

    line-height: 1.18;

    animation:
        games-gradient-text 7s linear infinite;
}

@keyframes games-gradient-text {
    to {
        background-position:
            250% center;
    }
}

.games-hero p {
    max-width: 720px;

    margin:
        16px auto 0;

    color: #64748b;

    font-size: 1rem;

    line-height: 1.85;
}

html:not(.games-light) .games-hero p {
    color: #94a3b8;
}

/* =========================================================
   CONTROLS
   ========================================================= */

.games-controls {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 18px;

    margin:
        0 auto 30px;

    animation:
        games-controls-enter 0.8s 0.12s ease both;
}

@keyframes games-controls-enter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.games-search {
    position: relative;

    flex: 1;

    max-width: 650px;
}

.games-search input {
    width: 100%;

    min-height: 52px;

    box-sizing: border-box;

    padding:
        0 50px 0 18px;

    border:
        1px solid rgba(148, 163, 184, 0.25);

    border-radius: 16px;

    background:
        rgba(255, 255, 255, 0.82);

    color: #0f172a;

    font-family: inherit;

    font-size: 0.95rem;

    outline: none;

    box-shadow:
        0 8px 25px rgba(15, 23, 42, 0.05);

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.games-search input:focus {
    transform: translateY(-1px);

    border-color:
        rgba(124, 58, 237, 0.5);

    box-shadow:
        0 0 0 4px rgba(124, 58, 237, 0.08),
        0 12px 30px rgba(124, 58, 237, 0.08);
}

.games-search-icon {
    position: absolute;

    top: 50%;
    right: 17px;

    transform: translateY(-50%);

    font-size: 18px;

    pointer-events: none;
}

html:not(.games-light) .games-search input {
    background:
        rgba(15, 23, 42, 0.82);

    color: #f8fafc;

    border-color:
        rgba(71, 85, 105, 0.35);
}

html:not(.games-light) .games-search input::placeholder {
    color: #64748b;
}

.games-counter {
    display: flex;

    align-items: center;

    gap: 10px;

    min-height: 52px;

    padding:
        0 18px;

    border-radius: 16px;

    background:
        rgba(255, 255, 255, 0.78);

    border:
        1px solid rgba(148, 163, 184, 0.22);

    color: #64748b;

    box-shadow:
        0 8px 25px rgba(15, 23, 42, 0.05);
}

.games-counter-number {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 32px;
    height: 32px;

    padding:
        0 8px;

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            var(--games-primary),
            var(--games-secondary)
        );

    color: white;

    font-weight: 900;

    box-shadow:
        0 5px 15px rgba(124, 58, 237, 0.22);
}

html:not(.games-light) .games-counter {
    background:
        rgba(15, 23, 42, 0.82);

    color: #94a3b8;

    border-color:
        rgba(71, 85, 105, 0.35);
}

/* =========================================================
   GAME GRID
   ========================================================= */

.games-grid {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(290px, 1fr)
        );

    gap: 22px;
}

/* =========================================================
   GAME CARD
   ========================================================= */

.game-card {
    position: relative;

    min-height: 300px;

    display: flex;

    flex-direction: column;

    box-sizing: border-box;

    padding: 22px;

    overflow: hidden;

    text-decoration: none;

    border-radius:
        var(--games-radius);

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.97),
            rgba(248, 250, 252, 0.90)
        );

    border:
        1px solid rgba(148, 163, 184, 0.22);

    box-shadow:
        0 12px 35px rgba(15, 23, 42, 0.07),
        0 2px 8px rgba(15, 23, 42, 0.04);

    opacity: 0;

    animation:
        games-card-enter 0.6s cubic-bezier(.22,.9,.3,1.12) forwards;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease,
        background 0.3s ease;
}

.game-card:nth-child(1) {
    animation-delay: 0.05s;
}

.game-card:nth-child(2) {
    animation-delay: 0.10s;
}

.game-card:nth-child(3) {
    animation-delay: 0.15s;
}

.game-card:nth-child(4) {
    animation-delay: 0.20s;
}

.game-card:nth-child(5) {
    animation-delay: 0.25s;
}

.game-card:nth-child(6) {
    animation-delay: 0.30s;
}

.game-card:nth-child(7) {
    animation-delay: 0.35s;
}

.game-card:nth-child(8) {
    animation-delay: 0.40s;
}

.game-card:nth-child(9) {
    animation-delay: 0.45s;
}

@keyframes games-card-enter {
    0% {
        opacity: 0;
        transform: translateY(28px) scale(0.94) rotate(-0.8deg);
        filter: blur(5px);
    }
    60% {
        opacity: 1;
        transform: translateY(-5px) scale(1.012) rotate(0.35deg);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0);
        filter: none;
    }
}

/* =========================================================
   CARD LIGHT EFFECT
   ========================================================= */

.game-card::before {
    content: "";

    position: absolute;

    top: -80px;
    right: -80px;

    width: 180px;
    height: 180px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(124, 58, 237, 0.13),
            transparent 68%
        );

    transition:
        transform 0.45s ease,
        opacity 0.45s ease;
}

.game-card::after {
    content: "";

    position: absolute;

    top: 0;
    left: -140%;

    width: 70%;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.12),
            transparent
        );

    transform:
        skewX(-18deg);

    pointer-events: none;

    transition:
        left 0.8s ease;
}

.game-card:hover::before {
    transform:
        scale(1.5);

    opacity: 1;
}

.game-card:hover::after {
    left: 150%;
}

/* =========================================================
   DARK CARDS
   ========================================================= */

html:not(.games-light) .game-card {
    background:
        linear-gradient(
            145deg,
            rgba(15, 23, 42, 0.97),
            rgba(2, 6, 23, 0.96)
        );

    border-color:
        rgba(71, 85, 105, 0.35);

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

/* =========================================================
   CARD HOVER
   ========================================================= */

@media (hover: hover) and (pointer: fine) {

    .game-card:hover {
        transform:
            translateY(-9px)
            scale(1.012);

        border-color:
            rgba(139, 92, 246, 0.52);

        box-shadow:
            0 24px 55px rgba(124, 58, 237, 0.15),
            0 8px 20px rgba(15, 23, 42, 0.08);
    }

    html:not(.games-light) .game-card:hover {
        border-color:
            rgba(139, 92, 246, 0.65);

        box-shadow:
            0 25px 60px rgba(124, 58, 237, 0.18),
            0 10px 25px rgba(0, 0, 0, 0.40);
    }
}

/* =========================================================
   CARD CONTENT
   ========================================================= */

.game-card-content {
    position: relative;

    z-index: 2;

    display: flex;

    flex-direction: column;

    flex: 1;
}

.game-card-content > div:first-child {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;
}

.game-card-content > div:first-child span:first-child {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 34px;
    height: 28px;

    padding:
        0 8px;

    box-sizing: border-box;

    border-radius: 9px;

    background:
        rgba(241, 245, 249, 0.85);

    color: #64748b;

    font-size: 0.78rem;

    font-weight: 900;

    transition:
        transform 0.25s ease,
        background 0.25s ease;
}

.game-card:hover
.game-card-content > div:first-child span:first-child {
    transform:
        rotate(-4deg)
        scale(1.05);
}

html:not(.games-light)
.game-card-content > div:first-child span:first-child {
    background:
        rgba(30, 41, 59, 0.78);

    color: #94a3b8;
}

.game-card-content > div:first-child span:last-child {
    font-size: 40px;

    line-height: 1;

    filter:
        drop-shadow(
            0 6px 9px rgba(15, 23, 42, 0.12)
        );

    transition:
        transform 0.35s ease;
}

.game-card:hover
.game-card-content > div:first-child span:last-child {
    transform:
        translateY(-4px)
        rotate(5deg)
        scale(1.08);
}

/* =========================================================
   GAME ICON
   ========================================================= */

.game-card-icon {
    position: relative;

    width: 56px;
    height: 56px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin-bottom: 15px;

    border-radius: 16px;

    box-shadow:
        0 8px 20px rgba(15, 23, 42, 0.08);

    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease;
}

.game-card:hover .game-card-icon {
    transform:
        translateY(-3px)
        rotate(-3deg)
        scale(1.07);

    box-shadow:
        0 12px 28px rgba(124, 58, 237, 0.16);
}

html:not(.games-light) .game-card-icon {
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.22);
}

/* =========================================================
   TITLE
   ========================================================= */

.game-card-title {
    margin: 0;

    color: #0f172a;

    font-size: 1.2rem;

    font-weight: 900;

    letter-spacing: -0.018em;

    line-height: 1.4;
}

html:not(.games-light) .game-card-title {
    color: #f8fafc;
}

/* =========================================================
   DESCRIPTION
   ========================================================= */

.game-card-description {
    min-height: 48px;

    margin:
        9px 0 0;

    color: #64748b;

    font-size: 0.9rem;

    line-height: 1.7;
}

html:not(.games-light) .game-card-description {
    color: #94a3b8;
}

/* =========================================================
   FOOTER
   ========================================================= */

.game-card-footer {
    position: relative;

    z-index: 2;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-top: auto;

    padding-top: 20px;
}

.game-card-category {
    color: #64748b;

    font-size: 0.78rem;

    font-weight: 800;
}

html:not(.games-light) .game-card-category {
    color: #94a3b8;
}

/* =========================================================
   PLAY BUTTON
   ========================================================= */

.game-card-play {
    position: relative;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 50px;

    padding:
        0 21px;

    overflow: hidden;

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            var(--games-primary),
            var(--games-secondary)
        );

    color: white;

    font-size: 0.88rem;

    font-weight: 900;

    border:
        1px solid rgba(255, 255, 255, 0.12);

    box-shadow:
        0 10px 24px rgba(79, 70, 229, 0.18);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.game-card:hover .game-card-play {
    transform:
        translateY(-2px);

    box-shadow:
        0 14px 30px rgba(124, 58, 237, 0.28);
}

.game-card-play::before {
    content: "";

    position: absolute;

    top: 0;
    left: -120%;

    width: 80%;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.28),
            transparent
        );

    transform:
        skewX(-20deg);

    transition:
        left 0.65s ease;
}

.game-card:hover
.game-card-play::before {
    left: 140%;
}

.game-card-play span,
.game-card-play i {
    position: relative;

    z-index: 2;
}

/* =========================================================
   EXISTING SHINE
   ========================================================= */

.game-card-shine::after {
    opacity: 0.65;

    pointer-events: none;
}

/* =========================================================
   EMPTY STATE
   ========================================================= */

.games-empty {
    display: none;

    padding:
        55px 20px;

    text-align: center;

    color: #64748b;
}

html:not(.games-light) .games-empty {
    color: #94a3b8;
}

/* =========================================================
   FOOTER
   ========================================================= */

.games-footer {
    padding:
        38px 10px 12px;

    text-align: center;

    color: #64748b;

    font-size: 0.82rem;
}

html:not(.games-light) .games-footer {
    color: #64748b;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .games-page {
        padding-left: 16px;
        padding-right: 16px;
    }

    .games-topbar {
        padding:
            14px 16px;
    }

    .games-brand-icon {
        width: 50px;
        height: 50px;

        flex-basis: 50px;

        font-size: 25px;
    }

    .games-brand-text h1 {
        font-size: 1.15rem;
    }

    .games-brand-text p {
        font-size: 0.78rem;
    }

    .games-hero {
        margin-top: 34px;
    }

    .games-hero::before,
    .games-hero::after {
        opacity: 0.4;
    }

    .games-controls {
        flex-direction: column;

        align-items: stretch;
    }

    .games-search {
        max-width: none;
    }

    .games-counter {
        justify-content: center;
    }

    .games-grid {
        grid-template-columns:
            repeat(
                auto-fit,
                minmax(250px, 1fr)
            );

        gap: 16px;
    }

    .game-card {
        min-height: 285px;
    }
}

/* =========================================================
   VERY SMALL SCREENS
   ========================================================= */

@media (max-width: 480px) {

    .games-page {
        padding-left: 12px;
        padding-right: 12px;
    }

    .games-topbar {
        border-radius:
            0 0 18px 18px;
    }

    .games-brand-text p {
        display: none;
    }

    .games-action-btn {
        min-width: 44px;

        padding:
            0 12px;
    }

    .games-action-btn span:last-child {
        display: none;
    }

    .games-hero {
        margin-top: 28px;
    }

    .games-hero h2 {
        font-size: 1.8rem;
    }

    .games-hero p {
        font-size: 0.88rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .game-card {
        min-height: 280px;

        padding: 20px;
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;

        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
    }
}
/* =========================================================
   GAP-FILL + POLISH (تكملة مكونات الصفحة على نفس الروح)
   ========================================================= */

/* صندوق الرصيد — زجاجي أخضر متناسق */
.games-credit-box {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 14px;
    border: 1px solid rgba(34, 197, 94, .30);
    background: rgba(34, 197, 94, .10);
    color: #15803d; font-size: .9rem; font-weight: 800;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: transform .25s ease, box-shadow .25s ease;
}
.games-credit-box:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(34,197,94,.18); }
.games-credit-box strong { color: #16a34a; font-size: 1.05rem; min-width: 18px; text-align: center; }
html:not(.games-light) .games-credit-box {
    border-color: rgba(74, 222, 128, .30); background: rgba(34, 197, 94, .12);
    color: #86efac;
}
html:not(.games-light) .games-credit-box strong { color: #4ade80; }

/* شارة الصف — بنفسجي الثيم */
.game-badge-grade {
    font-size: 10.5px; padding: 4px 9px; border-radius: 8px; font-weight: 800;
    background: rgba(139, 92, 246, .12); color: #7c3aed;
    border: 1px solid rgba(139, 92, 246, .20);
}
html:not(.games-light) .game-badge-grade {
    background: rgba(167, 139, 250, .14); color: #c4b5fd;
    border-color: rgba(167, 139, 250, .26);
}

/* حالة التحميل/الأخطاء + زر إعادة المحاولة */
.games-status { text-align: center; padding: 34px 16px; color: var(--games-muted); line-height: 1.9; font-weight: 600; }
html:not(.games-light) .games-status { color: #94a3b8; }
.games-status button {
    margin-top: 12px; padding: 10px 18px; border-radius: 12px; cursor: pointer;
    border: 1.5px solid rgba(139, 92, 246, .35);
    background: linear-gradient(135deg, rgba(139,92,246,.12), rgba(6,182,212,.12));
    color: #7c3aed; font-weight: 800; font-family: inherit;
    transition: transform .25s ease, box-shadow .25s ease;
}
.games-status button:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(139,92,246,.22); }
html:not(.games-light) .games-status button { color: #c4b5fd; }

/* الحالة الفارغة — أيقونة عائمة */
.games-empty {
    text-align: center; padding: 60px 20px; border-radius: var(--games-radius);
    background: rgba(255,255,255,.72); border: 1.5px dashed rgba(148,163,184,.35);
    margin-top: 8px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
html:not(.games-light) .games-empty { background: rgba(15,23,42,.55); border-color: rgba(71,85,105,.5); }
.games-empty-icon { font-size: 46px; margin-bottom: 12px; animation: games-particle 5s ease-in-out infinite; }
.games-empty h3 { font-size: 18px; font-weight: 900; margin-bottom: 8px; color: var(--games-text); }
.games-empty p { color: var(--games-muted); font-size: 13.5px; font-weight: 600; }

/* =========================================================
   MAGNET SPOTLIGHT + أيقونات حية + سهم اللعب (جذب بصري)
   ========================================================= */

/* طبقة الضوء بتتبع الماوس فوق الكارت — بتتحقن من الـhook ولا تمس المنطق */
.game-card-spot {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
                rgba(139, 92, 246, .16), transparent 62%);
    opacity: 0; transition: opacity .35s ease;
}
html:not(.games-light) .game-card-spot {
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%),
                rgba(167, 139, 250, .20), transparent 62%);
}
@media (hover: hover) and (pointer: fine) {
    .game-card:hover .game-card-spot { opacity: 1; }
}

/* الأيقونة بتعيش وحدها + بوب عند الـhover */
.game-card-icon {
    animation: games-icon-bob 3.8s ease-in-out infinite;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes games-icon-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}
@media (hover: hover) and (pointer: fine) {
    .game-card:hover .game-card-icon {
        animation-play-state: paused;
        transform: scale(1.14) rotate(-6deg);
    }
}

/* زر اللعب ينبض بالثيم */
.game-card-play { transition: transform .3s ease, color .3s ease; }
@media (hover: hover) and (pointer: fine) {
    .game-card:hover .game-card-play { transform: scale(1.07); color: var(--games-primary); }
    .game-card:hover .game-price-free { animation: games-free-pop .45s cubic-bezier(.34,1.56,.64,1); }
}
@keyframes games-free-pop {
    0% { transform: scale(1); } 55% { transform: scale(1.18); } 100% { transform: scale(1); }
}

/* تخفيف الحركة لمن يفضّل */
@media (prefers-reduced-motion: reduce) {
    .game-card-icon { animation: none !important; }
    .game-card-spot { display: none; }
}
