:root {
  color-scheme: dark;
  --bg: #0b0f19;
  --surface: #131b2e;
  --surface-hover: #1a243b;
  --border: #223049;
  --border-subtle: #192338;
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-glow: rgba(16, 185, 129, 0.15);
  --gold: #f59e0b;
  --blue: #38bdf8;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; color: var(--text-main); background-color: var(--bg); background-image: radial-gradient(circle at 50% -20%, rgba(16, 185, 129, 0.08), transparent 60%), linear-gradient(180deg, #070a12, #0b0f19); }

button, input { font: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.page-shell { width: min(1320px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 40px; }

/* Utility Bar */
.utility-bar { height: 44px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-subtle); margin-bottom: 20px; }
.utility-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; font-weight: 600; transition: color 0.15s; }
.utility-link:hover { color: var(--text-main); }
.utility-link svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* Hero / Header Section */
.hero-row { display: grid; grid-template-columns: 280px 1fr 280px; align-items: center; gap: 24px; padding: 16px 0 32px; border-bottom: 1px solid var(--border); }
.brand-logo { display: flex; justify-content: center; }
.brand-logo img { max-height: 52px; width: auto; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)); }

.hero-side { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); transition: all 0.2s ease; }
.hero-side:hover { border-color: var(--accent); background: var(--surface-hover); }
.play-link { justify-content: flex-start; }
.discord-link { justify-content: flex-end; text-align: right; }
.hero-side-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hero-side-copy strong { font-size: 13px; font-weight: 700; color: var(--text-main); }
.hero-side-copy small { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.network-count { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.network-count i, .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.network-count i.offline { background: var(--text-muted); box-shadow: none; }
.network-count b { color: var(--text-main); font-weight: 700; }

.round-icon { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--border-subtle); color: var(--text-main); flex-shrink: 0; border: 1px solid var(--border); }
.round-icon svg { width: 20px; height: 20px; }
.online-corner { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 10px; background: var(--gold); color: #000; font-size: 10px; font-weight: 800; }

/* Layout Structure */
.store-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; margin-top: 24px; }

/* Sidebar Navigation */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.sidebar-eyebrow { font-size: 11px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; padding-left: 4px; }

.login-banner { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); text-align: left; transition: all 0.2s ease; cursor: pointer; }
.login-banner:hover { background: var(--surface-hover); border-color: var(--accent); }
.banner-avatar { width: 48px; height: 48px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); flex-shrink: 0; }
.banner-avatar img { width: 38px; height: 38px; image-rendering: pixelated; }
.banner-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.banner-copy strong { font-size: 13px; font-weight: 700; }
.banner-copy small { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.banner-arrow { color: var(--text-muted); transition: transform 0.2s; }
.login-banner:hover .banner-arrow { transform: translateX(2px); color: var(--text-main); }
.banner-arrow svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-categories { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.sidebar-section-label { padding: 14px 16px 8px; font-size: 11px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.category-nav { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 16px; text-align: left; border-left: 3px solid transparent; transition: all 0.15s ease; }
.category-nav:hover { background: var(--surface-hover); }
.category-nav.active { background: var(--surface-hover); border-left-color: var(--accent); }
.category-icon-box { width: 36px; height: 36px; display: grid; place-items: center; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); }
.category-icon-box img { width: 22px; height: 22px; object-fit: contain; }
.category-copy { display: flex; flex-direction: column; flex: 1; }
.category-copy strong { font-size: 13px; font-weight: 600; }
.category-copy small { font-size: 11px; color: var(--text-muted); }
.category-chevron { color: var(--text-muted); font-size: 18px; font-weight: bold; }

.sidebar-online, .sidebar-balance { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 13px; }
.sidebar-online-mark, .balance-mark { width: 32px; height: 32px; display: grid; place-items: center; background: var(--border-subtle); border-radius: 8px; color: var(--text-muted); border: 1px solid var(--border); }
.sidebar-online-mark svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-online-copy { display: flex; flex-direction: column; flex: 1; }
.sidebar-online-copy small, .sidebar-balance small { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.sidebar-online-copy strong, .sidebar-balance strong { font-size: 13px; font-weight: 700; }
.sidebar-online-live { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.balance-mark { font-weight: 800; color: var(--gold); }

/* Main Panel & Store Content */
.main-panel { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-height: 600px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }

.login-gate { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; padding: 56px; align-items: center; }
.gate-art-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gate-art-label, .gate-art-foot { font-size: 10px; color: var(--text-muted); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.gate-art { width: 190px; height: 230px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); display: grid; place-items: center; position: relative; overflow: hidden; box-shadow: inset 0 0 20px rgba(0,0,0,0.5); }
.gate-art img { width: 130px; height: 170px; image-rendering: pixelated; position: relative; z-index: 1; filter: drop-shadow(0 8px 16px rgba(0,0,0,0.4)); }
.gate-art-glow { position: absolute; bottom: 0; width: 120px; height: 50px; background: rgba(16, 185, 129, 0.15); filter: blur(16px); }

.gate-copy h1 { font-size: 30px; font-weight: 800; line-height: 1.2; margin: 8px 0 14px; letter-spacing: -0.02em; }
.gate-copy > p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; line-height: 1.6; }
.gate-points { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.gate-points span { display: flex; align-items: center; gap: 10px; }
.gate-points i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.tiny-label { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; }
.gate-note { font-size: 11px; color: var(--text-muted); margin-top: 16px; }

.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 20px; border-radius: 8px; background: var(--accent); color: #041f12; font-size: 13px; font-weight: 700; transition: all 0.2s ease; box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3); }
.primary-button:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4); }
.primary-button:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }

/* Store Content Dashboard */
.store-content { padding: 28px; }
.store-welcome { display: flex; justify-content: space-between; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--border-subtle); gap: 16px; }
.welcome-player { display: flex; align-items: center; gap: 16px; }
.welcome-avatar-frame { width: 52px; height: 52px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; }
.welcome-avatar-frame img { width: 40px; height: 40px; image-rendering: pixelated; }
.store-welcome h1 { font-size: 22px; font-weight: 800; margin: 4px 0 2px; letter-spacing: -0.01em; }
.store-welcome p { font-size: 12px; color: var(--text-muted); margin: 0; }

