/* ==========================================================================
   OX Game — design system translated from the Stitch "OX Game Design System"
   Midnight Teal base / Molten Gold primary / Emerald trust / Saffron heat
   Fonts: Sora (display) + Plus Jakarta Sans (body)
   ========================================================================== */

:root {
    --bg: #001716;
    --surface: #002423;
    --surface-high: #052f2e;
    --surface-highest: #133b39;
    --surface-lowest: #001111;
    --ink: #c2eae8;
    --muted: #d3c5ac;
    --gold: #fbbf24;
    --gold-soft: #ffe1a7;
    --gold-deep: #402d00;
    --emerald: #4edea3;
    --emerald-deep: #00a572;
    --saffron: #ffbb65;
    --saffron-deep: #f59e0b;
    --danger: #ffb4ab;
    --glass: rgba(13, 61, 60, 0.8);
    --radius-card: 1rem;
    --transition-fast: 180ms ease;
    --transition-med: 250ms ease;
}

html {
    scroll-padding-top: 6rem;
}

body {
    font-size: 16px; /* minimum body size, incl. mobile */
}

/* Every interactive element is clearly clickable */
a, button, [role="button"], summary {
    cursor: pointer;
}

/* Visible focus for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection {
    background: var(--gold);
    color: var(--gold-deep);
}

/* Skip link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: var(--gold);
    color: var(--gold-deep);
    padding: 0.6rem 1rem;
    font-weight: 700;
    border-radius: 0 0 0.5rem 0;
}
.skip-link:focus {
    left: 0;
}

/* ==========================================================================
   Header / navigation
   ========================================================================== */

.site-header {
    background: rgba(0, 36, 35, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.nav-link {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.4rem 0.15rem;
    border-bottom: 2px solid transparent;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}
.nav-link:hover {
    color: var(--gold-soft);
}
.nav-link-active {
    color: var(--gold) !important;
    border-bottom-color: var(--gold);
}

.mobile-menu {
    background: rgba(0, 17, 17, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.mobile-nav-link {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    color: var(--ink);
    font-weight: 600;
    font-size: 1rem;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.mobile-nav-link:hover {
    background: rgba(251, 191, 36, 0.1);
    color: var(--gold-soft);
}
.mobile-nav-link.nav-link-active {
    background: rgba(251, 191, 36, 0.12);
    border-bottom: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-gold,
.btn-outline-emerald,
.btn-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 0.75rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast),
                background var(--transition-fast), color var(--transition-fast),
                opacity var(--transition-fast);
}

.btn-gold {
    background: var(--gold);
    color: var(--gold-deep);
}
.btn-gold:hover {
    box-shadow: 0 0 24px rgba(251, 191, 36, 0.35);
    transform: translateY(-1px);
}
.btn-gold:active {
    transform: scale(0.97);
}

.btn-outline-emerald {
    border: 1px solid var(--emerald);
    color: var(--emerald);
    background: transparent;
}
.btn-outline-emerald:hover {
    background: rgba(78, 222, 163, 0.1);
}
.btn-outline-emerald:active {
    transform: scale(0.97);
}

.btn-card {
    background: var(--surface-high);
    color: var(--gold-soft);
    font-size: 0.8rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
}
.btn-card:hover {
    background: var(--gold);
    color: var(--gold-deep);
}

.btn-download {
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.25);
}

/* ==========================================================================
   Glass panels & cards (Stitch: tonal layering + subtle glassmorphism)
   ========================================================================== */

.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.apk-card {
    transition: transform var(--transition-med), box-shadow var(--transition-med);
}
.apk-card:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

.apk-card-img {
    width: 100%;
    max-width: 9rem;
    aspect-ratio: 1 / 1;
    height: auto;
}

.card-title-link {
    color: inherit;
    transition: color var(--transition-fast);
}
.card-title-link:hover {
    color: var(--gold-soft);
}
/* Make the whole card head clickable through the title */
.card-title-link::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 11rem;
}

/* Corner badge on cards */
.card-badge {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.3rem 0.6rem;
    border-radius: 0 0 0 0.6rem;
}

/* Inline badge on the APK detail hero — static by design, never absolute */
.card-badge-inline {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
}

.card-badge-hot {
    background: var(--saffron-deep);
    color: #2a1700;
}
.card-badge-new {
    background: var(--emerald-deep);
    color: #ffffff;
}

/* ==========================================================================
   Section headers
   ========================================================================== */

.section-head {
    position: relative;
}
.section-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--emerald);
    background: rgba(78, 222, 163, 0.1);
    border: 1px solid rgba(78, 222, 163, 0.3);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    margin-bottom: 0.9rem;
}
.section-tag-hot {
    color: var(--saffron);
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.35);
}
.section-line {
    display: block;
    width: 64px;
    height: 3px;
    margin-top: 1rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold), transparent);
}
.section-line-hot {
    background: linear-gradient(90deg, var(--saffron-deep), transparent);
}

