/* ==========================================================================
   Poko Portal Custom Features: Premium Dark Mode, Instant Search, Favorites, Recently Played
   ========================================================================== */

:root {
    --pk-bg: #f8fafc;
    --pk-surface: #ffffff;
    --pk-surface-subtle: #f1f5f9;
    --pk-text: #0f172a;
    --pk-text-muted: #64748b;
    --pk-border: #e2e8f0;
    --pk-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --pk-accent: #3b82f6;
    --pk-accent-hover: #2563eb;
    --pk-fav: #ec4899;
}

/* --------------------------------------------------------------------------
   🌓 PREMIUM OLED / STEAM-STYLE DARK MODE OVERRIDES
   -------------------------------------------------------------------------- */
html.dark, [data-theme="dark"] {
    --pk-bg: #0b0f19;
    --pk-surface: #111827;
    --pk-surface-subtle: #1e293b;
    --pk-text: #f8fafc;
    --pk-text-muted: #94a3b8;
    --pk-border: rgba(255, 255, 255, 0.08);
    --pk-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

/* Global Body & Background */
html.dark body {
    background-color: #0b0f19 !important;
    background-image: radial-gradient(circle at 50% -20%, #1e293b 0%, #0b0f19 75%) !important;
    background-attachment: fixed !important;
    color: #f8fafc !important;
}

/* Global Smooth Transitions */
body, .cg-topbar, .cgp-topbar, .cat-topbar, 
.cg-game-card, .cgp-game-card, .cat-game-card, .m-game-card,
.cgp-player-card, .cgp-action-bar, .cgp-sidebar, .cgp-card,
.cat-editorial-card, .cg-about-card, footer {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

/* --------------------------------------------------------------------------
   1. TOPBARS & LOGO IN DARK MODE
   -------------------------------------------------------------------------- */
html.dark .cg-topbar,
html.dark .cgp-topbar,
html.dark .cat-topbar {
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    color: #f8fafc !important;
}

/* Make dark text on logo crisp and visible in dark mode */
html.dark .cg-logo-img,
html.dark footer img[src*="logo"],
html.dark .offcanvas-menu img[src*="logo"] {
    filter: invert(1) hue-rotate(180deg) brightness(1.08) drop-shadow(0 2px 8px rgba(255, 255, 255, 0.15));
}

/* Breadcrumbs in dark mode */
html.dark .cgp-breadcrumb a,
html.dark .cat-breadcrumb a {
    color: #94a3b8 !important;
}
html.dark .cgp-breadcrumb a:hover,
html.dark .cat-breadcrumb a:hover {
    color: #60a5fa !important;
}
html.dark .cgp-breadcrumb-sep,
html.dark .cat-breadcrumb-sep {
    color: #475569 !important;
}
html.dark .cgp-breadcrumb-current,
html.dark .cat-breadcrumb-current {
    color: #f8fafc !important;
}

/* Search Bar & Pill Buttons in Topbar */
html.dark .cg-search-trigger {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
}
html.dark .cg-search-trigger:hover {
    background: #243047 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25) !important;
}
html.dark .cg-search-trigger input {
    color: #ffffff !important;
}
html.dark .cg-search-trigger input::placeholder {
    color: #64748b !important;
}
html.dark .cg-search-kbd {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .cgp-pill-btn,
html.dark .cat-pill-btn,
html.dark .cg-action-btn-search-mobile {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}
html.dark .cgp-pill-btn:hover,
html.dark .cat-pill-btn:hover,
html.dark .cg-action-btn-search-mobile:hover {
    background: #334155 !important;
    color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   2. CATEGORY PILLS STRIP
   -------------------------------------------------------------------------- */
html.dark .cg-cat-nav-btn {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
}
html.dark .cg-cat-nav-btn:hover {
    background: #3b82f6 !important;
    color: #ffffff !important;
}

html.dark .cg-cat-pill,
html.dark .cat-pill {
    background: #151e32 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
html.dark .cg-cat-pill:hover,
html.dark .cat-pill:hover {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
}
html.dark .cg-cat-pill.active,
html.dark .cat-pill.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45) !important;
}

/* --------------------------------------------------------------------------
   3. GAME CARDS (HOME, GAME PAGE, CATEGORY PAGE, OFFCANVAS)
   -------------------------------------------------------------------------- */
html.dark .cg-game-card,
html.dark .cgp-game-card,
html.dark .cat-game-card,
html.dark .m-game-card,
html.dark .cg-card {
    background: #131b2e !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45) !important;
}

html.dark .cg-game-card:hover,
html.dark .cgp-game-card:hover,
html.dark .cat-game-card:hover,
html.dark .m-game-card:hover,
html.dark .cg-card:hover {
    border-color: #3b82f6 !important;
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.7), 0 0 16px rgba(59, 130, 246, 0.25) !important;
}

html.dark .cg-card-thumb-wrap,
html.dark .cgp-card-thumb-wrap,
html.dark .cat-card-thumb-wrap,
html.dark .m-game-thumbnail {
    background: #090d16 !important;
}

html.dark .cg-card-body,
html.dark .cgp-card-body,
html.dark .cat-card-body {
    background: #131b2e !important;
    border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
}

html.dark .cg-card-title,
html.dark .cgp-card-title,
html.dark .cat-card-title,
html.dark .m-game-details p {
    color: #f8fafc !important;
}

html.dark .cg-card-meta,
html.dark .cgp-card-meta,
html.dark .cat-card-meta,
html.dark .cg-card-cat-name {
    color: #94a3b8 !important;
}

/* --------------------------------------------------------------------------
   4. SECTION HEADINGS, CONTROLS & ARROWS
   -------------------------------------------------------------------------- */
html.dark .cg-section-title,
html.dark .cgp-section-title,
html.dark .cat-section-title,
html.dark .cat-grid-title,
html.dark .cat-hero-title,
html.dark .poko-shelf-title {
    color: #f8fafc !important;
}

html.dark .cg-section-subtitle,
html.dark .cgp-section-subtitle,
html.dark .cat-section-subtitle,
html.dark .cat-grid-count {
    color: #94a3b8 !important;
}

html.dark .cg-arrow-btn,
html.dark .cgp-arrow-btn {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
html.dark .cg-arrow-btn:hover,
html.dark .cgp-arrow-btn:hover {
    background: #3b82f6 !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
}

html.dark .cg-view-all-link {
    background: rgba(59, 130, 246, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    color: #60a5fa !important;
}
html.dark .cg-view-all-link:hover {
    background: #3b82f6 !important;
    color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   5. HOMEPAGE HERO SLIDER & SIDE PICKS
   -------------------------------------------------------------------------- */
html.dark .cg-hero-slider {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6) !important;
}
html.dark .cg-side-card {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

/* --------------------------------------------------------------------------
   6. GAME PLAY PAGE (CENTER ARENA & SIDEBARS)
   -------------------------------------------------------------------------- */
html.dark .cgp-player-card {
    background: #090d16 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6) !important;
}

html.dark .cgp-action-bar {
    background: #111827 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .cgp-game-icon {
    border-color: #1e293b !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6) !important;
}

html.dark .cgp-game-title {
    color: #f8fafc !important;
}

html.dark .cgp-meta-row {
    color: #94a3b8 !important;
}
html.dark .cgp-cat-tag {
    color: #60a5fa !important;
}
html.dark .cgp-meta-dot {
    color: #475569 !important;
}

html.dark .cgp-btn {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}
html.dark .cgp-btn:hover {
    background: #334155 !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Sidebars in Game Play Page */
html.dark .cgp-sidebar-header {
    color: #94a3b8 !important;
}
html.dark .cgp-side-game-card {
    background: #131b2e !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}
html.dark .cgp-side-game-card:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
}

/* --------------------------------------------------------------------------
   7. GAME OVERVIEW, CONTROLS & HOW-TO-PLAY CARDS (.cgp-card)
   -------------------------------------------------------------------------- */
html.dark .cgp-card {
    background: #111827 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    color: #cbd5e1 !important;
}

html.dark .cgp-card-title {
    color: #f8fafc !important;
}

html.dark .cgp-game-desc {
    color: #cbd5e1 !important;
}
html.dark .cgp-game-desc h1,
html.dark .cgp-game-desc h2,
html.dark .cgp-game-desc h3,
html.dark .cgp-game-desc h4 {
    color: #f8fafc !important;
}
html.dark .cgp-game-desc p {
    color: #94a3b8 !important;
}
html.dark .cgp-game-desc strong,
html.dark .cgp-game-desc b {
    color: #f8fafc !important;
}
html.dark .cgp-game-desc li {
    color: #94a3b8 !important;
}
html.dark .cgp-game-desc a {
    color: #60a5fa !important;
}

html.dark .cgp-meta-tag {
    color: #94a3b8 !important;
}
html.dark .cgp-meta-val {
    color: #f8fafc !important;
}

html.dark .cgp-control-key {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #f8fafc !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}
html.dark .cgp-control-val {
    color: #cbd5e1 !important;
}

/* --------------------------------------------------------------------------
   8. CATEGORY EDITORIAL & FAQ ACCORDION (.cat-editorial-card)
   -------------------------------------------------------------------------- */
html.dark .cat-hero-card {
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6) !important;
}

html.dark .cat-editorial-card {
    background: #111827 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    color: #cbd5e1 !important;
}

html.dark .cat-article-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
html.dark .cat-article-badge {
    color: #94a3b8 !important;
}

html.dark .cat-article-body h2,
html.dark .cat-article-body h3 {
    color: #f8fafc !important;
}
html.dark .cat-article-body p,
html.dark .cat-article-body li {
    color: #94a3b8 !important;
}

html.dark .cat-faq-item {
    background: #161f32 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
html.dark .cat-faq-q {
    color: #f8fafc !important;
}
html.dark .cat-faq-a {
    color: #94a3b8 !important;
}

html.dark .cat-empty-box {
    background: #111827 !important;
    border: 1px dashed rgba(255, 255, 255, 0.15) !important;
}
html.dark .cat-empty-title {
    color: #f8fafc !important;
}
html.dark .cat-empty-desc {
    color: #94a3b8 !important;
}

/* --------------------------------------------------------------------------
   9. HOMEPAGE ABOUT CARD (.cg-about-card)
   -------------------------------------------------------------------------- */
html.dark .cg-about-card {
    background: #111827 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}
html.dark .cg-about-header {
    border-color: rgba(255, 255, 255, 0.08) !important;
}
html.dark .cg-about-title {
    color: #f8fafc !important;
}
html.dark .cg-about-content {
    color: #94a3b8 !important;
}
html.dark .cg-about-content h1,
html.dark .cg-about-content h2,
html.dark .cg-about-content h3 {
    color: #f8fafc !important;
}
html.dark .cg-about-content p,
html.dark .cg-about-content li {
    color: #94a3b8 !important;
}

/* --------------------------------------------------------------------------
   10. STATIC PAGES & OFFCANVAS & FOOTER
   -------------------------------------------------------------------------- */
/* Static Page Container */
html.dark .page-content {
    background: #111827 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
}
html.dark .page-content h1,
html.dark .page-content h2,
html.dark .page-content h3 {
    color: #f8fafc !important;
}
html.dark .page-content p {
    color: #94a3b8 !important;
}

/* Offcanvas Drawer */
html.dark .offcanvas {
    background: rgba(8, 12, 20, 0.8) !important;
    backdrop-filter: blur(8px) !important;
}
html.dark .offcanvas-menu {
    background: #0b0f19 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8) !important;
    color: #f8fafc !important;
}
html.dark .offcanvas-menu .live-search {
    background: #151e32 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
html.dark .offcanvas-menu .live-search input {
    color: #ffffff !important;
}
html.dark .offcanvas-menu .category-link-box {
    background: #151e32 !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
html.dark .offcanvas-menu .category-link-box:hover {
    background: #3b82f6 !important;
    color: #ffffff !important;
}
html.dark .offcanvas-menu .close-button {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}
html.dark .recent-uploaded-games h3 {
    color: #f8fafc !important;
}
html.dark .search-error {
    background: #151e32 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
}
html.dark .search-error h5 {
    color: #f8fafc !important;
}
html.dark .search-error p {
    color: #94a3b8 !important;
}

/* Footer */
html.dark footer {
    background: #080c14 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}
html.dark footer h3 {
    color: #f8fafc !important;
}
html.dark footer .footer-links a {
    color: #94a3b8 !important;
}
html.dark footer .footer-links a:hover {
    color: #60a5fa !important;
}

/* Advertisement Box */
html.dark .cg-ad-box {
    background: rgba(17, 24, 39, 0.5) !important;
    border: 1px dashed rgba(255, 255, 255, 0.1) !important;
}
html.dark .cg-ad-label {
    color: #64748b !important;
}

/* Popups (Bug Report & Thank You) */
html.dark .report-popup,
html.dark .thank-you-popup {
    background: #111827 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7) !important;
}
html.dark #report_textarea {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   🌓 THEME TOGGLE BUTTON
   -------------------------------------------------------------------------- */
.poko-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
.poko-theme-toggle:hover {
    transform: rotate(20deg) scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
html.dark .poko-theme-toggle {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.15);
    color: #facc15;
    box-shadow: 0 0 14px rgba(250, 204, 21, 0.25);
}
html.dark .poko-theme-toggle:hover {
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.45);
}

/* --------------------------------------------------------------------------
   ❤️ FAVORITE BUTTON & BADGES
   -------------------------------------------------------------------------- */
.poko-fav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    flex-shrink: 0;
}
.poko-fav-btn:hover {
    background: #fce7f3;
    color: #db2777;
    border-color: #fbcfe8;
    transform: translateY(-1px);
}
html.dark .poko-fav-btn {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f472b6;
}
html.dark .poko-fav-btn:hover {
    background: rgba(236, 72, 153, 0.2);
    border-color: #ec4899;
    color: #ffffff;
}

.poko-fav-btn.active {
    background: linear-gradient(135deg, #ec4899 0%, #ef4444 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
}
.poko-fav-btn .fav-badge-count {
    background: rgba(0, 0, 0, 0.1);
    color: inherit;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 999px;
}
.poko-fav-btn.active .fav-badge-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}
html.dark .poko-fav-btn .fav-badge-count {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* Game Play Page Favorite Button */
.cgp-btn-fav.active {
    background: linear-gradient(135deg, #ec4899 0%, #ef4444 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
}
.cgp-btn-fav.active svg {
    fill: #ffffff;
    stroke: #ffffff;
    animation: heartBeat 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Card Floating Heart Icon */
.poko-card-fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.cg-game-card:hover .poko-card-fav-btn,
.cgp-game-card:hover .poko-card-fav-btn,
.cat-game-card:hover .poko-card-fav-btn {
    opacity: 1;
    transform: scale(1);
}
.poko-card-fav-btn.is-fav {
    opacity: 1;
    transform: scale(1);
    background: #ec4899;
    border-color: #f43f5e;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.4);
}
.poko-card-fav-btn:hover {
    transform: scale(1.15) !important;
}

/* --------------------------------------------------------------------------
   🔍 INSTANT LIVE SEARCH DROPDOWN
   -------------------------------------------------------------------------- */
.poko-search-wrapper {
    position: relative;
    width: 100%;
}

.poko-search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
    border: 1px solid #e2e8f0;
    z-index: 1000;
    overflow: hidden;
    display: none;
    animation: fadeInDown 0.2s ease-out;
}
html.dark .poko-search-dropdown {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.poko-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}
html.dark .poko-search-header {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

.poko-search-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 6px;
    margin: 0;
    list-style: none;
}

.poko-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    text-decoration: none;
    color: #0f172a;
    transition: all 0.15s ease;
    cursor: pointer;
}
html.dark .poko-search-item {
    color: #f8fafc;
}
.poko-search-item:hover,
.poko-search-item.is-selected {
    background: #f1f5f9;
    transform: translateX(4px);
}
html.dark .poko-search-item:hover,
html.dark .poko-search-item.is-selected {
    background: #1e293b;
}

.poko-search-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e2e8f0;
}

.poko-search-info {
    flex: 1;
    min-width: 0;
}
.poko-search-title {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.poko-search-title mark {
    background: transparent;
    color: #3b82f6;
    font-weight: 800;
}
html.dark .poko-search-title mark {
    color: #60a5fa;
}

.poko-search-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}
html.dark .poko-search-meta {
    color: #94a3b8;
}
.poko-search-cat-badge {
    background: #e0f2fe;
    color: #0284c7;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    text-transform: uppercase;
}
html.dark .poko-search-cat-badge {
    background: rgba(2, 132, 199, 0.2);
    color: #38bdf8;
}

.poko-search-play-btn {
    padding: 6px 12px;
    border-radius: 999px;
    background: #3b82f6;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.2s ease;
}
.poko-search-item:hover .poko-search-play-btn,
.poko-search-item.is-selected .poko-search-play-btn {
    opacity: 1;
    transform: scale(1);
}

.poko-search-empty {
    text-align: center;
    padding: 30px 20px;
    color: #64748b;
}
html.dark .poko-search-empty {
    color: #94a3b8;
}
.poko-search-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 11px;
    color: #94a3b8;
}
html.dark .poko-search-footer {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
}

/* --------------------------------------------------------------------------
   🕒 & ❤️ DYNAMIC HOMEPAGE SHELVES (Recently Played & Favorites)
   -------------------------------------------------------------------------- */
.poko-shelf-section {
    margin-bottom: 30px;
    animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.poko-shelf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.poko-shelf-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.poko-shelf-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.poko-shelf-icon-recent {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
}
html.dark .poko-shelf-icon-recent {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

.poko-shelf-icon-fav {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #db2777;
}
html.dark .poko-shelf-icon-fav {
    background: rgba(236, 72, 153, 0.2) !important;
    color: #f472b6 !important;
    border: 1px solid rgba(236, 72, 153, 0.3) !important;
}

.poko-shelf-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}
html.dark .poko-shelf-title {
    color: #f8fafc !important;
}
.poko-shelf-count {
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}
html.dark .poko-shelf-count {
    background: #1e293b;
    color: #94a3b8;
}

.poko-shelf-clear-btn {
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s ease;
}
.poko-shelf-clear-btn:hover {
    color: #ef4444;
}

.poko-shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
}
@media (max-width: 640px) {
    .poko-shelf-grid {
        display: flex;
        overflow-x: auto;
        padding-bottom: 8px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .poko-shelf-grid::-webkit-scrollbar { display: none; }
    .poko-shelf-grid .cg-game-card {
        min-width: 120px;
        max-width: 120px;
        scroll-snap-align: start;
        flex-shrink: 0;
    }
}

/* --------------------------------------------------------------------------
   MODAL DIALOG (For Full Favorites & History Manager)
   -------------------------------------------------------------------------- */
.poko-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}
html.dark .poko-modal-backdrop {
    background: rgba(8, 12, 20, 0.8) !important;
}

.poko-modal-box {
    background: #ffffff;
    border-radius: 24px;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    animation: scaleUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
html.dark .poko-modal-box {
    background: #111827 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8) !important;
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.poko-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
}
html.dark .poko-modal-header {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.poko-modal-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
}
.poko-modal-tab {
    padding: 8px 16px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
html.dark .poko-modal-tab {
    background: #1e293b !important;
    color: #94a3b8 !important;
}
.poko-modal-tab.active {
    background: #0f172a;
    color: #ffffff;
}
html.dark .poko-modal-tab.active {
    background: #3b82f6 !important;
    color: #ffffff !important;
}

.poko-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.poko-modal-close:hover {
    background: #ef4444;
    color: #ffffff;
}
html.dark .poko-modal-close {
    background: #1e293b !important;
    color: #94a3b8 !important;
}
html.dark .poko-modal-close:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
}

.poko-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.poko-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.poko-modal-empty {
    text-align: center;
    padding: 40px 20px;
}
.poko-modal-empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
}
.poko-modal-empty-title {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}
html.dark .poko-modal-empty-title {
    color: #f8fafc !important;
}
.poko-modal-empty-desc {
    font-size: 13px;
    color: #64748b;
    max-width: 340px;
    margin: 0 auto 16px;
}
html.dark .poko-modal-empty-desc {
    color: #94a3b8 !important;
}
