/* =============================================================================
 *  store.css  —  theme styling (matches the StablePvP look)
 *  Edit the colour variables in :root to re-skin the whole store.
 * ========================================================================== */

:root {
  --bg-top:      #1a1a1a;
  --bg-bottom:   #141414;
  --panel:       #232323;
  --panel-2:     #2c2c2c;
  --panel-3:     #1c1c1c;
  --panel-line:  rgba(255,255,255,.06);

  --purple:      #9b59d9;
  --purple-2:    #7d3fc4;
  --purple-glow: rgba(155,89,217,.45);
  --cat-a:       #2c1550;   /* category card gradient (light) */
  --cat-b:       #180b30;   /* category card gradient (dark)  */
  --cat-line:    rgba(155,89,217,.35);

  --green:       #8aef5b;
  --green-2:     #5fce34;

  --text:        #ffffff;
  --muted:       #a7a7b4;
  --muted-2:     #7c7c88;
  --strike:      #8b8b96;

  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 10px 30px rgba(0,0,0,.35);
  --wrap:        1180px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(var(--bg-top) 0%, var(--bg-bottom) 100%) fixed;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------- top nav ------------------------------------------------------ */
#topbar { display: block; padding: 16px 0 8px; }
.topbar-inner { position: relative; display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 50px; }
.topbar-inner .back { color: var(--muted); font-weight: 600; font-size: 14px; }
.topbar-inner .back:hover { color: #fff; }
.topbar-inner .brand {
  /* sit centred on the BOTTOM edge of the bar: top half on the bar, bottom half hanging below */
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, -50%);
  z-index: 6; font-weight: 800; letter-spacing: .3px; display: flex; align-items: center; gap: 8px;
}
.topbar-inner .brand img { height: 26px; width: auto; }
.topbar-inner .brand .brand-logo { height: 92px; width: auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.55)); }
/* Wide wordmark banner. The source PNG is 16:9 with a lot of empty space above
   and below the lettering, so we crop the box to the wordmark (object-fit) —
   otherwise it would tower over the bar and get clipped at the top. */
