/* ALWTO SMP - shared styles.
   Dark, in the family of the old ALWTO site; the accents are the colours of the spawn. */

:root {
  color-scheme: dark;
  --bg: #0f1116;
  --surface: #1b1f27;
  --surface-2: #161a21;
  --border: #2b313c;
  --text: #e8eaed;
  --muted: #a8b0bd;
  --dim: #c9d1dc;
  --red: #ff3b3b;
  --blue: #3b8cff;
  /* the wordmark: three stops of full-saturation red, three of blue (each word its own gradient) */
  --red-1: #ff5757;
  --red-2: #ff1f1f;
  --red-3: #cc0011;
  --blue-1: #52c5ff;
  --blue-2: #2b86ff;
  --blue-3: #2f47ff;
  --link: #7ab3ff;
  --on-blue: #08111f;
  /* the boards' values in the colours of the game's sidebar lines; the three boards the sidebar has no line for in
     game colours of their own */
  --money: #55ff55;
  --soul: #55ffff;
  --playtime: #ffff55;
  --kills: #ff5555;
  --deaths: #ffffff;
  --mobs: #ff55ff;
  --mined: #00aaaa;
  --placed: #ffaa00;
  --gold: #ffc21a;
  --silver: #d6dce4;
  --bronze: #d08a4e;
  --sky: #456d9c;
  --sky-2: #668bb0;
  --snow: #9ca7bc;
  --meadow: #728849;
  --meadow-2: #526737;
  --forest: #25332e;
  --lava: #d48233;
  --blossom: #c98bcd;
  --discord: #5865f2;
  --radius: 14px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }

/* The browser's own [hidden] rule loses to ANY author display rule, so without
   this `el.hidden = true` would not hide a button that has display:block. */
[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg) radial-gradient(1100px 460px at 50% -180px, rgba(69, 109, 156, .2), rgba(69, 109, 156, 0) 70%) no-repeat;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
/* A page whose content arrives after it: tall from the start, so the footer waits
   below the screen instead of being pushed down it when the content lands. */
.tall { min-height: 100vh; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 300;
  background: var(--blue); color: var(--on-blue); font-weight: 700;
  padding: 9px 14px; border-radius: 8px;
}
.skip:focus { top: 10px; }

/* Icons are drawn from one sheet the script adds to the page: the game's own 8x8 sidebar pictures, 16px, every pixel
   square. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 16px; height: 16px; flex: none; vertical-align: -3px; shape-rendering: crispEdges; }

/* ---------- wordmark: "ALWTO" in a red gradient and "SMP" in a blue one; the two never run into each other ---------- */
.wordmark { font-weight: 900; letter-spacing: .5px; display: inline-block; }
.wm-red { color: var(--red); }
.wm-blue { color: var(--blue); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .wm-red, .wm-blue {
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }
  .wm-red { background-image: linear-gradient(90deg, var(--red-1), var(--red-2) 55%, var(--red-3)); }
  .wm-blue { background-image: linear-gradient(90deg, var(--blue-1), var(--blue-2) 55%, var(--blue-3)); }
}
@media (forced-colors: active) {
  .wm-red, .wm-blue { background: none; -webkit-text-fill-color: currentColor; color: CanvasText; }
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 17, 22, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 26px; height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 1.15rem; flex: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; object-fit: contain; }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); font-weight: 600; font-size: .94rem; }
.nav a:hover, .nav a.is-active { color: var(--text); text-decoration: none; }
.nav .cta { background: var(--discord); color: #fff; padding: 9px 16px; border-radius: 9px; }
.nav .cta:hover { background: #4752c4; color: #fff; }

/* ---------- header search ---------- */
.search { position: relative; flex: 1; max-width: 300px; }
.search input, .find input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: 9px; padding: 9px 13px; font: inherit; font-size: .92rem;
}
.search input::placeholder, .find input::placeholder { color: var(--muted); opacity: 1; }
.search input:focus, .find input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(59, 140, 255, .35); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 250px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); z-index: 60;
}
.search-hit {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  color: var(--text); font-weight: 600; font-size: .9rem;
}
.search-hit:hover, .search-hit.is-active { background: rgba(255, 255, 255, .07); text-decoration: none; }
.search-hit .face { width: 22px; height: 22px; border-radius: 5px; }
.search-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit .money { margin-left: auto; font-weight: 700; font-size: .86rem; }
.search-empty { padding: 12px; color: var(--muted); font-size: .9rem; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 18px; margin: 24px auto 4px; max-width: var(--wrap);
  min-height: clamp(380px, 41vw, 470px);
  display: flex; align-items: center;
  background: var(--forest);
}
/* A real <img>, not a CSS background: it starts downloading while the HTML is
   still arriving, and a crawler can see it. */
