/* =============================================
   PlayJoy - 侧边栏 + Bento网格 + 横向滚动 排版
   - 左侧固定导航侧边栏
   - Hero 多卡片横幅区
   - Hot/New 横向滚动轮播
   - All Games Bento 混合大小网格
   - 暗黑电竞主题色
   ============================================= */

/* ============= CSS Variables ============= */
:root {
    --bg-primary: #080810;
    --bg-sidebar: #0c0c1d;
    --bg-card: #14142a;
    --bg-card-hover: #1c1c3d;
    --bg-surface: #11112a;
    --accent-1: #00e5ff;
    --accent-2: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #00e5ff, #8b5cf6);
    --accent-warm: linear-gradient(135deg, #f97316, #ef4444);
    --text-primary: #ececf5;
    --text-secondary: #8e8eb8;
    --text-muted: #585880;
    --border-color: #1c1c3a;
    --border-glow: rgba(0, 229, 255, 0.22);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 24px rgba(0, 229, 255, 0.12);
    --sidebar-w: 248px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ============= APP LAYOUT: Sidebar + Content ============= */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============= SIDEBAR (fixed left) ============= */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.sidebar-brand .logo img {
    height: 28px;
    width: auto;
    -webkit-text-fill-color: initial;
}

/* Sidebar Search */
.sidebar-search {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-search .search-box {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.sidebar-search .search-box:focus-within {
    border-color: var(--accent-1);
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.1);
}

.sidebar-search .search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    background: transparent;
    font-family: inherit;
    min-width: 0;
}

.sidebar-search .search-box input::placeholder {
    color: var(--text-muted);
}

.sidebar-search .search-box button {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 10px 14px;
    cursor: pointer;
    font-size: 15px;
    transition: color 0.2s;
}

.sidebar-search .search-box button:hover {
    color: var(--accent-1);
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 10px 8px 6px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    position: relative;
}

.sidebar-nav a::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.sidebar-nav a:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.sidebar-nav a:hover::before {
    background: var(--accent-1);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.sidebar-nav a.active {
    color: var(--accent-1);
    background: rgba(0, 229, 255, 0.06);
}

.sidebar-nav a.active::before {
    background: var(--accent-1);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-footer a {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    padding: 4px 0;
    transition: color 0.2s;
}

.sidebar-footer a:hover {
    color: var(--accent-1);
}

.sidebar-footer .copyright {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    opacity: 0.7;
}

/* ============= CONTENT AREA (right side) ============= */
.content-area {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-width: 0;
    padding-bottom: 40px;
}

/* ============= HERO BANNER (multi-card strip) ============= */
.hero-strip {
    padding: 36px 36px 48px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    background: radial-gradient(ellipse at 30% 20%, rgba(0, 229, 255, 0.06) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
}

.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
}

.hero-card:hover {
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 0 28px rgba(0, 229, 255, 0.08);
}

.hero-card-main {
    grid-row: span 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 36px;
    background: linear-gradient(160deg, #121235 0%, #14142a 40%, #1a1040 100%);
    border: 1px solid transparent;
    background-clip: padding-box;
}

.hero-card-main::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: var(--accent-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.4;
}

.hero-card-main .hero-icon-large {
    font-size: 64px;
    margin-bottom: 16px;
    animation: floatIcon 3.5s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-card-main h1 {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1.2;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.hero-card-main p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    max-width: 260px;
}

.hero-card-main .hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-gradient);
    color: #fff;
    padding: 12px 32px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.2px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.22);
}

.hero-card-main .hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0, 229, 255, 0.35);
}

/* Sub hero cards - feature cards */
.hero-card-sub {
    padding: 24px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
}

.hero-card-sub .feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    transition: border-color 0.25s;
}

.hero-card-sub:hover .feature-icon {
    border-color: var(--accent-1);
}

.hero-card-sub .feature-text strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
    transition: color 0.25s;
}

.hero-card-sub:hover .feature-text strong {
    color: var(--accent-1);
}

.hero-card-sub .feature-text span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Stats card */
.hero-card-stats {
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-card-stats .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.hero-card-stats .stat-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.hero-card-stats .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.hero-card-stats .stat-value {
    font-size: 22px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============= CONTENT CONTAINER ============= */
.content-inner {
    padding: 0 36px;
}

/* ============= SECTION HEADER ============= */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-top: 40px;
}

.section-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .icon {
    font-size: 22px;
}

.view-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-1);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 7px 14px;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    transition: all 0.25s;
}

.view-all:hover {
    background: rgba(0, 229, 255, 0.08);
    border-color: var(--accent-1);
}

