/* ============================================================
   INGOTHQ MARKETPLACE — single stylesheet (dark default + light)
   Design tokens per spec. System fonts only (CSP-friendly).
   Logical CSS properties everywhere for full RTL support.
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
svg { width: 20px; height: 20px; flex: none; }

:root {
  --bg: #0c0b09;
  --surface: #14120e;
  --elevated: #1b1813;
  --text: #ece7db;
  --muted: #99917f;
  --border: #2b261c;
  --border-soft: #211d15;

  --primary: #c2a14e;
  --primary-strong: #a9893d;
  --primary-soft: rgba(194, 161, 78, 0.12);
  --accent: #8c6d3f;
  --accent-soft: rgba(140, 109, 63, 0.16);
  --gold: #d9b56a;
  --gold-soft: rgba(217, 181, 106, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --info-soft: rgba(140, 109, 63, 0.12);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.22);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.3);
  --ring: 0 0 0 3px rgba(194, 161, 78, 0.35);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --header-h: 60px;
  --speed: 180ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --elevated: #ffffff;
  --text: #1c1811;
  --muted: #6e6656;
  --border: #e2ddd0;
  --border-soft: #eae6db;

  --primary: #8a6d27;
  --primary-strong: #75591e;
  --accent: #6e5730;
  --gold: #9a7c2f;
  --primary-soft: rgba(138, 109, 39, 0.12);
  --accent-soft: rgba(110, 87, 48, 0.12);
  --gold-soft: rgba(154, 124, 47, 0.14);
  --danger-soft: rgba(239, 68, 68, 0.1);
  --info-soft: rgba(110, 87, 48, 0.1);

  --shadow-1: 0 1px 2px rgba(16, 24, 38, 0.06), 0 6px 20px rgba(16, 24, 38, 0.08);
  --shadow-2: 0 4px 12px rgba(16, 24, 38, 0.1), 0 16px 40px rgba(16, 24, 38, 0.12);
  --ring: 0 0 0 3px rgba(138, 109, 39, 0.25);
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
h1, h2, h3, h4, h5 { margin: 0 0 0.5em; line-height: 1.25; font-weight: 700; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; } h5 { font-size: 0.92rem; }
p { margin: 0 0 0.9em; }
a { color: var(--primary); text-decoration: none; transition: color var(--speed) var(--ease); }
a:hover { color: var(--primary-strong); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
input, select, textarea, button { font-size: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
::placeholder { color: var(--muted); opacity: 0.8; }
code, .mono { font-family: var(--mono); font-size: 0.9em; }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
dl, ul, ol { margin: 0 0 1em; padding: 0; }
li { margin-inline-start: 1.2em; }

#app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
main { flex: 1; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
main.container { padding-block: 24px 48px; }

/* ---------- 3. Utilities ---------- */
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.ltr { direction: ltr; unicode-bidi: isolate; text-align: start; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.page-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; }

/* ---------- 4. Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 14px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand:hover { color: var(--text); }
.brand img { width: 34px; height: 34px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.02rem; letter-spacing: 0.02em; }
.brand-text small { color: var(--gold); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; }

.main-nav { display: none; gap: 4px; }
.main-nav a {
  padding: 7px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500;
}
.main-nav a:hover { color: var(--text); background: var(--elevated); }
.main-nav a.active { color: var(--primary); background: var(--primary-soft); }

.nav-search { display: none; position: relative; flex: 1; max-width: 300px; margin-inline-start: auto; }
.nav-search input { width: 100%; padding-inline: 36px 12px; }
.nav-search .search-ico {
  position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; display: flex;
}

.header-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent; color: var(--muted);
  cursor: pointer; transition: all var(--speed) var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--elevated); }
.icon-btn .badge-dot {
  position: absolute; top: 3px; inset-inline-end: 3px;
  min-width: 16px; height: 16px; padding-inline: 4px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 0.64rem; font-weight: 700; line-height: 16px; text-align: center;
}
.header-auth { display: flex; align-items: center; gap: 8px; }

.user-menu { position: relative; }
.user-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border);
  transition: background var(--speed) var(--ease);
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--elevated); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 700; font-size: 0.8rem;
}
.user-menu .menu-panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
  min-width: 220px; background: var(--elevated); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 6px;
  display: flex; flex-direction: column; z-index: 60; max-height: calc(100vh - 110px); overflow-y: auto; overscroll-behavior: contain;
}
.user-menu .menu-panel a,
.user-menu .menu-panel button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text); background: none; border: none; text-align: start;
  cursor: pointer; font: inherit;
}
.user-menu .menu-panel a:hover,
.user-menu .menu-panel button:hover { background: var(--surface); color: var(--primary); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-label { padding: 6px 10px 2px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.mobile-nav {
  display: none; flex-direction: column; gap: 2px;
  padding: 10px 16px 14px; border-top: 1px solid var(--border);
  background: var(--surface);
}
.mobile-nav a { padding: 10px 8px; border-radius: var(--radius-sm); color: var(--text); font-weight: 500; }
.mobile-nav a.active { color: var(--primary); background: var(--primary-soft); }
.mobile-nav.open { display: flex; }

/* ---------- 5. Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 28px 0 20px; margin-top: auto;
}
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.footer-brand img { width: 30px; height: 30px; }
.footer-tagline { color: var(--gold); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--primary); }
.footer-base {
  margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border-soft);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: 0.82rem;
}

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 0.92rem;
  background: var(--elevated); color: var(--text);
  transition: all var(--speed) var(--ease); white-space: nowrap;
  user-select: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.loading { opacity: 0.6; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--primary); color: #221a06; }
.btn-primary:hover { background: var(--primary-strong); }
.btn-gold { background: var(--gold); color: #2d2205; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--elevated); }
.btn-sm { padding: 5px 10px; font-size: 0.82rem; border-radius: 7px; }
.btn-lg { padding: 12px 22px; font-size: 1rem; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn .spin { width: 14px; height: 14px; }

/* ---------- 7. Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-weight: 600; font-size: 0.88rem; }
.field .hint { color: var(--muted); font-size: 0.8rem; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input:disabled { opacity: 0.55; cursor: not-allowed; }
textarea.input { resize: vertical; min-height: 90px; }
select.input { appearance: none; padding-inline-end: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
[dir="rtl"] select.input {
  background-position: 16px 55%, 11px 55%;
}
.input.invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 0.82rem; }
.check-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; cursor: pointer; }
.check-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.check-row span { user-select: none; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- 8. Cards & grids ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 18px;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.card.elevated { background: var(--elevated); }
.card.hoverable:hover { border-color: var(--border); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); box-shadow: var(--shadow-2); }
.card h3, .card h2 { margin-top: 0; }

.grid-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stat-card { padding: 14px 16px; }
.stat-card .stat-label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-card .stat-value { font-size: 1.35rem; font-weight: 800; margin-top: 4px; }
.stat-card.tone-primary .stat-value { color: var(--primary); }
.stat-card.tone-gold .stat-value { color: var(--gold); }
.stat-card.tone-accent .stat-value { color: var(--accent); }
.stat-card.tone-danger .stat-value { color: var(--danger); }

/* Product card */
.product-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; color: var(--text); box-shadow: var(--shadow-1);
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.product-card:hover { transform: translateY(-3px); border-color: var(--border); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: var(--shadow-2); color: var(--text); }
.pc-cover { aspect-ratio: 16 / 9; background: var(--elevated); position: relative; overflow: hidden; }
.pc-cover img { width: 100%; height: 100%; object-fit: cover; }
.pc-cover-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--elevated), var(--surface));
  color: var(--primary); font-size: 1.8rem; font-weight: 800;
}
.pc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pc-name { font-weight: 700; font-size: 0.98rem; line-height: 1.3; }
.pc-store { color: var(--muted); font-size: 0.8rem; display: flex; align-items: center; gap: 5px; }
.pc-store:hover { color: var(--primary); }
.pc-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.pc-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; }
.price { font-weight: 800; color: var(--gold); font-size: 1.02rem; }
.price .price-old { color: var(--muted); text-decoration: line-through; font-weight: 500; font-size: 0.8rem; margin-inline-start: 6px; }
.price .price-free { color: var(--primary); }
.fav-btn {
  position: absolute; top: 8px; inset-inline-end: 8px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 70%, transparent); color: #fff;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px); transition: all var(--speed) var(--ease);
}
.fav-btn:hover { transform: scale(1.12); color: var(--danger); }
.fav-btn.active { color: var(--danger); }
.fav-btn.active svg { fill: var(--danger); }

/* Store card */
.store-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; color: var(--text); box-shadow: var(--shadow-1);
  transition: border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.store-card:hover { border-color: var(--border); border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); transform: translateY(-2px); color: var(--text); }
