/* bloons-tdx2.com — black page, the game's Oetztype pixel font for headings and buttons,
   readable system sans for body copy, hard pixel-style edges (no rounded corners). */
@font-face {
  font-family: 'Oetztype';
  src: url('/assets/Oetztype.ttf') format('truetype');
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #0b0b0b;
  --line: #2a2a2a;
  --text: #f2f2f2;
  --dim: #9a9a9a;
  --gold: #f5b81c;
  --red: #c8102e;
  --green: #2fbf3f;
  --blue: #5865f2;
  --head: 'Oetztype', 'Courier New', monospace;
  --body: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --top-h: 82px; /* the sticky header's height — anchors scroll to just below it */
}
/* in-page anchors (#Gamma-1.7, #launcher-0.7.0, #post-…) land below the pinned header */
[id] { scroll-margin-top: calc(var(--top-h) + 24px); }
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--body);
  display: flex;
  flex-direction: column;
}
a { color: var(--gold); }
a:hover { color: #fff; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; background: #161616; padding: 1px 5px; }
pre { background: #101010; border: 2px solid var(--line); padding: 12px 14px; overflow-x: auto; font-size: 14px; line-height: 1.45; }
pre code { background: none; padding: 0; }
img { max-width: 100%; height: auto; }

h1, h2, h3, h4, .btn, .nav a, .badge, .node {
  font-family: var(--head);
  font-weight: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  -webkit-font-smoothing: none;
}
h1 { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.05; margin: 0.6em 0 0.4em; text-shadow: 0 4px 0 rgba(200, 16, 46, 0.55); }
h2 { font-size: clamp(1.3rem, 3.2vw, 1.9rem); line-height: 1.1; margin: 1.2em 0 0.5em; color: var(--gold); text-shadow: 0 3px 0 rgba(0, 0, 0, 0.8); }
h3 { font-size: 1.15rem; margin: 1em 0 0.4em; color: #fff; }
h2 a, h3 a { color: inherit; text-decoration: none; }
p { margin: 0.5em 0 0.9em; }
.lead { font-size: 1.1rem; color: #ddd; max-width: 62ch; }
.dim, .meta { color: var(--dim); }
.meta { font-size: 0.92rem; }
.row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.grow { flex: 1 1 240px; }

/* top bar (sticky: stays pinned while scrolling, solid so content never shows through) + footer.
   The plank is the game's own spr_TopBar: assets/topbar.png is a 640×60 crop of it from past the
   ROUND slot, cross-faded end to end so it repeats seamlessly. It is scaled by HEIGHT only
   (background-size: auto 100%) and repeated across the width, so the grain never stretches —
   a taller bar just means a proportionally wider tile. */
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px clamp(14px, 3vw, 32px) 10px;
  min-height: 60px;
  background: var(--bg) url('/assets/topbar.png') repeat-x left top;
  background-size: auto 100%;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.55);
}
.brand img { display: block; width: 130px; height: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
/* white on tan wood needs the game's 2 px outline to stay readable */
.nav a {
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
  padding: 6px 2px;
  border-bottom: 3px solid transparent;
  text-shadow: 2px 2px 0 #1c0f06, -2px 2px 0 #1c0f06, 2px -2px 0 #1c0f06, -2px -2px 0 #1c0f06;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--gold); color: var(--gold); }
.wrap { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 8px clamp(14px, 3vw, 32px) 48px; }
body.wide .wrap { max-width: 1200px; }
.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  justify-content: center;
  padding: 18px clamp(14px, 3vw, 32px) 26px;
  border-top: 3px solid var(--line);
  font-family: var(--head);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.85rem;
}
.foot a { color: #fff; text-decoration: none; }
.foot a:hover { color: var(--gold); }

/* buttons */
.btn {
  display: inline-block;
  padding: 12px 20px;
  border: 3px solid #fff;
  background: #000;
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--red);
  transition: transform 0.06s ease;
  text-align: center;
}
.btn:hover { background: #fff; color: #000; }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--red); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn[disabled]:hover { background: #000; color: #fff; }
.btn-gold { border-color: var(--gold); color: var(--gold); box-shadow: 4px 4px 0 #6b4d00; }
.btn-gold:hover { background: var(--gold); color: #000; }
.btn-green { border-color: var(--green); color: var(--green); box-shadow: 4px 4px 0 #0f5a19; }
.btn-green:hover { background: var(--green); color: #000; }
.btn-yt { border-color: #ff0033; color: #fff; background: #ff0033; box-shadow: 4px 4px 0 #6a0015; }
.btn-yt:hover { background: #fff; color: #ff0033; }
.btn-discord { border-color: var(--blue); color: #fff; background: var(--blue); box-shadow: 4px 4px 0 #23287a; }
.btn-discord:hover { background: #fff; color: var(--blue); }
.btn-gh { border-color: #fff; background: #fff; color: #000; box-shadow: 4px 4px 0 #555; }
.btn-gh:hover { background: #000; color: #fff; }
.btn-ghost { border-color: #666; color: #ddd; box-shadow: 4px 4px 0 #222; }
.btn-ghost:hover { border-color: #fff; }
/* the two products, wherever they are named in prose: launcher green, Kong Studio blue */
.lnk-launcher { color: var(--green); font-weight: 700; }
.lnk-studio { color: #56aaff; font-weight: 700; }
.btn-coffee { border-color: #ffdd00; background: #ffdd00; color: #000; box-shadow: 4px 4px 0 #8a7500; }
.btn-coffee:hover { background: #000; color: #ffdd00; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; box-shadow: 3px 3px 0 #222; }
button.link { background: none; border: 0; color: var(--gold); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
button.link.danger { color: #ff6b6b; }

/* the launcher image button: the launcher's own logo with the green LAUNCHER undertext */
.btn-launcher { display: inline-block; line-height: 0; transition: transform 0.08s ease, filter 0.08s ease; }
.btn-launcher img { width: 261px; height: auto; display: block; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.6)); }
.btn-launcher:hover { transform: scale(1.04); filter: drop-shadow(0 0 14px rgba(47, 191, 63, 0.55)); }
/* home: the launcher and Kong Studio logos side by side, each its own link */
.logo-pair { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: center; align-items: center; }
.logo-pair .btn-launcher img { width: min(196px, 40vw); }
.logo-pair .btn-launcher:last-child:hover { filter: drop-shadow(0 0 14px rgba(86, 170, 255, 0.55)); }

/* home: the living Monkey Rivulet behind the hero. home-bg.js draws the game's map contained
   in the viewport (crisp pixels) with its bloons and the dart monkey on the canvas; the
   blurred, darkened cover copy of the same map underneath turns the margins green. */
body.home { background: #2a5d1c; }
/* the background lives inside main.wrap (a stacking context); z-index -1 puts it under every
   in-flow child — panel, text, buttons, and the drop-shadowed logos alike */
body.home .wrap { position: relative; z-index: 0; }
.home-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #2a5d1c; pointer-events: none; }
.home-bg-blur {
  position: absolute;
  top: -32px;
  left: -32px;
  width: calc(100% + 64px);
  height: calc(100% + 64px);
  max-width: none;
  object-fit: cover;
  filter: blur(16px) brightness(0.5);
}
/* three stacked layers in DOM order: the static map, the moving sprites, the static overlay
   (home-bg.js creates the two static ones beside #home-bg-canvas) */
.home-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
body.home .foot { position: relative; z-index: 1; background: rgba(0, 0, 0, 0.62); border-top-color: rgba(255, 255, 255, 0.14); }
.hero.panel {
  background: rgba(0, 0, 0, 0.74);
  border: 3px solid rgba(255, 255, 255, 0.14);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
  padding: clamp(16px, 4vh, 40px) clamp(14px, 3vw, 32px) 28px;
  margin: 12px auto 20px;
  max-width: 640px;
}
.hero { text-align: center; padding-top: clamp(16px, 5vh, 56px); }
.logo-main { width: min(522px, 92vw); height: auto; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.7)); }
.tagline { font-family: var(--head); font-size: 1.3rem; line-height: 1.5; color: var(--gold); margin: 18px auto 26px; max-width: 48ch; }
.actions { display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 460px; margin: 0 auto; }
.actions .btn { width: 100%; }
.dl-launcher { margin: 10px 0 4px; width: 100%; }
.dl-launcher .btn { width: 100%; margin-top: 12px; }
.dl-launcher .meta { margin: 8px 0 0; }
/* GitHub / Discord / coffee sit in one row under the downloads, not stacked full-width */
.actions .community { width: 100%; justify-content: center; gap: 10px; }
.actions .community .btn { width: auto; flex: 1 1 auto; padding: 12px 14px; }

dialog.confirm { background: #000; color: var(--text); border: 3px solid #fff; box-shadow: 8px 8px 0 var(--red); padding: 22px 26px; max-width: 520px; width: calc(100vw - 32px); }
dialog.confirm::backdrop { background: rgba(0, 0, 0, 0.78); }
dialog.confirm h2 { margin-top: 0; }
dialog.confirm .row { margin-top: 14px; }
dialog.confirm .row .btn { flex: 1 1 auto; }

/* cards + content */
.card { border: 2px solid var(--line); background: var(--panel); padding: 16px 20px; margin: 16px 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0.2em; }
.badge { display: inline-block; font-size: 0.72rem; padding: 2px 8px; border: 2px solid #555; color: #ddd; vertical-align: middle; }
.badge.official { border-color: var(--gold); color: var(--gold); }
.badge.pending { border-color: var(--gold); color: var(--gold); }
.badge.published, .badge.ok { border-color: var(--green); color: var(--green); }
.badge.rejected, .badge.error { border-color: #ff6b6b; color: #ff6b6b; }
.release header h2 { margin-bottom: 0.1em; }
.release .meta { margin-top: 0; }
.changelog h3 { color: var(--gold); font-size: 1rem; margin: 1em 0 0.3em; }
.changelog ol, .changelog ul { margin: 0.2em 0 0.8em; padding-left: 1.6em; }
.changelog li { margin: 0.2em 0; }
.rel-list { list-style: none; padding: 0; margin: 0; }
.rel-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.rel-list li:first-child { border-top: 0; }

/* the launcher pitch */
.ad { display: flex; gap: 20px; align-items: center; border: 3px dashed var(--green); padding: 16px 20px; margin: 22px 0; background: #050a06; }
.ad-logo img { width: 180px; height: auto; display: block; }
.ad-text h3 { margin-top: 0; color: var(--green); }
.ad-text p { margin: 0.4em 0; }

/* launcher page */
.dl-hero { display: flex; flex-wrap: wrap; gap: 20px 28px; align-items: center; margin: 12px 0 20px; }
.shot { margin: 0 0 20px; }
.shot img { border: 2px solid var(--line); display: block; }
.shot figcaption { font-size: 0.9rem; color: var(--dim); margin-top: 6px; }
.nodes td { padding: 6px 12px 6px 0; vertical-align: top; }
.node { display: inline-block; width: 30px; text-align: center; border: 3px solid; padding: 2px 0; font-size: 1rem; }
.node.alpha { border-color: #777; color: #aaa; }
.node.beta { border-color: #56aaff; color: #56aaff; }
.node.gamma { border-color: var(--gold); color: var(--gold); }
.lrel { border-top: 1px solid var(--line); padding: 10px 0 2px; }
.lrel h3 { margin: 0.3em 0; }
.lrel .meta { font-family: var(--body); text-transform: none; letter-spacing: 0; font-size: 0.9rem; }

/* newsletter */
.signup label { display: block; font-family: var(--head); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
input, textarea, select {
  font: inherit;
  color: var(--text);
  background: #101010;
  border: 2px solid #444;
  padding: 10px 12px;
  min-width: 0;
}
input:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.signup input[type="email"] { flex: 1 1 240px; }
.status { min-height: 1.4em; color: var(--green); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline > li { display: grid; grid-template-columns: 92px 110px 1fr; gap: 6px 14px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); }
.timeline > li > time { color: var(--dim); font-size: 0.9rem; }
.timeline .t-body h3 { margin: 0 0 0.3em; }
.timeline .notes, .timeline .post-body { font-size: 0.95rem; color: #ccc; }
.timeline .notes ul { margin: 0.3em 0 0; padding-left: 1.3em; }
.timeline .video { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.timeline .video img { width: 160px; height: 90px; object-fit: cover; border: 2px solid var(--line); }
.t-release .badge { border-color: var(--gold); color: var(--gold); }
.t-launcher .badge { border-color: var(--green); color: var(--green); }
.t-video .badge { border-color: #ff0033; color: #ff6b81; }
.t-post .badge { border-color: #fff; color: #fff; }

/* credits */
.about { display: grid; grid-template-columns: 230px 1fr; gap: 18px 28px; align-items: start; }
.about .duck { width: 230px; height: 230px; object-fit: cover; display: block; border: 3px solid #fff; box-shadow: 6px 6px 0 var(--red); image-rendering: auto; }
.about h2 { margin-top: 0; }
.about .meta { margin-top: -0.3em; }
.about .links { margin-top: 12px; gap: 8px 10px; }
.team .member { display: grid; grid-template-columns: 110px 1fr; gap: 6px 18px; padding: 10px 0; border-top: 1px solid var(--line); }
.team .member:first-of-type { border-top: 0; }
.team .who { font-family: var(--head); text-transform: uppercase; letter-spacing: 0.06em; color: #fff; font-size: 1.1rem; }
.team .role { color: var(--gold); font-family: var(--head); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.95rem; }
.earlier h3 { color: var(--gold); margin-top: 1.1em; }
.earlier .names { columns: 3; column-gap: 28px; padding-left: 1.2em; margin: 0.2em 0 0.8em; }
.earlier .names li { break-inside: avoid; }
.earlier .names.libs, .earlier .names.also { columns: 1; }
.earlier .thanks { color: #ddd; margin-top: 1.2em; }
.earlier .thanks.nk { font-size: 1.05rem; }
.registry .empty { border: 3px dashed var(--green); padding: 18px 20px; color: #ddd; font-family: var(--head); text-transform: uppercase; letter-spacing: 0.06em; }
.person { border: 2px solid var(--line); background: var(--panel); padding: 14px 18px; margin: 12px 0; }
.person header h3 { margin: 0; font-size: 1.3rem; }
.person .login { font-family: var(--body); text-transform: none; letter-spacing: 0; font-size: 0.9rem; color: var(--dim); }
.person .meta { margin: 4px 0 8px; }
.badge.role { border-color: var(--gold); color: var(--gold); }
.contribs { list-style: none; padding: 0; margin: 0; }
.contribs li { padding: 5px 0; border-top: 1px solid var(--line); }
.contribs li:first-child { border-top: 0; }
.badge.kind-content { border-color: var(--green); color: var(--green); }
.badge.kind-release { border-color: var(--gold); color: var(--gold); }
.badge.kind-bugfix { border-color: #56aaff; color: #56aaff; }
.badge.kind-bugreport { border-color: #ff6b6b; color: #ff6b6b; }
.badge.kind-art { border-color: #e78fff; color: #e78fff; }
.badge.kind-idea { border-color: #fff; color: #fff; }

/* admin */
.banner { border: 2px solid; padding: 10px 16px; margin: 12px 0; }
.banner p { margin: 0.3em 0; }
.banner.warn { border-color: var(--gold); background: #1a1400; }
.banner.error { border-color: #ff6b6b; background: #1a0505; }
.banner.ok { border-color: var(--green); background: #04120a; }
.login { max-width: 420px; }
.login label { display: block; margin: 12px 0 4px; font-family: var(--head); text-transform: uppercase; letter-spacing: 0.08em; }
.login input { width: 100%; }
.tablewrap { overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
table.grid th, table.grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid th { font-family: var(--head); font-weight: normal; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); font-size: 0.8rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.facts dt { color: var(--dim); font-family: var(--head); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; }
dl.facts dd { margin: 0; word-break: break-word; }
code.hash { font-size: 0.8em; }
form.inline { display: inline; }
.reject { margin-top: 14px; }
.reject label { display: block; margin-bottom: 4px; color: var(--dim); }
.reject input { flex: 1 1 260px; }
.attach { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 10px; }
.attach progress { width: 100%; margin-top: 8px; }
.post-form label { display: block; margin: 10px 0 4px; color: var(--dim); }
.post-form input:not([type="date"]), .post-form textarea { width: 100%; }
.posts { padding-left: 1.2em; }
.posts li { margin: 4px 0; }
.person-admin.is-hidden { border-style: dashed; opacity: 0.75; }
.person-admin h3 { margin-top: 0; }
.person-form label, .contrib-form label { display: block; color: var(--dim); font-size: 0.85rem; margin-bottom: 3px; }
.person-form { align-items: flex-end; margin-bottom: 10px; }
.contrib-form { margin-top: 10px; }
.contrib-form input[name="title"] { flex: 1 1 200px; }
.contrib-form input[name="ref"] { flex: 1 1 200px; }
.person-admin .contribs li { font-size: 0.95rem; }

@media (max-width: 640px) {
  /* compact pinned header on phones: one plank tall. The nav scrolls sideways rather than
     wrapping — a wrapped nav would grow the header and blow the plank up with it. */
  :root { --top-h: 62px; }
  .top { gap: 8px 10px; padding: 4px 10px; min-height: 56px; }
  .brand img { width: 88px; }
  /* flex-start, not flex-end: the overflow has to hang off the RIGHT so Launcher and Studio
     are the two you can see without scrolling */
  .nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; gap: 0 14px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { font-size: 0.86rem; padding: 3px 1px; white-space: nowrap; }
  .logo-pair { gap: 8px 10px; }
  .logo-pair .btn-launcher img { width: min(196px, 36vw); }
  .ad { flex-direction: column; align-items: flex-start; }
  .timeline > li { grid-template-columns: 1fr; gap: 4px; }
  .timeline > li > time { order: -1; }
  dl.facts { grid-template-columns: 1fr; gap: 2px 0; }
  dl.facts dd { margin-bottom: 8px; }
  dialog.confirm .row .btn { flex-basis: 100%; }
  .hero.panel { padding: 14px 12px 20px; margin: 8px auto 16px; }
  .about { grid-template-columns: 1fr; }
  .about .duck { width: 160px; height: 160px; }
  .team .member { grid-template-columns: 1fr; gap: 2px; }
  .earlier .names { columns: 2; }
}