.hot-section {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.05) 0%, rgba(0, 23, 22, 0) 60%);
}

/* ==========================================================================
   Home hero — animated orbs background
   ========================================================================== */

.home-hero {
    background: linear-gradient(180deg, #042f2e 0%, var(--bg) 100%);
}

/* Generated hero background image + readability shade */
.home-hero-img {
    position: absolute;
    inset: 0;
    background-image: url('/assets/images/hero-bg.jpg');
    background-size: cover;
    background-position: center right;
}
.home-hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 23, 22, 0.96) 0%, rgba(0, 23, 22, 0.82) 45%, rgba(0, 23, 22, 0.35) 100%),
        linear-gradient(180deg, rgba(0, 23, 22, 0.25) 0%, rgba(0, 23, 22, 0.95) 100%);
}

/* Right-side hero image */
.hero-side-img {
    width: min(100%, 420px);
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(251, 191, 36, 0.45);
    box-shadow: 0 0 60px rgba(251, 191, 36, 0.28), 0 24px 60px rgba(0, 0, 0, 0.5);
    animation: hero-float 7s ease-in-out infinite alternate;
}
@keyframes hero-float {
    from { transform: translateY(0); }
    to   { transform: translateY(-14px); }
}
@media (max-width: 1023px) {
    .hero-side-img {
        width: min(70%, 340px);
    }
}

.home-hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.22;
    animation: orb-float 14s ease-in-out infinite alternate;
}
.hero-orb-gold {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.55), transparent 70%);
    top: -120px;
    right: -80px;
}
.hero-orb-teal {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(19, 59, 57, 0.9), transparent 70%);
    bottom: -180px;
    left: -120px;
    animation-delay: -5s;
}
.hero-orb-emerald {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 165, 114, 0.4), transparent 70%);
    top: 30%;
    left: 45%;
    animation-delay: -9s;
}
@keyframes orb-float {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(40px, -30px, 0) scale(1.12); }
}

/* ==========================================================================
   APK detail hero — blurred image background
   ========================================================================== */

.apk-hero {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.apk-hero-bg {
    position: absolute;
    inset: -40px;
    background-size: cover;
    background-position: center;
    filter: blur(38px) saturate(1.2);
    transform: scale(1.15);
    opacity: 0.5;
}
.apk-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 23, 22, 0.72) 0%, rgba(0, 23, 22, 0.94) 100%);
}
.apk-hero-img {
    width: 150px;
    height: 150px;
    border: 2px solid rgba(251, 191, 36, 0.5);
    box-shadow: 0 0 34px rgba(251, 191, 36, 0.28);
}
@media (min-width: 768px) {
    .apk-hero-img {
        width: 176px;
        height: 176px;
    }
}

.version-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: var(--muted);
    background: rgba(13, 61, 60, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
}
.stat-chip strong {
    color: var(--gold-soft);
    font-weight: 700;
}

/* ==========================================================================
   Static page hero — blurred logo background
   ========================================================================== */

