/* ==========================================================================
   AetherRise Skygen — Design System
   Single source of truth for the entire site.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* ---- Surfaces: black, warmed slightly toward the red ---- */
  /* The brand is red, yellow and black. Surfaces are SOLID colours, not
     translucent white over black: flat panels with hard edges are what makes
     this read as a game UI rather than another glassy landing page. */
  --black:         #0b0a0a;   /* page background          */
  --black-soft:    #151313;   /* raised block             */
  --black-light:   #201d1c;   /* panels                   */
  --black-lighter: #2c2826;   /* hover / active surfaces  */

  --bg:            var(--black);
  --bg-elev:       var(--black-light);
  --surface:       var(--black-soft);
  --surface-hover: var(--black-light);
  --border:        #2f2a28;
  --border-strong: #4a4340;

  /* Hard drop under every raised block - the "1 block of depth" look. */
  --edge:          #000000;

  /* ---- Brand: red primary, yellow accent (the two halves of the gem) ---- */
  --red:         #e01f31;   /* primary — passes AA with white text */
  --red-bright:  #ff4d5e;
  --red-deep:    #6f1117;   /* the gem's shadow side */
  --yellow:      #ffb70c;   /* the gem's top — always pair with dark text */
  --yellow-light: #fff0c7;  /* the gem's highlight */
  --yellow-deep: #a86f00;

  /* Legacy aliases so existing rules keep working */
  --aether: var(--red);
  --rise:   var(--yellow);
  --glow:   var(--yellow);
  --gold:   var(--yellow);

  /* ---- Semantic ---- */
  --success: #34d399;   /* stays green: "paid / online" is universal */
  --danger:  var(--red-bright);
  --warn:    var(--yellow);

  /* Gradients are gone from the UI. These stay as flat colours so any rule
     that still references them renders as a solid block. */
  --grad-brand: var(--red);
  --grad-red:   var(--red);
  --grad-text:  var(--yellow);

  /* ---- Type ---- */
  /* Pixel caps to match the "AETHERRISE_" lettering in the logo; a plain,
     sturdy sans for reading. Silkscreen over other pixel faces because its
     B doesn't read as an 8 at headline sizes. */
  --font-display: 'Silkscreen', ui-monospace, monospace;
  --font-body:    'Rubik', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Warm greys — a cool grey ramp fights a red/yellow palette */
  --text:      #f4f1ee;
  --text-dim:  #b3aca6;
  --text-mute: #7d7670;

  /* Ink for use on top of yellow */
  --ink: #14100a;

  /* Tick glyph used by .product__perks, as a mask so it takes any colour */
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");

  /* Corners are nearly square - blocks, not bubbles. */
  --r-xs: 2px;
  --r-sm: 3px;
  --r:    4px;
  --r-lg: 6px;
  --r-xl: 8px;

  /* Hard, unblurred offsets instead of soft glows. */
  --shadow:    0 4px 0 var(--edge);
  --shadow-lg: 0 8px 0 var(--edge);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --nav-h: 68px;
  --wrap: 1140px;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

/* The browser hides [hidden] with `display: none`, but that lives in the UA
   stylesheet — ANY author rule setting display (.callout is flex, .row is
   flex, .grid is grid) silently overrides it and the element stays visible.
   This must come with !important, and must apply to every element, or the
   hidden attribute becomes a no-op wherever we've set a display. */
[hidden] { display: none !important; }

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

/* Pixel star field: square 2-3px "stars" on a tile, fading out down the
   page so content further down sits on plain sky. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' shape-rendering='crispEdges'%3E%3Cg fill='%23ffffff'%3E%3Crect x='18' y='26' width='2' height='2' opacity='.55'/%3E%3Crect x='96' y='12' width='3' height='3' opacity='.35'/%3E%3Crect x='170' y='58' width='2' height='2' opacity='.6'/%3E%3Crect x='214' y='130' width='2' height='2' opacity='.4'/%3E%3Crect x='60' y='104' width='2' height='2' opacity='.3'/%3E%3Crect x='128' y='160' width='3' height='3' opacity='.45'/%3E%3Crect x='30' y='196' width='2' height='2' opacity='.5'/%3E%3Crect x='190' y='212' width='2' height='2' opacity='.3'/%3E%3C/g%3E%3Crect x='146' y='96' width='2' height='2' fill='%23ffb70c' opacity='.6'/%3E%3C/svg%3E");
  mask-image: linear-gradient(#000 0%, rgba(0,0,0,.35) 55%, transparent 90%);
  -webkit-mask-image: linear-gradient(#000 0%, rgba(0,0,0,.35) 55%, transparent 90%);
  pointer-events: none;
}

img, svg { display: block; max-width: 100%; }

/* --------------------------------------------------------------------------
   Icons — see the sprite in scripts/app.js
   Sized in em so they scale with whatever text they sit beside, and coloured
   by currentColor so they need no per-theme rules.
   -------------------------------------------------------------------------- */
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  display: inline-block;
  vertical-align: -0.18em;
}
.icon--lg { width: 1.6em; height: 1.6em; }
.icon--xl { width: 2.4em; height: 2.4em; }

/* Links use the brighter red, not --red. The primary red is tuned for white
   text sitting on top of it; as text on black it only reaches 4.16:1.
   --red-bright gets to 5.68:1, and yellow on hover is unmistakable. */
a { color: var(--red-bright); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: var(--yellow); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  color: #fff;
}
/* The pixel face is for headlines; small headings read better in the body
   face, set heavy. */
