/* =============================================================================
   FISHCOIN

   The look is borrowed from the art: dusk water, lantern light, hull red and
   plank orange. Nothing is rounded and nothing is soft — panels sit on a hard
   1px edge with a flat offset shadow, the way a pixel UI would.

   Type — three bitmap faces, one job each:

     Jersey 15     display. Condensed and heavy, so it carries headings, the
                   wordmark, labels and buttons without needing a bold.
     DotGothic16   body. Even colour, and legible right down to 12px.
     VT323         figures. Genuinely monospaced, so balances and odds line up.

   None of the three ships a bold, so `font-synthesis: none` is set globally:
   a synthesised bold smears a bitmap glyph into mud. Hierarchy comes from
   size, case and colour instead.

   (Silkscreen and Pixelify Sans were both tried and dropped — below ~18px
   their C is indistinguishable from their O, so "Cast" reads as "Oast".)
   ========================================================================== */

@font-face {
  font-family: 'Jersey 15';
  src: url('/fonts/jersey-15-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'DotGothic16';
  src: url('/fonts/dotgothic16-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'VT323';
  src: url('/fonts/vt323-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* surfaces */
  --night:   #070d1a;
  --deep:    #0b1324;
  --panel:   #111b31;
  --panel-2: #17243f;
  --edge:    #22335a;
  --edge-2:  #182541;
  --shadow:  #04080f;
  /* ink */
  --ink:   #e9f1ff;
  --ink-2: #a5b9d6;
  --ink-3: #6d86aa;
  /* accents, all pulled from the sprite palette */
  --sun:    #f5b53f;
  --sun-2:  #ffcb6b;
  --crest:  #7fd8ec;
  --hull:   #b6485c;
  --plank:  #d08a4f;
  --kelp:   #5fd07a;
  --danger: #e2604f;
  --display: 'Jersey 15', 'Trebuchet MS', sans-serif;  /* headings, labels    */
  --sans: 'DotGothic16', system-ui, sans-serif;        /* body copy           */
  --mono: 'VT323', ui-monospace, monospace;            /* every figure        */
  --wrap: 1400px;
  --gut: clamp(16px, 2.5vw, 22px);
  --lift: 3px 3px 0 var(--shadow);
  --lift-sm: 2px 2px 0 var(--shadow);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-synthesis: none;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--night);
  background-image:
    radial-gradient(900px 460px at 82% -6%, rgba(127, 216, 236, .10), transparent 68%),
    radial-gradient(760px 420px at 6% 2%, rgba(182, 72, 92, .10), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .014) 0 1px, transparent 1px 3px);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
img.sprite, canvas { image-rendering: pixelated; }
/* width/height attributes reserve the space; height:auto keeps the ratio when
   a narrow viewport shrinks the image. */
img { max-width: 100%; height: auto; }
h1, h2, h3 {
  margin: 0 0 .4em; line-height: 1.15; text-wrap: balance;
  font-family: var(--display); font-weight: 400; letter-spacing: .01em;
}
/* the topbar is sticky, so anchored targets need room above them */
:target, h1, h2, h3, section[id] { scroll-margin-top: 84px; }
p { margin: 0 0 1em; text-wrap: pretty; }
ol, ul { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; }
code, kbd { font-family: var(--mono); }
a { color: var(--crest); text-underline-offset: 3px; }
a:hover { color: #a5e6f5; }
.muted { color: var(--ink-3); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 400; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
:focus-visible {
  outline: 2px solid var(--crest);
  outline-offset: 2px;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--sun); color: #1d1200;
  font: 400 14px/1 var(--display); letter-spacing: .06em;
  padding: 12px 16px; text-decoration: none;
  transition: top .12s ease-out;
}
.skip-link:focus { top: 12px; color: #1d1200; }
/* --- label: the small uppercase Silkscreen tag used all over ------------- */
.label {
  font: 400 14px/1 var(--display);
  letter-spacing: .1em;  
  color: var(--ink-3);
}
/* ================================================================ topbar == */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(7, 13, 26, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge-2);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: 10px var(--gut);
  display: flex; align-items: center; gap: clamp(12px, 3vw, 28px);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
}
.brand img { width: 28px; height: 28px; }
.brand-name {
  font: 400 26px/1 var(--display);
  letter-spacing: .06em;
}
.tabs { display: flex; gap: 2px; margin-right: auto; }
.tab {
  font: 400 14px/1 var(--display);
  letter-spacing: .08em; 
  color: var(--ink-3); text-decoration: none;
  padding: 11px 15px;
  border: 1px solid transparent;
  transition: color .12s, background-color .12s, border-color .12s;
}
.tab:hover { color: var(--ink); background: var(--panel); border-color: var(--edge-2); }
.tab[aria-current="page"] {
  color: #1d1200; background: var(--sun); border-color: var(--sun);
}
.wallet-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chip-balance {
  font: 400 25px/1 var(--mono); font-variant-numeric: tabular-nums;
  color: var(--sun);
  background: var(--panel); border: 1px solid var(--edge);
  padding: 9px 12px; white-space: nowrap;
}
@media (max-width: 640px) { .chip-balance { display: none; } }
/* =============================================================== buttons == */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 400 15px/1 var(--display);
  letter-spacing: .04em;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--edge);
  box-shadow: var(--lift-sm);
  padding: 11px 16px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .12s, border-color .12s, color .12s, box-shadow .1s, transform .1s;
}
.btn:hover:not(:disabled) { background: #223357; border-color: #33487a; color: var(--ink); }
.btn:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--shadow); }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--sun); border-color: var(--sun); color: #221600; }
.btn-primary:hover:not(:disabled) { background: var(--sun-2); border-color: var(--sun-2); color: #221600; }
.btn-buy { background: var(--kelp); border-color: var(--kelp); color: #04220e; }
.btn-buy:hover:not(:disabled) { background: #79e295; border-color: #79e295; color: #04220e; }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover:not(:disabled) { background: var(--panel); }
.btn-sm { padding: 8px 12px; font-size: 12px; }
.btn-lg { padding: 16px 28px; font-size: 16px; box-shadow: var(--lift); }
.btn-block { width: 100%; }
kbd {
  font-family: var(--mono); font-size: 15px;
  background: var(--panel-2); border: 1px solid var(--edge);
  border-bottom-width: 2px;
  padding: 3px 6px; color: var(--ink-2);
}
/* ============================================================== sections == */
main { flex: 1; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.band {
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(34px, 6vw, 58px) var(--gut);
  border-top: 1px solid var(--edge-2);
}
.band-head { max-width: 62ch; margin-bottom: 26px; }
.band-title {
  font-size: clamp(20px, 2.4vw, 26px); font-weight: 400;
  margin-bottom: .35em;
}
.band-note { color: var(--ink-3); margin: 0; font-size: 15px; }
/* =================================================================== hero == */
.hero {
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(30px, 5vw, 54px) var(--gut) clamp(24px, 4vw, 40px);
}
.hero-title {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 400;
  line-height: 1.25;
  margin: 0 0 18px;
  max-width: 24ch;
}
.lede {
  font-size: clamp(15px, 1.4vw, 17px);
  color: var(--ink-2);
  max-width: 60ch;
  margin-bottom: 24px;
}
.lede b { color: var(--sun); font-weight: 400; white-space: nowrap; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stage {
  position: relative;
  margin-top: clamp(26px, 4vw, 42px);
  border: 1px solid var(--edge);
  box-shadow: var(--lift);
  background: #0d1a2f;
  line-height: 0;
  overflow: hidden;
}
.hero-stage {
  /* The band trims the deepest water so the composition sits on the horizon. */
  aspect-ratio: 2.15;
}
.hero-stage {
  display: flex; align-items: center; justify-content: center;
}
.hero-stage canvas { display: block; width: 100%; height: auto; }
.hero-stage-glare {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 13, 26, .34) 0%, transparent 26%, transparent 78%, rgba(7, 13, 26, .40) 100%);
}
/* stat strip under the hero */
.stat-strip {
  display: flex; flex-wrap: wrap; gap: 1px;
  margin: 26px 0 0;
  background: var(--edge-2);
  border: 1px solid var(--edge);
}
.stat-strip > div { flex: 1 1 140px; min-width: 0; background: var(--deep); padding: 16px 18px; }
.stat-strip dt { font: 400 14px/1 var(--display); letter-spacing: .12em;  color: var(--ink-3); }
.stat-strip dd {
  margin: 10px 0 0;
  font: 400 25px/1 var(--mono); font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat-strip dd small { font-size: 12px; color: var(--ink-3); }
/* ================================================================== steps == */
.steps {
  display: grid; gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  counter-reset: step;
}
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.steps li {
  counter-increment: step;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--edge);
  box-shadow: var(--lift-sm);
  padding: 20px 18px 18px;
  min-width: 0;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font: 400 14px/1 var(--display);
  letter-spacing: .14em;
  color: var(--sun);
  margin-bottom: 14px;
}
.steps img { height: 40px; width: auto; margin-bottom: 12px; display: block; }
.steps b { display: block; font-size: 15px; font-weight: 400; margin-bottom: 4px; }
.steps span { color: var(--ink-3); font-size: 14px; }
/* ============================================================ catch table == */
.table-wrap {
  border: 1px solid var(--edge);
  box-shadow: var(--lift-sm);
  overflow-x: auto;
}
.catch-table { width: 100%; min-width: 460px; background: var(--panel); }
.catch-table th, .catch-table td {
  padding: 11px 16px; text-align: left;
  border-bottom: 1px solid var(--edge-2);
}
.catch-table thead th {
  font: 400 14px/1 var(--display); letter-spacing: .12em; 
  color: var(--ink-3); background: var(--deep);
}
.catch-table tbody tr:last-child td { border-bottom: 0; }
.catch-table tbody tr:hover td { background: var(--panel-2); }
.catch-table .num { text-align: right; font-size: 18px; }
.catch-table td.price { color: var(--sun); }
.catch-name { display: flex; align-items: center; gap: 14px; min-width: 0; }
.catch-name img { max-height: 26px; width: auto; flex: none; }
.catch-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font: 400 14px/1 var(--display); letter-spacing: .1em; 
  padding: 5px 9px;
  border: 1px solid currentColor;
}
.pill::before { content: ''; width: 5px; height: 5px; background: currentColor; }
/* ================================================================= tracks == */
.tracks { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .tracks { grid-template-columns: 1fr; } }
.track {
  background: var(--panel);
  border: 1px solid var(--edge);
  box-shadow: var(--lift-sm);
  padding: 18px;
  min-width: 0;
}
.track h3 {
  font: 400 14px/1 var(--display); letter-spacing: .14em; 
  color: var(--crest); margin-bottom: 4px;
}
.track-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--edge-2);
  min-width: 0;
}
.track-item img { width: 34px; height: 34px; flex: none; }
.track-item .ti-name { flex: 1; min-width: 0; }
.track-item .ti-name b { display: block; font-size: 14px; font-weight: 400; }
.track-item .ti-name small {
  color: var(--ink-3); font-family: var(--mono); font-size: 14px;
  display: block; overflow-wrap: anywhere;
}
.track-item .ti-cost {
  font: 400 25px/1 var(--mono); font-variant-numeric: tabular-nums;
  color: var(--sun); white-space: nowrap; flex: none;
}
/* ============================================================= token card == */
.token-card {
  display: flex; flex-wrap: wrap; gap: 1px;
  margin: 0;
  background: var(--edge-2);
  border: 1px solid var(--edge);
  box-shadow: var(--lift-sm);
}
.token-card > div {
  flex: 1 1 220px; min-width: 0;
  background: var(--panel); padding: 16px 18px;
}
.token-card dt { font: 400 14px/1 var(--display); letter-spacing: .12em;  color: var(--ink-3); }
.token-card dd {
  margin: 10px 0 0;
  font-family: var(--mono); font-size: 15px;
  overflow-wrap: anywhere;
}
/* =================================================================== game == */
.game {
  max-width: var(--wrap); margin: 0 auto;
  padding: 22px var(--gut) 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1120px) { .game { grid-template-columns: 1fr; } }