.hero-img {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 30%;
}
/* The picture stays bright on the right; the left, where the text is, goes dark. */
.hero::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 12, 20, .88) 0%, rgba(8, 12, 20, .66) 34%, rgba(8, 12, 20, .16) 66%, rgba(8, 12, 20, 0) 100%),
    linear-gradient(0deg, rgba(8, 12, 20, .5) 0%, rgba(8, 12, 20, 0) 42%);
}
.hero-inner { position: relative; padding: 52px 46px; max-width: 660px; }
.hero h1 {
  font-size: clamp(2.4rem, 6.4vw, 3.7rem); line-height: 1.1;
  margin: 0 0 14px;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, .55));
}
.hero-lead { margin: 0; font-size: 1.12rem; color: #fff; max-width: 520px; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.ip-wrap { position: relative; display: inline-flex; }
.hero-note { margin: 14px 0 0; font-size: .86rem; color: var(--dim); text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }

/* Not open yet (the page learns it a moment after it loads): a badge pinned on the
   address button, which takes no room of its own, and two lines that swap. */
.when-closed { display: none; }
.is-closed .when-open { display: none; }
.is-closed .when-closed { display: inline; }
.soon {
  position: absolute; left: 14px; top: -15px;
  background: var(--lava); color: #1a1206;
  font-size: .74rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; line-height: 1.5;
  padding: 3px 11px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5); pointer-events: none;
}
.is-closed .soon.when-closed { display: block; }
.is-closed .join-sub { color: #f0a45d; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  border-radius: 10px; padding: 13px 20px;
  font-size: .95rem; font-weight: 700; font-family: inherit; line-height: 1.5;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-ip { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ip .ip { color: var(--link); }
.btn-ip .hint { color: var(--muted); font-weight: 500; min-width: 46px; text-align: left; }
.btn-discord { background: var(--discord); color: #fff; }
.btn-plain { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-more {
  display: flex; width: -moz-fit-content; width: fit-content; margin: 18px auto 0;
  background: var(--surface); border-color: var(--border); color: var(--text);
}
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-decoration: underline; }
/* An address or a port inside a sentence: click to copy. */
.code {
  font: inherit; font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; font-size: .92em;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--link);
  border-radius: 6px; padding: 1px 7px; cursor: pointer;
}
.code:hover { border-color: var(--blue); }

/* ---------- sections ---------- */
section { padding: 34px 0; }
.section-title { text-align: center; font-size: 2rem; font-weight: 800; margin: 0 0 6px; color: #fff; }
.section-sub { text-align: center; color: var(--muted); margin: 0 0 24px; }

/* ---------- stat strip ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 14px; }
.stat {
  flex: 1 1 170px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px 14px; text-align: center;
}
.stat b {
  display: block; font-size: 1.9rem; font-weight: 800; color: #fff; line-height: 1.15;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stat > span { color: var(--muted); font-size: .88rem; }
.stat .money { color: var(--money); }
.stat .ic { width: .82em; height: .82em; vertical-align: -.08em; margin-right: .22em; }
.stats-tight .stat { flex-basis: 150px; padding: 15px 12px; }
.stats-tight .stat b { font-size: 1.4rem; }

/* ---------- board tabs ---------- */
.lb-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.lb-controls-center { justify-content: center; }
.seg {
  position: relative; display: inline-flex; gap: 2px; max-width: 100%;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px;
  overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; font-size: .92rem;
  padding: 8px 11px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.seg button:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.seg button.is-active { background: var(--blue); color: var(--on-blue); }
/* Global, North America, Europe above the boards (NA / EU on a phone) */
.lb-region-row { margin-bottom: 12px; }
.seg-region button { padding: 6px 14px; font-size: .9rem; }
.seg-region .short { display: none; }
.lb-region-note { font-size: .86rem; color: var(--muted); }

.find { position: relative; flex: 0 1 200px; margin-left: auto; }
/* room for the note only while it shows: the placeholder gets the whole box */
.find:has(.find-note:not(:empty)) input { padding-right: 78px; }
/* How many the find box left, written inside the box: beside it, it would push the table down. */
.find-note {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: .8rem; color: var(--muted); pointer-events: none; white-space: nowrap;
}

/* ---------- board table ---------- */
.lb-table {
  width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.lb-table th {
  text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; padding: 14px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-table th.num { text-align: right; }
.lb-table td { padding: 12px 16px; border-bottom: 1px solid rgba(43, 49, 60, .55); overflow: hidden; }
.lb-table tr:last-child td { border-bottom: 0; }
.lb-table tbody tr:hover { background: rgba(255, 255, 255, .025); }
.col-rank { width: 88px; }
.col-val { width: 190px; }
/* Board switch in flight: keep the old rows, just dim them. */
.lb-table tbody { transition: opacity .12s; }
.lb-table.is-loading tbody { opacity: .45; }
.lb-rank { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.top1 { color: var(--gold); }
.top2 { color: var(--silver); }
.top3 { color: var(--bronze); }
.lb-player { display: flex; align-items: center; gap: 11px; font-weight: 700; color: #fff; min-width: 0; }
.lb-player:hover { text-decoration: none; }
.lb-player:hover .rk-n { text-decoration: underline; }
.lb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Faces are 8x8 pixel art scaled up: keep the pixels square, not blurred. */
.face { image-rendering: pixelated; background: var(--surface-2); flex: none; }
.lb-player .face { width: 28px; height: 28px; border-radius: 6px; }
.lb-val { font-weight: 800; color: #fff; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.money { color: var(--money); white-space: nowrap; }
.souls { color: var(--soul); white-space: nowrap; }
.val { white-space: nowrap; }
.v-playtime { color: var(--playtime); }
.v-kills { color: var(--kills); }
.v-deaths { color: var(--deaths); }
.v-mobs { color: var(--mobs); }
.v-mined { color: var(--mined); }
.v-placed { color: var(--placed); }
.money .ic, .souls .ic, .val .ic { margin-right: 5px; }
.notice { text-align: center; color: var(--muted); padding: 40px 16px; }
.lb-foot { text-align: center; margin: 14px 0 0; font-size: .86rem; color: var(--muted); }

/* Rank tags: a glyph in the rank's colour, then the name in its own. */
.rk-g { margin-right: .3em; font-weight: 400; }

/* Placeholder rows shown until the data lands: the same height as real rows, so
   the table is already its final size and nothing shifts. */
.sk {
  display: inline-block; height: 12px; border-radius: 6px; vertical-align: middle;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: sk-shimmer 1.3s linear infinite;
}
/* One line, whatever the width: a bar that wrapped under the face would make the row taller than a real one. */
.sk-row td { white-space: nowrap; line-height: 0; }
.sk-av { width: 28px; height: 28px; border-radius: 6px; margin-right: 11px; }
.sk-r { width: 26px; }
.sk-n { width: 128px; }
.sk-v { width: 52px; }
.sk-row:nth-child(3n+1) .sk-n { width: 150px; }
.sk-row:nth-child(3n+2) .sk-n { width: 104px; }
.sk-row:nth-child(4n) .sk-n { width: 92px; }
.sk-row:nth-child(2n) .sk-v { width: 44px; }
@keyframes sk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- cards ---------- */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.info-grid-2 { grid-template-columns: repeat(2, 1fr); }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 18px; }
.info-card h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 1.05rem; color: #fff; }
.info-card p { margin: 0; font-size: .93rem; color: var(--muted); }
.join-card { border-top: 3px solid var(--meadow); }
.join-card.is-bedrock { border-top-color: var(--snow); }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery a {
  display: block; overflow: hidden; aspect-ratio: 16 / 9;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
}
.gallery img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gallery a:hover img, .gallery a:focus-visible img { transform: scale(1.05); }

.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--text); overflow: hidden;
}
.lightbox::backdrop { background: rgba(6, 8, 12, .9); }
.lightbox figure {
  margin: 0; height: 100%; padding: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.lightbox img { display: block; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); background: var(--surface); }
.lightbox figcaption { color: var(--dim); font-size: .9rem; text-align: center; max-width: 760px; min-height: 1.5em; }
.lb-x, .lb-prev, .lb-next {
  position: absolute; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(27, 31, 39, .86); border: 1px solid var(--border); color: #fff;
  font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lb-x:hover, .lb-prev:hover, .lb-next:hover { background: var(--blue); color: var(--on-blue); }
.lb-x { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; margin-top: -22px; }
.lb-next { right: 14px; top: 50%; margin-top: -22px; }

/* ---------- player profile ---------- */
.profile-head {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px 18px; align-items: center;
  padding: 30px 0 22px;
}
.profile-avatar { grid-row: 1 / span 2; width: 64px; height: 64px; border-radius: 10px; }
.profile-name {
  align-self: end; margin: 0; min-height: 40px;
  font-size: 2rem; font-weight: 900; color: #fff; line-height: 1.25; overflow-wrap: anywhere;
}
.rank-chips { align-self: start; display: flex; gap: 8px; flex-wrap: wrap; min-height: 32px; }
.rank-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 13px; font-size: .82rem; color: var(--muted); font-weight: 600; white-space: nowrap;
}
.rank-chip b { color: var(--text); font-weight: 800; }
.rank-chip.is-online { color: #a4e8b0; border-color: rgba(134, 217, 147, .4); }
a.rank-chip:hover { border-color: var(--blue); color: var(--text); text-decoration: none; }
.chip-history { color: var(--link); border-color: rgba(59, 140, 255, .45); }
/* an earlier holder of a name another player has now: Name~2, the ~2 quieter */
.rk-alt { color: var(--muted); font-weight: 600; font-size: .8em; margin-left: 1px; }
.tile-rr { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #5fd47a; animation: dot-pulse 2s ease-out infinite; }
@keyframes dot-pulse {
  from { box-shadow: 0 0 0 0 rgba(95, 212, 122, .6); }
  to { box-shadow: 0 0 0 7px rgba(95, 212, 122, 0); }
}
.panel-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 1.2rem; font-weight: 800; margin: 30px 0 12px; color: #fff; }
.panel-title .muted { font-size: .88rem; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 108px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  color: var(--text);
}
a.tile:hover { border-color: var(--blue); text-decoration: none; }
.tile-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .86rem; font-weight: 600; }
.tile-value {
  font-size: 1.45rem; font-weight: 800; color: #fff; line-height: 1.25;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-value .money { color: var(--money); }
.tile-value .souls { color: var(--soul); }
.tile-value .ic { display: none; }
.tile-rank { font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile-rank .lb-rank { color: var(--text); }
.tile-rank .top1 { color: var(--gold); }
.tile-rank .top2 { color: var(--silver); }
.tile-rank .top3 { color: var(--bronze); }
.sk-col { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sk-col .sk { display: block; }
.profile-head .sk { display: block; }
.sk-name { width: 220px; max-width: 100%; height: 34px; }
.sk-chips { width: 340px; max-width: 100%; height: 32px; border-radius: 16px; }
.sk-l { width: 84px; }
.sk-b { width: 104px; height: 24px; }
.sk-s { width: 70px; }

/* ---------- purchases ---------- */
.buys { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.buy {
  display: grid; align-items: center; gap: 6px 16px;
  grid-template-columns: minmax(0, 1fr) auto 124px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 16px; font-size: .94rem;
}
.buy-main { display: flex; align-items: center; gap: 5px 10px; flex-wrap: wrap; min-width: 0; }
.buy-item { font-weight: 700; color: #fff; }
.buy-item.is-unknown { font-weight: 600; font-style: italic; color: var(--muted); }
.buy-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.buy-from { color: var(--muted); font-size: .86rem; }
.buy-cost { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.buy-when { font-size: .82rem; text-align: right; white-space: nowrap; color: var(--muted); }
.chip {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 7px; white-space: nowrap; color: var(--muted);
}
.chip-shop { color: #bcd28c; background: rgba(114, 136, 73, .18); border-color: rgba(114, 136, 73, .55); }
.chip-auction { color: #f2a65f; background: rgba(212, 130, 51, .14); border-color: rgba(212, 130, 51, .5); }
.chip-order { color: #a9c8ea; background: rgba(69, 109, 156, .22); border-color: rgba(102, 139, 176, .55); }

/* ---------- items (the economy, purchases) ---------- */
/* The game's own inventory pictures, 64 px drawn at 32 (24 in purchases): every pixel square. */
.item-ic { image-rendering: pixelated; flex: none; width: 32px; height: 32px; }
.buy .item-ic { width: 24px; height: 24px; }

/* ---------- the economy ---------- */
.ec-when { display: flex; gap: 12px 18px; flex-wrap: wrap; align-items: center; justify-content: center; margin-bottom: 20px; }
.day-pick, .sort { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.day-pick label, .sort label { white-space: nowrap; }
.day-pick input, .sort select {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 8px 10px; font: inherit; font-size: .92rem;
}
.day-pick input:disabled { opacity: .5; }
.day-pick input:focus, .sort select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(59, 140, 255, .35); }
.ec-stats { margin-bottom: 18px; }
.ec-stats .stat { cursor: default; }
.stat-more { display: block; margin-top: 2px; font-size: .8rem; font-weight: 700; }

.ec-chart { margin: 0 0 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 10px; }
.ec-chart-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: .86rem; color: var(--muted); font-weight: 600; }
.ec-chart-title { color: var(--text); font-weight: 800; }
.ec-chart-max .ic { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }
.ec-bars { height: 120px; margin-top: 10px; cursor: pointer; touch-action: pan-y; }
.ec-bars svg { display: block; width: 100%; height: 100%; }
.ec-bars .bar { fill: rgba(85, 255, 85, .22); }
.ec-bars .bar.is-in { fill: var(--money); }
.ec-bars .base { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ec-chart-axis { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.ec-chart-note { font-size: .86rem; color: var(--muted); min-height: 1.5em; margin: 4px 0 0; text-align: center; }
.ec-chart-note b { color: var(--text); }

.sort select { max-width: 100%; }
.item-cell { display: flex; align-items: center; gap: 11px; font-weight: 700; color: #fff; min-width: 0; }
.item-cell:hover { text-decoration: none; }
.item-cell:hover .item-name { text-decoration: underline; }
.item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-table .col-rank { width: 76px; }
.col-price, .col-metric { width: 170px; }
.ec-table td { padding-top: 9px; padding-bottom: 9px; }
/* A sell price in green as the server's, in the game's gold when a buy order pays it. */
.price { font-weight: 800; color: var(--money); white-space: nowrap; font-variant-numeric: tabular-nums; }
.price .ic { margin-right: 5px; }
.price-order, .price-order.price { color: #ffaa00; }
.price-by { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #ffaa00; font-weight: 700; line-height: 1.3; }
.price-ah { color: var(--muted); font-size: .86rem; white-space: nowrap; }
.metric { display: block; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-sub { display: block; font-size: .78rem; line-height: 1.3; white-space: nowrap; }
.metric-sub .money, .metric-sub .souls { font-weight: 600; }
.metric-sub .ic { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }
.premium { color: #ff55ff; white-space: nowrap; }

/* one item */
.item-head .item-head-ic { grid-row: 1 / span 2; width: 64px; height: 64px; border-radius: 0; background: none; }
.item-head .sk-av { width: 64px; height: 64px; border-radius: 10px; margin: 0; }
.item-advice { margin: 0 0 20px; color: var(--dim); max-width: 860px; }
.item-advice b { color: #fff; }
.item-advice .price .ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.rank-chip .price .ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.item-tiles { margin-bottom: 22px; }
.item-tiles .tile { min-height: 96px; }
.tile-unit { font-size: .9rem; font-weight: 700; color: var(--muted); }
.item-tiles .tile-rank .ic { display: inline; width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }
.item-chart .item-plot { height: 150px; cursor: default; }
.item-chart polyline { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.item-chart polyline.is-dot { stroke-width: 7; }
.item-chart .grid { stroke: rgba(43, 49, 60, .7); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 4 4; }
.ln-server { stroke: var(--money); }
.ln-order { stroke: #ffaa00; }
.ln-ah { stroke: var(--link); }
.item-legend { display: flex; gap: 6px 16px; flex-wrap: wrap; justify-content: center; font-size: .82rem; color: var(--muted); margin-top: 6px; }
.item-legend .key::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; background: currentColor; }
.item-legend .ln-server { color: var(--money); }
.item-legend .ln-order { color: #ffaa00; }
.item-legend .ln-ah { color: var(--link); }
.item-legend .key { color: var(--muted); }
.item-legend .key.ln-server::before { background: var(--money); }
.item-legend .key.ln-order::before { background: #ffaa00; }
.item-legend .key.ln-ah::before { background: var(--link); }
.day-table td { white-space: nowrap; }
.day-table th:first-child { width: 34%; }

/* a player's history */
.h-title { color: var(--muted); font-weight: 700; font-size: .62em; margin-left: 4px; }
.h-tiles { margin-bottom: 22px; }
.h-tiles .tile-rank .ic { display: none; }
.h-chart .item-plot { cursor: pointer; }
.h-chart-tabs { margin-bottom: 10px; }
.ln-h { stroke: var(--link); }
.delta { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.is-up { color: var(--money); }
.delta.is-down { color: #ff6b6b; }
.h-table tbody tr { cursor: pointer; }
.h-table tbody tr:hover td { background: rgba(255, 255, 255, .03); }
.h-table tr.is-picked td { background: rgba(59, 140, 255, .1); }
.h-table .h-pick { color: var(--text); font-weight: 700; text-decoration: none; }
.h-table .h-pick:hover { text-decoration: underline; }
.h-table .metric .ic { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }
.h-table th:first-child { width: auto; }
.h-table .d-short { display: none; }

.ec-help {
  margin-top: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 18px; color: var(--muted); font-size: .92rem;
}
.ec-help summary { cursor: pointer; color: var(--text); font-weight: 700; }
.ec-help dl { margin: 6px 0 0; }
.ec-help dt { color: var(--text); font-weight: 700; margin-top: 12px; }
.ec-help dd { margin: 2px 0 0; max-width: 72ch; }

/* ---------- a page with one thing to say (no such player, no such page) ---------- */
.lost { text-align: center; padding: 70px 0 40px; }
.lost h1 { margin: 0 0 10px; font-size: 1.7rem; color: #fff; overflow-wrap: anywhere; }
.lost p { margin: 0 auto 8px; color: var(--muted); max-width: 520px; }
.lost .cta-row { justify-content: center; }
.lost-code { display: block; font-size: clamp(4.5rem, 18vw, 8rem); line-height: 1; margin-bottom: 12px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 44px; padding: 30px 0 44px;
  color: var(--muted); font-size: .86rem; text-align: center;
}
.site-footer .wrap { max-width: 720px; }
.site-footer p { margin: 0 0 8px; line-height: 1.6; }
.footer-copy { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: .84rem; }
#year { display: inline-block; min-width: 2.3em; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 12px 20px; border-radius: 10px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 400;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- narrower screens ---------- */
@media (max-width: 1119px) {
  .find { flex-basis: 100%; max-width: 320px; margin-left: 0; }
}
@media (max-width: 900px) {
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .nav { gap: 14px; }
  .nav a:not(.cta) { font-size: .88rem; }
  /* Brand and nav on one row, the search on its own: sharing a row squeezes the
     box down to a stub nobody can type a name into. */
  .site-header .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px 16px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .hero { margin-top: 16px; border-radius: 14px; }
  .hero::after {
    background: linear-gradient(180deg, rgba(8, 12, 20, .78) 0%, rgba(8, 12, 20, .62) 55%, rgba(8, 12, 20, .78) 100%);
  }
  .hero-inner { padding: 36px 22px 30px; }
  .hero-lead { font-size: 1.02rem; }
  .section-title { font-size: 1.6rem; }
  .find { max-width: none; }
  .profile-head { column-gap: 14px; padding-top: 22px; }
  .profile-name { font-size: 1.55rem; }
  .buy { grid-template-columns: minmax(0, 1fr) auto; }
  .buy-when { grid-column: 1 / -1; text-align: left; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; margin-top: 0; }
}
@media (max-width: 680px) {
  /* The same room under "How to join": its not-open-yet line is the longer one and wraps first. */
  .join-sub { min-height: 3em; margin-bottom: 12px; }
}
@media (max-width: 560px) {
  .info-grid, .info-grid-2 { grid-template-columns: 1fr; }
  .stat { flex-basis: 132px; padding: 14px 10px; }
  .stat b { font-size: 1.45rem; }
  .stats-tight .stat { flex-basis: 132px; }
  .stats-tight .stat b { font-size: 1.2rem; }
  .lb-table th, .lb-table td { padding: 10px 9px; font-size: .9rem; }
  /* A long heading ("Blocks placed") takes two lines here; every heading keeps that
     height, so the rows do not move when the board changes. */
  .lb-table th { font-size: .7rem; height: 46px; padding-top: 8px; padding-bottom: 8px; line-height: 1.25; white-space: normal; }
  .col-rank { width: 70px; }
  .col-val { width: 110px; }
  /* the board's picture is on its tab: here a long number (12,345,678) needs the whole cell */
  .lb-val .ic { display: none; }
  .lb-player { gap: 8px; }
  .lb-player .face, .sk-av { width: 22px; height: 22px; }
  .sk-av { margin-right: 8px; }
  .sk-n { width: 84px; }
  .sk-row:nth-child(3n+1) .sk-n { width: 96px; }
  .sk-row:nth-child(3n+2) .sk-n { width: 72px; }
  .sk-row:nth-child(4n) .sk-n { width: 60px; }
  .profile-avatar { grid-row: auto; }
  .profile-name { align-self: center; }
  /* the economy's list: the picture smaller, the two numbers narrower, the name gets the rest (two lines at most) */
  .ec-table .col-rank { width: 42px; }
  .ec-table .lb-rank { font-size: .8rem; }
  .col-price { width: 92px; }
  .col-metric { width: 84px; }
  .item-cell { gap: 7px; }
  .item-cell .item-ic { width: 24px; height: 24px; }
  .ec-table .item-name {
    white-space: normal; font-size: .88rem; line-height: 1.25; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .price .ic { display: none; }
  .metric-sub .ic { display: none; }
  .ec-when { gap: 10px; }
  .day-pick { flex-wrap: wrap; justify-content: center; }
  .sort { flex: 1 1 100%; }
  .sort select { flex: 1; }
  .item-head .item-head-ic { grid-row: auto; }
  .day-table .col-wide { display: none; }
  .day-table th:first-child { width: auto; }
  .seg-region .long { display: none; }
  .seg-region .short { display: inline; }
  .h-table .metric .ic { display: none; }
  .h-table .d-long { display: none; }
  .h-table .d-short { display: inline; }
  .item-chart .item-plot { height: 120px; }
  /* On a phone the chips sit under the face, two to a row: the placeholder keeps that height. */
  .rank-chips { grid-column: 1 / -1; min-height: 72px; align-content: flex-start; }
  .sk-chips { width: 100%; height: 72px; }
  .tile { padding: 12px; min-height: 100px; }
  .tile-value { font-size: 1.22rem; }
  .tile-rank { font-size: .8rem; }
  /* Room for the longer line of the two that swap when the server is not open yet,
     so nothing below moves when it does. */
  .hero-inner { padding-bottom: 14px; }
  .hero-note { min-height: 3em; }
}
@media (max-width: 480px) {
  /* "1,442 players ranked · updated 11 minutes ago" may not fit one line here: always two,
     so the tabs and the table stay where they are whatever the board. */
  #lb-caption { min-height: 3em; }
  .cap-sep { display: none; }
  .cap-part { display: block; }
  /* The header's first row: logo, name, Leaderboards, Discord. Tighter, so it stays one row. */
  .brand { font-size: 1rem; gap: 8px; }
  .nav { gap: 10px; }
  .nav .cta { padding: 9px 13px; }
}
@media (max-width: 390px) {
  .brand .wordmark { display: none; }
  /* The narrowest phones: thinner cell edges, so a name with a rank tag still fits beside "#1,000" and its value. */
  .lb-table th, .lb-table td { padding-left: 7px; padding-right: 7px; }
  .col-rank { width: 66px; }
  .col-val { width: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  .sk, .dot { animation: none; }
  .gallery img, .toast, .lb-table tbody { transition: none; }
  .gallery a:hover img, .gallery a:focus-visible img { transform: none; }
}
