/* Restless Stats. The website's colours and system fonts (web/public/assets/site.css); no inline styles (CSP). */

:root {
  --bg: #0e0a13;
  --card: #1b1525;
  --card-2: #221a2f;
  --line: #3b2f4b;
  --line-soft: #2c2338;
  --text: #f5f0f8;
  --muted: #c6bcd3;
  --accent-2: #ffb347;
  --link: #ffc47a;
  --link-hover: #ffe0b0;
  --focus: #ffd58f;
  --on-accent: #1d0c0c;
  --grad: linear-gradient(90deg, #ff5e62 0%, #ffb347 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1120px;
  --gutter: 16px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", Menlo, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(1100px 520px at 85% -8%, rgba(255, 94, 98, 0.10), transparent 62%),
    radial-gradient(900px 520px at -10% 4%, rgba(132, 92, 255, 0.10), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 6vw, 2.9rem); }
h2 { font-size: clamp(1.25rem, 3.6vw, 1.5rem); }
h3 { font-size: 1.15rem; }
p, ul, dl { margin: 0 0 1rem; }

a { color: var(--link); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

code {
  font-family: var(--mono);
  font-size: 0.95em;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 0.05em 0.35em;
}

strong { color: #fff; }
.muted { color: var(--muted); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 640px) { :root { --gutter: 24px; } }

.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--accent-2); color: var(--on-accent); font-weight: 700;
  padding: 10px 16px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Header */

.site-header { border-bottom: 1px solid var(--line-soft); background: rgba(14, 10, 19, 0.92); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 20px; padding-top: 12px; padding-bottom: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
  font-family: var(--serif); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.02em;
}
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.brand-sub { color: var(--accent-2); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-block; padding: 8px 12px; border-radius: 999px; color: var(--text);
  text-decoration: none; font-weight: 600; font-size: 0.98rem;
}
.site-nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.site-nav a[aria-current="page"] {
  background: rgba(255, 179, 71, 0.14); color: var(--link-hover); box-shadow: inset 0 0 0 1px rgba(255, 179, 71, 0.4);
}

/* Page heads */

.page-head {
  padding: clamp(28px, 6vw, 56px) 0 clamp(18px, 4vw, 28px);
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(34, 26, 47, 0.55), rgba(14, 10, 19, 0));
}
.lead { max-width: 62ch; color: var(--muted); font-size: clamp(1.05rem, 3vw, 1.2rem); }
.content { padding-top: clamp(20px, 4vw, 32px); padding-bottom: clamp(40px, 8vw, 72px); }
.crumbs { margin: 0 0 0.4rem; color: var(--muted); font-size: 0.95rem; }
.crumbs .pn { color: var(--text); }
.as-of { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.25rem; }
.player-name { overflow-wrap: anywhere; }

.tag {
  display: inline-block; vertical-align: middle; margin-left: 4px; padding: 1px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.22);
  font-family: var(--sans); font-size: 0.75rem; font-weight: 700; color: var(--text); white-space: nowrap;
}

/* Search */

.search { max-width: 560px; margin: 1.25rem 0 0; }
.search label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.search-row { display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; min-height: 46px; padding: 8px 14px; font: inherit; color: var(--text);
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 999px;
}
.search input::placeholder { color: #8f849e; }
.hint { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.92rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 1rem;
  line-height: 1.2; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--grad); color: var(--on-accent); }
.btn-primary:hover { color: var(--on-accent); filter: brightness(1.08); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.28); color: var(--text); margin: 0 8px 8px 0; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* Board lists */

