/* ============================================================
   Skin.TF — dark TF2 trading theme
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #111009;
  --bg-2: #16140d;
  --panel: #1b1811;
  --panel-2: #211d14;
  --panel-end: #181510;   /* gradient end used on cards/tiles */
  --line: #2e2819;
  --line-2: #3b3220;
  --text: #c8b8a0;
  --text-dim: #8d806c;
  --text-bright: #ece3d2;
  --accent: #c8a96e;
  --accent-2: #e0c389;
  --accent-ink: #1a160d;
  --good: #7bb45f;
  --bad: #d2603a;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --maxw: 2000px;

  /* Theme-sensitive surfaces (overridden in light mode) */
  --scrim: rgba(0, 0, 0, 0.72);        /* label/badge backdrops over icons */
  --scrim-strong: rgba(0, 0, 0, 0.85);
  --body-glow-1: rgba(200, 169, 110, 0.08);
  --body-glow-2: rgba(70, 98, 145, 0.06);
  --texture: #ffffff;                  /* diagonal background texture */
  --nav-bg: rgba(17, 16, 9, 0.85);     /* sticky navbar (blurred) */
  --pending: #b08adb;                  /* "custom price" label */

  /* Steam quality colours */
  --q-normal: #b2b2b2;
  --q-genuine: #4d7455;
  --q-vintage: #476291;
  --q-unusual: #8650ac;
  --q-unique: #ffd700;
  --q-community: #70b04a;
  --q-selfmade: #70b04a;
  --q-valve: #a50f79;
  --q-strange: #cf6a32;
  --q-haunted: #38f3ab;
  --q-collectors: #aa0000;
  --q-decorated: #fafafa;
}

/* ── Light theme ───────────────────────────────────────────────
   Same variables, warm-paper palette. Everything that references the
   vars above re-themes automatically. */
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f4f1e9;
  --bg-2: #ebe6da;
  --panel: #ffffff;
  --panel-2: #faf7ef;
  --panel-end: #f1ece0;
  --line: #ddd5c4;
  --line-2: #c8bca3;
  --text: #4a4232;
  --text-dim: #877c66;
  --text-bright: #2a2418;
  --accent: #b0832c;
  --accent-2: #8a5f17;
  --accent-ink: #fff8ea;
  --good: #4f8f37;
  --bad: #c1481f;
  --shadow: 0 10px 28px rgba(60, 50, 30, 0.14);

  --scrim: rgba(255, 255, 255, 0.86);
  --scrim-strong: rgba(255, 255, 255, 0.92);
  --body-glow-1: rgba(176, 131, 44, 0.10);
  --body-glow-2: rgba(70, 98, 145, 0.07);
  --texture: #5a4a2a;
  --nav-bg: rgba(244, 241, 233, 0.85);
  --pending: #7a3fa0;

  /* nudge a few near-white/low-contrast qualities so they read on light bg */
  --q-normal: #8a8378;
  --q-unique: #b8910a;
  --q-haunted: #1aa278;
  --q-decorated: #9a9a9a;
}

* { box-sizing: border-box; }

/* The hidden attribute must always win, even over display:flex containers
   like .modal-backdrop / .overlay (equal specificity would otherwise let
   the class's display:flex override it and leave modals stuck on screen). */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Barlow', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 70% -10%, var(--body-glow-1), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, var(--body-glow-2), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

