/* BLKN PVP: night-forge palette from the logo (charcoal shield, silver blades, gold hilt).
   Layout: wide sections on a faint block grid, pixel-notched panels, gold only for actions and ranks. */
:root {
  --ink: #0e0f14;
  --ink-2: #13141b;
  --panel: #191a23;
  --panel-2: #20212c;
  --line: #2d2e3b;
  --line-2: #3a3b4a;
  --silver: #e4e7ee;
  --text: #c5c9d4;
  --muted: #8b8fa0;
  --lav: #b0a8c8;
  --gold: #ffc83a;
  --gold-deep: #c48a1e;
  --gold-ink: #2a1d00;
  --good: #5ee08a;
  --bad: #ff6b6b;

  --f-pixel: "Silkscreen", "Courier New", monospace;
  --f-head: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --f-body: "Barlow", "Segoe UI", system-ui, sans-serif;

  --notch: 6px;
  --max: 1180px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 17px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { /* faint block grid */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    linear-gradient(to right, rgb(255 255 255 / .022) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 255 255 / .022) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}
img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-head); color: var(--silver); margin: 0; text-wrap: balance; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0; }

.wrap {
  max-width: var(--max); margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.notch {
  clip-path: polygon(var(--notch) 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% calc(100% - var(--notch)),
    calc(100% - var(--notch)) 100%, var(--notch) 100%, 0 calc(100% - var(--notch)), 0 var(--notch));
}
.eyebrow {
  font: 400 .78rem/1 var(--f-pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--gold);
  display: inline-flex; align-items: center; gap: .6em;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; background: currentColor; box-shadow: 8px 8px 0 -4px var(--gold-deep); }
.lede { color: var(--text); font-size: 1.12rem; max-width: 60ch; }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  --b: var(--panel-2); --bf: var(--silver); --shade: rgb(0 0 0 / .35); --hi: rgb(255 255 255 / .08);
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  font: 400 .92rem/1 var(--f-pixel); letter-spacing: .04em; text-transform: uppercase;
  color: var(--bf); background: var(--b); border: 0; cursor: pointer;
  padding: 15px 22px 17px;
  box-shadow: inset 0 -4px 0 var(--shade), inset 0 2px 0 var(--hi);
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
  transition: transform .12s, filter .12s;
  text-decoration: none !important; white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 -2px 0 var(--shade); }
.btn-gold { --b: var(--gold); --bf: var(--gold-ink); --shade: var(--gold-deep); --hi: rgb(255 255 255 / .45); }
.btn-discord { --b: #5865f2; --bf: #fff; --shade: #3c45b5; }
.btn-ghost { --b: transparent; box-shadow: inset 0 0 0 2px var(--line-2); }
.btn[disabled], .btn.is-disabled { --b: var(--panel-2); --bf: var(--muted); --shade: rgb(0 0 0 / .35); --hi: transparent; cursor: not-allowed; transform: none; filter: none; }
.btn-discord.is-disabled { --b: #2a2d52; --bf: #9aa1e6; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgb(14 15 20 / .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--silver); text-decoration: none !important; }
.brand img { height: 40px; width: auto; }

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  font: 400 .78rem/1 var(--f-pixel); text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 10px 9px; text-decoration: none; white-space: nowrap;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--silver); }
.nav .btn { padding: 11px 16px 13px; font-size: .8rem; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: var(--silver); padding: 8px; cursor: pointer; }
@media (max-width: 1150px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 68px; flex-direction: column; gap: 0;
    background: var(--ink-2); border-bottom: 1px solid var(--line); padding: 8px max(20px, env(safe-area-inset-left, 0px)) 16px;
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 14px 4px; font-size: .9rem; border-bottom: 1px solid var(--line); }
  .nav .btn-nav { display: none; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding-block: clamp(40px, 7vw, 88px) clamp(40px, 6vw, 72px); overflow: hidden; }
