/* GeekPlay Arcade — Modern Dark Neon & Clean Light Dual Theme */
:root {
    --bg-body: #0b0d17;
    --bg-surface: #131627;
    --bg-card: #181c31;
    --bg-card-hover: #212744;
    --bg-input: #101322;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f6ff;
    --text-secondary: #a1abc7;
    --text-muted: #707a99;
    --accent: #7c3aed;
    --accent-2: #06b6d4;
    --accent-glow: rgba(124, 58, 237, 0.35);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.35);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

html[data-theme="light"] {
    --bg-body: #f3f6fc;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8faff;
    --bg-input: #eef2fb;
    --border-color: rgba(15, 23, 42, 0.09);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.07);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 13, 23, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
}

html[data-theme="light"] .site-header {
    background: rgba(255, 255, 255, 0.9);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 68px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.18rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.brand-text {
    background: linear-gradient(135deg, #a78bfa, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

html[data-theme="light"] .brand-text {
    background: linear-gradient(135deg, #6d28d9, #0284c7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-search {
    flex: 1 1 200px;
    min-width: 170px;
    max-width: 440px;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px 6px 4px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.header-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.header-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.94rem;
    min-width: 0;
}

.header-search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.search-clear {
    display: none;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-right: 2px;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}

.search-clear.visible {
    display: inline-flex;
}

.search-clear:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.header-search .search-submit {
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-pill {
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-pill:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.nav-pill-glow {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.24), rgba(6, 182, 212, 0.24));
    border-color: rgba(124, 58, 237, 0.5);
    color: var(--text-primary);
}

.nav-pill-random {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.18), rgba(124, 58, 237, 0.22));
    border-color: rgba(236, 72, 153, 0.38);
    color: var(--text-primary);
}

.nav-pill-random:hover {
    border-color: #ec4899;
    box-shadow: 0 0 14px rgba(236, 72, 153, 0.28);
}

.icon-btn, .lang-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 999px;
    height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}

.icon-btn:hover, .lang-btn:hover {
    border-color: var(--accent);
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(6, 182, 212, 0.22));
    border: 1px solid rgba(124, 58, 237, 0.5);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.2s;
}

.user-pill:hover {
    border-color: var(--accent-2);
    transform: translateY(-1px);
}

