/* /snail/ - Snailposting. Yotsuba B, the way the board actually looks, with snail orange as the one loud colour. */
:root {
  --bg: #EEF2FF;
  --fade: #D1D5EE;
  --reply: #D6DAF0;
  --border: #B7C5D9;
  --name: #117743;
  --subject: #0F0C5D;
  --green: #789922;
  --link: #34345C;
  --red: #DD0000;
  --title: #AF0A0F;
  --hl: #D6BAD0;
  --hlb: #BA9DBF;
  --postblock: #9988EE;
  --yellow: #F5B800;
  --orange: #F68A00;
  --cap: #9A4A00;
  --fg: #000;
  --muted: #444;
  --mod: #800080;
  --admin: #FF0000;
  --mono: Consolas, "Lucida Console", Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  padding: 0 8px 0;
  color: var(--fg);
  background: var(--bg) linear-gradient(var(--fade), var(--bg) 210px) no-repeat;
  font: 13px arial, helvetica, sans-serif;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
hr { border: 0; border-top: 1px solid var(--border); height: 0; margin: 4px 0; clear: both; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -40px; background: #fff; padding: 4px 8px; z-index: 60; }
.skip:focus { top: 6px; }
.linkbtn { font: inherit; color: var(--link); background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
.linkbtn:hover { color: var(--red); }

/* ---------------- board chrome ---------------- */
.boardList { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 3px 0; font-size: 9pt; color: #89A; }
.boardBanner { text-align: center; margin-top: 10px; }
.banner {
  position: relative; width: 300px; max-width: 100%; height: 100px; margin: 0 auto; overflow: hidden;
  background: var(--yellow); border: 1px solid #000;
  display: flex; align-items: center; justify-content: flex-end; padding-right: 14px;
}
.banner img { position: absolute; left: -14px; bottom: -22px; width: 150px; height: auto; transform: rotate(-8deg); }
.banner-t {
  position: relative; font: 40px/0.92 Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif; text-align: right;
  color: #fff; -webkit-text-stroke: 3px #000; paint-order: stroke fill; letter-spacing: .5px; max-width: 160px;
}
.boardTitle { margin: 4px 0 0; font: 700 28px Tahoma, Verdana, sans-serif; letter-spacing: -2px; color: var(--title); }
.boardSubtitle { margin: 2px 0 0; font-size: 10px; }
.postingMode { text-align: center; font: 700 18px arial, helvetica, sans-serif; margin: 6px 0; }
.postingMode .linkbtn { font-weight: 700; }

/* ---------------- post form ---------------- */
.postForm { margin: 4px auto 8px; display: table; transform-origin: 50% 0; }
.postForm table { border-spacing: 1px; }
.postForm th {
  background: var(--postblock); border: 1px solid #000; color: #000; font-weight: 700; font-size: 10pt;
  padding: 0 5px; text-align: left; vertical-align: top; line-height: 22px; white-space: nowrap;
}
.postForm td { padding: 0; }
.postForm input:not([type]), .postForm textarea {
  width: 300px; max-width: 100%; font: 13px arial, helvetica, sans-serif; border: 1px solid #AAA; padding: 2px 4px; margin: 0; background: #fff; color: #000;
}
.postForm textarea { height: 84px; resize: vertical; display: block; }
.optRow { display: flex; gap: 4px; }
.optRow input { flex: 1 1 auto; width: auto !important; min-width: 0; }
.postForm button { font: 13px arial, helvetica, sans-serif; }
.fileRow { line-height: 22px; }
.dlNote { color: var(--name); }
.rulesRow td { padding-top: 2px; }
.rules { margin: 0; padding: 0 0 0 16px; font-size: 10px; max-width: 360px; }
.rules li { margin: 1px 0; }

/* ---------------- global message: the contract address ---------------- */
.globalMessage { text-align: center; color: var(--red); font-weight: 700; margin: 8px 0; padding: 0 4px; }
.globalMessage p { margin: 3px 0; }
.ca-line { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 15px; }
.ca-k { color: var(--fg); font-size: 16px; }
.ca-slot { position: relative; display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 2px 8px; min-width: 0; max-width: 100%; }
.ca-none {
  font: italic 400 14px arial, helvetica, sans-serif; color: #707070; background: #fff;
  border: 1px dashed var(--border); padding: 4px 10px;
}
/* the whole address is the copy button. Long ones lose their middle, never their "...pump" end */
.ca {
  display: inline-flex; min-width: 0; max-width: 100%; margin: 0; cursor: copy;
  font: 700 16px/1.3 var(--mono); color: #000; background: #fff;
  border: 1px solid var(--border); border-bottom-color: #8A98B5; padding: 4px 10px;
  transition: background-color .12s, border-color .12s;
}
.ca:hover { background: #FFFBE6; border-color: var(--orange); }
.ca:active { transform: translateY(1px); }
.ca-a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ca-b { flex: none; white-space: nowrap; }
.ca.flash { animation: caFlash .9s ease-out; }
@keyframes caFlash { 0%, 25% { background: var(--yellow); border-color: #000; } 100% { background: #fff; } }
.ca-hint { font: 400 11px arial, helvetica, sans-serif; color: var(--link); white-space: nowrap; }
.ca-hint.ok { color: var(--name); font-weight: 700; }
/* 4chan X style notice */
.ca-toast {
  position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); pointer-events: none; z-index: 5;
  background: #E5F6DC; color: #000; border: 1px solid var(--name); padding: 2px 8px; font: 700 12px arial, helvetica, sans-serif;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .15); white-space: nowrap;
  animation: toast 1.1s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, 6px); } 15% { opacity: 1; transform: translate(-50%, 0); }
  75% { opacity: 1; transform: translate(-50%, -2px); } 100% { opacity: 0; transform: translate(-50%, -10px); }
}
.ca-warn { font-size: 13px; }
.gm-links { font-weight: 400; font-size: 13px; }
.gm-bond { color: var(--name); }
.gm-ascend {
  font: 700 22px/1.1 Tahoma, Verdana, sans-serif; letter-spacing: -1px; color: var(--title); text-transform: uppercase;
  margin: 4px 0 8px !important;
}
/* links that exist once there is a contract: until then they sit there, plainly not clickable */
a.inert, a.inert:hover { color: #8F96B3; cursor: default; text-decoration: none; }

/* ---------------- thread nav + the updater ---------------- */
.navLinks { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 2px 0; }
.navLinks .nl { line-height: 20px; }
.auto { cursor: pointer; white-space: nowrap; }
.auto input { margin: 0 1px 0 0; vertical-align: -2px; }
.updStatus { margin-left: 6px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.updStatus.err { color: var(--red); }
.updStatus.ping { animation: ping .5s ease-out; }
@keyframes ping { from { opacity: .3; } to { opacity: 1; } }
.threadStats { color: var(--muted); font-size: 11px; }

/* ---------------- posts ---------------- */
.thread { display: block; }
.postContainer { margin: 0; }
.replyContainer { display: flex; align-items: flex-start; }
.sideArrows { color: var(--border); flex: none; margin: 4px 3px 0 2px; user-select: none; }
.post { position: relative; }
.post.reply {
  display: table; background: var(--reply); border: 1px solid var(--border); border-left: 0; border-top: 0;
  padding: 2px 2px 2px 2px; margin: 4px 0; max-width: 100%;
}
.post.highlight, .post:target { background: var(--hl); border-color: var(--hlb); }
.post.op:target, .post.op.highlight { background: var(--hl); }
.postInfo { padding: 2px 4px 0; }
.postInfo > * { margin-right: 3px; }
.subject { color: var(--subject); font-weight: 700; }
.name { color: var(--name); font-weight: 700; }
.capcode { color: var(--cap); font-weight: 700; }
.you { font-weight: 700; }
.dateTime { white-space: nowrap; }
.postNum { white-space: nowrap; }
.postNum .linkbtn { color: var(--fg); }
.postNum a, .postNum .linkbtn:hover { color: var(--fg); }
.postNum a:hover, .postNum .linkbtn:hover { color: var(--red); }
.backlinks { font-size: 11px; }
.backlinks a { margin-right: 4px; display: inline-block; } /* lets a long backlink row wrap */
.backlinks a.fresh-bl { animation: blIn .9s ease-out; }
@keyframes blIn { 0% { background: var(--yellow); } 100% { background: transparent; } }
.postMessage { margin: 13px 40px 13px 40px; word-wrap: break-word; overflow-wrap: anywhere; line-height: 1.25; }
.reply .postMessage { margin: 10px 32px 10px 24px; }
.quote { color: var(--green); }
a.quotelink { color: var(--red); text-decoration: underline; }
a.quotelink:hover { color: var(--red); }
a.quotelink.deadlink { text-decoration: line-through; }
.file { margin: 0; }
.fileText { margin: 2px 0 2px 20px; font-size: 13px; }
.reply .fileText { margin-left: 24px; }
.fileThumb { float: left; display: block; margin: 3px 20px 5px 24px; cursor: zoom-in; }
.fileThumb img { display: block; border: 0; height: auto; }
.reply .fileThumb img { width: 125px; }
.reply .fileThumb.expanded { float: none; cursor: zoom-out; }
.reply .fileThumb.expanded img { width: min(640px, calc(100vw - 80px)); }
.reply .postMessage { overflow: hidden; }
.reply::after { content: ""; display: block; clear: both; }

/* new posts: a short yellow wash, like 4chan X's fresh-post highlight */
.post.fresh::before {
  content: ""; position: absolute; inset: 0; background: var(--yellow); opacity: 0; pointer-events: none;
  animation: fresh 1.8s ease-out;
}
@keyframes fresh { 0% { opacity: .45; } 100% { opacity: 0; } }

/* ---------------- the OP ---------------- */
.op { padding: 0 0 4px; }
.op .fileThumb { cursor: zoom-out; margin-left: 20px; margin-bottom: 8px; }
.op .fileThumb:not(.expanded) { cursor: zoom-in; }
.op .fileThumb.expanded { width: min(620px, calc(100vw - 56px)); }
.op .fileThumb:not(.expanded) { width: 250px; }
.stage {
  width: 100%; aspect-ratio: 4 / 3; background: #fff;
  --snst-slime: rgba(183, 197, 217, .75); --snst-sheen: #fff; --snst-shadow: rgba(15, 12, 93, .12);
  --snst-label: var(--subject); --snst-ground: 5%;
  font: 700 22px Tahoma, Verdana, sans-serif; color: var(--subject);
}
.op .postInfo { padding-top: 6px; }
.op .postMessage { margin-top: 10px; }
.mcap {
  display: block; margin: 2px 0 2px -3px;
  font: 700 clamp(54px, 8.4vw, 104px)/0.95 Tahoma, Verdana, "Segoe UI", sans-serif;
  letter-spacing: -0.05em; color: var(--subject); white-space: nowrap;
  font-variant-numeric: tabular-nums; text-shadow: 4px 4px 0 var(--yellow);
  transform-origin: 30% 60%;
}
/* size the number to its own column so $173.76M never runs off the post */
#thread .op .postMessage { container-type: inline-size; }
@supports (font-size: 1cqi) {
  #thread .op .mcap { font-size: clamp(44px, 18cqi, 104px); }
}
.mstat { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 8px; font-size: 11px; color: var(--muted); }
.mstat #statusText { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--fg); }
.mstat .sq { width: 9px; height: 9px; background: #8A8FAE; flex: none; }
.mstat[data-s="live"] .sq { background: var(--name); animation: blinkSq 1.6s steps(1) infinite; }
.mstat[data-s="stale"] .sq, .mstat[data-s="paused"] .sq { background: var(--orange); }
.mstat[data-s="error"] .sq { background: var(--red); }
.mstat[data-s="demo"] .sq, .mstat[data-s="fixed"] .sq { background: var(--postblock); }
.mstat[data-s="prelaunch"] .sq { background: var(--yellow); outline: 1px solid #000; }
@keyframes blinkSq { 50% { opacity: .25; } }
.chg.up { color: var(--name); font-weight: 700; }
.chg.down { color: var(--red); font-weight: 700; }
.bondBar {
  display: inline-block; vertical-align: -1px; width: 120px; max-width: 30vw; height: 10px;
  background: #fff; border: 1px solid var(--border); overflow: hidden;
}
.bondBar i {
  display: block; height: 100%; width: 0; background: var(--green);
  background-image: repeating-linear-gradient(-45deg, transparent 0 4px, rgba(255, 255, 255, .28) 4px 8px);
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.bondLine.bonded .bondBar { border-color: var(--name); }
.bondLine.bonded .bondBar i { background-color: var(--name); }
.bondLine.bonded #bondK { font-weight: 700; }
.metaLine.warn .quote { color: var(--red); }
.stickyIcon { display: inline-block; vertical-align: -2px; }
.stickyIcon svg { fill: var(--subject); display: block; }
.opLine { font-size: 14px; }
.opContainer::after { content: ""; display: block; clear: both; }

/* sizes post: reached rows turn into greentext */
.sz { display: block; }
.sz-n::before { content: "\3E"; visibility: hidden; }
.sz.got { color: var(--green); }
.sz.got .sz-n::before { visibility: visible; }
.sz-v { font-weight: 700; }
.sz.got .sz-v { font-weight: 400; }
.sz-s { color: var(--red); }
.sz.got .sz-s { color: var(--green); }
.sz.hit { animation: szHit 1.6s ease-out; }
@keyframes szHit { 0%, 30% { background: var(--yellow); } 100% { background: transparent; } }
.sz-u { font-size: 11px; color: var(--muted); }
.sz.got .sz-u { color: var(--green); }
.sz-goal .sz-n { font-weight: 700; }
.sz-past { display: block; margin-top: 4px; font-style: italic; color: var(--muted); }

/* staff: capcoded names take the capcode colour, like the board */
.cap-mod .name, .cap-mod .capcode { color: var(--mod); }
.cap-admin .name, .cap-admin .capcode { color: var(--admin); }
.banmsg { color: var(--admin); font-weight: 700; text-transform: uppercase; }
.staff .postMessage { font-size: 14px; }
.omittedPosts { color: #707070; margin: 6px 0 6px 24px; font-size: 12px; }
.threadStats .lim { font-style: italic; color: var(--red); }
.updStatus.plus { color: var(--name); font-weight: 700; }

/* ---------------- milestone sticky + quote previews ---------------- */
.msBar {
  position: fixed; left: 50%; top: 0; z-index: 40; transform: translate(-50%, -110%);
  background: var(--yellow); color: #000; border: 1px solid #000; border-top: 0;
  padding: 6px 14px 7px; font-size: 14px; text-align: center; max-width: calc(100vw - 16px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .18);
}
.msBar b { color: var(--title); font: 700 16px Tahoma, Verdana, sans-serif; letter-spacing: -1px; margin-right: 6px; }
.msBar i { font-style: normal; font-size: 12px; margin-left: 6px; padding-left: 8px; border-left: 1px solid rgba(0, 0, 0, .3); }
.msBar i:empty { display: none; }
/* tiers escalate: bigger bar from halfway up, green for the bond, red and loud for god snail, night sky past it */
.msBar[data-k="big"] { padding: 8px 18px 9px; font-size: 15px; }
.msBar[data-k="big"] b { font-size: 19px; }
.msBar[data-k="bond"] { background: #E5F6DC; border-color: var(--name); }
.msBar[data-k="bond"] b { color: var(--name); font-size: 19px; }
.msBar[data-k="god"], .msBar[data-k="post"] { padding: 10px 22px 12px; font-size: 16px; border-width: 0 2px 2px; }
.msBar[data-k="god"] { background: var(--yellow) linear-gradient(90deg, var(--yellow), #FFE27A, var(--yellow)); }
.msBar[data-k="god"] b, .msBar[data-k="post"] b { display: block; font: 30px/1 Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; letter-spacing: 1px; color: #fff; -webkit-text-stroke: 2px #000; paint-order: stroke fill; margin: 0 0 3px; }
.msBar[data-k="post"] { background: #0F0C5D; color: #fff; border-color: var(--yellow); }
.msBar[data-k="post"] b { color: var(--yellow); }
.msBar[data-k="post"] i { border-color: rgba(255, 255, 255, .4); }
.qp { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; max-width: min(560px, calc(100vw - 16px)); }
.qp .post { display: block; margin: 0; background: var(--reply); border: 1px solid var(--border); box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.qp .post.op { padding: 2px; }
.qp .mcap { font-size: 40px; text-shadow: 2px 2px 0 var(--yellow); }
.qp .fileThumb img { width: 125px; }

/* ---------------- the banner keeps long tier names inside the box ---------------- */
.banner-t[data-len="l"] { font-size: 34px; }
.banner-t[data-len="xl"] { font-size: 27px; max-width: 170px; }

/* ---------------- past the goal: the board itself changes ---------------- */
[data-pg] .mcap { text-shadow: 4px 4px 0 var(--yellow), 8px 8px 0 var(--orange); }
[data-pg] .banner { background: linear-gradient(115deg, #F5B800 0 40%, #FFE27A 50%, #F5B800 60% 100%) 0 0 / 300% 100%; }
[data-pg] .boardTitle { color: var(--title); }
[data-pg="2"] .banner { border-color: var(--orange); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--orange); }
[data-pg="3"] .banner, [data-pg="4"] .banner {
  background: radial-gradient(1.2px 1.2px at 20% 30%, #fff 50%, transparent 60%) 0 0 / 37px 29px,
    radial-gradient(1.6px 1.6px at 70% 60%, #FFE27A 50%, transparent 60%) 0 0 / 53px 41px, #0F0C5D;
}
[data-pg="4"] .bondBar, [data-pg="4"] .ca-none { background: #1D1F21; }
[data-pg="3"] .banner-t, [data-pg="4"] .banner-t { color: var(--yellow); }
@media (prefers-reduced-motion: no-preference) {
  [data-pg="1"] .banner, [data-pg="2"] .banner { animation: shine 3.2s linear infinite; }
  [data-pg="3"] .banner, [data-pg="4"] .banner { animation: drift 14s linear infinite; }
  [data-pg="4"] .banner-t { animation: hue 4s linear infinite; }
  [data-pg] .stickyIcon { animation: pinIn .5s cubic-bezier(.2,1.4,.4,1); }
}
@keyframes shine { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@keyframes drift { from { background-position: 0 0, 0 0; } to { background-position: -370px 0, -530px 0; } }
@keyframes hue { to { filter: hue-rotate(360deg); } }
@keyframes pinIn { from { transform: translateY(-8px) scale(.4); opacity: 0; } }

/* $10M: the board style flips to Tomorrow */
[data-pg="4"] {
  --bg: #1D1F21; --fade: #1D1F21; --reply: #282A2E; --border: #111; --fg: #C5C8C6; --muted: #A0A4A2;
  --name: #C5C8C6; --subject: #B294BB; --green: #B5BD68; --link: #81A2BE; --red: #CC6666; --title: #C5C8C6;
  --hl: #1D1D21; --hlb: #111; --postblock: #282A2E; --mod: #C397D8; --admin: #E06C75;
}
[data-pg="4"] body { color: var(--fg); }
[data-pg="4"] a.quotelink { color: #5F89AC; }
[data-pg="4"] .postForm th { color: var(--fg); border-color: #111; }
[data-pg="4"] .mstat .sq { outline-color: var(--fg); }
[data-pg="4"] .omittedPosts { color: var(--muted); }
[data-pg="4"] hr { border-top-color: #282A2E; }

.foot { text-align: center; font-size: 11px; color: var(--muted); padding: 6px 0 28px; }
.foot p { margin: 6px auto; max-width: 70ch; }
.foot .boardList { justify-content: center; }

/* ---------------- wide: the OP image beside its text ---------------- */
@media (min-width: 1000px) {
  .op { display: grid; grid-template-columns: auto minmax(320px, 1fr); align-items: start; }
  .op .file { grid-row: 1 / span 3; }
  .op .fileThumb { float: none; }
  .op .postInfo { padding-top: 22px; }
}

/* ---------------- phones ---------------- */
@media (max-width: 640px) {
  body { padding: 0 6px; }
  .boardTitle { font-size: 24px; }
  .banner { width: 240px; height: 80px; }
  .banner img { width: 120px; bottom: -18px; }
  .banner-t { font-size: 32px; max-width: 130px; }
  .postForm { display: block; }
  .postForm table { width: 100%; }
  .postForm th { width: 1%; }
  .postForm input:not([type]), .postForm textarea { width: 100%; }
  .op .fileThumb, .op .fileThumb.expanded { margin: 3px 0 6px; }
  .op .fileThumb.expanded { width: 100%; }
  .op .stage { aspect-ratio: 3 / 2; }
  .op .fileText { margin-left: 0; }
  .op .postInfo { padding-left: 0; }
  .postMessage { margin: 8px 6px 10px 2px; }
  .reply .postMessage { margin: 8px 10px 8px 8px; }
  .reply .fileText { margin-left: 8px; }
  .reply .fileThumb { margin: 3px 10px 5px 8px; }
  .reply .fileThumb img { width: 96px; }
  .post.reply { display: block; }
  .replyContainer { min-width: 0; }
  .navLinks { font-size: 12px; }
  .threadStats { width: 100%; }
  .ca { font-size: 14px; padding: 4px 8px; }
  .ca-line { font-size: 14px; }
  .gm-ascend { font-size: 18px; }
  .banner-t[data-len="l"] { font-size: 28px; }
  .banner-t[data-len="xl"] { font-size: 22px; max-width: 140px; }
  .msBar[data-k="god"] b, .msBar[data-k="post"] b { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .post.fresh::before, .sz.hit, .backlinks a.fresh-bl, .updStatus.ping, .mstat[data-s="live"] .sq, .ca.flash, .ca-toast { animation: none; }
  .bondBar i, .ca { transition: none; }
}
