@font-face { font-family: "Chakra Petch"; font-weight: 500; font-display: swap; src: url(fonts/chakra-petch-500.woff2) format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url(fonts/chakra-petch-600.woff2) format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-display: swap; src: url(fonts/chakra-petch-700.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 100 800; font-display: swap; src: url(fonts/jetbrains-mono.woff2) format("woff2"); }
@font-face { font-family: "Silkscreen"; font-weight: 400; font-display: swap; src: url(fonts/silkscreen.woff2) format("woff2"); }

:root {
    --bg: #090a11;
    --band: #0e0f18;
    --card: #11131d;
    --line: #222536;
    --text: #e9eaf2;
    --muted: #9799aa;
    --amber: #ffb547;
    --cyan: #53d3ec;
    --green: #6fdc8c;
    --grey: #8a8c9c;
    --sans: "Chakra Petch", system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
    --pixel: "Silkscreen", var(--mono);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 500 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 30px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 12px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.pixel { font-family: var(--pixel); }
.upper { text-transform: uppercase; letter-spacing: .08em; }
.nowrap { white-space: nowrap; }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(9, 10, 17, .88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 400 18px var(--pixel); letter-spacing: .06em; text-transform: uppercase; }
.brand img { width: 28px; }
.nav { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.nav > a:not(.btn) { color: #c9cad6; text-decoration: none; }
.nav > a:not(.btn):hover { color: #fff; }
.nav form { margin: 0; }
.lang { display: flex; align-items: center; gap: 2px; padding: 4px 6px 4px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.lang .icon { width: 16px; height: 16px; margin-right: 4px; }
.lang a { font: 600 12px var(--mono); padding: 3px 6px; border-radius: 4px; text-decoration: none; color: var(--muted); }
.lang a:hover { color: #fff; }
.lang a.active { background: #232637; color: #fff; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 4px; border: 1px solid transparent; font: 700 15px var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .15s, border-color .15s; }
.btn svg { width: 14px; height: 14px; fill: currentColor; }
.btn-primary { background: var(--amber); color: #1a1205; }
.btn-primary:hover { background: #ffc66c; }
.btn-ghost { background: transparent; border-color: #34374a; color: var(--text); }
.btn-ghost:hover { border-color: #565a73; }
.btn-small { padding: 8px 16px; font-size: 14px; }

/* Hero */
.hero { padding: 48px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 5fr 6fr; gap: 56px; align-items: center; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.hero h1 { margin: 0 0 22px; }
.hero h1 img { width: 100%; max-width: 420px; filter: drop-shadow(0 0 18px rgba(255, 40, 40, .35)); }
.lead { font-size: 18px; color: #d7d8e2; max-width: 34em; margin-bottom: 26px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.hero-shot { margin: 0; }
.frame { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #000; box-shadow: 0 30px 80px -30px rgba(255, 181, 71, .12); }
.frame img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-shot figcaption { margin-top: 8px; }

/* Sections */
.band { background: var(--band); border-top: 1px solid #151724; border-bottom: 1px solid #151724; padding: 64px 0; }
.section { padding: 64px 0; }
.section h2 { margin-bottom: 32px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 24px; }
.section-head p { max-width: 330px; margin: 0; font-size: 14px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.platform { display: flex; flex-direction: column; padding: 18px 16px; min-height: 154px; }
.platform .card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; color: var(--cyan); }
.platform h3 { margin-bottom: 8px; }
.platform p { font-size: 13px; }
.platform-text { flex: 1; margin-bottom: 12px; }
.platform-text p { margin: 0; }
.platform.recommended { background: #161308; border-color: var(--amber); }
.platform.recommended .card-top { color: var(--amber); }
.platform.unavailable { border-style: dashed; background: transparent; }
.platform.unavailable .card-top { color: var(--grey); }
.cta { color: var(--cyan); text-decoration: none; font-weight: 600; font-size: 14px; }
.recommended .cta { color: var(--amber); }
.cta:hover { text-decoration: underline; }
.badge { font: 600 9px var(--mono); letter-spacing: .12em; text-transform: uppercase; padding: 4px 7px; border: 1px solid currentColor; border-radius: 2px; white-space: nowrap; }
.badge-solid { background: var(--amber); border-color: var(--amber); color: #1a1205; }

/* Progress */
.progress-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.overall { padding: 24px 18px; }
.overall-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.big { font-size: 26px; }
.accent { color: var(--amber); }
.bar { background: #222536; border-radius: 1px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--amber); }
.bar-thick { height: 8px; margin-bottom: 18px; }
.bar-mid { height: 4px; margin: 6px 0 12px; }
.bar-thin { height: 3px; }
.bar-thin span { background: #e9eaf2; }
.items { list-style: none; margin: 0; padding: 0; }
.items li { margin-bottom: 12px; font-size: 13px; }
.item-head { display: flex; justify-content: space-between; margin-bottom: 6px; color: #cfd0db; }
.platform-progress { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.platform-progress .card { padding: 14px 14px 6px; }
.pp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.pp-head h3 { font-size: 15px; }
.pp-pct { margin: 0; }
.pp-pct .pixel { font-size: 20px; margin-right: 6px; }
.platform-progress .small { font-size: 12px; }
.tone-amber .badge, .tone-amber .pixel { color: var(--amber); }
.tone-cyan .badge, .tone-cyan .pixel { color: var(--cyan); }
.tone-cyan .bar span { background: var(--cyan); }
.tone-green .badge, .tone-green .pixel { color: var(--green); }
.tone-green .bar span { background: var(--green); }
.tone-grey .badge, .tone-grey .pixel { color: var(--grey); }
.tone-grey .bar span { background: var(--grey); }

.changes { margin-top: 16px; padding: 18px; }
.changes ul { margin: 4px 0 6px; padding-left: 18px; font-size: 12px; color: #c4c5d2; columns: 2; column-gap: 40px; }
.changes li { margin-bottom: 6px; break-inside: avoid; }
.tip { margin: 16px 0 0; }

/* Blog */
.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.post-card { display: flex; flex-direction: column; gap: 6px; }
.post-card p { margin: 0; }
.post-card h3 a { text-decoration: none; }
.post-card h3 a:hover { color: var(--amber); }
.post-card .excerpt { flex: 1; }
.post-list { display: grid; gap: 12px; margin-top: 24px; }
.blog-wrap { max-width: 780px; }
.blog h1 { font-size: 34px; margin: 8px 0 12px; }
.post { margin: 24px 0 32px; }
.post .eyebrow { margin-bottom: 10px; }
.post-body { font-size: 16px; line-height: 1.7; }
.post-body h3 { font-size: 20px; margin: 28px 0 10px; color: var(--text); }
.post-body ul { padding-left: 20px; margin: 0 0 12px; }
.post-body li { margin-bottom: 6px; }
.prose code { font: 13px var(--mono); background: #1a1d2b; padding: 1px 5px; border-radius: 3px; color: #e9eaf2; }

/* Screenshots */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.shots figure { margin: 0; }
.shots a { display: block; cursor: zoom-in; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #000; }
.shots img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s; }
.shots a:hover img { transform: scale(1.03); }
.shots figcaption { margin-top: 8px; }
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; overflow: hidden; }
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(4, 5, 10, .92); }
.lightbox img { max-width: min(92vw, 1100px); max-height: 82vh; width: auto; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.lb-caption { margin: 12px 0 0; color: #c9cad6; white-space: pre; }
.lb-btn { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #34374a; border-radius: 50%; background: rgba(17, 19, 29, .85); color: var(--text); font: 400 30px/1 var(--sans); cursor: pointer; }
.lb-btn:hover { border-color: var(--amber); color: var(--amber); }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-close { right: 20px; top: 20px; font-size: 26px; }
a.frame { display: block; cursor: zoom-in; }

/* About and footer */
.about-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; }
.prose { font-size: 14px; color: #d0d1dc; }
.prose a { color: var(--amber); }
.footer { border-top: 1px solid #151724; padding: 22px 0 40px; font-size: 12px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; }
.footer p { margin: 0; }
.footer a { color: var(--muted); }

@media (max-width: 920px) {
    .hero-grid, .progress-grid, .about-grid { grid-template-columns: 1fr; gap: 32px; }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}
/* The level editor needs a wide screen and a mouse: its link goes first. */
@media (max-width: 960px) {
    .nav > a.nav-wide { display: none; }
}
/* Until the links go (640 px) the bar holds them a little closer, then drops those into the page. */
@media (max-width: 860px) {
    .nav { gap: 16px; font-size: 14px; }
}
@media (max-width: 780px) {
    .nav > a.nav-page { display: none; }
}
@media (max-width: 640px) {
    .nav > a:not(.btn) { display: none; }
    .nav { gap: 12px; }
    .cards, .platform-progress, .shots { grid-template-columns: 1fr; }
    .changes ul { columns: 1; }
    .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
    .footer-inner { flex-direction: column; }
    h2 { font-size: 26px; }
}
@media (max-width: 440px) {
    .nav > .btn { display: none; }
}
#blog .section-head { align-items: baseline; }
#blog .section-head h2 { margin-bottom: 0; }
/* Two plain sections in a row share one gap instead of stacking both paddings. */
.section + .section { padding-top: 0; }

/* Manual */
.manual-grid { display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: start; }
.manual-toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; font-size: 14px; }
.manual-toc ol { list-style: none; margin: 0; padding: 0; }
.manual-toc li { margin: 0 0 8px; }
.manual-toc a { color: #c9cad6; text-decoration: none; }
.manual-toc a:hover { color: var(--amber); }
.manual-body { max-width: 780px; font-size: 15px; line-height: 1.7; }
.manual-body h1 { font-size: 34px; margin: 0 0 12px; }
.manual-chapter { scroll-margin-top: 80px; }
.manual-chapter.level-1 { margin-top: 40px; }
.manual-chapter.level-1 h2 { font-size: 24px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.manual-chapter.level-2 { margin-top: 22px; }
.manual-chapter h3 { font-size: 16px; margin-bottom: 8px; color: var(--amber); }
.manual-chapter h4 { font-size: 16px; margin: 18px 0 8px; }
.manual-chapter ul { padding-left: 20px; margin: 0 0 12px; }
.manual-chapter li { margin-bottom: 4px; }
.manual-chapter pre { font: 13px/1.6 var(--mono); color: #d0d1dc; margin: 0 0 12px; padding-left: 1.5em; white-space: pre-wrap; }
.port-entry pre { padding-left: 0; }
.port-entry { border: 1px solid var(--amber); border-radius: 6px; padding: 12px 16px; margin: 8px 0 16px; background: #161308; }
.port-entry h4 { margin-top: 0; color: var(--amber); }
.keys { border-collapse: collapse; margin: 0 0 14px; font-size: 14px; }
.keys th { text-align: left; font: 600 13px/1.7 var(--mono); color: var(--amber); padding: 4px 18px 4px 0; vertical-align: top; white-space: nowrap; }
.keys td { vertical-align: top; }
.keys td { padding: 4px 0; color: #d0d1dc; }
.keys tr + tr { border-top: 1px solid #1c1f2d; }
@media (max-width: 920px) {
    .manual-grid { grid-template-columns: 1fr; gap: 16px; }
    .manual-toc { position: static; max-height: none; }
    .manual-toc ol { columns: 2; }
}
@media (max-width: 640px) {
    .keys th { white-space: normal; }
}
.keys tr.more { border-top: 0; }
.keys td strong { color: var(--text); font-weight: 700; margin-right: 4px; }

/* Help dialogs */
.help-link { display: block; margin: 8px 0 0; padding: 0; border: 0; background: none; color: var(--muted); font: 500 13px var(--sans); text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.help-link:hover { color: var(--text); }
.help-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 28px 30px 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font-size: 15px; line-height: 1.65; overflow: auto; }
.help-dialog::backdrop { background: rgba(4, 5, 10, .85); }
.help-dialog h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; margin: 0 40px 16px 0; }
.help-dialog h2 .icon { color: var(--cyan); }
.help-dialog p { margin: 0 0 14px; }
.help-dialog .caution { padding: 10px 14px; border-left: 3px solid var(--amber); background: #161308; font-size: 14px; }
.help-dialog ol { margin: 0 0 16px; padding-left: 22px; }
.help-dialog li { margin-bottom: 10px; }
.help-dialog li a { color: var(--cyan); }
.help-close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; font-size: 22px; }
.post-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 4px 0 18px; }
.post-images figure { margin: 0; }
.post-images a { display: block; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: zoom-in; }
.post-images img { width: 100%; display: block; }
.post-images figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); }
.post-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.post-meta .badge { color: var(--cyan); }

/* Hall of fame */
.hof h1 { font-size: 34px; margin: 0 0 8px; }
.hof-tabs { display: flex; flex-direction: column; gap: 10px; margin: 24px 0 18px; }
.hof-waves { display: flex; align-items: center; gap: 10px; margin: 20px 0 0; font: 600 13px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.hof-waves select { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 7px 10px; font: 600 13px var(--mono); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 4px; color: #c9cad6; text-decoration: none; font: 600 13px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.tabs a:hover { border-color: #565a73; color: #fff; }
.tabs a.active { background: var(--amber); border-color: var(--amber); color: #1a1205; }
.periods a.active { background: #232637; border-color: #3a3e55; color: #fff; }
.hof-caption { margin-bottom: 10px; }
.hof-empty { padding: 28px; text-align: center; }
.hof-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.hof-table th { text-align: left; font: 600 12px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #11131d; }
.hof-table td { padding: 8px 12px; border-bottom: 1px solid #1a1d2b; vertical-align: middle; }
.hof-table .num { text-align: right; white-space: nowrap; }
.hof-table .score { font: 600 15px var(--mono); }
.hof-table .place { font: 400 14px var(--pixel); color: var(--muted); width: 3em; }
.hof-table .top .place { color: var(--amber); }
.hof-table .top-1 .score { color: var(--amber); }
.hof-table .date { white-space: nowrap; }
.hof-more-toggle { padding: 0; border: 0; background: none; color: var(--text); font: 600 15px var(--sans); cursor: pointer; text-align: left; }
.hof-more-toggle:hover { color: var(--amber); }
.hof-more td { border-bottom: 1px solid #1a1d2b; padding-top: 0; }
.rank-img { display: block; width: 124px; height: 15px; background: url(img/ranks.png) no-repeat 0 calc(var(--rank) * -15px); image-rendering: pixelated; }
.hof-how { margin-top: 16px; }
@media (max-width: 760px) {
    .hof-table .date, .hof-table th.date { display: none; }
    .hof-table td, .hof-table th { padding: 7px 6px; }
    .rank-img { width: 64px; overflow: hidden; }
}
.hof-home-intro { margin: -16px 0 20px; font-size: 14px; }
#halloffame .section-head { align-items: baseline; margin-bottom: 24px; }
#halloffame .section-head h2 { margin-bottom: 0; }
.hof-home { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.hof-best { display: flex; flex-direction: column; gap: 6px; text-decoration: none; min-height: 104px; }
.hof-best .eyebrow { margin: 0; }
.hof-best-score { font-size: 18px; color: var(--amber); }
.hof-best.empty { border-style: dashed; background: transparent; }
.hof-best:hover { border-color: #565a73; }
@media (max-width: 920px) { .hof-home { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .hof-home { grid-template-columns: repeat(2, 1fr); } }

/* Open network duels */
.duel-open { padding: 40px 0; }
.duel-open .section-head { align-items: baseline; margin-bottom: 14px; }
.duel-open .section-head h2 { margin-bottom: 0; }
.duel-empty { margin: 0; font-size: 14px; }
.duel-intro { margin: 0 0 14px; }
.duel-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.duel-game { display: flex; flex-direction: column; gap: 4px; text-decoration: none; border-color: var(--amber); background: #161308; }
.duel-game:hover { border-color: #ffc66c; }
.duel-name { font-weight: 700; font-size: 17px; }
.duel-game .cta { color: var(--amber); margin-top: 6px; }
.duel-playing { margin: 12px 0 0; }

/* News banner on the start page */
.news-banner { padding: 40px 0 0; }
.news-banner + .section { padding-top: 32px; }
.news-card { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 24px 28px;
    border-color: var(--amber); background: linear-gradient(100deg, #1a1508, var(--card) 70%); }
.news-card .eyebrow { margin-bottom: 8px; }
.news-card h2 { font-size: 24px; margin: 0 0 8px; }
.news-card p.muted { margin: 0; font-size: 14px; max-width: 46em; }
.news-actions { display: flex; flex-wrap: wrap; gap: 10px; flex: 0 0 auto; }
@media (max-width: 760px) {
    .news-card { flex-direction: column; align-items: flex-start; gap: 18px; padding: 20px; }
}
