/* =============================================================
   ARCADE GAMES PAGE
   1. Auto-scrolling gallery
   2. Hero intro section
   3. Topic cards and category links
   4. Full-width conclusion band
   ============================================================= */

/* ---------- Gallery header ---------- */
.arcade-page .auto-gallery {
    padding: 60px 20px 30px;
}

.arcade-page .auto-gallery__header {
    max-width: 1240px;
    margin: 0 auto 28px;
    text-align: center;
}

.arcade-page .auto-gallery__header h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 900;
    color: #ffffff;
    line-height: 1.2;
}

.arcade-page .auto-gallery__header h2 span {
    background: linear-gradient(90deg, #f9d800, #84cc16, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.arcade-page .auto-gallery__header p {
    max-width: 620px;
    margin: 10px auto 0;
    color: #9ca3af;
    font-size: 1rem;
}

/* ---------- Gallery viewport and track ---------- */
.arcade-page .auto-gallery__viewport {
    overflow: hidden;
    width: 100%;
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 60px, black calc(100% - 60px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, black 60px, black calc(100% - 60px), transparent 100%);
}

.arcade-page .auto-gallery__track {
    display: flex;
    gap: 16px;
    width: max-content;
    padding: 10px 0;
    will-change: transform;
}

/* Animation starts only after arcade-games.js adds the duplicate set. */
.arcade-page .auto-gallery__track.is-ready {
    animation: arcade-gallery-scroll 32s linear infinite;
}

.arcade-page .auto-gallery:hover .auto-gallery__track,
.arcade-page .auto-gallery:focus-within .auto-gallery__track {
    animation-play-state: paused;
}

/* ---------- Gallery cards ---------- */
.arcade-page .auto-gallery__card {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 300px;
    height: 170px;
    overflow: hidden;
    border-radius: 11px;
    background: #0f172a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    text-decoration: none;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s ease;
}

.arcade-page .auto-gallery__card:hover,
.arcade-page .auto-gallery__card:focus-visible {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 4px 8px rgba(124, 58, 237, 0.12);
    outline: none;
}

.arcade-page .auto-gallery__card:focus-visible {
    box-shadow: 0 0 0 3px #f9d800, 0 10px 28px rgba(0, 0, 0, 0.4);
}

.arcade-page .auto-gallery__card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.arcade-page .auto-gallery__card:hover img,
.arcade-page .auto-gallery__card:focus-visible img {
    transform: scale(1.08);
}

.arcade-page .auto-gallery__title {
    position: absolute;
    inset: auto 0 0 0;
    padding: 18px 16px 14px;
    color: #ffffff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    font-size: 1.05rem;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.arcade-page .auto-gallery__card:hover .auto-gallery__title,
.arcade-page .auto-gallery__card:focus-visible .auto-gallery__title {
    opacity: 1;
    transform: translateY(0);
}

@keyframes arcade-gallery-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ===========================================================
   HERO INTRO SECTION
   =========================================================== */
.arcade-page .arc-intro {
    padding: 30px 20px 50px;
}

.arcade-page .arc-intro__inner {
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
}

.arcade-page .arc-intro__inner h1 {
    margin: 0 0 18px;
    color: #ffffff;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    line-height: 1.15;
}

.arcade-page .arc-intro__inner p {
    margin: 0;
    color: #cfcfcf;
    font-size: clamp(1rem, 1.4vw, 1.125rem);
    line-height: 1.75;
}

/* ===========================================================
   TOPIC CARDS
   =========================================================== */
.arcade-page .topic-card {
    max-width: 1100px;
    margin: 24px auto;
    padding: 36px clamp(20px, 4vw, 44px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.06) 0%, rgba(15, 23, 42, 0.6) 100%);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    transition: border-color 0.25s ease;
}

.arcade-page .topic-card:hover {
    border-color: rgba(124, 58, 237, 0.4);
}

.arcade-page .topic-card p {
    margin: 0 0 22px;
    color: #cfcfcf;
    font-size: 1rem;
    line-height: 1.8;
}

.arcade-page .topic-card p:last-child {
    margin-bottom: 0;
}

.arcade-page .topic-card h2 {
    position: relative;
    margin: 0 0 16px;
    padding-left: 16px;
    color: #ffffff;
    font-size: clamp(1.4rem, 2.2vw, 1.875rem);
    font-weight: 800;
    line-height: 1.25;
}

.arcade-page .topic-card h2::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(180deg, #f9d800, #84cc16, #f97316);
}

.arcade-page .topic-card h3 {
    margin: 18px 0 14px;
    color: #a855f7;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.arcade-page .topic-card ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px 22px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.arcade-page .topic-card ul:last-child {
    margin-bottom: 0;
}

.arcade-page .topic-card li {
    position: relative;
    padding: 6px 0 6px 28px;
    color: #e5e7eb;
    font-size: 0.975rem;
    line-height: 1.55;
}

.arcade-page .topic-card li::before {
    content: "▸";
    position: absolute;
    top: 6px;
    left: 6px;
    color: #f9d800;
    font-size: 0.85rem;
    line-height: 1.55;
}

/* ---------- Purple card variant ---------- */
.arcade-page .topic-card--purple {
    border-color: rgba(255, 255, 255, 0.18);
    background: linear-gradient(160deg, #5a10e4 0%, #7c3aed 100%);
    box-shadow: 0 8px 28px rgba(90, 16, 228, 0.35);
}

.arcade-page .topic-card--purple:hover {
    border-color: rgba(255, 255, 255, 0.32);
}

.arcade-page .topic-card--purple.topic-card--transparent {
    border-color: rgba(255, 255, 255, 0.08);
    background: transparent;
    box-shadow: none;
}

.arcade-page .topic-card--purple p,
.arcade-page .topic-card--purple li {
    color: #f1f1f8;
}

.arcade-page .topic-card--purple h2::before {
    background: #fecb01;
}

.arcade-page .topic-card--purple h3,
.arcade-page .topic-card--purple li::before {
    color: #fecb01;
}

/* ---------- Yellow card variant ---------- */
.arcade-page .topic-card--yellow {
    border-color: #e0b400;
    background: #fecb01;
    box-shadow: 0 8px 28px rgba(240, 188, 0, 0.25);
}

.arcade-page .topic-card--yellow:hover {
    border-color: #c89e00;
}

.arcade-page .topic-card--yellow p,
.arcade-page .topic-card--yellow li {
    color: #1a1a1a;
}

.arcade-page .topic-card--yellow h2 {
    color: #0d0d16;
}

.arcade-page .topic-card--yellow h2::before {
    background: #0d0d16;
}

.arcade-page .topic-card--yellow h3,
.arcade-page .topic-card--yellow li::before {
    color: #5a10e4;
}

/* ---------- Cross-category link ---------- */
.arcade-page .inline-category-link {
    color: #f9d800;
    font-weight: 700;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.arcade-page .inline-category-link:hover,
.arcade-page .inline-category-link:focus-visible {
    color: #84cc16;
}

.arcade-page .inline-category-link:focus-visible {
    border-radius: 3px;
    outline: 2px solid #f9d800;
    outline-offset: 3px;
}

/* ===========================================================
   CONCLUSION
   =========================================================== */
.arcade-page .arc-conclusion {
    margin: 24px 0 0;
    padding: 56px 24px;
    color: #0d0d16;
    background: #fecb01;
    text-align: center;
}

.arcade-page .arc-conclusion__inner {
    max-width: 960px;
    margin: 0 auto;
}

.arcade-page .arc-conclusion h2 {
    margin: 0 0 24px;
    color: #0d0d16;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    line-height: 1.1;
}

.arcade-page .arc-conclusion p {
    margin: 0;
    color: #1a1a1a;
    font-size: clamp(0.95rem, 1.3vw, 1.0625rem);
    line-height: 1.8;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .arcade-page .auto-gallery__track.is-ready {
        animation: none;
        transform: none;
    }

    .arcade-page .auto-gallery__card,
    .arcade-page .auto-gallery__card img,
    .arcade-page .auto-gallery__title {
        transition: none;
    }
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .arcade-page .auto-gallery {
        padding: 40px 14px 20px;
    }

    .arcade-page .auto-gallery__card {
        width: 260px;
        height: 147px;
        border-radius: 14px;
    }

    .arcade-page .auto-gallery__track {
        gap: 14px;
    }

    .arcade-page .auto-gallery__track.is-ready {
        animation-duration: 26s;
    }

    .arcade-page .auto-gallery__viewport {
        -webkit-mask-image: linear-gradient(to right, transparent 0, black 30px, black calc(100% - 30px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, black 30px, black calc(100% - 30px), transparent 100%);
    }

    .arcade-page .arc-intro {
        padding: 20px 16px 36px;
    }

    .arcade-page .topic-card {
        margin: 18px 14px;
        padding: 26px 18px;
        border-radius: 16px;
    }

    .arcade-page .topic-card h2 {
        font-size: 1.25rem;
    }

    .arcade-page .topic-card h3 {
        font-size: 1rem;
    }

    .arcade-page .topic-card ul {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .arcade-page .arc-conclusion {
        margin-top: 18px;
        padding: 40px 18px;
    }
}
