/* Everforge store
   Built from Minecraft's own interface grammar: bevelled GUI panels, inset item slots,
   purple item tooltips and colour codes, in the colours of a forge. */

@font-face {
  font-family: 'Minecraft';
  src: url('/fonts/minecraft.woff2') format('woff2'), url('/fonts/minecraft.woff') format('woff');
  font-display: swap;
}

:root {
  --blackstone: #1f1714;
  --basalt: #2e231e;
  --basalt-2: #382b24;
  --bevel-hi: #4d3b31;
  --bevel-lo: #150e0b;
  --soot: #0d0806;
  --molten: #ff8a1e;
  --molten-hi: #ffc070;
  --ember: #b8460c;
  --ember-deep: #6e2306;
  --glow: #ffd84a;
  --bone: #f3e6d5;
  --ash: #b9a595;
  --mc-green: #55ff55;
  --mc-red: #ff5555;
  --mc-yellow: #ffff55;
  --mc-blue: #5555ff;
  --tip-bg: rgba(16, 0, 16, 0.94);
  --tip-a: #5000ff;
  --tip-b: #28007f;
  --shadow: rgba(0, 0, 0, 0.5);
  --px: 2px; /* one Minecraft pixel at 16px type */
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--blackstone);
  background-image: url('/img/blackstone.svg');
  background-size: 128px 128px;
  image-rendering: pixelated;
  color: var(--bone);
  font-family: 'Minecraft', ui-monospace, 'Courier New', monospace;
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

img { image-rendering: pixelated; }

h1, h2, h3, p { margin: 0; font-weight: normal; }

a { color: var(--glow); text-underline-offset: 4px; }
a:hover { color: #fff; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: var(--px) solid #fff;
  outline-offset: var(--px);
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 50;
  padding: 8px 16px;
  background: var(--molten);
  color: #000;
}
.skip:focus { top: 16px; }

/* Text shadow the way Minecraft draws it: one pixel down-right in a dark tone. */
.mc-shadow, h1, h2, .btn, .price, .wm, .catbar a {
  text-shadow: var(--px) var(--px) 0 var(--shadow);
}

/* Formatting codes */
.mc-line { display: block; }
.mc-b { text-shadow: 0.125em 0 0 currentColor, var(--px) var(--px) 0 var(--shadow), calc(var(--px) * 2) var(--px) 0 var(--shadow); letter-spacing: 0.125em; }
.mc-i { font-style: italic; }
.mc-u { text-decoration: underline; text-underline-offset: 4px; }
.mc-s { text-decoration: line-through; }
.inline-mc .mc-line { display: inline; }

/* ---------- Bevels ---------- */

.panel {
  background: var(--basalt);
  border: var(--px) solid var(--soot);
  box-shadow: inset var(--px) var(--px) 0 var(--bevel-hi), inset calc(var(--px) * -1) calc(var(--px) * -1) 0 var(--bevel-lo);
  padding: 20px;
}
.panel > h2 { font-size: 16px; color: var(--glow); margin-bottom: 16px; }

.slot {
  display: grid;
  place-items: center;
  background: #1a120f;
  box-shadow: inset var(--px) var(--px) 0 var(--soot), inset calc(var(--px) * -1) calc(var(--px) * -1) 0 var(--bevel-hi);
}

