@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Rajdhani:wght@400;500;600;700&display=swap');

:root {
    --bg: #0e0f0b;
    --bg-alt: #121309;
    --bg-panel: #1a1c12;
    --bg-card: #1f2216;
    --bg-card-hover: #262a18;
    --border: #333a22;
    --border-light: #454e2b;
    --olive: #7a9142;
    --olive-light: #9ab654;
    --olive-dark: #4c5a28;
    --rust: #d1652f;
    --rust-light: #e88445;
    --gold: #e7c873;
    --text: #eef0e2;
    --text-muted: #98a180;
    --text-dim: #6b7358;
    --danger: #c0392b;
    --success: #7a9142;
    --radius: 6px;
    --radius-lg: 12px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.45);
    --shadow-glow: 0 0 0 1px rgba(122,145,66,0.25), 0 8px 20px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 15% 0%, rgba(122,145,66,0.10) 0%, transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(209,101,47,0.08) 0%, transparent 40%),
        linear-gradient(180deg, #0e0f0b 0%, #0b0c08 100%);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

h1, h2, h3, .brand, .btn-primary, .btn-steam, nav a, .page-title, .site-title {
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.5px;
}

a { color: inherit; text-decoration: none; }
code {
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--gold);
}

::selection { background: var(--olive-dark); color: #fff; }

/* ================= SCROLLBAR ================= */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--olive-dark); }

/* ================= NAVBAR ================= */
.navbar {
    background: linear-gradient(180deg, rgba(26,28,18,0.97) 0%, rgba(14,15,11,0.97) 100%);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}
.navbar::after {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(90deg, var(--olive) 0%, var(--rust) 50%, transparent 100%);
    opacity: 0.6;
}
.navbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 34px;
}
.brand {
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text);
    letter-spacing: 2px;
    white-space: nowrap;
}
.brand span { color: var(--rust-light); }
.nav-links { display: flex; gap: 26px; flex: 1; align-items: center; }
.nav-links a {
    position: relative;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
    padding: 8px 2px;
    transition: color 0.15s;
}
.nav-links a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: var(--olive-light);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.is-active { color: var(--olive-light); }
.nav-links a.is-active::after { transform: scaleX(1); }

.nav-user { display: flex; align-items: center; gap: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-light); object-fit: cover; }
.user-chip { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 4px 6px; border-radius: 20px; transition: background 0.15s; }
.user-chip:hover { background: rgba(255,255,255,0.04); }
.balance {
    background: linear-gradient(135deg, rgba(231,200,115,0.14), rgba(231,200,115,0.04));
    border: 1px solid rgba(231,200,115,0.4);
    color: var(--gold);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    white-space: nowrap;
}