/* ============= HORIZONTAL SCROLL ROW (Hot / New) ============= */
.scroll-row-wrap {
    position: relative;
}

.scroll-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 4px 20px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.scroll-row::-webkit-scrollbar { height: 4px; }
.scroll-row::-webkit-scrollbar-track { background: transparent; }
.scroll-row::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.scroll-row::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Horizontal scroll card - larger */
.scroll-card {
    flex: 0 0 auto;
    width: 220px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.28s, box-shadow 0.28s, border-color 0.28s;
}

.scroll-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-1);
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.12);
}

.scroll-card a {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.scroll-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--bg-surface);
    transition: transform 0.35s, filter 0.35s;
    filter: brightness(0.8);
}

.scroll-card:hover img {
    transform: scale(1.05);
    filter: brightness(1);
}

.scroll-card .game-title {
    padding: 12px 14px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid var(--border-color);
    transition: color 0.25s, border-color 0.25s;
}

.scroll-card:hover .game-title {
    color: var(--accent-1);
    border-color: rgba(0, 229, 255, 0.2);
}

/* Scroll row nav arrows */
.scroll-arrow {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    opacity: 0;
}

.scroll-row-wrap:hover .scroll-arrow {
    opacity: 1;
}

.scroll-arrow:hover {
    border-color: var(--accent-1);
    background: var(--bg-card-hover);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.15);
}

.scroll-arrow-left { left: -8px; }
.scroll-arrow-right { right: -8px; }

/* ============= BENTO GRID (All Games) ============= */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 160px;
    gap: 14px;
}

/* Bento card sizes */
.bento-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.28s, box-shadow 0.28s, border-color 0.28s;
    cursor: pointer;
}

.bento-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-1);
    box-shadow: 0 0 22px rgba(0, 229, 255, 0.12);
}

.bento-card a {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
}

.bento-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--bg-surface);
    transition: transform 0.4s, filter 0.4s;
    filter: brightness(0.75);
}

.bento-card:hover img {
    transform: scale(1.06);
    filter: brightness(1.05);
}

.bento-card .game-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 14px 12px;
    background: linear-gradient(to top, rgba(8, 8, 16, 0.95) 0%, transparent 100%);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.25s, padding-bottom 0.25s;
}

.bento-card:hover .game-title {
    color: var(--accent-1);
    padding-bottom: 16px;
}

/* Bento size variants */
.bento-wide {
    grid-column: span 2;
}

.bento-tall {
    grid-row: span 2;
}

.bento-large {
    grid-column: span 2;
    grid-row: span 2;
}

/* ============= Load More ============= */
.load-more {
    text-align: center;
    margin-top: 40px;
    grid-column: 1 / -1;
}

.load-more button {
    background: transparent;
    color: var(--accent-1);
    border: 2px solid var(--border-color);
    padding: 13px 50px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
}

.load-more button:hover {
    border-color: var(--accent-1);
    background: rgba(0, 229, 255, 0.06);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.12);
}

.load-more button:disabled {
    background: var(--bg-card);
    color: var(--text-muted);
    border-color: var(--border-color);
    cursor: not-allowed;
    box-shadow: none;
}

/* ============= Footer ============= */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 28px 36px 20px;
    color: var(--text-muted);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-footer .footer-links {
    display: flex;
    gap: 18px;
}

.site-footer .footer-links a {
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}

.site-footer .footer-links a:hover {
    color: var(--accent-1);
}

/* ============= Back to Top ============= */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 42px;
    height: 42px;
    background: var(--bg-card);
    color: var(--accent-1);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    z-index: 90;
}

.back-to-top.show { display: flex; }

.back-to-top:hover {
    border-color: var(--accent-1);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.2);
    transform: translateY(-2px);
}

/* ============= Loading ============= */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 16, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 100001;
    transition: opacity 0.35s;
    backdrop-filter: blur(8px);
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-1);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
    animation: bounce 0.6s infinite alternate;
}

.loading-dot:nth-child(2) { animation-delay: 0.15s; background: var(--accent-2); box-shadow: 0 0 10px rgba(139, 92, 246, 0.6); }
.loading-dot:nth-child(3) { animation-delay: 0.3s; opacity: 0.7; }

@keyframes bounce {
    from { transform: translateY(0); opacity: 0.4; }
    to { transform: translateY(-12px); opacity: 1; }
}

/* ============= Category Page Styles ============= */
.category-hero {
    padding: 44px 36px 36px;
    border-bottom: 1px solid var(--border-color);
    background: radial-gradient(ellipse at 40% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 60%);
}

.category-title {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -1px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Category page uses a dense 5-col grid (not bento, for many items) */
.category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.category-grid .game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.28s, box-shadow 0.28s, border-color 0.28s;
    cursor: pointer;
}