/* faint diagonal texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: repeating-linear-gradient(45deg, var(--texture) 0 1px, transparent 1px 7px);
  z-index: 0;
}

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

h1, h2, h3, .brand {
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-bright);
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(1.7rem, 3vw, 2.6rem); text-transform: uppercase; }

.main { flex: 1 0 auto; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 1.5rem clamp(0.8rem, 3vw, 2.5rem); position: relative; z-index: 1; }
.muted { color: var(--text-dim); }

/* ───────── buttons ───────── */
.btn-primary, .btn-ghost, .btn-steam {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 4px 14px rgba(200, 169, 110, 0.25);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(200, 169, 110, 0.35); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.4); }
.btn-ghost {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text-bright); }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; flex: none;
  background: transparent; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); color: var(--text); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.theme-toggle:hover { color: var(--accent-2); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
/* Show the icon for the mode you'd switch TO: dark→sun, light→moon. */
.theme-toggle .t-moon { display: none; }
:root[data-theme='light'] .theme-toggle .t-sun { display: none; }
:root[data-theme='light'] .theme-toggle .t-moon { display: block; }

.btn-steam { background: #171a21; color: #c7d5e0; border-color: #2a3f5a; }
.btn-steam:hover { background: #1b2838; color: #fff; }

/* ───────── nav ───────── */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: clamp(0.55rem, 1.6vw, 1.5rem);
  padding: 0.7rem clamp(0.8rem, 3vw, 2.5rem);
  min-width: 0;
}
.brand { font-size: 1.6rem; letter-spacing: 0.06em; display: flex; align-items: baseline; flex: 0 0 auto; white-space: nowrap; }
.brand-mark { color: var(--text-bright); }
.brand-dot { color: var(--accent); }
.brand-tf { color: var(--accent); }
.beta-badge {
  align-self: center;
  margin-left: 0.55rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.12em;
  line-height: 1;
  color: var(--bg-1, #111009);
  background: var(--accent);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.nav-links {
  display: flex; align-items: center; gap: clamp(0.55rem, 1.25vw, 1.1rem);
  flex: 1 1 auto; min-width: 0; flex-wrap: wrap; row-gap: 0.35rem;
}
.nav-links a {
  color: var(--text-dim); font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; font-size: clamp(0.9rem, 1vw, 1.05rem); padding: 0.2rem 0;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.nav-links a:hover { color: var(--text-bright); }
.nav-links a.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-user { display: flex; align-items: center; gap: 0.5rem; flex: 0 1 auto; min-width: 0; margin-left: auto; }
.avatar { width: 30px; height: 30px; border-radius: 5px; border: 1px solid var(--line-2); flex: 0 0 auto; }
.user-meta { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; }
.uname { color: var(--text-bright); font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-pill { display: inline-flex; align-items: center; gap: 0.2rem; flex: 0 0 auto; color: var(--text-bright); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 0.18rem 0.45rem; font-weight: 700; font-size: 0.82rem; line-height: 1.1; white-space: nowrap; }
.logout-form { margin: 0; }
.logout-form .btn-ghost { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.bot-status { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.bot-status.on { background: var(--good); box-shadow: 0 0 8px var(--good); }
.bot-status.off { background: var(--bad); box-shadow: 0 0 8px var(--bad); }

/* ───────── footer ───────── */
.foot { flex-shrink: 0; border-top: 1px solid var(--line); background: var(--bg-2); position: relative; z-index: 1; }
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 1.2rem clamp(0.8rem, 3vw, 2.5rem); display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; color: var(--text-dim); font-size: 0.9rem; }
.foot-sep { opacity: 0.4; }
.foot-note { flex-basis: 100%; font-size: 0.78rem; opacity: 0.6; margin-top: 0.3rem; }

/* ============================================================
   TRADE PAGE
   ============================================================ */
.trade-toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.search-wrap { flex: 1; min-width: 180px; }
input[type='search'], input[type='text'], input[type='number'], select, textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--text-bright);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
  font-family: 'Barlow', sans-serif;
  font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.15); }
select { width: auto; min-width: 130px; cursor: pointer; }

/* Per-column filter bar (bot and user each have their own). */
.col-filters { display: flex; gap: 0.45rem; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); background: var(--bg-2); flex-wrap: wrap; align-items: center; }
.col-filters .col-search { flex: 1 1 100%; min-width: 0; }
.col-filters .col-quality, .col-filters .col-sort { flex: 1 1 0; min-width: 0; padding: 0.45rem 0.5rem; font-size: 0.85rem; }
.col-filters .col-refresh { flex: 0 0 auto; padding: 0.45rem 0.7rem; font-size: 1.05rem; line-height: 1; }
@media (min-width: 1100px) {
  .col-filters .col-search { flex: 1 1 100%; }
}

.columns {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px) 1fr;
  gap: 1rem;
  align-items: start;
}

.col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-height: 320px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.col-head h2 { font-size: 1.15rem; margin: 0; text-transform: uppercase; }
.currency-totals { font-size: 0.95rem; color: var(--accent-2); font-family: 'Barlow Condensed', sans-serif; letter-spacing: 0.03em; font-weight: 600; }
.col-empty { padding: 2.5rem 1.2rem; text-align: center; color: var(--text-dim); display: flex; flex-direction: column; gap: 0.8rem; align-items: center; }
.col-banner {
  margin: 0.55rem 0.6rem -0.2rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(210, 96, 58, 0.08);
  border: 1px solid rgba(210, 96, 58, 0.35);
  border-left-width: 3px;
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.4;
}
.col-banner a { color: var(--accent-2); font-weight: 600; }

.col-offer { position: sticky; top: 72px; }

/* item grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  grid-auto-rows: 88px; /* explicit row height — prevents aspect-ratio rows from
                            collapsing/overlapping inside this scroll container */
  gap: 7px;
  padding: 10px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.grid::-webkit-scrollbar { width: 8px; }
.grid::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }

.item {
  position: relative;
  background: linear-gradient(180deg, var(--panel-2), var(--panel-end));
  border: 1px solid var(--line-2);
  border-bottom-width: 3px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.item:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 6px 16px rgba(0,0,0,0.5); z-index: 2; }
.item img { width: 88%; height: 88%; object-fit: contain; pointer-events: none; }
.item.disabled { opacity: 0.32; cursor: not-allowed; filter: grayscale(0.7); }
.item.disabled:hover { transform: none; border-color: var(--line-2); box-shadow: none; }
.item.stock-cap-reached, .item.selection-cap-reached {
  opacity: 0.24;
  cursor: not-allowed;
  filter: grayscale(0.85) saturate(0.55);
}
.item.stock-cap-reached:hover, .item.selection-cap-reached:hover {
  transform: none;
  border-color: var(--bad);
  box-shadow: 0 0 0 1px rgba(210,96,58,0.28) inset;
}
.item .stock-cap-note {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  padding: 2px 3px;
  border: 1px solid rgba(210,96,58,0.65);
  border-radius: 5px;
  background: rgba(28, 22, 18, 0.88);
  color: var(--bad);
  text-align: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}
.item .stock-cap-note[hidden] { display: none; }
.item-tip .tip-stockcap { border-color: var(--bad); color: var(--bad); font-weight: 700; }
/* Currency cards: gold-accented showcase, shown for reference, used as change automatically. */
.item.showcase { cursor: default; border-bottom-color: var(--accent); background: linear-gradient(180deg, var(--body-glow-1), var(--panel-end)); }
.item.showcase:hover { transform: none; border-color: var(--line-2); border-bottom-color: var(--accent); box-shadow: none; }
.item.showcase .price { color: var(--accent-2); background: var(--scrim-strong); }
.item .count {
  position: absolute; top: 3px; right: 4px;
  font-size: 0.72rem; font-weight: 700; font-family: 'Barlow Condensed', sans-serif;
  background: var(--scrim); color: var(--text-bright);
  padding: 0 5px; border-radius: 4px; min-width: 16px; text-align: center;
}
.item .price {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 0.68rem; font-weight: 600;
  background: var(--scrim); color: var(--accent-2);
  text-align: center; padding: 1px 2px;
  font-family: 'Barlow Condensed', sans-serif; letter-spacing: 0.02em;
}
.item .price-pending { color: var(--pending); font-style: italic; }
/* Unusual effect particle image — sits behind the item icon as a glow. */
.item .effect-img {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: contain; opacity: 0.55; pointer-events: none; z-index: 0;
}
.item img:not(.effect-img) { position: relative; z-index: 1; }
/* Unusual effect ribbon along the top of the tile (text label; image swaps in if it loads). */
.item .effect-tag {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  font-size: 0.6rem; font-weight: 700; line-height: 1.25;
  background: linear-gradient(90deg, rgba(134,80,172,0.92), rgba(90,50,130,0.92));
  color: #fff; text-align: center; padding: 1px 2px;
  font-family: 'Barlow Condensed', sans-serif; letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* "SP" marker showing Strange Parts are attached (detail in tooltip). */
.item .parts-dot {
  position: absolute; top: 3px; left: 4px;
  font-size: 0.58rem; font-weight: 800; font-family: 'Barlow Condensed', sans-serif;
  background: var(--q-strange, #cf6a32); color: #1a1206;
  padding: 0 4px; border-radius: 4px; letter-spacing: 0.03em; z-index: 2;
}
/* Uncraftable — dashed outline + a struck-through label, like other trade sites. */
.item.uncraftable { border-style: dashed; border-color: var(--line); }
.mini.uncraftable { outline: 1px dashed var(--line); outline-offset: -1px; opacity: 0.92; }
.chip.uncraft .chip-name { text-decoration: line-through; text-decoration-thickness: 1px; opacity: 0.85; }

/* Styled hover tooltip for item tiles (replaces the native title) */
.item-tip {
  position: fixed; z-index: 80; max-width: 240px;
  background: var(--panel-2, #1b1a15); border: 1px solid var(--accent);
  border-radius: 8px; padding: 0.5rem 0.6rem;
  box-shadow: 0 10px 28px rgba(0,0,0,0.55);
  pointer-events: none; font-size: 0.82rem; line-height: 1.35;
  animation: tip-in 0.09s ease-out;
}
@keyframes tip-in { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.item-tip .tip-name { color: var(--text-bright); font-weight: 600; margin-bottom: 0.28rem; }
.item-tip .tip-meta { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.28rem; }
.item-tip .tip-meta[hidden] { display: none; }
.item-tip .tip-badge {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 4px;
  padding: 0.05rem 0.36rem; font-size: 0.72rem; color: var(--text-dim);
}
.item-tip .tip-uncraft { border-style: dashed; color: var(--text-bright); }
.item-tip .tip-classes { border-color: var(--accent); color: var(--accent-2); font-weight: 600; }
.item-tip .tip-pending { color: var(--pending); font-style: italic; }
.item-tip .tip-price { color: var(--accent-2); font-weight: 600; }
.item-tip .tip-price[hidden] { display: none; }

/* quality colour border + glow */
.item[class*='q-'] { border-bottom-color: var(--qc, var(--line-2)); }
.q-normal { --qc: var(--q-normal); }
.q-genuine { --qc: var(--q-genuine); }
.q-vintage { --qc: var(--q-vintage); }
.q-unusual { --qc: var(--q-unusual); }
.q-unique { --qc: var(--q-unique); }
.q-community, .q-selfmade { --qc: var(--q-community); }
.q-valve { --qc: var(--q-valve); }
.q-strange { --qc: var(--q-strange); }
.q-haunted { --qc: var(--q-haunted); }
.q-collectors { --qc: var(--q-collectors); }
.q-decorated { --qc: var(--q-decorated); }
.item.q-unusual { background: radial-gradient(circle at 50% 40%, rgba(134,80,172,0.28), var(--panel-end) 70%); }

/* offer builder */
.offer-body { padding: 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; }
.offer-side-label { font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); font-size: 0.85rem; margin-bottom: 0.35rem; }
.offer-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 5px; min-height: 54px; background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: 6px; }
.offer-list .mini {
  position: relative; aspect-ratio: 1; border-radius: 5px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line-2); border-bottom-width: 2px;
  display: flex; align-items: center; justify-content: center;
}
.offer-list .mini img { width: 86%; height: 86%; object-fit: contain; }
.offer-list .mini:hover { border-color: var(--bad); }
.offer-list .mini .x { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(210,96,58,0.35); font-weight: 700; color: #fff; border-radius: 5px; }
.offer-list .mini:hover .x { display: flex; }
.offer-list .mini .ct { position: absolute; bottom: 1px; right: 2px; font-size: 0.62rem; background: var(--scrim); padding: 0 3px; border-radius: 3px; }

.offer-balance { text-align: center; padding: 0.5rem; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); }
.balance-line { font-family: 'Barlow Condensed', sans-serif; font-size: 1.05rem; letter-spacing: 0.02em; }
.balance-line.ok { color: var(--good); }
.balance-line.warn { color: var(--accent-2); }
.balance-line.err { color: var(--bad); }

.offer-actions { display: flex; gap: 0.6rem; padding: 0.9rem; border-top: 1px solid var(--line); }
.offer-actions .btn-primary { flex: 1; justify-content: center; }

/* ============================================================
   MODALS / OVERLAY / TOAST
   ============================================================ */
.modal-backdrop, .overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8, 7, 4, 0.72);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.4rem; width: 100%; max-width: 440px;
  animation: pop 0.16s ease;
}
.modal-wide { max-width: 620px; }
@keyframes pop { from { transform: translateY(10px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 1.4rem; }
.modal-sub { color: var(--text-dim); font-size: 0.9rem; margin: 0 0 0.9rem; }
.modal input { margin-bottom: 0.8rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.6rem; }
.modal-error { color: var(--bad); font-size: 0.88rem; margin-bottom: 0.6rem; }
.tradeurl-steps { margin: 0 0 0.9rem; padding-left: 1.2rem; color: var(--text); font-size: 0.9rem; line-height: 1.55; }
.tradeurl-steps li { margin-bottom: 0.15rem; }
.tradeurl-steps em { color: var(--accent-2); font-style: normal; }
.modal .tradeurl-open { display: flex; justify-content: center; margin-bottom: 0.9rem; }

.confirm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 0.9rem; }
.confirm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 5px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px; min-height: 52px; }
.confirm-list .mini { aspect-ratio: 1; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 5px; display: flex; align-items: center; justify-content: center; position: relative; }
.confirm-list .mini img { width: 86%; height: 86%; object-fit: contain; }
.confirm-list .mini .ct { position: absolute; bottom: 1px; right: 2px; font-size: 0.6rem; background: var(--scrim); padding: 0 3px; border-radius: 3px; }
.confirm-summary { text-align: center; font-family: 'Barlow Condensed', sans-serif; font-size: 1.15rem; color: var(--accent-2); margin-bottom: 0.6rem; }