.page-hero {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.page-hero-bg {
    position: absolute;
    inset: -60px;
    background-image: url('/assets/images/logo.webp');
    background-size: 45%;
    background-position: center;
    background-repeat: repeat;
    filter: blur(46px) saturate(1.1);
    opacity: 0.35;
}
.page-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 47, 46, 0.75) 0%, rgba(0, 23, 22, 0.96) 100%);
}

/* ==========================================================================
   Article content (verbatim content styled by the design system)
   ========================================================================== */

.article-content {
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.75;
}
.article-content .article-title {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 1.65rem;
    line-height: 1.3;
    color: var(--gold-soft);
    margin-bottom: 1.25rem;
}
.article-content h2 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.35;
    color: var(--gold);
    margin: 2.2rem 0 0.9rem;
}
.article-content h3 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.12rem;
    color: var(--emerald);
    margin: 1.8rem 0 0.7rem;
}
.article-content p {
    margin-bottom: 1rem;
    color: var(--ink);
}
.article-content ul,
.article-content ol {
    margin: 0 0 1.2rem 1.4rem;
}
.article-content ul {
    list-style: none;
}
.article-content ul > li {
    position: relative;
    padding-left: 1.35rem;
    margin-bottom: 0.45rem;
}
.article-content ul > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 2px;
    background: var(--gold);
    transform: rotate(45deg);
}
.article-content ol {
    list-style: decimal;
}
.article-content ol > li {
    padding-left: 0.35rem;
    margin-bottom: 0.45rem;
}
.article-content ol > li::marker {
    color: var(--gold);
    font-weight: 700;
}
.article-content a {
    color: var(--emerald);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--transition-fast);
}
.article-content a:hover {
    color: var(--gold-soft);
}
.article-content strong {
    color: var(--gold-soft);
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar-sticky {
    position: sticky;
    top: 6.5rem;
}

.details-list div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.86rem;
}
.details-list div:last-child {
    border-bottom: none;
}
.details-list dt {
    color: var(--muted);
}
.details-list dd {
    color: var(--ink);
    font-weight: 600;
    text-align: right;
}

/* Stars */
.stars {
    display: inline-flex;
    gap: 1px;
}
.star {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
}
.star-fill {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

/* ==========================================================================
   Warning / responsible gambling
   ========================================================================== */

.warning-card {
    background: rgba(147, 0, 10, 0.12);
    border: 1px solid rgba(255, 180, 171, 0.3);
}
.warning-18 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: var(--danger);
    color: #690005;
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
}
.tip-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--danger);
    border: 1px solid rgba(255, 180, 171, 0.35);
    background: rgba(255, 180, 171, 0.08);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
}

/* ==========================================================================
   Footer bits
   ========================================================================== */

.footer-link {
    color: var(--muted);
    transition: color var(--transition-fast);
}
.footer-link:hover {
    color: var(--emerald);
}

/* Scroll-to-top */
.scroll-top-btn {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 60;
    width: 2.9rem;
    height: 2.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: var(--gold);
    color: var(--gold-deep);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity var(--transition-med), transform var(--transition-med),
                visibility var(--transition-med);
}
.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-top-btn:hover {
    box-shadow: 0 0 22px rgba(251, 191, 36, 0.45);
}

/* ==========================================================================
   Scroll animations (JS adds .in-view via IntersectionObserver)
   ========================================================================== */

[data-animate] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 500ms ease, transform 500ms ease;
}
[data-animate].in-view {
    opacity: 1;
    transform: translateY(0);
}
/* If JS is unavailable, keep everything visible */
.no-observer [data-animate] {
    opacity: 1;
    transform: none;
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    [data-animate] {
        opacity: 1;
        transform: none;
    }
    .hero-orb {
        animation: none;
    }
}

/* ==========================================================================
   Small-screen refinements (375px / 768px / 1024px / 1440px are handled by
   Tailwind's sm/md/lg/xl utilities; the tweaks below cover the extremes)
   ========================================================================== */

@media (max-width: 374px) {
    .stat-chip {
        font-size: 0.74rem;
        padding: 0.4rem 0.7rem;
    }
}

@media (min-width: 1440px) {
    .article-content {
        font-size: 1.05rem;
    }
}