.category-grid .game-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-1);
    box-shadow: 0 0 22px rgba(0, 229, 255, 0.12);
}

.category-grid .game-card a {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.category-grid .game-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: var(--bg-surface);
    transition: transform 0.35s, filter 0.35s;
    filter: brightness(0.8);
}

.category-grid .game-card:hover img {
    transform: scale(1.05);
    filter: brightness(1);
}

.category-grid .game-card .game-title {
    padding: 10px 14px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid var(--border-color);
    transition: color 0.25s, border-color 0.25s;
}

.category-grid .game-card:hover .game-title {
    color: var(--accent-1);
    border-color: rgba(0, 229, 255, 0.2);
}

/* ============= Detail Page ============= */
.game {
    max-width: 100%;
    margin: 0;
    padding: 32px 36px 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
}

.game-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: border-color 0.3s;
}

.game-preview:hover {
    border-color: rgba(0, 229, 255, 0.3);
}

.game-preview-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    text-align: center;
    z-index: 2;
}

.game-preview-icon img {
    width: 110px;
    height: 110px;
    border-radius: 20px;
    object-fit: cover;
    border: 3px solid var(--border-color);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    transition: border-color 0.3s;
}

.game-preview:hover .game-preview-icon img {
    border-color: var(--accent-1);
}

.game-preview-title {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    max-width: 90%;
    line-height: 1.2;
}

.play-game-btn {
    border: none;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 13px 44px;
    border-radius: 100px;
    cursor: pointer;
    letter-spacing: -0.2px;
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.28);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.play-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0, 229, 255, 0.4);
}

.play-game-btn:active { transform: scale(0.96); }

.game-iframe-wrap {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.game-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.game-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(8, 8, 16, 0.9);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: background 0.2s;
    border: 1px solid var(--border-color);
}

.game-close-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent-1);
}

.game-detail-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-actions-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
    letter-spacing: -0.2px;
}

.action-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-1);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.08);
}

.action-btn .icon { font-size: 17px; }

.game-intro {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 24px;
}

.game-intro h2 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.game-intro p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.install-btn { display: none; }

.similar-games-section {
    max-width: none;
    padding: 0 36px;
    margin-top: 44px;
}

.game > .similar-games-section {
    grid-column: 1 / -1;
    margin-top: 44px;
    max-width: none;
    padding: 0;
}

.similar-games-section .section-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.similar-games-section .section-title .icon {
    font-size: 22px;
}

.similar-games-scroll-wrap { position: relative; }

.similar-games-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px 20px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.similar-games-scroll::-webkit-scrollbar { height: 4px; }
.similar-games-scroll::-webkit-scrollbar-track { background: transparent; }
.similar-games-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
.similar-games-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.similar-game-card {
    flex: 0 0 auto;
    width: 160px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.28s, box-shadow 0.28s, border-color 0.28s;
}

.similar-game-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-1);
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.1);
}

.similar-game-card a {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.similar-game-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--bg-surface);
    transition: transform 0.3s, filter 0.3s;
    filter: brightness(0.8);
}

.similar-game-card:hover img {
    transform: scale(1.04);
    filter: brightness(1);
}