.account-pill { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: 11px; font-weight: 700; }
.account-pill button { color: var(--text-muted); display: grid; place-items: center; padding: 2px; transition: color 0.15s; }
.account-pill button:hover { color: var(--text-main); }
.account-pill svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; border-bottom: 1px solid var(--border-subtle); gap: 16px; }
.catalog-context strong { font-size: 16px; font-weight: 700; display: block; margin-top: 3px; }
.catalog-tools { display: flex; align-items: center; gap: 14px; }

.currency-switch { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg); padding: 2px; }
.currency-option { padding: 6px 12px; font-size: 11px; font-weight: 700; color: var(--text-muted); border-radius: 6px; transition: all 0.15s; }
.currency-option.active { background: var(--border); color: var(--text-main); }

.free-note { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--gold); background: rgba(245, 158, 11, 0.1); padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(245, 158, 11, 0.2); }
.free-note i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); }

.cart-button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: 13px; font-weight: 700; transition: all 0.15s; }
.cart-button:hover { border-color: var(--accent); background: var(--surface-hover); }
.cart-button svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cart-button b { min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: #041f12; font-size: 10px; font-weight: 800; }

.catalog-heading { display: flex; justify-content: space-between; align-items: flex-end; margin: 28px 0 20px; }
.catalog-heading h2 { font-size: 22px; font-weight: 800; margin: 4px 0; letter-spacing: -0.01em; }
.catalog-heading p { font-size: 13px; color: var(--text-muted); margin: 0; }
.catalog-counter { font-size: 11px; color: var(--text-muted); font-weight: 700; border: 1px solid var(--border); padding: 6px 10px; border-radius: 6px; background: var(--bg); }

/* Product Grid */
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.product-card { border: 1px solid var(--border); border-radius: 10px; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; transition: all 0.2s ease; }
.product-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.3); }
.product-visual { position: relative; height: 160px; background: linear-gradient(135deg, var(--surface), var(--bg)); display: grid; place-items: center; border-bottom: 1px solid var(--border); }
.product-tag { position: absolute; top: 10px; left: 10px; font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 6px; background: var(--border-subtle); color: var(--text-muted); text-transform: uppercase; border: 1px solid var(--border); }
.product-icon-frame { width: 72px; height: 72px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.product-icon-frame img { width: 44px; height: 44px; object-fit: contain; }

.product-info { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.product-info h3 { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.product-info p { font-size: 12px; color: var(--text-muted); margin: 0 0 20px; line-height: 1.5; flex: 1; }
.product-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.product-price { font-size: 18px; font-weight: 800; color: var(--text-main); }
.free-chip { font-size: 10px; font-weight: 700; color: #34d399; background: rgba(52, 211, 153, 0.1); padding: 4px 8px; border-radius: 6px; border: 1px solid rgba(52, 211, 153, 0.2); }

.add-button { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 12px; font-weight: 700; transition: all 0.15s; }
.add-button:hover { background: var(--accent); color: #041f12; border-color: var(--accent); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25); }
.add-button:disabled { opacity: 0.5; cursor: not-allowed; }

.store-footnote { display: flex; align-items: center; gap: 14px; margin-top: 28px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); font-size: 12px; color: var(--text-muted); }
.footnote-shield { color: var(--gold); }
.footnote-shield svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Bottom Support & Footer */
.bottom-info { display: flex; align-items: center; gap: 18px; margin-top: 24px; padding: 18px 24px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 13px; }
.support-symbol { color: var(--blue); width: 36px; height: 36px; display: grid; place-items: center; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }
.support-symbol svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bottom-info strong { display: block; font-weight: 700; color: var(--text-main); }
.bottom-info p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.support-caption { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

footer { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding: 0 6px; color: var(--text-muted); font-size: 11px; font-weight: 500; }

/* Modals & Drawers */
.modal-backdrop, .drawer-backdrop { position: fixed; inset: 0; background: rgba(3, 7, 18, 0.8); backdrop-filter: blur(6px); z-index: 100; display: grid; place-items: center; }
.login-modal { width: min(460px, calc(100% - 32px)); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 28px; position: relative; box-shadow: 0 25px 50px rgba(0,0,0,0.5); }
.modal-player-avatar { width: 84px; height: 84px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); display: grid; place-items: center; margin: 0 auto 18px; position: relative; overflow: hidden; }
.modal-player-avatar img { width: 64px; height: 64px; image-rendering: pixelated; position: relative; z-index: 1; }
.avatar-ring { position: absolute; inset: 6px; border: 1px dashed var(--border); border-radius: 6px; }
.login-modal h2 { font-size: 20px; font-weight: 800; text-align: center; margin: 0 0 24px; letter-spacing: -0.01em; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); font-size: 18px; transition: all 0.15s; }
.modal-close:hover { background: var(--border); color: var(--text-main); }

.edition-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.edition-option { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); text-align: left; transition: all 0.15s; cursor: pointer; }
.edition-option.selected { border-color: var(--accent); background: var(--surface-hover); box-shadow: 0 0 0 1px var(--accent); }
.edition-option svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; color: var(--text-muted); }
.edition-option.selected svg { color: var(--accent); }
.edition-option strong { display: block; font-size: 12px; font-weight: 700; }
.edition-option small { display: block; font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.input-label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px; letter-spacing: 0.06em; }
.login-modal input[type="text"] { width: 100%; height: 42px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text-main); font-size: 14px; outline: none; transition: border-color 0.15s; }
.login-modal input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-hint { font-size: 11px; color: var(--text-muted); margin: 6px 0 18px; }
.login-submit { width: 100%; height: 42px; font-weight: 700; }
.modal-description { font-size: 11px; color: var(--text-muted); text-align: center; margin: 18px 0 8px; line-height: 1.5; }
.modal-security { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.modal-security svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login-error { margin-top: 14px; padding: 10px 14px; border-radius: 8px; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #f87171; font-size: 12px; font-weight: 600; }

/* Cart Drawer */
.cart-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--surface); border-left: 1px solid var(--border); z-index: 101; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: -20px 0 50px rgba(0,0,0,0.5); }
.cart-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 24px; border-bottom: 1px solid var(--border); }
.drawer-header h2 { font-size: 18px; font-weight: 800; margin: 2px 0 0; }
.drawer-items { flex: 1; overflow-y: auto; padding: 24px; }
.cart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); text-align: center; gap: 10px; }
.cart-empty span { font-size: 28px; margin-bottom: 4px; }
.cart-empty strong { font-size: 15px; color: var(--text-main); font-weight: 700; }
.cart-empty p { font-size: 12px; margin: 0; }

