@font-face {
  font-family: "Anton";
  src: url("../fonts/anton.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  /* Yotsuba B */
  --bg: #eef2ff;
  --bg-top: #d1d5ee;
  --reply: #d6daf0;
  --reply-border: #b7c5d9;
  --hl: #d6bad0;
  --hl-border: #ba9dbf;
  --name: #117743;
  --subject: #0f0c5d;
  --gt: #789922;
  --link: #34345c;
  --quote: #dd0000;
  --title: #af0a0f;
  --label: #9988ee;
  --label-border: #7766dd;
  --muted: #707070;
  --navy: #0f0c5d;

  --up: #16c784;
  --down: #ea3943;
  --accent: var(--down);
  --big: var(--title);

  --ui: arial, helvetica, sans-serif;
  --board: Tahoma, Verdana, Geneva, sans-serif;
  --meme: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

html[data-mode="bull"] {
  --accent: var(--up);
  --big: var(--name);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 64px; }

body {
  margin: 0;
  color: #000;
  font: 14px/1.4 var(--ui);
  background: var(--bg) linear-gradient(var(--bg-top), var(--bg) 260px) no-repeat;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); }
a:hover { color: var(--quote); }

button { font: inherit; }

:focus-visible { outline: 2px solid var(--label-border); outline-offset: 2px; }

/* ---------- board nav ---------- */
.boardnav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: center;
  padding: 6px 12px;
  font-size: 12px;
  color: #89a;
  background: rgba(214, 218, 240, 0.94);
  border-bottom: 1px solid var(--reply-border);
  backdrop-filter: blur(4px);
}
.boardnav a { text-decoration: none; }
.boardnav .right { margin-left: auto; }

.navbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  cursor: pointer;
  font-size: inherit;
}
.navbtn:hover { color: var(--quote); }
.navbtn[aria-pressed="true"] { color: var(--accent); font-weight: bold; }

a.soon, a.soon:hover {
  color: #8b90ad;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 44px 16px 36px;
}
#chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(230px, 380px) 1fr;
  gap: 48px;
  align-items: center;
}

.frog-wrap { position: relative; justify-self: center; width: 100%; max-width: 360px; }
.frog {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  animation: bob 3.4s ease-in-out infinite;
}
.frog img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 0 rgba(15, 12, 93, 0.14));
  user-select: none;
  -webkit-user-drag: none;
}
.frog.shake { animation: shake 0.55s linear; }
.frog-shadow {
  width: 62%;
  height: 16px;
  margin: 4px auto 0;
  border-radius: 50%;
  background: radial-gradient(rgba(15, 12, 93, 0.22), transparent 70%);
  animation: shadow 3.4s ease-in-out infinite;
}

.bubble {
  position: absolute;
  top: 2%;
  right: -6%;
  max-width: 220px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--gt);
  background: #fff;
  border: 1px solid var(--reply-border);
  box-shadow: 3px 3px 0 var(--reply-border);
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
}
.bubble.show { opacity: 1; transform: none; }
.bubble::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -8px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid var(--reply-border);
  border-bottom: 1px solid var(--reply-border);
  transform: rotate(45deg);
}

.banner {
  display: block;
  width: 300px;
  max-width: 100%;
  height: auto;
  margin: 6px auto 14px;
}
.boardTitle {
  margin: 0;
  font: bold 22px/1.1 var(--board);
  letter-spacing: -1px;
  color: var(--title);
}
.bigname {
  margin: 4px 0 2px;
  font: 400 clamp(92px, 15vw, 196px)/0.86 var(--meme);
  letter-spacing: 0.01em;
  color: var(--big);
  text-shadow: 6px 6px 0 rgba(15, 12, 93, 0.13);
  transition: color 0.3s;
}
.boardSubtitle {
  margin: 6px 0 20px;
  font: italic 18px/1.3 var(--board);
  color: var(--subject);
}