.user-pill-guest {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.user-pill-name {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-pill-lv {
    font-size: 0.72rem;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(6, 182, 212, 0.22);
    color: #22d3ee;
}

.tool-btn.favorited {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #fcd34d;
}

/* Cloud Save Bar under Game Player */
.cloud-save-bar {
    padding: 13px 20px;
    background: rgba(124, 58, 237, 0.08);
    border-top: 1px solid var(--border-color);
}

.cloud-save-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.cloud-toggle-btn {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid rgba(124, 58, 237, 0.5);
    background: rgba(124, 58, 237, 0.22);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.cloud-save-form {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cloud-save-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.cloud-save-grid input {
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.86rem;
    outline: none;
}

.cloud-save-grid input:focus {
    border-color: var(--accent-2);
}

.cloud-save-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

/* Account & Auth Pages */
.auth-shell {
    max-width: 480px;
    margin: 24px auto;
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}

.auth-tab {
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-tab.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border-color: transparent;
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: 1.45rem;
}

.auth-sub {
    margin: 0 0 20px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.auth-alert {
    padding: 11px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 0.86rem;
    font-weight: 600;
}

.auth-alert.error {
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

.auth-alert.success {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #6ee7b7;
}

.auth-field {
    margin-bottom: 14px;
}

.auth-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.auth-field input[type="text"], .auth-field input[type="password"] {
    width: 100%;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.94rem;
    outline: none;
}

.auth-field input:focus {
    border-color: var(--accent-2);
}

.avatar-picker {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.avatar-opt input {
    display: none;
}

.avatar-opt span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 2px solid transparent;
    font-size: 1.3rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.save-slot-status {
    font-size: 0.84rem;
    font-weight: 600;
    color: #6ee7b7;
}

.save-slot-status.warn {
    color: #fbbf24;
}

.save-slot-status.err {
    color: #fca5a5;
}

.clear-recent-btn {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.clear-recent-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.avatar-opt input:checked + span {
    border-color: var(--accent-2);
    background: rgba(6, 182, 212, 0.18);
}

.profile-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.25), transparent 55%), var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
}

.profile-id {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.profile-id h1 {
    margin: 0 0 6px;
    font-size: 1.45rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lv-badge {
    font-size: 0.78rem;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(6, 182, 212, 0.22);
    color: #22d3ee;
}

.xp-bar-wrap {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.xp-bar {
    width: 210px;
    height: 7px;
    border-radius: 999px;
    background: var(--bg-card);
    overflow: hidden;
    margin-bottom: 4px;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.profile-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.p-stat {
    text-align: center;
    padding: 8px 14px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    min-width: 78px;
}

.p-stat strong {
    display: block;
    font-size: 1.2rem;
}

.p-stat small {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.saves-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.save-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
}

.save-row img {
    width: 84px;
    height: 62px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.save-info {
    flex: 1;
    min-width: 200px;
}

.save-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 2px 0 4px;
}

.save-note {
    font-size: 0.86rem;
    color: var(--text-secondary);
}

.save-code-box {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--bg-input);
    font-size: 0.78rem;
    color: #38bdf8;
    word-break: break-all;
    max-height: 54px;
    overflow: auto;
}

.save-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }

/* Main */
.site-main {
    min-height: calc(100vh - 230px);
    padding: 26px 0 56px;
}

/* Hero Banner */
.hero-banner {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 28px;
    align-items: center;
    background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.28), transparent 55%),
                radial-gradient(circle at bottom left, rgba(6, 182, 212, 0.18), transparent 55%),
                var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-card);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid rgba(124, 58, 237, 0.45);
    color: #c4b5fd;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

html[data-theme="light"] .hero-badge {
    color: #6d28d9;
}

.hero-title {
    margin: 0 0 12px;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    line-height: 1.18;
    letter-spacing: -0.02em;
}

.hero-desc {
    margin: 0 0 22px;
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 560px;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
}

.stat-chip {
    padding: 6px 13px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.94rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.16s, box-shadow 0.2s, opacity 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 8px 22px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.hero-preview-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    aspect-ratio: 16 / 10;
    background: var(--bg-card);
    display: block;
}

.hero-preview-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.hero-preview-card:hover img {
    transform: scale(1.05);
}

.hero-preview-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 18px;
    background: linear-gradient(to top, rgba(11, 13, 23, 0.92), transparent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Category Pills */
.category-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0 12px;
    margin-bottom: 18px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.category-bar::-webkit-scrollbar {
    display: none;
    height: 0;
}

html[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 6px;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #0b0d17;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.45);
}

.cat-pill {
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}

.cat-pill:hover, .cat-pill.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: #fff;
}

.cat-pill .count {
    opacity: 0.78;
    font-size: 0.78rem;
    margin-left: 4px;
}

/* Section Header */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 18px;
}

.section-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.section-sub {
    margin: 4px 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.shelf-count {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
}

.shelf-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.view-all-link {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--accent-2);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.25);
    white-space: nowrap;
    transition: all 0.18s;
}

.view-all-link:hover {
    background: rgba(6, 182, 212, 0.22);
    color: #fff;
}

html[data-theme="light"] .view-all-link:hover {
    color: var(--text-primary);
}

.rail-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.16s;
}

.rail-arrow:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

/* Editor's Choice Widescreen Cards */
.editors-section {
    margin: 8px 0 32px;
}

.editors-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.editor-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.editor-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 58, 237, 0.65);
    box-shadow: 0 14px 32px rgba(124, 58, 237, 0.18);
}

.editor-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #141830 url('/assets/img/game-placeholder.svg') center / cover no-repeat;
}