.cart-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-subtle); }
.cart-row img { width: 48px; height: 48px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.cart-row-main { flex: 1; min-width: 0; }
.cart-row-main strong { font-size: 13px; font-weight: 700; display: block; }
.cart-row-main small { font-size: 11px; color: var(--text-muted); }
.cart-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cart-row-side b { font-size: 14px; font-weight: 700; }
.remove-item { font-size: 11px; color: #f87171; padding: 0; font-weight: 600; }
.remove-item:hover { text-decoration: underline; }

.drawer-footer { padding: 24px; border-top: 1px solid var(--border); background: var(--bg); }
.drawer-total { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin-bottom: 8px; font-weight: 600; }
.drawer-total strong { font-size: 20px; font-weight: 800; color: var(--accent); }
.drawer-footer > p { font-size: 11px; color: var(--text-muted); margin: 0 0 16px; line-height: 1.4; }
.checkout-button { width: 100%; height: 44px; font-weight: 700; }
.checkout-feedback { font-size: 12px; color: var(--accent); margin-top: 10px; text-align: center; font-weight: 600; }

/* Toast */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface); border: 1px solid var(--border); padding: 12px 20px; border-radius: 8px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,0.5); opacity: 0; pointer-events: none; transition: all 0.2s ease; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 960px) {
  .hero-row { grid-template-columns: 1fr; gap: 14px; }
  .store-layout { grid-template-columns: 1fr; }
  .login-gate { grid-template-columns: 1fr; text-align: center; padding: 32px; }
  .gate-art-wrap { margin: 0 auto; }
  .gate-points { align-items: center; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .product-grid { grid-template-columns: 1fr; }
  .store-welcome { flex-direction: column; align-items: flex-start; }
}