@font-face { font-family: "Monocraft"; src: url("../fonts/monocraft.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Monocraft"; src: url("../fonts/monocraft-bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0e1016;
  --panel: #161922;
  --panel-2: #1d212d;
  --line: #2c3243;
  --ink: #e9edf4;
  --muted: #9ca5b8;
  --blue: #8FD3FF;
  --blue-hover: #b0e0ff;
  --purple: #A78BFA;
  --gold: #FFD84D;
  --silver: #DCE3EC;
  --bronze: #E39A55;
  --red: #FF6B6B;
  --pixel: "Monocraft", ui-monospace, monospace;
  --text: "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); color: var(--ink); }
body { margin: 0; font: 400 17px/1.55 var(--text); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 48px 24px 64px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img.px { image-rendering: pixelated; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 700; margin: 0; line-height: 1.2; letter-spacing: 0; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0; max-width: 70ch; }
.muted { color: var(--muted); }
.mono { font-family: var(--pixel); }

/* header */
.top { border-bottom: 2px solid var(--line); background: var(--panel); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-family: var(--pixel); font-weight: 700; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { font-family: var(--pixel); font-size: 13px; color: var(--muted); padding: 8px 12px; border: 2px solid transparent; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); border-color: var(--line); background: var(--panel-2); }
.top-actions { display: flex; gap: 8px; }

/* minecraft buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--pixel); font-size: 13px; font-weight: 700; color: #0b0d12;
  background: var(--blue); border: 2px solid #07080b; padding: 8px 16px; cursor: pointer;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .45), inset -2px -2px 0 rgba(0, 0, 0, .3);
}
.btn:hover { background: var(--blue-hover); text-decoration: none; }
.btn:active { box-shadow: inset -2px -2px 0 rgba(255, 255, 255, .35), inset 2px 2px 0 rgba(0, 0, 0, .35); }
.btn.dark { background: #3a4152; color: var(--ink); box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .18), inset -2px -2px 0 rgba(0, 0, 0, .4); }
.btn.dark:hover { background: #485063; }
.btn[disabled] { background: #2a2f3c; color: #6f7789; box-shadow: none; cursor: not-allowed; }
.btn.big { font-size: 15px; padding: 12px 20px; }

/* panels */
.panel { position: relative; background: var(--panel); border: 2px solid var(--line); padding: 32px 24px 24px; }
.panel > .tab {
  position: absolute; top: -2px; left: 16px; transform: translateY(-50%);
  font-family: var(--pixel); font-size: 13px; font-weight: 700; color: var(--ink);
  background: var(--panel-2); border: 2px solid var(--line); padding: 4px 10px;
}
.stack { display: grid; gap: 48px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
.page-head { display: grid; gap: 8px; margin-bottom: 48px; }

/* ip line */
.ip { display: flex; align-items: stretch; border: 2px solid var(--line); background: var(--panel-2); width: max-content; max-width: 100%; }
.ip code { font-family: var(--pixel); font-size: 17px; padding: 10px 16px; color: var(--ink); }
.ip .btn { border-width: 0 0 0 2px; }

/* countdown */
.count { font-family: var(--pixel); font-size: 44px; font-weight: 700; line-height: 1; color: var(--ink); }
.status { font-family: var(--pixel); font-size: 13px; color: var(--muted); }
.status.open { color: var(--purple); }
.status.live { color: var(--blue); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-family: var(--pixel); font-size: 13px; color: var(--muted); font-weight: 400; padding: 8px 12px; border-bottom: 2px solid var(--line); }
td { padding: 10px 12px; border-bottom: 2px solid var(--panel-2); vertical-align: middle; }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--panel-2); }
td.num, th.num { text-align: right; font-family: var(--pixel); font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.who img { width: 24px; height: 24px; image-rendering: pixelated; }
.place { font-family: var(--pixel); font-weight: 700; width: 48px; }
.p1 { color: var(--gold); } .p2 { color: var(--silver); } .p3 { color: var(--bronze); }

/* tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--line); margin-bottom: 24px; }
.tabs button {
  font-family: var(--pixel); font-size: 13px; color: var(--muted); background: transparent;
  border: 2px solid transparent; border-bottom: 0; padding: 10px 16px; cursor: pointer; margin-bottom: -2px;
}
.tabs button[aria-selected="true"] { color: var(--ink); background: var(--panel); border-color: var(--line); }

/* podium */
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 16px; margin-bottom: 32px; }
.step { display: grid; justify-items: center; gap: 8px; color: var(--ink); }
.step:hover { text-decoration: none; }
.step img { height: 150px; image-rendering: pixelated; }
.step .block { width: 100%; background: var(--panel); border: 2px solid var(--line); display: grid; justify-items: center; gap: 4px; padding: 12px; }
.step.first .block { padding-top: 40px; border-color: var(--gold); }
.step.second .block { padding-top: 24px; }
.step .name { font-weight: 600; }
.step .val { font-family: var(--pixel); color: var(--muted); }

/* search */
.search { position: relative; max-width: 360px; }
.search input {
  width: 100%; font: 500 15px var(--text); color: var(--ink); background: var(--panel-2);
  border: 2px solid var(--line); padding: 10px 12px; outline: none;
}
.search input:focus { border-color: var(--blue); }
.search ul { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 0; padding: 0; list-style: none; background: var(--panel); border: 2px solid var(--line); border-top: 0; }
.search li a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; color: var(--ink); }
.search li a:hover { background: var(--panel-2); text-decoration: none; }
.search li img { width: 20px; height: 20px; image-rendering: pixelated; }
.head-row { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }

/* lists */
.rows { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 90px 1fr auto; gap: 16px; align-items: center; padding: 12px 16px; background: var(--panel-2); border: 2px solid transparent; color: var(--ink); }
.row:hover { border-color: var(--line); text-decoration: none; }
.row .id { font-family: var(--pixel); color: var(--muted); font-size: 13px; }
.row .meta { color: var(--muted); font-size: 15px; text-align: right; }

/* profile */
.profile { display: grid; grid-template-columns: 220px 1fr; gap: 48px; align-items: start; }
.profile .skin { width: 100%; image-rendering: pixelated; background: var(--panel); border: 2px solid var(--line); padding: 16px; }
.idline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.idline img.badge { height: 20px; image-rendering: pixelated; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 2px solid var(--line); background: var(--panel); }
.stats div { padding: 16px; border-right: 2px solid var(--line); }
.stats div:nth-child(4n) { border-right: 0; }
.stats div:nth-child(n+5) { border-top: 2px solid var(--line); }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-family: var(--pixel); font-size: 22px; }

/* store */
.store-note { border: 2px solid var(--line); background: var(--panel); padding: 16px 20px; margin-bottom: 32px; }
.store-note strong { color: var(--purple); font-family: var(--pixel); font-size: 13px; }
.buyer { display: grid; gap: 6px; width: 320px; max-width: 100%; }
.buyer label { font-family: var(--pixel); font-size: 13px; color: var(--muted); }
.buyer-row { display: flex; border: 2px solid var(--line); background: var(--panel-2); }
.buyer-row img { width: 40px; height: 40px; border-right: 2px solid var(--line); background: var(--panel); }
.buyer-row input { flex: 1; min-width: 0; font: 500 16px var(--text); color: var(--ink); background: transparent; border: 0; padding: 0 12px; outline: none; }
.buyer-row:focus-within { border-color: var(--blue); }
.buyer-row:has(input.bad) { border-color: var(--red); }
.hint { font-size: 13px; color: var(--muted); }
.buyer-row:has(input.bad) + .hint { color: var(--red); }
.store-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.cat + .cat { margin-top: 48px; }
.cat h2 { margin-bottom: 8px; }
.cat-note { font-size: 15px; margin-bottom: 16px; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 16px; }
.items.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.items.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.items.n4 .item-buy { flex-direction: column; align-items: stretch; gap: 10px; }
.items.n4 .btn { width: 100%; }
.item { display: grid; grid-template-rows: auto 1fr auto; background: var(--panel); border: 2px solid var(--line); }
.item .art { width: 100%; height: auto; aspect-ratio: 1; padding: 20%; background: var(--panel-2); border-bottom: 2px solid var(--line); image-rendering: pixelated; }
.item-body { padding: 14px 14px 0; display: grid; gap: 6px; align-content: start; }
.item-body p { font-size: 15px; line-height: 1.45; }
.item-buy { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; }
.item .price { font-family: var(--pixel); font-size: 17px; font-weight: 700; }
.item .price small { font-size: 13px; font-weight: 400; color: var(--muted); }
.item.wide { grid-template-columns: 160px 1fr auto; grid-template-rows: auto; grid-column: 1 / -1; }
.item.wide .art { border-bottom: 0; border-right: 2px solid var(--line); padding: 24px; }
.item.wide .item-body { padding: 20px; align-content: center; }
.item.wide .item-buy { flex-direction: column; justify-content: center; align-items: flex-end; padding: 20px; }
.item:hover { border-color: #3d4560; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15px; }
.feed li { display: flex; align-items: center; gap: 10px; }
.feed img { width: 24px; height: 24px; image-rendering: pixelated; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; color: var(--muted); }
.steps li::marker { font-family: var(--pixel); color: var(--blue); }

/* prose */
.prose { max-width: 70ch; display: grid; gap: 16px; }
.prose h2 { margin-top: 24px; font-size: 17px; }

/* footer */
.foot { border-top: 2px solid var(--line); background: var(--panel); }
.foot-links { display: flex; gap: 20px; }
.foot-in { align-items: center; max-width: 1120px; margin: 0 auto; padding: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 15px; }

/* home */
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero-art { margin: 0; display: grid; justify-items: center; }
.hero-art img { width: 384px; height: 384px; display: block; }
.hero-text { display: grid; gap: 16px; justify-items: start; }
.next { display: grid; gap: 8px; }
.section { margin-top: 64px; }
.section-s { margin-bottom: 32px; }
.section-title { margin-bottom: 16px; }
.stack-s { display: grid; gap: 32px; }
.more { margin-top: 16px; font-size: 15px; }
.winner { display: flex; gap: 16px; align-items: center; }
.heads { display: flex; gap: 4px; }
.heads img { width: 48px; height: 48px; }
.page-head.flush { margin-bottom: 0; }
.team { display: grid; gap: 6px; }
.team-row { display: flex; align-items: center; gap: 16px; }
.team-row .mono { font-size: 13px; }
.hit-elo { margin-left: auto; font-size: 13px; }
.empty-hit { padding: 8px 12px; color: var(--muted); }

.empty { color: var(--muted); padding: 24px 0; }
.err { color: var(--red); }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 24px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel-2); border: 2px solid var(--blue); padding: 10px 16px; font-family: var(--pixel); font-size: 13px; display: none; }
.toast.show { display: block; }

