/* =========================================================================
   Games-Juegos theme — Poki-inspired design system
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;500;600;700;800&family=Nunito:wght@400;500;600;700;800&display=swap');

/* -------------------------------------------------------------------------
 *  CSS variables (Poki palette + custom)
 * ------------------------------------------------------------------------- */
:root {
        /* Poki blues */
        --poki-blue:   #009cff;
        --blue-5:      #0074e0;
        --blue-3:      #054a91;
        --blue-1:      #002b50;

        /* Greys */
        --grey-9:      #f9fbff;
        --grey-7:      #f0f5fc;
        --grey-5:      #bac9de;
        --grey-3:      #5d6b84;
        --grey-2:      #2c3550;
        --grey-1:      #0f1226;

        /* Accents */
        --pink-1:      #ff7690;
        --pink-2:      #ff4d8d;
        --amber:       #ffb547;
        --green:       #3cd9a6;
        --purple:      #a855f7;
        --yellow:      #ffd83d;

        /* Surfaces */
        --bg:          var(--grey-9);
        --surface:     #ffffff;
        --surface-2:   var(--grey-7);
        --text:        var(--blue-1);
        --text-soft:   var(--grey-3);
        --border:      var(--grey-5);

        /* Typography */
        --font-display: "Baloo 2", "Nunito", system-ui, -apple-system, sans-serif;
        --font-body:    "Nunito", system-ui, -apple-system, sans-serif;

        /* Radii */
        --r-sm: 6px;
        --r-md: 12px;
        --r-lg: 16px;
        --r-xl: 24px;
        --r-pill: 100px;

        /* Shadows */
        --shadow-sm: 0 1px 2px rgba(5, 74, 145, 0.06);
        --shadow-md: 0 6px 18px rgba(5, 74, 145, 0.10);
        --shadow-lg: 0 14px 38px rgba(5, 74, 145, 0.14);

        /* Layout */
        --container-w: 1280px;
        --header-h: 64px;
        --pills-h: 52px;
}

/* -------------------------------------------------------------------------
 *  Reset
 * ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
        margin: 0;
        font-family: var(--font-body);
        font-size: 16px;
        line-height: 1.55;
        color: var(--text);
        background: var(--bg);
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        overflow-x: hidden;
}
img, video, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { padding: 0; margin: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.2; color: var(--blue-1); }

.gj-font-display { font-family: var(--font-display) !important; font-weight: 700; }

/* -------------------------------------------------------------------------
 *  Layout containers
 * ------------------------------------------------------------------------- */
.gj-container {
        max-width: var(--container-w);
        margin: 0 auto;
        padding: 24px 20px;
}
.gj-main { min-height: 60vh; }

/* -------------------------------------------------------------------------
 *  Header
 * ------------------------------------------------------------------------- */
.gj-header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: saturate(180%) blur(12px);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
        border-bottom: 1px solid rgba(186, 201, 222, 0.45);
        box-shadow: var(--shadow-sm);
        transition: transform 0.3s cubic-bezier(.4,0,.2,1), opacity 0.3s;
}
.gj-header.gj-hidden { transform: translateY(-100%); opacity: 0; }
.gj-header-inner {
        max-width: var(--container-w);
        margin: 0 auto;
        padding: 0 16px;
        height: var(--header-h);
        display: flex;
        align-items: center;
        gap: 16px;
}

.gj-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.gj-brand-mark { display: inline-flex; }
.gj-brand-name {
        font-family: var(--font-display);
        font-size: 22px;
        font-weight: 800;
        color: var(--blue-1);
        letter-spacing: -0.5px;
}
.gj-brand-name em { color: var(--poki-blue); font-style: normal; }

.gj-search {
        flex: 1 1 auto;
        max-width: 480px;
        display: flex;
        align-items: center;
        gap: 8px;
        background: var(--surface-2);
        border: 2px solid transparent;
        border-radius: var(--r-pill);
        padding: 0 16px;
        height: 42px;
        color: var(--text-soft);
        transition: all 0.18s ease;
}
.gj-search:focus-within {
        background: #fff;
        border-color: var(--poki-blue);
        box-shadow: 0 0 0 4px rgba(0, 156, 255, 0.15);
}
.gj-search input {
        flex: 1;
        border: 0;
        background: transparent;
        outline: none;
        font-size: 14px;
        color: var(--text);
}
.gj-search input::placeholder { color: var(--text-soft); }