h3, h4 {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Silkscreen is wide, all-caps and drawn on a grid, so headlines run a size
   smaller than a normal face would need. */
h1 { font-size: clamp(1.7rem, 4.4vw, 2.9rem); }
h2 { font-size: clamp(1.25rem, 2.9vw, 1.8rem); }
h3 { font-size: 1.18rem; }

p { color: var(--text-dim); }

::selection { background: var(--red); color: #fff; }

:focus-visible {
  /* Yellow, not red — it stays visible against both the black background
     and the red buttons it will often sit on top of. */
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}

.page {
  flex: 1;
  padding-block: 56px 88px;
}

.page-narrow { max-width: 760px; margin-inline: auto; }

.stack   { display: flex; flex-direction: column; gap: 20px; }
.row     { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.center  { text-align: center; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.gradient-text {
  /* Name kept so existing markup works - it's no longer a gradient. Yellow
     with a hard red drop, like a title screen. */
  color: var(--yellow);
  text-shadow: 0.06em 0.06em 0 var(--red-deep);
}

.section-head {
  margin-bottom: 28px;
}
.section-head p { margin-top: 8px; max-width: 62ch; }

/* --------------------------------------------------------------------------
   4. Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--black-soft);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 3px 0 var(--edge);
}

.nav__inner {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Must not be squeezed by the link list — staff see three extra links and
     without this the brand text collides with the first nav item. */
  flex: none;
  margin-right: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: #fff;
  white-space: nowrap;
}
.nav__brand:hover { color: #fff; }
.nav__brand img { width: 28px; height: 28px; }
.nav__brand span { color: var(--red-bright); text-shadow: 2px 2px 0 var(--edge); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  list-style: none;
}

.nav__links a {
  display: block;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  transition: all .18s var(--ease);
}
.nav__links a:hover {
  color: #fff;
  background: var(--surface-hover);
}
/* Current page: a yellow block underline rather than a filled pill. */
.nav__links a[aria-current="page"] {
  color: #fff;
  background: transparent;
  box-shadow: inset 0 -3px 0 var(--yellow);
}

/* "More" / "Staff" dropdowns */
.nav__group { position: relative; }
.nav__more {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.nav__more:hover, .nav__more[aria-expanded="true"] { color: #fff; background: var(--surface-hover); }
.nav__more[data-active] { color: #fff; box-shadow: inset 0 -3px 0 var(--yellow); }
.nav__more svg { transition: transform .18s var(--ease); }
.nav__more[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  padding: 6px;
  list-style: none;
  background: var(--black-soft);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: 0 4px 0 var(--edge);
  display: none;
}
.nav__more[aria-expanded="true"] + .nav__menu { display: block; }
.nav__menu a { padding: 9px 12px; }

.nav__actions { display: flex; align-items: center; gap: 10px; margin-left: 6px; }

.nav__cart {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all .18s var(--ease);
}
.nav__cart:hover { border-color: var(--border-strong); color: #fff; background: var(--surface-hover); }

.nav__cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--r-xs);
  /* Solid yellow rather than the brand gradient: at 0.68rem the dark-on-red
     end of that gradient dropped below readable contrast. */
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
}
/* (the global [hidden] rule in the reset covers this) */

.nav__burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  place-items: center;
}
.nav__burger span {
  display: block;
  width: 17px;
  height: 1.8px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}
.nav__burger span + span { margin-top: 4px; }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.8px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.8px) rotate(-45deg); }

/* Below this the bar folds into the burger, and dropdowns open flat in it. */
@media (max-width: 860px) {
  .nav__more { display: none; }
  .nav__menu {
    position: static;
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 6px;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .nav__burger { display: grid; }
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px 20px 22px;
    background: var(--black-soft);
    border-bottom: 2px solid var(--border);
    box-shadow: 0 6px 0 var(--edge);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: all .22s var(--ease);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .nav__links.open { transform: none; opacity: 1; visibility: visible; }
  .nav__links a { padding: 12px 14px; font-size: 0.98rem; }
  .nav__actions { margin-left: auto; }
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-sm);
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  /* Every button sits one "block" above the page and sinks when pressed.
     --btn-edge is the colour of that bottom face. */
  --btn-edge: var(--edge);
  box-shadow: 0 4px 0 var(--btn-edge);
  transition: transform .08s ease, box-shadow .08s ease, background-color .15s ease, color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--btn-edge);
}

/* Red with white text (4.8:1). The red→yellow brand gradient is reserved for
   decorative fills — it can't carry button text at a readable contrast at
   both ends. */
.btn--primary {
  background: var(--red);
  border-color: #ff5a68;
  color: #fff;
  --btn-edge: var(--red-deep);
}
.btn--primary:hover { color: #fff; background: #ee2c3e; }

/* Yellow call-to-action, for when you want maximum pop against the red. */
.btn--accent {
  background: var(--yellow);
  border-color: #ffe08a;
  color: var(--ink);
  --btn-edge: var(--yellow-deep);
}
.btn--accent:hover { color: var(--ink); background: #ffd25e; }

.btn--ghost {
  background: var(--black-light);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--ghost:hover { background: var(--black-lighter); color: #fff; }

.btn--cashapp {
  background: #00d54b;
  border-color: #5cf08c;
  color: #00320f;
  --btn-edge: #007a2b;
}
.btn--cashapp:hover { color: #00320f; background: #19e15f; }

.btn--danger { background: rgba(255, 61, 79, 0.14); border-color: rgba(255, 61, 79, 0.38); color: var(--red-bright); }
.btn--danger:hover { background: rgba(255, 61, 79, 0.24); color: var(--red-bright); }

.btn--success { background: rgba(52, 211, 153, 0.13); border-color: rgba(52, 211, 153, 0.35); color: var(--success); }
.btn--success:hover { background: rgba(52, 211, 153, 0.22); color: var(--success); }

.btn--sm { padding: 8px 14px; font-size: 0.84rem; border-radius: var(--r-sm); box-shadow: 0 3px 0 var(--btn-edge); }
.btn--lg { padding: 15px 30px; font-size: 1rem; }
.btn--block { width: 100%; }

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* --------------------------------------------------------------------------
   6. Cards & surfaces
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

/* Lifts one step, and the block underneath gets taller to match. */
.card--hover:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: 0 7px 0 var(--edge); }
.card--flush { padding: 0; overflow: hidden; }

.panel {
  background: var(--bg-elev);
  border: 2px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow);
}

.divider { height: 1px; background: var(--border); border: 0; margin-block: 20px; }

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(60px, 10vw, 110px) clamp(48px, 8vw, 88px);
  text-align: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px;
  border-radius: var(--r-xs);
  border: 2px solid var(--border-strong);
  background: var(--black-soft);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-bottom: 26px;
}

.hero h1 {
  font-size: clamp(2rem, 5.6vw, 3.9rem);
  font-weight: 700;
  line-height: 0.98;
  margin-bottom: 20px;
  text-shadow: 0.05em 0.05em 0 var(--edge);
}

.hero__sub {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  max-width: 60ch;
  margin: 0 auto 36px;
  color: var(--text-dim);
}

.hero__cta { display: flex; gap: 13px; justify-content: center; flex-wrap: wrap; }

/* Live status dot */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 0;
  flex-shrink: 0;
}
.dot--on  { background: var(--success); box-shadow: 0 0 0 0 rgba(52,211,153,.65); animation: pulse 2s infinite; }
.dot--off { background: var(--text-mute); }

@keyframes pulse {
  70%  { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* --------------------------------------------------------------------------
   8. Connect / copy field
   -------------------------------------------------------------------------- */
.copyfield {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 16px;
  background: var(--edge);
  border: 2px solid var(--border);
  border-radius: var(--r);
  transition: border-color .2s var(--ease);
}
.copyfield:hover { border-color: var(--border-strong); }

.copyfield__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-mute);
  font-weight: 700;
  flex-shrink: 0;
}

.copyfield__value {
  font-family: var(--font-mono);
  font-size: 0.94rem;
  color: #fff;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   9. Stat / feature tiles
   -------------------------------------------------------------------------- */
.stat {
  text-align: center;
  padding: 22px 16px;
}
.stat__num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.stat__label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  margin-top: 8px;
  font-weight: 600;
}

/* An inventory slot: sunken square with a bevel - dark top-left, light
   bottom-right - so the icon looks like an item sitting in it. */
.feature__icon {
  width: 46px;
  height: 46px;
  border-radius: 0;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  color: var(--yellow);
  background: var(--edge);
  border: 3px solid;
  border-color: #000 #3d3734 #3d3734 #000;
  margin-bottom: 15px;
}

/* --------------------------------------------------------------------------
   10. Shop
   -------------------------------------------------------------------------- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 20px;
}

.product {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  overflow: hidden;
  transition: transform .22s var(--ease), border-color .22s var(--ease);
}
.product::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity .22s var(--ease);
}
.product:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.product:hover::before { opacity: 1; }

.product--featured { border-color: rgba(255, 183, 12, 0.42); }
.product--featured::before { opacity: 1; }

.product__badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 11px;
  border-radius: var(--r-xs);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--yellow);
  color: var(--ink);
}

.product__icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  image-rendering: pixelated;
  margin-bottom: 16px;
}

.product__name { font-size: 1.2rem; margin-bottom: 7px; }
.product__desc { font-size: 0.9rem; flex: 1; margin-bottom: 18px; }

.product__price {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 18px;
  line-height: 1;
}
.product__price small {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-mute);
  margin-left: 5px;
}

.product__perks {
  list-style: none;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.product__perks li {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding-left: 21px;
  position: relative;
}
/* Tick rendered as a masked SVG rather than a text glyph, so it matches the
   rest of the icon set instead of depending on the font's checkmark. */
.product__perks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 14px;
  height: 14px;
  background-color: var(--yellow);
  -webkit-mask: var(--tick) no-repeat center / contain;
  mask: var(--tick) no-repeat center / contain;
}

/* --------------------------------------------------------------------------
   11. Cart & line items
   -------------------------------------------------------------------------- */
.line {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.line:last-child { border-bottom: 0; }

.line__icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.line__body { flex: 1; min-width: 0; }
.line__name { font-weight: 600; color: #fff; font-size: 0.98rem; }
.line__meta { font-size: 0.82rem; color: var(--text-mute); }
.line__price { font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 1.05rem; }

.qty {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: rgba(0,0,0,.25);
}
.qty button {
  width: 30px;
  height: 30px;
  background: none;
  border: 0;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.qty button:hover { background: var(--surface-hover); color: #fff; }
.qty span {
  min-width: 28px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.totals { display: flex; flex-direction: column; gap: 11px; }
.totals__row { display: flex; justify-content: space-between; font-size: 0.92rem; color: var(--text-dim); }
.totals__row--grand {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

/* --------------------------------------------------------------------------
   12. Checkout steps
   -------------------------------------------------------------------------- */
.steps {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.step {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.84rem;
  color: var(--text-mute);
  font-weight: 600;
}
.step__num {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  font-size: 0.76rem;
  flex-shrink: 0;
}
.step[data-state="active"] { color: #fff; }
.step[data-state="active"] .step__num { background: var(--red); border-color: transparent; color: #fff; }
.step[data-state="done"] { color: var(--success); }
.step[data-state="done"] .step__num { border-color: var(--success); color: var(--success); }
.step__bar { width: 26px; height: 1px; background: var(--border); }

/* Cash App payment block */
.paybox {
  border: 1px solid rgba(0, 213, 75, 0.28);
  background: linear-gradient(160deg, rgba(0, 213, 75, 0.07), transparent 62%);
  border-radius: var(--r-lg);
  padding: 28px;
  text-align: center;
}

.paybox__amount {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
}

.paybox__to {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: #00d54b;
  font-weight: 600;
  margin-bottom: 26px;
}

.ordercode {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 20px;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed var(--border-strong);
  margin-block: 6px 22px;
}
.ordercode code {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.callout {
  display: flex;
  gap: 13px;
  padding: 16px 18px;
  border-radius: var(--r);
  background: rgba(255, 183, 12, 0.09);
  border: 1px solid rgba(255, 183, 12, 0.26);
  text-align: left;
  font-size: 0.88rem;
  color: #ffe6a6;
}
/* Info is deliberately neutral. With red already meaning "danger" and yellow
   meaning "warning", a third hue would dilute both — so notes read as plain
   raised surface instead. */
.callout--info    { background: rgba(255, 255, 255, 0.05); border-color: var(--border-strong);      color: #ddd9d5; }
.callout--danger  { background: rgba(255, 61, 79, 0.09);   border-color: rgba(255, 61, 79, 0.30);   color: #ffc9ce; }
.callout--success { background: rgba(52, 211, 153, 0.08);  border-color: rgba(52, 211, 153, 0.26);  color: #a7f3d0; }
.callout strong { color: #fff; }

/* Numbered how-to list */
.howto { list-style: none; counter-reset: howto; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.howto li {
  counter-increment: howto;
  position: relative;
  padding-left: 40px;
  font-size: 0.92rem;
  color: var(--text-dim);
}
.howto li::before {
  content: counter(howto);
  position: absolute;
  left: 0;
  top: -1px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
}
.howto strong { color: #fff; }

/* --------------------------------------------------------------------------
   13. Forms
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; }

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
}

.input, input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  padding: 12px 15px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.input:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--aether);
  background: rgba(0, 0, 0, 0.45);
}
input::placeholder, textarea::placeholder { color: var(--text-mute); }

textarea { resize: vertical; min-height: 110px; }

.input-group { position: relative; }
.input-group .input { padding-right: 46px; }
.input-group__btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: .6;
  transition: opacity .15s var(--ease);
}
.input-group__btn:hover { opacity: 1; }
.input-group__btn img { width: 18px; }

.form-msg { font-size: 0.86rem; min-height: 1.3em; }
.form-msg--err { color: var(--danger); }
.form-msg--ok  { color: var(--success); }

/* --------------------------------------------------------------------------
   14. Badges, tables, empty states
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-xs);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 2px solid var(--border-strong);
  background: var(--black-light);
  color: var(--text-dim);
  text-transform: uppercase;
}
.badge--pending  { background: rgba(255, 183, 12,.14);  border-color: rgba(255, 183, 12,.34);  color: var(--yellow); }
.badge--review   { background: rgba(255,255,255,.07); border-color: var(--border-strong);  color: #e6e2de; }
.badge--done     { background: rgba(52,211,153,.13);  border-color: rgba(52,211,153,.32);  color: var(--success); }
.badge--rejected { background: rgba(255,61,79,.14);   border-color: rgba(255,61,79,.34);   color: var(--red-bright); }

.empty {
  text-align: center;
  padding: 64px 24px;
}
/* Sizing comes from .icon--xl on the SVG, so no font-size here — otherwise the
   em-based icon multiplies against it and renders enormous. */
.empty__icon {
  margin-bottom: 14px;
  color: var(--text-mute);
  display: flex;
  justify-content: center;
}
.empty h3, .empty__title { margin-bottom: 8px; font-size: 1.15rem; }
.empty p { margin-bottom: 22px; }

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r);
  height: 84px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* --------------------------------------------------------------------------
   15. Toast
   -------------------------------------------------------------------------- */
.toaster {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 19px;
  border-radius: var(--r-sm);
  background: rgba(28, 28, 32, 0.98);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  color: var(--text);
  animation: toast-in .3s var(--ease);
  max-width: min(360px, calc(100vw - 48px));
  pointer-events: auto;
}
.toast--ok  { border-color: rgba(52, 211, 153, 0.45); }
.toast--err { border-color: rgba(255, 61, 79, 0.5); }
.toast.out { animation: toast-out .25s var(--ease) forwards; }

@keyframes toast-in  { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(8px) scale(.97); } }

@media (max-width: 560px) {
  .toaster { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
}

/* --------------------------------------------------------------------------
   16. Team, events, socials
   -------------------------------------------------------------------------- */
.member { text-align: center; padding: 30px 24px; }
.member img {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 2px solid var(--border-strong);
  image-rendering: pixelated;
}
.member h3 { margin-bottom: 4px; }
.member__role {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}
.member p { font-size: 0.88rem; }

.event {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 20px 24px;
}
.event__date {
  flex-shrink: 0;
  width: 74px;
  text-align: center;
  padding: 11px 6px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--border);
}
.event__month {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--yellow);
}
.event__day {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.event__title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: #fff; }
.event__sub { font-size: 0.84rem; color: var(--text-mute); }

.social {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px 20px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all .18s var(--ease);
}
.social:hover { border-color: var(--border-strong); background: var(--surface-hover); transform: translateX(3px); }
.social__icon { font-size: 1.4rem; width: 30px; text-align: center; flex-shrink: 0; }
.social__name { font-weight: 600; color: #fff; font-size: 0.96rem; }
.social__handle { font-size: 0.83rem; color: var(--text-mute); }
.social__arrow { margin-left: auto; color: var(--text-mute); }

/* Daily login reward tiles */
.rewards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 14px;
}
.reward {
  position: relative;
  padding: 22px 16px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  transition: all .2s var(--ease);
}
.reward__day {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 10px;
}
.reward__prize { font-size: 0.92rem; font-weight: 600; color: #fff; margin-bottom: 14px; }
.reward--claimed { opacity: .5; border-color: rgba(52,211,153,.3); }
.reward--current { border-color: var(--red); box-shadow: 0 0 0 1px rgba(224,31,49,.28), 0 8px 30px -10px rgba(224,31,49,.5); }
.reward--locked  { opacity: .38; }

/* --------------------------------------------------------------------------
   17. Footer
   -------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 40px 32px;
  margin-top: auto;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer__brand { font-family: var(--font-display); font-weight: 800; color: #fff; }
.footer p { font-size: 0.86rem; color: var(--text-mute); }
.footer__links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer__links a { font-size: 0.86rem; color: var(--text-mute); }
.footer__links a:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   18. Utilities
   -------------------------------------------------------------------------- */
.mono { font-family: var(--font-mono); }
.dim  { color: var(--text-dim); }
.mute { color: var(--text-mute); }
.small { font-size: 0.86rem; }
.tiny  { font-size: 0.78rem; }
.hidden { display: none !important; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .card, .panel, .product, .paybox { padding: 20px; }
  .page { padding-block: 36px 64px; }
}

/* --------------------------------------------------------------------------
   19. Chat (/chat) — Ollama assistant
   --------------------------------------------------------------------------
   The log is the only scrolling region on the page. Making the whole window
   scroll instead would push the composer off-screen mid-answer, which is
   exactly when you want it pinned. `min-height: 0` on the flex children is
   what actually lets the log shrink — without it a flex item refuses to go
   below its content height and the box overflows the viewport.
   -------------------------------------------------------------------------- */
.chat {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  /* Fill the viewport under the nav, minus the page heading and padding.
     Sized so the composer and its hint line sit fully on screen without the
     window itself scrolling — a chat you have to scroll the page to type in
     is worse than one that's simply shorter. */
  height: calc(100vh - var(--nav-h) - 245px);
  min-height: 480px;
}

/* ---- Left rail: conversations ---- */
.chat__rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.chat__threads {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 3px;
}

.thread {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.thread:hover { background: var(--surface); color: var(--text); }
.thread[aria-current="true"] {
  background: var(--surface);
  border-color: var(--border-strong);
  color: #fff;
}
.thread__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread__del {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.thread:hover .thread__del,
.thread[aria-current="true"] .thread__del { opacity: 1; }
.thread__del:hover { background: rgba(255, 61, 79, 0.16); color: var(--red-bright); }
.thread__del .icon { width: 0.95em; height: 0.95em; }

/* ---- Main column ---- */
.chat__main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.chat__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-dim);
  min-width: 0;
}
.chat__status strong { color: #fff; font-weight: 600; }

.chat__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Segmented control — assistant vs free chat */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.28);
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 14px -6px rgba(224, 31, 49, 0.8);
}

/* `width: 100%` on the base select rule would push this onto its own line
   and double the header height — the header is a flex row, not a form. */
.chat__model {
  width: auto;
  max-width: 190px;
  padding: 7px 10px;
  font-size: 0.8rem;
  border-radius: var(--r-sm);
}

/* ---- Log ---- */
.chat__log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg--user { flex-direction: row-reverse; }

.msg__avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: .02em;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.msg__avatar--bot {
  background: var(--grad-red);
  border-color: transparent;
  color: #fff;
}
.msg__avatar--bot .icon { width: 1.05em; height: 1.05em; }

.msg__body { max-width: min(78%, 720px); min-width: 0; }

.msg__bubble {
  padding: 12px 16px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.94rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.msg--user .msg__bubble {
  background: var(--grad-red);
  border-color: transparent;
  color: #fff;
  border-bottom-right-radius: 5px;
}
.msg--bot .msg__bubble { border-bottom-left-radius: 5px; }
.msg--error .msg__bubble {
  background: rgba(255, 61, 79, 0.09);
  border-color: rgba(255, 61, 79, 0.30);
  color: #ffc9ce;
}

/* Markdown inside an answer */
.msg__bubble p + p,
.msg__bubble p + ul,
.msg__bubble p + ol,
.msg__bubble ul + p,
.msg__bubble ol + p,
.msg__bubble p + pre,
.msg__bubble pre + p { margin-top: 11px; }
.msg__bubble strong { color: #fff; font-weight: 700; }
.msg--user .msg__bubble strong { color: #fff; }
.msg__bubble ul, .msg__bubble ol { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.msg__bubble li { line-height: 1.6; }
.msg__bubble a { color: var(--yellow); text-decoration: underline; text-underline-offset: 2px; }
.msg--user .msg__bubble a { color: #fff; }
.msg__bubble code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--border);
  color: var(--yellow);
}
.msg--user .msg__bubble code { color: #fff; background: rgba(0, 0, 0, 0.24); }

.codeblock {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.codeblock pre {
  margin: 0;
  padding: 13px 15px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #e8e5e2;
}
.codeblock pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.codeblock__copy {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 4px 9px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--black-light);
  color: var(--text-dim);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s var(--ease), color .15s var(--ease);
}
.codeblock:hover .codeblock__copy { opacity: 1; }
.codeblock__copy:hover { color: #fff; border-color: var(--border-strong); }

.msg__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 7px;
  font-size: 0.72rem;
  color: var(--text-mute);
}
.msg__meta button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--text-mute);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.msg__meta button:hover { color: var(--text); }

/* Blinking caret while a token stream is open */
.caret {
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.14em;
  border-radius: 1px;
  background: var(--yellow);
  animation: caret 1s steps(2) infinite;
}
@keyframes caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* Three-dot "thinking" state before the first token lands */
.thinking { display: inline-flex; gap: 5px; align-items: center; padding: 3px 0; }
.thinking span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-mute);
  animation: thinking 1.25s ease-in-out infinite;
}
.thinking span:nth-child(2) { animation-delay: .16s; }
.thinking span:nth-child(3) { animation-delay: .32s; }
@keyframes thinking {
  0%, 60%, 100% { opacity: .28; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-3px); }
}

/* ---- Empty state ---- */
.chat__intro { margin: auto 0; padding: 8px 4px 24px; text-align: center; }
.chat__intro-mark {
  width: 58px; height: 58px;
  margin: 0 auto 16px;
  border-radius: var(--r);
  display: grid;
  place-items: center;
  background: var(--grad-red);
  box-shadow: 0 14px 40px -14px rgba(224, 31, 49, 0.9);
}
.chat__intro-mark .icon { width: 1.6em; height: 1.6em; color: #fff; }
.chat__intro h2 { font-size: 1.35rem; }
.chat__intro p { margin-top: 8px; color: var(--text-dim); font-size: 0.92rem; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 22px; }
.chip {
  padding: 9px 15px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
  transition: transform .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.chip:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  color: #fff;
  background: var(--surface-hover);
}

/* ---- Composer ---- */
.chat__compose {
  border-top: 1px solid var(--border);
  padding: 13px 18px 16px;
  background: rgba(0, 0, 0, 0.22);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 7px 7px 7px 15px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--black-soft);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.composer:focus-within {
  border-color: rgba(224, 31, 49, 0.55);
  box-shadow: 0 0 0 3px rgba(224, 31, 49, 0.13);
}

/* The base `textarea` rule sets min-height: 110px for form fields. A chat
   composer has to start one line tall and grow as you type, so that floor
   is cleared here rather than in JS. */
.composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: none;
  padding: 9px 0;
  resize: none;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.55;
  max-height: 190px;
  overflow-y: auto;
}
.composer textarea:focus { outline: 0; border: 0; box-shadow: none; }
/* The composer is one line tall until you type. A placeholder long enough
   to wrap would be clipped in half on a narrow phone, so truncate it. */
.composer textarea::placeholder {
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer__send {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  background: var(--grad-red);
  color: #fff;
  cursor: pointer;
  transition: transform .18s var(--ease), opacity .18s var(--ease), filter .18s var(--ease);
}
.composer__send:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.composer__send:disabled { opacity: .38; cursor: not-allowed; }
.composer__send .icon { width: 1.05em; height: 1.05em; }
.composer__send--stop { background: var(--black-lighter); border: 1px solid var(--border-strong); }
.composer__send--stop::after {
  content: '';
  width: 11px; height: 11px;
  border-radius: 3px;
  background: currentColor;
}

.chat__hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 9px;
  font-size: 0.73rem;
  color: var(--text-mute);
}
.chat__hint kbd {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.4);
}

/* ---- Offline / setup notice ---- */
.chat__offline {
  margin: auto;
  max-width: 520px;
  text-align: center;
  padding: 8px 4px;
}
.chat__offline .icon { width: 2.2em; height: 2.2em; color: var(--yellow); margin: 0 auto 12px; }

/* ---- Staff connection panel ---- */
.chat__conn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  /* One column: the conversation list becomes a horizontal strip above the
     chat. Sizing is deliberately tight — the composer has to be reachable
     without scrolling the page first, or the whole thing feels broken on a
     phone. dvh rather than vh so it survives the browser's collapsing
     address bar. */
  .page--chat { padding-block: 28px 40px; }
  .page--chat .section-head { margin-bottom: 18px; }

  .chat {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 0;
  }
  .chat__rail {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .chat__rail .btn { width: auto; flex-shrink: 0; }
  .chat__rail-note { display: none; }
  .chat__threads {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
  }
  .thread { width: auto; max-width: 190px; flex-shrink: 0; }
  .thread__del { opacity: 1; }
  .chat__main {
    height: calc(100dvh - var(--nav-h) - 250px);
    min-height: 420px;
  }
  .msg__body { max-width: 88%; }
}

@media (max-width: 560px) {
  .chat__head { padding: 10px 13px; gap: 8px; }
  .chat__log { padding: 16px 13px 6px; }
  .chat__compose { padding: 11px 13px 13px; }
  .msg__body { max-width: calc(100% - 44px); }

  /* Keep the mode toggle and the model picker on one row. Three stacked
     rows of controls would leave almost no room for the conversation. */
  .chat__tools { width: 100%; flex-wrap: nowrap; justify-content: space-between; }
  .seg button { padding: 6px 9px; font-size: 0.75rem; }
  .chat__model { max-width: 130px; padding: 6px 8px; }

  /* Top-align the empty state so the suggestion chips stay above the fold. */
  .chat__intro { margin: 0; padding: 4px 2px 16px; }
  .chat__intro-mark { width: 48px; height: 48px; margin-bottom: 12px; border-radius: var(--r); }
  .chat__intro h2 { font-size: 1.15rem; }
  .chat__intro p { font-size: 0.86rem; }
  .chips { margin-top: 16px; gap: 7px; }
  .chip { padding: 7px 12px; font-size: 0.8rem; }

  .chat__hint { font-size: 0.7rem; }
}

/* --------------------------------------------------------------------------
   20. Crate odds (/odds)
   -------------------------------------------------------------------------- */
.odds { display: flex; flex-direction: column; gap: 4px; }

.odds__row {
  display: grid;
  /* tier | bar | percentage | "1 in N" */
  grid-template-columns: minmax(90px, 118px) 1fr 64px 96px;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
}

.odds__tier {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
}
.odds__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.odds__bar {
  height: 9px;
  border-radius: var(--r-xs);
  background: rgba(0, 0, 0, .38);
  overflow: hidden;
}
.odds__bar span {
  display: block;
  height: 100%;
  border-radius: var(--r-xs);
  /* A 0.5% slice is a sliver; the floor keeps it visible without lying about
     the number, which is printed next to it either way. */
  min-width: 3px;
}

.odds__pct { text-align: right; font-weight: 700; font-size: 0.9rem; }
.odds__odds { text-align: right; }

.odds__examples {
  padding: 0 0 12px 26px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  line-height: 1.5;
}
.odds__examples:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

@media (max-width: 600px) {
  .odds__row {
    grid-template-columns: 1fr 56px;
    grid-template-areas:
      "tier pct"
      "bar  bar";
    gap: 6px 10px;
  }
  .odds__tier { grid-area: tier; }
  .odds__pct  { grid-area: pct; }
  .odds__bar  { grid-area: bar; }
  .odds__odds { display: none; }   /* the percentage is enough on a phone */
  .odds__examples { padding-left: 0; }
}

/* --------------------------------------------------------------------------
   21. Shop additions — bundles and the purchase ticker
   -------------------------------------------------------------------------- */
.product__saving {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--success);
  margin-top: -6px;
  margin-bottom: 10px;
}

.product__odds {
  display: block;
  margin: 0 0 12px;
  color: var(--text-mute);
}
.product__odds:hover { color: var(--yellow); }

.ticker { padding: 12px 18px; overflow: hidden; }
.ticker__label {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  margin-bottom: 6px;
}
.ticker__list {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.ticker__list::-webkit-scrollbar { display: none; }
.ticker__item {
  white-space: nowrap;
  font-size: 0.86rem;
  color: var(--text-dim);
  flex-shrink: 0;
}
.ticker__item strong { color: #fff; }

/* --------------------------------------------------------------------------
   22. Prose — news posts and guide pages
   --------------------------------------------------------------------------
   Long-form reading, so the measure is capped and the vertical rhythm is
   looser than the rest of the site. Everything here is scoped to .prose so it
   can't leak into the compact card layouts elsewhere.
   -------------------------------------------------------------------------- */
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1.1em; }

.prose p { color: var(--text-dim); line-height: 1.75; }

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #fff;
  margin-top: 2.2em;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.prose h2:first-child { margin-top: 0; }

.prose h3 { font-size: 1.05rem; color: #fff; margin-top: 1.8em; }

.prose a { color: var(--yellow); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--red-bright); }

.prose code {
  background: rgba(0, 0, 0, .42);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1px 6px;
  font-size: 0.88em;
  color: var(--yellow);
}

.prose strong { color: var(--text); }

.prose ul, .prose ol { padding-left: 0; }
.prose .howto { margin-top: 1.1em; }

/* The tick-list style used by .product__perks reads well in prose too. */
.prose .product__perks li { color: var(--text-dim); }

.prose .callout { margin-block: 1.6em; }

/* Anchor links beside headings — invisible until the heading is hovered, so
   they don't clutter the page for people who are just reading. */
.heading-anchor {
  margin-left: 10px;
  color: var(--text-mute);
  text-decoration: none;
  opacity: 0;
  font-weight: 400;
  transition: opacity .15s var(--ease);
}
.prose h2:hover .heading-anchor,
.heading-anchor:focus-visible { opacity: 1; }

/* --------------------------------------------------------------------------
   23. News list
   -------------------------------------------------------------------------- */
.newspost__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: #fff;
  line-height: 1.25;
}
.newspost .prose { max-width: none; }

.newspost__link { text-decoration: none; }
.newspost__link:hover { color: var(--yellow); }

/* Deep-linked post gets a brief edge highlight so a shared link lands
   somewhere obvious rather than mid-page with no explanation. */
.newspost--target {
  border-color: var(--yellow);
  box-shadow: 0 0 0 1px rgba(255, 183, 12, .3);
}

.newsteaser { display: block; text-decoration: none; }
.newsteaser h3 { color: #fff; }

/* --------------------------------------------------------------------------
   24. Guides index
   -------------------------------------------------------------------------- */
.guidecard {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all .18s var(--ease);
}
.guidecard:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateX(3px);
}

.guidecard__icon {
  width: 46px;
  height: 46px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--grad-red);
  color: #fff;
}
.guidecard__icon .icon { width: 22px; height: 22px; }

.guidecard__body { flex: 1; min-width: 0; }
.guidecard__title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: #fff;
  line-height: 1.3;
}
.guidecard__summary { color: var(--text-mute); margin-top: 4px; }

.guidecard__arrow { color: var(--text-mute); flex-shrink: 0; }
.guidecard:hover .guidecard__arrow { color: var(--yellow); }

@media (max-width: 560px) {
  .guidecard { gap: 14px; padding: 16px; }
  .guidecard__arrow { display: none; }
}

/* Breadcrumb above a guide */
.crumbs {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-mute);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--yellow); }

/* --------------------------------------------------------------------------
   25. Submission forms and the staff inbox
   -------------------------------------------------------------------------- */
/* Long answers get a stacked block; short ones stay on one row as a
   .totals__row. Mixing the two keeps a report card scannable. */
.answer {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.answer:last-child { border-bottom: 0; }

.answer__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 6px;
}
.answer__value {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.answer__value a { color: var(--yellow); }

/* --------------------------------------------------------------------------
   26. Footer columns
   -------------------------------------------------------------------------- */
.footer__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 28px;
}
.footer__cols > div { display: flex; flex-direction: column; gap: 9px; }

.footer__heading {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 2px;
}
.footer__cols a { font-size: 0.87rem; color: var(--text-mute); }
.footer__cols a:hover { color: var(--yellow); }

.footer__inner { border-top: 1px solid var(--border); padding-top: 24px; }

/* --------------------------------------------------------------------------
   27. Atlas (/atlas) — the unlisted page index
   -------------------------------------------------------------------------- */
.atlas-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.atlas-toolbar .input { flex: 1; min-width: 220px; }

.atlas { display: flex; flex-direction: column; }

.atlas__row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.atlas__row:last-child { border-bottom: 0; padding-bottom: 0; }
.atlas__row:first-child { padding-top: 0; }

.atlas__main { flex: 1; min-width: 0; }

.atlas__name {
  font-weight: 600;
  color: #fff;
  font-size: 0.96rem;
  margin-right: 9px;
}
.atlas__name:hover { color: var(--yellow); }

.atlas__path {
  font-size: 0.8rem;
  color: var(--text-mute);
  background: rgba(0, 0, 0, .32);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1px 6px;
}

.atlas__desc { margin-top: 4px; line-height: 1.5; }

.atlas__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Fixed width so the rows don't jump sideways as each check comes back. */
.atlas__status {
  min-width: 84px;
  text-align: right;
  font-family: var(--font-mono);
}

@media (max-width: 700px) {
  .atlas__row { flex-direction: column; align-items: stretch; gap: 8px; }
  .atlas__meta { justify-content: flex-start; }
  .atlas__status { min-width: 0; text-align: left; }
}

/* --------------------------------------------------------------------------
   28. Skygen Clicker (/game)
   -------------------------------------------------------------------------- */
.gamegrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 900px) {
  .gamegrid { grid-template-columns: 1fr; }
}

/* The counter column sticks so the big number stays put while you scroll a
   long generator list on desktop. */
@media (min-width: 901px) {
  .gamegrid__main { position: sticky; top: calc(var(--nav-h) + 20px); }
}

.game-core { text-align: center; }

.game-count {
  font-size: clamp(2.6rem, 8vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.game-stats { gap: 10px; text-align: center; }
.game-stats .stat__num { font-size: 1.15rem; }

/* ---- Altitude ---- */
.alt { text-align: left; }
.alt__zone {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}
.alt__metres { font-size: 1.3rem; font-weight: 700; color: var(--yellow); }

.alt__bar {
  height: 8px;
  border-radius: var(--r-xs);
  background: rgba(0, 0, 0, .4);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: 10px;
}
.alt__bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: var(--r-xs);
  background: var(--grad-brand);
  transition: width .3s var(--ease);
}

/* ---- The mine button ---- */
.miner { position: relative; margin-top: 22px; }

.miner__btn {
  position: relative;
  width: min(190px, 52vw);
  aspect-ratio: 1;
  margin-inline: auto;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: none;
  /* Nothing here should be selectable — a fast clicker otherwise ends up
     highlighting the label instead of mining. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.miner__face {
  position: absolute;
  inset: 0;
  border-radius: var(--r);
  background: var(--grad-red);
  border: 2px solid rgba(255, 255, 255, .16);
  box-shadow: 0 18px 44px -14px rgba(224, 31, 49, .7), inset 0 2px 0 rgba(255,255,255,.18);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.miner__btn:hover .miner__face { transform: translateY(-2px) scale(1.02); }
.miner__btn:active .miner__face { transform: translateY(2px) scale(.96); }
.miner__btn:focus-visible .miner__face { outline: 3px solid var(--yellow); outline-offset: 4px; }

.miner__label {
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: .14em;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
  pointer-events: none;
}

@keyframes miner-hit {
  0%   { transform: scale(1); }
  40%  { transform: scale(.94); }
  100% { transform: scale(1); }
}
.miner__btn.hit { animation: miner-hit .18s var(--ease); }

/* Floating +N on each click. */
.floaty {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--yellow);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
  pointer-events: none;
  animation: floaty-rise .9s var(--ease) forwards;
  z-index: 4;
}
@keyframes floaty-rise {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(.9); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--drift, 0px)), -180%) scale(1.15); }
}

/* ---- Golden block ---- */
.golden {
  position: fixed;
  width: 62px;
  height: 62px;
  border: 0;
  padding: 0;
  border-radius: var(--r);
  cursor: pointer;
  z-index: 60;
  background: linear-gradient(145deg, #ffe9a8, var(--yellow) 45%, #c08a06);
  box-shadow: 0 0 0 3px rgba(255, 183, 12, .25), 0 14px 40px -8px rgba(255, 183, 12, .75);
  animation: golden-in .3s var(--ease), golden-pulse 1.4s ease-in-out .3s infinite;
}
@keyframes golden-in   { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }
@keyframes golden-pulse{ 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.golden:hover { filter: brightness(1.12); }

/* ---- Generator rows ---- */
.genrow, .upgrow {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 13px 15px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease);
}
.genrow + .genrow, .upgrow + .upgrow { margin-top: 10px; }

.genrow:hover:not(:disabled), .upgrow:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateX(3px);
}
.genrow:disabled, .upgrow:disabled { cursor: not-allowed; }

/* Unaffordable stays readable rather than vanishing — you need to be able to
   read what you're saving up for. */
.genrow--poor, .upgrow--poor { opacity: .5; }

.genrow__icon {
  width: 42px; height: 42px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  flex-shrink: 0;
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--border);
  color: var(--yellow);
}
.genrow__icon .icon { width: 20px; height: 20px; }

.genrow__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.genrow__name { font-weight: 700; color: #fff; font-size: 0.95rem; }
.genrow__blurb { line-height: 1.4; }
.genrow__rate { color: var(--success); font-family: var(--font-mono); }

.genrow__buy { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; }
.genrow__owned { font-size: 1.25rem; font-weight: 800; color: #fff; line-height: 1; }
.genrow__cost { color: var(--yellow); }

/* ---- Upgrade rows ---- */
.upgrow__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.upgrow__name { font-weight: 700; color: #fff; font-size: 0.93rem; }
.upgrow__cost { color: var(--yellow); font-weight: 700; flex-shrink: 0; }

.owned-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.owned-chip {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--r-xs);
  background: rgba(52, 211, 153, .12);
  border: 1px solid rgba(52, 211, 153, .3);
  color: var(--success);
  cursor: help;
}

/* Count badge on the Upgrades tab. */
.seg__dot {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: var(--r-xs);
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
}

/* ---- Achievements ---- */
.achgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 9px;
}
.ach {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--border);
  opacity: .45;
}
.ach--got {
  opacity: 1;
  border-color: rgba(255, 183, 12, .35);
  background: rgba(255, 183, 12, .08);
}
.ach__name {
  display: block;
  font-weight: 700;
  font-size: 0.84rem;
  color: #fff;
  margin-bottom: 2px;
}
.ach--got .ach__name { color: var(--yellow); }
.ach__desc { display: block; line-height: 1.35; }

@media (max-width: 560px) {
  .genrow, .upgrow { padding: 11px 12px; gap: 11px; }
  .genrow__blurb { display: none; }
  .genrow__icon { width: 36px; height: 36px; }
}

/* --------------------------------------------------------------------------
   29. Launch waitlist
   -------------------------------------------------------------------------- */
.waitlist {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 32px;
  align-items: center;
}
.waitlist__text p { max-width: 46ch; }
.waitlist__form { min-width: 0; }

@media (max-width: 780px) {
  .waitlist { grid-template-columns: 1fr; gap: 22px; }
}

/* --------------------------------------------------------------------------
   30. Leaderboards
   -------------------------------------------------------------------------- */
.lb { display: flex; flex-direction: column; }

.lbrow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
}
.lbrow:nth-child(odd) { background: rgba(255, 255, 255, .028); }

.lbrow__rank {
  width: 34px;
  flex-shrink: 0;
  text-align: right;
  font-weight: 800;
  color: var(--text-mute);
  font-size: 0.95rem;
}
.lbrow__name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lbrow__value { flex-shrink: 0; font-weight: 700; color: var(--text-dim); }

/* Top three get colour; below that the number does the work on its own. */
.lbrow--gold   { background: rgba(255, 183, 12, .09);  border-color: rgba(255, 183, 12, .28); }
.lbrow--gold   .lbrow__rank,  .lbrow--gold   .lbrow__value { color: var(--yellow); }
.lbrow--silver { background: rgba(255, 255, 255, .055); border-color: rgba(255,255,255,.14); }
.lbrow--silver .lbrow__rank { color: #d8d4d0; }
.lbrow--bronze { background: rgba(255, 122, 24, .07);  border-color: rgba(255, 122, 24, .22); }
.lbrow--bronze .lbrow__rank { color: #ff9d2e; }

/* The row matching the current search, wherever it sits in the table. */
.lbrow--me {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(224, 31, 49, .3);
}

@media (max-width: 480px) {
  .lbrow { gap: 10px; padding: 10px 8px; }
  .lbrow__rank { width: 26px; }
}

/* --------------------------------------------------------------------------
   31. Footer legal strip
   -------------------------------------------------------------------------- */
.footer__legal {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.footer__legal a { font-size: 0.82rem; color: var(--text-mute); }
.footer__legal a:hover { color: var(--yellow); }


/* --------------------------------------------------------------------------
   32. Tap targets
   --------------------------------------------------------------------------
   WCAG 2.2 (2.5.8) wants interactive targets at least 24x24. Footer links and
   inline prose links were rendering at 23px high — one pixel short. Padding
   rather than a bigger font, so nothing about the design changes.
   -------------------------------------------------------------------------- */
.footer__cols a,
.footer__legal a,
.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.prose a,
.product__odds,
.crumbs a,
.newspost__link {
  /* Inline links can't grow their box without breaking the text flow, so the
     padding goes on the block axis where it costs nothing visually. */
  padding-block: 2px;
}

.heading-anchor { min-width: 24px; display: inline-block; text-align: center; }


/* --------------------------------------------------------------------------
   33. Title screen (home page)
   --------------------------------------------------------------------------
   Built like Minecraft's own title screen instead of a landing-page hero:
   an extruded block logo, the tilted yellow splash text, a stacked column of
   bevelled menu buttons, and version / status text in the bottom corners.
   The section sits on a strip of grass-block edge. The island art is inline
   SVG made of plain rects (see index.html).
   -------------------------------------------------------------------------- */
.title-screen {
  position: relative;
  min-height: min(640px, calc(100vh - var(--nav-h)));
  display: grid;
  place-items: center;
  padding: 56px 20px 92px;
  overflow: hidden;
  margin-bottom: 64px;
}

/* The ground: grass block edge, then dirt, along the bottom. */
.title-screen::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='24' shape-rendering='crispEdges'%3E%3Crect x='0' y='0' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='4' y='0' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='8' y='0' width='4' height='4' fill='%234a9e2f'/%3E%3Crect x='12' y='0' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='16' y='0' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='20' y='0' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='24' y='0' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='28' y='0' width='4' height='4' fill='%234a9e2f'/%3E%3Crect x='0' y='4' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%234a9e2f'/%3E%3Crect x='8' y='4' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='12' y='4' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='16' y='4' width='4' height='4' fill='%234a9e2f'/%3E%3Crect x='20' y='4' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='24' y='4' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='28' y='4' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='0' y='8' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='4' y='8' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='8' y='8' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='12' y='8' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='16' y='8' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='20' y='8' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='24' y='8' width='4' height='4' fill='%235fbf3f'/%3E%3Crect x='28' y='8' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='0' y='12' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='4' y='12' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='8' y='12' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='12' y='12' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='16' y='12' width='4' height='4' fill='%236d4423'/%3E%3Crect x='20' y='12' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='24' y='12' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='28' y='12' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='0' y='16' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='4' y='16' width='4' height='4' fill='%236d4423'/%3E%3Crect x='8' y='16' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='12' y='16' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='16' y='16' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='20' y='16' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='24' y='16' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='28' y='16' width='4' height='4' fill='%236d4423'/%3E%3Crect x='0' y='20' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='4' y='20' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='8' y='20' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='12' y='20' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='16' y='20' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='20' y='20' width='4' height='4' fill='%238a5a32'/%3E%3Crect x='24' y='20' width='4' height='4' fill='%236d4423'/%3E%3Crect x='28' y='20' width='4' height='4' fill='%238a5a32'/%3E%3C/svg%3E") repeat-x left top / 32px 24px;
  image-rendering: pixelated;
}

.title-screen__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 560px;
}

/* ---- Block logo ---- */
.mc-logo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
  line-height: 1;
}
/* Red face, black outline, then two layers of extrusion going down — the
   first shadows in the list paint on top, so the outline comes first. */
.mc-logo__main {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 9vw, 5.4rem);
  text-transform: uppercase;
  color: var(--red);
  letter-spacing: 0.02em;
  text-shadow:
    0.04em 0 0 #000, -0.04em 0 0 #000, 0 0.04em 0 #000, 0 -0.04em 0 #000,
    0.04em 0.04em 0 #000, -0.04em 0.04em 0 #000, 0.04em -0.04em 0 #000, -0.04em -0.04em 0 #000,
    0 0.09em 0 var(--red-deep), 0.04em 0.09em 0 #000, -0.04em 0.09em 0 #000,
    0 0.14em 0 #000;
}
/* The "JAVA EDITION" line under the real logo. */
.mc-logo__sub {
  margin-top: 0.55em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.95rem, 2.6vw, 1.45rem);
  letter-spacing: 0.5em;
  margin-right: -0.5em;   /* letter-spacing adds trailing space; cancel it */
  text-transform: uppercase;
  color: var(--yellow);
  text-shadow: 0.12em 0.12em 0 #000;
}

/* ---- Splash text: tilted, yellow, pulsing ---- */
.splash {
  position: absolute;
  right: -0.4em;
  bottom: 0.2em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.8rem, 2.2vw, 1.15rem);
  color: #ffff55;           /* the game's own splash yellow */
  text-shadow: 0.12em 0.12em 0 #3f3f15;
  white-space: nowrap;
  transform: rotate(-18deg);
  transform-origin: center;
  animation: splash-pulse 0.5s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes splash-pulse {
  from { transform: rotate(-18deg) scale(1); }
  to   { transform: rotate(-18deg) scale(1.08); }
}

/* ---- Menu buttons, bevelled like the game's ---- */
.mc-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 400px;
}
.mc-menu__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.mc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 16px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: #f0f0f0;
  text-shadow: 2px 2px 0 #3a3a3a;
  background: #6f6f6f;
  border: 2px solid #000;
  border-radius: 0;
  /* Light top-left, dark bottom-right, inside the black outline. */
  box-shadow: inset 2px 2px 0 #a8a8a8, inset -2px -3px 0 #4a4a4a;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mc-btn:hover {
  color: #ffffa0;
  background: #7d86b8;       /* the game's blue-grey hover */
  box-shadow: inset 2px 2px 0 #b6bde0, inset -2px -3px 0 #4e567f;
  outline: 2px solid #fff;
  outline-offset: -4px;
}
.mc-btn:active { box-shadow: inset 2px 3px 0 #3f3f3f, inset -2px -2px 0 #8a8a8a; }

.mc-btn--primary {
  min-height: 56px;
  font-size: 1.1rem;
  color: #fff;
  text-shadow: 2px 2px 0 var(--red-deep);
  background: var(--red);
  box-shadow: inset 2px 2px 0 #ff6b78, inset -2px -3px 0 #8c0d1a;
}
.mc-btn--primary:hover {
  color: #fff;
  background: #ee2c3e;
  box-shadow: inset 2px 2px 0 #ff8a95, inset -2px -3px 0 #8c0d1a;
}

.title-screen__tag {
  margin-top: 26px;
  font-size: 0.95rem;
  color: var(--text-dim);
}

/* ---- Corner text, like the version and copyright lines ---- */
.title-screen__corner {
  position: absolute;
  bottom: 34px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-dim);
  text-shadow: 1px 1px 0 #000;
}
.title-screen__corner--left  { left: 20px; }
.title-screen__corner--right { right: 20px; }
.title-screen__corner .mono { color: #fff; }

/* ---- Island art, drifting off to the side ---- */
.title-screen .hero__art {
  position: absolute;
  right: max(2vw, calc(50% - 640px));
  top: 64%;
  width: min(22vw, 280px);
  transform: translateY(-50%);
  opacity: 0.95;
  pointer-events: none;
}

/* Bob in whole-pixel steps (steps()), so the motion looks like sprite
   animation rather than smooth tweening. */
.hero__crystal { animation: crystal-bob 2.4s steps(2, jump-none) infinite alternate; }
.hero__island  { animation: island-bob 3.2s steps(2, jump-none) infinite alternate; }
.hero__cloud--a { animation: cloud-drift 9s steps(6) infinite alternate; }
.hero__cloud--b { animation: cloud-drift 11s steps(6) infinite alternate-reverse; }

@keyframes crystal-bob { from { transform: translateY(0); } to { transform: translateY(-8px); } }
@keyframes island-bob  { from { transform: translateY(0); } to { transform: translateY(8px); } }
@keyframes cloud-drift { from { transform: translateX(0); } to { transform: translateX(24px); } }

@media (prefers-reduced-motion: reduce) {
  .hero__crystal, .hero__island, .hero__cloud, .splash { animation: none; }
}

/* Below wide desktop the island moves above the logo so nothing overlaps. */
@media (max-width: 1180px) {
  .title-screen { padding-top: 24px; }
  .title-screen .hero__art {
    position: static;
    order: -1;
    width: 190px;
    transform: none;
    margin-bottom: 8px;
  }
  .title-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; }
}

/* Phones: corners stack under the menu instead of pinning to the edges. */
@media (max-width: 600px) {
  .title-screen { padding-bottom: 60px; }
  .title-screen__corner {
    position: static;
    justify-content: center;
    margin-top: 10px;
  }
  .title-screen__corner--left { margin-top: 22px; flex-direction: column; gap: 2px; }
  .title-screen__sep { display: none; }
  .splash { right: 0; bottom: -0.2em; }
  /* Two buttons share a row here, so they need a size that fits "How to join". */
  .mc-menu__row .mc-btn { font-size: 0.85rem; padding: 0 8px; white-space: nowrap; }
}
