/* MinecraftRanking: grass-and-stone palette, system fonts (fast first paint matters for ranking), light + dark. */
:root {
  --bg: #f3f5ef; --surface: #ffffff; --surface-2: #eef2e9; --ink: #17211a; --muted: #5b685d; --line: #dbe2d4;
  --accent: #15803d; --accent-2: #116932; --accent-ink: #ffffff; --gold: #a86a12; --gold-bg: #fff6e3; --danger: #b42318;
  --on: #15803d; --off: #8a948b; --radius: 10px; --shadow: 0 1px 2px rgba(23, 33, 26, .06), 0 4px 14px rgba(23, 33, 26, .05);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1310; --surface: #161d18; --surface-2: #1c251f; --ink: #e6ece4; --muted: #9aa69b; --line: #26302a;
    --accent: #22a854; --accent-2: #2fbf63; --accent-ink: #06130a; --gold: #e4a64a; --gold-bg: #2a2214; --danger: #ef6b5e;
    --on: #3ecf73; --off: #6b766d; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  --bg: #0e1310; --surface: #161d18; --surface-2: #1c251f; --ink: #e6ece4; --muted: #9aa69b; --line: #26302a;
  --accent: #22a854; --accent-2: #2fbf63; --accent-ink: #06130a; --gold: #e4a64a; --gold-bg: #2a2214; --danger: #ef6b5e;
  --on: #3ecf73; --off: #6b766d; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; font-weight: 750; }
p { margin: 0 0 1em; }
code, .ip { font-family: var(--mono); font-size: .92em; }
img, video { max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 620px; margin: 2rem auto; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.inline { display: inline; } .inline-block { display: inline-block; margin-right: 8px; }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand b { color: var(--accent); }
.brand.small { font-size: 1.05rem; margin-bottom: .5rem; }
/* A grass block: green top band over dirt, drawn in CSS. */
.brand-mark { width: 26px; height: 26px; border-radius: 5px; background: linear-gradient(#4caf50 0 34%, #3f8f3a 34% 42%, #8b5a2b 42% 100%); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12); flex: none; }
.search { flex: 1 1 260px; }
.search input { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--ink); font: inherit; }
.account { display: flex; align-items: center; gap: 14px; }
.account a { text-decoration: none; font-weight: 600; }
.cats { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; }
.cats a { white-space: nowrap; padding: 5px 11px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; }
.cats a:hover { background: var(--surface-2); color: var(--ink); }

/* Buttons */
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 10px 18px; font: 600 .95rem/1.2 var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-2); color: var(--accent-ink); }
.btn-sm { padding: 7px 12px; font-size: .85rem; }
.btn.big { padding: 13px 24px; font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn-ghost:hover { background: var(--surface-2); color: var(--accent-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-vote { background: var(--accent); }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; font-weight: 600; }

/* Hero + sections */
main { padding-top: 22px; padding-bottom: 48px; }
.hero { padding: 18px 0 8px; max-width: 760px; }
.lede { font-size: 1.1rem; color: var(--muted); }
.hero-links { display: flex; gap: 10px; flex-wrap: wrap; }
.section-title { margin-top: 28px; font-size: 1.25rem; }
.crumbs { font-size: .875rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.list-head .intro { max-width: 780px; }

/* List layout */
.list-layout { display: grid; grid-template-columns: 250px 1fr; gap: 24px; align-items: start; }
.list-side { position: sticky; top: 12px; }
@media (max-width: 900px) { .list-layout { grid-template-columns: 1fr; } .list-side { position: static; } }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 14px; }
.sorts { display: flex; flex-wrap: wrap; gap: 6px; }
.sort { font-size: .82rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink); text-decoration: none; }
.sort.cur { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.filter-row { display: grid; gap: 10px; margin-top: 10px; }
.filter-box > summary { cursor: pointer; font-weight: 700; font-size: .9rem; list-style-position: inside; }
@media (min-width: 901px) { .filter-box > summary { display: none; } .filter-row { margin-top: 0; } }
.filter-row label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.filter-row label.check { display: flex; align-items: center; gap: 6px; }
select, input, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
textarea { width: 100%; resize: vertical; }

/* Server card */
.card { display: grid; grid-template-columns: 76px 1fr 170px; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
/* Paid and featured placements. Class names avoid "sponsor"/"ad" words: ad blockers hide those, and with them the slots we sell. */
.card.spotlight { border-color: var(--gold); background: linear-gradient(var(--gold-bg), var(--surface) 70%); }
.card-rank { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rank { font-weight: 800; font-size: 1.05rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.spot-label { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.logo { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; image-rendering: pixelated; background: var(--surface-2); }
.server-head .logo { width: 96px; height: 96px; }
.logo-empty { display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: var(--muted); }
.card-main { min-width: 0; }
.card-title { font-size: 1.08rem; margin: 0 0 6px; overflow-wrap: anywhere; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.banner { display: block; width: 100%; max-width: 468px; aspect-ratio: 468 / 60; height: auto; border-radius: 6px; background: var(--surface-2); object-fit: cover; }
/* Our own placeholder for listings without a banner: reads like a banner (dark grass/dirt band, name, site watermark), same in both themes. */
.banner-empty { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 12px; overflow: hidden; color: #f2f7ef; font-weight: 800; font-size: clamp(.8rem, 2.6vw, 1.05rem); letter-spacing: .01em;
  background: linear-gradient(180deg, #2f7a34 0 18%, #276b2c 18% 24%, #5b3b1e 24% 100%); }
.banner-empty::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(0, 0, 0, .14) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, .14) 1px, transparent 1px); background-size: 10px 10px; pointer-events: none; }
.banner-empty .be-mark { position: relative; width: 26px; height: 26px; flex: none; border-radius: 4px; background: linear-gradient(#4caf50 0 34%, #3f8f3a 34% 42%, #8b5a2b 42% 100%); box-shadow: 0 0 0 2px rgba(0, 0, 0, .25); }
.banner-empty .be-name { position: relative; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.banner-empty .be-site { position: relative; flex: none; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .62); }
@media (max-width: 420px) { .banner-empty .be-site { display: none; } }
.logo-empty { background: linear-gradient(#4caf50 0 30%, #3f8f3a 30% 38%, #6d4523 38% 100%); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); border-radius: 8px; }
.ip-row { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; flex-wrap: wrap; }
.ip { background: var(--surface-2); padding: 3px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.copy { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; padding: 3px 9px; font: 600 .8rem var(--font); cursor: pointer; }
.copy.copied { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.card-desc { color: var(--muted); font-size: .92rem; margin: 6px 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: .76rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); text-decoration: none; }
.tag:hover { background: var(--accent); color: var(--accent-ink); }
.card-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-size: .9rem; }
.card-side .btn-vote { margin-top: auto; }
.stat b { font-variant-numeric: tabular-nums; }
.pill { font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.pill.on { background: color-mix(in srgb, var(--on) 16%, transparent); color: var(--on); }
.pill.off { background: color-mix(in srgb, var(--off) 18%, transparent); color: var(--off); }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; margin-right: 4px; }
.verified { font-size: .7rem; font-weight: 800; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 0 5px; vertical-align: middle; }
@media (max-width: 700px) {
  .card { grid-template-columns: 56px 1fr; }
  .card-side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .card-side .btn-vote { margin-left: auto; margin-top: 0; }
  .logo { width: 44px; height: 44px; }
}
.spotlight-list { margin-bottom: 18px; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 20px; }
.pager a, .pager span { padding: 6px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-variant-numeric: tabular-nums; }
.pager .cur { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.pager .gap { border: 0; background: none; }
.empty { padding: 30px; text-align: center; background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--line); }

/* Mode grid */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.mode-grid.big { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.mode { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.mode:hover { border-color: var(--accent); }
.mode span { color: var(--muted); font-size: .85rem; }
.mode small { color: var(--muted); }
.mini-list { padding-left: 1.2em; }
.seo-copy { margin-top: 36px; max-width: 820px; }
.seo-copy h2 { font-size: 1.1rem; margin-top: 1.2em; }

/* Server page */
.server-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; margin-bottom: 14px; }
.server-head h1 { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) { .server-head { grid-template-columns: auto 1fr; } .server-head .btn { grid-column: 1 / -1; text-align: center; } }
.server-banner .banner { max-width: 728px; }
.server-grid { display: grid; grid-template-columns: 380px 1fr; gap: 28px; margin-top: 18px; }
@media (max-width: 900px) { .server-grid { grid-template-columns: 1fr; } }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0; }
.facts dt { font-weight: 700; color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.links { display: flex; gap: 10px; flex-wrap: wrap; }
.motd { margin-top: 12px; background: #1e1e1e; color: #ddd; font-family: var(--mono); font-size: .88rem; padding: 12px 14px; border-radius: 8px; line-height: 1.5; overflow-wrap: anywhere; }
.server-about p { overflow-wrap: anywhere; white-space: pre-line; }
.howto li { margin-bottom: 6px; }
.spark { margin: 0; }
.spark svg { width: 100%; height: 120px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.spark-area { fill: color-mix(in srgb, var(--accent) 18%, transparent); stroke: none; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.video { aspect-ratio: 16 / 9; } .video iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; }
.reviews { margin-top: 32px; max-width: 820px; }
.review { border-top: 1px solid var(--line); padding: 12px 0; }
.review header { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.stars { color: var(--gold); letter-spacing: 1px; }
.reply { background: var(--surface-2); padding: 8px 12px; border-radius: 8px; }
.review-form, .stack { display: grid; gap: 12px; }
.stack label, .review-form label { display: grid; gap: 5px; font-weight: 600; }
.rating-input { border: 0; padding: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.rating-input label { display: flex; gap: 4px; font-weight: 500; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }

/* Vote */
.vote-head { display: flex; gap: 14px; align-items: center; }
.vote-head h1 { margin: 0; }
.captcha { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; }
.captcha img { border-radius: 8px; border: 1px solid var(--line); }
.code-big { font-size: 1.2rem; background: var(--surface-2); padding: 4px 10px; border-radius: 6px; }

/* Flash */
.flash { padding: 10px 14px; border-radius: 8px; background: var(--surface-2); border-left: 4px solid var(--accent); }
.flash.err { border-left-color: var(--danger); }
.flash.warn { border-left-color: var(--gold); }

/* Forms */
.form-page { max-width: 860px; }
.grid-form { display: grid; gap: 18px; }
.grid-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; background: var(--surface); }
.grid-form legend { font-weight: 800; padding: 0 6px; }
.grid-form label { display: grid; gap: 5px; font-weight: 600; }
.grid-form small { font-weight: 400; color: var(--muted); }
.two { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.danger { margin-top: 24px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.inline-form label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; }

/* Tables (dashboard/admin/advertise) */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: block; overflow-x: auto; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: .85rem; color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 20px; }
.stat-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; }
.stat-box b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat-box span { color: var(--muted); font-size: .85rem; }

/* Docs */
.doc { max-width: 760px; } .doc h2 { margin-top: 1.4em; font-size: 1.15rem; }

/* Footer */
.foot { background: var(--surface); border-top: 1px solid var(--line); padding: 28px 0 18px; font-size: .92rem; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.foot a { display: block; color: var(--ink); text-decoration: none; padding: 2px 0; }
.foot a:hover { color: var(--accent); }
.legal-note { margin-top: 18px; font-size: .75rem; color: var(--muted); }

/* Minecraft MOTD colours */
.mc-black { color: #000; } .mc-dark_blue { color: #00a; } .mc-dark_green { color: #0a0; } .mc-dark_aqua { color: #0aa; } .mc-dark_red { color: #a00; }
.mc-dark_purple { color: #a0a; } .mc-gold { color: #fa0; } .mc-gray { color: #aaa; } .mc-dark_gray { color: #555; } .mc-blue { color: #55f; }
.mc-green { color: #5f5; } .mc-aqua { color: #5ff; } .mc-red { color: #f55; } .mc-light_purple { color: #f5f; } .mc-yellow { color: #ff5; } .mc-white { color: #fff; }
.mc-b { font-weight: 700; } .mc-i { font-style: italic; } .mc-u { text-decoration: underline; } .mc-s { text-decoration: line-through; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