.topbar-inner .brand .brand-banner {
  width: 300px; aspect-ratio: 2.5 / 1; height: auto;
  object-fit: cover; object-position: center;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.55));
}
/* the square logo is only a stand-in for narrow screens when a banner is set */
.topbar-inner .brand .brand-alt { display: none; }
@media (max-width: 720px) {
  .topbar-inner .brand .brand-logo { height: 66px; }
  .topbar-inner .brand .brand-banner { width: 220px; }
}
.topnav { display: flex; gap: 20px; align-items: center; }
.topnav a { color: #e9e9ef; font-weight: 600; font-size: 14px; }
.topnav a:hover { color: var(--purple); }
.cur-switch { display: inline-flex; border: 1px solid var(--panel-line); border-radius: 8px; overflow: hidden; }
.cur-switch .cur-btn {
  background: transparent; color: var(--muted); border: none; cursor: pointer;
  padding: 6px 11px; font-size: 12px; font-weight: 700; font-family: inherit;
  transition: background .12s ease, color .12s ease;
}
.cur-switch .cur-btn.active { background: var(--purple); color: #fff; }
.cur-switch .cur-btn:not(.active):hover { color: #fff; }
.cart-cur-note { padding: 10px 16px 4px; color: var(--muted-2); font-size: 12px; }
.cart-cur-note .fa { color: var(--purple); margin-right: 5px; }
.cart-item.ci-owned { opacity: .6; }
.ci-owned-tag { color: #ff9b6b; font-weight: 700; font-size: 12px; }
.cart-warn { color: #ffb4b4; font-size: 13px; text-align: center; margin: 12px 0 0; }
.cart-warn .fa { margin-right: 6px; }

/* ---------- generic panel ------------------------------------------------ */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- welcome header panel ---------------------------------------- */
.welcome {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 22px; margin-top: 8px;
}
.welcome .logo {
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  display: grid; place-items: center; font-size: 22px; color: #fff;
  box-shadow: 0 6px 18px var(--purple-glow); overflow: hidden; flex: 0 0 auto;
}
.welcome .logo img { width: 100%; height: 100%; object-fit: cover; }
.welcome .logo.copy-ip { border: none; cursor: pointer; transition: transform .08s ease, filter .15s ease; }
.welcome .logo.copy-ip:hover { filter: brightness(1.08); }
.welcome .logo.copy-ip:active { transform: translateY(1px); }
.welcome .titles h1 { margin: 0; font-size: 22px; font-weight: 800; }
.welcome .titles p  { margin: 2px 0 0; color: var(--purple); font-weight: 600; }
.welcome .actions { margin-left: auto; display: flex; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: none; border-radius: var(--radius-sm); padding: 11px 18px;
  font-weight: 700; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  transition: transform .08s ease, filter .15s ease; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.green { background: linear-gradient(135deg, var(--green), var(--green-2)); color: #10240a; }
.btn.ghost { background: var(--panel-2); }
.btn .badge {
  background: #fff; color: var(--purple-2); font-size: 11px; font-weight: 800;
  border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-grid; place-items: center;
}

/* ---------- sale banner -------------------------------------------------- */
.sale {
  margin-top: 16px; padding: 20px 22px; position: relative; overflow: hidden;
  /* Symmetric grid: equal 1fr sides keep the headline (and the accent under it)
     dead-centre regardless of the tag/countdown widths. */
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
}
.sale .tag {
  justify-self: start;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #10240a; font-weight: 900; font-size: 22px; letter-spacing: .5px;
  padding: 12px 20px; border-radius: 12px; transform: rotate(-1deg);
  box-shadow: 0 8px 22px rgba(138,239,91,.25);
}
.sale .headline {
  text-align: center; font-size: 28px; font-weight: 900; letter-spacing: .5px;
}
.sale .accent {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 80px; height: 4px; border-radius: 4px 4px 0 0;
  background: linear-gradient(90deg, var(--green), var(--green-2));
}
.sale .countdown { justify-self: end; }
@media (max-width: 640px) {
  .sale { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .sale .tag, .sale .countdown { justify-self: center; }
  .sale .accent { display: none; }
}
.countdown { display: flex; gap: 8px; }
.countdown .cell {
  background: var(--panel-2); border-radius: 10px; padding: 8px 12px; min-width: 54px;
  text-align: center;
}
.countdown .num { font-size: 24px; font-weight: 800; line-height: 1; }
.countdown .lbl { font-size: 10px; color: var(--muted); letter-spacing: 1px; margin-top: 4px; }

/* ---------- main + sidebar layout --------------------------------------- */
.layout {
  margin-top: 18px; display: grid; grid-template-columns: 1fr 300px; gap: 18px;
  align-items: start;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
/* allow inner scroll containers (rank table) to scroll instead of stretching the column */
.layout > * { min-width: 0; }

.section-title {
  font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin: 4px 2px 12px;
}

/* ---------- category cards (homepage) ----------------------------------- */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .cat-grid { grid-template-columns: 1fr; } }

.cat-card {
  position: relative; overflow: hidden; cursor: pointer;
  border-radius: 14px; padding: 30px 26px; min-height: 130px;
  background: linear-gradient(135deg, var(--cat-a), var(--cat-b));
  border: 1px solid var(--cat-line);
  display: flex; align-items: center; justify-content: space-between;
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.cat-card::before {
  content: ""; position: absolute; left: -40px; top: 50%; transform: translateY(-50%);
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,0,0,.35), transparent 70%);
}
.cat-card:hover { transform: translateY(-3px); border-color: var(--purple); box-shadow: 0 14px 34px rgba(0,0,0,.4); }
.cat-card .cat-text { position: relative; z-index: 1; }
.cat-card h3 { margin: 0; font-size: 26px; font-weight: 800; text-transform: uppercase; }
.cat-card .view { color: #cbb6ef; font-weight: 600; margin-top: 4px; }
.cat-card .cat-img {
  position: relative; z-index: 1; width: 120px; height: 100px;
  display: grid; place-items: center;
}
.cat-card .cat-img img { max-height: 100px; width: auto; filter: drop-shadow(0 8px 14px rgba(0,0,0,.5)); }
.cat-card .cat-img .fa { font-size: 52px; color: #d8c6f5; opacity: .85; }

/* ---------- product cards ----------------------------------------------- */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.prod {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.prod:hover { transform: translateY(-3px); border-color: rgba(155,89,217,.5); box-shadow: 0 14px 30px rgba(0,0,0,.4); }
.prod .thumb {
  position: relative; height: 150px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #2a1550, #191919 70%);
}
.prod .thumb img { max-height: 108px; width: auto; filter: drop-shadow(0 8px 14px rgba(0,0,0,.5)); }
.prod .thumb .fa { font-size: 46px; color: #c9b4ef; }
.prod .sale-flag {
  position: absolute; top: 10px; right: 10px; background: linear-gradient(135deg,var(--green),var(--green-2));
  color: #10240a; font-weight: 800; font-size: 12px; padding: 3px 8px; border-radius: 8px;
}
/* rank-upgrade credit: own badge, top-LEFT, arrow + amount */
.upgrade-flag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  color: #fff; font-weight: 800; font-size: 12px; padding: 3px 9px; border-radius: 8px;
  box-shadow: 0 4px 12px rgba(155,89,217,.35); white-space: nowrap;
}
.prod .body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.prod .name { font-weight: 700; font-size: 15px; }
.prod .price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.prod .price .now { font-size: 18px; font-weight: 800; }
/* struck-through "before" price — applies everywhere (cards, cart, modal) */
.was { color: var(--strike); text-decoration: line-through; font-size: 13px; }
.prod .price .was { font-size: 13px; }
.prod .price .sub { color: var(--muted-2); font-size: 12px; }
.prod .add { width: 100%; justify-content: center; }
/* ---------- quantity slider card ---------------------------------------- */
.slider-card .body { gap: 8px; }
/* marks are absolutely placed at their real value position (set inline by app.js) */
.sl-marks { position: relative; height: 14px; font-size: 11px; font-weight: 700; color: var(--muted-2); }
.sl-marks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.sl-range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 999px;
  background: var(--panel-3); outline: none; cursor: pointer; margin: 2px 0;
}
.sl-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--purple); border: 2px solid #fff2; cursor: grab;
  box-shadow: 0 2px 8px rgba(155,89,217,.5);
}
.sl-range::-moz-range-thumb {
  width: 16px; height: 16px; border: 2px solid #fff2; border-radius: 50%;
  background: var(--purple); cursor: grab; box-shadow: 0 2px 8px rgba(155,89,217,.5);
}
.sl-range:active::-webkit-slider-thumb { cursor: grabbing; }
.sl-amount { text-align: center; font-weight: 800; font-size: 13px; color: var(--purple); }

.prod-actions { display: flex; gap: 8px; align-items: stretch; }
.prod-actions .add { flex: 1; width: auto; }
.prod-info {
  flex: 0 0 auto; border: none; cursor: pointer; border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #7fd957, #5cc23a); color: #123006;
  padding: 0 15px; font-size: 15px; font-weight: 800; display: grid; place-items: center;
  transition: filter .12s ease;
}
.prod-info:hover { filter: brightness(1.08); }
.prod-info:active { transform: translateY(1px); }

/* already-owned buy buttons (disabled) */
.is-owned, .is-owned:hover {
  background: #333 !important; color: var(--muted-2) !important;
  cursor: not-allowed !important; box-shadow: none !important; filter: none !important;
  transform: none !important;
}
/* brief state while we're still fetching the player's owned packages */
.is-checking { opacity: .55 !important; cursor: progress !important; filter: none !important; transform: none !important; }
/* item already in the cart -> button locked (no message) */
.in-cart, .in-cart:hover {
  background: #2b3b2b !important; color: #a9c9a9 !important;
  cursor: default !important; box-shadow: none !important; filter: none !important; transform: none !important;
}

/* ---------- sidebar modules --------------------------------------------- */
.module { padding: 16px 16px 18px; margin-bottom: 16px; }
.module .m-title {
  display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin-bottom: 12px;
}
.module .m-title .fa { color: var(--purple); }
.module .empty { color: var(--muted); font-size: 13px; }
.goal-bar { height: 12px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.goal-bar > span { display: block; height: 100%; background: linear-gradient(90deg,var(--purple),var(--purple-2)); }
.goal-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.pay-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.pay-row img { width: 30px; height: 30px; border-radius: 6px; }
.pay-row .pn { font-size: 13px; font-weight: 600; }
.pay-row .pay-amt { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--green); white-space: nowrap; }
.top-cust { display: flex; align-items: center; gap: 12px; }
.top-cust img { width: 40px; height: 40px; border-radius: 8px; }

/* ---------- cart --------------------------------------------------------- */
.cart-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--panel-line); }
.cart-item:last-child { border-bottom: none; }
.cart-item .ci-img { width: 56px; height: 56px; border-radius: 10px; background: #1f1338; display: grid; place-items: center; }
.cart-item .ci-img img { max-height: 46px; }
.cart-item .ci-img .fa { color: #c9b4ef; font-size: 22px; }
.cart-item .ci-name { font-weight: 700; }
.cart-item .ci-price { color: var(--muted); font-size: 13px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--panel-line); border-radius: 8px; overflow: hidden; }
.qty button { background: var(--panel-2); color: #fff; border: none; width: 30px; height: 30px; cursor: pointer; font-size: 16px; }
.qty span { min-width: 34px; text-align: center; }
.cart-item .ci-remove { color: var(--muted-2); cursor: pointer; background: none; border: none; font-size: 16px; }
.cart-item .ci-remove:hover { color: #ff6b6b; }
.cart-summary { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px; }
.cart-summary .total { font-size: 20px; font-weight: 800; }

/* ---------- username field ---------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field input {
  background: var(--panel-3); border: 1px solid var(--panel-line); border-radius: 10px;
  color: #fff; padding: 12px 14px; font-size: 15px; font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--purple); }

/* ---------- login page --------------------------------------------------- */
.login-panel { padding: 44px 30px; margin-top: 18px; text-align: center; }
.login-title { font-size: 30px; font-weight: 900; letter-spacing: .5px; margin: 0 0 10px; }
.login-sub { color: var(--muted); max-width: 520px; margin: 0 auto 26px; }
.platform-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 620px; margin: 0 auto 18px; }
.pf-btn {
  padding: 20px; border-radius: 12px; background: var(--panel-3); border: 1px solid var(--panel-line);
  color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: border-color .15s ease, background .15s ease;
}
.pf-btn:hover { border-color: var(--purple); }
.pf-btn.active { background: var(--panel-2); border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple) inset; }
.pf-btn .fa { color: var(--purple); }
.login-row { display: flex; gap: 12px; max-width: 620px; margin: 0 auto; }
.login-row input {
  flex: 1; background: var(--panel-3); border: 1px solid var(--panel-line); border-radius: 10px;
  color: #fff; padding: 14px 16px; font-size: 15px; font-family: inherit;
}
.login-row input:focus { outline: none; border-color: var(--purple); }
.login-row .btn { padding: 14px 26px; }
@media (max-width: 560px) { .login-row { flex-direction: column; } .platform-toggle { grid-template-columns: 1fr; } }

/* logged-in account line in the cart */
.cart-account { color: var(--muted); font-size: 14px; }
.cart-account strong { color: #fff; }
.pf-badge {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .3px;
  background: var(--panel-3); border: 1px solid var(--panel-line); color: #cbb6ef;
  padding: 2px 8px; border-radius: 999px; vertical-align: middle;
}
.linklike { background: none; border: none; color: var(--purple); cursor: pointer; font: inherit; padding: 0; }
.linklike:hover { text-decoration: underline; }

/* ---------- modal -------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 100; padding: 20px;
}
.modal { width: 100%; max-width: 420px; padding: 24px; }
.modal h2 { margin: 0 0 6px; font-size: 20px; }
.modal p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.modal .modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal .modal-actions .btn { flex: 1; justify-content: center; }

/* ---------- toast -------------------------------------------------------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--panel-2); border: 1px solid var(--panel-line); color: #fff;
  padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); animation: toastin .2s ease;
}
.toast.err { border-color: #ff6b6b; }
.toast.ok  { border-color: var(--green-2); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ---------- states ------------------------------------------------------- */
.loading, .error-box { text-align: center; padding: 60px 20px; color: var(--muted); }
.error-box { color: #ffb4b4; }
.spinner {
  width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--purple); border-radius: 50%; margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- footer ------------------------------------------------------- */
.footer { margin-top: 40px; padding: 34px 0 0; border-top: 1px solid var(--panel-line); }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
@media (max-width: 800px) { .footer-cols { grid-template-columns: 1fr; } }
.footer h4 { margin: 0 0 10px; font-size: 17px; }
.footer p { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.ip-btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.socials { display: flex; gap: 10px; }
.socials a {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--green), var(--green-2)); color: #10240a; font-size: 16px;
}
.footer-bottom {
  margin-top: 26px; padding: 16px 0; border-top: 1px solid var(--panel-line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--muted-2); font-size: 12px;
}
.footer-bottom strong { color: #fff; font-weight: 700; }
.footer-legal { display: flex; gap: 18px; color: var(--muted-2); font-size: 12px; padding: 10px 0 26px; }
.footer-legal a:hover { color: #fff; }

.upgrade-hint {
  background: var(--panel); border: 1px solid var(--panel-line); border-left: 3px solid var(--purple);
  border-radius: 10px; padding: 11px 14px; margin: 0 0 14px; color: var(--muted); font-size: 13px;
}
.upgrade-hint .fa { color: var(--purple); margin-right: 6px; }
.upgrade-hint a { color: var(--purple); font-weight: 700; }
.upgrade-hint a:hover { text-decoration: underline; }

.crumbs { color: var(--muted); font-size: 13px; margin: 2px 0 14px; }
.crumbs a:hover { color: #fff; }
.crumbs .sep { margin: 0 8px; opacity: .5; }

/* ---------- rank comparison table --------------------------------------- */
.rank-table {
  --rt-blue: #3a78f0; --rt-blue-2: #2f63d6;
  --rt-magenta: #d94ff0; --rt-magenta-2: #b93be0;
  --rt-info: #7fd957; --rt-info-2: #5cc23a;
  --rt-buy: #4db4ff; --rt-buy-2: #2f9bea;
  --rt-ok: #43c04a; --rt-no: #e0524f;
  margin-top: 28px;
}
.rt-title {
  background: linear-gradient(180deg, var(--rt-blue), var(--rt-blue-2));
  color: #fff; font-weight: 800; font-size: 20px; text-align: center;
  padding: 14px; border-radius: 12px; letter-spacing: .3px;
  box-shadow: 0 8px 22px rgba(58,120,240,.25);
}
.rt-scroll { overflow-x: auto; margin-top: 14px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.rt-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1.5fr) repeat(var(--rt-cols, 5), minmax(112px, 1fr));
  min-width: calc(160px + var(--rt-cols, 5) * 116px);
  border-radius: 12px; overflow: hidden;
  background: var(--panel-3); border: 1px solid var(--panel-line);
}

/* row 1: features card + rank headers (auto-placed in DOM order) */
.rt-features {
  margin: 12px; border-radius: 12px;
  background: linear-gradient(160deg, var(--rt-magenta), var(--rt-magenta-2));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px 10px; min-height: 150px;
}
.rt-star { font-size: 40px; color: rgba(40,10,60,.85); }
.rt-features-label { font-weight: 900; letter-spacing: 1px; color: #2a0a3e; font-size: 15px; }
.rt-rank { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px; text-align: center; }
.rt-icon { height: 56px; display: grid; place-items: center; }
.rt-icon img { max-height: 56px; width: auto; }
.rt-icon .fa { font-size: 32px; color: #c9b4ef; }
.rt-rname { font-weight: 800; font-size: 15px; }
.rt-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; justify-content: center; }
.rt-price .now { font-size: 14px; font-weight: 800; color: var(--green); }
.rt-price .was { font-size: 12px; color: #e06a6a; text-decoration: line-through; }
.rt-actions { display: flex; gap: 6px; margin-top: 4px; }
.rt-info, .rt-buy { border: none; cursor: pointer; border-radius: 8px; padding: 7px 13px; font-size: 13px; display: inline-grid; place-items: center; transition: filter .12s ease; }
.rt-info { background: linear-gradient(180deg, var(--rt-info), var(--rt-info-2)); color: #123006; }
.rt-buy { background: linear-gradient(180deg, var(--rt-buy), var(--rt-buy-2)); color: #06263f; }
.rt-info:hover, .rt-buy:hover { filter: brightness(1.08); }

/* comparison rows */
.rt-cell { padding: 12px 14px; display: flex; align-items: center; background: var(--panel); }
.rt-cell.rt-alt { background: var(--panel-3); }
.rt-label { font-weight: 700; font-size: 13px; background: var(--panel-2); }
.rt-label.rt-alt { background: #262626; }
.rt-inforow { background: var(--panel-2); }
.rt-head { justify-content: center; font-weight: 700; font-size: 13px; color: var(--muted); background: var(--panel); }
.rt-val { justify-content: center; }
.rt-q { color: var(--muted-2); font-size: 12px; cursor: help; }
.rt-check, .rt-cross { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: 13px; }
.rt-check { background: var(--rt-ok); }
.rt-cross { background: var(--rt-no); }
.rt-text { font-weight: 700; font-size: 13px; color: var(--text); text-align: center; }

/* info modal */
.rt-modal { max-width: 460px; text-align: left; }
.rt-modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rt-modal-head img { width: 44px; height: 44px; object-fit: contain; }

/* Image quality: real artwork is smoothed (default), only genuinely tiny
   Minecraft textures get the crisp "pixelated" treatment. The .px-art class is
   added automatically by app.js based on the image's real resolution. */
.px-art { image-rendering: pixelated; image-rendering: crisp-edges; }
.rt-modal-head h2 { margin: 0; }
.rt-modal-body { color: var(--muted); font-size: 14px; max-height: 320px; overflow-y: auto; padding-right: 10px; }
.rt-modal-body :is(h1,h2,h3,h4) { color: #fff; }
.rt-modal-price { margin-top: 14px; font-size: 18px; }
.rt-modal-price .now { font-weight: 800; }
.rt-modal-price .was { color: var(--strike); text-decoration: line-through; margin-left: 8px; font-size: 14px; }

/* ---------- scrollbars (item info + rank table) -------------------------- */
/* Firefox */
.rt-modal-body, .rt-scroll { scrollbar-width: thin; scrollbar-color: var(--purple) transparent; }
/* Chrome / Edge / Safari */
.rt-modal-body::-webkit-scrollbar,
.rt-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.rt-modal-body::-webkit-scrollbar-track,
.rt-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,.05); border-radius: 999px; }
.rt-modal-body::-webkit-scrollbar-thumb,
.rt-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--purple), var(--purple-2));
  border-radius: 999px;
}
.rt-modal-body::-webkit-scrollbar-thumb:hover,
.rt-scroll::-webkit-scrollbar-thumb:hover { background: var(--purple); }
.rt-modal-body::-webkit-scrollbar-corner,
.rt-scroll::-webkit-scrollbar-corner { background: transparent; }

/* =============================================================================
 *  MOBILE
 * ========================================================================== */
@media (max-width: 640px) {
  .wrap { padding: 0 14px; }

  /* Header: keep the straddling logo, just a bit smaller on phones. */
  .topbar-inner { gap: 10px; min-height: 46px; }
  /* no room for the wide banner between the nav links → use the square logo */
  .topbar-inner .brand .brand-banner { display: none; }
  .topbar-inner .brand .brand-alt { display: block; }
  .topbar-inner .brand .brand-logo { height: 52px; }
  /* tighten the nav so the centred logo has room */
  .topnav { gap: 12px; }
  .topnav a { font-size: 13px; }
  .cur-switch .cur-btn { padding: 5px 8px; font-size: 11px; }

  /* Welcome panel: title row, then full-width Login / Cart. */
  .welcome { flex-wrap: wrap; padding: 16px; gap: 14px; }
  .welcome .logo { width: 48px; height: 48px; }
  .welcome .titles h1 { font-size: 19px; }
  .welcome .actions { margin-left: 0; width: 100%; }
  .welcome .actions .btn { flex: 1; justify-content: center; }

  /* Sale banner. */
  .sale { padding: 16px; }
  .sale .headline { font-size: 21px; }
  .sale .tag { font-size: 17px; padding: 9px 14px; }
  .countdown .cell { min-width: 46px; padding: 7px 8px; }
  .countdown .num { font-size: 20px; }

  /* Category cards. */
  .cat-card { padding: 20px 18px; min-height: 104px; }
  .cat-card h3 { font-size: 21px; }
  .cat-card .cat-img { width: 84px; height: 78px; }
  .cat-card .cat-img img { max-height: 78px; }

  /* Product cards a touch tighter. */
  .prod-grid { gap: 12px; }
}

@media (max-width: 480px) {
  /* Cart rows wrap cleanly instead of squeezing off-screen. */
  .cart-item { flex-wrap: wrap; row-gap: 10px; }
  .cart-item .ci-img { width: 46px; height: 46px; }
  .cart-item .qty button { width: 34px; height: 34px; }
  .footer { padding-top: 26px; }
  .footer-legal { flex-direction: column; gap: 6px; }
}

@media (max-width: 400px) {
  /* Save space on very small phones: arrow only. */
  .back-label { display: none; }
  .topnav { gap: 10px; }
}