.overlay-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: 0.8rem; align-items: center; }
.overlay-card h3 { font-size: 1.6rem; margin: 0; }
.overlay-card p { color: var(--text-dim); margin: 0; }
.overlay-card .btn-primary { width: 100%; justify-content: center; }
.overlay-spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
.overlay-check { width: 56px; height: 56px; border-radius: 50%; background: rgba(123,180,95,0.15); border: 2px solid var(--good); color: var(--good); display: flex; align-items: center; justify-content: center; font-size: 2rem; line-height: 1; animation: pop 0.25s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
#sent-timer { color: var(--accent-2); font-weight: 700; }

.toast {
  position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--bad); color: var(--text-bright);
  padding: 0.7rem 1.2rem; border-radius: var(--radius-sm); box-shadow: var(--shadow);
  z-index: 60; max-width: 90vw; font-size: 0.92rem; animation: pop 0.18s ease;
}
.toast.ok { border-color: var(--good); }

/* ============================================================
   KEYS PAGE
   ============================================================ */
.keys-hero { text-align: center; margin-bottom: 1.8rem; }
.keys-sub { color: var(--text-dim); margin-top: -0.4rem; }
.keys-rates { display: flex; gap: 1rem; justify-content: center; margin-top: 1.2rem; flex-wrap: wrap; }
.rate-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 1rem 1.6rem; min-width: 170px; }
.rate-label { display: block; color: var(--text-dim); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.rate-value { display: block; font-family: 'Barlow Condensed', sans-serif; font-size: 2rem; color: var(--accent-2); font-weight: 700; }
.rate-value em { font-size: 1rem; font-style: normal; color: var(--text-dim); }
.keys-login, .keys-panels { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }
.keys-login { flex-direction: column; align-items: center; text-align: center; gap: 0.8rem; }
.keys-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; width: 320px; max-width: 100%; }
.panel-note { color: var(--text-dim); font-size: 0.9rem; margin-top: -0.3rem; }
.qty-row { display: flex; gap: 0.5rem; align-items: center; margin: 1rem 0; }
.qty-btn { width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-bright); font-size: 1.4rem; cursor: pointer; }
.qty-btn:hover { border-color: var(--accent); }
.qty-input { text-align: center; font-size: 1.2rem; }
.keys-cost { text-align: center; font-family: 'Barlow Condensed', sans-serif; font-size: 1.15rem; color: var(--accent-2); min-height: 1.5em; margin-bottom: 0.8rem; }
.keys-panel .btn-primary { width: 100%; justify-content: center; }

/* ============================================================
   HISTORY
   ============================================================ */
.history-list { display: flex; flex-direction: column; gap: 0.6rem; }
.history-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1.1rem; display: grid; grid-template-columns: 150px 1fr 130px; gap: 1rem; align-items: center; }
.history-meta { display: flex; flex-direction: column; gap: 0.25rem; }
.history-date { color: var(--text-dim); font-size: 0.82rem; }
.history-dir { text-transform: uppercase; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.05em; padding: 0.1rem 0.5rem; border-radius: 4px; width: max-content; }
.history-status {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 0.74rem;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 0.08rem 0.45rem;
  border-radius: 4px; width: max-content; border: 1px solid currentColor;
}
.status-completed { color: var(--good); }
.status-pending, .status-escrow, .status-countered { color: var(--accent-2); }
.status-declined, .status-invalid { color: var(--bad); }
.status-expired, .status-canceled { color: var(--text-dim); }
.history-buy { background: rgba(123,180,95,0.18); color: var(--good); }
.history-sell { background: rgba(210,96,58,0.18); color: var(--bad); }
.history-mixed, .history-keys { background: rgba(200,169,110,0.18); color: var(--accent-2); }
.history-items { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.history-side-label { color: var(--text-dim); font-size: 0.78rem; text-transform: uppercase; }
.history-arrow { color: var(--text-dim); font-size: 1.3rem; }
.chip-row { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--qc, var(--line-2)); border-radius: 5px; padding: 0.18rem 0.5rem; font-size: 0.82rem; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip img { width: 22px; height: 22px; object-fit: contain; }
.chip-x { color: var(--accent-2); font-weight: 700; font-family: 'Barlow Condensed', sans-serif; }
.history-value { text-align: right; font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; color: var(--accent-2); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-cards { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.2rem 0; }
.contact-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 1.4rem; display: flex; flex-direction: column; gap: 0.3rem; width: 220px; transition: border-color 0.15s, transform 0.1s; }
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-icon { font-size: 1.8rem; }
.contact-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 1.2rem; color: var(--text-bright); }
.contact-sub { color: var(--text-dim); font-size: 0.85rem; }
.contact-fine { color: var(--text-dim); font-size: 0.9rem; max-width: 620px; }

