/* Roblox site kit: one stylesheet for every game. The accent colour comes from game.json.
   Look: chunky cartoon UI. Thick dark outlines, hard drop shadows, pastel cards, rounded type. */
:root {
  --ink: #1b1d36;
  --edge: #1b1d36;
  --muted: #4f5578;
  --paper: color-mix(in srgb, var(--accent) 6%, #ffffff);
  --dots: color-mix(in srgb, var(--accent) 16%, transparent);
  --panel: #ffffff;
  --line: color-mix(in srgb, var(--edge) 14%, transparent);
  --soft: color-mix(in srgb, var(--accent) 9%, #ffffff);
  --pop: #ffdd3c;
  --play: #3fcf4e;
  --t1: #e6fbdc;
  --t2: #fff3d1;
  --t3: #e0f0ff;
  --t4: #eee6ff;
  --t5: #ffe4ec;
  --win: #128a4e;
  --loss: #c62f45;
  --fair: #a86b00;
  --bw: 3px;
  --lift: 5px;
  --radius-s: 10px;
  --radius-m: 18px;
  --display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Fredoka", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1f2ff;
    --edge: #05060e;
    --muted: #aab0d6;
    --paper: color-mix(in srgb, var(--accent) 10%, #12142a);
    --dots: color-mix(in srgb, var(--accent) 22%, transparent);
    --panel: #1f2244;
    --line: rgba(255, 255, 255, 0.09);
    --soft: color-mix(in srgb, var(--accent) 16%, #1f2244);
    --t1: #1d3a2b;
    --t2: #3b3220;
    --t3: #1c3150;
    --t4: #2d2653;
    --t5: #43233a;
    --win: #4cd38c;
    --loss: #ff7a8c;
    --fair: #ffc25a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--paper) radial-gradient(var(--dots) 1.5px, transparent 1.7px) 0 0 / 22px 22px;
  color: var(--ink);
  font: 500 17px/1.55 var(--body);
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; width: 100%; }
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--panel); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 48px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.1rem, 5.6vw, 3.3rem); margin: 0.45em 0 0.3em; max-width: 22ch; text-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 35%, transparent); }
h2 { font-size: clamp(1.45rem, 3.2vw, 1.85rem); margin: 1.7em 0 0.55em; }
p, li, dd { max-width: 70ch; }
.lede { font-size: 1.12rem; color: var(--muted); margin-top: 0; }
.note { color: var(--muted); font-size: 0.92rem; margin-top: 2.5em; }

/* Shared chunky surface */
.tools a, table.data, .tier-row, .stats div, .calc-row, .verdict, details, .facts div, .hero .lede {
  background: var(--panel);
  border: var(--bw) solid var(--edge);
  border-radius: var(--radius-m);
  box-shadow: 0 var(--lift) 0 var(--edge);
}

