/* Meow Tide: night-sea palette with pixel headings (Silkscreen) and Instrument Sans body text */
:root {
  --sea: #0d1830;
  --sea-2: #132443;
  --sea-3: #1b3157;
  --line: #2a4572;
  --ink: #eef3fb;
  --ink-2: #b7c4dc;
  --ink-3: #8193b4;
  --foam: #fff3e0;
  --tide: #4fc3f7;
  --cat: #f2a65a;
  --good: #7ed39a;
  --warn: #ffcc66;
  --bad: #ff8a80;
  --pixel: "Silkscreen", ui-monospace, monospace;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--sea); color: var(--ink); font: 16px/1.6 var(--body); }
a { color: var(--tide); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--foam); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--foam); color: var(--sea); padding: 6px 10px; }
.skip:focus { left: 8px; z-index: 10; }
.defs { position: absolute; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 700; line-height: 1.15; letter-spacing: 0.01em; }
h2 { font-size: clamp(24px, 4vw, 34px); margin: 0 0 8px; }
h3 { font-size: 17px; margin: 0 0 12px; color: var(--foam); }
.sub { color: var(--ink-2); max-width: 62ch; margin: 0 0 24px; }
.fine { color: var(--ink-3); font-size: 14px; }
code { font-size: 0.92em; background: var(--sea-3); padding: 1px 5px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 2px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--pixel); font-weight: 700; font-size: 18px; }
.brand img { image-rendering: pixelated; }
nav { display: flex; gap: 18px; flex-wrap: wrap; }
nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; }
nav a:hover { color: var(--foam); }
nav a[aria-current="page"] { color: var(--foam); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--tide); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; }
a.btn { display: inline-block; text-decoration: none; }
.btn.ghost-link { background: transparent; color: var(--foam); border: 2px solid var(--foam); box-shadow: none; }
main { min-height: calc(100vh - 140px); }

main > section { max-width: 1080px; margin: 0 auto; padding: 56px 20px; }

