/* The sky takes the colour of the selected mode, the page below is where it meets the water. */
:root {
  color-scheme: light;
  --bg: #f1f4ff;
  --surface: #fff;
  --ink: #161b45;
  --muted: #575e8c;
  --line: #dde3f7;
  --dim: transparent;
  --display: Unbounded, system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11143a;
  --surface: #1a1e4d;
  --ink: #eef1ff;
  --muted: #aab1e0;
  --line: #2f3470;
  --dim: #090b2a73;
}
body { --sky-top: #1741bd; --sky-bottom: #3f95f0; --accent: #2258d8; }
body[data-mode="knockback"] { --sky-top: #43179f; --sky-bottom: #8c5bef; --accent: #6c2fd9; }
body[data-mode="hardcore"] { --sky-top: #7d0c2c; --sky-bottom: #df4b52; --accent: #bd1f40; }
body[data-mode="gungame"] { --sky-top: #0a5a36; --sky-bottom: #2f9e68; --accent: #137a43; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 Figtree, system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sky :focus-visible, .sea :focus-visible { outline-color: #fff; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* sky, blocky clouds and the blocky wave edge */
.sky {
  position: relative;
  padding-bottom: 80px;
  color: #fff;
  background:
    linear-gradient(var(--dim), var(--dim)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='320' fill='white' fill-opacity='.12'%3E%3Cpath d='M40 90h48V74h64v16h40v28H40zM400 190h32v-16h80v16h56v28H400zM250 20h40V6h48v14h24v22H250z'/%3E%3C/svg%3E"),
    linear-gradient(var(--sky-top), var(--sky-bottom));
}
.sky::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 32px;
  background: var(--bg);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='32'%3E%3Cpath d='M0 32V20h16v-6h16V8h16V4h32v4h16v6h16v6h16v4h32v8z'/%3E%3C/svg%3E") repeat-x bottom;
}
.sky:has(.podium) { padding-bottom: 0; }

header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-block: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font: 800 19px var(--display); }
header nav { display: flex; flex-wrap: wrap; gap: 2px; }
header nav a { padding: 6px 10px; border-radius: 8px; font-weight: 600; }
header nav a:hover { background: #fff3; }
header nav a[aria-current] { background: #fff; color: #161b45; }
.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tools button, .tools a, .socials a { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 8px; background: #fff2; color: inherit; cursor: pointer; }
.server { display: flex; flex-direction: column; margin: 0; padding: 3px 14px; border-radius: 8px; background: #fff; color: #161b45; font-size: 13px; line-height: 1.35; }

.hero { padding-top: 28px; text-align: center; }
.hero h1 { margin: 0; font: 800 clamp(30px, 6vw, 54px)/1.15 var(--display); }
.hero > p { margin: 8px 0 0; font-size: 18px; }

/* segmented radio groups */
.seg { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 0; padding: 4px; border: 0; border-radius: 12px; background: var(--surface); }
.seg legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 8px; color: var(--muted); font-weight: 600; cursor: pointer; }
.seg input:checked + span { background: var(--accent); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.hero .seg { margin-top: 22px; background: #0a0d3347; }
.hero .seg span { padding: 11px 18px; color: #fff; font: 600 13px var(--display); }
.hero .seg input:checked + span { background: #fff; color: #161b45; }
.hero .seg input:focus-visible + span { outline-color: #fff; }

/* podium: the blocks stand in the wave */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: 20px 0 0; padding: 0; list-style: none; }
.place { display: flex; flex-direction: column; align-items: center; width: min(210px, 32%); animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.p1 { order: 2; --block: #ffc531; }
.p2 { order: 1; --block: #d3dbf2; animation-delay: .08s; }
.p3 { order: 3; --block: #f0a064; animation-delay: .16s; }
.place img.skin { height: 180px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 8px 6px #0005); }
.p1 img.skin { height: 215px; }
.place strong { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; max-width: 100%; margin-top: 8px; overflow-wrap: anywhere; line-height: 1.3; text-shadow: 0 1px 4px #0007; }
.rating-line { font-size: 14px; text-shadow: 0 1px 4px #0007; }
.block { align-self: stretch; height: 74px; margin-top: 10px; padding-top: 6px; border-top: 10px solid color-mix(in srgb, var(--block), #fff 55%); border-radius: 4px 4px 0 0; background: var(--block); color: #161b45; font: 800 24px var(--display); }
.p1 .block { height: 120px; padding-top: 22px; font-size: 38px; }
.p2 .block { height: 96px; padding-top: 14px; font-size: 30px; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
@media (prefers-reduced-motion: reduce) { .place { animation: none; } }

main { padding-block: 28px 72px; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
#search, .pick { padding: 9px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.pick { font-weight: 600; cursor: pointer; }
#search { width: min(260px, 100%); margin-left: auto; }

.scroll { overflow-x: auto; border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-variant-numeric: tabular-nums; }
th { padding: 14px 16px; border-bottom: 2px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 600; text-align: left; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.num { text-align: right; }
.medal { display: inline-grid; place-items: center; min-width: 32px; height: 32px; border-radius: 6px; font-weight: 800; }
.m1, .m2, .m3 { color: #161b45; background: #ffc531; }
.m2 { background: #d3dbf2; }
.m3 { background: #f0a064; }
.rating { color: color-mix(in srgb, var(--accent), var(--ink) 30%); font-weight: 800; font-size: 18px; }
/* the ELO rank next to a rating, "Gold II" */
.tier { margin-left: 6px; color: var(--muted); font-size: 14px; font-weight: 600; }
/* a server event that runs or is coming up */
.notice { margin: 0 0 14px; padding: 12px 16px; border-left: 6px solid var(--accent); border-radius: 12px; background: var(--surface); }
.player { display: inline-flex; align-items: center; gap: 10px; vertical-align: middle; }
/* player rank colours are mixed with the text colour so they stay readable in both themes */
.name { color: color-mix(in srgb, var(--rank, var(--ink)) 62%, var(--ink)); font-weight: 800; }
.hero .name { color: #fff; }
.empty { margin: 0; padding: 32px; color: var(--muted); text-align: center; }

.rules { display: grid; grid-template-columns: 280px 1fr; gap: 16px 48px; padding-block: 32px; border-top: 2px solid var(--line); }
.rules:first-child { padding-top: 8px; border-top: 0; }
.rules h2 { position: sticky; top: 24px; align-self: start; margin: 0; font: 600 21px var(--display); }
.rules h3 { margin: 0; font-size: 18px; }
.rules p { max-width: 68ch; margin: 2px 0 22px; color: var(--muted); }

.crew h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; color: color-mix(in srgb, var(--c) 65%, var(--ink)); font: 600 21px var(--display); }
.crew ul { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 48px; padding: 0; list-style: none; }
.crew li { display: flex; flex-direction: column; align-items: center; width: 190px; padding: 20px 12px 14px; border-radius: 12px; background: var(--surface); }
.crew img.skin { position: relative; height: 190px; max-width: 100%; object-fit: contain; }
.pedestal { width: 120px; height: 22px; margin: -8px 0 12px; border-top: 7px solid color-mix(in srgb, var(--c), #fff 45%); border-radius: 3px; background: var(--c); }
.crew strong { display: flex; align-items: center; gap: 6px; max-width: 100%; overflow-wrap: anywhere; }

.needs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 48px; }
.need { padding: 24px; border-radius: 12px; background: var(--c, #2258d8); color: #fff; }
.need.video { --c: #bd1f2d; }
.need.cast { --c: #6b32d1; }
.need h2 { display: flex; align-items: center; gap: 10px; margin: 0; font: 600 18px var(--display); }
.need p { margin: 12px 0 4px; }
.need ul { margin: 0; padding-left: 20px; }

/* blog: the newest post spans the full row */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.posts a { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 12px; background: var(--surface); }
.posts img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.posts a > div { padding: 16px 20px 20px; }
.posts h2 { margin: 10px 0 6px; font: 600 18px/1.35 var(--display); }
.posts p { margin: 0; color: var(--muted); }
.posts a:hover h2 { text-decoration: underline; }
.posts li:first-child { grid-column: 1 / -1; }
.posts li:first-child a { flex-direction: row; align-items: center; }
.posts li:first-child img { width: 60%; }
.posts li:first-child a > div { flex: 1; padding: 24px 32px; }
.posts li:first-child h2 { font-size: 26px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; }
.tag { padding: 1px 10px; border-radius: 6px; background: #2258d8; color: #fff; font-weight: 600; }
.tag.update { background: #6c2fd9; }
.tag.event { background: #b34d12; }

.article { max-width: 860px; margin-inline: auto; }
.cover { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; object-fit: cover; }
.article .meta { margin: 18px 0 0; color: var(--muted); }
.prose { max-width: 68ch; margin-bottom: 28px; font-size: 18px; }
.prose h2 { margin: 28px 0 0; font: 600 20px var(--display); }
.prose a { text-decoration: underline; }
.prose .button { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; }
.back { font-weight: 800; text-decoration: underline; }

/* player list and profiles */
a.player:hover .name, a.clan:hover, .place strong a:hover, .crew strong a:hover { text-decoration: underline; }
.status { font-weight: 600; color: var(--muted); }
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.status.on, .won { color: color-mix(in srgb, #11a34a, var(--ink) 30%); }
.lost { color: color-mix(in srgb, #d92b3a, var(--ink) 20%); }
/* profile: player card on the left stays in view, tables on the right */
.profile-page { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: start; gap: 24px; }
.profile { position: sticky; top: 24px; display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 24px 20px; border-radius: 12px; background: var(--surface); }
.profile > img { height: 220px; max-width: 100%; object-fit: contain; }
.profile dl { display: grid; grid-template-columns: auto auto; justify-content: space-between; align-self: stretch; gap: 10px 12px; margin: 0; }
.profile dt { color: var(--muted); }
.profile dd { margin: 0; font-weight: 600; text-align: right; }
.part h2 { margin: 36px 0 12px; font: 600 21px var(--display); }
.part:first-child h2 { margin-top: 0; }
/* the bounties stand alone under the board, so "first child" does not mean "top of the page" there */
#bounties h2 { margin-top: 36px; }
.part h3 { margin: 18px 0 8px; color: var(--muted); font-size: 15px; }
.part h2 + h3 { margin-top: 0; }
@media (max-width: 900px) {
  .profile-page { grid-template-columns: minmax(0, 1fr); }
  .profile { position: static; justify-self: center; width: min(360px, 100%); }
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 8px 14px; border-radius: 12px; background: var(--surface); font-weight: 600; }
.group th { padding-block: 9px; border-bottom-width: 1px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--ink); font-weight: 800; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 16px; }
.pick:disabled { opacity: .45; cursor: default; }

/* footer: the water below, in the colour of the selected mode */
.sea { --deep: color-mix(in srgb, var(--sky-top), #060a2a 20%); position: relative; margin-top: auto; padding: 32px 0 24px; background: linear-gradient(var(--deep), color-mix(in srgb, var(--sky-top), #060a2a 72%)); color: #fff; }
.sea::before { content: ""; position: absolute; inset: -31px 0 auto; height: 32px; background: var(--deep); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='32'%3E%3Cpath d='M0 32V20h16v-6h16V8h16V4h32v4h16v6h16v6h16v4h32v8z'/%3E%3C/svg%3E") repeat-x bottom; }
.call { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding: 26px 30px; border-radius: 12px; background: #4752c4; }
.call h2 { display: flex; align-items: center; gap: 12px; margin: 0; font: 800 22px var(--display); }
.call h2 .icon { width: 30px; height: 30px; }
.call p { margin: 6px 0 0; }
.button { padding: 10px 20px; border: 0; border-radius: 8px; background: #fff; color: #161b45; font-weight: 800; cursor: pointer; }
.cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-block: 40px 32px; }
.about p { max-width: 38ch; margin: 12px 0 0; }
.about .join { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; font-size: 18px; }
.about .join .button { padding: 7px 14px; font-size: 14px; }
.about .online { margin-top: 4px; color: #ffffffb8; }
.socials { display: flex; gap: 8px; margin-top: 16px; }
.cols nav { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cols h2 { margin: 0 0 8px; font: 600 15px var(--display); }
.sea nav a { color: #ffffffd6; }
.sea nav a:hover { color: #fff; text-decoration: underline; }
.legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-top: 20px; border-top: 1px solid #ffffff2b; color: #ffffffb8; font-size: 14px; }
.legal p { margin: 0; }
.legal nav { display: flex; flex-wrap: wrap; gap: 20px; }

@media (max-width: 760px) {
  .posts { grid-template-columns: 1fr; }
  .posts li:first-child a { flex-direction: column; align-items: stretch; }
  .posts li:first-child img { width: 100%; }
  .posts li:first-child a > div { padding: 16px 20px 20px; }
  .posts li:first-child h2 { font-size: 20px; }
  .cols { grid-template-columns: 1fr 1fr; }
  .about { grid-column: 1 / -1; }
  .tools { margin-left: 0; }
  .hero .seg span { padding: 9px 10px; font-size: 11px; }
  .place img.skin { height: 120px; }
  .p1 img.skin { height: 145px; }
  .place strong { font-size: 13px; }
  #search { width: 100%; }
  .rules { grid-template-columns: 1fr; }
  .rules h2 { position: static; }
}