.hero::after { /* gold forge glow */
  content: ""; position: absolute; z-index: -1; width: 900px; height: 900px; right: -220px; top: -260px;
  background: radial-gradient(closest-side, rgb(255 200 58 / .13), rgb(176 168 200 / .05) 55%, transparent 75%);
}
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: center; }
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.hero-logo { width: min(440px, 90%); margin-left: -8px; filter: drop-shadow(0 16px 30px rgb(0 0 0 / .55)); }
.hero-art { position: relative; min-width: 0; }
.hero-art img {
  width: 100%; animation: float 7s ease-in-out infinite;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
  transform: scale(1.12);
}
@keyframes float { 0%, 100% { transform: scale(1.12) translateY(0); } 50% { transform: scale(1.12) translateY(-12px); } }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 560px; margin: -24px auto -36px; }
  .hero-logo { display: none; }
}

/* IP join box */
.ipbox {
  display: flex; align-items: stretch; background: var(--panel); max-width: 520px;
  box-shadow: inset 0 0 0 2px var(--line-2);
}
.ipbox .ip-main { flex: 1; min-width: 0; padding: 14px 18px; display: grid; gap: 6px; }
.ipbox .ip-label { font: 400 .7rem/1 var(--f-pixel); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ipbox .ip { font: 400 clamp(1.05rem, 2.6vw, 1.35rem)/1.2 var(--f-pixel); color: var(--silver); overflow-wrap: anywhere; }
.ipbox button {
  border: 0; cursor: pointer; padding: 0 20px; background: var(--panel-2); color: var(--silver);
  font: 400 .78rem/1 var(--f-pixel); text-transform: uppercase; letter-spacing: .05em;
  border-left: 2px solid var(--line-2); min-width: 92px;
}
.ipbox button:hover { background: var(--gold); color: var(--gold-ink); }
.ipbox button.copied { background: var(--good); color: #062a13; }
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.status i { width: 8px; height: 8px; background: var(--muted); display: inline-block; }
.status.online i { background: var(--good); box-shadow: 0 0 10px var(--good); animation: pulse 2s infinite; }
.status.online { color: var(--good); }
.status.offline i { background: var(--bad); }
@keyframes pulse { 50% { opacity: .4; } }

/* stats strip */
.stats { border-block: 1px solid var(--line); background: var(--ink-2); }
.stats .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { padding: 22px 8px; display: grid; gap: 4px; border-right: 1px solid var(--line); text-align: center; }
.stat:last-child { border-right: 0; }
.stat b { font: 700 1.7rem/1 var(--f-head); color: var(--silver); font-variant-numeric: tabular-nums; }
.stat span { font: 400 .7rem/1 var(--f-pixel); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
@media (max-width: 640px) {
  .stats .wrap { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(56px, 8vw, 96px); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 14px; margin-bottom: 36px; }
.section-head.row { grid-template-columns: 1fr auto; align-items: end; }
@media (max-width: 640px) { .section-head.row { grid-template-columns: 1fr; } .rank { padding: 22px; } .ranks.single { grid-template-columns: minmax(0, 1fr); } }

/* announcements */
.news { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
.news-side { display: grid; gap: 16px; align-content: start; }
@media (max-width: 900px) { .news { grid-template-columns: 1fr; } }
.post {
  background: var(--panel); padding: 24px; display: grid; gap: 12px; align-content: start;
  box-shadow: inset 0 0 0 1px var(--line); min-width: 0;
}
.post.lead { padding: 30px; background: linear-gradient(160deg, #24222a, var(--panel) 60%); box-shadow: inset 0 0 0 1px var(--line-2), inset 0 3px 0 var(--gold); }
.post.lead h3 { font-size: 1.7rem; }
.post.lead { position: relative; overflow: hidden; }
.post.lead::after { /* emblem watermark fills the lead card */
  content: ""; position: absolute; right: -30px; bottom: -10px; width: 380px; height: 130px; opacity: .06;
  background: url(/assets/blkn-wordmark.webp) center / contain no-repeat; pointer-events: none;
}
.post code, .faq code, .rules code { font: 400 .8em var(--f-pixel); color: var(--silver); background: var(--panel-2); padding: 1px 5px; }
.post-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font: 400 .7rem/1 var(--f-pixel); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tag { padding: 5px 7px 6px; background: var(--panel-2); color: var(--lav); box-shadow: inset 0 0 0 1px var(--line-2); }
.tag.pin { background: var(--gold); color: var(--gold-ink); box-shadow: none; }
.post-body { white-space: pre-line; overflow-wrap: anywhere; }
.post img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.news-list { display: grid; gap: 16px; max-width: 820px; }

/* kits */
.kits { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.kit {
  background: var(--panel); padding: 20px; display: grid; gap: 8px; align-content: start;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s, transform .15s;
}
.kit:hover { box-shadow: inset 0 0 0 1px var(--gold-deep); transform: translateY(-2px); }
.kit-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kit .tag { font: 400 .62rem/1 var(--f-pixel); text-transform: uppercase; }
.kit p { color: var(--muted); font-size: .96rem; }

/* tier ladder */
.tiers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 48px; align-items: center; }
@media (max-width: 900px) { .tiers { grid-template-columns: 1fr; } }
.ladder { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tier {
  font: 400 .95rem/1 var(--f-pixel); text-align: center; padding: 16px 4px 18px; color: #fff;
  box-shadow: inset 0 -4px 0 rgb(0 0 0 / .3), inset 0 2px 0 rgb(255 255 255 / .2);
  text-shadow: 2px 2px 0 rgb(0 0 0 / .35);
}

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery figure { margin: 0; position: relative; overflow: hidden; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform .5s; }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption {
  position: absolute; inset: auto 0 0 0; padding: 26px 14px 12px; font-size: .9rem; color: var(--silver);
  background: linear-gradient(transparent, rgb(10 10 14 / .92));
}
@media (max-width: 900px) { .gallery { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .gallery { grid-template-columns: 1fr; } }

/* store */
.ranks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.ranks.single { grid-template-columns: minmax(0, min(100%, 640px)); justify-content: center; }
.rank { min-width: 0;
  --rc: var(--gold);
  position: relative; background: var(--panel); padding: 32px; display: grid; gap: 20px; align-content: start;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.rank.featured { background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--rc) 16%, transparent), transparent 70%), var(--panel); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--rc) 70%, transparent); }
.rank-name {
  justify-self: start; font: 400 1.5rem/1 var(--f-pixel); color: var(--ink); background: var(--rc);
  padding: 10px 14px 12px; box-shadow: inset 0 -4px 0 rgb(0 0 0 / .25), inset 0 2px 0 rgb(255 255 255 / .4);
}
.rank-price { display: flex; align-items: baseline; gap: 10px; }
.rank-price b { font: 700 2.8rem/1 var(--f-head); color: var(--silver); }
.rank-price span { font: 400 .72rem/1 var(--f-pixel); text-transform: uppercase; color: var(--muted); }
.perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.perks li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; align-items: start; }
.perks li::before { content: ""; width: 10px; height: 10px; margin-top: 8px; background: var(--rc); box-shadow: 3px 3px 0 rgb(0 0 0 / .4); }
.perks code { font: 400 .82rem var(--f-pixel); color: var(--silver); background: var(--panel-2); padding: 1px 5px; }
.rank { grid-template-columns: minmax(0, 1fr); }
.rank .btn { width: 100%; white-space: normal; text-align: center; line-height: 1.3; }
.store-note { text-align: center; margin-top: 22px; color: var(--muted); font-size: .95rem; }

/* staff */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 40px; }
.member { background: var(--panel); padding: 20px 14px; display: grid; justify-items: center; gap: 10px; text-align: center; box-shadow: inset 0 0 0 1px var(--line); }
.member img { width: 64px; height: 64px; image-rendering: pixelated; box-shadow: 0 6px 0 rgb(0 0 0 / .35); }
.member b { font: 600 1.02rem var(--f-head); color: var(--silver); overflow-wrap: anywhere; }
.role-badge { font: 400 .66rem/1 var(--f-pixel); text-transform: uppercase; padding: 5px 7px 6px; color: #0e0f14; box-shadow: inset 0 -2px 0 rgb(0 0 0 / .25); }
.roles { display: grid; gap: 8px; }
.role-row {
  display: grid; grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: center;
  background: var(--panel); padding: 16px 20px; box-shadow: inset 0 0 0 1px var(--line);
}
.role-row .cmds { display: flex; flex-wrap: wrap; gap: 6px; }
.role-row code { font: 400 .74rem/1 var(--f-pixel); padding: 5px 7px 6px; background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
@media (max-width: 760px) { .role-row { grid-template-columns: 1fr; gap: 10px; } }

.apply-cta {
  margin-top: 40px; padding: 32px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between;
  background: linear-gradient(110deg, #2a2412, var(--panel) 55%); box-shadow: inset 0 0 0 1px #5a4a1e;
}
.apply-cta > div { display: grid; gap: 6px; min-width: 0; flex: 1 1 320px; }

/* rules + faq */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: r; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 44px 1fr; gap: 14px; background: var(--panel); padding: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.rules li::before { content: counter(r); font: 400 1.1rem/44px var(--f-pixel); text-align: center; height: 44px; background: var(--panel-2); color: var(--gold); box-shadow: inset 0 -3px 0 rgb(0 0 0 / .3); }
.rules b { color: var(--silver); display: block; font-family: var(--f-head); }
.rules p { color: var(--muted); font-size: .96rem; }
details.faq { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 8px; }
details.faq summary { cursor: pointer; padding: 16px 18px; font: 600 1.02rem var(--f-head); color: var(--silver); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-family: var(--f-pixel); color: var(--gold); }
details.faq[open] summary::after { content: "−"; }
details.faq p { padding: 0 18px 18px; color: var(--muted); }

/* discord band */
.discord-band { background: linear-gradient(110deg, #20234a, #15162a 60%, var(--ink-2)); border-block: 1px solid #333873; }
.discord-band .wrap { padding-block: 56px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.discord-band .wrap > div { display: grid; gap: 10px; min-width: 0; flex: 1 1 360px; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.social {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--panel); color: var(--silver);
  font: 400 .72rem/1 var(--f-pixel); text-transform: uppercase; box-shadow: inset 0 0 0 1px var(--line-2); text-decoration: none !important;
}
.social:hover { box-shadow: inset 0 0 0 1px var(--gold); color: var(--gold); }
.social svg { width: 16px; height: 16px; }

/* footer */
.footer { padding-block: 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.footer img { height: 40px; width: auto; }

/* forms (apply page) */
.form { display: grid; gap: 20px; max-width: 760px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field label { font: 600 1rem var(--f-head); color: var(--silver); }
.field small { color: var(--muted); }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--silver); background: var(--panel); border: 0; padding: 13px 14px;
  box-shadow: inset 0 0 0 1px var(--line-2), inset 0 3px 0 rgb(0 0 0 / .25);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--gold); }
.positions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.pos input { position: absolute; opacity: 0; pointer-events: none; }
.pos span { display: grid; gap: 6px; padding: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; height: 100%; }
.pos b { font: 400 .9rem var(--f-pixel); text-transform: uppercase; color: var(--silver); }
.pos small { color: var(--muted); font-size: .88rem; }
.pos input:checked + span { box-shadow: inset 0 0 0 2px var(--gold); background: #231f14; }
.pos input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.pos.closed span { opacity: .45; cursor: not-allowed; }
.msg { padding: 14px 16px; font-weight: 500; }
.msg.err { background: #3a1719; color: #ffb3b3; box-shadow: inset 0 0 0 1px #6b2a2e; }
.msg.ok { background: #12301f; color: #b4f5cb; box-shadow: inset 0 0 0 1px #24633d; }
.hp { position: absolute; left: -9999px; }

.page-hero { padding-block: 56px 24px; }
.page-hero .wrap { display: grid; gap: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.section[id] { scroll-margin-top: 68px; }

/* ---------- player chip ---------- */
.player-chip {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--panel); color: var(--silver); padding: 6px 12px 6px 6px; font: 600 .92rem var(--f-head);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.player-chip:hover { box-shadow: inset 0 0 0 1px var(--gold); }
.player-chip img { width: 24px; height: 24px; image-rendering: pixelated; }
@media (max-width: 1150px) {
  .player-chip { margin-left: auto; order: 1; }
  .nav-toggle { order: 2; }
  .nav .wrap:has(.player-chip:not([hidden])) .nav-toggle { margin-left: 8px; }
  .player-chip span { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- modal ---------- */
body.locked { overflow: hidden; }
.modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgb(6 7 10 / .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fade .18s ease-out;
}
.modal.gate { background: radial-gradient(ellipse at 50% 30%, rgb(90 55 0 / .55), rgb(6 7 10 / .94) 65%); }
@keyframes fade { from { opacity: 0; } }
.modal-box {
  position: relative; width: min(460px, 100%); max-height: 100%; overflow-y: auto;
  background: var(--panel); padding: 30px; display: grid; gap: 16px; box-shadow: inset 0 0 0 1px var(--line-2), inset 0 3px 0 var(--gold);
}
.modal-box h2 { font-size: 1.6rem; }
.modal-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.modal-x:hover { color: var(--silver); }
.gate .modal-box { text-align: center; justify-items: center; }
.gate-logo { width: 260px; margin-bottom: 4px; }
.gate-form { display: grid; gap: 14px; width: 100%; }
.gate-row { display: flex; gap: 12px; align-items: center; }
.gate-row img { width: 56px; height: 56px; image-rendering: pixelated; flex: none; box-shadow: 0 5px 0 rgb(0 0 0 / .4); }
.gate-row input { font-size: 1.15rem; font-weight: 600; }
.gate-form .btn { width: 100%; }

/* ---------- checkout ---------- */
.co-rank { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.co-rank .rank-name { font-size: 1.2rem; }
.co-rank b { font: 700 2.2rem/1 var(--f-head); color: var(--silver); }
.co-player { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.co-player img { image-rendering: pixelated; }
.co-player div { display: grid; flex: 1; min-width: 0; }
.co-player small { color: var(--muted); font-size: .8rem; }
.co-player b { color: var(--silver); font-family: var(--f-head); font-size: 1.1rem; overflow-wrap: anywhere; }
.link-btn { border: 0; background: none; color: var(--gold); cursor: pointer; font: 600 .92rem var(--f-body); padding: 6px; }
.pp-box { background: #ffffff; padding: 14px 14px 4px; min-height: 120px; }
.pp-box .muted { color: #6b6f7d; }
.fine { color: var(--muted); font-size: .82rem; line-height: 1.5; }
.co-done { display: grid; gap: 14px; justify-items: center; text-align: center; padding-block: 8px; }
.co-done img { image-rendering: pixelated; box-shadow: 0 8px 0 rgb(0 0 0 / .4); }
.pay-methods { text-align: center; font: 400 .66rem/1 var(--f-pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: -6px; }

/* ---------- leaderboard ---------- */
.lb { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.lb-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.lb-tabs { display: flex; gap: 6px; overflow-x: auto; flex: 1 1 400px; min-width: 0; padding-bottom: 4px; scrollbar-width: thin; }
.lb-tabs button {
  flex: none; border: 0; cursor: pointer; padding: 10px 14px 11px; background: var(--panel); color: var(--muted);
  font: 400 .74rem/1 var(--f-pixel); text-transform: uppercase; letter-spacing: .05em; box-shadow: inset 0 0 0 1px var(--line-2);
}
.lb-tabs button:hover { color: var(--silver); }
.lb-tabs button[aria-selected="true"] { background: var(--gold); color: var(--gold-ink); box-shadow: inset 0 -3px 0 var(--gold-deep); }
.lb-tools input { flex: 0 1 240px; min-width: 160px; }

.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 12px; max-width: 720px; width: 100%; margin: 18px auto 6px; }
.pod { display: grid; justify-items: center; min-width: 0; }
.pod img { height: 150px; width: auto; image-rendering: pixelated; filter: drop-shadow(0 10px 8px rgb(0 0 0 / .5)); margin-bottom: -6px; position: relative; }
.pod-1 img { height: 190px; }
.pod-base {
  width: 100%; display: grid; justify-items: center; gap: 4px; padding: 16px 8px 14px; text-align: center;
  background: linear-gradient(var(--panel-2), var(--panel)); box-shadow: inset 0 3px 0 var(--pc), inset 0 0 0 1px var(--line-2);
}
.pod-1 .pod-base { padding-block: 26px 22px; }
.pod-1 { --pc: #ffc83a; } .pod-2 { --pc: #c9ced8; } .pod-3 { --pc: #d0743c; }
.pod-pos { font: 400 1.1rem/1 var(--f-pixel); color: var(--pc); }
.pod-base b { font: 700 1.1rem/1.2 var(--f-head); color: var(--silver); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-val { font: 700 1.5rem/1 var(--f-head); color: var(--pc); font-variant-numeric: tabular-nums; }
.pod-1 .pod-val { font-size: 1.9rem; }
.pod small { font: 400 .58rem/1 var(--f-pixel); text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.pod.me .pod-base { box-shadow: inset 0 3px 0 var(--pc), inset 0 0 0 2px var(--gold); }

.lb-head, .lb-row { display: grid; grid-template-columns: 48px 32px minmax(0, 1fr) 64px 130px 110px; gap: 14px; align-items: center; }
.lb-head { padding: 0 16px; font: 400 .62rem/1 var(--f-pixel); text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.lb-head span:last-child, .lb-val { text-align: right; }
.lb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lb-row { padding: 10px 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.lb-row:hover { box-shadow: inset 0 0 0 1px var(--line-2); background: var(--panel-2); }
.lb-row.me { box-shadow: inset 0 0 0 2px var(--gold); }
.lb-pos { font: 400 .95rem/1 var(--f-pixel); color: var(--muted); text-align: center; }
.lb-row img { image-rendering: pixelated; }
.lb-name { font: 600 1.02rem var(--f-head); color: var(--silver); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name em { font: 400 .58rem/1 var(--f-pixel); font-style: normal; background: var(--gold); color: var(--gold-ink); padding: 3px 5px; margin-left: 6px; vertical-align: middle; }
.lb-wl { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.lb-val { font: 700 1.1rem var(--f-head); color: var(--silver); font-variant-numeric: tabular-nums; }
.tier-badge { justify-self: start; font: 400 .7rem/1 var(--f-pixel); padding: 5px 7px 6px; color: #fff; text-shadow: 1px 1px 0 rgb(0 0 0 / .35); box-shadow: inset 0 -2px 0 rgb(0 0 0 / .3); }
.tier-badge.unr { background: var(--panel-2); color: var(--muted); text-shadow: none; box-shadow: inset 0 0 0 1px var(--line-2); }
.lb-foot { text-align: center; font-size: .9rem; }
.lb-empty { background: var(--panel); padding: 40px 24px; text-align: center; display: grid; gap: 8px; box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 720px) {
  .lb-head { display: none; }
  .lb-row { grid-template-columns: 34px 28px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  .lb-row .tier-badge, .lb-wl { display: none; }
  .lb-tools input { flex: 1 1 100%; }
  .pod img { height: 96px; } .pod-1 img { height: 124px; }
  .pod-base b { font-size: .9rem; } .pod-val { font-size: 1.1rem; } .pod-1 .pod-val { font-size: 1.35rem; }
  .podium { gap: 6px; }
}