.gj-nav { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.gj-nav-link {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 8px 14px;
        font-size: 14px;
        font-weight: 600;
        color: var(--blue-3);
        border-radius: var(--r-pill);
        transition: background 0.15s, color 0.15s;
}
.gj-nav-link:hover { background: var(--surface-2); color: var(--poki-blue); }
.gj-nav-link-fav svg { color: var(--pink-1); }
.gj-fav-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        background: var(--pink-1);
        color: #fff;
        font-size: 11px;
        font-weight: 800;
}
.gj-fav-count:empty,
.gj-fav-count[data-count="0"] { display: none; }

.gj-burger {
        display: none;
        width: 38px;
        height: 38px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        border-radius: 8px;
        background: var(--surface-2);
}
.gj-burger span {
        width: 18px;
        height: 2px;
        background: var(--blue-1);
        border-radius: 2px;
        transition: transform 0.2s, opacity 0.2s;
}
.gj-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.gj-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.gj-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Pills bar */
.gj-pills-bar {
        border-top: 1px solid rgba(186, 201, 222, 0.35);
        background: rgba(255, 255, 255, 0.6);
}
.gj-pills-inner {
        max-width: var(--container-w);
        margin: 0 auto;
        padding: 8px 16px;
        display: flex;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
}
.gj-pills-inner::-webkit-scrollbar { display: none; }
.gj-pill {
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 14px;
        font-weight: 600;
        color: var(--blue-3);
        background: var(--surface-2);
        border-radius: var(--r-pill);
        transition: all 0.15s ease;
}
.gj-pill:hover { background: var(--grey-5); color: var(--blue-1); }
.gj-pill.is-active {
        background: linear-gradient(135deg, var(--poki-blue), var(--blue-5));
        color: #fff;
        box-shadow: 0 4px 10px rgba(0, 116, 224, 0.35);
}

/* -------------------------------------------------------------------------
 *  Mobile sidebar
 * ------------------------------------------------------------------------- */
.gj-mobile-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 18, 38, 0.45);
        z-index: 200;
        opacity: 0;
        transition: opacity 0.25s ease;
}
.gj-mobile-backdrop.is-open { opacity: 1; }
.gj-mobile-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, 320px);
        background: #fff;
        z-index: 201;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(.4,0,.2,1);
        display: flex;
        flex-direction: column;
        box-shadow: var(--shadow-lg);
}
.gj-mobile-sidebar.is-open { transform: translateX(0); }
.gj-sidebar-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 18px 20px;
        border-bottom: 1px solid var(--surface-2);
        font-size: 20px;
}
.gj-sidebar-close {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        font-size: 22px;
        background: var(--surface-2);
}
.gj-sidebar-nav {
        flex: 1;
        overflow-y: auto;
        padding: 16px 20px;
        display: flex;
        flex-direction: column;
        gap: 6px;
}
.gj-sidebar-nav a {
        padding: 10px 12px;
        font-weight: 600;
        color: var(--blue-1);
        border-radius: 8px;
}
.gj-sidebar-nav a:hover { background: var(--surface-2); }
.gj-sidebar-nav hr { border: 0; border-top: 1px solid var(--surface-2); margin: 14px 0; }
.gj-sidebar-section {
        display: block;
        margin-bottom: 6px;
        font-size: 12px;
        text-transform: uppercase;
        color: var(--text-soft);
        letter-spacing: 0.06em;
}

/* -------------------------------------------------------------------------
 *  Buttons
 * ------------------------------------------------------------------------- */