/* ============================================================
   ADMIN
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; margin-bottom: 1.4rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; text-align: center; }
.stat-num { display: block; font-family: 'Barlow Condensed', sans-serif; font-size: 1.9rem; font-weight: 700; color: var(--accent-2); }
.stat-label { color: var(--text-dim); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.admin-actions { display: flex; gap: 0.8rem; align-items: center; margin-bottom: 1.4rem; flex-wrap: wrap; }
.admin-status { color: var(--accent-2); font-family: 'Barlow Condensed', sans-serif; }
.admin-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; margin-bottom: 1.2rem; }
.admin-card h3 { font-size: 1.3rem; }
.admin-subcard { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; margin: 1rem 0; }
.admin-subcard h4 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.switch-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem; }
.switch-row input { width: auto; }
.field-label { display: block; color: var(--text-dim); font-size: 0.85rem; margin: 0.6rem 0 0.3rem; text-transform: uppercase; letter-spacing: 0.03em; }
.admin-card .btn-primary { margin-top: 0.9rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
.admin-table th { color: var(--text-dim); text-transform: uppercase; font-size: 0.78rem; font-family: 'Barlow Condensed', sans-serif; letter-spacing: 0.04em; }

/* pricing config card */
.cfg-intro code { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 0.05rem 0.35rem; font-size: 0.85em; }
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 0.6rem; }
.cfg-field { display: flex; flex-direction: column; }
.cfg-inline { display: flex; gap: 0.5rem; }
.cfg-inline input { flex: 1; }
.cfg-inline select { min-width: 80px; }
.cfg-hint { color: var(--text-dim); font-size: 0.78rem; font-weight: 400; text-transform: none; letter-spacing: 0; }
.cfg-field .cfg-hint { margin-top: 0.3rem; }
.cfg-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.8rem 1rem; margin: 0.8rem 0 1rem; }
.cfg-lists textarea { font-family: 'Barlow', monospace; font-size: 0.85rem; resize: vertical; }
.mp-table { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem; margin-bottom: 1rem; }
.mp-head, .mp-row { display: grid; grid-template-columns: 1.6fr 0.8fr 0.9fr 0.8fr 0.9fr 36px; gap: 0.5rem; align-items: center; }
.ia-head, .ia-row { grid-template-columns: 1.8fr 1fr 1fr 36px !important; }
.sc-head, .sc-row { grid-template-columns: 2.4fr 1fr 36px !important; }
.custom-block { margin-bottom: 1rem; }
.custom-items { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem; }
.custom-chip { background: var(--bg-2); border: 1px solid var(--q-strange, #cf6a32); color: var(--text-bright); border-radius: var(--radius-sm); padding: 0.35rem 0.6rem; font-size: 0.82rem; cursor: pointer; font-family: 'Barlow', sans-serif; }
.custom-chip:hover { border-color: var(--accent); }
.custom-chip.priced { border-color: var(--ok, #6fbf73); opacity: 0.7; }
.mp-head { color: var(--text-dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 0 0.1rem 0.4rem; }
.mp-row { margin-bottom: 0.45rem; }
.mp-row input { padding: 0.4rem 0.5rem; font-size: 0.88rem; }
.mp-del { padding: 0.35rem 0; text-align: center; }
#mp-add { margin-top: 0.3rem; padding: 0.4rem 0.9rem; }
.cfg-save-row { display: flex; align-items: center; gap: 0.9rem; }

/* ============================================================
   ERROR
   ============================================================ */
.error-page { text-align: center; padding: 3rem 1rem; }
.error-code { font-family: 'Barlow Condensed', sans-serif; font-size: clamp(4rem, 14vw, 9rem); font-weight: 800; color: var(--line-2); line-height: 1; }
.error-page .btn-primary { margin-top: 1rem; }

/* ============================================================
   DOC PAGES (How it works / FAQ / Terms & Privacy)
   ============================================================ */
.doc { max-width: 760px; margin: 0 auto; }
.doc h1 { margin-bottom: 0.3rem; }
.doc h2 { margin-top: 2rem; font-size: 1.35rem; border-bottom: 1px solid var(--line); padding-bottom: 0.35rem; }
.trust-strip { display: flex; gap: 0.8rem; margin: 1.2rem 0 1.6rem; flex-wrap: wrap; }
.trust-stat { flex: 1 1 0; min-width: 130px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; text-align: center; }
.trust-num { display: block; font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 1.7rem; color: var(--accent); line-height: 1; }
.trust-lab { display: block; margin-top: 0.3rem; font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.03em; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: 0.7rem; }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem 0.9rem 3rem; position: relative; color: var(--text); line-height: 1.5; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0.85rem; top: 0.85rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; font-family: 'Barlow Condensed', sans-serif; }
.faq-item { margin: 0.9rem 0; padding-bottom: 0.9rem; border-bottom: 1px solid var(--line); }
.faq-item h3 { margin: 0 0 0.35rem; font-size: 1.05rem; color: var(--text); }
.faq-item p { margin: 0; color: var(--text-dim); line-height: 1.55; }
.doc a { color: var(--accent-2); }

/* ============================================================
   ADMIN TRADE MONITOR
   ============================================================ */
.status-active, .status-confirming { color: var(--accent-2); }
.monitor { max-width: 1000px; margin: 0 auto; }
.mon-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.mon-head h1 { margin-bottom: 0.2rem; }
.mon-meta { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.mon-auto { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--text-dim); }
.btn-small { padding: 0.4rem 0.7rem; font-size: 0.85rem; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); cursor: pointer; font-family: inherit; }
.btn-small:hover { border-color: var(--accent); }
.mon-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-dim); display: inline-block; }
.mon-dot.ok { background: var(--good); box-shadow: 0 0 0 3px rgba(120,190,120,0.18); }
.mon-dot.down { background: var(--bad); box-shadow: 0 0 0 3px rgba(200,90,90,0.18); }
.mon-h2 { margin-top: 1.6rem; font-size: 1.2rem; }
.mon-count { font-size: 0.8rem; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 0.05rem 0.55rem; font-family: 'Barlow Condensed', sans-serif; font-weight: 800; vertical-align: middle; margin-left: 0.3rem; }
.tm-list { display: grid; gap: 0.6rem; margin-top: 0.7rem; }
.tm-row {
  display: grid; grid-template-columns: 150px 1fr 150px; grid-template-areas: "head items meta" "who items meta";
  gap: 0.3rem 0.9rem; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem 0.9rem;
}
.tm-row.live { border-left: 3px solid var(--accent-2); }
.tm-rowhead { grid-area: head; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.tm-dir { font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; font-size: 0.78rem; color: var(--text-dim); letter-spacing: 0.04em; }
.tm-tag { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-dim); border: 1px dashed var(--line-2); border-radius: 4px; padding: 0 4px; }
.tm-who { grid-area: who; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-who a { color: var(--accent-2); }
.tm-items { grid-area: items; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tm-side { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.tm-sidelab { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); }
.tm-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.tm-chip { font-size: 0.72rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.tm-chip.cur { color: var(--accent-2); border-color: var(--accent-2); }
.tm-none { color: var(--text-dim); }
.tm-arrow { color: var(--text-dim); font-size: 1.1rem; }
.tm-meta { grid-area: meta; text-align: right; display: flex; flex-direction: column; gap: 0.15rem; }
.tm-val { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; color: var(--accent); }
.tm-time { font-size: 0.78rem; color: var(--text-dim); }
.tm-oid { font-size: 0.68rem; color: var(--line-2); font-family: monospace; }
@media (max-width: 760px) {
  .tm-row { grid-template-columns: 1fr; grid-template-areas: "head" "who" "items" "meta"; gap: 0.5rem; }
  .tm-meta { text-align: left; flex-direction: row; gap: 0.7rem; align-items: center; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1400px) {
  .columns { grid-template-columns: 1fr minmax(260px, 320px) 1fr; }
}
@media (max-width: 1100px) {
  .columns { grid-template-columns: 1fr 1fr; }
  .col-offer { grid-column: 1 / -1; order: 3; position: static; }
  .col-user { order: 1; }
  .col-bot { order: 2; }
  .offer-body { flex-direction: row; flex-wrap: wrap; }
  .offer-body .offer-side { flex: 1; min-width: 200px; }
  .offer-balance { flex-basis: 100%; order: 2; }
}
@media (max-width: 900px) {
  .nav-inner { flex-wrap: wrap; }
  .nav-links { order: 3; flex: 1 0 100%; gap: 0.7rem; justify-content: flex-start; }
  .nav-links a { font-size: 0.92rem; }
  .uname { display: none; }
  .grid { max-height: 60vh; }
}
@media (max-width: 600px) {
  .nav-inner { flex-wrap: wrap; gap: 0.55rem; }
  .nav-links { order: 3; flex-basis: 100%; justify-content: flex-start; gap: 0.6rem 0.75rem; }
  .nav-links a { font-size: 0.86rem; }
  .columns { grid-template-columns: 1fr; }
  .col-user { order: 1; } .col-bot { order: 2; } .col-offer { order: 3; }
  .offer-body { flex-direction: column; }
  .confirm-grid { grid-template-columns: 1fr; }
  .history-row { grid-template-columns: 1fr; gap: 0.6rem; }
  .history-value { text-align: left; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); grid-auto-rows: 76px; }
}
@media (min-width: 2000px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); grid-auto-rows: 100px; }
}

/* ── Active-offer reminder banner (trade page) ───────────────────────── */
.active-offers {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.active-offers .ao-msg { font-weight: 600; color: var(--text-bright); }
.active-offers .ao-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 700;
}
.active-offers .ao-link:hover { filter: brightness(1.07); color: var(--accent-ink); }

/* ── Admin: Bot Inventory (TF2 new-items notification style) ──────────────── */
.inv-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.inv-loading { padding: 24px 0; }

.inv-section { margin-bottom: 32px; }
.inv-bot-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  padding: 8px 14px; background: var(--bg-2); border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.inv-bot-id { font-weight: 700; color: var(--text-bright); font-size: 1.05rem; }
.inv-bot-count { font-size: 0.88rem; color: var(--text-dim); }
.inv-bot-cur { font-size: 0.88rem; margin-left: auto; }

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
}

.inv-card {
  background: var(--bg-2);
  border: 2px solid transparent;
  border-radius: 8px;
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform 0.08s, border-color 0.12s;
  cursor: default;
}
.inv-card:hover { transform: translateY(-2px); }

/* Quality border colours reuse the existing CSS vars */
.inv-card.q-normal    { border-color: var(--q-normal); }
.inv-card.q-genuine   { border-color: var(--q-genuine); }
.inv-card.q-vintage   { border-color: var(--q-vintage); }
.inv-card.q-unusual   { border-color: var(--q-unusual); box-shadow: 0 0 8px rgba(134,80,172,0.35); }
.inv-card.q-unique    { border-color: var(--q-unique); }
.inv-card.q-community { border-color: var(--q-community); }
.inv-card.q-valve     { border-color: var(--q-valve); }
.inv-card.q-selfmade  { border-color: var(--q-selfmade); }
.inv-card.q-strange   { border-color: var(--q-strange); }
.inv-card.q-haunted   { border-color: var(--q-haunted); }
.inv-card.q-collectors{ border-color: var(--q-collectors); }
.inv-card.q-decorated { border-color: var(--q-decorated); }
.inv-card.inv-pending { border-style: dashed; opacity: 0.75; }

.inv-img {
  position: relative; width: 100%; padding-top: 100%;
  background: linear-gradient(160deg, var(--bg-1, #0d0c09) 0%, var(--bg-2) 100%);
  overflow: hidden;
}
.inv-img img:not(.inv-effect) {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 82%; height: 82%; object-fit: contain;
}
.inv-effect {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.55; pointer-events: none;
}
.inv-no-img {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: var(--text-dim);
}

.inv-info { padding: 6px 8px 8px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.inv-name {
  font-size: 0.75rem; line-height: 1.25; font-weight: 600; color: var(--text-bright);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.inv-effect-tag { font-size: 0.68rem; color: var(--q-unusual); font-weight: 600; }
.inv-attr { font-size: 0.65rem; color: var(--text-dim); }
.inv-unc { font-style: italic; }
.inv-price { font-size: 0.72rem; margin-top: auto; padding-top: 4px; color: var(--accent-2); font-weight: 600; }
.inv-currency { color: var(--text-dim); }
.inv-set-price { color: var(--accent); }
.inv-no-price { color: var(--text-dim); font-style: italic; }

/* ── Load-more pagination (trade monitor) ────────────────────────────────── */
#done-pagination { padding: 14px 0; }

/* ── Admin card sub-header (title + meta on one line) ────────────────────── */
.admin-card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.admin-card-head h3 { margin: 0; }

/* ── Name-discount banner (trade page) ───────────────────────────────────── */
.discount-banner {
  margin: 0 0 14px;
  padding: 11px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 100%);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 500;
}

/* ============================================================
   SMALL PHONES  (≤480px; extra tightening ≤360px)
   Placed last so these win over the wider breakpoints above.
   ============================================================ */
@media (max-width: 480px) {
  /* Use the full width — trim outer chrome */
  .main { padding: 0.9rem 0.6rem 1.4rem; }
  .nav-inner { padding: 0.55rem 0.7rem; gap: 0.5rem; }
  .foot-inner { padding: 1rem 0.7rem; font-size: 0.8rem; gap: 0.4rem; }

  /* Header: compact brand + flexible nav, keep the username hidden */
  .brand { font-size: 1.3rem; letter-spacing: 0.04em; }
  .beta-badge { margin-left: 0.35rem; padding: 0.16rem 0.32rem; font-size: 0.56rem; }
  .nav-links { gap: 0.45rem 0.7rem; }
  .nav-links a { font-size: 0.82rem; }
  .nav-user { gap: 0.38rem; }
  .uname { display: none; }
  .coin-pill { padding: 0.16rem 0.36rem; font-size: 0.76rem; }
  .avatar { width: 26px; height: 26px; }
  .logout-form .btn-ghost { padding: 0.28rem 0.48rem; font-size: 0.74rem; }
  .theme-toggle { padding: 0.28rem; }

  /* Trade columns: single column, tighter, grids size to a usable height */
  .columns { gap: 0.7rem; }
  .col { min-height: auto; border-radius: 12px; }
  .col-head { padding: 0.6rem 0.75rem; }
  .col-head h2 { font-size: 1rem; }
  .col-filters { padding: 0.5rem 0.6rem; gap: 0.4rem; }
  .col-filters .col-quality, .col-filters .col-sort { font-size: 0.8rem; padding: 0.5rem 0.4rem; }
  .col-filters .col-search { padding: 0.55rem 0.6rem; }

  /* Item grids: smaller cells (4–5 per row), shorter scroll area so all
     three sections (your items / bot items / offer) stay reachable */
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
    grid-auto-rows: 70px;
    gap: 5px; padding: 7px; max-height: 50vh;
  }
  .item img { width: 90%; height: 90%; }

  /* Offer panel: stacked, full-width action button */
  .offer-body { padding: 0.7rem; gap: 0.5rem; }
  .offer-list { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  .offer-actions { padding: 0.7rem; gap: 0.5rem; flex-direction: column; }
  .offer-actions .btn-primary, .offer-actions .btn-ghost { width: 100%; }

  /* Comfortable tap targets on the primary actions (≥44px) */
  .btn-primary, .btn-steam { min-height: 46px; }

  /* Modals → bottom-sheet feel: full width, slide up from the bottom, scroll if tall */
  .modal-backdrop, .overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%; width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 1.2rem 1rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
    max-height: 92vh; overflow-y: auto;
  }
  .modal h3 { font-size: 1.2rem; }
  .confirm-grid { grid-template-columns: 1fr; gap: 0.7rem; }
  .modal-actions { flex-direction: column-reverse; gap: 0.5rem; }
  .modal-actions button { width: 100%; min-height: 46px; }
  .confirm-list, .offer-list { min-height: 46px; }

  /* Banners stack their CTA full width */
  .active-offers, .discount-banner { padding: 10px 12px; font-size: 0.85rem; gap: 8px; }
  .active-offers .ao-link { width: 100%; justify-content: center; }

  /* Landing trust strip stacks */
  .trust-strip { flex-direction: column; gap: 0.6rem; }
  .trust-stat { min-width: 0; }

  /* Admin: 2-up stats, horizontally-scrollable tables, full-width actions */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .stat { padding: 0.7rem 0.6rem; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .admin-actions { gap: 0.5rem; }
  .admin-actions .btn-primary, .admin-actions .btn-ghost, .admin-actions > a { flex: 1 1 100%; justify-content: center; min-height: 44px; text-align: center; }
  .mon-head, .inv-header { gap: 0.6rem; }
}

@media (max-width: 360px) {
  .brand { font-size: 1.14rem; }
  .beta-badge { display: none; }
  .nav-links { gap: 0.35rem 0.55rem; }
  .nav-links a { font-size: 0.74rem; letter-spacing: 0.025em; }
  .nav-inner { gap: 0.35rem; }
  .coin-pill { font-size: 0.7rem; padding: 0.14rem 0.3rem; }
  .logout-form .btn-ghost { padding: 0.24rem 0.38rem; font-size: 0.68rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); grid-auto-rows: 62px; gap: 4px; }
  .col-head h2 { font-size: 0.92rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-num { font-size: 1.4rem; }
}

/* ── Gems & cards buy page: 2-column (items + sticky offer), mirrors the trade page ── */
.columns.cols-buy { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); }
.item.st-card { cursor: pointer; }
.item.st-card.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.item .nm-tag { position: absolute; top: 2px; right: 2px; font-size: 0.6rem; font-weight: 700; background: var(--scrim-strong); color: var(--pending); padding: 0 3px; border-radius: 3px; letter-spacing: 0.03em; z-index: 3; }
.recv-pure { display: flex; gap: 8px; flex-wrap: wrap; }
.recv-pure .pure-chip { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 0.95rem; }
.offer-sent { padding: 0.8rem 0.9rem; border-top: 1px solid var(--line); font-size: 0.9rem; }
.buy-intro { margin-bottom: 0.8rem; }
.buy-intro h1 { margin: 0 0 0.2rem; }
@media (max-width: 860px) {
  .columns.cols-buy { grid-template-columns: 1fr; }
  .columns.cols-buy .col-offer { position: static; order: 2; }
  .columns.cols-buy .col-user { order: 1; }
}

/* ── Steam gems/cards page: +25% zoom, search/type filter ───────────────── */
.steam-zoom { zoom: 1.25; }
.st-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.st-filter .col-search { flex: 1 1 200px; min-width: 160px; }
.st-types { display: flex; gap: 6px; flex-wrap: wrap; }
.custom-chip.active { border-color: var(--accent); color: var(--text-bright); background: var(--panel-2); }

/* ── Steam sign-in policy disclaimer (Steam brand guidelines) ───────────────
   Appended under every "Sign in through Steam" CTA. The compact nav button is
   kept single-line (icon + label) without the disclaimer. */
.btn-steam[href="/auth/steam"] { flex-direction: column; gap: 0.15rem; line-height: 1.2; text-align: center; }
.btn-steam[href="/auth/steam"]::after {
  content: "This site is not associated with Valve Corp.";
  display: block; font-size: 0.62rem; font-weight: 400; opacity: 0.72; letter-spacing: 0.01em;
}
.nav-user .btn-steam[href="/auth/steam"] { flex-direction: row; gap: 0.5rem; }
.nav-user .btn-steam[href="/auth/steam"]::after { display: none; }


/* Cleaner price overlays + clearer disabled items. */
.item .price { z-index: 6; min-height: 16px; line-height: 1.15; backdrop-filter: blur(2px); }
.item.disabled .price, .item.stock-cap-reached .price, .item.selection-cap-reached .price { opacity: 1; color: var(--accent-2); }
.item .disabled-note { max-width: calc(100% - 10px); }
.item-tip { z-index: 9999; min-width: 150px; }
.item-tip .tip-price { display: block; margin-top: 0.25rem; padding-top: 0.25rem; border-top: 1px solid var(--line); color: var(--accent-2); font-size: 0.95rem; }

/* Steam cards/emoticons can have tall/odd artwork; keep them inside the tile and let the hover tooltip carry the clean price. */
.item.st-card img { width: 78%; height: 72%; max-width: 78%; max-height: 72%; object-fit: contain; }
.item.st-card .count { z-index: 7; }
.item.st-card .price { font-size: 0.72rem; padding: 2px 3px; background: var(--scrim-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.st-card:hover .price { color: var(--text-bright); }
.tradeurl-help-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:6px; }
.tradeurl-help-row .btn-small { text-decoration:none; display:inline-flex; align-items:center; justify-content:center; }

/* ============================================================
   GIVEAWAY PRIZE CARD + UNUSUAL-STYLE EFFECTS
   ============================================================ */
.giveaway-card { overflow: hidden; }
.giveaway-hero {
  display: grid;
  grid-template-columns: minmax(170px, 260px) 1fr;
  align-items: center;
  gap: clamp(1rem, 4vw, 2rem);
}
.giveaway-copy { min-width: 0; position: relative; z-index: 3; }
.giveaway-prize-name { margin: 0.2rem 0 0.45rem; color: var(--text-bright); font-size: 1.05rem; }
.giveaway-prize-wrap {
  --effect-a: rgba(224, 195, 137, 0.92);
  --effect-b: rgba(120, 220, 255, 0.80);
  --effect-c: rgba(255, 95, 190, 0.70);
  position: relative;
  isolation: isolate;
  width: min(260px, 100%);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(224, 195, 137, 0.18), transparent 54%),
    radial-gradient(circle at 50% 60%, rgba(0, 0, 0, 0.18), transparent 66%);
}
.giveaway-prize-wrap::before,
.giveaway-prize-wrap::after {
  content: '';
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.giveaway-prize-wrap::before {
  background:
    radial-gradient(circle, var(--effect-a) 0 3px, transparent 4px),
    radial-gradient(circle, var(--effect-b) 0 2px, transparent 4px),
    radial-gradient(circle, var(--effect-c) 0 2px, transparent 4px);
  background-size: 48px 48px, 70px 70px, 92px 92px;
  filter: drop-shadow(0 0 12px var(--effect-a));
  animation: giveaway-spin 7s linear infinite;
  opacity: 0.78;
}
.giveaway-prize-wrap::after {
  inset: 16%;
  border: 1px solid color-mix(in srgb, var(--effect-a) 60%, transparent);
  box-shadow:
    0 0 26px color-mix(in srgb, var(--effect-a) 55%, transparent),
    inset 0 0 38px color-mix(in srgb, var(--effect-b) 35%, transparent);
  animation: giveaway-pulse 2.4s ease-in-out infinite;
  opacity: 0.86;
}
.giveaway-orbit {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  border: 1px dashed color-mix(in srgb, var(--effect-a) 45%, transparent);
  animation: giveaway-spin 10s linear infinite reverse;
}
.giveaway-orbit-b {
  inset: 20%;
  border-color: color-mix(in srgb, var(--effect-b) 40%, transparent);
  animation-duration: 13s;
  animation-direction: normal;
}
.giveaway-orbit-c {
  inset: -2%;
  border-style: solid;
  border-color: color-mix(in srgb, var(--effect-c) 25%, transparent);
  filter: blur(1px);
  animation-duration: 18s;
}
.giveaway-prize-img {
  position: relative;
  z-index: 2;
  width: 74%;
  height: 74%;
  object-fit: contain;
  filter:
    drop-shadow(0 14px 20px rgba(0, 0, 0, 0.42))
    drop-shadow(0 0 22px color-mix(in srgb, var(--effect-a) 52%, transparent));
  transform: translateZ(0);
}
.giveaway-prize-placeholder {
  position: relative;
  z-index: 2;
  font-size: clamp(4.2rem, 12vw, 7rem);
  line-height: 1;
  filter: drop-shadow(0 0 24px color-mix(in srgb, var(--effect-a) 60%, transparent));
}
.giveaway-effect-burning {
  --effect-a: rgba(255, 203, 77, 0.95);
  --effect-b: rgba(255, 107, 45, 0.86);
  --effect-c: rgba(255, 55, 105, 0.74);
}
.giveaway-effect-burning::before {
  animation: giveaway-float 2.2s ease-in-out infinite;
  background:
    radial-gradient(ellipse at center, var(--effect-a) 0 2px, transparent 5px),
    radial-gradient(ellipse at center, var(--effect-b) 0 3px, transparent 8px),
    radial-gradient(ellipse at center, var(--effect-c) 0 2px, transparent 7px);
  background-size: 42px 62px, 64px 88px, 88px 120px;
}
.giveaway-effect-storm {
  --effect-a: rgba(130, 220, 255, 0.94);
  --effect-b: rgba(80, 126, 255, 0.76);
  --effect-c: rgba(238, 246, 255, 0.72);
}
.giveaway-effect-storm::before {
  background:
    linear-gradient(115deg, transparent 0 44%, var(--effect-c) 45% 47%, transparent 48% 100%),
    radial-gradient(circle, var(--effect-a) 0 2px, transparent 4px),
    radial-gradient(circle, var(--effect-b) 0 2px, transparent 4px);
  background-size: 85px 85px, 58px 58px, 86px 86px;
  animation: giveaway-storm 1.7s linear infinite;
}




.giveaway-effect-mega-strike {
  --effect-a: rgba(255, 248, 100, 0.98);
  --effect-b: rgba(70, 215, 255, 0.86);
  --effect-c: rgba(255, 255, 255, 0.94);
  isolation: isolate;
  overflow: visible;
  background:
    radial-gradient(ellipse at 50% 79%, rgba(255, 247, 92, 0.22), transparent 18%),
    radial-gradient(ellipse at 50% 70%, rgba(70, 215, 255, 0.16), transparent 34%),
    radial-gradient(circle at 50% 54%, rgba(255, 255, 255, 0.10), transparent 24%),
    radial-gradient(circle at 50% 60%, rgba(0, 0, 0, 0.34), transparent 72%);
}
.giveaway-effect-mega-strike::before {
  content: '';
  position: absolute;
  inset: -42% -20% -8% -20%;
  z-index: 1;
  border-radius: 0;
  pointer-events: none;
  background: url('/img/particles/mega-strike-lightning.gif') center center / contain no-repeat;
  opacity: 0.92;
  mix-blend-mode: screen;
  filter:
    brightness(1.14)
    contrast(1.08)
    drop-shadow(0 0 5px rgba(255, 255, 255, 0.92))
    drop-shadow(0 0 18px rgba(255, 238, 70, 0.80))
    drop-shadow(0 0 34px rgba(255, 238, 70, 0.46));
  animation: giveaway-mega-gif-flash 1.34s ease-in-out infinite;
}
.giveaway-effect-mega-strike::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 3%;
  top: 56%;
  z-index: 2;
  border: 0;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 66%, rgba(255, 255, 255, 0.72) 0 4%, transparent 7%),
    radial-gradient(ellipse at 50% 70%, rgba(255, 247, 92, 0.56) 0 12%, transparent 23%),
    radial-gradient(ellipse at 50% 73%, rgba(62, 213, 255, 0.40) 0 24%, transparent 40%);
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.46),
    0 0 38px rgba(255, 241, 76, 0.38),
    inset 0 0 34px rgba(255, 246, 101, 0.32);
  mix-blend-mode: screen;
  opacity: 0.52;
  animation: giveaway-mega-ground-burst 1.34s steps(1, end) infinite;
}
.giveaway-effect-mega-strike .giveaway-prize-img {
  z-index: 3;
  opacity: 0.74;
  filter:
    drop-shadow(0 16px 22px rgba(0, 0, 0, 0.48))
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.50))
    drop-shadow(0 0 26px rgba(255, 242, 76, 0.34));
  animation: giveaway-mega-prize-shock 1.34s steps(1, end) infinite;
}
.giveaway-effect-mega-strike .giveaway-prize-placeholder {
  z-index: 3;
  opacity: 0.74;
  animation: giveaway-mega-prize-shock 1.34s steps(1, end) infinite;
}
.giveaway-effect-mega-strike .giveaway-orbit {
  display: none;
}