/* ── Hero: cat on the shore, fish in the waves ── */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: center; }
.scene { position: relative; aspect-ratio: 4 / 3; border: 2px solid var(--line); overflow: hidden; background: #13213f; }
.scene-svg { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.scene-svg g, .scene-svg rect { transform-box: fill-box; }
/* Stars twinkle, the surface drifts, bubbles rise */
.star { animation: twinkle 3s steps(2) infinite; }
.star.s1 { animation-delay: 1s; }
.star.s2 { animation-delay: 2s; }
@keyframes twinkle { 50% { opacity: 0.25; } }
.surf { animation: drift 4s steps(16) infinite; }
.surf.slow { animation-duration: 7s; animation-direction: reverse; }
@keyframes drift { to { transform: translateX(-16px); } }
.bubble { opacity: 0; animation: rise 5s steps(24) infinite; }
.bubble.b1 { animation-delay: 1s; } .bubble.b2 { animation-delay: 2.2s; } .bubble.b3 { animation-delay: 3.1s; } .bubble.b4 { animation-delay: 4s; }
@keyframes rise { 0% { opacity: 0; transform: translateY(0); } 10% { opacity: 0.9; } 90% { opacity: 0.7; } 100% { opacity: 0; transform: translateY(-46px); } }
/* Two fish swim under the surface in opposite directions */
.swim-left { animation: swimL 14s linear infinite; }
@keyframes swimL { from { transform: translate(170px, 0); } 50% { transform: translate(70px, 5px); } to { transform: translate(-40px, 0); } }
.swim-right { animation: swimR 19s linear infinite; animation-delay: -6s; }
@keyframes swimR { from { transform: translate(-10px, 0); } 50% { transform: translate(90px, -4px); } to { transform: translate(190px, 0); } }
/* Every 9 s a fish leaps toward the pier and the cat swipes at it */
.jumper { opacity: 0; animation: leap 9s linear infinite; }
@keyframes leap {
  0%, 62% { opacity: 0; transform: translate(98px, 96px) rotate(0deg); }
  64% { opacity: 1; transform: translate(96px, 66px) rotate(-30deg); }
  72% { transform: translate(84px, 40px) rotate(-10deg); }
  78% { transform: translate(74px, 34px) rotate(20deg); }
  86% { opacity: 1; transform: translate(68px, 62px) rotate(70deg); }
  88%, 100% { opacity: 0; transform: translate(66px, 90px) rotate(80deg); }
}
.splash { opacity: 0; animation: splash 9s steps(1) infinite; }
@keyframes splash { 0%, 86% { opacity: 0; transform: translateY(0); } 87% { opacity: 1; } 91% { opacity: 1; transform: translateY(-3px); } 93%, 100% { opacity: 0; } }
.paw { opacity: 0; transform-origin: left center; animation: swipe 9s steps(1) infinite; }
@keyframes swipe { 0%, 70% { opacity: 0; transform: translate(0, 0); } 72% { opacity: 1; transform: translate(2px, -2px); } 76% { opacity: 1; transform: translate(6px, -6px); } 80% { opacity: 1; transform: translate(3px, -3px); } 83%, 100% { opacity: 0; } }
/* The cat blinks and flicks its tail */
.lid { opacity: 0; animation: blink 5s steps(1) infinite; }
@keyframes blink { 0%, 92% { opacity: 0; } 93%, 96% { opacity: 1; } 97%, 100% { opacity: 0; } }
.tail { transform-origin: left bottom; animation: wag 2.4s steps(3) infinite alternate; }
@keyframes wag { from { transform: rotate(-8deg); } to { transform: rotate(10deg); } }
.hero h1 { font-size: clamp(40px, 7vw, 68px); margin: 0 0 14px; color: var(--foam); }
.lede { font-size: 18px; color: var(--ink-2); margin: 0 0 24px; max-width: 54ch; }
.readout { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 0 16px; border: 2px solid var(--line); }
.readout div { padding: 12px 14px; border-right: 2px solid var(--line); }
.readout div:last-child { border-right: 0; }
.readout dt { font-size: 13px; color: var(--ink-3); }
.readout dd { margin: 4px 0 0; font-family: var(--pixel); font-size: 20px; color: var(--foam); font-variant-numeric: tabular-nums; }
.readout small { font-family: var(--body); font-size: 13px; color: var(--ink-3); }
.meter { position: relative; height: 12px; background: var(--sea-3); border: 2px solid var(--line); margin-bottom: 12px; }
.meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--tide); transition: width 0.8s; }
.meter b { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--cat); left: 30%; }
.status { color: var(--ink-2); margin: 0; }
.status.warn { color: var(--warn); }
.vrf-note { margin: 16px 0 0; padding: 12px 14px; border: 2px solid var(--warn); background: var(--sea-2); color: var(--ink-2); }
.vrf-note p { margin: 0 0 8px; }
.vrf-note b { color: var(--warn); }
.vrf-note .meter { margin: 8px 0; }
.vrf-note .meter i { background: var(--warn); }
.vrf-play { margin: 0 0 14px; }