/* Minecraft-style button, recoloured. */
.btn {
  --face: var(--molten);
  --hi: var(--molten-hi);
  --lo: var(--ember);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px 10px;
  background: var(--face);
  color: #fff;
  border: var(--px) solid #000;
  box-shadow: inset var(--px) var(--px) 0 var(--hi), inset calc(var(--px) * -1) calc(var(--px) * -2) 0 var(--lo);
  text-decoration: none;
  text-shadow: var(--px) var(--px) 0 var(--ember-deep);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.btn:hover { --face: #ff9c3d; border-color: #fff; color: #fff; }
.btn:active {
  box-shadow: inset var(--px) calc(var(--px) * 2) 0 var(--lo);
  padding-top: 10px;
  padding-bottom: 8px;
}
.btn[disabled], .btn[aria-disabled='true'] {
  --face: #4a3d36;
  --hi: #5c4d44;
  --lo: #2b221d;
  color: #8f8078;
  text-shadow: none;
  cursor: not-allowed;
  border-color: #000;
}
.btn-stone {
  --face: #514038;
  --hi: #73605a;
  --lo: #2c201b;
  text-shadow: var(--px) var(--px) 0 #1a110d;
}
.btn-stone:hover { --face: #5f4c42; }
.btn-block { width: 100%; }
.btn-small { min-height: 36px; padding: 4px 12px 6px; }
.btn-small:active { padding-top: 6px; padding-bottom: 4px; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--glow);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.link-btn:hover { color: #fff; }

.field {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  background: #000;
  border: var(--px) solid #a0a0a0;
  color: #fff;
  caret-color: var(--glow);
}
.field:focus { border-color: #fff; outline: none; }
.field::placeholder { color: #7d7068; }
.field[aria-invalid='true'] { border-color: var(--mc-red); }

/* ---------- Header ---------- */

/* One row on the content grid: server IP left, logo centre, currency and basket right. */
.site-header {
  background:
    radial-gradient(ellipse 34% 120% at 50% 100%, rgba(255, 122, 26, 0.2), transparent 70%),
    rgba(20, 13, 10, 0.55);
}
/* A strip of molten pixels where the header meets the categories. */
.site-header::after {
  content: '';
  display: block;
  height: 8px;
  background:
    repeating-linear-gradient(90deg,
      #ff8a1e 0 20px, #ffb02e 20px 28px, #e0560f 28px 44px, #ff8a1e 44px 52px,
      #ffc94a 52px 60px, #c8440c 60px 76px, #ff9b2e 76px 92px, #e86a14 92px 100px);
}
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px 20px;
}
.header-inner > .ip { justify-self: start; }
.header-inner > .top-actions { justify-self: end; }

.ip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.45);
  border: var(--px) solid transparent;
  cursor: pointer;
  text-align: left;
}
.ip:hover { border-color: #fff; }
.ip-text { display: grid; }
.ip-address { color: #fff; }
.ip-sub { color: var(--ash); }
.ip.copied .ip-sub { color: var(--mc-green); }

/* The server list's signal bars */
.signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; flex: none; }
.signal i { display: block; width: 4px; background: #3a3a3a; }
.signal i:nth-child(1) { height: 4px; }
.signal i:nth-child(2) { height: 7px; }
.signal i:nth-child(3) { height: 10px; }
.signal i:nth-child(4) { height: 13px; }
.signal i:nth-child(5) { height: 16px; }
.signal.on i { background: var(--mc-green); box-shadow: 1px 1px 0 #105010; }
.signal.off i { background: var(--mc-red); }

.top-actions { display: flex; align-items: center; gap: 8px; }

/* Currency picker, styled as a stone button with a pixel arrow */
.currency {
  appearance: none;
  min-height: 44px;
  padding: 8px 34px 10px 14px;
  background-color: #514038;
  background-image:
    linear-gradient(45deg, transparent 50%, #fff 50%),
    linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: right 18px top 52%, right 12px top 52%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  border: var(--px) solid #000;
  box-shadow: inset var(--px) var(--px) 0 #73605a, inset calc(var(--px) * -1) calc(var(--px) * -2) 0 #2c201b;
  color: #fff;
  text-shadow: var(--px) var(--px) 0 #1a110d;
  cursor: pointer;
}
.currency:hover { border-color: #fff; }
.currency option { background: #2e231e; color: #fff; }
.fx-note { margin: -8px 0 12px; }
.basket-jump img { width: 24px; height: 24px; }
/* Item count on the Basket button: a small molten badge, hidden while the basket is empty. */
.count {
  display: inline-block;
  min-width: 24px;
  padding: 0 6px;
  background: var(--molten);
  color: #fff;
  border: var(--px) solid #000;
  box-shadow: inset var(--px) var(--px) 0 var(--molten-hi), inset calc(var(--px) * -1) calc(var(--px) * -1) 0 var(--ember);
  text-shadow: var(--px) var(--px) 0 var(--ember-deep);
  line-height: 20px;
  text-align: center;
}

.wordmark {
  display: block;
  text-decoration: none;
  margin-bottom: 0.15em; /* room for the extruded depth */
  font-size: clamp(40px, 6vw, 72px);
}
/* The letters carry the extruded block depth... */
.wm {
  position: relative;
  display: block;
  font-size: 1em;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #8a2f08;
  text-shadow:
    0 0.04em 0 #7a2907,
    0 0.08em 0 #5e1f05,
    0 0.12em 0 #3f1403,
    0 0.16em 0 #240b02;
}
/* ...and a copy on top takes the banded fill, like heated metal in pixel art. */
.wm::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    #fff4b8 0 18%, #ffd84a 18% 40%, #ffa42a 40% 62%, #ff7a1a 62% 82%, #d9500e 82% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
.wordmark:hover .wm::after { filter: brightness(1.12); }
.wordmark:focus-visible { outline-offset: 8px; }

/* ---------- Categories ---------- */

/* Flat tabs; the active one is lit from below. Tab text lines up with the content edge. */
.catbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(20, 13, 10, 0.96);
  border-bottom: var(--px) solid var(--soot);
}
.catbar ul {
  display: flex;
  gap: 2px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}
.catbar a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 4px 14px 0;
  color: var(--ash);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 4px solid transparent;
}
.catbar a:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.catbar a[aria-current='page'] {
  color: #fff;
  border-bottom-color: var(--molten);
  background: linear-gradient(transparent 40%, rgba(255, 138, 30, 0.12));
}
.catbar img { width: 24px; height: 24px; }

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
main { min-width: 0; outline: none; }
.sidebar { display: grid; gap: 24px; position: sticky; top: 76px; }

.view-head { margin-bottom: 24px; max-width: 68ch; }
.view-head h1 { font-size: 32px; line-height: 40px; color: #fff; margin-bottom: 8px; }
.view-head p { color: var(--ash); }

.section-title { font-size: 24px; line-height: 32px; color: #fff; margin: 40px 0 16px; }

/* Home intro: plain text on the page, not another box */
.welcome { display: grid; gap: 12px; max-width: 64ch; }
.welcome h1 { font-size: 32px; line-height: 40px; color: #fff; }
.welcome p { color: var(--ash); }

/* Sidebar extras sit flat under the basket, split by a rule */
.side-block { padding-top: 20px; border-top: var(--px) solid #3a2c25; }
.side-block > h2 { font-size: 16px; color: var(--glow); margin-bottom: 14px; }

/* ---------- Packages ---------- */

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

/* Icon and name on top; price and button share one bottom row, so every card in a row lines up. */
.pkg {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
}
.pkg:hover { background: var(--basalt-2); }
.pkg-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; }
.pkg .slot { position: relative; width: 64px; height: 64px; }
.pkg .slot img { width: 44px; height: 44px; }
.pkg-name { font-size: 16px; line-height: 24px; color: #fff; }
.pkg-name button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: inherit;
}
.pkg-short { color: var(--ash); }
.pkg-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding-top: 14px;
  border-top: var(--px) solid var(--soot);
}
.pkg-foot .price { margin: 0; }
.pkg-foot .btn { flex: none; }
.pkg.have { opacity: 0.72; }
.pkg.have:hover { opacity: 1; }

.rank-note { color: var(--ash); margin: 0; }
.rank-note.up { color: var(--mc-green); }

.price { color: var(--glow); font-size: 16px; }
.price s { color: #8f7d70; margin-right: 8px; text-shadow: none; }
.price .per { color: var(--ash); }

/* Sale badge pinned to the corner of the item slot */
.tag {
  position: absolute;
  top: -8px;
  left: -8px;
  padding: 0 5px;
  line-height: 20px;
  background: #c8221a;
  color: #fff;
  border: var(--px) solid #000;
  box-shadow: inset var(--px) var(--px) 0 #ff6655;
  text-shadow: var(--px) var(--px) 0 #5a0d08;
}

.cat-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.cat-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}
.cat-card:hover { background: var(--basalt-2); color: inherit; }
.cat-card .slot { width: 64px; height: 64px; }
.cat-card .slot img { width: 44px; height: 44px; }
.cat-card strong { display: block; font-weight: normal; color: #fff; }
.cat-card span { color: var(--ash); }

/* ---------- Tooltip ---------- */

.mc-tooltip {
  position: fixed;
  z-index: 60;
  max-width: 340px;
  padding: 6px 10px 8px;
  background: var(--tip-bg);
  border: var(--px) solid transparent;
  border-image: linear-gradient(var(--tip-a), var(--tip-b)) 1;
  outline: var(--px) solid #100010;
  color: #aaaaaa;
  text-shadow: var(--px) var(--px) 0 #2a2a2a;
  pointer-events: none;
}
.tip-title { color: #fff; margin-bottom: 4px; }
.tip-meta { color: var(--mc-blue); margin-top: 6px; }
.tip-price { color: var(--glow); margin-top: 6px; }

/* The same tooltip, sitting still inside the package window */
.lore {
  padding: 8px 12px 10px;
  background: var(--tip-bg);
  border: var(--px) solid transparent;
  border-image: linear-gradient(var(--tip-a), var(--tip-b)) 1;
  outline: var(--px) solid #100010;
  color: #aaaaaa;
  text-shadow: var(--px) var(--px) 0 #2a2a2a;
}

/* ---------- Windows (dialogs) ---------- */

.window {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  background: var(--basalt);
  color: var(--bone);
  border: var(--px) solid #000;
  box-shadow:
    inset var(--px) var(--px) 0 var(--bevel-hi),
    inset calc(var(--px) * -1) calc(var(--px) * -1) 0 var(--bevel-lo),
    0 24px 0 -12px rgba(0, 0, 0, 0.35);
  overflow: auto;
}
.window::backdrop { background: rgba(10, 5, 3, 0.72); }
.window[open] { animation: window-in 120ms steps(3) both; }
@keyframes window-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.window-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px 14px 20px;
  background: #241a16;
  border-bottom: var(--px) solid var(--soot);
}
.window-bar h2 { font-size: 16px; color: #fff; }
.x {
  width: 36px;
  height: 36px;
  flex: none;
  background: #514038;
  border: var(--px) solid #000;
  box-shadow: inset var(--px) var(--px) 0 #73605a, inset calc(var(--px) * -1) calc(var(--px) * -2) 0 #2c201b;
  color: #fff;
  cursor: pointer;
}
.x:hover { border-color: #fff; }
.window-body { padding: 20px; display: grid; gap: 16px; }

.pkg-detail { display: grid; grid-template-columns: 128px 1fr; gap: 20px; align-items: start; }
.pkg-detail .slot { width: 128px; height: 128px; }
.pkg-detail .slot img { width: 96px; height: 96px; }
.buy-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.buy-row .price { font-size: 24px; line-height: 32px; }

.stepper { display: inline-flex; align-items: stretch; }
.stepper button {
  width: 40px;
  background: #514038;
  border: var(--px) solid #000;
  box-shadow: inset var(--px) var(--px) 0 #73605a, inset calc(var(--px) * -1) calc(var(--px) * -2) 0 #2c201b;
  color: #fff;
  cursor: pointer;
}
.stepper button:hover { border-color: #fff; }
.stepper input {
  width: 56px;
  min-height: 40px;
  text-align: center;
  background: #000;
  border: var(--px) solid #a0a0a0;
  border-left: 0;
  border-right: 0;
  color: #fff;
  -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Sidebar ---------- */

.player-form { display: grid; gap: 8px; }
.player-form label { color: var(--ash); }
.hint { color: var(--ash); }
.error { color: var(--mc-red); }

.player-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.3);
}
.player-card img { width: 48px; height: 48px; }
.player-card strong { display: block; font-weight: normal; color: #fff; overflow: hidden; text-overflow: ellipsis; }
.player-card span { color: var(--ash); }

.lines { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.line {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
}
.line .slot { width: 40px; height: 40px; }
.line .slot img { width: 28px; height: 28px; }
.line-name { color: #fff; overflow-wrap: anywhere; }
.line-meta { color: var(--ash); display: flex; gap: 10px; align-items: center; }
.line .price { text-align: right; }
.qty-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  background: #514038;
  border: var(--px) solid #000;
  color: #fff;
  line-height: 18px;
  cursor: pointer;
}
.qty-btn:hover { border-color: #fff; }

.empty { color: var(--ash); margin-top: 12px; }

.coupon { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 16px; }
.coupon .field { min-height: 40px; text-transform: uppercase; }

.totals { margin: 16px 0; display: grid; gap: 4px; }
.totals div { display: flex; justify-content: space-between; color: var(--ash); }
.totals .grand { color: #fff; padding-top: 8px; margin-top: 4px; border-top: var(--px) solid var(--soot); }
.totals .grand span:last-child { color: var(--glow); }
.totals .off span:last-child { color: var(--mc-green); }

/* Goal shown as an XP bar */
.xp {
  position: relative;
  height: 14px;
  margin: 18px 0 10px;
  background: #000;
  border: var(--px) solid #000;
  box-shadow: inset 0 0 0 var(--px) #2a1d17;
}
.xp-fill {
  height: 100%;
  background: linear-gradient(#ffd27a 0 30%, #ff8a1e 30% 70%, #c2410c 70%);
}
.xp-level {
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%);
  color: var(--molten);
  text-shadow: var(--px) 0 0 #000, calc(var(--px) * -1) 0 0 #000, 0 var(--px) 0 #000, 0 calc(var(--px) * -1) 0 #000;
}
.goal-text { color: var(--ash); }
.goal-text strong { color: #fff; font-weight: normal; }

.heads { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.heads li { position: relative; }
.heads button {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 4px;
  background: #1a120f;
  border: 0;
  box-shadow: inset var(--px) var(--px) 0 var(--soot), inset calc(var(--px) * -1) calc(var(--px) * -1) 0 var(--bevel-hi);
  cursor: default;
}
.heads img { width: 100%; height: 100%; display: block; }
.top-card { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; }
.top-card img { width: 64px; height: 64px; }
.top-card strong { display: block; font-weight: normal; color: var(--glow); }

/* ---------- Checkout and receipt ---------- */

.summary { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.summary li { display: flex; justify-content: space-between; gap: 12px; }
.summary .price { white-space: nowrap; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; cursor: pointer; }
.check input {
  appearance: none;
  width: 24px;
  height: 24px;
  margin: 0;
  background: #000;
  border: var(--px) solid #a0a0a0;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.check input:checked::after { content: ''; width: 12px; height: 12px; background: var(--mc-green); box-shadow: var(--px) var(--px) 0 #105010; }
.check input:focus-visible { outline: var(--px) solid #fff; outline-offset: var(--px); }
.notice {
  padding: 10px 12px;
  background: rgba(255, 216, 74, 0.08);
  border: var(--px) solid #5a4a12;
  color: #f2e2a0;
}
.secure { color: var(--ash); }

.receipt { display: grid; gap: 24px; padding: 28px; max-width: 720px; }
.receipt h1 { font-size: 32px; line-height: 40px; color: #fff; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: step; }
.steps li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: center;
  color: var(--ash);
}
.steps .dot {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: #1a120f;
  box-shadow: inset var(--px) var(--px) 0 var(--soot), inset calc(var(--px) * -1) calc(var(--px) * -1) 0 var(--bevel-hi);
  color: #6d5e55;
}
.steps li.done { color: #fff; }
.steps li.done .dot { color: var(--mc-green); }
.steps li.active { color: #fff; }
.steps li.active .dot { color: var(--glow); animation: blink 1s steps(2) infinite; }
.steps li.bad .dot { color: var(--mc-red); }
.steps small { display: block; color: var(--ash); font-size: 16px; }
@keyframes blink { 50% { opacity: 0.35; } }

.terms { padding: 28px; display: grid; gap: 20px; max-width: 76ch; }
.terms h1 { font-size: 32px; line-height: 40px; color: #fff; }
.terms-body { color: var(--ash); }
.terms-body h2 {
  font-size: 16px;
  line-height: 24px;
  color: var(--glow);
  margin: 28px 0 8px;
  scroll-margin-top: 88px; /* clear the sticky category bar */
  outline: none;
}
.terms-body h2:first-of-type { margin-top: 12px; }
.terms-body p { margin: 0 0 8px; }
.terms-body ul { margin: 0 0 8px; padding-left: 24px; list-style: square; }
.terms-body li { margin-bottom: 4px; }
.terms-body li::marker { color: var(--molten); }
.toc {
  margin: 0;
  padding: 16px 20px;
  list-style: none;
  background: rgba(0, 0, 0, 0.3);
  columns: 2;
  column-gap: 32px;
}
.toc li { break-inside: avoid; margin-bottom: 4px; color: #8f7d70; }
.toc a { color: var(--bone); text-decoration: none; }
.toc a:hover { color: var(--glow); text-decoration: underline; }

.loading { color: var(--ash); padding: 24px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Footer, toast ---------- */

.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: #8f7d70;
  border-top: var(--px) solid var(--soot);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  background: var(--tip-bg);
  border: var(--px) solid transparent;
  border-image: linear-gradient(var(--tip-a), var(--tip-b)) 1;
  color: #fff;
}
.toast.bad { color: var(--mc-red); }

/* ---------- Small screens ---------- */

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; padding: 24px 16px 48px; }
  .sidebar { position: static; }
  .catbar ul { padding: 0 2px; }
  .header-inner { padding: 14px 16px 16px; }
}

/* Header stacks: logo on its own row, IP and actions below it */
@media (max-width: 760px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 8px; }
  .wordmark { grid-column: 1 / -1; order: -1; justify-self: center; font-size: clamp(36px, 11vw, 56px); }
  .ip-sub { display: none; }
  .ip { min-height: 44px; padding: 6px 8px; gap: 8px; min-width: 0; }
  .ip-address { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #discord { display: none; }
}

@media (max-width: 640px) {
  .top-actions .btn { padding: 6px 10px 8px; }
  .currency { padding-left: 10px; padding-right: 28px; background-position: right 14px top 52%, right 8px top 52%; }
  .basket-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .grid, .cat-list { grid-template-columns: 1fr; gap: 12px; }
  .pkg-detail { grid-template-columns: 1fr; }
  .pkg-detail .slot { margin: 0 auto; }
  .view-head h1, .welcome h1, .receipt h1, .terms h1 { font-size: 24px; line-height: 32px; }
  .toc { columns: 1; }
  .receipt, .terms { padding: 20px; }
  .footer { padding: 24px 16px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .window[open] { animation: none; }
  .steps li.active .dot { animation: none; }
}