.store-logo {
  width: 52px; height: 52px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 1.3rem;
}
.store-logo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 9. Badges / chips / tags ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em;
  background: var(--elevated); color: var(--muted); border: 1px solid var(--border);
}
.badge.tone-success { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge.tone-gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.badge.tone-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.tone-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--elevated); color: var(--muted); font-size: 0.72rem; border: 1px solid var(--border-soft);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; font-size: 0.85rem; font-weight: 500;
  transition: all var(--speed) var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--primary); }
.chip.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.chip.selectable { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 10. Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 560px; }
.table th {
  text-align: start; padding: 10px 14px; color: var(--muted);
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border); background: var(--elevated); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--speed) var(--ease); }
.table tbody tr:hover { background: var(--elevated); }
.table .actions-cell { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.table select.input, .table .input { padding: 5px 8px; width: auto; }

/* ---------- 11. Tabs & pagination ---------- */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border); margin-bottom: 20px; padding-bottom: 0;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  padding: 10px 14px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); font-weight: 600; font-size: 0.9rem; cursor: pointer; white-space: nowrap;
  transition: all var(--speed) var(--ease);
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 22px; }
.pagination .page-info { color: var(--muted); font-size: 0.88rem; }

/* ---------- 12. Toasts / modal / alerts ---------- */
.toast-stack {
  position: fixed; bottom: 16px; inset-inline-end: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--elevated); border: 1px solid var(--border);
  border-inline-start: 3px solid var(--primary);
  border-radius: var(--radius-sm); padding: 11px 14px;
  box-shadow: var(--shadow-2); font-size: 0.9rem;
  animation: toast-in 240ms var(--ease);
}
.toast.error { border-inline-start-color: var(--danger); }
.toast.error .toast-ico { color: var(--danger); }
.toast.gold { border-inline-start-color: var(--gold); }
.toast .toast-ico { color: var(--primary); display: flex; margin-top: 1px; flex-shrink: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(4, 8, 12, 0.6); -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fade-in 180ms var(--ease);
}
.modal {
  width: 100%; max-width: 480px; max-height: 85vh; max-height: 85dvh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: 20px;
  animation: modal-in 200ms var(--ease);
}
.modal h3 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.92rem;
  border: 1px solid var(--border); background: var(--elevated); margin-bottom: 14px;
}
.alert svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; }
.alert.warn { background: var(--gold-soft); border-color: transparent; color: var(--gold); }
.alert.error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.alert.success { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.alert.info { background: var(--info-soft); border-color: transparent; color: var(--accent); }

/* ---------- 13. Skeletons / spinner / empty ---------- */
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--elevated) 25%, var(--surface) 50%, var(--elevated) 75%);
  background: linear-gradient(90deg, var(--elevated) 25%, color-mix(in srgb, var(--elevated) 55%, var(--surface)) 50%, var(--elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-line { height: 12px; margin-bottom: 10px; }
.sk-line.w-60 { width: 60%; } .sk-line.w-40 { width: 40%; }
.sk-card { height: 210px; }
.sk-row { height: 44px; margin-bottom: 8px; }

.spinner, .btn .spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--primary-soft);
  border: 2px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-top-color: var(--primary);
  animation: spin 700ms linear infinite; display: inline-block;
}
.spinner.lg { width: 30px; height: 30px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 0; color: var(--muted); }

.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; padding: 44px 20px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-state .empty-ico { color: var(--muted); opacity: 0.7; }
.empty-state h3 { color: var(--text); margin: 0; }
.empty-state p { margin: 0; max-width: 420px; font-size: 0.92rem; }
.empty-state .btn { margin-top: 8px; }

/* ---------- 14. Home / hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 44px 24px; text-align: center;
  background:
    radial-gradient(600px 280px at 15% 0%, var(--primary-soft), transparent 70%),
    radial-gradient(600px 280px at 85% 100%, var(--accent-soft), transparent 70%),
    var(--surface);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(400px 200px at 50% 120%, var(--gold-soft), transparent 70%);
}
.hero > * { position: relative; z-index: 1; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--gold); font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem); margin-bottom: 12px;
  background: linear-gradient(100deg, var(--primary) 10%, var(--gold) 55%, var(--accent) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); max-width: 560px; margin-inline: auto; font-size: 1.02rem; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

.feature-cards { display: grid; gap: 16px; grid-template-columns: 1fr; }
.feature-card { text-align: center; padding: 22px 18px; }
.feature-card .feature-ico {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.feature-card.tone-primary .feature-ico { background: var(--primary-soft); color: var(--primary); }
.feature-card.tone-gold .feature-ico { background: var(--gold-soft); color: var(--gold); }
.feature-card.tone-accent .feature-ico { background: var(--accent-soft); color: var(--accent); }

/* ---------- 15. Product detail ---------- */
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.85rem; margin-bottom: 16px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--primary); }
.crumbs .sep::before { content: "›"; }
[dir="rtl"] .crumbs .sep::before { content: "‹"; }

.pd-layout { display: grid; gap: 22px; grid-template-columns: 1fr; }
.pd-side { display: flex; flex-direction: column; gap: 16px; }
.pd-cover {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--elevated); aspect-ratio: 16 / 10;
}
.pd-cover img { width: 100%; height: 100%; object-fit: cover; }
.pd-cover-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 800; color: var(--primary);
  background: linear-gradient(135deg, var(--elevated), var(--surface));
}
.buy-box .price-big { font-size: 1.7rem; font-weight: 800; color: var(--gold); }
.buy-box .price-big .price-old { font-size: 1rem; color: var(--muted); font-weight: 500; text-decoration: line-through; margin-inline-start: 8px; }
.pd-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.license-facts { display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }
.license-facts .fact { display: flex; justify-content: space-between; gap: 12px; }
.license-facts .fact .k { color: var(--muted); }

.md-body { line-height: 1.7; font-size: 0.96rem; overflow-wrap: break-word; }
.md-body h3 { margin: 1.1em 0 0.4em; color: var(--primary); }
.md-body h4 { margin: 1em 0 0.4em; color: var(--accent); }
.md-body h5 { margin: 0.9em 0 0.3em; color: var(--gold); }
.md-body strong { color: var(--text); }
.file-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 4px; border-bottom: 1px solid var(--border-soft);
}
.file-row:last-child { border-bottom: none; }
.review-item { border-bottom: 1px solid var(--border-soft); padding: 14px 0; }
.review-item:last-child { border-bottom: none; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rating-input { display: flex; gap: 4px; }
.rating-input button {
  background: none; border: none; cursor: pointer; padding: 2px;
  color: var(--muted); transition: all 120ms var(--ease); display: flex;
}
.rating-input button.on { color: var(--gold); }
.rating-input button.on svg { fill: var(--gold); }
.qa-item { border-bottom: 1px solid var(--border-soft); padding: 14px 0; }
.qa-item:last-child { border-bottom: none; }
.qa-answer {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--primary-soft); border-inline-start: 3px solid var(--primary); font-size: 0.92rem;
}

/* ---------- 16. Cart / checkout / invoice ---------- */
.cart-item { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.cart-item:last-child { border-bottom: none; }
.cart-thumb { width: 64px; height: 44px; border-radius: var(--radius-sm); object-fit: cover; background: var(--elevated); flex-shrink: 0; }
.cart-thumb-fallback {
  width: 64px; height: 44px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; background: var(--elevated); color: var(--primary);
}
.qty-control { display: flex; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: 999px; padding: 2px; }
.qty-control button {
  width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--elevated); color: var(--text); display: flex; align-items: center; justify-content: center;
}
.qty-control button:hover { background: var(--primary-soft); color: var(--primary); }
.qty-control .qty { min-width: 26px; text-align: center; font-weight: 700; font-size: 0.9rem; }

.invoice-box { display: flex; flex-direction: column; gap: 12px; }
.invoice-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.invoice-row .k { color: var(--muted); font-size: 0.85rem; }
.pay-address {
  font-family: var(--mono); font-size: 0.84rem; word-break: break-all;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; line-height: 1.5;
}
.pay-amount { font-family: var(--mono); font-size: 1.25rem; font-weight: 800; color: var(--gold); }
.countdown {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-weight: 700; font-size: 1.05rem; color: var(--gold);
}
.countdown.expired { color: var(--danger); }
.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 0.94rem; }
.summary-line.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; font-weight: 800; font-size: 1.05rem; }

/* ---------- 17. Library / licenses ---------- */
.lib-item { margin-bottom: 16px; }
.license-panel { display: flex; flex-direction: column; gap: 10px; font-size: 0.92rem; }
.license-panel .fact { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.license-panel .fact .k { color: var(--muted); }
.activation-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 0; border-top: 1px dashed var(--border-soft); font-size: 0.85rem;
}
.activation-row .fp { font-family: var(--mono); word-break: break-all; }