.similar-game-card .game-title {
    padding: 8px 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

/* Fullscreen game */
.app-module {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 99999;
}

.app-module iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

.app-module .game-close-btn {
    position: fixed;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(8, 8, 16, 0.9);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* No results */
.no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
    font-size: 16px;
    grid-column: 1 / -1;
}

.no-results-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ============= MOBILE HEADER (hamburger bar) ============= */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(12, 12, 29, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 200;
    flex-shrink: 0;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.mobile-header .hamburger {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mobile-header .hamburger:hover {
    border-color: var(--accent-1);
    background: var(--bg-card-hover);
}

.mobile-header .mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex: 1;
    min-width: 0;
}

.mobile-header .mobile-logo img {
    height: 24px;
    width: auto;
    -webkit-text-fill-color: initial;
}

.mobile-header .mobile-search-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mobile-header .mobile-search-btn:hover {
    color: var(--accent-1);
    border-color: var(--accent-1);
}

/* Mobile body offset for fixed header */
body.menu-open { overflow: hidden; }

/* Mobile overlay (behind sidebar) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.sidebar-overlay.show { opacity: 1; }

/* ============= RESPONSIVE ============= */
@media (max-width: 1400px) {
    .bento-grid { grid-template-columns: repeat(4, 1fr); }
    .category-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1200px) {
    .hero-strip { grid-template-columns: 1fr 1fr; }
    .hero-card-main { grid-row: span 1; grid-column: 1 / -1; }
    .bento-grid { grid-template-columns: repeat(3, 1fr); }
    .category-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
    :root { --sidebar-w: 220px; }
    .sidebar-brand .logo { font-size: 17px; }
    .sidebar-brand .logo img { height: 24px; }
    .sidebar-nav a { font-size: 12px; padding: 8px 12px; }
    .hero-strip { padding: 28px 24px 36px; }
    .content-inner { padding: 0 24px; }
    .hero-card-main { padding: 32px 24px; }
    .hero-card-main h1 { font-size: 24px; }
    .scroll-card { width: 180px; }
}

/* ===== MOBILE: hamburger menu + overlay sidebar ===== */
@media (max-width: 860px) {
    .mobile-header { display: flex; }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 99;
        width: 280px !important;
        min-width: 280px !important;
        top: 56px;          /* start below mobile header */
        bottom: 0;
        left: 0;
        box-shadow: none;
        border-top: none;
    }
    
    .sidebar.open { 
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6);
    }
    
    /* Overlay — darkens content behind sidebar */
    .sidebar-overlay {
        display: block; 
        pointer-events: none;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
    .sidebar-overlay.show { pointer-events: auto; }
    
    /* Content area */
    .content-area { margin-left: 0 !important; padding-top: 56px; }
    
    /* Hero strip — single column stacked */
    .hero-strip {
        padding: 20px 16px 28px;
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    .hero-card-main { padding: 36px 20px 30px; }
    .hero-card-main h1 { font-size: 22px; }
    .hero-card-main p { font-size: 13px; max-width: 100%; }
    .hero-card-main .hero-icon-large { font-size: 48px; margin-bottom: 12px; }
    
    .content-inner { padding: 0 16px; }
    
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 140px;
        gap: 10px;
    }
    .bento-wide { grid-column: span 2; }
    .bento-large { grid-column: span 2; grid-row: span 1; }
    
    .category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .category-hero { padding: 24px 16px 20px; }
    .category-title { font-size: 22px; }
    
    /* Section headers */
    .section-title { font-size: 17px; }
    .section-header { padding-top: 28px !important; margin-bottom: 14px; }
    .view-all { font-size: 11px; padding: 6px 12px; }
    
    /* Scroll cards */
    .scroll-card { width: 160px; }
    .scroll-arrow { display: none !important; } /* hide arrows on mobile, use touch scroll */
    
    /* Detail page */
    .game { 
        grid-template-columns: 1fr !important; 
        padding: 16px 16px 36px !important;
        gap: 18px;
    }
    .similar-games-section { padding: 0 16px !important; }
    
    /* Footer */
    .site-footer { 
        padding: 20px 16px 16px; 
        flex-direction: column; 
        gap: 10px; 
        text-align: center; 
    }
    
    /* Back to top */
    .back-to-top { bottom: 16px; right: 16px; width: 38px; height: 38px; font-size: 16px; }
}

@media (max-width: 480px) {
    .mobile-header { height: 50px; padding: 0 12px; }
    .mobile-header .mobile-logo { font-size: 15px; }
    .mobile-header .mobile-logo img { height: 20px; }
    .mobile-header .hamburger,
    .mobile-header .mobile-search-btn { width: 36px; height: 36px; font-size: 17px; }
    .content-area { padding-top: 50px; }
    .sidebar { top: 50px; }   /* match smaller header height */
    
    .scroll-card { width: 140px; }
    .scroll-card img { aspect-ratio: 3 / 2; }
    .scroll-card .game-title { font-size: 11px; padding: 8px 10px 12px; }
    
    .hero-card-main h1 { font-size: 19px; }
    .hero-card-main p { font-size: 12px; }
    .hero-card-main .hero-cta { font-size: 13px; padding: 10px 24px; }
    .hero-card-main .hero-icon-large { font-size: 40px; }
    
    .bento-grid {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 120px;
        gap: 8px;
    }
    .bento-card .game-title { font-size: 11px; padding: 18px 8px 8px; }
    
    .category-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .category-grid .game-card .game-title { font-size: 11px; padding: 8px 10px 12px; }
    
    /* Similar games — 3-col grid on small screens instead of scroll */
    .similar-games-scroll {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        overflow-x: visible;
        padding: 0;
    }
    .similar-game-card { width: 100%; }
    .similar-game-card img { aspect-ratio: 1/1; }
    .similar-game-card .game-title { font-size: 10px; padding: 6px 6px 10px; }
    
    .back-to-top { bottom: 12px; right: 12px; width: 34px; height: 34px; font-size: 15px; }
}