/* ================= BUTTONS ================= */
.btn-primary, .btn-steam, .btn-secondary, .btn-small, .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: var(--radius);
    padding: 10px 20px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-primary {
    background: linear-gradient(135deg, var(--olive-light), var(--olive));
    color: #0d0e08;
    box-shadow: 0 2px 10px rgba(122,145,66,0.25);
}
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(122,145,66,0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: #3a3d2c; color: #777; cursor: not-allowed; box-shadow: none; filter: none; transform: none; }
.btn-buy { width: 100%; }
.btn-steam { background: linear-gradient(135deg, #2a475e, #1b2838); color: #66c0f4; border: 1px solid #2a475e; }
.btn-steam:hover { filter: brightness(1.15); }
.btn-secondary { background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text-muted); }
.btn-secondary:hover { border-color: var(--olive); color: var(--text); }
.btn-small { background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text); font-size: 12px; padding: 7px 14px; }
.btn-small:hover { border-color: var(--olive); background: var(--bg-card-hover); }
.btn-danger { background: linear-gradient(135deg, #d94a3a, var(--danger)); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }

/* ================= LAYOUT ================= */
.container { max-width: 1240px; margin: 0 auto; padding: 34px 24px 60px; min-height: 70vh; }
.page-title {
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 6px;
    border-left: 4px solid var(--rust);
    padding-left: 14px;
}
.subtitle { color: var(--text-muted); margin-bottom: 28px; font-size: 15px; }

.flash {
    padding: 13px 18px;
    border-radius: var(--radius);
    margin-bottom: 22px;
    font-weight: 600;
    border-left: 4px solid;
    box-shadow: var(--shadow-sm);
}
.flash.success { background: rgba(122,145,66,0.12); border-color: var(--olive); color: #c1dd93; }
.flash.error { background: rgba(192,57,43,0.14); border-color: var(--danger); color: #f0a99e; }

/* ================= HERO ================= */
.hero {
    position: relative;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 15% 20%, rgba(122,145,66,0.25) 0%, transparent 55%),
        radial-gradient(circle at 85% 80%, rgba(209,101,47,0.22) 0%, transparent 55%),
        linear-gradient(135deg, #1a1c12 0%, #14150e 100%);
    border: 1px solid var(--border);
    padding: 46px 40px;
    margin-bottom: 34px;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 26px);
    pointer-events: none;
}
.hero-content { position: relative; max-width: 640px; }
.hero-tag {
    display: inline-block;
    background: rgba(231,200,115,0.1);
    border: 1px solid rgba(231,200,115,0.35);
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 18px;
}
.hero-title {
    font-size: 42px;
    margin: 0 0 14px;
    text-transform: uppercase;
    line-height: 1.1;
    color: var(--text);
}
.hero-title span { color: var(--rust-light); }
.hero-subtitle { color: var(--text-muted); font-size: 16px; max-width: 520px; margin: 0 0 26px; }
.hero-stats { display: flex; gap: 30px; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; }
.hero-stat strong { font-family: 'Oswald', sans-serif; font-size: 24px; color: var(--olive-light); }
.hero-stat span { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* ================= CATEGORIES ================= */
.categories-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 34px;
    flex-wrap: wrap;
    padding-bottom: 4px;
}
.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 24px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12.5px;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    transition: all 0.15s ease;
}
.cat-pill-icon { font-size: 15px; line-height: 1; }
.cat-pill:hover { border-color: var(--olive); color: var(--text); background: var(--bg-card-hover); }
.cat-pill.active {
    background: linear-gradient(135deg, var(--olive-light), var(--olive));
    border-color: var(--olive);
    color: #0d0e08;
    box-shadow: 0 2px 10px rgba(122,145,66,0.3);
}

/* ================= SECTIONS / GROUPED CATEGORY VIEW ================= */
.category-section { margin-bottom: 42px; }
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.section-header h2 {
    margin: 0;
    font-size: 20px;
    text-transform: uppercase;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-icon { font-size: 20px; }
.section-count { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.section-link {
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--olive-light);
    white-space: nowrap;
}
.section-link:hover { color: var(--rust-light); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
    background: var(--bg-card);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-lg);
}
.empty-icon { font-size: 34px; display: block; margin-bottom: 10px; }

/* ================= ITEM GRID ================= */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.item-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, #1a1c11 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.item-card:hover {
    border-color: var(--olive);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}
.item-image {
    position: relative;
    height: 158px;
    background: radial-gradient(circle at 50% 40%, #23261a 0%, #17190f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}
.item-image img { max-width: 82%; max-height: 82%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.5)); transition: transform 0.2s ease; }
.item-card:hover .item-image img { transform: scale(1.06); }
.item-image .no-image { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; text-align: center; line-height: 1.8; }
.qty-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(14,15,11,0.85);
    border: 1px solid var(--border-light);
    color: var(--gold);
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
}
.item-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.item-body h3 { margin: 0; font-size: 16.5px; font-family: 'Oswald', sans-serif; text-transform: uppercase; color: var(--text); }
.item-meta { font-size: 11.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.item-footer { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--border); }
.item-price { font-weight: 700; color: var(--gold); font-family: 'Oswald', sans-serif; font-size: 18px; }

/* ================= CARDS/FORMS ================= */
.card-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.card-box.narrow { max-width: 500px; }
.card-box h3 { margin-top: 0; text-transform: uppercase; font-size: 18px; color: var(--olive-light); }

.stacked-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.stacked-form label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.stacked-form input, .stacked-form select, .stacked-form textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 11px 13px;
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    transition: border-color 0.15s;
}
.stacked-form input:focus, .stacked-form select:focus, .stacked-form textarea:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px rgba(122,145,66,0.15); }
.inline-form { display: inline-block; margin-right: 6px; }

/* ================= ADMIN ================= */
.admin-nav { display: flex; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.admin-nav a { background: var(--bg-card); border: 1px solid var(--border); padding: 9px 18px; border-radius: var(--radius); font-weight: 600; text-transform: uppercase; font-size: 13px; transition: 0.15s; }
.admin-nav a:hover { border-color: var(--olive); color: var(--olive-light); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; margin-bottom: 10px; }
.stat-box { background: linear-gradient(160deg, var(--bg-card), #191b11); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; text-align: center; }
.stat-box h2 { margin: 0; font-size: 30px; color: var(--rust-light); font-family: 'Oswald', sans-serif; }
.stat-box p { margin: 8px 0 0; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.admin-table th, .admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; text-align: left; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.admin-table th { background: #17190f; color: var(--text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
.admin-table img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

/* ================= FOOTER ================= */
.footer { text-align: center; padding: 30px 20px; color: var(--text-dim); font-size: 13px; border-top: 1px solid var(--border); background: var(--bg-panel); margin-top: 40px; }
.footer-brand { font-family: 'Oswald', sans-serif; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.footer-brand span { color: var(--rust); }

/* ================= PURCHASE HISTORY ================= */
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; transition: border-color 0.15s; }
.history-item:hover { border-color: var(--border-light); }
.history-item .h-name { font-weight: 600; }
.history-item .h-date { color: var(--text-dim); font-size: 12px; }

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
    .navbar-inner { flex-wrap: wrap; gap: 14px; }
    .nav-links { order: 3; width: 100%; gap: 18px; flex-wrap: wrap; }
    .hero { padding: 32px 24px; }
    .hero-title { font-size: 30px; }
}
@media (max-width: 560px) {
    .container { padding: 22px 16px 40px; }
    .hero-stats { gap: 18px; }
    .item-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 4px; }
}