/* ---------- 18. Dashboards ---------- */
.dash-tabs { margin-bottom: 24px; }
.kv-list { display: flex; flex-direction: column; gap: 8px; font-size: 0.92rem; }
.kv-list .kv { display: flex; justify-content: space-between; gap: 14px; }
.kv-list .kv .k { color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 14px; }
.ledger-amount.pos { color: var(--primary); font-weight: 700; }
.ledger-amount.neg { color: var(--danger); font-weight: 700; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-bar .input { width: auto; min-width: 150px; }
.filter-bar .search-grow { flex: 1; min-width: 180px; max-width: 340px; }

/* ---------- 19. Progress / uploader ---------- */
.progress-track { height: 8px; border-radius: 999px; background: var(--elevated); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 200ms var(--ease);
}
.uploader { display: flex; flex-direction: column; gap: 10px; }
.upload-progress-row { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--muted); }
.upload-progress-row .progress-track { flex: 1; }

/* ---------- 20. Auth pages ---------- */
.auth-wrap { max-width: 420px; margin-inline: auto; padding-block: 24px; }
.auth-card { padding: 26px; }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head img { width: 46px; height: 46px; margin: 0 auto 12px; }
.auth-providers { display: flex; justify-content: center; gap: 14px; margin: 18px 0 6px; }
.provider-card { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 150px; padding: 18px 12px; background: var(--elevated, #1a212b); border: 1px solid var(--border, #232c38); border-radius: 12px; cursor: pointer; transition: transform .15s, border-color .15s; color: var(--text); font: inherit; }
.provider-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.provider-label { font-size: 0.95rem; font-weight: 600; }
.auth-or-section { text-align: center; margin-top: 20px; }
.auth-or-section h3 { margin: 6px 0 4px; font-size: 1.02rem; }
.auth-trouble { text-align: center; margin-top: 16px; }
.linklike { background: none; border: none; color: var(--primary); cursor: pointer; font: inherit; text-decoration: underline; padding: 4px; }
.auth-fallback-title { margin: 12px 0 8px; font-size: 1rem; }
.auth-switch { text-align: center; margin-top: 16px; color: var(--muted); font-size: 0.9rem; }
.turnstile-slot { margin: 12px 0; min-height: 0; }
.turnstile-slot.active { min-height: 65px; }

/* ---------- 21. Support ---------- */
.support-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }

/* ---------- 22. RTL specifics ---------- */
[dir="rtl"] .icon-flip { transform: scaleX(-1); }

/* ---------- 23. Responsive ---------- */
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .feature-cards { grid-template-columns: repeat(3, 1fr); }
  .support-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 60px 40px; }
}
@media (min-width: 900px) {
  .main-nav { display: flex; }
  .nav-search { display: block; }
  .hamburger-btn { display: none !important; }
  .mobile-nav { display: none !important; }
  .pd-layout { grid-template-columns: 1fr 340px; align-items: start; }
  .pd-layout-rtl-ok { direction: inherit; }
}
@media (max-width: 899px) {
  .header-auth .btn-label { display: none; }
  .header-auth .btn { padding: 8px 10px; }
}

/* ---------- 24. Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}


/* File drag-and-drop upload affordance */
.file-drop { border: 1px dashed var(--border); border-radius: var(--radius); padding: 12px; transition: border-color .15s, background .15s; }
.file-drop.dragover { border-color: var(--primary); background: var(--primary-soft); }
.file-drop-hint { color: var(--muted); font-size: .85rem; margin-top: 8px; }


/* Accessibility preferences */
html.a11y-font-large { font-size: 18px; }
html.a11y-font-xlarge { font-size: 20px; }
html.a11y-high-contrast { --muted: #c4ceda; --border: #718096; --text: #ffffff; }
html.a11y-reduce-motion *, html.a11y-reduce-motion *::before, html.a11y-reduce-motion *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }


/* Support ticket conversations */
.ticket-message { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2, var(--surface)); }
.ticket-message p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; }
.ticket-message + .ticket-message { margin-top: 8px; }


/* Seller analytics chart */
.analytics-bars { display:flex; align-items:flex-end; gap:8px; min-height:190px; overflow-x:auto; padding:12px 2px 4px; }
.analytics-bar-col { flex:1 0 42px; min-width:42px; display:flex; flex-direction:column; align-items:center; gap:6px; }
.analytics-bar-value { font-size:.68rem; color:var(--muted); white-space:nowrap; }
.analytics-bar-track { width:100%; height:110px; display:flex; align-items:flex-end; background:var(--surface-2); border-radius:8px; overflow:hidden; }
.analytics-bar-fill { width:100%; min-height:2px; background:var(--primary); border-radius:8px 8px 0 0; }


/* Print-friendly order receipt — use the browser's Save as PDF option */
@media print { body, #app { background:#fff !important; color:#111 !important; } #site-header, #site-footer, .site-header, .site-footer, .form-actions, .btn, button, .icon-btn, .mobile-nav, .main-nav, .nav-search { display:none !important; } .container { max-width:none !important; width:100% !important; padding:0 !important; } .card, .alert { box-shadow:none !important; break-inside:avoid; border:1px solid #bbb !important; background:#fff !important; color:#111 !important; } a { color:#111 !important; text-decoration:none !important; } .muted, .small, .k { color:#444 !important; } }

/* ============================================================
   INGOTHQ — CLASSIC THEME LAYER (v2 storefront overhaul)
   Light-first classic marketplace. Same variable names, so every
   component above re-skins automatically. Dark mode via [data-theme=dark].
   ============================================================ */

/* ---------- classic tokens ---------- */
:root {
  --bg: #f7f5f0;
  --surface: #fffdf8;
  --surface-2: #faf8f2;
  --elevated: #ffffff;
  --text: #1a1710;
  --muted: #6f6a5c;
  --border: #ddd6c4;
  --border-soft: #e9e4d6;

  --primary: #9a7c2f;
  --primary-strong: #7d6424;
  --primary-soft: rgba(154, 124, 47, 0.10);
  --accent: #7d6424;
  --accent-soft: rgba(125, 100, 36, 0.12);
  --gold: #a9852f;
  --gold-soft: rgba(169, 133, 47, 0.12);
  --danger: #b4322c;
  --danger-soft: rgba(180, 50, 44, 0.10);
  --info-soft: rgba(125, 100, 36, 0.10);

  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 10px;
  --shadow-1: 0 1px 2px rgba(58, 50, 30, 0.08);
  --shadow-2: 0 2px 10px rgba(58, 50, 30, 0.12);
  --ring: 0 0 0 3px rgba(154, 124, 47, 0.28);

  --font: Georgia, "Times New Roman", "Noto Naskh Arabic", "Amiri", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  --header-h: 64px;
}
[data-theme="dark"] {
  --bg: #171410;
  --surface: #1e1a14;
  --surface-2: #241f18;
  --elevated: #241f18;
  --text: #ede7d8;
  --muted: #a39a85;
  --border: #3a3324;
  --border-soft: #2e281c;
  --primary: #d0ab54;
  --primary-strong: #e0bd66;
  --gold: #dfba6d;
  --danger: #ef6a63;
}

body { font-family: var(--font-ui); font-size: 15px; }
h1, h2, .brand-text strong, .hero h1, .stat-value, .price-big, .wallet-amount { font-family: var(--font); letter-spacing: .01em; }
h1 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 700; }
h2 { font-size: 1.18rem; border-bottom: 2px solid var(--border-soft); padding-bottom: 8px; }
h3 { font-size: 1.02rem; }