/* ── Play steps ── */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.step { min-width: 0; counter-increment: s; background: var(--sea-2); border: 2px solid var(--line); padding: 20px 22px; }
.step h3::before { content: counter(s) ". "; color: var(--tide); }
.lookup label { display: block; font-size: 14px; color: var(--ink-3); margin-bottom: 6px; }
.row { display: flex; gap: 10px; }
input { flex: 1; min-width: 0; font: inherit; color: var(--ink); background: var(--sea); border: 2px solid var(--line); padding: 10px 12px; }
.btn { font: 600 15px var(--body); color: var(--sea); background: var(--foam); border: 0; padding: 10px 18px; cursor: pointer; box-shadow: 3px 3px 0 var(--tide); }
.btn:hover { background: #fff; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--tide); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.ghost { background: var(--sea-3); color: var(--ink); box-shadow: none; width: 44px; padding: 8px 0; font-size: 20px; }
.err { color: var(--bad); margin: 10px 0 0; }
.look { margin-top: 16px; }
.look-who { font-weight: 600; word-break: break-all; margin: 0 0 10px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 0; }
.facts div { background: var(--sea); border: 2px solid var(--line); padding: 8px 10px; }
.facts dt { font-size: 13px; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts .no { color: var(--ink-3); }
.look-note { color: var(--warn); margin: 12px 0 0; }
.gallery { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.gallery li { background: var(--sea); border: 2px solid var(--line); padding: 4px; text-align: center; font-size: 12px; color: var(--ink-3); }
.gallery img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; display: block; }
.gallery .q { aspect-ratio: 1; display: grid; place-items: center; font-family: var(--pixel); font-size: 28px; color: var(--warn); background: var(--sea-2); }
.gallery .cat-tag { color: var(--cat); }
/* Collection animations: fish bob in the water, cats twitch now and then, unrevealed ones pulse */
.gallery .k-fish img { animation: bob 3.2s ease-in-out infinite; }
.gallery .k-fish:nth-child(3n) img { animation-delay: -1.1s; }
.gallery .k-fish:nth-child(3n+1) img { animation-delay: -2.2s; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.gallery .k-cat img { animation: twitch 6s steps(1) infinite; }
.gallery .k-cat:nth-child(2n) img { animation-delay: -3s; }
@keyframes twitch { 0%, 90% { transform: rotate(0); } 92% { transform: rotate(-4deg); } 95% { transform: rotate(4deg); } 98% { transform: rotate(0); } }
.gallery .q { animation: pulse 1.6s steps(2) infinite; }
@keyframes pulse { 50% { color: var(--foam); } }
.gallery li { transition: transform 0.15s; }
.gallery li:hover { transform: translateY(-3px); }

.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.act { text-align: left; font: inherit; color: var(--ink); background: var(--sea); border: 2px solid var(--line); padding: 12px 14px; cursor: pointer; }
.act.on { border-color: var(--tide); background: var(--sea-3); box-shadow: 3px 3px 0 var(--tide); }
.act-name { display: block; font-family: var(--pixel); font-weight: 700; font-size: 16px; color: var(--foam); }
.act-desc { display: block; font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.count-opts { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 16px; }
.count-opts[hidden] { display: none; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper output { font-family: var(--pixel); font-size: 24px; min-width: 2ch; text-align: center; }
.cost { margin: 0; color: var(--ink-2); }
.act-note { color: var(--warn); margin: 0 0 12px; }
.copytext { background: var(--sea); border: 2px dashed var(--line); padding: 14px; margin: 0 0 14px; font-size: 15px; color: var(--foam); overflow-wrap: anywhere; }
.hint { font-size: 14px; color: var(--ink-3); margin: 14px 0 0; }

/* ── Market ── */
.mk-bar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: 600 14px var(--body); color: var(--ink); background: var(--sea-2); border: 2px solid var(--line); padding: 6px 12px; cursor: pointer; }
.chip.on { border-color: var(--tide); background: var(--sea-3); }
.mk-sort, .sell-opts label { color: var(--ink-2); font-size: 14px; display: flex; gap: 8px; align-items: center; }
select { font: inherit; color: var(--ink); background: var(--sea); border: 2px solid var(--line); padding: 6px 8px; }
.mk-grid { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mk-card { background: var(--sea-2); border: 2px solid var(--line); padding: 8px; cursor: pointer; text-align: left; font: inherit; color: var(--ink); width: 100%; transition: transform 0.15s, border-color 0.15s; }
.mk-card:hover { transform: translateY(-3px); }
.mk-card.on { border-color: var(--tide); box-shadow: 3px 3px 0 var(--tide); }
.mk-card img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; display: block; margin-bottom: 6px; }
.mk-name { display: block; font-family: var(--pixel); font-size: 13px; color: var(--foam); }
.mk-price { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.mk-tide { display: block; font-size: 12px; color: var(--ink-3); }
.mk-buy { margin-top: 6px; }
.nonum::before { content: none !important; }
.sell-opts { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-top: 16px; }
.sell-opts input { flex: 0 0 8em; }
.rule-list { padding-left: 20px; max-width: 72ch; }
.rule-list li { margin-bottom: 12px; color: var(--ink-2); }
.rule-list b { color: var(--foam); }
.addrs { display: grid; gap: 10px; margin: 0 0 12px; }
.addrs div { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.addrs dt { color: var(--ink-3); min-width: 160px; }
.addrs dd { margin: 0; word-break: break-all; font-family: ui-monospace, monospace; font-size: 14px; }
.foot { border-top: 2px solid var(--line); padding: 20px; text-align: center; color: var(--ink-3); font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--foam); color: var(--sea); padding: 10px 16px; font-weight: 600; box-shadow: 3px 3px 0 var(--tide); max-width: calc(100% - 32px); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .readout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .readout div:nth-child(2) { border-right: 0; }
  .readout div:nth-child(-n+2) { border-bottom: 2px solid var(--line); }
  main > section { padding: 40px 16px; }
  .row { flex-direction: column; }
}