/* Header */
.top { background: var(--panel); border-bottom: var(--bw) solid var(--edge); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; gap: 16px; min-height: 62px; }
.brand { font: 400 1.3rem/1 var(--display); text-decoration: none; white-space: nowrap; letter-spacing: 0.01em; }
.brand::before {
  content: ""; display: inline-block; width: 1.05em; height: 1.05em; margin-right: 0.45em; vertical-align: -0.17em;
  background: var(--accent) radial-gradient(circle, var(--accent-ink) 22%, transparent 24%) center / 100% 100%;
  border: 2px solid var(--edge); border-radius: 7px; box-shadow: 0 2px 0 var(--edge);
}
.top nav { overflow-x: auto; scrollbar-width: none; flex: 1; padding: 4px 2px 6px; }
.top nav::-webkit-scrollbar { display: none; }
.top ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.top nav a { display: block; padding: 6px 11px; border: 2px solid transparent; border-radius: 999px; text-decoration: none; color: var(--ink); white-space: nowrap; font-weight: 600; font-size: 0.97rem; }
.top nav a:hover { background: var(--soft); color: var(--ink); }
.top nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--edge); box-shadow: 0 2px 0 var(--edge); }
.play {
  order: 3; flex: none; font: 400 1.05rem/1 var(--display); letter-spacing: 0.02em; text-decoration: none;
  background: var(--play); color: #fff; padding: 9px 16px; border: var(--bw) solid var(--edge); border-radius: 12px;
  box-shadow: 0 4px 0 var(--edge); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.play:hover { color: #fff; filter: brightness(1.06); }
@media (max-width: 760px) {
  .top-in { flex-wrap: wrap; gap: 6px 12px; padding-top: 10px; }
  .brand { flex: 1; }
  .play { order: 2; padding: 7px 13px; }
  .top nav { order: 4; flex-basis: 100%; margin: 0 -16px; padding: 2px 16px 10px; }
}

.crumbs { font-size: 0.9rem; color: var(--muted); padding-top: 16px; font-weight: 600; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 2px; }

/* The die: tier chips look like dice faces */
.die {
  display: inline-grid; place-items: center;
  min-width: 2.1em; height: 2.1em; padding: 0 0.4em;
  border-radius: 0.5em; border: 2px solid var(--edge);
  background: var(--c, var(--accent)); color: var(--ci, #fff);
  font: 400 0.9rem/1 var(--display); letter-spacing: 0.02em;
  box-shadow: 0 2px 0 var(--edge), inset 0 -0.2em 0 rgba(0, 0, 0, 0.18), inset 0 0.12em 0 rgba(255, 255, 255, 0.4);
  vertical-align: middle;
}
.die-lg { font-size: 1.6rem; min-width: 2.2em; height: 2.2em; }
.die-pending { --c: var(--soft); --ci: var(--muted); }

/* Home hero: full-width band in the accent colour */
.hero {
  margin: 0 calc(50% - 50vw) 8px;
  padding: 36px max(16px, calc(50vw - 514px)) 44px;
  background:
    radial-gradient(rgba(255, 255, 255, 0.22) 2px, transparent 2.3px) 0 0 / 26px 26px,
    linear-gradient(170deg, color-mix(in srgb, var(--accent) 70%, #ffffff), var(--accent) 70%);
  border-bottom: var(--bw) solid var(--edge);
}
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px 40px; align-items: center; }
.hero .facts { grid-column: 1 / -1; }
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.podium { background: var(--panel); border: var(--bw) solid var(--edge); border-radius: var(--radius-m); box-shadow: 0 var(--lift) 0 var(--edge); padding: 14px 18px 16px; transform: rotate(1.5deg); }
.podium-title { margin: 0 0 8px; font: 400 1.3rem var(--display); }
.podium ol { list-style: none; margin: 0 0 10px; padding: 0; counter-reset: pod; }
.podium li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 2px solid var(--line); }
.podium li a { font-weight: 700; text-decoration: none; }
.podium li > span:last-child { font: 400 1.05rem var(--display); color: var(--win); }
.hero .facts { margin-top: 4px; }
.hero h1 { margin: 0 0 18px; max-width: none; text-shadow: none; line-height: 0.98; }
.hero h1 span { display: block; -webkit-text-stroke: 0.16em var(--edge); paint-order: stroke fill; text-shadow: 0 0.09em 0 var(--edge); }
.hero-game { color: #fff; font-size: clamp(2.8rem, 9vw, 5.2rem); }
.hero-sub { color: var(--pop); font-size: clamp(1.6rem, 4.6vw, 2.6rem); margin-top: 0.12em; }
.hero .lede { color: var(--ink); padding: 14px 18px; max-width: 60ch; }
.finder { margin-top: 22px; max-width: 580px; }
.finder label { display: block; font: 400 1.15rem var(--display); color: #fff; -webkit-text-stroke: 5px var(--edge); paint-order: stroke fill; margin-bottom: 8px; letter-spacing: 0.02em; }
.finder-row { display: flex; gap: 10px; }
.finder input { flex: 1; min-width: 0; box-shadow: 0 4px 0 var(--edge); }
.finder button { background: var(--pop); color: var(--edge); }
.finder button:hover { color: var(--edge); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 30px 0 0; }
.facts div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 12px 16px; text-align: center; }
.facts div:nth-child(5n+1) { background: var(--t1); }
.facts div:nth-child(5n+2) { background: var(--t2); }
.facts div:nth-child(5n+3) { background: var(--t3); }
.facts div:nth-child(5n+4) { background: var(--t4); }
.facts div:nth-child(5n+5) { background: var(--t5); }
.facts dd { margin: 0; font: 400 clamp(1.6rem, 3.6vw, 2.1rem)/1.1 var(--display); max-width: none; font-variant-numeric: tabular-nums; }
.facts dt { color: var(--muted); font-weight: 600; font-size: 0.92rem; }

/* Tool cards */
.tools { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.tools li { max-width: none; }
.tools a { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-content: start; height: 100%; padding: 14px 16px; text-decoration: none; transition: transform 0.12s, box-shadow 0.12s; }
.tools a:hover { color: inherit; transform: translateY(-3px); box-shadow: 0 calc(var(--lift) + 3px) 0 var(--edge); }
.tools a:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--edge); }
.tool-icon { grid-row: span 2; display: grid; place-items: center; width: 52px; height: 52px; font-size: 1.7rem; border: 2px solid var(--edge); border-radius: 14px; background: var(--t1); box-shadow: 0 3px 0 var(--edge); }
.tools li:nth-child(5n+2) .tool-icon { background: var(--t2); }
.tools li:nth-child(5n+3) .tool-icon { background: var(--t3); }
.tools li:nth-child(5n+4) .tool-icon { background: var(--t4); }
.tools li:nth-child(5n+5) .tool-icon { background: var(--t5); }
.tools strong { font: 400 1.22rem/1.2 var(--display); letter-spacing: 0.01em; align-self: end; }
.tools a:hover strong { color: var(--accent); }
.tools span:not(.tool-icon) { color: var(--muted); font-size: 0.95rem; line-height: 1.4; }
.more { font-weight: 700; }

/* Forms */
input, select, button { font: inherit; color: inherit; }
input[type="search"], input[type="text"], input[type="number"], select {
  background: var(--panel); border: var(--bw) solid var(--edge); border-radius: 12px;
  padding: 8px 12px; min-height: 48px; width: 100%; font-weight: 600;
}
input:hover, select:hover { border-color: var(--accent); }
input[aria-invalid="true"] { border-color: var(--loss); }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 8px 18px; border: var(--bw) solid var(--edge); border-radius: 12px;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none;
  font: 400 1.08rem/1 var(--display); letter-spacing: 0.02em;
  box-shadow: 0 4px 0 var(--edge), inset 0 -4px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.08s, box-shadow 0.08s;
}
button:hover, .button:hover { filter: brightness(1.08); color: var(--accent-ink); }
button:active, .button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge), inset 0 -2px 0 rgba(0, 0, 0, 0.15); }
button.quiet, button.remove { background: var(--panel); color: var(--ink); box-shadow: 0 4px 0 var(--edge); }
button.quiet:hover, button.remove:hover { color: var(--loss); filter: none; }
label { font-weight: 700; font-size: 0.95rem; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.field-grid p, .calc-row p { margin: 0 0 12px; }
.field-grid label, .calc-row label { display: block; margin-bottom: 4px; }
.field-inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.field-inline input { width: 120px; }
.hint { color: var(--muted); font-size: 0.9rem; margin-top: 0; }

/* Tables */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px calc(var(--lift) + 4px); }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; overflow: hidden; }
.data th, .data td { padding: 10px 14px; text-align: left; border-bottom: 2px solid var(--line); white-space: nowrap; }
.data thead th { background: var(--accent); color: var(--accent-ink); font: 400 1rem var(--display); letter-spacing: 0.02em; border-bottom: var(--bw) solid var(--edge); }
.data tbody tr:nth-child(even) { background: color-mix(in srgb, var(--soft) 55%, transparent); }
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr:hover { background: var(--soft); }
.data .num { text-align: right; }
.data td a { font-weight: 700; }
.sortable th[data-sort] { cursor: pointer; user-select: none; }
.sortable th[data-sort]:hover { filter: brightness(1.1); }
.sortable th[aria-sort="ascending"]::after { content: " ▲"; font-size: 0.7em; }
.sortable th[aria-sort="descending"]::after { content: " ▼"; font-size: 0.7em; }
.table-tools { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; max-width: 420px; }
.flag { color: var(--fair); font-weight: 700; cursor: help; }
tr.owned-ish td { color: var(--muted); }
tr.owned-ish td:last-child { color: var(--win); font-weight: 700; }