/* post form (CA box) */
.postform table {
  border-spacing: 1px;
  width: 100%;
  max-width: 520px;
}
.postform th {
  width: 84px;
  padding: 5px 8px;
  text-align: left;
  font-size: 13px;
  color: #000;
  background: var(--label);
  border: 1px solid var(--label-border);
}
.postform td {
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #aaa;
}
.postform .name { color: var(--name); font-weight: bold; }
.trip { color: var(--name); }
.ca-cell { display: flex; align-items: center; gap: 8px; }
#ca-value {
  flex: 1;
  min-width: 0;
  font: 13px/1.35 var(--mono);
  word-break: break-all;
}
#ca-value.pending { color: var(--muted); font-family: var(--ui); font-style: italic; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }

.pfbtn {
  display: inline-block;
  padding: 4px 12px;
  font: 13px/1.3 var(--ui);
  color: #000;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(#fff, #e1e1e6);
  border: 1px solid #8a8a99;
  border-radius: 2px;
  cursor: pointer;
}
.pfbtn:hover { color: #000; background: linear-gradient(#fff, #eeeef3); }
.pfbtn:active { background: #dcdce4; }
.pfbtn:disabled { opacity: 0.45; cursor: not-allowed; }
.pfbtn.buy { color: #fff; font-weight: bold; background: var(--accent); border-color: rgba(0, 0, 0, 0.35); }
.pfbtn.buy:hover { filter: brightness(1.08); }
.pfbtn.soon, .pfbtn.soon:hover {
  color: #777;
  text-decoration: none;
  background: #e9e9ef;
  border-color: #b9b9c6;
}
.pfbtn.soon::after { content: " soon"; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- bench of bearys sitting on the tape ---------- */
.bench {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(2px, 1.2vw, 18px);
  height: 74px;
  margin-top: -18px;
  margin-bottom: -6px;
  overflow: hidden;
  pointer-events: none;
}
.sitter {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  transform-origin: 50% 100%;
  animation: sit 2.8s ease-in-out infinite;
}
.sitter img {
  display: block;
  height: 66px;
  width: auto;
  transition: transform 0.15s;
}
.sitter:hover img,
.sitter:focus-visible img { transform: translateY(-8px) rotate(-4deg); }

/* ---------- ticker tape ---------- */
.tape {
  overflow: hidden;
  white-space: nowrap;
  color: #fff;
  background: var(--navy);
  border-top: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
}
.tape-track {
  display: inline-flex;
  padding: 7px 0;
  font: 400 20px/1 var(--meme);
  letter-spacing: 0.03em;
  animation: tape 38s linear infinite;
}
.tape-track span { padding: 0 18px; }
.tape-track .dn { color: var(--down); }
.tape-track .up { color: var(--up); }

/* ---------- board / posts ---------- */
.board { max-width: 1100px; margin: 0 auto; padding: 0 14px; }
hr { border: 0; border-top: 1px solid var(--reply-border); margin: 16px 0; }

.post { font-size: 13px; }
.post.op { display: flow-root; margin-bottom: 6px; }
.fileText { font-size: 12.5px; margin: 2px 0; }
.fileThumb { float: left; margin: 3px 20px 6px 0; cursor: zoom-in; }
.fileThumb img { display: block; height: auto; max-width: 125px; }
.op-thumb img { max-width: 250px; }
.fileThumb.expanded { float: none; cursor: zoom-out; }
.fileThumb.expanded img { max-width: min(100%, 640px); }

.postInfo { font-size: 13px; }
.postInfo .subject { color: var(--subject); font-weight: bold; }
.postInfo .name { color: var(--name); font-weight: bold; }
.postNum a { color: inherit; text-decoration: none; }
.qn { cursor: pointer; }
.qn:hover { color: var(--quote); }
.dig { font-style: normal; color: var(--quote); font-weight: bold; }
.tag {
  padding: 0 4px;
  font-size: 10.5px;
  color: var(--title);
  border: 1px solid var(--title);
  border-radius: 2px;
}

.postMessage {
  margin: 12px 40px 12px 40px;
  font-size: 14.5px;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.gt { color: var(--gt); }
.quotelink { color: var(--quote); }
.quotelink.xboard { cursor: pointer; }
.inline-ca { font: 12.5px var(--mono); background: rgba(255, 255, 255, 0.6); padding: 0 3px; word-break: break-all; }
.buylink { color: var(--quote); font-weight: bold; }

.omitted { clear: both; color: var(--muted); font-size: 12.5px; }

.replyContainer { display: flex; margin: 4px 0; }
.sideArrows { flex: none; margin-right: 3px; color: var(--reply-border); font-size: 13px; }
.post.reply {
  display: flow-root;
  min-width: 0;
  max-width: 100%;
  padding: 4px 8px 2px;
  background: var(--reply);
  border: 1px solid var(--reply-border);
  border-top: 0;
  border-left: 0;
}
.post.reply:target,
.post.reply.highlight { background: var(--hl); border-color: var(--hl-border); }

/* dubs roller */
.roller {
  position: relative;
  clear: both;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin: 0 40px 14px;
}
.roll { padding: 8px 22px; font-weight: bold; font-size: 15px; }
.roll-num { font: bold 26px/1.1 var(--mono); letter-spacing: -0.02em; }
.roll-num .dig { font-size: 1.05em; }
.roll-label { font-size: 13px; color: var(--gt); }
.roll-stats { display: flex; gap: 16px; margin: 0; font-size: 12px; }
.roll-stats div { text-align: center; }
.roll-stats dt { color: var(--muted); }
.roll-stats dd { margin: 0; font-weight: bold; font-size: 15px; }
.checked {
  position: absolute;
  right: 0;
  top: -18px;
  padding: 2px 12px;
  font: 400 52px/1 var(--meme);
  color: var(--quote);
  border: 5px solid var(--quote);
  border-radius: 6px;
  transform: rotate(-12deg) scale(1.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.25s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.checked.show { opacity: 0.92; transform: rotate(-12deg) scale(1); }

/* gif dump / catalog */
.dump { clear: both; margin: 24px 0 8px; }
.dump-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 14px; }
.dump-head h2 { margin: 0; font: bold 22px var(--board); letter-spacing: -1px; color: var(--title); }
.dump-sub { font-size: 12.5px; color: var(--muted); }
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 22px 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  color: #000;
  text-align: center;
  cursor: zoom-in;
}
.tile img {
  display: block;
  max-width: 100%;
  height: 180px;
  object-fit: cover;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}
.tile:hover img { transform: scale(1.04) rotate(-1deg); }
.tile .meta { font-size: 11px; color: var(--muted); }
.tile .meta b { color: #000; }
.tile .teaser b { color: var(--subject); }

/* beary catalog wall */
.wall-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
#wall-filter {
  flex: 1 1 240px;
  max-width: 360px;
  padding: 5px 8px;
  font: 14px var(--ui);
  border: 1px solid #aaa;
  background: #fff;
}
.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 18px 10px;
}
.btile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 6px 4px 4px;
  border: 1px solid transparent;
  background: none;
  font-size: 11.5px;
  color: #000;
  cursor: zoom-in;
}
.btile:hover { background: rgba(214, 218, 240, 0.7); border-color: var(--reply-border); }
.btile img {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  transition: transform 0.15s;
}
.btile:hover img { transform: translateY(-4px); }
.btile .fname {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btile.pop { background: var(--hl); border-color: var(--hl-border); }
.wall-empty { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.wall-more { margin-top: 16px; text-align: center; }
.wall-more[hidden] { display: none; }

/* quick reply */
.qr {
  max-width: 560px;
  margin: 20px 0 8px;
  background: var(--reply);
  border: 1px solid var(--reply-border);
}
.qr-head {
  padding: 4px 8px;
  font-weight: bold;
  font-size: 13px;
  background: var(--label);
  border-bottom: 1px solid var(--label-border);
}
#qr-form { display: flex; flex-direction: column; gap: 4px; padding: 6px; }
#qr-form input,
#qr-form textarea {
  width: 100%;
  padding: 5px 6px;
  font: 14px/1.4 var(--ui);
  border: 1px solid #aaa;
  background: #fff;
}
#qr-form textarea { resize: vertical; }
.qr-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qr-note { font-size: 12px; color: var(--muted); }

/* footer */
.foot {
  padding: 8px 16px 44px;
  text-align: center;
  font-size: 12px;
  color: var(--link);
}
.foot a { text-decoration: none; }
.disclaimer { max-width: 640px; margin: 14px auto 6px; line-height: 1.5; }
.legal { margin: 0; color: var(--muted); }

/* lightbox */
.lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 94vw;
  max-height: 94vh;
}
.lightbox::backdrop { background: rgba(10, 10, 30, 0.78); }
.lightbox figure { margin: 0; }
.lightbox img { display: block; max-width: 94vw; max-height: 80vh; width: auto; height: auto; margin: 0 auto; }
.lightbox figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 10px;
  font-size: 13px;
  background: var(--reply);
  border: 1px solid var(--reply-border);
}
.lightbox #lb-cap { color: var(--subject); font-weight: bold; }
.lightbox img.pixel { image-rendering: pixelated; background: #fff; }

/* quote hover preview */
.hoverpost {
  position: fixed;
  z-index: 60;
  display: none;
  max-width: min(560px, 92vw);
  pointer-events: none;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}
.hoverpost.show { display: block; }
.hoverpost .post { margin: 0; padding: 4px 8px; background: var(--reply); border: 1px solid var(--reply-border); }
.hoverpost .roller, .hoverpost .checked { display: none; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 70;
  max-width: 90vw;
  padding: 10px 16px;
  font-size: 13.5px;
  color: #fff;
  background: var(--navy);
  border-left: 4px solid var(--accent);
  box-shadow: 0 6px 20px rgba(15, 12, 93, 0.3);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* rain overlay */
#rain {
  position: fixed;
  inset: 0;
  z-index: 50;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
}
#rain.on { display: block; }

/* ---------- motion ---------- */
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes shadow {
  0%, 100% { transform: scaleX(1); opacity: 1; }
  50% { transform: scaleX(0.86); opacity: 0.7; }
}
@keyframes shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  15% { transform: translate(-6px, 2px) rotate(-3deg); }
  30% { transform: translate(5px, -2px) rotate(2deg); }
  45% { transform: translate(-4px, 1px) rotate(-2deg); }
  60% { transform: translate(4px, 0) rotate(1.5deg); }
  80% { transform: translate(-2px, 1px) rotate(-1deg); }
}
@keyframes sit {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.96) translateY(1px); }
}
@keyframes tape {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frog, .frog-shadow, .sitter { animation: none; }
  .tape-track { animation: none; }
  .tile img, .bubble, .toast, .checked { transition: none; }
}

/* ---------- mobile ---------- */
@media (max-width: 780px) {
  .hero { padding: 26px 14px 28px; }
  .hero-inner { grid-template-columns: 1fr; gap: 18px; }
  .frog-wrap { max-width: 230px; }
  .bubble { right: -30%; max-width: 180px; font-size: 13px; }
  .hero-copy { text-align: center; }
  .postform table { margin: 0 auto; text-align: left; }
  .postform th { width: 70px; }
  .boardnav .right { margin-left: 0; }
  .postMessage { margin: 10px 8px 10px 10px; font-size: 15px; }
  .roller { margin: 0 8px 12px; }
  .checked { font-size: 40px; top: -10px; }
  .fileThumb { margin-right: 12px; }
  .fileThumb img { max-width: 110px; }
  .op-thumb img { max-width: 150px; }
  .catalog { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 12px; }
  .wall { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 6px; }
  .btile img { image-rendering: auto; }
  .btile { font-size: 10.5px; }
  .bench { height: 58px; margin-top: -10px; }
  .sitter img { height: 52px; }
  .tile img { height: 150px; }
}