.gj-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        height: 44px;
        padding: 0 22px;
        font-family: var(--font-display);
        font-size: 15px;
        font-weight: 700;
        border-radius: var(--r-pill);
        border: 3px solid var(--poki-blue);
        background: transparent;
        color: var(--poki-blue);
        transition: all 0.18s ease;
        position: relative;
        overflow: hidden;
        white-space: nowrap;
}
.gj-btn:hover { transform: translateY(-1px); }
.gj-btn:active { transform: translateY(0); }
.gj-btn-primary {
        background: linear-gradient(135deg, var(--poki-blue), var(--blue-5));
        color: #fff;
        box-shadow: 0 6px 14px rgba(0, 116, 224, 0.35);
}
.gj-btn-primary::after {
        content: '';
        position: absolute;
        top: 0;
        left: -120%;
        width: 60%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
        transform: skewX(-20deg);
        transition: left 0.6s ease;
}
.gj-btn-primary:hover::after { left: 130%; }
.gj-btn-ghost {
        border-color: var(--grey-5);
        color: var(--blue-3);
        background: #fff;
}
.gj-btn-ghost:hover { border-color: var(--poki-blue); color: var(--poki-blue); }
.gj-btn-lg { height: 48px; padding: 0 30px; font-size: 17px; }
.gj-btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.gj-btn-icon {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 10px;
        border: 2px solid var(--grey-5);
        background: #fff;
        color: var(--blue-3);
}
.gj-btn-icon:hover { border-color: var(--poki-blue); color: var(--poki-blue); }

/* -------------------------------------------------------------------------
 *  Hero
 * ------------------------------------------------------------------------- */
.gj-hero {
        position: relative;
        min-height: 480px;
        max-height: 580px;
        display: flex;
        align-items: flex-end;
        overflow: hidden;
        isolation: isolate;
}
.gj-hero-bg { position: absolute; inset: 0; z-index: -2; }
.gj-hero-bg img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: scale(1.05);
        animation: gradientPan 30s ease-in-out infinite alternate;
        filter: saturate(1.2);
}
.gj-hero-overlay {
        position: absolute;
        inset: 0;
        z-index: -1;
        background:
                linear-gradient(135deg, rgba(5, 74, 145, 0.86) 0%, rgba(0, 43, 80, 0.65) 60%, rgba(0, 156, 255, 0.45) 100%),
                linear-gradient(to top, rgba(15, 18, 38, 0.55) 0%, transparent 50%);
}
.gj-hero-inner {
        max-width: var(--container-w);
        margin: 0 auto;
        padding: 80px 20px 48px;
        width: 100%;
        color: #fff;
        animation: slideUp 0.8s ease;
}
.gj-hero-badge {
        display: inline-block;
        padding: 6px 14px;
        background: rgba(255, 255, 255, 0.16);
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: var(--r-pill);
        font-weight: 700;
        font-size: 12px;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        margin-bottom: 16px;
}
.gj-hero-title {
        font-size: clamp(34px, 6vw, 60px);
        color: #fff;
        text-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
        margin-bottom: 14px;
}
.gj-hero-desc {
        font-size: 17px;
        max-width: 600px;
        color: rgba(255, 255, 255, 0.92);
        margin-bottom: 22px;
}
.gj-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.gj-hero-actions .gj-btn-ghost { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.5); color: #fff; backdrop-filter: blur(8px); }
.gj-hero-actions .gj-btn-ghost:hover { background: rgba(255, 255, 255, 0.2); }
.gj-hero-meta { display: flex; gap: 18px; font-size: 14px; color: rgba(255, 255, 255, 0.9); font-weight: 600; }

/* -------------------------------------------------------------------------
 *  Stats strip
 * ------------------------------------------------------------------------- */
.gj-stats-strip {
        max-width: var(--container-w);
        margin: -32px auto 0;
        padding: 0 20px;
        position: relative;
        z-index: 5;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
}
.gj-stat-card {
        background: #fff;
        border-radius: var(--r-lg);
        padding: 18px 20px;
        box-shadow: var(--shadow-md);
        display: flex;
        flex-direction: column;
        gap: 4px;
        border: 1px solid var(--surface-2);
        animation: scaleIn 0.5s ease backwards;
}
.gj-stat-card:nth-child(1) { animation-delay: 0.05s; }
.gj-stat-card:nth-child(2) { animation-delay: 0.1s; }
.gj-stat-card:nth-child(3) { animation-delay: 0.15s; }
.gj-stat-card:nth-child(4) { animation-delay: 0.2s; }
.gj-stat-num { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--poki-blue); }
.gj-stat-label { font-size: 13px; color: var(--text-soft); font-weight: 600; }