.giveaway-effect-purple {
  --effect-a: rgba(184, 112, 255, 0.94);
  --effect-b: rgba(255, 85, 230, 0.72);
  --effect-c: rgba(128, 255, 212, 0.60);
}
.giveaway-effect-none::before,
.giveaway-effect-none::after,
.giveaway-effect-none .giveaway-orbit { display: none; }
.giveaway-effect-none .giveaway-prize-img { filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.42)); }

@keyframes giveaway-spin {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(360deg) scale(1.03); }
}
@keyframes giveaway-pulse {
  0%, 100% { transform: scale(0.96); opacity: 0.56; }
  50% { transform: scale(1.06); opacity: 0.95; }
}
@keyframes giveaway-float {
  0%, 100% { transform: translateY(8px) scale(0.98); opacity: 0.62; }
  50% { transform: translateY(-10px) scale(1.06); opacity: 0.9; }
}
@keyframes giveaway-storm {
  0% { transform: translate3d(-4px, 3px, 0) rotate(0deg); opacity: 0.55; }
  50% { transform: translate3d(5px, -3px, 0) rotate(180deg); opacity: 0.92; }
  100% { transform: translate3d(-4px, 3px, 0) rotate(360deg); opacity: 0.55; }
}




@keyframes giveaway-mega-gif-flash {
  0%, 100% { opacity: 0.78; transform: translateY(0) scale(1); }
  28% { opacity: 0.98; transform: translateY(2px) scale(1.02); }
  46% { opacity: 0.68; transform: translateY(-1px) scale(0.995); }
  68% { opacity: 1; transform: translateY(3px) scale(1.025); }
}