.editor-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.editor-card:hover .editor-thumb img {
    transform: scale(1.06);
}

.editor-cat-pill {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(11, 13, 23, 0.78);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
}

.editor-body {
    padding: 15px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.editor-body h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editor-body p {
    margin: 0;
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.48;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.editor-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}

.editor-cta {
    color: var(--accent-2);
    font-weight: 700;
}

/* Thematic Horizontal Carousel Shelves */
.shelf-section {
    margin: 26px 0;
}

.game-rail {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 4px 2px 10px;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.game-rail::-webkit-scrollbar {
    display: none;
}

.rail-card {
    flex: 0 0 218px;
    scroll-snap-align: start;
}

/* Recently Played Strip */
.recent-rail {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 0 8px;
    scrollbar-width: none;
}

.recent-rail::-webkit-scrollbar {
    display: none;
}

.recent-chip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 7px 8px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: border-color 0.18s, transform 0.18s;
}

.recent-chip:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.recent-chip img {
    width: 52px;
    height: 39px;
    object-fit: cover;
    border-radius: 8px;
    background: #141830 url('/assets/img/game-placeholder.svg') center / cover no-repeat;
}

.recent-chip strong {
    display: block;
    font-size: 0.86rem;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-chip span {
    font-size: 0.74rem;
    color: var(--accent-2);
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 18px;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 58, 237, 0.55);
    box-shadow: var(--shadow-card);
}

.game-thumb-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #141830 url('/assets/img/game-placeholder.svg') center / cover no-repeat;
}

.game-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.game-card:hover .game-thumb-wrap img {
    transform: scale(1.07);
}

.game-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
}

.badge {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fff;
}

.badge-original { background: linear-gradient(135deg, #7c3aed, #ec4899); }
.badge-hot { background: #ef4444; }
.badge-new { background: #06b6d4; }

.play-hover {
    position: absolute;
    inset: 0;
    background: rgba(11, 13, 23, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.game-card:hover .play-hover {
    opacity: 1;
}

.play-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.game-card-body {
    padding: 13px 14px 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.game-card-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.79rem;
    color: var(--text-muted);
}

.game-cat-tag {
    color: var(--accent-2);
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 34px;
}

.page-btn {
    padding: 9px 16px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.page-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border-color: transparent;
}

/* AdSense-Safe Ad Containers */
.ad-wrapper {
    margin: 26px auto;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    text-align: center;
    overflow: hidden;
}

.ad-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.ad-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
}

/* Play Page Layout */
.play-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 26px;
    align-items: start;
}

.play-layout > * {
    min-width: 0;
}

.play-layout.theater-mode {
    grid-template-columns: 1fr;
}

.player-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 100%;
}

.player-stage {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 460px;
    background: #05070e;
}

.player-stage.pseudo-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
}

.fs-exit-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 10000;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(11, 13, 23, 0.85);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.play-layout.theater-mode .player-stage {
    min-height: 620px;
}

.player-stage iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.player-loader {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #070a14;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    pointer-events: none;
}

.player-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.player-loader .loader-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(18px) brightness(0.32);
    transform: scale(1.08);
}

.player-loader .loader-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 18px;
}

.loader-spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.16);
    border-top-color: #22d3ee;
    border-right-color: #7c3aed;
    animation: gpSpin 0.75s linear infinite;
}

@keyframes gpSpin {
    to { transform: rotate(360deg); }
}

.loader-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.loader-sub {
    font-size: 0.84rem;
    color: #cbd5e1;
}

.player-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.player-title-wrap h1 {
    margin: 0 0 4px;
    font-size: 1.35rem;
}

.player-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.player-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s;
}

.tool-btn:hover {
    border-color: var(--accent);
}

.tool-btn.liked {
    background: rgba(239, 68, 68, 0.18);
    border-color: #ef4444;
    color: #fca5a5;
}

.seo-content-box {
    margin-top: 26px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 26px 28px;
}