/* Tier list */
.tiers { display: grid; gap: 16px; margin-top: 20px; }
.tier-row { display: grid; grid-template-columns: 7rem 1fr; align-items: stretch; overflow: hidden; }
.tier-name { margin: 0; display: grid; place-items: center; padding: 14px 8px; background: var(--c); border-right: var(--bw) solid var(--edge); }
.tier-name .die { font-size: 2rem; background: transparent; border: 0; box-shadow: none; color: #fff; -webkit-text-stroke: 0.16em var(--edge); paint-order: stroke fill; text-shadow: 0 0.08em 0 var(--edge); }
.tier-row > div { padding: 14px 16px; background: color-mix(in srgb, var(--c) 10%, var(--panel)); }
.tier-range { margin: 0 0 10px; color: var(--muted); font-size: 0.92rem; font-weight: 600; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips a { display: inline-block; padding: 6px 13px; border-radius: 999px; background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 3px 0 var(--edge); text-decoration: none; font-weight: 700; }
.chips a:hover { background: var(--c); color: var(--ci); }
.chips small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.chips a:hover small { color: inherit; }
.chips .empty { color: var(--muted); }
@media (max-width: 520px) {
  .tier-row { grid-template-columns: 1fr; }
  .tier-name { border-right: 0; border-bottom: var(--bw) solid var(--edge); padding: 6px; }
}

/* A to Z */
.az { list-style: none; padding: 0; columns: 3 200px; column-gap: 24px; }
.az li { break-inside: avoid; margin: 0 0 10px; }
.az a { text-decoration: none; font-weight: 700; }
.az .die { font-size: 0.72rem; margin-right: 8px; }

/* Item page */
.item-head { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.item-head h1 { margin: 0; }
.item-head + .lede { margin-top: 14px; }
.item-head .die { font-size: 1.5rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 20px 0 24px; }
.stats div { padding: 12px 16px; }
.stats div:nth-child(5n+1) { background: var(--t1); }
.stats div:nth-child(5n+2) { background: var(--t2); }
.stats div:nth-child(5n+3) { background: var(--t3); }
.stats div:nth-child(5n+4) { background: var(--t4); }
.stats div:nth-child(5n+5) { background: var(--t5); }
.stats dt { font-size: 0.88rem; color: var(--muted); font-weight: 700; }
.stats dd { margin: 2px 0 0; font: 400 1.6rem/1.2 var(--display); font-variant-numeric: tabular-nums; }
.neighbours { padding-left: 1.2em; }

/* Tools */
.tool { margin: 24px 0; }
.calc-row {
  display: grid; grid-template-columns: 2fr repeat(var(--mods, 2), 1.2fr) 0.7fr 1fr auto; gap: 0 12px; align-items: end;
  padding: 14px 14px 2px; margin-bottom: 16px;
}
.calc-row .row-out { align-self: center; font: 400 1.25rem var(--display); text-align: right; margin-bottom: 12px; font-variant-numeric: tabular-nums; color: var(--win); }
.calc-row .remove { margin-bottom: 12px; padding: 8px 12px; font-size: 0.95rem; }
@media (max-width: 860px) {
  .calc-row { grid-template-columns: 1fr 1fr; }
  .calc-row p:first-child { grid-column: 1 / -1; }
  .calc-row .row-out { text-align: left; }
}
.calc-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.totals .empty { color: var(--muted); }
.trade { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.trade .side h2 { margin-top: 0; }
.trade .calc-row { grid-template-columns: 1fr 1fr; }
.trade .calc-row p:first-child { grid-column: 1 / -1; }
.trade .calc-row .row-out { text-align: left; }
.side-total { font: 400 1.25rem var(--display); }
.verdict { grid-column: 1 / -1; font: 400 1.5rem/1.3 var(--display); padding: 16px 20px; background: var(--soft); }
.verdict.win { color: var(--win); background: var(--t1); }
.verdict.loss { color: var(--loss); background: var(--t5); }
.verdict.fair { color: var(--fair); background: var(--t2); }
@media (max-width: 720px) { .trade { grid-template-columns: 1fr; } }

/* FAQ */
details { padding: 2px 18px; margin: 0 0 14px; max-width: 75ch; }
summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
summary::marker { color: var(--accent); }
details p { margin-top: 0; color: var(--muted); }

/* Ads: reserve space so the page doesn't jump when an ad loads */
.ad { margin: 28px 0; min-height: 120px; text-align: center; }
.ad-label { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 4px; }
.ad-dev { display: grid; place-items: center; border: 2px dashed var(--muted); border-radius: var(--radius-m); color: var(--muted); font-size: 0.9rem; background: var(--panel); }

/* Footer */
.foot { border-top: var(--bw) solid var(--edge); background: #1b1d36; color: #b9bddc; font-size: 0.92rem; padding: 26px 0 40px; }
.foot p { margin: 0 0 8px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: #fff; font-weight: 600; }
.foot a:hover { color: var(--pop); }
@media (prefers-color-scheme: dark) { .foot { background: #0a0b18; } }

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