.stage-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.side-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Stacked, the bucket and the gear are what a thumb reaches for, so they come
   straight after the controls and the log drops to the bottom. `display:
   contents` promotes the stage column's children to grid items so they can be
   ordered against the rail. */
@media (max-width: 1120px) {
  .stage-col { display: contents; }
  .hud { order: 1; }
  .stage { order: 2; }
  .stage-controls { order: 3; }
  .side-col { order: 4; }
}
/* HUD */
.hud {
  display: flex; flex-wrap: wrap; gap: 1px; margin: 0;
  background: var(--edge-2);
  border: 1px solid var(--edge);
  box-shadow: var(--lift-sm);
}
.hud > div {
  flex: 1 1 108px; min-width: 0;
  background: var(--panel); padding: 11px 15px;
}
.hud dt { font: 400 14px/1 var(--display); letter-spacing: .13em;  color: var(--ink-3); }
.hud dd {
  margin: 9px 0 0;
  font: 400 25px/1 var(--mono); font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hud dd small { font-size: 11px; font-weight: 400; color: var(--ink-3); }
.hud-gear { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.hud-gear img { width: 26px; height: 26px; }
.hud-gear img.none { opacity: .25; }
/* Stage */
.stage {
  position: relative;
  border: 1px solid var(--edge);
  box-shadow: var(--lift);
  background: #0d1a2f;
  line-height: 0;
  overflow: hidden;
}
#scene {
  width: 100%; height: auto; display: block; margin: 0 auto;
  cursor: crosshair;
  touch-action: manipulation;
}
.stage { display: flex; flex-direction: column; align-items: center; }
.stage-prompt {
  position: absolute; inset-inline: 0; top: 14px;
  margin: 0; text-align: center; pointer-events: none;
  font: 400 15px/1.4 var(--display);
  letter-spacing: .1em; 
  color: var(--ink);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .85);
}
.stage-prompt.is-alert {
  color: var(--sun); font-size: 19px; font-weight: 400;
  animation: blink .36s steps(2, jump-none) infinite;
}
@keyframes blink { 50% { opacity: .3; } }
.bite-bar {
  position: absolute; left: 50%; translate: -50% 0;
  top: 40px; width: 210px; height: 9px;
  background: rgba(4, 8, 16, .8);
  border: 1px solid var(--edge);
  overflow: hidden;
}
.bite-bar i { display: block; height: 100%; width: 100%; background: var(--sun); }
.catch-card {
  position: absolute; left: 50%; bottom: 16px; translate: -50% 0;
  display: flex; align-items: center; gap: 16px;
  background: rgba(7, 13, 26, .94);
  border: 1px solid var(--edge);
  box-shadow: var(--lift);
  padding: 13px 20px;
  line-height: 1.35; text-align: left;
  animation: rise .16s ease-out;
}
@keyframes rise { from { translate: -50% 10px; opacity: 0; } }
.catch-card img { max-height: 42px; width: auto; }
.catch-card b { display: block; font-size: 16px; font-weight: 400; }
.catch-card .cc-price {
  font: 400 15px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--sun);
  margin-top: 4px;
}
/* Gate overlay: connect a wallet / buy the first rod */
.gate {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 26px; text-align: center; line-height: 1.5;
  background: rgba(6, 11, 22, .92);
  backdrop-filter: blur(2px);
}
.gate img.sprite { width: 48px; height: auto; }
.gate h3 {
  margin: 0;
  font: 400 14px/1.4 var(--display); letter-spacing: .08em; 
  color: var(--ink);
}
.gate p { margin: 0; color: var(--ink-2); max-width: 46ch; font-size: 14px; }
.gate-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.gate-list { margin: 0; font-family: var(--mono); font-size: 15px; color: var(--sun); }
.gate-list li { padding: 2px 0; }
.stage-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.stage-controls .hint { margin: 0; color: var(--ink-3); font-size: 13px; }
.hint-touch { display: none; }
@media (pointer: coarse) {
  .hint-pointer { display: none; }
  .hint-touch { display: inline; }
}
/* ================================================================= panels == */
.panel {
  background: var(--panel);
  border: 1px solid var(--edge);
  box-shadow: var(--lift-sm);
  padding: 16px 18px;
  min-width: 0;
}
.panel-title {
  font: 400 14px/1 var(--display); letter-spacing: .14em; 
  color: var(--crest);
  margin: 0 0 14px;
}
.panel-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--edge-2);
  font-family: var(--mono); font-size: 15px;
}
.panel-foot span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--ink-3); font-size: 14px; padding: 4px 0 2px; margin: 0; }
/* bucket */
.bucket-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; border-top: 1px solid var(--edge-2);
  min-width: 0;
}
.bucket-row:first-child { border-top: 0; padding-top: 2px; }
.bucket-row img { width: 36px; height: 36px; flex: none; }
.bucket-row .br-name { flex: 1; min-width: 0; font-size: 14px; }
.bucket-row .br-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bucket-row .br-name small { display: block; font-family: var(--mono); font-size: 14px; }
.bucket-row .br-count {
  font: 400 15px/1 var(--mono); font-variant-numeric: tabular-nums;
  color: var(--ink-3); flex: none;
}
/* gear */
.gear-track { padding: 13px 0; border-top: 1px solid var(--edge-2); }
.gear-track:first-child { border-top: 0; padding-top: 0; }
.gear-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 10px; min-width: 0;
}
.gear-head b { font: 400 14px/1 var(--display); letter-spacing: .12em;  color: var(--ink-2); }
.gear-head span { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gear-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gear-row img { width: 32px; height: 32px; flex: none; }
.gear-row .gr-name { flex: 1; min-width: 0; font-size: 14px; }
.gear-row .gr-name b { display: block; font-weight: 400; }
.gear-row .gr-name small {
  display: block; color: var(--ink-3);
  font-family: var(--mono); font-size: 14px; line-height: 1.45;
  overflow-wrap: anywhere;
}
.gear-max { font: 400 14px/1 var(--display); letter-spacing: .1em; color: var(--kelp); }
/* odds */
.odds-row {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 0;
  font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums;
}
.odds-row .or-label { width: 76px; flex: none; }
.odds-row .or-bar { flex: 1; height: 8px; background: var(--deep); border: 1px solid var(--edge-2); }
.odds-row .or-bar i { display: block; height: 100%; transition: width .28s ease-out; }
.odds-row .or-val { width: 54px; text-align: right; flex: none; color: var(--ink-2); }
/* treasury / wallet panel */
.field { display: block; margin-bottom: 12px; }
.field .label { display: block; margin-bottom: 7px; }
.field input {
  width: 100%;
  font: 400 17px/1 var(--mono); font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--deep);
  border: 1px solid var(--edge);
  padding: 11px 12px;
}
.field input:focus-visible { border-color: var(--crest); }
.treasury-row { display: flex; gap: 8px; margin-bottom: 8px; }
.treasury-row .btn { flex: 1; }
.treasury-note { margin: 12px 0 0; font-size: 12px; color: var(--ink-3); }
/* On a touch screen a tap leaves the element "hovered" until you tap elsewhere,
   so the hover styling is folded back to the resting one. */