@keyframes giveaway-mega-main-strike {
  0%, 5%, 13%, 24%, 42%, 63%, 100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-16px) rotate(-6deg) scaleY(0.78) scaleX(0.88);
  }
  6%, 8% {
    opacity: 1;
    transform: translateX(-50%) translateY(10px) rotate(-3deg) scaleY(1.12) scaleX(1.08);
  }
  9%, 12% {
    opacity: 0.42;
    transform: translateX(-50%) translateY(2px) rotate(2deg) scaleY(0.96) scaleX(0.92);
  }
  25%, 27% {
    opacity: 0.92;
    transform: translateX(-50%) translateY(7px) rotate(5deg) scaleY(1.04) scaleX(0.98);
  }
  43%, 45% {
    opacity: 0.74;
    transform: translateX(-50%) translateY(5px) rotate(-1deg) scaleY(1) scaleX(0.9);
  }
  64%, 66% {
    opacity: 1;
    transform: translateX(-50%) translateY(12px) rotate(3deg) scaleY(1.1) scaleX(1.02);
  }
}
@keyframes giveaway-mega-ground-burst {
  0%, 5%, 14%, 24%, 42%, 63%, 100% { opacity: 0; transform: scale(0.58); }
  6%, 8% { opacity: 1; transform: scale(1.08); }
  9%, 12% { opacity: 0.34; transform: scale(1.32); }
  25%, 27% { opacity: 0.84; transform: scale(1.02); }
  43%, 45% { opacity: 0.62; transform: scale(0.96); }
  64%, 66% { opacity: 0.96; transform: scale(1.18); }
}
@keyframes giveaway-mega-prize-shock {
  0%, 5%, 13%, 24%, 42%, 63%, 100% { transform: translateZ(0) scale(1); }
  6%, 8% { transform: translate3d(-1px, 1px, 0) scale(1.035); }
  9%, 12% { transform: translate3d(1px, -1px, 0) scale(1.012); }
  25%, 27% { transform: translate3d(1px, 0, 0) scale(1.026); }
  43%, 45% { transform: translate3d(-1px, 0, 0) scale(1.014); }
  64%, 66% { transform: translate3d(0, 1px, 0) scale(1.032); }
}
@keyframes giveaway-mega-branch-a {
  0%, 4%, 13%, 23%, 46%, 100% { opacity: 0; transform: rotate(-32deg) scale(0.72); }
  5%, 8% { opacity: 0.96; transform: translate3d(-5px, 6px, 0) rotate(-28deg) scale(1.02); }
  24%, 28% { opacity: 0.76; transform: translate3d(4px, -2px, 0) rotate(-36deg) scale(0.88); }
  47%, 50% { opacity: 0.90; transform: translate3d(-2px, 1px, 0) rotate(-30deg) scale(0.96); }
}
@keyframes giveaway-mega-branch-b {
  0%, 8%, 18%, 35%, 59%, 100% { opacity: 0; transform: rotate(34deg) scale(0.68); }
  9%, 12% { opacity: 0.86; transform: translate3d(5px, 4px, 0) rotate(38deg) scale(0.96); }
  36%, 39% { opacity: 0.98; transform: translate3d(-4px, -2px, 0) rotate(30deg) scale(1.04); }
  60%, 66% { opacity: 0.84; transform: translate3d(2px, 2px, 0) rotate(36deg) scale(0.92); }
}
@keyframes giveaway-mega-branch-c {
  0%, 5%, 20%, 40%, 62%, 100% { opacity: 0; transform: translateX(-50%) rotate(4deg) scale(0.78); }
  6%, 10% { opacity: 0.95; transform: translateX(-50%) translateY(6px) rotate(0deg) scale(1.05); }
  21%, 26% { opacity: 0.74; transform: translateX(-50%) translateY(2px) rotate(6deg) scale(0.95); }
  41%, 44% { opacity: 0.86; transform: translateX(-50%) translateY(3px) rotate(-2deg) scale(1); }
  63%, 68% { opacity: 1; transform: translateX(-50%) translateY(7px) rotate(3deg) scale(1.08); }
}

