:root {
  --wall: #f6efe0;
  --wall-2: #efe4cd;
  --ink: #1d2a33;
  --ink-2: #4b5a66;
  --coral: #ff6b4a;
  --gold: #ffc93c;
  --sea: #2a97d0;
  --wood: #8a5a34;
  --wood-2: #6e4426;
  --card: #fffaf0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--wall);
  background-image: radial-gradient(rgba(29, 42, 51, 0.06) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 500 16px/1.5 Nunito, system-ui, sans-serif;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

/* ---------- header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 3vw, 36px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-fish { width: 46px; height: 30px; }
.brand-name { font: 700 28px/1 Fredoka, sans-serif; letter-spacing: -0.5px; }
.brand-name span { color: var(--sea); }
.brand-ticker {
  font: 700 14px/1 'JetBrains Mono', monospace;
  background: var(--ink);
  color: var(--wall);
  padding: 5px 8px;
  border-radius: 6px;
}
nav { display: flex; align-items: center; gap: 18px; font-weight: 800; }
nav a { text-decoration: none; }
nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }
.btn {
  background: var(--coral);
  color: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 8px 18px;
  box-shadow: 0 3px 0 var(--ink);
  font: 600 16px/1 Fredoka, sans-serif;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

/* ---------- stats row */
.tank-wrap { padding: 0 clamp(16px, 3vw, 36px); }
.stats {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.75fr 1.35fr;
  gap: 14px;
  margin-bottom: 14px;
}
.stat {
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.stat-label { font: 600 13px/1.2 Fredoka, sans-serif; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.stat-value { font: 700 26px/1.2 Fredoka, sans-serif; }
.stat-sub { font-size: 13px; color: var(--ink-2); min-height: 1.2em; }
.whale-stat { background: #fff4cf; }
.net-stat { background: #e3f4fb; }
.net-stat .stat-value { font-variant-numeric: tabular-nums; }
.net-stat.casting .stat-value { color: var(--sea); }
.whale-stat .stat-value {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font: 700 22px/1.3 'JetBrains Mono', monospace;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.whale-stat .stat-value:hover { text-decoration: underline; }
.whale-stat.flash { animation: whaleflash 1.2s ease 3; }
@keyframes whaleflash { 50% { background: var(--gold); } }
.find-row { display: flex; gap: 8px; margin: 4px 0 2px; }
.find-row input {
  flex: 1;
  min-width: 0;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
}
.find-row button {
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--sea);
  color: #fff;
  font: 600 15px/1 Fredoka, sans-serif;
  padding: 0 16px;
}

/* ---------- the tank */
.tank { position: relative; }
.lid {
  height: 16px;
  margin: 0 -6px;
  background: var(--ink);
  border-radius: 8px 8px 2px 2px;
}
.glass {
  position: relative;
  height: clamp(440px, 72vh, 820px);
  border: 8px solid var(--ink);
  border-top-width: 4px;
  border-bottom-width: 10px;
  overflow: hidden;
  background: #2a97d0;
}
#tankCanvas { display: block; width: 100%; height: 100%; touch-action: manipulation; }
.stand {
  height: 34px;
  margin: 0 -14px;
  background: linear-gradient(var(--wood), var(--wood-2));
  border: 3px solid var(--ink);
  border-radius: 0 0 10px 10px;
  position: relative;
}
.stand span {
  position: absolute;
  bottom: -26px;
  width: 26px;
  height: 26px;
  background: var(--wood-2);
  border: 3px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 6px 6px;
}
.stand span:first-child { left: 8%; }
.stand span:last-child { right: 8%; }

.demo-tag {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(29, 42, 51, 0.8);
  color: #fff;
  font: 600 13px/1 Fredoka, sans-serif;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
}
.labels-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(29, 42, 51, 0.75);
  border-radius: 999px;
  padding: 3px;
  color: #fff;
  font: 600 12px/1 Fredoka, sans-serif;
}
.labels-toggle span { padding: 0 6px 0 8px; opacity: 0.8; }
.labels-toggle button {
  border: 0;
  background: none;
  color: #fff;
  border-radius: 999px;
  padding: 5px 9px;
  font: 600 12px/1 Fredoka, sans-serif;
}
.labels-toggle button.on { background: #fff; color: var(--ink); }

/* wide tank (1000+ fish): arrows, scroll bar, hint */
.pan {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
}
.pan svg { width: 22px; height: 22px; }
.pan-l { left: 12px; }
.pan-r { right: 12px; }
.pan:hover:not(:disabled) { background: #fff; }
.pan:disabled { opacity: 0.35; cursor: default; }
.scrollbar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  height: 14px;
  background: rgba(29, 42, 51, 0.5);
  border-radius: 999px;
  cursor: pointer;
  touch-action: none;
}
.scroll-thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  min-width: 24px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  cursor: grab;
}
.scroll-mark {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  pointer-events: none;
}
.scroll-mark.whale { background: var(--gold); }
.scroll-mark.mine { background: var(--coral); }
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  background: rgba(29, 42, 51, 0.88);
  color: #fff;
  font: 600 14px/1.3 Fredoka, sans-serif;
  padding: 8px 14px;
  border-radius: 12px;
  text-align: center;
  width: max-content;
  max-width: calc(100% - 40px);
  pointer-events: none;
  transition: opacity 0.6s;
}
.scroll-hint.out { opacity: 0; }
.glass.scrolls .feed { bottom: 34px; }

.feed {
  position: absolute;
  left: 14px;
  bottom: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: min(360px, calc(100% - 28px));
  pointer-events: none;
}
.feed li {
  pointer-events: auto;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 0 var(--ink);
  cursor: pointer;
  animation: feedin 0.35s ease-out;
  transition: opacity 0.6s;
}
.feed li .mono { font-weight: 700; }
.feed li.whale { background: var(--gold); }
.feed li.leave { background: #e9e3d6; color: var(--ink-2); }
.feed li.catch { background: #8fd3ff; }
.feed li.old { opacity: 0; }
@keyframes feedin { from { transform: translateX(-20px); opacity: 0; } }

.card {
  position: absolute;
  top: 56px;
  right: 14px;
  width: 270px;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 4px 0 var(--ink);
}
.card-x {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: none;
  font-size: 24px;
  line-height: 1;
}
.card-pic { width: 100%; height: 110px; display: block; background: #d8f1fb; border-radius: 10px; border: 2px solid var(--ink); }
.card-tag { font: 700 13px/1 Fredoka, sans-serif; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 10px; color: var(--sea); }
.card-tag.whale { color: #c98a00; }
.card-wallet { font-size: 12px; word-break: break-all; margin: 4px 0 8px; }
.card-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 10px; margin: 0 0 10px; }
.card-facts dt { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.05em; }
.card-facts dd { margin: 0; font: 600 15px/1.2 Fredoka, sans-serif; }
.card-actions { display: flex; gap: 8px; align-items: center; }
.card-actions button {
  border: 2px solid var(--ink);
  background: var(--coral);
  color: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font: 600 14px/1 Fredoka, sans-serif;
}
.card-actions button.is-mine { background: #fff; color: var(--ink); }
.card-actions a { font-weight: 800; font-size: 14px; }

.banner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(460px, 86%);
  height: fit-content;
  background: var(--gold);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--ink);
  text-align: center;
  padding: 18px 20px;
  pointer-events: none;
  animation: bannerin 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.banner.out { animation: bannerout 0.4s ease-in forwards; }
.banner.caught { background: #8fd3ff; }
.banner-kicker { font: 700 clamp(32px, 6vw, 48px)/1 Fredoka, sans-serif; text-transform: uppercase; }
.banner-wallet { font-size: clamp(13px, 2.2vw, 17px); font-weight: 700; margin-top: 8px; word-break: break-all; }
.banner-sub { font-weight: 800; margin-top: 4px; }
@keyframes bannerin { from { transform: scale(0.4); opacity: 0; } }
@keyframes bannerout { to { transform: translateY(-30px); opacity: 0; } }

/* ---------- sections */
section h2 { font: 700 clamp(28px, 4vw, 40px)/1.1 Fredoka, sans-serif; margin: 0 0 18px; }
.tk { font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.how, .board { max-width: 1100px; margin: 0 auto; padding: 84px clamp(16px, 3vw, 36px) 20px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step {
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 0 var(--ink);
}
.step-n {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sea);
  color: #fff;
  border: 2.5px solid var(--ink);
  display: grid;
  place-items: center;
  font: 700 18px/1 Fredoka, sans-serif;
}
.step h3 { font: 600 21px/1.2 Fredoka, sans-serif; margin: 12px 0 6px; }
.step p { margin: 0; color: var(--ink-2); }
.ca {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
}
.ca-label { font: 700 14px/1 Fredoka, sans-serif; background: var(--ink); color: var(--wall); padding: 5px 8px; border-radius: 6px; }
.ca code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ca button { border: 2px solid var(--ink); background: var(--gold); border-radius: 8px; padding: 6px 12px; font: 600 14px/1 Fredoka, sans-serif; }

.board-sub { margin: -10px 0 18px; color: var(--ink-2); }
.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board-list li {
  display: grid;
  grid-template-columns: 40px 64px 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 6px 14px 6px 10px;
  cursor: pointer;
}
.board-list li:hover { background: #fff; }
.board-list li.whale { background: #fff4cf; }
.board-list li.mine { outline: 3px solid var(--coral); outline-offset: 1px; }
.board-rank { font: 700 18px/1 Fredoka, sans-serif; text-align: center; }
.board-pic { width: 64px; height: 38px; }
.board-wallet { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-sol { font: 600 16px/1 Fredoka, sans-serif; white-space: nowrap; }
.board-empty { color: var(--ink-2); }
.catch-list li { grid-template-columns: 52px 64px 1fr auto; }
.catch-n { font: 600 14px/1 Fredoka, sans-serif; color: var(--ink-2); text-align: center; }
.catch-meta { display: flex; flex-direction: column; min-width: 0; }
.catch-when { font-size: 12px; color: var(--ink-2); }
.catch-status { font-size: 12px; font-weight: 800; text-align: right; }
.catch-status a { color: var(--sea); }
.catch-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

.foot { text-align: center; padding: 60px 16px 40px; font-size: 14px; color: var(--ink-2); }

/* ---------- small screens */
@media (max-width: 1060px) {
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat.find, .stat.count-stat { grid-column: 1 / -1; }
  .count-stat { flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .count-stat .stat-value { font-size: 20px; }
  .steps { grid-template-columns: 1fr; }
  nav a:not(.btn) { display: none; }
}
@media (max-width: 560px) {
  .brand-name { font-size: 19px; }
  .brand-ticker { display: none; }
  .brand-fish { width: 36px; }
  .stat-value { font-size: 21px; }
  .whale-stat .stat-value { font-size: 16px; }
  .glass { height: 66vh; min-height: 420px; border-width: 5px; border-bottom-width: 7px; }
  .lid { margin: 0 -4px; height: 12px; }
  .stand { margin: 0 -8px; height: 24px; }
  .card { left: 10px; right: 10px; width: auto; top: auto; bottom: 10px; }
  .feed { bottom: auto; top: 50px; }
  .feed li { font-size: 12px; padding: 4px 8px; }
  .feed li:nth-child(n + 3) { display: none; }
  .labels-toggle { top: 10px; right: 10px; }
  .demo-tag { top: auto; bottom: 10px; font-size: 11px; }
  .glass.scrolls .demo-tag { bottom: 32px; }
  .pan { width: 38px; height: 38px; }
  .scroll-hint { font-size: 12px; bottom: 56px; }
  .board-list li { grid-template-columns: 28px 52px 1fr auto; gap: 8px; }
  .catch-list li { grid-template-columns: 40px 52px 1fr auto; }
  .board-pic { width: 52px; }
}