/* -------------------------------------------------------------------------
 *  Sections + grids
 * ------------------------------------------------------------------------- */
.gj-section { margin-top: 40px; }
.gj-section-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 14px;
}
.gj-section-title {
        font-size: 22px;
        color: var(--blue-1);
        display: flex;
        align-items: center;
        gap: 8px;
}
.gj-emoji { font-size: 22px; }

.gj-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 14px;
}
@media (max-width: 1100px) { .gj-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 900px)  { .gj-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 700px)  { .gj-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px)  { .gj-grid { grid-template-columns: repeat(2, 1fr); } }

/* Recently Played grid: uses auto-fill so cards keep their natural size
   even when there are only 1-3 items (prevents single-card stretching). */
#gj-recent-grid,
.gj-grid-auto {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

/* -------------------------------------------------------------------------
 *  Game card
 * ------------------------------------------------------------------------- */
.gj-card {
        background: #fff;
        border-radius: var(--r-lg);
        overflow: hidden;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--surface-2);
        transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s;
        position: relative;
        will-change: transform;
}
.gj-card:hover {
        transform: translateY(-6px) scale(1.02);
        box-shadow: var(--shadow-lg);
}
.gj-card-3d { perspective: 1000px; }
.gj-card-3d:hover .gj-card-thumb img { transform: scale(1.08); }

.gj-card-link { display: block; color: inherit; }
.gj-card-thumb {
        position: relative;
        aspect-ratio: 3 / 2;
        background: var(--surface-2);
        overflow: hidden;
}
.gj-card-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.4s ease;
}
.gj-card-play {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 156, 255, 0);
        color: #fff;
        opacity: 0;
        transition: all 0.2s ease;
}
.gj-card-play svg {
        width: 56px;
        height: 56px;
        background: var(--poki-blue);
        border-radius: 50%;
        padding: 14px;
        box-shadow: 0 8px 20px rgba(0, 116, 224, 0.5);
        transform: scale(0.7);
        transition: transform 0.25s cubic-bezier(.34,1.56,.64,1);
}
.gj-card:hover .gj-card-play { background: rgba(0, 156, 255, 0.35); opacity: 1; }
.gj-card:hover .gj-card-play svg { transform: scale(1); }

