/* CEILING CAT tokens (locked once, before build)
   palette: tile #F4F0E1 / tile-2 #EAE5D3 / panel #FBF9F2 / rail #8A8984 / rail-dark #5E5D59
            void #0B0B0B / ink #161616 / ear #F3B6C4 (sparing) / link #1F3FBF (2007 forum blue)
   type:    Anton (Impact-style caption face) + Courier Prime (forum chrome), both bundled from @fontsource
   spacing: 4 / 8 / 12 / 16 / 24 / 32 px
   radius:  0 everywhere (MS Paint and phpBB never rounded anything)
   motion:  none decorative; hover = instant void/tile swap; the only moving thing is the eyes */
@font-face { font-family: "Anton"; src: url("assets/fonts/anton-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("assets/fonts/courier-prime-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("assets/fonts/courier-prime-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --tile: #F4F0E1; --tile-2: #EAE5D3; --panel: #FBF9F2;
  --rail: #8A8984; --rail-dark: #5E5D59;
  --void: #0B0B0B; --ink: #161616; --ear: #F3B6C4; --link: #1F3FBF;
  --caption: "Anton", Impact, "Arial Black", sans-serif;
  --mono: "Courier Prime", "Courier New", monospace;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --tile-size: 160px;
  /* classic macro outline: white fill ringed by black, drawn with shadows so the fill stays solid */
  --outline: 3px 0 0 #000, -3px 0 0 #000, 0 3px 0 #000, 0 -3px 0 #000, 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 3px 3px 0 #000;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 15px/1.5 var(--mono);
  background-color: var(--tile);
  /* the drop ceiling: grey rails every tile, slightly heavier than a hairline like the art */
  background-image:
    linear-gradient(to right, var(--rail) 3px, transparent 3px),
    linear-gradient(to bottom, var(--rail) 3px, transparent 3px);
  background-size: var(--tile-size) var(--tile-size);
  background-position: -2px -2px;
}
::selection { background: var(--ear); color: var(--ink); }
a { color: var(--link); }
a:hover { background: var(--void); color: var(--tile); text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--ear); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 1040px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s6); }

/* board header */
.board {
  display: flex; align-items: stretch; justify-content: space-between; gap: var(--s4);
  background: var(--panel); border: 3px solid var(--rail-dark); padding: var(--s4) var(--s5);
}
.board-logo {
  font: 400 clamp(40px, 8vw, 76px)/0.95 var(--caption); letter-spacing: 1px; text-decoration: none;
  color: #fff; text-shadow: var(--outline);
}
.board-logo:hover { background: none; color: #fff; }
.board-tag { margin: var(--s2) 0 0; font-size: 13px; color: var(--rail-dark); }
.void-tile {
  flex: 0 0 auto; width: 120px; height: 96px; background: var(--void);
  display: flex; align-items: center; justify-content: center; gap: var(--s3);
  border: 3px solid var(--rail);
}
.eye { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 3px solid #fff; position: relative; overflow: hidden; }
.pupil { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--void); }

/* nav + crumbs */
.navbar { display: flex; flex-wrap: wrap; gap: 0; background: var(--void); border: 3px solid var(--void); border-top: 0; }
.navbar a {
  color: var(--tile); text-decoration: none; font-weight: 700; font-size: 14px; text-transform: uppercase;
  padding: var(--s2) var(--s4); display: inline-flex; align-items: center; gap: var(--s2);
  border-right: 1px solid var(--rail-dark);
}
.navbar a:hover { background: var(--tile); color: var(--void); }
.nav-x img { width: 24px; height: 24px; background: var(--tile); image-rendering: pixelated; }
.crumbs {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2);
  font-size: 13px; padding: var(--s2) var(--s3); margin: var(--s4) 0 var(--s3);
  background: var(--panel); border: 1px solid var(--rail);
}
.status b { background: var(--void); color: var(--tile); padding: 0 var(--s1); }

/* posts */
.thread { display: flex; flex-direction: column; gap: var(--s3); }
.replies { display: flex; flex-direction: column; gap: var(--s3); }
.post { display: grid; grid-template-columns: 184px 1fr; background: var(--panel); border: 2px solid var(--rail-dark); }
.post:nth-child(even) .post-body { background: var(--tile-2); }
.poster { padding: var(--s3); border-right: 2px solid var(--rail); display: flex; flex-direction: column; gap: var(--s1); font-size: 12px; }
.poster-pic { width: 160px; height: 160px; border: 2px solid var(--void); image-rendering: auto; }
.poster-meta { display: flex; flex-direction: column; gap: 2px; margin-top: var(--s2); }
.poster-name { font-size: 15px; color: var(--link); }
.rank { color: var(--rail-dark); }
.post-body { padding: 0 var(--s4) var(--s4); min-width: 0; }
.post-head {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s2);
  font-size: 12px; color: var(--rail-dark); padding: var(--s2) 0; margin-bottom: var(--s3);
  border-bottom: 1px dashed var(--rail);
}
.canary b { color: var(--ink); font-variant-numeric: tabular-nums; }
.post-banner { width: 100%; border: 2px solid var(--void); }
.macro-h {
  margin: var(--s4) 0 var(--s3); font: 400 clamp(34px, 6.4vw, 64px)/1.02 var(--caption); text-transform: uppercase;
  color: #fff; text-shadow: var(--outline); letter-spacing: 1px;
}
.post-body p { margin: 0 0 var(--s3); max-width: 62ch; }