/* ---------- classic header: topbar + nav strip ---------- */
#site-header { border-bottom: 3px double var(--border); background: var(--surface); }
.header-row { padding-top: 10px; padding-bottom: 10px; gap: 14px; }
.brand { gap: 10px; }
.brand img { height: 34px; }
.brand-text strong { font-size: 1.25rem; letter-spacing: .06em; }
.brand-text small { letter-spacing: .22em; text-transform: uppercase; color: var(--gold); font-size: .62rem; }
.main-nav { gap: 4px; }
.main-nav a { font-family: var(--font-ui); font-size: .86rem; padding: 7px 12px; border-radius: var(--radius-sm); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.main-nav a:hover { background: var(--primary-soft); }
.main-nav a.active { background: var(--primary); color: #fff; }
.nav-search input { border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.icon-btn { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.btn { border-radius: var(--radius-sm); font-family: var(--font-ui); font-weight: 600; letter-spacing: .02em; text-transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary-strong); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-gold { background: linear-gradient(180deg, var(--gold), var(--primary-strong)); }

/* category strip under the header */
.cat-strip { border-bottom: 1px solid var(--border-soft); background: var(--surface-2); }
.cat-strip-inner { display: flex; gap: 4px; overflow-x: auto; padding: 0 16px; scrollbar-width: none; }
.cat-strip-inner::-webkit-scrollbar { display: none; }
.cat-link { font-family: var(--font-ui); font-size: .78rem; color: var(--muted); padding: 8px 12px; white-space: nowrap; border-bottom: 2px solid transparent; letter-spacing: .04em; }
.cat-link:hover { color: var(--primary); }
.cat-link.active { color: var(--primary); border-bottom-color: var(--gold); font-weight: 700; }

/* ---------- classic hero ---------- */
.hero { border: 1px solid var(--border); border-radius: var(--radius-lg); background:
  linear-gradient(180deg, var(--surface-2), var(--surface)); padding: clamp(24px, 5vw, 56px);
  text-align: center; position: relative; overflow: hidden; }
.hero::before, .hero::after { content: ""; position: absolute; top: 12px; bottom: 12px; width: 1px; background: var(--border); }
.hero::before { inset-inline-start: 18px; }
.hero::after { inset-inline-end: 18px; }
.hero-kicker { text-transform: uppercase; letter-spacing: .35em; color: var(--gold); font-size: .72rem; font-family: var(--font-ui); font-weight: 700; }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.8rem); margin: 10px auto; max-width: 22ch; }
.hero p { max-width: 60ch; margin-inline: auto; }
.hero-cta { justify-content: center; gap: 10px; }
.feature-cards { border-top: 2px solid var(--border-soft); }

/* ---------- classic cards & grids ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); background: var(--surface); }
.card.elevated { border-top: 3px solid var(--gold); }
.grid-cards { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.product-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: box-shadow var(--speed), transform var(--speed); }
.product-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--primary); }
.pc-cover { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.pc-name { font-weight: 600; line-height: 1.35; }
.pc-body { border-top: 1px solid var(--border-soft); }
.price { font-family: var(--font); font-weight: 700; color: var(--primary-strong); }
.price-old { color: var(--muted); }
.table th { background: var(--surface-2); border-bottom: 2px solid var(--border); font-family: var(--font-ui); font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.tabs { border-bottom: 2px solid var(--border); gap: 2px; }
.tabs button { border: 1px solid transparent; border-bottom: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-family: var(--font-ui); font-size: .84rem; color: var(--muted); }
.tabs button:hover { color: var(--text); background: var(--surface-2); }
.tabs button.active { background: var(--surface); border-color: var(--border); color: var(--primary-strong); font-weight: 700; box-shadow: 0 2px 0 var(--surface); }
.dash-tabs { border-bottom: 2px solid var(--border); }
.stat-card { border-inline-start: 3px solid var(--gold); }
.stat-value { color: var(--primary-strong); }
.badge { font-family: var(--font-ui); font-size: .7rem; border-radius: 3px; letter-spacing: .04em; }
.tone-gold { background: var(--gold-soft); color: var(--gold); }
.tone-success { background: rgba(48, 104, 62, 0.12); color: #2e6e3e; }
[data-theme="dark"] .tone-success { color: #7fd08d; }
.tone-danger { background: var(--danger-soft); color: var(--danger); }
.tone-accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- classic footer ---------- */
#site-footer { border-top: 3px double var(--border); background: var(--surface-2); margin-top: 48px; }
.footer-grid h4 { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-family: var(--font-ui); color: var(--gold); }
.footer-links a { display: block; padding: 3px 0; color: var(--muted); font-family: var(--font-ui); font-size: .85rem; }
.footer-links a:hover { color: var(--primary); }
.footer-base { border-top: 1px solid var(--border-soft); font-family: var(--font-ui); font-size: .8rem; color: var(--muted); }

/* ---------- empty & notices ---------- */
.empty-state { border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); }
.empty-ico { color: var(--gold); }
.alert { border-radius: var(--radius-sm); border-inline-start-width: 3px; font-family: var(--font-ui); }
.countdown { font-family: var(--mono, monospace); }
.pay-address { word-break: break-all; }

/* ---------- payment method grid (20 crypto wallets) ---------- */
.pm-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pm-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; text-align: start; font-family: var(--font-ui);
  transition: border-color var(--speed), box-shadow var(--speed); width: 100%; }
.pm-card:hover { border-color: var(--primary); box-shadow: var(--shadow-1); }
.pm-card.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); background: var(--gold-soft); }
.pm-logo { width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.pm-logo svg { width: 28px; height: 28px; }
.pm-name { font-size: .78rem; font-weight: 600; line-height: 1.25; }
.pm-cur { font-size: .66rem; color: var(--muted); letter-spacing: .05em; }
.pm-note { font-family: var(--font-ui); font-size: .72rem; color: var(--muted); }

/* ---------- product gallery ---------- */
.gallery { display: grid; gap: 10px; }
.g-main { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.g-main img, .g-main video { width: 100%; height: 100%; object-fit: contain; display: block; background: #0b0a08; }
.g-badge { position: absolute; top: 8px; inset-inline-start: 8px; }
.g-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.g-thumb { flex: 0 0 auto; width: 76px; height: 60px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer; background: var(--surface-2); padding: 0; display: flex; align-items: center; justify-content: center; }
.g-thumb img { width: 100%; height: 100%; object-fit: cover; }
.g-thumb.selected { border-color: var(--gold); }
.g-thumb .g-thumb-video { color: var(--gold); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .6rem; font-family: var(--font-ui); }
.media-count { font-family: var(--font-ui); font-size: .72rem; color: var(--muted); letter-spacing: .04em; }

/* ---------- seller media manager ---------- */
.media-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.m-item { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); position: relative; }
.m-item img { width: 100%; height: 90px; object-fit: cover; display: block; }
.m-item .m-video { height: 90px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--gold); font-size: .68rem; font-family: var(--font-ui); }
.m-item-actions { display: flex; justify-content: space-between; padding: 4px 6px; }
.m-cover-chip { position: absolute; top: 4px; inset-inline-start: 4px; background: var(--gold); color: #fff; font-size: .6rem; padding: 2px 6px; border-radius: 3px; font-family: var(--font-ui); letter-spacing: .05em; }
.m-rule { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); font-family: var(--font-ui); font-size: .8rem; display: flex; align-items: center; gap: 8px; }
.m-rule.ok { border-color: #2e6e3e; color: #2e6e3e; background: rgba(48, 104, 62, 0.07); }
.m-rule.pending { border-color: var(--gold); color: var(--primary-strong); }
.file-drop { border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); }

/* ---------- deposit / tx submit ---------- */
.dep-summary { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 14px; font-family: var(--font-ui); }
.dep-amount { font-family: var(--font); font-size: 1.6rem; color: var(--primary-strong); font-weight: 700; }
.tx-row { display: flex; gap: 8px; align-items: stretch; }
.tx-row .input { flex: 1; }
.step-dot { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong);
  align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; font-family: var(--font-ui); border: 1px solid var(--primary); }
.step-done .step-dot { background: #2e6e3e; border-color: #2e6e3e; color: #fff; }

/* ---------- password code flow ---------- */
.code-hint { border-inline-start: 3px solid var(--gold); background: var(--gold-soft); padding: 10px 12px; border-radius: var(--radius-sm); font-family: var(--font-ui); font-size: .82rem; }

/* ---------- owner-removed notice ---------- */
.notice-card { text-align: center; padding: 48px 20px; }

@media (max-width: 720px) {
  .pm-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .hero { padding: 22px 16px; }
}

/* ================= v3 polish: animations + new auth + wallet QR ================= */
@keyframes ihFadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes ihFloaty { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
@keyframes ihGradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes ihPop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

/* hero — animated gradient orbs + staggered entrance */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -45%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(620px 320px at 18% 28%, rgba(185, 153, 74, .28), transparent 62%),
    radial-gradient(520px 280px at 82% 16%, rgba(185, 153, 74, .20), transparent 60%),
    radial-gradient(720px 420px at 58% 92%, rgba(122, 97, 27, .16), transparent 65%);
  background-size: 200% 200%;
  animation: ihGradient 16s ease-in-out infinite;
}
.hero > * { position: relative; z-index: 1; }
.hero .hero-kicker { animation: ihFadeUp .5s both; }
.hero h1 { animation: ihFadeUp .6s .08s both; }
.hero p { animation: ihFadeUp .6s .18s both; }
.hero .hero-cta { animation: ihFadeUp .6s .28s both; }

/* floating chips in the hero */
.hero-floats { position: absolute; inset: 0; pointer-events: none; z-index: 1; display: none; }
@media (min-width: 980px) { .hero-floats { display: block; } }
.hero-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(255, 253, 246, .92); border: 1px solid #e4dcc8; color: #5d4b17;
  box-shadow: 0 10px 26px rgba(31, 26, 15, .12);
  animation: ihFloaty 7s ease-in-out infinite;
}
.hero-chip svg { width: 15px; height: 15px; }
.fc1 { top: 18%; inset-inline-start: 6%; animation-delay: .2s; }
.fc2 { top: 30%; inset-inline-end: 7%; animation-delay: 1.4s; }
.fc3 { bottom: 22%; inset-inline-start: 10%; animation-delay: 2.6s; }
.fc4 { bottom: 30%; inset-inline-end: 9%; animation-delay: 3.5s; }

