:root {
  --bg: #e4f0fb;
  --bg2: #d3e8f8;
  --surface: #ffffff;
  --ink: #0b1b33;
  --muted: #4e6280;
  --faint: #7f93ae;
  --line: #cfe0f1;
  --sky: #0ea5e9;
  --sky-soft: #dcf0fc;
  --navy: #0b2545;
  --win: #15803d;
  --lose: #dc2626;
  --blue: #1d4ed8;
  --cyan: #22d3ee;
  --ok: #16a34a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(14, 64, 120, .06), 0 10px 28px rgba(14, 64, 120, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3 { font-family: Manrope, Inter, sans-serif; letter-spacing: -.02em; margin: 0; }
h2 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; line-height: 1.15; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0; }
code { font: 600 .9em ui-monospace, Consolas, monospace; background: var(--sky-soft); color: #0369a1; padding: 2px 7px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }

/* header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(240, 248, 255, .88); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid #c3daf0;
}
.top .wrap { display: flex; align-items: center; height: 64px; gap: 28px; }
.top .logo img { height: 34px; display: block; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 7px 13px; border-radius: 8px; font-weight: 500; font-size: 15px; color: var(--muted); }
.nav a:hover { color: var(--ink); background: #f0f5fb; }
.nav a.active { color: var(--ink); background: var(--sky-soft); }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 11px 20px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); font: 600 15px Inter, sans-serif; color: var(--ink); cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { border-color: #c9d8ea; box-shadow: var(--shadow); }
.btn.blue { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.blue:hover { background: #16305a; }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.discord:hover { background: #4752c4; }
.btn.sm { padding: 8px 14px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; }

/* hero */
.hero { position: relative; min-height: 640px; display: flex; align-items: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: url(/img/beach.jpg) center 45% / cover no-repeat; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(228,240,251,0) 0%, rgba(228,240,251,.2) 60%, var(--bg) 100%); }
.hero-inner { position: relative; width: 100%; text-align: center; padding: 70px 20px 90px; }
.hero-logo { width: min(620px, 92vw); filter: drop-shadow(0 12px 30px rgba(11, 27, 51, .3)); }
.hero-sub { margin: 22px auto 30px; font-size: 19px; font-weight: 500; color: #1d2f4c; max-width: 560px; text-shadow: 0 1px 12px rgba(255,255,255,.8); }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; align-items: center; }
.ip {
  display: inline-flex; align-items: center; gap: 14px; padding: 7px 7px 7px 18px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  font: 700 18px Manrope, sans-serif; color: var(--ink); cursor: pointer;
}
.ip .copy { padding: 7px 12px; border-radius: 8px; background: var(--sky-soft); color: #0369a1; font: 600 13px Inter, sans-serif; }
.ip:hover .copy { background: #cfeafb; }
.status { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 6px 13px; border-radius: 99px; background: rgba(255,255,255,.9); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #b8c3d3; }
.status.on i { background: var(--ok); box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.status.on b { color: var(--ink); }

/* sections */
.sec { padding: 84px 0; }
.sec.white { background: linear-gradient(180deg, var(--bg2), #e2f0fb); border-top: 1px solid #c3daf0; border-bottom: 1px solid #c3daf0; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 34px; }
.sec-head p { margin-top: 10px; color: var(--muted); max-width: 560px; font-size: 17px; }
.link { color: #0369a1; font-weight: 600; white-space: nowrap; }
.link:hover { text-decoration: underline; }

/* intro split */
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: start; }
.split .lead { font-size: 18px; color: var(--muted); margin: 16px 0 30px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 26px; }
.fact { display: flex; gap: 14px; }
.fact img { width: 42px; height: 42px; flex: none; }
.fact b { display: block; font-weight: 650; margin-bottom: 2px; }
.fact span { color: var(--muted); font-size: 15px; }

.ladder { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ladder-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 650; background: #eef7fe; }
.ladder-head img { width: 24px; }
.ladder-row { display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-bottom: 1px solid #eef3f9; font-size: 15px; }
.ladder-row:last-child { border-bottom: 0; }
.ladder-row .name { font-weight: 550; }
.ladder-row .note { margin-left: auto; color: var(--faint); font-size: 13.5px; }

/* in-game rank icons (from the server resource pack) */
.rank { height: 24px; width: auto; image-rendering: pixelated; vertical-align: middle; display: inline-block; }
.pl .rank { height: 28px; width: auto; border-radius: 0; }
.ladder-row .rank { height: 26px; }

/* events */
.events { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.ev { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.ev.big { grid-column: span 2; }
.ev.small { grid-column: span 3; }
.ev .pic { aspect-ratio: 16 / 8; background: center / cover no-repeat; }
.ev .body { padding: 20px 22px 22px; }
.ev .body p { color: var(--muted); margin-top: 8px; font-size: 15.5px; }
.ev .label { display: inline-block; font: 700 11.5px Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #0369a1; margin-bottom: 8px; }
.ev.plain .body { padding-top: 24px; }
.ev.plain .icon { width: 44px; height: 44px; margin-bottom: 14px; }
.points { margin-top: 14px; display: grid; gap: 8px; }
.point { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: #effaf3; border: 1px solid #cdeed8; font-size: 14px; font-weight: 550; }
.point i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.point code { margin-left: auto; cursor: pointer; }

/* top players */
.podium { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.pl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px 16px; text-align: center; box-shadow: var(--shadow); }
.pl img { width: 64px; height: 64px; image-rendering: pixelated; border-radius: 10px; }
.pl .pos { font: 800 13px Manrope, sans-serif; color: var(--faint); }
.pl .nm { font-weight: 650; margin: 8px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .sub { font-size: 13px; color: var(--muted); margin-top: 8px; }
.empty-box { padding: 40px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed #cbd8e9; border-radius: var(--radius); }

/* join banner */
.cta-band { background: linear-gradient(120deg, #0ea5e9, #2563eb); border-radius: 20px; padding: 44px; display: flex; gap: 30px; align-items: center; justify-content: space-between; color: #fff; box-shadow: 0 18px 40px rgba(37, 99, 235, .28); }
.cta-band p { color: #e0f2fe; margin-top: 10px; max-width: 520px; font-size: 17px; }
.cta-band .btn:not(.discord) { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.4); color: #fff; }
.cta-band .btn:not(.discord):hover { background: rgba(255,255,255,.24); }
.cta-band .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* page header (inner pages) */
.page-head { position: relative; background: linear-gradient(180deg, rgba(228,240,251,.25), rgba(228,240,251,.8) 72%, var(--bg)), url(/img/lake.jpg) center 35% / cover no-repeat; border-bottom: 1px solid #c3daf0; padding: 84px 0 44px; }
.page-head h1 { text-shadow: 0 2px 18px rgba(255,255,255,.7); }
.page-head p { color: #26405f; }
.page-head h1 { font-size: clamp(34px, 5vw, 46px); font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 10px; font-size: 17px; max-width: 620px; }

/* leaderboard */
.lb-tools { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 30px 0 16px; flex-wrap: wrap; }
.search { flex: 1; max-width: 320px; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; }
.search:focus { outline: 2px solid #bae6fd; border-color: var(--sky); }
.table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: grid; grid-template-columns: 56px 1fr 90px 90px 80px 80px 70px; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid #eef3f9; }
.row:last-child { border-bottom: 0; }
.row.head { font-size: 12.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; background: #eef7fe; }
a.row:hover { background: #f3f9fe; }
.row .n { font: 800 16px Manrope, sans-serif; color: var(--faint); }
.row.r1 .n { color: #ca8a04; } .row.r2 .n { color: #64748b; } .row.r3 .n { color: #c2410c; }
.row .who { display: flex; align-items: center; gap: 12px; font-weight: 650; min-width: 0; }
.row .who img { width: 34px; height: 34px; border-radius: 8px; image-rendering: pixelated; }
.row .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .num { text-align: right; font-variant-numeric: tabular-nums; color: #26374f; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.online-now { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 4px; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 550; }
.chip img { width: 22px; height: 22px; border-radius: 50%; }

/* rules */
.rules-layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; padding: 44px 0 90px; align-items: start; }
.toc { position: sticky; top: 90px; display: grid; gap: 2px; }
.toc a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-size: 15px; }
.toc a:hover { background: #eaf2fb; color: var(--ink); }
.rule-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; margin-bottom: 16px; scroll-margin-top: 90px; }
.rule-block h3 { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rule-block h3 img { width: 28px; }
.rule-block ul { margin: 0; padding-left: 20px; color: #33445e; }
.rule-block li { margin: 6px 0; }
.rule-block p { color: #33445e; }
.rule-block p + p, .rule-block p + ul, .rule-block ul + p { margin-top: 10px; }
.allowed { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.allowed span { font-size: 13.5px; padding: 4px 10px; border-radius: 8px; border: 1px solid; }
.allowed .no { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.allowed .yes { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.callout { background: #fff8e6; border: 1px solid #f6e2a8; border-radius: var(--radius); padding: 18px 22px; color: #6b4e12; margin-bottom: 16px; }

/* join */
.join-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; padding: 44px 0 90px; align-items: start; }
.steps { display: grid; gap: 14px; }
.step { display: flex; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step .k { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--sky-soft); color: #0369a1; font: 800 16px Manrope, sans-serif; }
.step p { color: var(--muted); margin-top: 4px; }
.side { display: grid; gap: 14px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.box h3 { margin-bottom: 10px; }
.box ul { margin: 0; padding-left: 18px; color: #33445e; }
.box li { margin: 5px 0; }
details { border-top: 1px solid var(--line); padding: 12px 0; }
details:first-of-type { border-top: 0; padding-top: 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; float: right; color: var(--faint); font-weight: 500; transition: transform .15s; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--muted); margin-top: 8px; font-size: 15px; }

/* footer */
.foot { background: var(--navy); padding: 40px 0; margin-top: 0; }
.foot .wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.foot img { height: 34px; }
.foot nav { display: flex; gap: 18px; color: #a9c1de; font-size: 14.5px; flex-wrap: wrap; }
.foot nav a:hover { color: #fff; }
.foot small { margin-left: auto; color: #7f9bbf; font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; transition: all .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* fights */
.fights { display: grid; gap: 10px; }
.fight {
  display: grid; grid-template-columns: 92px 1fr 34px 1fr auto; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow);
}
.fight .when { color: var(--faint); font-size: 13.5px; }
.fighter { display: flex; align-items: center; gap: 11px; min-width: 0; }
.fighter img.head { width: 38px; height: 38px; border-radius: 9px; image-rendering: pixelated; flex: none; }
.fighter .nm { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fighter .nm:hover { color: #0369a1; }
.fighter .meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.fighter .rank { height: 18px; }
.vs-icon { width: 28px; height: 28px; opacity: .85; }
.xp { font: 700 13.5px Inter, sans-serif; white-space: nowrap; }
.xp.up { color: var(--win); }
.xp.down { color: var(--lose); }
.fight .tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tag-demote { font-size: 12px; font-weight: 600; color: #b45309; background: #fff4e0; border: 1px solid #fcd9a4; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.more { display: flex; justify-content: center; margin-top: 18px; }
.filter-note { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.filter-note a { color: #0369a1; font-weight: 600; margin-left: 8px; }

/* players */
.search-big { width: 100%; max-width: 520px; padding: 15px 18px; border-radius: 12px; border: 1px solid #bcd6ee; background: #fff; font: 500 17px Inter, sans-serif; box-shadow: var(--shadow); }
.search-big:focus { outline: 3px solid #bae6fd; border-color: var(--sky); }
.dir { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 26px; }
.card-pl { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; transition: border-color .15s, transform .15s; }
.card-pl:hover { border-color: #93c5fd; transform: translateY(-2px); }
.card-pl img.head { width: 40px; height: 40px; border-radius: 9px; image-rendering: pixelated; }
.card-pl b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-pl .rank { height: 18px; margin-top: 3px; }
.profile { display: grid; grid-template-columns: 240px 1fr; gap: 26px; margin-top: 30px; align-items: start; }
.profile-card { background: linear-gradient(180deg, #dff1fd, #fff 60%); border: 1px solid var(--line); border-radius: 18px; padding: 24px; text-align: center; box-shadow: var(--shadow); }
.profile-card .body { height: 230px; image-rendering: pixelated; filter: drop-shadow(0 10px 14px rgba(14,64,120,.25)); }
.profile-card h2 { font-size: 26px; margin-top: 14px; word-break: break-all; }
.profile-card .rank { height: 34px; margin-top: 10px; }
.profile-card .sub { margin-top: 12px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pill { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--sky-soft); color: #0369a1; }
.pill.on { background: #dcfce7; color: var(--win); }
.pill.off { background: #eef2f7; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 26px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.tile span { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.tile b { display: block; font: 800 26px Manrope, sans-serif; margin-top: 4px; }
.tile b small { font: 600 14px Inter, sans-serif; color: var(--faint); margin-left: 4px; }
.sub-h { font-size: 20px; margin: 0 0 14px; }
.notfound { margin-top: 30px; }

@media (max-width: 920px) {
  .fight { grid-template-columns: 1fr auto; row-gap: 10px; }
  .fight .when { grid-column: 1 / -1; order: -1; }
  .vs-icon { display: none; }
  .fight .tags { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; }
  .profile { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 920px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .nav.open { display: flex; }
  .menu { display: block; }
  .top .right .btn { display: none; }
  .split, .join-grid, .rules-layout { grid-template-columns: 1fr; }
  .toc { position: static; display: flex; flex-wrap: wrap; }
  .facts { grid-template-columns: 1fr; }
  .events { grid-template-columns: 1fr; }
  .ev.big, .ev.small { grid-column: auto; }
  .podium { grid-template-columns: repeat(2, 1fr); }
  .cta-band { flex-direction: column; align-items: flex-start; padding: 30px 24px; }
  .row { grid-template-columns: 40px 1fr 70px 60px; padding: 11px 14px; }
  .row .hide-sm { display: none; }
  .sec { padding: 60px 0; }
  .hero { min-height: 560px; }
  .foot small { margin-left: 0; }
}