@media (hover: none) {
  .btn:hover:not(:disabled) { background: var(--panel-2); border-color: var(--edge); }
  .btn-primary:hover:not(:disabled) { background: var(--sun); border-color: var(--sun); }
  .btn-buy:hover:not(:disabled) { background: var(--kelp); border-color: var(--kelp); }
  .btn-ghost:hover:not(:disabled) { background: transparent; }
  .tab:hover { color: var(--ink-3); background: none; border-color: transparent; }
  .tab[aria-current="page"]:hover { color: #1d1200; background: var(--sun); border-color: var(--sun); }
  .catch-table tbody tr:hover td { background: none; }
  a:hover { color: var(--crest); }
}

/* ============================================================ small screens = */

@media (max-width: 640px) {
  .game { padding-top: 14px; gap: 14px; }

  /* the primary action is a thumb target, so it spans the width */
  .stage-controls { flex-direction: column; align-items: stretch; gap: 10px; }
  .stage-controls .btn { width: 100%; padding-block: 18px; font-size: 17px; }
  .stage-controls .hint { text-align: center; }

  .hud > div { padding: 9px 12px; }
  .hud dd { margin-top: 6px; font-size: 15px; }

  .catch-table th, .catch-table td { padding: 9px 11px; }
  .catch-name { gap: 9px; }

  .panel { padding: 14px; }

  .topbar-inner { gap: 10px; }
  .tab { padding: 10px 11px; }

  .toasts { left: 12px; right: 12px; align-items: stretch; }
  .toast { max-width: none; }
}

/* Landscape on a phone: very little height, so trim the vertical rhythm. */
@media (max-height: 560px) and (orientation: landscape) {
  .topbar { position: static; }
  .game { padding-top: 10px; gap: 10px; }
}

/* ================================================================= toasts == */
.toasts {
  position: fixed; z-index: 90;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--panel-2);
  border: 1px solid var(--edge);
  border-left: 3px solid var(--crest);
  box-shadow: var(--lift);
  padding: 12px 16px;
  font-size: 14px; line-height: 1.45;
  max-width: min(360px, calc(100vw - 32px));
  animation: slide-in .16s ease-out;
}
@keyframes slide-in { from { translate: 12px 0; opacity: 0; } }
.toast.ok  { border-left-color: var(--kelp); }
.toast.err { border-left-color: var(--danger); }
.toast a { display: inline-block; margin-top: 5px; font-family: var(--mono); font-size: 15px; }
/* ========================================================= reduced motion == */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .stage-prompt.is-alert { animation: none; opacity: 1; }
}