/* staggered cards */
.feature-card { transition: transform .3s ease, box-shadow .3s ease; animation: ihFadeUp .6s both; }
.feature-card:nth-child(2) { animation-delay: .12s; }
.feature-card:nth-child(3) { animation-delay: .24s; }
.feature-card:hover { transform: translateY(-6px); box-shadow: 0 16px 34px rgba(31, 26, 15, .12); }
.grid-cards > *, .grid > * { animation: ihFadeUp .5s both; }
.grid-cards > *:nth-child(2), .grid > *:nth-child(2) { animation-delay: .05s; }
.grid-cards > *:nth-child(3), .grid > *:nth-child(3) { animation-delay: .1s; }
.grid-cards > *:nth-child(4), .grid > *:nth-child(4) { animation-delay: .15s; }
.grid-cards > *:nth-child(5), .grid > *:nth-child(5) { animation-delay: .2s; }
.grid-cards > *:nth-child(6), .grid > *:nth-child(6) { animation-delay: .25s; }
.grid-cards > *:nth-child(7), .grid > *:nth-child(7) { animation-delay: .3s; }
.grid-cards > *:nth-child(8), .grid > *:nth-child(8) { animation-delay: .35s; }
.product-card { transition: transform .25s ease, box-shadow .25s ease; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 14px 30px rgba(31, 26, 15, .12); }

