/* SteamedKeys — Steam-inspired dark theme */
:root {
  --bg:        #1b2838;
  --bg2:       #16202d;
  --bg3:       #2a475e;
  --surface:   #1e2d3d;
  --border:    #2d4159;
  --text:      #c6d4df;
  --text-dim:  #8f98a0;
  --accent:    #1a9fff;
  --accent-h:  #0d8ae6;
  --success:   #4caf50;
  --warning:   #ff9800;
  --danger:    #e53935;
  --xno:       #66c0f4;
  --radius:    6px;
  --shadow:    0 2px 12px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Motiva Sans', 'Noto Sans', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

main { flex: 1; padding: 0 20px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
}
.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.nav-logo-img {
  max-height: 40px;
  width: auto;
  display: block;
}
.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.logo-keys {
  color: var(--xno);
}
.nav-search {
  flex: 1;
  display: flex;
  max-width: 400px;
}
.nav-search input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text);
  padding: 7px 12px;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 0.9rem;
  outline: none;
}
.nav-search input:focus { border-color: var(--accent); }
.nav-search button {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 14px;
  cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.nav-search button:hover { background: var(--accent); color: #fff; }
.currency-switcher {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.currency-switcher select {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 7px 28px 7px 10px;
  font-size: 0.88rem;
  outline: none;
}
.currency-switcher select:focus { border-color: var(--accent); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.nav-links a { color: var(--text); font-size: 0.9rem; text-decoration: none; }
.nav-links a:hover { color: var(--xno); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--accent-h); text-decoration: none; }
.btn-secondary {
  display: inline-block;
  background: var(--bg3);
  color: var(--text) !important;
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-secondary:hover { background: var(--border); text-decoration: none; }
.btn-danger {
  display: inline-block;
  background: var(--danger);
  color: #fff !important;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-danger:hover { background: #c62828; text-decoration: none; }
.btn-link {
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }
.btn-lg { padding: 13px 28px; font-size: 1.05rem; }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; }
.btn-full { width: 100%; text-align: center; }
.btn-copy {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.btn-copy:hover { background: var(--accent); color: #fff; }
.btn-buy { display: block; text-align: center; }

/* ── Flash messages ──────────────────────────────────────────────────────── */
.flash-container { padding: 10px 20px; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.flash-success { background: #1b3a1f; border-left: 4px solid var(--success); }
.flash-error   { background: #3a1b1b; border-left: 4px solid var(--danger); }
.flash-warning { background: #3a2d1b; border-left: 4px solid var(--warning); }
.flash-info    { background: #1b2d3a; border-left: 4px solid var(--accent); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: url('/static/hero.webp') center/cover no-repeat;
  border-bottom: 1px solid var(--border);
  min-height: 420px;
  display: flex;
  align-items: center;
  margin: 0 -20px;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, rgba(16,20,35,0.72) 35%, rgba(16,20,35,0.05) 100%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 60px 40px;
  display: flex;
  justify-content: flex-end;
}
.hero-text {
  max-width: 540px;
  text-align: right;
}
.hero h1 { font-size: 2.4rem; font-weight: 700; color: #fff; margin-bottom: 12px; }
.hero p  { font-size: 1rem; color: var(--text-dim); margin-bottom: 28px; white-space: nowrap; }
.xno { color: var(--xno); }

/* ── Store ───────────────────────────────────────────────────────────────── */
.store-section { padding-top: 40px; padding-bottom: 40px; }
.store-section.container { padding-left: 0; padding-right: 0; }
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 24px; color: #fff; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  text-decoration: none;
}
.game-card-img {
  width: 100%;
  aspect-ratio: 16/7;
  object-fit: cover;
  display: block;
}
.game-card-placeholder {
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}
.game-card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.game-card-title { font-weight: 700; font-size: 0.95rem; color: #fff; }
.game-card-seller { font-size: 0.8rem; color: var(--text-dim); }
.game-card-seller-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.game-card-desc { font-size: 0.82rem; color: var(--text-dim); flex: 1; }
.game-card-warning { margin-top: 8px; font-size: 0.78rem; line-height: 1.4; color: var(--warning); }
.platform-icon-list { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.platform-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}
.platform-icon-badge i { font-size: 0.95rem; }
.platform-icon-badge-detail { justify-content: flex-start; gap: 8px; }
.platform-label { font-size: 0.78rem; color: var(--text-dim); }
.game-card-platforms { margin-top: 4px; }
.game-card-price { margin-top: auto; }
.price-xno { font-weight: 700; color: var(--xno); font-size: 1rem; }
.price-xno-original { color: var(--text-dim); font-size: 0.85rem; margin-right: 4px; }
.price-xno-discounted { font-weight: 700; color: #57d98b; font-size: 1rem; }
.price-fiat { font-size: 0.8rem; color: var(--text-dim); margin-left: 4px; }
.game-card-keys { font-size: 0.75rem; color: var(--text-dim); }
.game-card { position: relative; }
.game-card-discount-badge {
  position: absolute; top: 8px; left: 8px;
  background: #57d98b; color: #0d1b2a;
  font-size: 0.78rem; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
  pointer-events: none;
}
.store-filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 24px;
}
.store-search-input { flex: 1; min-width: 180px; max-width: 340px; }
.store-filter-select { min-width: 130px; max-width: 200px; }
.seller-note {
  margin-top: 10px;
  margin-bottom: 16px;
  padding: 13px 20px;
  border-radius: 10px;
  border: 1px solid rgba(244, 123, 32, 0.5);
  background: rgba(244, 123, 32, 0.12);
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.6;
}
.seller-note-rejected {
  border-color: rgba(229, 57, 53, 0.45);
  background: rgba(229, 57, 53, 0.1);
}
.seller-note-rejected strong { color: var(--danger); }
.seller-note-rejected a { color: var(--danger); }
.seller-note strong { color: #f47b20; }
.seller-note a { color: #f47b20; text-decoration: underline; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty-state p { margin-bottom: 16px; font-size: 1.05rem; }

/* ── How it works ────────────────────────────────────────────────────────── */
.how-it-works { padding: 40px 0 60px; }
.steps { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  flex: 1;
  min-width: 200px;
  max-width: 260px;
}
.step-icon { font-size: 2.5rem; margin-bottom: 12px; }
.step h3 { color: #fff; margin-bottom: 8px; }
.step p { font-size: 0.9rem; color: var(--text-dim); }

/* ── Game detail ─────────────────────────────────────────────────────────── */
.game-detail { padding: 32px 0; }
.game-hero-img-wrap { margin-bottom: 24px; }
.game-hero-img { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius); }
.game-detail-layout { display: flex; gap: 28px; align-items: flex-start; }
.game-detail-main { flex: 1; min-width: 0; }
.game-detail-title { font-size: 2rem; font-weight: 700; color: #fff; margin-bottom: 12px; }
.game-meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.badge {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  white-space: nowrap;
}
.badge-platform { background: #1a3a1a; border-color: var(--success); color: var(--success); }
.badge-verified { background: #1a3a1a; border-color: var(--success); color: var(--success); }
.badge-pending  { background: #3a2d1b; border-color: var(--warning); color: var(--warning); }
.badge-rejected { background: #3a1b1b; border-color: var(--danger); color: var(--danger); }
.badge-admin    { background: #2d1a3a; border-color: #9c27b0; color: #ce93d8; }
.badge-warning  { background: #3a2d1b; border-color: var(--warning); color: var(--warning); }
.badge-large    { font-size: 1rem; padding: 6px 16px; }
.game-short-desc { color: var(--text-dim); margin-bottom: 16px; font-size: 1rem; }
.game-description { color: var(--text); line-height: 1.7; }
.screenshots { margin-top: 24px; }
.screenshots h3 { color: #fff; margin-bottom: 12px; }
.screenshot-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.screenshot-grid img { width: 200px; height: 113px; object-fit: cover; border-radius: 4px; }

/* Buy panel */
.game-buy-panel { width: 280px; flex-shrink: 0; }
.buy-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 72px;
}
.price-xno-large { font-size: 1.8rem; font-weight: 700; color: var(--xno); }
.price-fiat-row { font-size: 0.9rem; color: var(--text-dim); margin-top: 4px; display: flex; gap: 10px; }
.keys-left { font-size: 0.85rem; color: var(--text-dim); margin: 10px 0; }
.out-of-stock { color: var(--danger); font-weight: 600; margin-bottom: 12px; }
.buy-info { margin-top: 16px; font-size: 0.82rem; color: var(--text-dim); display: flex; flex-direction: column; gap: 4px; }
.buy-box .btn-buy { margin-bottom: 8px; }
.btn-link.btn-sm { font-size: 0.82rem; }

/* ── Checkout ────────────────────────────────────────────────────────────── */
.checkout-page { padding: 32px 0; }
.checkout-layout { display: flex; gap: 28px; align-items: flex-start; }
.checkout-main { flex: 1; }
.checkout-title { font-size: 1.6rem; font-weight: 700; color: #fff; margin-bottom: 24px; }
.checkout-game-row { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.checkout-thumb-link { display: block; line-height: 0; }
.checkout-thumb { width: 120px; border-radius: 4px; }
.checkout-game-name { font-size: 1.1rem; font-weight: 700; color: #fff; }
.checkout-game-link { color: inherit; text-decoration: none; }
.checkout-game-link:hover { text-decoration: underline; }
.checkout-game-platform { color: var(--text-dim); font-size: 0.9rem; margin-top: 4px; }
.price-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}
.price-row { display: flex; justify-content: space-between; padding: 6px 0; }
.price-row + .price-row { border-top: 1px solid var(--border); }
.price-fee-row { font-size: 0.85rem; color: var(--text-dim); }
.checkout-step { margin-top: 8px; }
.field-label { display: block; margin-bottom: 6px; color: var(--text-dim); font-size: 0.9rem; }
.field-hint  { display: block; font-size: 0.8rem; color: var(--text-dim); margin-top: 4px; }
.field-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
}
.field-input:focus { border-color: var(--accent); }
.field-input.mono { font-family: 'Courier New', monospace; font-size: 0.85rem; }
.field-inline { width: 200px; }
textarea.field-input { resize: vertical; }
#buyer-email { margin-bottom: 16px; }
.payment-instructions { margin-bottom: 20px; }
.payment-instructions strong { color: var(--xno); }
.payment-hint { font-size: 0.85rem; color: var(--text-dim); margin-top: 6px; }
.countdown { font-weight: 700; color: var(--warning); }
.qr-section { text-align: center; margin: 20px 0; }
.qr-code { width: 200px; height: 200px; border: 4px solid #fff; border-radius: 8px; }
.qr-caption { font-size: 0.85rem; color: var(--text-dim); margin-top: 8px; }
.address-copy-box { display: flex; margin-bottom: 20px; }
.address-field {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius) 0 0 var(--radius);
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  outline: none;
}
.payment-status-box {
  text-align: center;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}
#status-text { color: #fff; font-weight: 600; }
.payment-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 20px;
}
.payment-exact-amount {
  font-size: 0.92rem;
  color: var(--text-dim);
  margin: 12px 0 0;
  line-height: 1.5;
}
.payment-exact-amount strong { color: var(--xno); }

/* Processing modal */
.processing-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(3px);
}
.processing-modal-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 48px;
  text-align: center;
  max-width: 340px;
  width: 90%;
}
.processing-spinner {
  width: 52px;
  height: 52px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.processing-modal-sub {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0;
}
.success-box { text-align: center; padding: 40px 20px; }
.success-icon { font-size: 3.5rem; margin-bottom: 16px; }
.success-box h2 { font-size: 1.8rem; color: var(--success); margin-bottom: 8px; }
.success-box p  { color: var(--text-dim); margin-bottom: 24px; }
.checkout-side { width: 260px; flex-shrink: 0; }
.checkout-info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.checkout-info-box h3 { color: #fff; margin-bottom: 10px; font-size: 0.95rem; }
.checkout-info-box ul { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; color: var(--text-dim); }
.checkout-info-expiry { font-size: 0.8rem; color: var(--text-dim); margin-top: 10px; }

/* ── Receipt ─────────────────────────────────────────────────────────────── */
.receipt-page { padding: 40px 0; }
.receipt-box {
  max-width: 680px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.receipt-header {
  background: var(--bg2);
  text-align: center;
  padding: 32px 24px;
  border-bottom: 1px solid var(--border);
}
.receipt-success-icon { font-size: 3rem; margin-bottom: 12px; }
.receipt-header h1 { font-size: 1.8rem; color: #fff; }
.receipt-subtitle { color: var(--text-dim); margin-top: 8px; }
.receipt-key-section {
  padding: 28px 24px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.receipt-key-section h2 { color: #fff; margin-bottom: 16px; }
.key-display {
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 24px;
  font-family: 'Courier New', monospace;
  font-size: 1.2rem;
  color: var(--xno);
  letter-spacing: 2px;
  margin-bottom: 16px;
  word-break: break-all;
}
.key-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.key-instructions { font-size: 0.85rem; color: var(--text-dim); margin-top: 12px; }
.receipt-details { padding: 24px; border-bottom: 1px solid var(--border); }
.receipt-details h3 { color: #fff; margin-bottom: 12px; }
.receipt-table { width: 100%; border-collapse: collapse; }
.receipt-table th, .receipt-table td { padding: 8px 0; font-size: 0.9rem; }
.receipt-table th { width: 140px; color: var(--text-dim); text-align: left; }
.receipt-table td { color: var(--text); }
.mono { font-family: 'Courier New', monospace; font-size: 0.85rem; }
.tx-link { font-family: 'Courier New', monospace; font-size: 0.85rem; }
.receipt-actions { padding: 24px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.receipt-save-notice { color: var(--warning); font-size: 0.9rem; }

/* ── Auth pages ──────────────────────────────────────────────────────────── */
.auth-page { padding: 60px 20px; display: flex; justify-content: center; }
.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 440px;
}
.auth-box-wide { max-width: 560px; }
.auth-box h1 { font-size: 1.6rem; color: #fff; margin-bottom: 8px; }
.auth-subtitle { color: var(--text-dim); margin-bottom: 24px; }
.field { margin-bottom: 18px; }
.field-checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 0.9rem; }
.field-checkbox input { margin-top: 3px; flex-shrink: 0; }
.field-validation-bubble {
  position: absolute;
  z-index: 500;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  color: #1b2838;
  font-size: 0.9rem;
  line-height: 1.35;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.field-validation-bubble::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 18px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  transform: rotate(45deg);
}
.required { color: var(--danger); }
.auth-alt { margin-top: 20px; text-align: center; font-size: 0.9rem; color: var(--text-dim); }
.seller-perks { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.seller-perks h3 { color: #fff; margin-bottom: 10px; font-size: 1rem; }
.seller-perks ul { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--text-dim); }

/* ── Nano wallet auth ────────────────────────────────────────────────────── */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--text-dim); font-size: 0.85rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.nano-auth-box { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.nano-auth-heading { font-size: 1rem; color: #fff; margin-bottom: 12px; }
.nano-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.nano-tab { background: none; border: none; color: var(--text-dim); font-size: 0.9rem; padding: 6px 14px; cursor: pointer; border-radius: var(--radius) var(--radius) 0 0; transition: background .15s; }
.nano-tab.active { background: var(--surface); color: var(--accent); border: 1px solid var(--border); border-bottom: 1px solid var(--surface); }
.nano-tab:hover:not(.active) { color: var(--text); background: rgba(255,255,255,.04); }

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.dashboard-page { padding: 32px 0; }
.dashboard-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.dashboard-header h1 { font-size: 1.8rem; color: #fff; }
.seller-username { color: var(--text-dim); }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h1 { font-size: 1.6rem; color: #fff; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; margin-bottom: 20px; }
.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.alert-card { border-color: var(--warning); }
.dashboard-card h2 { font-size: 1.1rem; color: #fff; margin-bottom: 14px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.stats-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  flex: 1;
  min-width: 140px;
}
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--xno); }
.stat-label { font-size: 0.85rem; color: var(--text-dim); margin-top: 4px; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg3); }
.admin-search-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.admin-search-bar .field-input { max-width: 480px; }
.admin-search-count { font-size: 0.85rem; color: var(--text-dim); white-space: nowrap; }
.btn-xs { padding: 2px 6px; font-size: 0.75rem; cursor: pointer; background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; color: var(--text-dim); }
.sales-chart-canvas { width: 100%; height: 160px; display: block; cursor: crosshair; }
.chart-tooltip { position: absolute; pointer-events: none; z-index: 20; background: #1a2030; border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; padding: 8px 10px; min-width: 140px; box-shadow: 0 4px 16px rgba(0,0,0,0.4); font-size: 0.8rem; line-height: 1.5; }
.chart-tip-date { color: rgba(255,255,255,0.5); font-size: 0.75rem; margin-bottom: 4px; }
.chart-tip-row { display: flex; align-items: center; gap: 6px; }
.chart-tip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chart-tip-label { color: rgba(255,255,255,0.6); flex: 1; }
.chart-tip-val { color: #fff; font-weight: 600; }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.chart-header h2 { margin: 0; }
.chart-legend { display: flex; align-items: center; font-size: 0.82rem; color: var(--text-dim); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.account-records-table { table-layout: fixed; }
.account-records-table .account-col-game { width: 26%; }
.account-records-table .account-col-party { width: 18%; }
.account-records-table .account-col-amount { width: 13%; }
.account-records-table .account-col-date { width: 12%; }
.account-records-table .account-col-receipt { width: 11%; }
.account-records-table .account-col-transaction { width: 20%; }
.account-records-table th,
.account-records-table td { overflow: hidden; text-overflow: ellipsis; }
.account-records-table td:nth-child(5),
.account-records-table td:nth-child(6) { white-space: nowrap; }
.action-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.view-all-link { display: block; text-align: right; margin-top: 10px; font-size: 0.85rem; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td { padding: 8px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.info-table th { width: 160px; color: var(--text-dim); font-size: 0.9rem; text-align: left; }
.info-table td { color: var(--text); }
.info-table td .inline-edit { background: transparent; border: 1px solid transparent; padding: 2px 6px; border-radius: 4px; color: var(--text); font-size: inherit; width: auto; min-width: 160px; transition: border-color .15s, background .15s; }
.info-table td .inline-edit:hover { border-color: var(--border); }
.info-table td .inline-edit:focus { background: var(--input-bg, var(--card-bg)); border-color: var(--accent); outline: none; }

/* ── Status badges ───────────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-active   { background: #1a3a1a; color: var(--success); }
.status-pending  { background: #3a2d1b; color: var(--warning); }
.status-unlisted { background: var(--bg3); color: var(--text-dim); }
.status-rejected { background: #3a1b1b; color: var(--danger); }
.status-available{ background: #1a3a1a; color: var(--success); }
.status-sold     { background: var(--bg3); color: var(--text-dim); }

/* ── Game management list ────────────────────────────────────────────────── */
.games-manage-list { display: flex; flex-direction: column; gap: 12px; }
.game-manage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.game-manage-thumb { width: 100px; flex-shrink: 0; }
.game-manage-thumb img { width: 100%; border-radius: 4px; }
.thumb-placeholder { width: 100px; height: 56px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; border-radius: 4px; }
.game-manage-info { flex: 1; min-width: 0; }
.game-manage-title { font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.review-note { font-size: 0.82rem; color: var(--warning); margin-top: 4px; }
.game-manage-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-dim); margin-top: 6px; }
.game-manage-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }

/* ── Keys page ───────────────────────────────────────────────────────────── */
.keys-summary { display: flex; gap: 16px; margin-bottom: 12px; font-size: 0.9rem; color: var(--text-dim); }
.redacted { color: var(--text-dim); }

/* ── Review items ────────────────────────────────────────────────────────── */
.review-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.review-item:last-child { border-bottom: none; }
.review-info { flex: 1; }
.review-text { font-size: 0.85rem; color: var(--text-dim); margin-top: 4px; }
.review-thumb { width: 80px; height: 45px; object-fit: cover; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.review-actions { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; flex-shrink: 0; }
.review-actions-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.seller-pending-games { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.seller-pending-game { display: flex; align-items: center; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; font-size: 0.88rem; }

/* ── Seller profile ──────────────────────────────────────────────────────── */
.seller-profile-page { padding: 32px 0; }
.seller-header { display: flex; align-items: center; gap: 20px; margin-bottom: 32px; }
.seller-status-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.seller-avatar {
  width: 64px; height: 64px;
  background: var(--bg3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--xno);
  flex-shrink: 0;
}
.seller-name { font-size: 1.6rem; color: #fff; margin-bottom: 6px; }

/* ── Verification ────────────────────────────────────────────────────────── */
.verified-banner { text-align: center; padding: 24px 0; }
.verification-help {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px dashed rgba(255, 193, 7, 0.35);
  border-radius: 12px;
  background: rgba(255, 193, 7, 0.06);
}
.verification-help p { margin: 0; color: var(--text-dim); }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-info    { background: #1b2d3a; border-left: 4px solid var(--accent); }
.alert-warning { background: #3a2d1b; border-left: 4px solid var(--warning); }
.alert-error   { background: #3a1b1b; border-left: 4px solid var(--danger); }

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
}
.filter-btn:hover, .filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 520px;
  width: 90%;
}
.modal-box h3 { color: #fff; margin-bottom: 12px; }
.modal-content { color: var(--text-dim); white-space: pre-wrap; margin-bottom: 16px; max-height: 300px; overflow-y: auto; }

/* ── Confirm dialog ──────────────────────────────────────────────────────── */
.confirm-modal { display: none; }
.confirm-modal-msg { color: var(--text-dim); margin-bottom: 24px; line-height: 1.6; font-size: 0.95rem; word-break: break-all; overflow-wrap: anywhere; }
.confirm-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  margin-top: 40px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-inner p { color: var(--text-dim); font-size: 0.85rem; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-dim); font-size: 0.85rem; }
.footer-links a:hover { color: var(--accent); }

/* ── Legal page ──────────────────────────────────────────────────────────── */
.legal-page { max-width: 780px; margin: 40px auto; padding: 0 20px 60px; }
.legal-page h1 { font-size: 2rem; color: #fff; margin-bottom: 6px; }
.last-updated { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 32px; }
.legal-page section { margin-bottom: 28px; }
.legal-page h2 { font-size: 1.2rem; color: var(--xno); margin-bottom: 10px; }
.legal-page ul { list-style: disc; padding-left: 20px; color: var(--text-dim); display: flex; flex-direction: column; gap: 6px; font-size: 0.95rem; }
.legal-page p { color: var(--text-dim); font-size: 0.95rem; line-height: 1.7; }

/* ── Error page ──────────────────────────────────────────────────────────── */
.error-page { display: flex; justify-content: center; align-items: center; padding: 80px 20px; }
.error-box { text-align: center; }
.error-code { font-size: 5rem; font-weight: 700; color: var(--bg3); margin-bottom: 12px; }
.error-message { font-size: 1.2rem; color: var(--text-dim); margin-bottom: 24px; }

/* ── Code block ──────────────────────────────────────────────────────────── */
.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--xno);
  white-space: pre;
  overflow-x: auto;
}

/* ── Price preview ───────────────────────────────────────────────────────── */
.price-preview { font-size: 0.9rem; color: var(--text-dim); margin-top: 6px; }
.nano-open-btn-mobile {
  display: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .game-detail-layout { flex-direction: column; }
  .game-buy-panel { width: 100%; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .hero { min-height: 0; background-position: 30% center; }
  .hero::after { background: linear-gradient(to bottom, rgba(16,20,35,0.72) 40%, rgba(16,20,35,0.25) 100%); }
  .hero-inner { justify-content: center; padding: 28px 20px 32px; }
  .hero-text { max-width: 100%; text-align: center; }
  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: 0.95rem; margin-bottom: 20px; white-space: normal; overflow: visible; text-overflow: clip; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .checkout-layout { flex-direction: column; }
  .checkout-side { width: 100%; }
  .nav-inner {
    height: auto;
    padding: 10px 20px;
    flex-wrap: wrap;
    align-items: center;
  }
  .nav-logo { flex: 1 1 auto; min-width: 0; }
  .nav-search {
    order: 3;
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
  }
  .currency-switcher {
    margin-left: auto;
  }
  .nano-open-btn-mobile {
    display: none;
  }
  .nav-links {
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px 14px;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .game-manage-card { flex-wrap: wrap; }
  .review-item { flex-direction: column; }
}

@media (max-width: 640px) {
  .nano-open-btn-mobile {
    display: inline-block;
  }
  #nano-qr-block {
    display: none !important;
  }
}