@media (max-width: 700px) {
  .giveaway-hero { grid-template-columns: 1fr; text-align: center; }
  .giveaway-prize-wrap { width: min(230px, 82vw); }
}
@media (prefers-reduced-motion: reduce) {
  .giveaway-prize-wrap::before,
  .giveaway-prize-wrap::after,
  .giveaway-orbit,
  .giveaway-effect-mega-strike .giveaway-prize-img { animation: none !important; }
}

/* Coin shop grid */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shop-item { border: 1px solid #e3e3e3; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; align-items: center; text-align: center; background: #fff; }
.shop-item-img { width: 100%; height: 90px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.shop-item-img img { max-width: 100%; max-height: 90px; }
.shop-item-name { font-size: 0.85em; font-weight: 600; min-height: 2.4em; display: flex; align-items: center; }
.shop-item-price { color: #9a6b00; font-size: 0.95em; margin: 4px 0 8px; }
.shop-item .btn-primary { width: 100%; }

/* ── Coin shop: search, filters, cart ───────────────────────────────────── */
.shop-balance-card {
  border: 1px solid #f0c36d;
  background: #fff8e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.shop-balance-number { font-size: 1.8em; font-weight: 800; color: #9a6b00; }
.shop-balance-number span:last-child { font-size: 0.6em; font-weight: 600; }
.shop-status { margin: 0 0 6px; font-weight: 700; min-height: 1.25em; }
.shop-head-row { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.shop-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin: 0 0 14px; }
.shop-search { flex: 1 1 260px; min-width: 180px; }
.shop-filter { flex: 0 1 170px; min-width: 145px; }
.shop-max-price { flex: 0 1 130px; min-width: 110px; }
.shop-check { display:inline-flex; align-items:center; gap:6px; font-weight:700; color:var(--muted); padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:var(--panel-2); white-space:nowrap; }
.shop-layout { display:grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap:14px; align-items:start; }
.shop-main-list { min-width:0; }

.shop-pagination {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin: 0 0 12px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel-2);
}
.shop-page-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.shop-page-size-label { display:flex; align-items:center; gap:7px; margin:0; }
.shop-page-size-label .shop-filter { min-width:86px; flex:0 0 auto; }
.shop-more-row { display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; margin-top:12px; }
.shop-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.shop-item { min-width:0; position:relative; gap:4px; }
.shop-item-sku { max-width:100%; color:var(--muted); font-size:0.72rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.shop-item-badges { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:4px; margin:2px 0 6px; min-height:20px; }
.shop-item-badges span { font-size:0.68rem; line-height:1; padding:4px 6px; border-radius:999px; border:1px solid var(--line); background:var(--panel-2); color:var(--muted); }
.shop-cart { position:sticky; top:86px; border:1px solid var(--line); border-radius:12px; padding:12px; background:var(--panel-2); box-shadow:0 10px 24px rgba(0,0,0,0.08); }
.shop-cart-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:10px; }
.cart-items { display:flex; flex-direction:column; gap:8px; max-height:380px; overflow:auto; padding-right:2px; }
.cart-row { display:flex; align-items:center; justify-content:space-between; gap:8px; border:1px solid var(--line); border-radius:10px; padding:7px; background:var(--panel); }
.cart-row-main { display:flex; align-items:center; gap:8px; min-width:0; }
.cart-row-main img, .cart-row-placeholder { width:38px; height:38px; object-fit:contain; flex:0 0 38px; border-radius:8px; background:rgba(0,0,0,0.04); display:grid; place-items:center; }
.cart-row-main strong { display:block; max-width:165px; font-size:0.82rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cart-row-main span { display:block; color:#9a6b00; font-weight:800; font-size:0.78rem; }
.cart-remove { width:28px; height:28px; border:1px solid var(--line); border-radius:8px; background:transparent; color:var(--muted); font-weight:900; cursor:pointer; }
.cart-remove:hover { color:#c0392b; }
.cart-summary { border-top:1px solid var(--line); margin-top:10px; padding-top:10px; display:grid; gap:6px; }
.cart-summary > div { display:flex; align-items:center; justify-content:space-between; gap:10px; color:var(--muted); }
.cart-summary strong { color:var(--text); }
#cart-checkout { width:100%; margin-top:10px; }

@media (max-width: 860px) {
  .shop-layout { grid-template-columns:1fr; }
  .shop-cart { position:static; }
  .cart-items { max-height:260px; }
}
@media (max-width: 560px) {
  .shop-toolbar > * { flex:1 1 100%; min-width:0; }
  .shop-pagination { align-items:stretch; }
  .shop-page-controls, .shop-page-size-label { width:100%; justify-content:space-between; }
  .shop-page-controls .btn-small { flex:0 0 auto; }
  #shop-page-info { text-align:center; flex:1 1 auto; }
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap:10px; }
  .shop-item-img { height:78px; }
  .shop-item-img img { max-height:78px; }
  .shop-balance-number { font-size:1.5em; }
}

/* Coin shop SKU stack/cart quantity view */
.shop-item-stock {
  position:absolute;
  top:8px;
  right:8px;
  z-index:1;
  padding:3px 7px;
  border-radius:999px;
  background:rgba(154, 107, 0, 0.12);
  border:1px solid rgba(154, 107, 0, 0.28);
  color:#8a6100;
  font-weight:900;
  font-size:0.74rem;
  line-height:1;
}
.shop-item-cartnote {
  width:100%;
  margin:0 0 4px;
  color:#1e8449;
  font-size:0.74rem;
  font-weight:800;
}
.cart-row-actions {
  display:flex;
  align-items:center;
  gap:4px;
  flex:0 0 auto;
}
.cart-qty-btn {
  width:28px;
  height:28px;
  border:1px solid var(--line);
  border-radius:8px;
  background:transparent;
  color:var(--text);
  font-weight:900;
  cursor:pointer;
}
.cart-qty-btn:hover:not(:disabled) { background:rgba(0,0,0,0.05); }
.cart-qty-btn:disabled { opacity:.45; cursor:not-allowed; }
.cart-row-main { flex:1 1 auto; }
.cart-row-main strong { max-width:145px; }
@media (max-width: 720px) {
  .cart-row-actions { gap:3px; }
  .cart-qty-btn, .cart-remove { width:30px; height:30px; }
}

/* ============================================================
   EARN PROVIDER SHOWCASE
   ============================================================ */
.earn-page { max-width: 1080px; }
.earn-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.earn-balance-card {
  border: 1px solid #f0c36d;
  background: #fff8e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.earn-balance-amount { font-size: 1.8em; font-weight: 800; color: #9a6b00; }
.earn-balance-amount span:last-child { font-size: 0.6em; font-weight: 600; }
.earn-shop-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.earn-warning-card { border: 1px solid #e0b14a; background: #fff8df; }
.earn-section-head,
.earn-wall-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.earn-provider-count {
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  padding: 0.18rem 0.7rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.earn-provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}
.earn-provider-card {
  width: 100%;
  min-height: 108px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.95rem;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  gap: 0.55rem 0.75rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.earn-provider-card:hover,
.earn-provider-card.is-active {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(0,0,0,0.16);
}
.earn-provider-card.is-active { background: linear-gradient(180deg, rgba(200,169,110,0.18), var(--bg-2)); }
.earn-provider-icon { font-size: 1.85rem; line-height: 1; }
.earn-provider-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.earn-provider-main strong {
  color: var(--text-bright);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.18rem;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.earn-provider-main small { color: var(--text-dim); font-size: 0.82rem; line-height: 1.25; }
.earn-provider-pill {
  grid-column: 1 / -1;
  justify-self: start;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.16rem 0.55rem;
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.earn-active-wall { scroll-margin-top: 90px; }
.earn-frame-wrap {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
.earn-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 720px;
  min-height: 560px;
  max-height: 76vh;
  border: 0;
  background: #fff;
}
.earn-frame-note { margin: 0.75rem 0 0; }
.earn-history-wrap { width: 100%; overflow-x: auto; }

@media (max-width: 640px) {
  .earn-page { max-width: 100%; }
  .earn-provider-grid { grid-template-columns: 1fr; }
  .earn-frame-wrap iframe { height: 640px; max-height: 72vh; }
  .earn-wall-head .btn-primary { width: 100%; justify-content: center; }
}

/* Earn referrals */
.earn-referral-card {
  border-color: rgba(200,169,110,0.28);
}
.referral-share-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
}
.referral-share-row input {
  padding: 0.72rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
}
.referral-mini-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.referral-mini-stats span {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  color: var(--text-dim);
  font-size: 0.88rem;
}
.referral-mini-stats strong { color: var(--text); }

/* Earn page two-column layout: surveys (main) + top-earners (sticky aside).
   Stacks to a single column on narrow screens so surveys always come first. */
.doc.earn-page { max-width: 1040px; }
.earn-layout { display: flex; gap: 18px; align-items: flex-start; }
.earn-main { flex: 1 1 auto; min-width: 0; }
.earn-aside { flex: 0 0 250px; width: 250px; position: sticky; top: 1rem; }
.earn-leaderboard-side { padding: 12px 14px; background: linear-gradient(160deg, rgba(241, 196, 15, 0.10), transparent); }
.earn-side-head { font-weight: 800; margin-bottom: 8px; }
.earn-side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.earn-side-list li { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; }
.earn-side-rank { width: 22px; text-align: center; flex: 0 0 auto; }
.earn-side-list img { border-radius: 3px; flex: 0 0 auto; display: block; }
.earn-side-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.earn-side-coins { color: #1e8449; white-space: nowrap; font-weight: 700; }
@media (max-width: 900px) {
  .earn-layout { flex-direction: column; }
  .earn-aside { position: static; width: 100%; flex-basis: auto; }
}

/* Compact earn page — denser cards, smaller text, minimal whitespace */
.earn-page { font-size: 0.93rem; }
.earn-page .admin-card { padding: 0.8rem 0.95rem; margin-bottom: 0.6rem; }
.earn-page .admin-card h3 { font-size: 1.05rem; }
.earn-page .admin-card > p { margin-top: 0.25rem; margin-bottom: 0.25rem; }
.earn-page .cfg-hint { font-size: 0.82rem; }
.earn-page .earn-balance-amount { font-size: 1.35em; }
.earn-page .earn-provider-grid { gap: 0.45rem; margin-top: 0.5rem; }
.earn-page .earn-provider-card { padding: 0.55rem 0.7rem; }
.earn-page .earn-provider-icon { font-size: 1.5rem; }
.earn-page .earn-provider-main small { font-size: 0.78rem; }
.earn-page .earn-frame-note { margin-top: 0.5rem; font-size: 0.78rem; }
.earn-layout { gap: 14px; }
.earn-aside { top: 0.7rem; }
.earn-leaderboard-side { padding: 0.7rem 0.85rem; }
.earn-side-list li { font-size: 0.86rem; }

/* Earn partner grid + ratings */
.earn-page .earn-provider-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(185px, 100%), 1fr));
  align-items: stretch;
}
.earn-page .earn-provider-card {
  min-height: 128px;
  grid-template-rows: auto auto 1fr;
  user-select: none;
}
.earn-page .earn-provider-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.earn-rating-row {
  grid-column: 1 / -1;
  align-self: end;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.1rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}
.earn-rating-avg {
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 700;
}
.earn-star-buttons {
  display: flex;
  gap: 1px;
  align-items: center;
}
.earn-star {
  border: 0;
  background: transparent;
  color: rgba(145, 145, 145, 0.75);
  cursor: pointer;
  padding: 0 1px;
  line-height: 1;
  font-size: 1rem;
}
.earn-star:hover,
.earn-star.is-on {
  color: #d99b20;
}
.earn-rating-msg {
  min-height: 1em;
  font-size: 0.72rem;
  font-weight: 700;
}
@media (min-width: 1180px) {
  .earn-page { max-width: 1240px; }
  .earn-page .earn-provider-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}


/* Rewarded-ad giveaway hero — bright prize pool block */
.adgiveaway-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 202, 86, 0.35);
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 202, 86, 0.26), transparent 31%),
    radial-gradient(circle at 90% 10%, rgba(99, 102, 241, 0.28), transparent 34%),
    linear-gradient(135deg, rgba(18, 24, 38, 0.96), rgba(27, 32, 52, 0.96) 45%, rgba(48, 31, 76, 0.96));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255,255,255,0.09);
  color: #fff;
}
.adgiveaway-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.08) 38%, transparent 58%);
  transform: translateX(-130%);
  animation: adgShine 5.5s ease-in-out infinite;
  pointer-events: none;
}
.adgiveaway-glow {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  filter: blur(28px);
  opacity: 0.46;
  pointer-events: none;
}
.adgiveaway-glow-a { right: -55px; top: -55px; background: #f59e0b; }
.adgiveaway-glow-b { left: -60px; bottom: -70px; background: #7c3aed; }
.adgiveaway-topline,
.adgiveaway-mainrow,
.adgiveaway-stats,
.adgiveaway-progress-wrap,
.adgiveaway-actions,
.adgiveaway-note,
.adgiveaway-alert {
  position: relative;
  z-index: 1;
}
.adgiveaway-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.adgiveaway-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.11);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fde68a;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.adgiveaway-countdown-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.16);
  color: #dbeafe;
  font-weight: 800;
}
.adgiveaway-countdown-chip strong { color: #fff; }
.adgiveaway-mainrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
}
.adgiveaway-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 2.1rem);
  letter-spacing: -0.035em;
}
.adgiveaway-copy {
  margin: 0.4rem 0 0;
  max-width: 620px;
  color: rgba(255,255,255,0.82);
  font-size: 0.95rem;
}
.adgiveaway-copy strong { color: #fde68a; }
.adgiveaway-prizebox {
  min-width: 150px;
  padding: 0.8rem 1rem;
  border-radius: 1.1rem;
  text-align: center;
  background: linear-gradient(180deg, #fff7ad, #f59e0b 78%);
  color: #251400;
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.34), inset 0 1px 0 rgba(255,255,255,0.7);
  transform: rotate(1deg);
}
.adgiveaway-prizebox span,
.adgiveaway-prizebox small {
  display: block;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  opacity: 0.76;
}
.adgiveaway-prizebox strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
  margin: 0.15rem 0;
  font-weight: 1000;
}
.adgiveaway-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 0.55rem;
  margin-top: 1rem;
}
.adgiveaway-stat {
  padding: 0.65rem 0.75rem;
  border-radius: 0.9rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
}
.adgiveaway-stat span {
  display: block;
  color: rgba(255,255,255,0.68);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.adgiveaway-stat strong {
  display: block;
  margin-top: 0.16rem;
  color: #fff;
  font-size: 1.22rem;
}
.adgiveaway-progress-wrap {
  margin-top: 0.9rem;
  padding: 0.75rem;
  border-radius: 0.95rem;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.13);
}
.adgiveaway-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.42rem;
  color: rgba(255,255,255,0.78);
  font-weight: 800;
  font-size: 0.8rem;
}
.adgiveaway-progress-head strong { color: #fde68a; }
.adgiveaway-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.13);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.35);
}
.adgiveaway-progress-fill {
  width: var(--adg-progress, 0%);
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #fde047, #f97316);
  box-shadow: 0 0 18px rgba(253, 224, 71, 0.46);
  transition: width 0.35s ease;
}
.adgiveaway-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.95rem;
}
.adgiveaway-btn {
  min-height: 42px;
  padding-inline: 1.1rem;
  background: linear-gradient(135deg, #22c55e, #16a34a 45%, #0891b2) !important;
  border: 0 !important;
  color: white !important;
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.28);
}
.adgiveaway-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(34, 197, 94, 0.35);
}
.adgiveaway-msg {
  margin: 0;
  color: #d1fae5;
  font-weight: 800;
}
.adgiveaway-note {
  margin: 0.65rem 0 0;
  color: rgba(255,255,255,0.6);
  font-size: 0.78rem;
}
.adgiveaway-alert {
  margin: 0.8rem 0 0;
  padding: 0.62rem 0.75rem;
  border-radius: 0.85rem;
  background: rgba(248, 113, 113, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #fecaca;
  font-weight: 800;
}
@keyframes adgShine {
  0%, 62% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}
@media (max-width: 720px) {
  .adgiveaway-mainrow { grid-template-columns: 1fr; }
  .adgiveaway-prizebox { width: 100%; min-width: 0; transform: none; }
  .adgiveaway-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .adgiveaway-stats { grid-template-columns: 1fr; }
  .adgiveaway-actions .adgiveaway-btn { width: 100%; }
}