/* new auth panel */
.auth2 { min-height: calc(100vh - 150px); display: grid; place-items: center; padding: 28px 0; }
.auth2-card {
  display: grid; grid-template-columns: 1.02fr 1.1fr; max-width: 950px; width: 100%;
  border-radius: 22px; overflow: hidden; border: 1px solid var(--line, #e4dcc8);
  background: var(--card, #fffdf6); box-shadow: 0 24px 60px rgba(31, 26, 15, .10);
  animation: ihPop .45s both;
}
.auth2-brand {
  background: linear-gradient(160deg, #1d1810, #2c2416 55%, #3a2f19);
  color: #f2e9d2; padding: 38px 32px; display: flex; flex-direction: column; gap: 13px;
  position: relative; overflow: hidden;
}
.auth2-brand::after {
  content: ''; position: absolute; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 201, 100, .28), transparent 70%);
  top: -70px; inset-inline-end: -90px; animation: ihFloaty 8s ease-in-out infinite; pointer-events: none;
}
.auth2-brand .b-logo { display: flex; align-items: center; gap: 10px; }
.auth2-brand .b-logo img { width: 40px; height: 40px; }
.auth2-brand h2 { font-family: Georgia, serif; font-size: 25px; margin: 4px 0 0; color: #fff; line-height: 1.3; }
.auth2-brand ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 11px; font-size: 14px; }
.auth2-brand li { display: flex; gap: 9px; align-items: flex-start; color: #d9d0b6; }
.auth2-brand li::before { content: '✓'; color: #e9c964; font-weight: 700; }
.auth2-form { padding: 32px 34px 26px; display: flex; flex-direction: column; gap: 13px; }
.auth2-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #f1ebdb; border-radius: 12px; padding: 4px; gap: 4px; }
.auth2-tab { border: 0; background: transparent; padding: 10px 8px; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 600; color: #6f6a5c; transition: all .2s; }
.auth2-tab.on { background: #fff; color: #211d15; box-shadow: 0 2px 8px rgba(31, 26, 15, .10); }
.auth2-divider { display: flex; align-items: center; gap: 10px; color: #8a8577; font-size: 12px; }
.auth2-divider::before, .auth2-divider::after { content: ''; height: 1px; background: #e4dcc8; flex: 1; }
#gbtn-slot { display: flex; justify-content: center; min-height: 44px; }
#gbtn-slot .alert { width: 100%; }
.auth2-alt { text-align: center; }
.auth2-foot { font-size: 12px; color: #8a8577; text-align: center; margin-top: 4px; }
.auth2 .stack > .stack { gap: 4px; }
@media (max-width: 860px) { .auth2-card { grid-template-columns: 1fr; } .auth2-brand { display: none; } .auth2-form { padding: 26px 22px 22px; } }

/* wallet / checkout QR + auto note */
.dep-flex { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.dep-qr {
  width: 148px; height: 148px; background: #fff; border: 1px solid #e4dcc8;
  border-radius: 12px; display: none; place-items: center; padding: 9px; flex: 0 0 auto;
}
.dep-qr.ready { display: grid; }
.dep-qr svg { width: 100%; height: 100%; }
.dep-auto { border-color: #cfe4d2 !important; background: #eef6ef !important; color: #2f7d46 !important; }

/* account switcher rows */
.acct-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid #e4dcc8; border-radius: 12px; background: #fffdf6;
}
.acct-row .spacer { flex: 1; }
.acct-row .btn-ghost { min-width: 30px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ---- license tier picker ---- */
.tier-picker{margin:12px 0;display:flex;flex-direction:column;gap:8px}
.tier-title{font-weight:700;font-size:14px;color:#5d4b17}
.tier-card{display:flex;align-items:center;gap:10px;width:100%;text-align:start;
  padding:10px 14px;border:1.5px solid #e4dcc8;border-radius:10px;background:#fffdf6;
  font:inherit;cursor:pointer;transition:border-color .15s, box-shadow .15s}
.tier-card:hover{border-color:#c9b98a}
.tier-card.sel{border-color:#a3873a;box-shadow:0 0 0 2px #f3ecd9;background:#fdf9ee}
.tier-name{font-weight:700;color:#211d15;flex:1}
.tier-meta{font-size:12.5px;color:#6f6a5c}
.tier-price{font-weight:700;color:#8a6d1f;white-space:nowrap}


/* ================= support pack v2 ================= */
.chat-fab { position:fixed; bottom:18px; inset-inline-end:18px; width:52px; height:52px; border-radius:50%; background:var(--primary); color:#fff; border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 8px 24px rgba(0,0,0,.25); z-index:1200; }
.chat-fab:hover { transform:translateY(-2px); }
.chat-fab-dot { position:absolute; top:4px; inset-inline-end:4px; width:12px; height:12px; border-radius:50%; background:#e5484d; border:2px solid #fff; }
.chat-panel { position:fixed; bottom:82px; inset-inline-end:18px; width:min(360px, calc(100vw - 24px)); height:min(480px, 70vh); background:var(--card, #fff); border:1px solid var(--border); border-radius:14px; box-shadow:0 12px 40px rgba(0,0,0,.25); z-index:1201; padding:12px; overflow:hidden; display:flex; flex-direction:column; }
.chat-panel-head { display:flex; align-items:center; gap:8px; padding-bottom:8px; border-bottom:1px solid var(--border); }
.chat-box { display:flex; flex-direction:column; gap:8px; flex:1; min-height:0; }
.chat-list-wrap { flex:1; min-height:0; overflow-y:auto; display:flex; flex-direction:column; gap:8px; padding:4px; }
.chat-messages { display:flex; flex-direction:column; gap:8px; }
.chat-msg { max-width:85%; display:flex; }
.chat-msg.mine { align-self:flex-end; }
.chat-msg.staff { align-self:flex-start; }
.chat-bubble { background:var(--bg, #f6f4ee); border:1px solid var(--border); border-radius:12px; padding:8px 12px; }
.chat-msg.mine .chat-bubble { background:var(--primary); color:#fff; border-color:var(--primary); }
.chat-meta { font-size:.72rem; opacity:.75; margin-bottom:2px; }
.chat-body { white-space:pre-wrap; word-break:break-word; font-size:.92rem; }
.chat-compose { display:flex; gap:8px; align-items:flex-end; }
.chat-compose .chat-input { flex:1; resize:none; }
.chat-layout { display:grid; grid-template-columns:280px 1fr; gap:16px; align-items:start; }
.chat-threads { display:flex; flex-direction:column; gap:6px; max-height:60vh; overflow:auto; }
.chat-thread { display:flex; align-items:center; gap:8px; text-align:start; width:100%; padding:10px; border:1px solid var(--border); border-radius:10px; background:transparent; cursor:pointer; font:inherit; color:inherit; }
.chat-thread.sel, .chat-thread:hover { background:rgba(0,0,0,.05); }
.chat-unread { background:#e5484d; color:#fff; min-width:20px; text-align:center; }
@media (max-width:640px) { .chat-layout { grid-template-columns:1fr; } }
.wallet-chip { display:inline-flex; align-items:center; padding:2px 8px; border-radius:999px; background:rgba(212,175,55,.16); color:var(--gold, #a8894f); font-weight:700; font-size:.78rem; }
.pm-card.wallet-pay { width:100%; text-align:start; cursor:pointer; border:1.5px solid var(--border); border-radius:12px; background:transparent; padding:12px; font:inherit; color:inherit; }
.pm-card.wallet-pay.sel { border-color:var(--primary); outline:2px solid var(--primary); }
.wallet-choice-title { font-weight:700; margin-top:6px; }
.payout-qr svg { width:180px; height:180px; background:#fff; border-radius:8px; padding:6px; }
.oc-code { font-weight:800; letter-spacing:.06em; }

/* ---- mobile header fix: header must never exceed the viewport (390px test) ---- */
@media (max-width: 720px) {
  .header-row { gap: 8px; padding: 10px 12px; }
  .brand { min-width: 0; flex: 0 1 auto; }
  .brand img, .brand svg { max-width: 26px; height: auto; }
  .header-actions { gap: 3px; flex: none; }
  .header-actions .icon-btn { width: 32px; height: 32px; padding: 0; }
  .header-actions .icon-btn img { width: 18px !important; height: 13px !important; }
  .header-auth { gap: 4px; }
  .header-auth .btn { padding: 6px 9px; font-size: .78rem; white-space: nowrap; }
  .cat-strip-inner { padding: 0 10px; }
}

/* ============ v29: featured carousel + servers + live chat + money + owner restyle ============ */
.feat-section .section-head { display: flex; align-items: center; gap: 10px; }
.feat-nav { display: flex; gap: 6px; }
.feat-track { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; scrollbar-width: thin; }
.feat-card { flex: 0 0 clamp(220px, 60vw, 300px); scroll-snap-align: start; border-radius: 16px; overflow: hidden; border: 1px solid var(--line, #e8e0cc); background: var(--card, #fff); text-decoration: none; color: inherit; display: block; }
.feat-img { height: 130px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--gold-soft, #f7edd2), var(--card, #fff)); }
.feat-img img { width: 100%; height: 100%; object-fit: cover; }
.feat-letter { font-size: 2.6rem; font-weight: 800; color: var(--gold, #a8894f); }
.feat-info { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 3px; }
.feat-dots { display: flex; gap: 6px; padding: 4px 2px 0; }
.feat-dot { width: 8px; height: 8px; border-radius: 50%; border: 0; background: var(--line, #d9d0b8); cursor: pointer; padding: 0; }
.feat-dot.on { background: var(--gold, #a8894f); transform: scale(1.25); }

.servers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.srv-card { display: flex; flex-direction: column; gap: 8px; }
.srv-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.srv-badges { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.srv-ip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.srv-ip { background: rgba(0,0,0,.06); padding: 2px 8px; border-radius: 6px; font-size: .85rem; }
.srv-live { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted, #8b8270); margin-top: 4px; }
.srv-dot { width: 9px; height: 9px; border-radius: 50%; background: #c0392b; display: inline-block; }
.srv-live.on { color: #1e7d32; }
.srv-live.on .srv-dot { background: #27ae60; box-shadow: 0 0 0 3px rgba(39,174,96,.18); }
.srv-desc { margin: 0; }
.srv-players { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #1e7d32; margin: 6px 0; }
.video-embed { position: relative; padding-top: 56.25%; border-radius: 14px; overflow: hidden; border: 1px solid var(--line, #e8e0cc); margin: 10px 0; }
.video-embed iframe, .video-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.srv-about p { white-space: pre-wrap; }
.srv-mine-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.srv-add { margin-top: 4px; }

.support-thread { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.support-thread.with-ctx { grid-template-columns: minmax(0, 1fr) clamp(240px, 30vw, 320px); }
@media (max-width: 900px) { .support-thread.with-ctx { grid-template-columns: 1fr; } }
.chat-card { display: flex; flex-direction: column; gap: 10px; }
.chat-head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line, #eee5cf); padding-bottom: 10px; }
.chat-feed { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding: 6px 2px; }
.chat-row { display: flex; }
.chat-row.mine { justify-content: flex-end; }
.chat-bubble { max-width: min(78%, 560px); background: var(--soft, #f6f1e3); border: 1px solid var(--line, #e8e0cc); border-radius: 14px; padding: 8px 12px; }
.chat-bubble.mine { background: var(--primary-soft, #e7f0e7); border-color: var(--primary, #2e6b34); }
.chat-bubble.staff { background: var(--gold-soft, #f7edd2); border-color: var(--gold, #a8894f); }
.chat-meta { font-size: .72rem; color: var(--muted, #8b8270); margin-bottom: 3px; }
.chat-body { white-space: pre-wrap; word-break: break-word; }
.chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-input-row textarea { flex: 1; }
.ctx-panel { position: sticky; top: 90px; align-self: start; }
.ctx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.ctx-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ctx-mail-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ctx-order { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: .85rem; flex-wrap: wrap; }
.ctx-actions { flex-wrap: wrap; gap: 6px; }
.ticket-row { margin-bottom: 10px; }
.support-list-page { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .support-list-page { grid-template-columns: 1fr; } }
.section-title { margin: 4px 0 10px; }

.money-page .stat-grid, .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card { border: 1px solid var(--line, #e8e0cc); border-radius: 14px; padding: 14px; background: var(--card, #fff); }
.stat-card.big { background: linear-gradient(135deg, var(--primary-soft, #e7f0e7), var(--card, #fff)); }
.stat-card .k { font-size: .8rem; color: var(--muted, #8b8270); }
.stat-card .v { font-size: 1.45rem; font-weight: 800; margin-top: 4px; }
.stat-card .small { margin-top: 2px; }

/* owner console — modern refresh */
.oc-root { --oc-side: #101613; }
.oc-side { background: var(--oc-side); color: #e9e4d5; border-radius: 0 18px 18px 0; }
.oc-side a { color: #d6d0be; border-radius: 10px; transition: background .15s ease, color .15s ease; }
.oc-side a:hover { background: rgba(233, 201, 100, .12); color: #fff; }
.oc-side a.oc-on { background: var(--gold, #a8894f); color: #141414; font-weight: 700; }
.oc-brand { letter-spacing: .14em; }
.oc-card { border-radius: 14px; }
.oc-grp { color: #8f9a8f; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.oc-feat-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line, #e8e0cc); border-radius: 10px; margin-bottom: 7px; cursor: pointer; background: var(--card, #fff); }
.oc-feat-list { max-height: 260px; overflow-y: auto; padding-right: 4px; }
.oc-net-row { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: center; padding: 7px 10px; border: 1px solid var(--line, #e8e0cc); border-radius: 10px; margin-bottom: 7px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .feat-card { flex-basis: 78vw; }
  .chat-input-row { flex-direction: column; align-items: stretch; }
  .ctx-grid { grid-template-columns: 1fr; }
}

/* ============ v31: top marquee + plugin card + withdrawals + settings + oc polish ============ */
.marquee-section { margin-bottom: 6px; }
.marquee-head { display: flex; align-items: baseline; gap: 12px; padding: 0 4px 8px; }
.marquee-head h2 { margin: 0; font-size: clamp(1.05rem, 2.6vw, 1.3rem); }
.marquee-frame { overflow: hidden; border: 1px solid var(--line, #e8e0cc); border-radius: 16px; background: var(--card, #fff); padding: 10px 0; }
.marquee-strip { display: flex; gap: 14px; width: max-content; animation: marquee-scroll 30s linear infinite; }
.marquee-frame:hover .marquee-strip { animation-play-state: paused; }
@keyframes marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
[dir="rtl"] .marquee-strip { animation-direction: reverse; }
@media (prefers-reduced-motion: reduce) { .marquee-strip { animation: none; } .marquee-frame { overflow-x: auto; } }
.feat-card { flex: 0 0 clamp(200px, 46vw, 260px); }
.feat-card .feat-img { height: 110px; }

.plugin-card { border: 1px solid var(--gold, #a8894f); box-shadow: 0 6px 24px rgba(184, 134, 11, .10); }
.plugin-card h3 { margin: 0 0 4px; }
.plugin-card .row { align-items: center; gap: 12px; flex-wrap: wrap; }
.plugin-steps { margin: 10px 0 0; padding-inline-start: 20px; color: var(--muted, #8b8270); font-size: .9rem; }

.withdraw-card h2 { margin-top: 0; }
.wd-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line, #e8e0cc); flex-wrap: wrap; }
.wd-row:last-child { border-bottom: 0; }

.settings-page .lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.lang-tile { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line, #e8e0cc); border-radius: 10px; background: var(--card, #fff); cursor: pointer; font: inherit; color: inherit; }
.lang-tile img { width: 24px; height: 17px; object-fit: cover; border-radius: 3px; }
.lang-tile.on { border-color: var(--gold, #a8894f); background: var(--gold-soft, #f7edd2); font-weight: 700; }
.settings-toggle { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line, #e8e0cc); border-radius: 10px; cursor: pointer; }

/* owner console v2 — softer, rounder, clearer */
.oc-root { background: linear-gradient(180deg, #f7f4ec, #f2ede0); }
.oc-side { background: linear-gradient(180deg, #131b16, #0d120f); }
.oc-side a { padding: 9px 12px; }
.oc-side a.oc-on { box-shadow: 0 4px 14px rgba(233, 201, 100, .35); }
.oc-card { box-shadow: 0 3px 18px rgba(20, 20, 10, .06); border: 1px solid var(--line, #e8e0cc); }
.oc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
table.oc-table tbody tr:hover { background: rgba(233, 201, 100, .06); }
.oc-btn.sm { padding: 2px 8px; font-size: .75rem; }

/* ---------------------- light ads ---------------------- */
.ad-banner { display: flex; align-items: center; gap: .55rem; max-width: 1080px; margin: .6rem auto 0; padding: .5rem .9rem; background: var(--surface); border: 1px solid var(--border, rgba(128,128,128,.22)); border-radius: 10px; font-size: .85rem; width: calc(100% - 1.5rem); box-sizing: border-box; }
.ad-banner .ad-body { flex: 1; min-width: 0; overflow: hidden; }
.ad-tag { flex-shrink: 0; font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: rgba(128,128,128,.16); border-radius: 6px; padding: .18rem .5rem; opacity: .8; }
.ad-close { flex-shrink: 0; background: none; border: none; color: inherit; opacity: .5; cursor: pointer; font-size: .95rem; padding: .15rem .35rem; }
.ad-close:hover { opacity: 1; }
.ad-grid-slot { position: relative; display: block; padding: 1.2rem; border: 1px dashed var(--border, rgba(128,128,128,.3)); border-radius: 12px; background: var(--surface); }
.ad-grid-slot .ad-close { position: absolute; top: .4rem; inset-inline-end: .4rem; }

/* push enable banner */
.push-ask { position: fixed; inset-inline: 16px; bottom: 16px; z-index: 120; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: var(--bg-card, #fff); color: inherit; border: 1px solid var(--line, #e8e0cc); border-radius: 14px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.18); max-width: 720px; margin-inline: auto; font-size: 14px; }
.push-ask .row { display: flex; gap: 8px; }
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
  .push-ask { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
}

/* ASHAL v2: games grid + ad cta + chat + ad pill + game chips */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.games-grid.picker { max-height: 46vh; overflow-y: auto; padding: 4px; }
.game-card { position: relative; display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line, #e8e0cc); background: #fff; text-align: center; transition: transform .15s ease; }
.game-card:hover { transform: translateY(-2px); }
.game-card-img { aspect-ratio: 16/10; background: #f4efe3; }
.game-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-card-name { padding: 9px 6px; font-weight: 700; font-size: 14px; }
.game-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line, #e8e0cc); background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.chip-on { background: var(--gold, #a8894f); border-color: var(--gold, #a8894f); color: #fff; }
.ad-cta { display: flex; gap: 16px; align-items: center; padding: 18px 20px; }
.ad-cta .row { font-size: 34px; }
.ad-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.ad-thumb img, .ad-thumb span { display: block; }
.chat-widget { position: fixed; bottom: 18px; inset-inline-end: 18px; z-index: 130; }
.chat-fab { width: 52px; height: 52px; border-radius: 50%; border: none; background: var(--gold, #a8894f); color: #fff; font-size: 22px; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.chat-panel { position: absolute; bottom: 62px; inset-inline-end: 0; width: min(340px, calc(100vw - 36px)); height: 420px; background: var(--bg-card, #fff); border: 1px solid var(--line, #e8e0cc); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.22); display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line, #e8e0cc); }
.chat-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 85%; border-radius: 10px; padding: 6px 10px; background: #f1ecdf; font-size: 13.5px; }
.chat-msg.mine { align-self: flex-end; background: var(--gold, #a8894f); color: #fff; }
.chat-msg.staff .chat-meta { color: var(--gold, #a8894f); font-weight: 700; }
.chat-meta { font-size: 11px; opacity: .75; margin-bottom: 2px; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line, #e8e0cc); }
.ad-pill { position: fixed; bottom: 18px; inset-inline-start: 18px; z-index: 125; display: flex; align-items: center; gap: 10px; background: var(--bg-card, #fff); border: 1px solid var(--line, #e8e0cc); border-radius: 12px; padding: 8px 12px; box-shadow: 0 8px 26px rgba(0,0,0,.18); max-width: min(360px, calc(100vw - 36px)); text-decoration: none; color: inherit; }
.ad-pill img { width: 64px; height: 36px; object-fit: cover; border-radius: 8px; }
.ad-pill-txt { display: flex; flex-direction: column; line-height: 1.2; }
.ad-pill-txt small { color: var(--muted, #8b8570); font-size: 10.5px; }
.ad-pill-txt strong { font-size: 13.5px; }
.ad-pill-x { position: absolute; top: -9px; inset-inline-end: -9px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line, #e8e0cc); background: #fff; cursor: pointer; font-size: 11px; }
.chat-panel[hidden] { display: none !important; }
@media (max-width: 640px) { .games-grid { grid-template-columns: repeat(2, 1fr); } .ad-cta { flex-direction: column; align-items: flex-start; } .chat-panel { width: calc(100vw - 36px); } }

.srv-card-rich { overflow: hidden; }
.srv-logo-wrap { aspect-ratio: 16/7; background: #f4efe3; }
.srv-logo-wrap .srv-logo { width: 100%; height: 100%; object-fit: cover; display: block; }
.srv-card-rich .srv-head { padding-top: 14px; }



/* ============ UX batch: cat-strip scroll, presence chip, promo bar, chat note, google btn ============ */
.cat-strip-inner { scrollbar-width: thin; scrollbar-color: rgba(140,120,80,.4) transparent; }
.cat-strip-inner::-webkit-scrollbar { display: block; height: 5px; }
.cat-strip-inner::-webkit-scrollbar-thumb { background: rgba(140,120,80,.4); border-radius: 999px; }
.presence-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(46,160,67,.12); color: #1f7a35; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid rgba(46,160,67,.25); }
.chat-note { padding: 2px 12px 8px; font-size: 11px; color: var(--muted, #8a7f66); text-align: center; }
.promo-bar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: linear-gradient(90deg, rgba(233,201,100,.18), rgba(233,201,100,.05)); border-bottom: 1px solid var(--border-soft, #e8e0cc); }
.promo-bar .promo-badge { font-size: 11px; font-weight: 700; color: #8a6d1f; background: rgba(233,201,100,.4); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.promo-bar img { width: 26px; height: 26px; object-fit: cover; border-radius: 6px; flex: none; }
.promo-bar .promo-name { font-weight: 700; font-size: 13.5px; color: var(--ink, #2b2416); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 26ch; text-decoration: none; }
.promo-bar .promo-msg { font-size: 12.5px; color: var(--muted, #8a7f66); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.promo-bar .promo-price { font-weight: 700; font-size: 13px; color: #1f7a35; white-space: nowrap; }
.promo-bar .promo-cta { font-size: 12.5px; font-weight: 700; color: var(--primary, #a8894f); white-space: nowrap; text-decoration: none; }
.promo-bar .promo-x { margin-inline-start: 4px; border: none; background: transparent; cursor: pointer; font-size: 14px; color: var(--muted, #8a7f66); padding: 2px 6px; }
@media (max-width: 640px) { .promo-bar .promo-msg, .promo-bar .promo-price { display: none; } }
.google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px 14px; background: #fff; border: 1px solid #dadce0; border-radius: 8px; font: 600 14.5px var(--font-ui, inherit); color: #3c4043; cursor: pointer; }
.google-btn:hover { box-shadow: 0 1px 3px rgba(60,64,67,.3); }
.google-btn svg { width: 20px; height: 20px; flex: none; }


/* ============ offers + maintenance ============ */
.product-card { position: relative; }
.pc-offer-badge { position: absolute; top: 8px; inset-inline-start: 8px; background: linear-gradient(135deg, #e9c964, #b8860b); color: #fff; font: 700 10.5px var(--font-ui, inherit); padding: 4px 9px; border-radius: 999px; letter-spacing: .04em; box-shadow: 0 2px 6px rgba(0,0,0,.25); z-index: 2; }


/* ============ AI assistant widget (light, readable) ============ */
.ai-fab { position:fixed; bottom:18px; inset-inline-start:18px; width:52px; height:52px; border-radius:50%; background:linear-gradient(135deg,#7c3aed,#4f46e5); border:none; cursor:pointer; font-size:24px; display:flex; align-items:center; justify-content:center; box-shadow:0 8px 24px rgba(79,70,229,.4); z-index:1200; transition:transform .15s; }
.ai-fab:hover { transform:translateY(-2px) scale(1.05); }
.ai-panel { position:fixed; bottom:82px; inset-inline-start:18px; width:min(360px, calc(100vw - 28px)); height:min(500px, 70vh); background:#ffffff; border:1px solid #e5e7eb; border-radius:16px; box-shadow:0 16px 48px rgba(17,24,39,.22); color:#111827; display:flex; flex-direction:column; overflow:hidden; z-index:1201; }
.ai-head { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; background:linear-gradient(135deg,#7c3aed,#4f46e5); color:#fff; font-weight:700; font-size:14px; flex:none; }
.ai-x { background:none; border:none; color:#fff; cursor:pointer; font-size:15px; opacity:.85; }
.ai-x:hover { opacity:1; }
.ai-msgs { flex:1; overflow-y:auto; padding:12px; display:flex; flex-direction:column; gap:8px; background:#f9fafb; }
.ai-msg { max-width:85%; padding:8px 12px; border-radius:14px; font-size:13.5px; line-height:1.55; white-space:pre-wrap; word-break:break-word; }
.ai-bot { align-self:flex-start; background:#ffffff; border:1px solid #e0e0ea; color:#1f2430; box-shadow:0 1px 2px rgba(17,24,39,.06); }
.ai-user { align-self:flex-end; background:linear-gradient(135deg,#7c3aed,#4f46e5); color:#fff; border:none; }
.ai-warn { background:#fef3f2 !important; border:1px solid #fecaca !important; color:#991b1b !important; font-weight:500; }
.ai-thinking { opacity:.65; font-style:italic; background:transparent !important; border:none !important; box-shadow:none; }
.ai-note { flex:none; background:#eef7ff; border-top:1px solid #dbeafe; color:#1e4e79; font-size:11px; line-height:1.4; padding:6px 12px; }
.ai-sugg { display:flex; flex-wrap:wrap; gap:6px; }
.ai-chip { background:#f5f3ff; border:1px solid #ddd6fe; color:#4c1d95; border-radius:999px; padding:5px 11px; font-size:12px; cursor:pointer; }
.ai-chip:hover { background:#ede9fe; }
.ai-compose { display:flex; gap:8px; padding:10px; border-top:1px solid #e5e7eb; background:#fff; }
.ai-input { flex:1; border:1px solid #d1d5db; background:#fff; color:#111827; border-radius:10px; padding:9px 12px; font-size:13.5px; outline:none; }
.ai-input::placeholder { color:#9ca3af; }
.ai-input:focus { border-color:#7c3aed; box-shadow:0 0 0 2px rgba(124,58,237,.15); }
.ai-input:disabled { background:#f3f4f6; color:#9ca3af; }
.ai-send { background:linear-gradient(135deg,#7c3aed,#4f46e5); color:#fff; border:none; border-radius:10px; width:40px; cursor:pointer; font-size:15px; }
.ai-send:disabled { opacity:.5; cursor:default; }
@media (max-width: 480px) { .ai-panel { width:calc(100vw - 24px); inset-inline-start:12px; } .ai-fab { inset-inline-start:12px; } }


/* ============ v39 mobile + cross-browser hardening ============ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: rgba(0,0,0,0); }
img, video, canvas, iframe, svg { max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
/* iOS Safari: prevent focus zoom */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
  button:not(.icon-btn):not(.ai-fab):not(.ai-x):not(.ai-send):not(.hamburger-btn):not(.ai-chip), .btn:not(.icon-btn) { min-height: 44px; }
}
/* header must fit 320-480px phones — the #1 mobile overflow (buttons cut off) */
@media (max-width: 480px) {
  .header-row { gap: 6px; padding-inline: 10px; }
  .brand-text { display: none; }
  .brand img, .brand svg { width: 26px !important; height: 26px !important; }
  .header-actions { gap: 2px; min-width: 0; flex-shrink: 1; }
  .header-actions .icon-btn { width: 30px; height: 30px; }
  .header-auth { gap: 3px; min-width: 0; flex-shrink: 1; }
  .header-auth .btn { padding: 6px 7px; font-size: .72rem; min-width: 0; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .header-actions .badge-dot { width: 8px; height: 8px; }
  .cat-strip-inner { padding: 0 8px; }
}
/* safety nets: fixed bars respect the iPhone home bar */
.ai-fab { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
.ai-panel { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
.mobile-nav { padding-bottom: env(safe-area-inset-bottom, 0px); }
/* dropdowns & panels never exceed the screen */
.user-menu .menu-panel { max-width: calc(100vw - 16px); }
@media (max-width: 380px) { .ai-panel { height: 72vh; } }
/* owner console on small screens */
@media (max-width: 560px) {
  .oc-fgrid { grid-template-columns: 1fr; }
  .oc-chart { height: 110px; }
}
/* generic action rows wrap instead of overflowing */
.form-actions, .oc-actions, .feat-nav { flex-wrap: wrap; }

/* ---------- ONYX purple re-skin (v11): token overrides, wins by cascade ---------- */
:root {
  --bg: #f6f3fc; --surface: #ffffff; --surface-2: #faf8fe; --elevated: #ffffff;
  --text: #211a33; --muted: #6c648a;
  --border: #e2dcef; --border-soft: #ece8f7;
  --primary: #6d4fd0; --primary-strong: #5a3ec0;
  --primary-soft: rgba(109, 79, 208, 0.10);
  --accent: #5f46b8; --accent-soft: rgba(95, 70, 184, 0.12);
  --gold: #7a58d9; --gold-soft: rgba(122, 88, 217, 0.12);
  --danger: #b4322c; --danger-soft: rgba(180, 50, 44, 0.10);
  --info-soft: rgba(95, 70, 184, 0.10);
  --shadow-1: 0 1px 2px rgba(50, 40, 90, 0.08);
  --shadow-2: 0 2px 10px rgba(50, 40, 90, 0.14);
  --ring: 0 0 0 3px rgba(109, 79, 208, 0.28);
}
[data-theme="light"] {
  --bg: #f6f3fc; --surface: #ffffff; --surface-2: #faf8fe; --elevated: #ffffff;
  --text: #211a33; --muted: #6c648a;
  --border: #e2dcef; --border-soft: #ece8f7;
  --primary: #6d4fd0; --primary-strong: #5a3ec0;
  --primary-soft: rgba(109, 79, 208, 0.10);
  --accent: #5f46b8; --accent-soft: rgba(95, 70, 184, 0.12);
  --gold: #7a58d9; --gold-soft: rgba(122, 88, 217, 0.12);
  --danger-soft: rgba(239, 68, 68, 0.1);
  --info-soft: rgba(95, 70, 184, 0.1);
}
[data-theme="dark"] {
  --bg: #13101e; --surface: #1a1530; --surface-2: #201a3c; --elevated: #201a3c;
  --text: #ebe7f7; --muted: #9e96bf;
  --border: #3a3159; --border-soft: #2c2547;
  --primary: #a78bfa; --primary-strong: #c2adfd;
  --primary-soft: rgba(167, 139, 250, 0.14);
  --accent: #9d85f2; --accent-soft: rgba(167, 139, 250, 0.12);
  --gold: #b49bf5; --gold-soft: rgba(180, 155, 245, 0.14);
  --danger: #ef6a63; --danger-soft: rgba(239, 106, 99, 0.10);
  --info-soft: rgba(167, 139, 250, 0.10);
  --shadow-1: 0 1px 2px rgba(15, 10, 35, 0.5);
  --shadow-2: 0 2px 10px rgba(15, 10, 35, 0.6);
  --ring: 0 0 0 3px rgba(167, 139, 250, 0.30);
}

/* ---------- v40: mobile header & google button fixes ---------- */
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 100%; box-sizing: border-box; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: #ffffff; color: var(--text); font-weight: 700; font-size: .95rem; cursor: pointer; font-family: inherit; }
.google-btn svg, .google-btn img { width: 20px; height: 20px; flex: 0 0 auto; }
.google-btn:hover { background: var(--surface-2); }
@media (max-width: 700px) {
  .header-row .presence-chip { display: none; } /* the 🟢 live chip stays in the catalog toolbar, not the phone header */
  .user-menu .uname, .user-menu summary .wallet-chip { display: none; } /* avatar-only account menu on phones */
  .user-menu summary { padding: 4px 6px; }
}
@media (max-width: 480px) {
  .header-auth { flex-shrink: 0; }
  .header-auth .btn { padding: 7px 10px; font-size: .78rem; max-width: none; overflow: visible; text-overflow: clip; }
}

/* ---------- v40b: restore auth button labels on phones, drop secondary icons ---------- */
@media (max-width: 480px) {
  .header-auth .btn-label { display: inline; }
  .header-auth { flex-shrink: 0; }
  .header-auth .btn { padding: 7px 10px; font-size: .78rem; max-width: none; overflow: visible; text-overflow: clip; }
  .header-actions a.icon-btn[href="/account"],
  .header-actions a.icon-btn[href="/compare"],
  .header-actions a.icon-btn[href="/favorites"],
  .header-actions a.icon-btn[href="/notifications"],
  .header-actions button.icon-btn[title="Dark"],
  .header-actions button.icon-btn[title="Light"] { display: none; }
}