.codebox { border: 1px solid var(--rail-dark); background: #fff; margin: var(--s4) 0; max-width: 520px; }
.codebox-head { font-size: 11px; font-weight: 700; padding: var(--s1) var(--s2); border-bottom: 1px solid var(--rail); background: var(--tile-2); display: flex; gap: var(--s2); align-items: center; }
.codebox code { display: block; padding: var(--s3); font: 700 14px/1.3 var(--mono); overflow-wrap: anywhere; user-select: all; }
.linkish { font: inherit; color: var(--link); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.linkish:hover { background: var(--void); color: var(--tile); }
.ca-note { color: var(--rail-dark); font-weight: 400; }
.sig { font-size: 13px; color: var(--rail-dark); }
.sig-rule { display: block; letter-spacing: -1px; }
.sig p { margin: var(--s1) 0 0; }

.macro { margin: 0 0 var(--s3); width: min(320px, 100%); border: 2px solid var(--void); position: relative; background: var(--void); }
.macro canvas { display: block; width: 100%; height: auto; }
.macro figcaption { padding: var(--s1) var(--s2); color: var(--tile); font: 400 16px/1.2 var(--caption); letter-spacing: 0.5px; }
.js .macro.drawn img, .js .macro.drawn figcaption { display: none; }
.reply .poster { gap: 2px; }
.del { margin-left: auto; }

/* reply box / macro maker */
.replybox { display: block; border: 3px solid var(--void); }
.replybox-head { background: var(--void); color: var(--tile); font-weight: 700; text-transform: uppercase; padding: var(--s2) var(--s4); font-size: 14px; }
.maker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); padding: var(--s5); }
.stage { position: relative; }
.stage canvas { width: 100%; height: auto; display: block; border: 3px solid var(--void); background: var(--void); }
.stage-fallback, .stage-note { display: none; }
.no-js .stage canvas { display: none; }
.no-js .stage-fallback, .no-js .stage-note, .stage.nocanvas .stage-fallback, .stage.nocanvas .stage-note { display: block; }
.stage.nocanvas canvas { display: none; }
.stage-note { font-size: 13px; margin-top: var(--s2); }
.controls { display: flex; flex-direction: column; gap: var(--s3); }
.controls label { display: flex; flex-direction: column; gap: var(--s1); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.controls input {
  font: 400 22px/1.2 var(--caption); letter-spacing: 0.5px; text-transform: uppercase; padding: var(--s2) var(--s3);
  border: 2px solid var(--void); background: #fff; color: var(--ink); border-radius: 0; width: 100%;
}
#uName { font: 700 16px/1.2 var(--mono); text-transform: none; }
.presets { display: flex; flex-wrap: wrap; gap: var(--s2); }
.presets button {
  font: 700 12px/1 var(--mono); padding: var(--s2) var(--s3); background: var(--tile-2); color: var(--ink);
  border: 1px solid var(--rail-dark); border-radius: 0; cursor: pointer;
}
.presets button:hover { background: var(--void); color: var(--tile); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.btn {
  font: 400 20px/1 var(--caption); letter-spacing: 1px; padding: var(--s3) var(--s5); cursor: pointer; border-radius: 0;
  border: 3px solid var(--void); background: var(--tile); color: var(--void);
}
.btn:hover { background: var(--void); color: var(--tile); }
.btn-void { background: var(--void); color: #fff; }
.btn-void:hover { background: var(--ear); color: var(--void); }
.btn-plain { font: 700 13px/1 var(--mono); border-width: 1px; padding: var(--s3); }
.maker-msg { font-size: 13px; margin: 0; min-height: 1.5em; }
.maker-msg.flash { background: var(--void); color: var(--tile); padding: 0 var(--s1); align-self: flex-start; }

/* footer */
.online { margin-top: var(--s5); background: var(--panel); border: 2px solid var(--rail-dark); font-size: 13px; }
.online-head { background: var(--void); color: var(--tile); font-weight: 700; padding: var(--s2) var(--s4); text-transform: uppercase; }
.online p { margin: var(--s3) var(--s4); }
.online .fine { color: var(--rail-dark); font-size: 12px; }

#errbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 99; background: #c00; color: #fff; font: 700 13px/1.4 var(--mono); padding: var(--s2) var(--s4); }

@media (max-width: 919px) {
  .maker { grid-template-columns: 1fr; padding: var(--s4); }
}
@media (max-width: 640px) {
  :root { --tile-size: 96px; }
  .wrap { padding: var(--s3) var(--s3) var(--s5); }
  .board { padding: var(--s3); }
  .void-tile { width: 76px; height: 64px; gap: var(--s2); }
  .eye { width: 22px; height: 22px; }
  .pupil { width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; }
  .post { grid-template-columns: 1fr; }
  .poster { flex-direction: row; align-items: center; gap: var(--s3); border-right: 0; border-bottom: 2px solid var(--rail); }
  .poster-pic { width: 64px; height: 64px; }
  .poster-meta { margin-top: 0; }
  .reply .poster { flex-wrap: wrap; column-gap: var(--s3); }
  .navbar a { padding: var(--s2) var(--s3); font-size: 12px; }
  .post-body { padding: 0 var(--s3) var(--s3); }
  .maker { padding: var(--s3); gap: var(--s4); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