.seo-content-box h2 {
    margin: 22px 0 10px;
    font-size: 1.18rem;
}

.seo-content-box h2:first-child {
    margin-top: 0;
}

.seo-content-box p, .seo-content-box li {
    color: var(--text-secondary);
    font-size: 0.96rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tag-chip {
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.faq-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.sidebar-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.sidebar-box h3 {
    margin: 0 0 14px;
    font-size: 1rem;
}

.mini-game-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mini-game-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.mini-game-item:hover {
    border-color: var(--accent);
}

.mini-game-item img {
    width: 68px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.mini-game-info {
    min-width: 0;
}

.mini-game-info strong {
    display: block;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-game-info span {
    font-size: 0.76rem;
    color: var(--text-muted);
}

/* Compliance / Static Pages */
.article-page {
    max-width: 860px;
    margin: 0 auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px;
}

.article-page h1 {
    margin-top: 0;
    font-size: 2rem;
}

.article-page h2 {
    margin-top: 26px;
    font-size: 1.25rem;
}

.article-page p, .article-page li {
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 56px 20px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
    padding: 34px 0 24px;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border-color);
}

.footer-logo {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.footer-desc {
    margin: 0;
    max-width: 440px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 18px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.footer-traffic {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.traffic-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.traffic-pill strong {
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 1280px) {
    .nav-pill:not(.nav-pill-random) {
        display: none !important;
    }
}

@media (max-width: 980px) {
    .hero-banner {
        grid-template-columns: 1fr;
        padding: 24px;
    }
    .editors-grid {
        grid-template-columns: 1fr;
    }
    .play-layout {
        grid-template-columns: 1fr;
    }
    .nav-pill, #btnTheater, .rail-arrow {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .user-pill {
        height: 32px;
        padding: 0 9px;
        font-size: 0.78rem;
    }
    .user-pill-name, .user-pill-lv {
        display: none;
    }
    .cloud-save-grid {
        grid-template-columns: 1fr;
    }
    .profile-banner {
        padding: 16px;
        gap: 14px;
    }
    .profile-id {
        width: 100%;
        min-width: 0;
        gap: 12px;
    }
    .profile-id > div {
        min-width: 0;
        flex: 1;
    }
    .profile-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.55rem;
    }
    .profile-id h1 {
        font-size: 1.15rem;
        flex-wrap: wrap;
        gap: 6px;
    }
    .xp-bar {
        width: 100%;
        max-width: 200px;
    }
    .profile-stats {
        width: 100%;
        gap: 8px;
    }
    .p-stat {
        flex: 1;
        min-width: 0;
        padding: 8px 6px;
    }
    .auth-card {
        padding: 20px 16px;
    }
    .save-row {
        padding: 12px;
        gap: 10px;
    }
    .save-info {
        min-width: 0;
        flex-basis: 100%;
    }
    .rail-card {
        flex: 0 0 165px;
    }
    .container {
        padding: 0 12px;
    }
    .header-inner {
        gap: 8px;
        height: 60px;
    }
    .brand-text {
        display: none;
    }
    .header-search {
        min-width: 0;
        flex: 1 1 auto;
        padding: 3px 4px 3px 10px;
    }
    .header-search input {
        font-size: 0.86rem;
    }
    .header-search .search-submit {
        width: 30px;
        height: 30px;
    }
    .header-actions {
        gap: 6px;
        flex-shrink: 0;
    }
    .icon-btn, .lang-btn {
        height: 32px;
        padding: 0 9px;
        font-size: 0.8rem;
    }
    .game-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .player-stage {
        width: 100%;
        aspect-ratio: auto;
        height: min(68svh, 520px);
        min-height: 440px;
    }
    .player-toolbar {
        padding: 12px 14px;
    }
    .player-title-wrap h1 {
        font-size: 1.15rem;
    }
    .seo-content-box {
        padding: 18px 16px;
    }
    .article-page {
        padding: 20px 16px;
    }
}