@media (max-width: 860px) {
  .top-in { flex-wrap: wrap; gap: 12px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .grid-2, .profile, .hero { grid-template-columns: 1fr; }
  .hero-art { margin: 0; }
  .hero-art img { width: 256px; height: 256px; }
  .profile > *, .grid-2 > *, .hero > * { min-width: 0; }
  .profile { gap: 24px; }
  .profile .skin { max-width: 120px; padding: 8px; }
  .nav { scrollbar-width: none; }
  .nav a { padding: 8px; }
  .panel { padding: 28px 16px 16px; }
  .opt { display: none; }
  th, td { padding: 8px; }
  .top-actions .btn:not(.dark) { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div:nth-child(2n) { border-right: 0; }
  .stats div:nth-child(n+3) { border-top: 2px solid var(--line); }
  .count { font-size: 30px; }
  .step img { height: 100px; }
  .store-grid { grid-template-columns: 1fr; }
  .items, .items.n3, .items.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .items.n3 .item-buy { flex-direction: column; align-items: stretch; gap: 10px; }
  .item.wide { grid-template-columns: 96px 1fr; }
  .item.wide .art { padding: 12px; }
  .item.wide .item-buy { grid-column: 1 / -1; flex-direction: row; border-top: 2px solid var(--line); }
  .buyer { width: 100%; }
  .row { grid-template-columns: 70px 1fr; }
  .row .meta { grid-column: 2; text-align: left; }
}

/* fights */
.bracket { display: grid; gap: 24px; }
.round h3 { font-size: 13px; color: var(--muted); font-weight: 400; margin-bottom: 8px; }
.fight { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; padding: 12px 16px; background: var(--panel-2); border-left: 2px solid var(--line); }
.fight + .fight { margin-top: 8px; }
.fight .side { display: grid; gap: 6px; opacity: .62; }
.fight .side.won { opacity: 1; }
.fight .side:last-child { justify-items: end; }
.fight .side:last-child .team-row { flex-direction: row-reverse; }
.fight .vs { display: grid; justify-items: center; gap: 2px; text-align: center; font-size: 13px; }
.fight .big { font-size: 22px; font-weight: 700; color: var(--ink); }
.res { font-family: var(--pixel); font-size: 13px; margin-right: 10px; }
.res.won { color: var(--blue); }
.res.lost { color: var(--muted); }
.score { font-size: 13px; color: var(--muted); }
.heads.small { display: inline-flex; gap: 2px; margin-right: 8px; vertical-align: middle; }
.heads.small img { width: 20px; height: 20px; image-rendering: pixelated; }
@media (max-width: 860px) {
  .fight { grid-template-columns: 1fr; justify-items: start; }
  .fight .side:last-child { justify-items: start; }
  .fight .side:last-child .team-row { flex-direction: row; }
  .fight .vs { justify-items: start; text-align: left; }
}

/* tournaments */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.tcard { display: grid; gap: 16px; padding: 16px 20px; background: var(--panel); border: 2px solid var(--line); color: var(--ink); }
.tcard:hover { border-color: var(--blue); text-decoration: none; }
.tcard-top { display: flex; justify-content: space-between; font-size: 13px; }
.tcard-win { display: flex; align-items: center; gap: 14px; }
.tcard-win strong { font-size: 17px; }
.champ-heads { display: flex; gap: 4px; }
.champ-heads img { image-rendering: pixelated; border: 2px solid var(--gold); background: var(--panel-2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-family: var(--pixel); font-size: 12px; color: var(--muted); background: var(--panel-2); border: 2px solid var(--line); padding: 3px 8px; }
.champ { display: flex; align-items: center; gap: 20px; padding: 20px 24px; margin-bottom: 32px; background: var(--panel); border: 2px solid var(--gold); }
.champ .status { color: var(--gold); }
.champ-name { font-family: var(--pixel); font-weight: 700; font-size: 22px; }
.tree { display: flex; gap: 32px; overflow-x: auto; padding-bottom: 8px; }
.col { display: grid; grid-template-rows: auto 1fr; gap: 12px; min-width: 240px; }
.col h3 { font-size: 13px; color: var(--muted); font-weight: 400; }
.col-body { display: flex; flex-direction: column; justify-content: space-around; gap: 16px; }
.match { position: relative; display: grid; border: 2px solid var(--line); background: var(--panel-2); }
.col + .col .match::before { content: ""; position: absolute; left: -34px; top: 50%; width: 32px; border-top: 2px solid var(--line); }
.slot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; opacity: .55; }
.slot + .slot { border-top: 2px solid var(--line); }
.slot.won { opacity: 1; background: #232838; }
.slot.won .pts { color: var(--blue); }
.who-list { display: grid; gap: 4px; }
.who-list .who img { width: 20px; height: 20px; }
.pts { font-size: 17px; font-weight: 700; }
.match-meta { font-size: 12px; color: var(--muted); padding: 4px 10px 6px; border-top: 2px solid var(--line); }

/* recent */
.match-row { display: grid; grid-template-columns: 40px auto 1fr auto; align-items: center; gap: 14px; padding: 12px 14px; background: var(--panel-2); border: 2px solid transparent; color: var(--ink); }
.match-row:hover { border-color: var(--line); text-decoration: none; }
.match-row.latest { border-color: var(--gold); }
.match-row .champ-heads img { width: 32px; height: 32px; }
.mr-id { font-size: 13px; color: var(--muted); }
.mr-who { display: grid; gap: 2px; min-width: 0; }
.mr-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-who .muted { font-size: 13px; }
.mr-when { font-size: 13px; white-space: nowrap; }
@media (max-width: 860px) {
  .match-row { grid-template-columns: auto 1fr; }
  .mr-id { display: none; }
  .mr-when { grid-column: 2; }
}