.gj-card-fav {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, 0.94);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--pink-1);
        box-shadow: var(--shadow-sm);
        z-index: 2;
        opacity: 0;
        transform: scale(0.85);
        transition: all 0.2s ease;
}
.gj-card:hover .gj-card-fav { opacity: 1; transform: scale(1); }
.gj-card-fav.is-favorited { opacity: 1; transform: scale(1); background: var(--pink-1); color: #fff; }
.gj-card-fav.is-favorited svg path { fill: currentColor; }
.gj-card-fav:active { animation: heartPop 0.4s ease; }

.gj-badge {
        position: absolute;
        top: 8px;
        left: 8px;
        padding: 4px 10px;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.05em;
        color: #fff;
        border-radius: var(--r-pill);
        z-index: 2;
        text-transform: uppercase;
        box-shadow: var(--shadow-sm);
}
.gj-badge-hot { background: linear-gradient(135deg, var(--pink-2), #ff6b6b); animation: badgePop 0.5s ease; }
.gj-badge-new { background: linear-gradient(135deg, var(--green), #2ec27e); animation: badgePop 0.5s ease; }
.gj-badge-gotd { background: linear-gradient(135deg, var(--amber), #ff8a00); }

.gj-card-meta { padding: 10px 12px; }
.gj-card-title {
        font-size: 14px;
        font-weight: 700;
        color: var(--blue-1);
        line-height: 1.3;
        margin-bottom: 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
}
.gj-card-sub {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 12px;
        color: var(--text-soft);
        flex-wrap: wrap;
}
.gj-card-cat { color: var(--poki-blue); font-weight: 600; }
.gj-card-cat:hover { text-decoration: underline; }
.gj-card-rating { color: var(--amber); font-weight: 700; }
.gj-card-plays { color: var(--text-soft); }

.gj-card-sm .gj-card-title { font-size: 13px; }

/* -------------------------------------------------------------------------
 *  Game of the Day
 * ------------------------------------------------------------------------- */
.gj-gotd { margin-top: 32px; }
.gj-gotd-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
        gap: 0;
        background: #fff;
        border-radius: var(--r-xl);
        overflow: hidden;
        box-shadow: var(--shadow-md);
        border: 1px solid var(--surface-2);
}
.gj-gotd-thumb {
        position: relative;
        display: block;
        aspect-ratio: 16 / 11;
        background: var(--surface-2);
        overflow: hidden;
}
.gj-gotd-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gj-gotd-thumb:hover img { transform: scale(1.05); }
.gj-gotd-body { padding: 28px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.gj-gotd-cat { color: var(--poki-blue); font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: 0.05em; }
.gj-gotd-title { font-size: clamp(24px, 3.5vw, 36px); color: var(--blue-1); }
.gj-gotd-desc { color: var(--text-soft); font-size: 15px; max-width: 460px; }
.gj-gotd-actions { display: flex; gap: 12px; margin-top: 8px; }
@media (max-width: 800px) {
        .gj-gotd-card { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------
 *  ★ GAME PLAYER ★ — CRITICAL iframe fills the wrapper
 * ------------------------------------------------------------------------- */
.gj-player-wrapper {
        position: relative;
        width: 100%;
        aspect-ratio: 4 / 3;
        background: #000;
        overflow: hidden;
        border-radius: var(--r-xl);
        box-shadow: var(--shadow-lg);
        margin-top: 16px;
}

/* THE FIX: iframe uses position:absolute + width:100% + height:100% so it fills the wrapper exactly. */
#gj-game-iframe,
.gj-game-iframe {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        background: #000 !important;
}

.gj-player-cover {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        z-index: 2;
        transition: opacity 0.3s ease;
}
.gj-player-cover.is-hidden { opacity: 0; pointer-events: none; }

.gj-player-cover img { width: 100%; height: 100%; object-fit: cover; }
.gj-player-bg {
        position: absolute;
        inset: 0;
        filter: blur(28px) saturate(1.4);
        transform: scale(1.15);
}
.gj-player-fg {
        position: relative;
        max-width: 70%;
        max-height: 80%;
        object-fit: contain;
        border-radius: var(--r-md);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.gj-play-btn {
        position: relative;
        z-index: 3;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 22px 36px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(12px);
        border: 2px solid rgba(255, 255, 255, 0.4);
        border-radius: var(--r-pill);
        color: #fff;
        font-family: var(--font-display);
        font-weight: 700;
        font-size: 18px;
        transition: all 0.25s ease;
        animation: playPulse 2.4s ease-in-out infinite;
}
.gj-play-btn:hover {
        background: var(--poki-blue);
        border-color: var(--poki-blue);
        transform: scale(1.05);
        box-shadow: 0 12px 30px rgba(0, 116, 224, 0.5);
}
.gj-play-icon {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        background: #fff;
        color: var(--poki-blue);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.gj-play-icon svg { margin-left: 4px; }

.gj-player-bar {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 44px;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent);
        color: #fff;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 14px;
        z-index: 4;
        opacity: 0;
        transition: opacity 0.3s ease;
}
.gj-player-wrapper.is-playing .gj-player-bar { opacity: 1; }
.gj-player-now {
        font-size: 13px;
        font-weight: 600;
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
}
.gj-player-controls { display: flex; gap: 4px; }
.gj-player-controls .gj-btn-icon {
        width: 32px;
        height: 32px;
        border-color: rgba(255, 255, 255, 0.4);
        background: rgba(0, 0, 0, 0.4);
        color: #fff;
}
.gj-player-controls .gj-btn-icon:hover {
        background: var(--poki-blue);
        border-color: var(--poki-blue);
}
.gj-live-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 10px;
        background: rgba(255, 80, 80, 0.92);
        border-radius: var(--r-pill);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.06em;
}
.gj-live-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #fff;
        animation: liveDot 1.4s ease-in-out infinite;
}

.gj-player-wrapper.is-fullscreen {
        position: fixed;
        inset: 0;
        z-index: 9999;
        border-radius: 0;
        aspect-ratio: auto;
}

/* -------------------------------------------------------------------------
 *  Single game page
 * ------------------------------------------------------------------------- */
.gj-game-detail { padding: 0; }
.gj-game-layout {
        max-width: var(--container-w);
        margin: 0 auto;
        padding: 24px 20px 48px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 28px;
}
@media (max-width: 1024px) {
        .gj-game-layout { grid-template-columns: 1fr; }
}

.gj-crumbs {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 12px;
        color: var(--text-soft);
        margin-bottom: 8px;
        flex-wrap: wrap;
}
.gj-crumbs a:hover { color: var(--poki-blue); }
.gj-crumb-sep { color: var(--grey-5); }
.gj-crumb-current { color: var(--blue-1); font-weight: 600; }

.gj-game-title {
        font-size: clamp(26px, 4vw, 38px);
        margin: 4px 0 12px;
        animation: slideUp 0.4s ease;
}

.gj-game-stats {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 8px;
}
.gj-stat-pill {
        padding: 6px 12px;
        background: var(--surface-2);
        border-radius: var(--r-pill);
        font-size: 13px;
        font-weight: 600;
        color: var(--blue-3);
}

.gj-game-actions {
        display: flex;
        gap: 10px;
        margin-top: 16px;
        flex-wrap: wrap;
}

.gj-game-info { margin-top: 36px; display: flex; flex-direction: column; gap: 16px; }
.gj-info-card {
        background: #fff;
        border-radius: var(--r-lg);
        padding: 22px 24px;
        border: 1px solid var(--surface-2);
        box-shadow: var(--shadow-sm);
}
.gj-info-title { font-size: 18px; margin-bottom: 8px; color: var(--blue-1); }
.gj-info-content { color: var(--text); font-size: 15px; line-height: 1.7; }
.gj-info-content p { margin: 0 0 12px; }
.gj-info-content p:last-child { margin-bottom: 0; }

.gj-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.gj-tag {
        padding: 6px 12px;
        background: var(--surface-2);
        border-radius: var(--r-pill);
        font-size: 12px;
        font-weight: 600;
        color: var(--blue-3);
        transition: all 0.15s;
}
.gj-tag:hover { background: var(--poki-blue); color: #fff; }

.gj-game-sidebar {
        background: #fff;
        border-radius: var(--r-lg);
        padding: 18px;
        border: 1px solid var(--surface-2);
        box-shadow: var(--shadow-sm);
        height: fit-content;
        position: sticky;
        top: calc(var(--header-h) + var(--pills-h) + 16px);
}
.gj-sidebar-title { font-size: 16px; margin-bottom: 14px; color: var(--blue-1); }
.gj-related-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }

/* -------------------------------------------------------------------------
 *  Archive hero
 * ------------------------------------------------------------------------- */
.gj-archive-hero {
        background: linear-gradient(135deg, var(--blue-3) 0%, var(--blue-1) 70%);
        color: #fff;
        padding: 56px 20px 44px;
}
.gj-archive-hero-inner { max-width: var(--container-w); margin: 0 auto; }
.gj-archive-title { color: #fff; font-size: clamp(28px, 5vw, 44px); margin-bottom: 6px; }
.gj-archive-sub { color: rgba(255, 255, 255, 0.88); font-size: 15px; }

.gj-sort-bar {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin: 24px 0;
}
.gj-sort-pill {
        padding: 8px 16px;
        background: #fff;
        border: 2px solid var(--surface-2);
        border-radius: var(--r-pill);
        font-size: 13px;
        font-weight: 600;
        color: var(--blue-3);
        transition: all 0.15s;
}
.gj-sort-pill:hover { border-color: var(--poki-blue); color: var(--poki-blue); }
.gj-sort-pill.is-active {
        background: var(--poki-blue);
        border-color: var(--poki-blue);
        color: #fff;
}

/* -------------------------------------------------------------------------
 *  Search
 * ------------------------------------------------------------------------- */
.gj-search-hero {
        background: linear-gradient(135deg, var(--blue-1) 0%, var(--blue-3) 100%);
        padding: 56px 20px 44px;
        color: #fff;
}
.gj-search-hero-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.gj-search-title { color: #fff; margin-bottom: 20px; font-size: clamp(24px, 4vw, 36px); }
.gj-search-large {
        background: #fff;
        color: var(--text);
        max-width: 100%;
        height: 52px;
        padding: 0 6px 0 18px;
        box-shadow: var(--shadow-md);
}
.gj-search-large input { color: var(--text); font-size: 15px; }
.gj-search-large .gj-btn { height: 40px; margin: 6px 0; }
.gj-search-count { color: var(--text-soft); margin: 14px 0; font-weight: 600; }

.gj-empty {
        text-align: center;
        padding: 60px 20px;
        background: #fff;
        border-radius: var(--r-lg);
        border: 1px solid var(--surface-2);
        margin: 24px 0;
}
.gj-empty h2 { font-size: 24px; margin-bottom: 8px; }
.gj-empty p { color: var(--text-soft); margin-bottom: 18px; }

/* -------------------------------------------------------------------------
 *  Pagination
 * ------------------------------------------------------------------------- */
.gj-pagination {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin: 32px 0;
        flex-wrap: wrap;
}
.gj-pagination .page-numbers {
        padding: 8px 14px;
        background: #fff;
        border: 1px solid var(--surface-2);
        border-radius: 10px;
        font-weight: 600;
        color: var(--blue-3);
        transition: all 0.15s;
}
.gj-pagination .page-numbers:hover { border-color: var(--poki-blue); color: var(--poki-blue); }
.gj-pagination .page-numbers.current {
        background: var(--poki-blue);
        color: #fff;
        border-color: var(--poki-blue);
}

/* -------------------------------------------------------------------------
 *  Favorites / Recently Played views
 * ------------------------------------------------------------------------- */
.gj-favorites-loading, .gj-favorites-empty {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 60px 20px;
}
.gj-spinner {
        width: 38px;
        height: 38px;
        border: 3px solid var(--surface-2);
        border-top-color: var(--poki-blue);
        border-radius: 50%;
        animation: spin 0.85s linear infinite;
}
.gj-favorites-actions { text-align: center; margin: 24px 0; }

/* -------------------------------------------------------------------------
 *  Footer
 * ------------------------------------------------------------------------- */
.gj-footer {
        background: var(--blue-1);
        color: rgba(255, 255, 255, 0.88);
        padding: 48px 20px 24px;
        margin-top: 60px;
}
.gj-footer-inner {
        max-width: var(--container-w);
        margin: 0 auto;
        display: grid;
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 32px;
}
.gj-footer-col { display: flex; flex-direction: column; gap: 8px; }
.gj-footer-col h4 { color: #fff; font-size: 16px; margin-bottom: 6px; }
.gj-footer-col a { color: rgba(255, 255, 255, 0.78); font-size: 14px; transition: color 0.15s; }
.gj-footer-col a:hover { color: var(--poki-blue); }
.gj-footer-brand .gj-brand-name { color: #fff; }
.gj-footer-brand .gj-brand-name em { color: var(--poki-blue); }
.gj-footer-tagline { margin-top: 12px; font-size: 14px; max-width: 320px; color: rgba(255, 255, 255, 0.7); }
.gj-footer-bottom {
        max-width: var(--container-w);
        margin: 32px auto 0;
        padding-top: 18px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 12px;
        color: rgba(255, 255, 255, 0.6);
        text-align: center;
}
@media (max-width: 800px) {
        .gj-footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 480px) {
        .gj-footer-inner { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------
 *  Back to top
 * ------------------------------------------------------------------------- */
.gj-back-to-top {
        position: fixed;
        bottom: 24px;
        right: 24px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--poki-blue);
        color: #fff;
        font-size: 20px;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: var(--shadow-md);
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: all 0.25s ease;
        z-index: 90;
}
.gj-back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.gj-back-to-top:hover { background: var(--blue-5); transform: translateY(-2px); }

/* -------------------------------------------------------------------------
 *  Skip link
 * ------------------------------------------------------------------------- */
.gj-skip-link {
        position: absolute;
        left: -9999px;
}
.gj-skip-link:focus {
        left: 16px;
        top: 16px;
        background: #fff;
        padding: 8px 14px;
        border-radius: 8px;
        box-shadow: var(--shadow-md);
        z-index: 999;
}

/* -------------------------------------------------------------------------
 *  Animations library
 * ------------------------------------------------------------------------- */
@keyframes popIn {
        0% { opacity: 0; transform: scale(0.8) translateY(8px); }
        100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes scaleIn {
        0% { opacity: 0; transform: scale(0.92); }
        100% { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
        0% { opacity: 0; transform: translateY(24px); }
        100% { opacity: 1; transform: translateY(0); }
}
@keyframes bounceIn {
        0% { opacity: 0; transform: scale(0.3); }
        60% { opacity: 1; transform: scale(1.08); }
        100% { transform: scale(1); }
}
@keyframes wiggle {
        0%, 100% { transform: rotate(0deg); }
        20% { transform: rotate(-3deg); }
        40% { transform: rotate(3deg); }
        60% { transform: rotate(-2deg); }
        80% { transform: rotate(2deg); }
}
@keyframes gradientPan {
        0% { transform: scale(1.05) translate(0, 0); }
        100% { transform: scale(1.15) translate(-3%, -2%); }
}
@keyframes glowPulse {
        0%, 100% { box-shadow: 0 0 0 0 rgba(0, 156, 255, 0.55); }
        50% { box-shadow: 0 0 0 14px rgba(0, 156, 255, 0); }
}
@keyframes playPulse {
        0%, 100% { box-shadow: 0 0 0 0 rgba(0, 156, 255, 0.45); }
        50% { box-shadow: 0 0 0 16px rgba(0, 156, 255, 0); }
}
@keyframes badgePop {
        0% { transform: scale(0) rotate(-20deg); }
        60% { transform: scale(1.15) rotate(5deg); }
        100% { transform: scale(1) rotate(0); }
}
@keyframes heartPop {
        0%, 100% { transform: scale(1); }
        30% { transform: scale(1.35); }
        60% { transform: scale(0.9); }
}
@keyframes liveDot {
        0%, 100% { opacity: 1; transform: scale(1); }
        50% { opacity: 0.3; transform: scale(0.7); }
}
@keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
}
@keyframes floatCard {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-6px); }
}

/* Scroll reveal */
.scroll-reveal {
        opacity: 0;
        transform: translateY(28px);
        transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.34,1.56,.64,1);
}
.scroll-reveal.is-visible {
        opacity: 1;
        transform: translateY(0);
}

/* Card 3D hover */
.gj-card-3d {
        transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s;
}
.gj-card-3d:hover {
        transform: translateY(-6px) scale(1.025) rotateZ(-0.5deg);
        box-shadow: var(--shadow-lg);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
                animation-duration: 0.001ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.001ms !important;
                scroll-behavior: auto !important;
        }
        .scroll-reveal { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------------------
 *  Responsive header (mobile)
 * ------------------------------------------------------------------------- */
@media (max-width: 860px) {
        .gj-burger { display: flex; }
        .gj-search { max-width: none; }
        .gj-nav { display: none; }
        .gj-brand-name { font-size: 18px; }
}

@media (max-width: 540px) {
        .gj-stats-strip { grid-template-columns: repeat(2, 1fr); }
        .gj-stat-card { padding: 14px; }
        .gj-stat-num { font-size: 22px; }
        .gj-hero { min-height: 380px; }
        .gj-hero-inner { padding: 60px 20px 32px; }
        .gj-section-title { font-size: 18px; }
        .gj-grid { gap: 10px; }
        .gj-card-meta { padding: 8px 10px; }
        .gj-card-title { font-size: 13px; }
        .gj-game-layout { padding: 16px 14px 32px; }
        .gj-info-card { padding: 16px 18px; }
        .gj-player-wrapper { border-radius: var(--r-lg); }
}

/* -------------------------------------------------------------------------
 *  Admin importer styles (shared by enqueue.php via gj-admin.css — kept here
 *  as a fallback so the importer page looks decent even without admin.css)
 * ------------------------------------------------------------------------- */
.gj-stat-cards {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        margin: 16px 0 24px;
}
.gj-stat-cards .gj-stat-card {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 14px;
        text-align: center;
}
.gj-stat-cards .gj-stat-num { font-size: 22px; color: #0074e0; display: block; }
.gj-stat-cards .gj-stat-label { font-size: 12px; color: #64748b; }
