* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

/* ---- Header ---- */
.header {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky; top: 0; z-index: 100;
}
.header-inner {
    max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; padding: 16px 24px 0;
}
.header h1 {
    font-size: 20px; font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; margin: 0;
}
.search-box input {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 8px 14px; border-radius: 10px; color: #fff;
    font-size: 14px; outline: none; width: 200px; transition: all 0.2s;
}
.search-box input:focus { border-color: #a78bfa; background: rgba(167,139,250,0.1); }
.search-box input::placeholder { color: rgba(255,255,255,0.4); }

.notice-bar {
    max-width: 1400px; margin: 12px auto 0; padding: 8px 24px 14px;
    font-size: 13px; color: #a78bfa; line-height: 1.6;
}

/* ---- Tabs ---- */
.category-tabs {
    display: flex; gap: 10px; flex-wrap: wrap;
    max-width: 1400px; margin: 20px auto 0; padding: 0 24px;
}
.cat-tab {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #cbd5e1; padding: 8px 18px; border-radius: 999px;
    font-size: 14px; cursor: pointer; transition: all 0.2s;
}
.cat-tab:hover { background: rgba(255,255,255,0.12); }
.cat-tab.active {
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    color: #fff; border-color: transparent; font-weight: 600;
}

/* ---- Container / Grid ---- */
.container { max-width: 1400px; margin: 0 auto; padding: 20px 24px 60px; }
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px; margin-top: 16px;
}
.loading, .empty-state {
    grid-column: 1 / -1; text-align: center; padding: 60px 0;
    color: rgba(255,255,255,0.5); font-size: 15px;
}

/* ---- Game Card ---- */
.game-card {
    position: relative;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px; overflow: hidden; cursor: pointer;
    display: flex; flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.game-card:hover {
    transform: translateY(-4px);
    border-color: rgba(167,139,250,0.5);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.game-img-wrap { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: #1a1a2e; }
.game-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-img.placeholder {
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; color: rgba(255,255,255,0.35); font-weight: 600;
    background: linear-gradient(135deg, #241f47, #3a2f63);
}
.game-cat-badge {
    position: absolute; top: 10px; left: 10px; z-index: 2;
    font-size: 11px; padding: 3px 10px; border-radius: 999px;
    font-weight: 600; background: rgba(167,139,250,0.85); color: #fff;
    backdrop-filter: blur(6px);
}
.game-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.game-title { font-size: 15px; font-weight: 600; color: #e8e8f0; line-height: 1.4; }
.game-desc {
    font-size: 12.5px; color: rgba(255,255,255,0.55); line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.game-price { font-size: 12.5px; color: #f472b6; font-weight: 600; margin-top: auto; }
.game-more { font-size: 12px; color: #a78bfa; }

/* ---- Pagination ---- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; flex-wrap: wrap; }
.pagination button {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #cbd5e1; padding: 6px 12px; border-radius: 8px;
    font-size: 13px; cursor: pointer; transition: all 0.2s; min-width: 36px;
}
.pagination button:hover:not(:disabled) { background: rgba(255,255,255,0.14); }
.pagination button.active {
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    color: #fff; border-color: transparent; font-weight: 600;
}
.pagination button:disabled { opacity: 0.35; cursor: default; }

/* ---- Detail Overlay ---- */
.detail-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(6,4,20,0.85); backdrop-filter: blur(6px);
    display: none; align-items: flex-start; justify-content: center;
    padding: 40px 16px; overflow-y: auto;
}
.detail-overlay.show { display: flex; }
.detail-box {
    position: relative; width: 100%; max-width: 1000px;
    background: linear-gradient(160deg, #1b1734, #221c40);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px; padding: 26px 26px 34px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.detail-close {
    position: absolute; top: 14px; right: 16px;
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,0.08); border: none;
    color: #fff; font-size: 20px; cursor: pointer; line-height: 1;
}
.detail-close:hover { background: rgba(255,255,255,0.2); }
.detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; padding-right: 44px; }
.detail-head h2 {
    font-size: 22px; font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.detail-cat {
    font-size: 12px; padding: 3px 12px; border-radius: 999px;
    background: rgba(167,139,250,0.2); color: #c4b5fd; border: 1px solid rgba(167,139,250,0.3);
}
.detail-body { display: grid; grid-template-columns: 1fr; gap: 20px; }
.detail-section { font-size: 14px; color: rgba(255,255,255,0.8); line-height: 1.9; }
.detail-section p { margin-bottom: 4px; }
.detail-pkgs { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.detail-pkg {
    font-size: 14px; color: #fbcfe8; font-weight: 600;
    background: rgba(244,114,182,0.1);
    border: 1px solid rgba(244,114,182,0.25);
    border-radius: 10px; padding: 9px 14px;
}
.detail-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.detail-imgs img {
    width: 100%; border-radius: 10px; cursor: zoom-in;
    border: 1px solid rgba(255,255,255,0.08); background: #1a1a2e;
    transition: transform 0.15s;
}
.detail-imgs img:hover { transform: scale(1.02); }
.detail-empty { color: rgba(255,255,255,0.4); font-size: 13px; }

/* ---- Zoom ---- */
.zoom-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(0,0,0,0.92); display: none; overflow: auto;
}
.zoom-overlay.show { display: block; }
.zoom-scroll-wrap { min-height: 100%; display: flex; align-items: flex-start; justify-content: center; padding: 20px; }
.zoom-overlay img { max-width: 100%; height: auto; border-radius: 8px; }

@media (min-width: 900px) {
    .detail-body { grid-template-columns: 340px 1fr; }
}
