:root {
    --bg: #0f1117;
    --surface: #181b24;
    --surface-2: #222634;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f2f3f5;
    --muted: #949ba4;
    --blurple: #5865f2;
    --blurple-hover: #4752c4;
    --green: #23a55a;
    --amber: #f0b232;
    --red: #f23f43;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at top right, #1b2038 0%, var(--bg) 55%);
    color: var(--text);
    min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.9rem; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 18px; }

.worker-notice {
    background: rgba(240, 178, 50, 0.16); border-bottom: 1px solid rgba(240, 178, 50, 0.45);
    color: #ffd57a; padding: 10px 16px; text-align: center; font-size: 0.9rem; font-weight: 600;
}

.navbar {
    position: sticky; top: 0; z-index: 40;
    background: rgba(15, 17, 23, 0.88); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); padding: 12px 0;
}
.nav-inner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 1.15rem; }
.brand-icon {
    width: 38px; height: 38px; border-radius: 10px; background: var(--blurple);
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem;
}

.search-wrap {
    flex: 1; min-width: 240px; display: flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 6px 4px 14px;
}
.search-wrap input {
    flex: 1; background: transparent; border: none; color: var(--text); font-family: inherit;
    font-size: 0.92rem; padding: 8px 4px; outline: none;
}
.btn-icon-accent {
    background: rgba(88, 101, 242, 0.2); border: 1px solid rgba(88, 101, 242, 0.45);
    color: #aeb8ff; border-radius: 9px; padding: 7px 12px; font-family: inherit;
    font-weight: 600; font-size: 0.84rem; cursor: pointer; white-space: nowrap;
}
.btn-icon-accent:hover { background: var(--blurple); color: #fff; }

.nav-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill-count {
    background: var(--blurple); color: #fff; border-radius: 999px;
    padding: 1px 7px; font-size: 0.78rem; margin-left: 4px;
}

.btn {
    border: none; border-radius: 10px; padding: 9px 14px; font-family: inherit;
    font-weight: 600; font-size: 0.9rem; cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center; gap: 7px; transition: 0.15s;
}
.btn-sm { padding: 6px 10px; font-size: 0.82rem; }
.btn-full { width: 100%; }
.btn-primary { background: var(--blurple); color: #fff; }
.btn-primary:hover { background: var(--blurple-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-danger-outline { background: transparent; color: var(--red); border: 1px solid rgba(242,63,67,0.45); }
.btn-discord { background: #5865f2; color: #fff; }
.btn-line { background: #06c755; color: #fff; }
.btn-google { background: #fff; color: #111; }

.main-wrap { padding-top: 22px; padding-bottom: 60px; }
.hero-card {
    background: linear-gradient(135deg, rgba(88,101,242,0.18) 0%, rgba(24,27,36,0.95) 65%);
    border: 1px solid rgba(88,101,242,0.3); border-radius: 20px; padding: 24px;
    display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-bottom: 18px;
}
.hero-copy h1 { margin: 10px 0 8px; font-size: 1.65rem; }
.hero-copy p { margin: 0 0 12px; color: #c7ccd6; line-height: 1.55; }
.hero-steps { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.step-box {
    background: rgba(15, 17, 23, 0.65); border: 1px solid var(--border);
    border-radius: 12px; padding: 11px 14px;
}
.step-box strong { display: block; font-size: 0.94rem; color: #b9c2ff; }
.step-box span { font-size: 0.84rem; color: var(--muted); }

.status-pill {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
    border-radius: 999px; font-size: 0.82rem; font-weight: 700;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.status-pill.online { background: rgba(35,165,90,0.16); color: #57f287; border: 1px solid rgba(35,165,90,0.35); }
.status-pill.online .dot { background: #23a55a; box-shadow: 0 0 8px #23a55a; }
.status-pill.offline { background: rgba(240,178,50,0.16); color: var(--amber); border: 1px solid rgba(240,178,50,0.35); }
.status-pill.offline .dot { background: var(--amber); }

.menu-links { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-links a {
    color: #c2cbff; text-decoration: none; font-size: 0.85rem; padding: 5px 10px;
    border-radius: 8px; background: rgba(255,255,255,0.05); border: 1px solid var(--border);
}

.filter-bar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.type-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    background: var(--surface); color: var(--muted); border: 1px solid var(--border);
    padding: 7px 14px; border-radius: 999px; font-family: inherit; font-size: 0.86rem; cursor: pointer;
}
.chip.active { background: var(--blurple); color: #fff; border-color: var(--blurple); font-weight: 600; }
.filter-right { display: flex; gap: 8px; }
select, input[type="email"], input[type="text"], input[type="password"], input[type="number"] {
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    padding: 8px 12px; border-radius: 10px; font-family: inherit; font-size: 0.9rem;
}

.image-search-bar {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    background: rgba(88,101,242,0.16); border: 1px solid rgba(88,101,242,0.4);
    border-radius: 12px; padding: 10px 14px; margin-bottom: 16px;
}

.product-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px;
}
.product-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: transform 0.15s, border-color 0.15s;
}
.product-card:hover { transform: translateY(-2px); border-color: rgba(88,101,242,0.55); }
.product-thumb-box {
    position: relative; aspect-ratio: 1 / 1; border-radius: 12px;
    background: radial-gradient(circle, #2a2e3e 0%, #161922 100%);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.product-thumb-box img { max-width: 82%; max-height: 82%; object-fit: contain; }
.type-tag {
    position: absolute; top: 8px; left: 8px; background: rgba(15,17,23,0.78);
    color: #c2cbff; padding: 3px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
}
.product-title { font-weight: 700; font-size: 0.96rem; line-height: 1.35; }
.product-sub { color: var(--muted); font-size: 0.8rem; min-height: 18px; }
.product-price-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; }
.product-price-row s { color: var(--muted); font-size: 0.8rem; margin-right: 6px; }
.product-price-row strong { font-size: 1.12rem; color: #57f287; }
.product-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: flex;
    align-items: center; justify-content: center; padding: 18px; z-index: 90;
}
.modal-card {
    width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px;
}
.modal-lg { max-width: 720px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 1.12rem; }
.close-btn { background: transparent; border: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; }

.preview-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; }
.discord-profile-card {
    background: #111214; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); padding-bottom: 16px;
}
.profile-banner { height: 74px; background: linear-gradient(135deg, #5865f2, #9b59b6); }
.avatar-stack {
    position: relative; width: 112px; height: 112px; margin: -52px auto 10px;
}
.base-avatar {
    width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
    position: absolute; top: 12px; left: 12px; border: 4px solid #111214;
}
.decoration-overlay {
    width: 112px; height: 112px; position: absolute; top: 0; left: 0; pointer-events: none; object-fit: contain;
}
.profile-meta { padding: 0 16px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.upload-avatar-btn {
    display: inline-block; margin-top: 6px; padding: 6px 12px; border-radius: 8px;
    background: var(--surface-2); font-size: 0.82rem; cursor: pointer;
}
.price-box {
    background: var(--surface-2); border-radius: 12px; padding: 12px;
    display: flex; justify-content: space-between; margin: 14px 0;
}
.price-box span { display: block; font-size: 0.78rem; color: var(--muted); }
.price-big { font-size: 1.35rem; color: #57f287; }

.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    border: 2px dashed rgba(88,101,242,0.5); border-radius: 14px; padding: 28px; cursor: pointer; text-align: center;
}
.dropzone i { font-size: 2rem; color: var(--blurple); }
.search-thumb { max-width: 140px; max-height: 140px; margin: 12px auto 0; display: block; border-radius: 12px; }

.cart-list, .inventory-list { display: flex; flex-direction: column; gap: 10px; }
.cart-row, .inv-item {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.offline-confirm {
    background: rgba(240,178,50,0.14); border: 1px solid rgba(240,178,50,0.45);
    border-radius: 10px; padding: 10px 12px; margin: 10px 0; color: #ffd57a; font-size: 0.86rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.form-row input { width: 100%; }
.payment-methods { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; font-size: 0.9rem; }
.checkout-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

.qr-box { text-align: center; margin-top: 14px; padding: 14px; background: var(--surface-2); border-radius: 12px; }
.qr-box img { max-width: 220px; border-radius: 10px; background: #fff; padding: 8px; }

.gift-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.gift-code {
    background: #111214; border: 1px solid rgba(88,101,242,0.5); border-radius: 8px;
    padding: 6px 10px; font-family: monospace; font-size: 0.85rem; word-break: break-all;
}
.countdown-badge { background: rgba(88,101,242,0.2); color: #b9c2ff; padding: 4px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.expired-badge { background: rgba(242,63,67,0.22); color: #ff8082; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 800; }

.oauth-stack, .stack-form { display: flex; flex-direction: column; gap: 8px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.reseller-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.user-card-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.user-card-summary img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; }
.balance-tag { color: #57f287; margin-top: 4px; }

.toast {
    position: fixed; bottom: 20px; right: 20px; background: var(--blurple); color: #fff;
    padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 200;
}

@media (max-width: 760px) {
    .hero-card, .preview-stage, .form-row { grid-template-columns: 1fr; }
}