.board-group { margin-bottom: 2rem; }
.board-links {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: 1fr; gap: 10px;
}
@media (min-width: 640px) { .board-links { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .board-links { grid-template-columns: repeat(3, 1fr); } }
.board-links a {
  display: block; height: 100%; padding: 14px 16px; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
}
.board-links a:hover { border-color: rgba(255, 179, 71, 0.55); }
.bl-title { display: block; font-weight: 700; color: var(--link-hover); }
.bl-blurb { display: block; color: var(--muted); font-size: 0.92rem; }

/* Tables */

table { width: 100%; border-collapse: collapse; }
.board, .collections {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); overflow: hidden;
}
.board th, .board td, .collections th, .collections td {
  padding: 9px 12px; text-align: left; border-top: 1px solid var(--line-soft); vertical-align: top;
}
.board thead th, .collections thead th {
  border-top: 0; color: var(--muted); font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.board .place { width: 3.2rem; font-weight: 800; color: var(--accent-2); }
.board .value { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.board thead th:last-child { text-align: right; }
.board .who { overflow-wrap: anywhere; }
.board .private { color: var(--muted); font-style: italic; }
.board .profile { color: var(--muted); }
.count { color: var(--muted); margin-top: 0.75rem; }
.collections tbody th { font-weight: 600; }
.collections .maxed th, .collections .maxed td { color: #c9f5d9; }
.collections td { font-variant-numeric: tabular-nums; }

/* Player pages */

.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1060px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card {
  min-width: 0; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px;
}
.card > :last-child { margin-bottom: 0; }
.card-wide { grid-column: 1 / -1; }
.card h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big-number { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 0; }
.shared { color: var(--muted); font-size: 0.92rem; }

.picker ul { display: flex; flex-wrap: wrap; gap: 6px 8px; list-style: none; margin: 0 0 1rem; padding: 0; }
.picker a, .picker span {
  display: inline-block; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.05); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}
.picker span[aria-current="page"] {
  background: rgba(255, 179, 71, 0.14); color: var(--link-hover); box-shadow: inset 0 0 0 1px rgba(255, 179, 71, 0.4);
}

.profiles, .skills, .pets, .places, .sprites, .relics, .clears { list-style: none; padding: 0; margin: 0; }
.profiles li, .skills li, .pets li, .places li, .sprites li, .relics li, .clears li { padding: 6px 0; border-top: 1px solid var(--line-soft); }
.profiles li:first-child, .skills li:first-child, .pets li:first-child, .places li:first-child,
.sprites li:first-child, .relics li:first-child, .clears li:first-child { border-top: 0; }
.sk-name { display: inline-block; min-width: 7.5rem; }
.sk-row { display: flex; justify-content: space-between; gap: 12px; }
.sk-xp { font-size: 0.88rem; margin-top: 2px; }
.card h3 { margin: 1rem 0 0.25rem; font-size: 1.05rem; }
progress {
  display: block; width: 100%; height: 6px; margin-top: 4px; border: 0; border-radius: 3px;
  background: rgba(255, 255, 255, 0.08); appearance: none; -webkit-appearance: none;
}
progress::-webkit-progress-bar { background: rgba(255, 255, 255, 0.08); border-radius: 3px; }
progress::-webkit-progress-value { background: var(--grad); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--grad); border-radius: 3px; }

.facts { margin: 0; }
.facts > div { padding: 6px 0; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 12px; }
.facts > div:first-child { border-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; }
.facts-table th, .facts-table td { padding: 5px 0; border-top: 1px solid var(--line-soft); text-align: left; font-weight: 400; }
.facts-table tr:first-child th, .facts-table tr:first-child td { border-top: 0; }
.facts-table th { color: var(--muted); }
.facts-table td { text-align: right; font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.tags li {
  padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-soft);
  font-size: 0.9rem;
}

/* SkyBlock profile: the skin, Sky Rank, summary and skills at the top, then the sections as tabs */

.sky-hero { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; margin-bottom: 1.5rem; }
@media (min-width: 760px) { .sky-hero { grid-template-columns: 200px minmax(0, 1fr); } }
.sky-hero-main { min-width: 0; }
.sky-hero-main .as-of { margin-bottom: 0.75rem; }
.sky-hero-main h3 { margin: 0 0 0.25rem; }
.skin {
  margin: 0; padding: 20px; display: flex; justify-content: center;
  background: radial-gradient(160px 220px at 50% 40%, rgba(255, 179, 71, 0.10), transparent 70%), var(--card);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
}
.skin img, .skin svg { width: 160px; height: auto; image-rendering: pixelated; }
.skin-none svg { color: var(--line); fill: currentColor; }
@media (max-width: 759px) {
  .sky-hero .skin { justify-self: center; padding: 12px 28px; }
  .sky-hero .skin img, .sky-hero .skin svg { width: 88px; }
}
.overview { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 640px) { .overview { grid-template-columns: 136px minmax(0, 1fr); } }
.skin-sm { padding: 14px 24px; justify-self: center; }
.skin-sm img, .skin-sm svg { width: 96px; }
.overview .grid { min-width: 0; }

.sky-rank-line { display: flex; align-items: baseline; gap: 12px; margin: 0 0 0.25rem; }
.sky-rank-line .sky-rank { font-size: 2.6rem; line-height: 1; }
.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 1.25rem; }
@media (min-width: 980px) { .summary { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.summary > div {
  min-width: 0; padding: 10px 14px; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
}
.summary dt { color: var(--muted); font-size: 0.85rem; }
.summary dd { margin: 0; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.summary dd .muted { font-size: 0.9rem; font-weight: 600; }
.skills-2 { display: grid; grid-template-columns: 1fr; column-gap: 28px; }
@media (min-width: 640px) {
  .skills-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skills-2 li:nth-child(2) { border-top: 0; }
}

.tabs ul {
  display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 1rem; padding: 0 0 10px;
  border-bottom: 1px solid var(--line-soft);
}
.tabs a {
  display: inline-block; padding: 8px 14px; border-radius: 999px; color: var(--text); text-decoration: none;
  font-weight: 600; font-size: 0.98rem;
}
.tabs a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.tabs a[aria-current="true"] {
  background: rgba(255, 179, 71, 0.14); color: var(--link-hover); box-shadow: inset 0 0 0 1px rgba(255, 179, 71, 0.4);
}
.panels { display: grid; gap: 16px; }
.panel { min-width: 0; scroll-margin-top: 16px; }
.panel-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .panel-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.js-tabs > .panel { display: none; }
.js-tabs > .panel.on { display: block; }
.js-tabs > .panel-2.on { display: grid; }
.facts-table thead th { color: var(--muted); font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; }
.facts-table thead th:last-child { text-align: right; }

/* Sky Rank bands (the in-game colours) and pet rarities */

.sky-rank { font-weight: 800; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.sr-gray { color: #aaaaaa; }
.sr-white { color: #ffffff; }
.sr-aqua { color: #55ffff; }
.sr-dark-aqua { color: #26c6c6; }
.sr-blue { color: #8c8cff; }
.sr-light-purple { color: #ff70ff; }
.sr-gold { color: #ffaa00; }
.rarity { font-weight: 700; font-size: 0.9rem; }
.r-common { color: #e6e1ec; }
.r-uncommon { color: #6ee36e; }
.r-rare { color: #6fa8ff; }
.r-epic { color: #c98bff; }
.r-legendary { color: #ffb347; }
.r-mythic { color: #ff70ff; }

/* States shared by the profile sections (docs/skyblock/portal-additions-spec.md) */

.na { color: var(--muted); font-style: italic; font-weight: 400; font-size: 0.95em; }
.locked { color: var(--muted); }
.lock {
  display: inline-block; position: relative; width: 0.62em; height: 0.5em; margin: 0 0.3em 0 0.1em;
  border-radius: 2px; background: currentColor; vertical-align: -0.02em;
}
.lock::before {
  content: ""; position: absolute; left: 0.1em; right: 0.1em; bottom: 100%; height: 0.32em;
  border: 0.09em solid currentColor; border-bottom: 0; border-radius: 0.3em 0.3em 0 0;
}
.small { font-size: 0.9rem; }
.anchor {
  margin-left: 2px; font-family: var(--sans); font-size: 0.8em; font-weight: 600; color: var(--muted);
  text-decoration: none; opacity: 0.5;
}
.anchor:hover, .anchor:focus-visible { opacity: 1; color: var(--link); }
[id] { scroll-margin-top: 16px; }

/* SkyBlock profile and RPG character pages, laid out the way SkyBlock players know from stats viewers: one picture of
   our world behind the page, sharp in a fixed column on the left where the player stands, blurred behind a see-through
   panel on the right that scrolls. Both pictures are files fixed to the window, so they line up into one scene and
   nothing is blurred live. Amber for SkyBlock, purple for the RPG. */

body.sky {
  --side: clamp(300px, 30vw, 560px);
  --head: 62px;
  --glass: rgba(12, 9, 17, 0.42);
  --card: rgba(6, 4, 10, 0.46);
  --hair: rgba(255, 255, 255, 0.1);
  --track: rgba(255, 255, 255, 0.13);
  --gold: #ffc65c;
  --game: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --scene-sharp: url("/assets/sky-side.jpg");
  --scene-soft: url("/assets/sky-bg.jpg");
  background: #0b0810 var(--scene-soft) center / cover fixed no-repeat;
}
body.rpg {
  --grad: linear-gradient(90deg, #7a3fd8 0%, #b884ff 100%);
  --on-accent: #ffffff;
  --scene-sharp: url("/assets/rpg-side.jpg");
  --scene-soft: url("/assets/rpg-bg.jpg");
}
.sky .site-header { background: rgba(10, 7, 14, 0.86); border-bottom-color: var(--hair); }
.sky .site-header .wrap, .sky .site-footer .wrap { max-width: none; }
.sky .site-footer { position: relative; z-index: 5; background: #0b0810; }
.sky main { font-family: var(--game); }
.sb { display: block; }
.sb-side {
  display: flex; align-items: flex-end; justify-content: center; height: 330px; overflow: hidden;
  background: #1b1525 var(--scene-sharp) center / cover no-repeat;
}
.sb-main { min-width: 0; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px));
  background: rgba(12, 9, 17, 0.72); }
@media (min-width: 900px) {
  .sky .site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: var(--head); }
  .sky .site-header .header-inner { height: 100%; padding-top: 0; padding-bottom: 0; }
  .sb-side {
    position: fixed; top: var(--head); left: 0; bottom: 0; width: var(--side); height: auto; z-index: 1;
    align-items: center; background-attachment: fixed; border-right: 1px solid var(--hair);
  }
  .sb-main { margin-left: var(--side); min-height: 100vh; padding: calc(var(--head) + 26px) clamp(24px, 2.8vw, 44px) 56px;
    background: var(--glass); }
}
.sb-skin, .sb-crest { position: relative; margin: 0 0 14px; text-align: center; }
.sb-skin img, .sb-skin svg { display: block; height: 290px; width: auto; image-rendering: pixelated;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.55)); }
.sb-skin::after {     /* the ground under the player's feet */
  content: ""; position: absolute; left: 12%; right: 12%; bottom: -6px; height: 18px; z-index: -1;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent);
}
@media (min-width: 900px) {
  .sb-skin, .sb-crest { margin: 4vh 0 0; }
  .sb-skin img, .sb-skin svg { height: min(70vh, 640px); }
}
.sb-skin.skin-none svg { color: rgba(245, 240, 248, 0.3); fill: currentColor; }
.sb-crest .crest-ico { display: block; margin: 0 auto 14px; width: 120px; height: 120px; image-rendering: pixelated;
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.6)); }
@media (min-width: 900px) { .sb-crest .crest-ico { width: min(26vh, 220px); height: min(26vh, 220px); } }
.sb-crest figcaption { display: inline-block; padding: 8px 20px; border-radius: 14px; background: rgba(10, 7, 14, 0.78);
  font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.sb-crest figcaption span { font-size: 0.95rem; font-weight: 600; color: var(--muted); }
.sb-main .crumbs { font-size: 0.88rem; margin-bottom: 6px; }

/* "Stats for <name> on <profile>" */

.sb-title {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem); font-weight: 300; line-height: 1.2;
}
.sb-chip {
  display: inline-flex; align-items: center; gap: 12px; margin: 0; padding: 5px 20px 5px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--game); font-size: inherit; font-weight: 700; line-height: 1.2;
}
.sb-prof .sb-chip, .sb-title > .sb-chip:last-child { padding-left: 20px; }
.sb-name .sky-rank, .lvl-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 2.1em; padding: 4px 12px;
  border-radius: 999px; font-size: 0.5em; font-weight: 800; line-height: 1.1; color: var(--on-accent); background: var(--grad);
}
.sb-name .sky-rank { color: #1d0c0c; }
.sb-chip .tag { font-size: 0.42em; }
.sb-prof { position: relative; }
.sb-prof summary { list-style: none; cursor: pointer; }
.sb-prof summary::-webkit-details-marker { display: none; }
.sb-prof ul {
  position: absolute; z-index: 40; left: 0; top: calc(100% + 6px); min-width: 100%; margin: 0; padding: 6px;
  list-style: none; background: #1b1525; border: 1px solid var(--line); border-radius: 12px; font-size: 1rem;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}
.sb-prof li a { display: block; padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 600; }
.sb-prof li a:hover { background: rgba(255, 255, 255, 0.08); }

.sb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 16px; border-radius: 999px;
  background: var(--grad); color: var(--on-accent); font-weight: 700; font-size: 0.95rem; text-decoration: none;
}
.pill:hover { color: var(--on-accent); filter: brightness(1.1); }

/* Bars: a round icon that sits on the start of a thick bar, the name and level above it, XP on the right */

.sbars { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: 1fr; gap: 12px 34px; }
@media (min-width: 760px) { .sbars-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sbar-wide { grid-column: 1 / -1; } }
.sbar { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: end; column-gap: 0;
  border-radius: 10px; outline-offset: 3px; }
.sbar > .ico {
  position: relative; z-index: 1; width: 40px; height: 40px; padding: 7px; border-radius: 50%; image-rendering: pixelated;
  background: var(--grad); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.28);
}
.sbar-body { min-width: 0; margin-left: -4px; }
.sbar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 2px 3px 12px;
  font-size: 0.98rem; font-weight: 600; }
.sbar-top strong { font-weight: 700; }
.sbar-val { color: var(--text); font-size: 0.8rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; opacity: 0.92; }
.sky progress { height: 12px; margin: 0 0 4px; border-radius: 0 6px 6px 0; background: var(--track); }
.sky progress::-webkit-progress-bar { background: var(--track); border-radius: 0 6px 6px 0; }
.sky progress::-webkit-progress-value { border-radius: 0 6px 6px 0; }
.sky progress::-moz-progress-bar { border-radius: 0 6px 6px 0; }
.sky .tip progress, .sky .sb-card progress { border-radius: 6px; height: 9px; margin: 4px 0 6px; }
.sbar.soon { opacity: 0.55; }
.sbar.nobar .sbar-top { padding-bottom: 12px; border-bottom: 3px solid var(--track); }
.sbar-top .sky-rank { font-size: 1em; }

.sb-more { margin: 0 0 14px; }
.sb-more > summary {
  list-style: none; cursor: pointer; text-align: center; padding: 8px; border-radius: 999px; font-size: 0.92rem;
  font-weight: 700; border: 1px solid var(--hair); background: rgba(0, 0, 0, 0.18);
}
.sb-more > summary:hover { background: rgba(255, 255, 255, 0.06); }
.sb-more > summary::-webkit-details-marker { display: none; }
.sb-more[open] > summary { margin-bottom: 12px; }
.sb-more h3 { margin: 0 0 0.2rem; font-family: var(--game); font-size: 1.05rem; }
.next-up { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
@media (min-width: 640px) { .next-up { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.next-up a {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--hair); border-radius: 12px;
}
.next-up .ico { image-rendering: pixelated; }
.next-up span span { display: block; font-size: 0.85rem; }

.sb-line { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 4px 0 4px; font-size: 1.02rem; }
.sb-line div { display: inline-flex; gap: 6px; }
.sb-line dt { color: var(--muted); font-weight: 600; }
.sb-line dt::after { content: ":"; }
.sb-line dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.sb-main .as-of { font-size: 0.82rem; margin: 0 0 22px; }

/* Tabs, panels and cards */

.sb-tabs ul { gap: 6px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 179, 71, 0.6); }
.rpg .sb-tabs ul { border-bottom-color: rgba(184, 132, 255, 0.6); }
.sb-tabs a { padding: 6px 14px; font-size: 1.02rem; font-weight: 600; color: rgba(245, 240, 248, 0.86); }
.sb-tabs a:hover { color: #fff; }
.sb-tabs a[aria-current="true"] { background: var(--grad); color: var(--on-accent); box-shadow: none; }
.sky .sb-tabs a[aria-current="true"] { color: #1d0c0c; }
.rpg .sb-tabs a[aria-current="true"] { color: #fff; }
.sb-panel { display: grid; gap: 16px; }
.js-tabs > .sb-panel.on { display: grid; }
.sb-card {
  min-width: 0; padding: 18px 20px; border-radius: 14px; background: var(--card); border: 1px solid var(--hair);
}
.sb-card > :last-child { margin-bottom: 0; }
.sb-card h3 { margin: 0 0 0.6rem; font-family: var(--game); font-size: 1.3rem; font-weight: 700; }
.kv { margin: 0 0 3px; font-size: 1.02rem; }
.kv span { color: var(--muted); font-weight: 600; }
.kv strong { font-weight: 700; }
.sb-cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1100px) { .sb-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sb-ch { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.sb-ch h3 { margin: 0; }
.sb-ch .ico { image-rendering: pixelated; }
.big { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; }
.mini-bars { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.mini-bars li { font-size: 0.95rem; }
.sb-pn { display: flex; justify-content: space-between; gap: 10px; margin: 2px 0 0; }
.sb-pn .pill { font-size: 1.05rem; min-height: 38px; padding: 4px 18px; }

.find input {
  width: 100%; min-height: 42px; padding: 6px 18px; font: inherit; color: var(--text);
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--hair); border-radius: 999px;
}
.find-count { margin: 6px 0 0; font-size: 0.88rem; min-height: 1.3em; }
.sb-pills ul {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; width: fit-content; max-width: 100%;
  margin: 10px auto 6px; padding: 4px; list-style: none; border-radius: 999px; background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--hair);
}
.sb-pills a { display: inline-block; padding: 5px 16px; border-radius: 999px; color: var(--text); text-decoration: none;
  font-size: 0.95rem; font-weight: 600; }
.sb-pills a:hover { background: rgba(255, 255, 255, 0.08); }
.sb-pills a.on { background: var(--grad); color: var(--on-accent); }
.sb-group { margin-top: 16px; }
.sb-gh { display: flex; align-items: baseline; gap: 12px; }
.sb-gh h3 { margin: 0; font-size: 1.1rem; }
.sb-gh .muted { font-size: 0.9rem; font-weight: 600; }

/* Item tiles: an icon, the name and tier, the amount; greyed when not started, gold when every tier is done */

.tiles { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tile {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 10px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.36); border: 1px solid rgba(255, 255, 255, 0.07); outline-offset: 2px;
}
.tile:hover, .tile:focus { border-color: rgba(255, 179, 71, 0.6); background: rgba(0, 0, 0, 0.5); }
.rpg .tile:hover, .rpg .tile:focus { border-color: rgba(184, 132, 255, 0.65); }
.tile .ico { width: 36px; height: 36px; image-rendering: pixelated; }
.t-txt { display: flex; flex-direction: column; line-height: 1.25; }
.t-name { font-weight: 700; font-size: 0.95rem; }
.t-sub { color: var(--muted); font-size: 0.82rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile.none > .ico, .tile.none > .t-txt { opacity: 0.42; }
.tile.none > .ico { filter: grayscale(1); }
.tile.maxed { border-color: rgba(255, 198, 92, 0.55); }
.tile.maxed .t-name { color: var(--gold); }

/* Square tiles for pets and gear: the rarity's colour, a big icon, the name and level under it */

.pet-tiles { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 14px; }
.pet-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 92px; text-align: center;
  border-radius: 14px; outline-offset: 3px;
}
.pet-tile > .ico { width: 72px; height: 72px; padding: 12px; border-radius: 14px; background: #8d8a99; image-rendering: pixelated;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18); }
.pet-tile:hover > .ico, .pet-tile:focus > .ico { filter: brightness(1.12); }
.pet-tile .t-name { font-size: 0.85rem; overflow-wrap: anywhere; line-height: 1.2; }
.t-lvl { font-size: 0.8rem; font-weight: 700; color: var(--gold); }
.r-bg-common > .ico { background: #8d8a99; }
.r-bg-uncommon > .ico { background: #3f9e4d; }
.r-bg-rare > .ico { background: #3f68d1; }
.r-bg-epic > .ico { background: #8a42cf; }
.r-bg-legendary > .ico { background: #e0952a; }
.r-bg-mythic > .ico { background: #cf42c4; }
.pet-tile.none > .ico { background: #3b3248; opacity: 0.6; }
.pet-tile.none .t-name { color: var(--muted); font-weight: 600; }
.tip .r-common { color: #e6e1ec; }
.rpg .tip .tip-h { background: rgba(184, 132, 255, 0.16); border-bottom-color: rgba(184, 132, 255, 0.4); }

/* The card a tile or bar shows on hover, keyboard focus or a tap */

.tip {
  display: none; position: absolute; z-index: 30; left: 0; top: calc(100% + 6px); width: max-content;
  max-width: min(300px, 82vw); padding: 0 0 8px; text-align: left; font-size: 0.84rem; font-weight: 400; line-height: 1.45;
  color: var(--text); background: rgba(13, 9, 18, 0.97); border: 1px solid #4a3b5e; border-radius: 10px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
}
.tip p { margin: 0 12px 4px; }
.tip .tip-h {
  margin: 0 0 8px; padding: 7px 12px; border-radius: 10px 10px 0 0; font-weight: 800; letter-spacing: 0.05em;
  text-transform: uppercase; background: rgba(255, 179, 71, 0.14); border-bottom: 1px solid rgba(255, 179, 71, 0.35);
}
.tip progress { display: block; width: calc(100% - 24px); margin: 2px 12px 4px; }
.tip .ladder { display: flex; flex-wrap: wrap; gap: 2px 7px; font-weight: 700; }
.tip .ladder .on { color: #ffc65c; }
.tip .ladder .off { color: #6e6280; }
.tip .knack.locked { color: var(--muted); }
.tile:hover > .tip, .tile:focus > .tip, .pet-tile:hover > .tip, .pet-tile:focus > .tip,
.sbar:hover > .tip, .sbar:focus > .tip { display: block; }
.tip.flip-x { left: auto; right: 0; }
.tip.flip-y { top: auto; bottom: calc(100% + 6px); }
.r-common { color: #e6e1ec; }

@media (prefers-reduced-motion: no-preference) {
  .tile:hover > .tip, .tile:focus > .tip, .pet-tile:hover > .tip, .pet-tile:focus > .tip { animation: card-in 0.12s ease-out; }
}
@keyframes card-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* The device's own settings, no switch on the site: nothing see-through, more contrast when asked */

@media (prefers-reduced-transparency: reduce) {
  .site-header, .sky .site-header { background: var(--bg); }
  .page-head { background: var(--bg); }
  .sb-main { background: #120d18; }
  .sb-card, .tile { background: #1b1525; }
}
@media (prefers-contrast: more) {
  :root { --muted: #e2dbea; --line-soft: #5a4a6e; --line: #7a6890; }
  .site-header, .sb-main { background: var(--bg); }
  .anchor { opacity: 1; }
  .tile.none > .ico, .tile.none > .t-txt { opacity: 0.75; }
}

/* Not found, about */

.notfound { padding-top: clamp(40px, 9vw, 96px); padding-bottom: clamp(40px, 9vw, 96px); }
.prose { max-width: 74ch; }
.prose h2 { margin-top: 2rem; }

/* Footer */

.site-footer {
  border-top: 1px solid var(--line-soft); background: #0b0810; color: var(--muted); font-size: 0.95rem; padding: 28px 0 22px;
}
.site-footer a { color: var(--link); }
.disclaimer {
  margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft);
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
