/* Monogram by Vinícius Menézio (CC0). Pixel UI frames: tools/build_ui.py → assets/ui/.
   --px is one "art pixel" in CSS pixels (set by game.js so it is always a whole number of screen
   pixels). The font, every frame, icon and gap is measured in it, so the whole UI shares one grid. */
@font-face { font-family: 'Monogram'; src: url(assets/fonts/monogram-extended.ttf) format('truetype'); font-display: block; }

:root {
  --ink: #e9efe9;
  --ink-dim: #a9b9b2;
  --ink-dark: #12302a;
  --gold: #f6dc8a;
  --line: #0b1514;
  --bg: #1b2b2c;
  --px: 2px;
  --fs: 32px;
  --fs-big: 48px;
  --fs-huge: 64px;
  --b1: var(--px);
  --b2: calc(var(--px) * 2);
  --b3: calc(var(--px) * 3);
  --b4: calc(var(--px) * 4);
  --u4: calc(var(--px) * 4);
  --u6: calc(var(--px) * 6);
  --u8: calc(var(--px) * 8);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: 'Monogram', monospace; font-size: var(--fs); line-height: 1; font-weight: normal;
  font-synthesis: none; -webkit-font-smoothing: none; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeSpeed;
  image-rendering: pixelated;
}
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }
button, input { font: inherit; color: inherit; margin: 0; }
button { cursor: pointer; }
b, strong, h1, h2, h3 { font-weight: normal; }
[hidden] { display: none !important; }
:focus { outline: none; }

/* ---------- the frames ---------- */
.card, .pill, #prompt, #reel-hint, .toast, #event-banner, .banner {
  border: var(--b3) solid transparent; border-radius: 0; background: none;
  border-image: url(assets/ui/panel.png) 3 fill / var(--b3);
}
.row, .detail, #preview {
  border: var(--b3) solid transparent; border-radius: 0; background: none;
  border-image: url(assets/ui/slot.png) 3 fill / var(--b3);
}
/* buttons: thicker bottom edge; they sink one pixel when pressed */
.btn, #catch-ok, #btn-join, #btn-auth, #action, .btn-ghost, .arrow, .small, #panel-tabs button, .auth-tabs button, .close {
  border-style: solid; border-color: transparent; border-radius: 0; background: none;
  border-width: var(--b3) var(--b3) var(--b4);
  border-image: url(assets/ui/btn.png) 3 3 4 3 fill / var(--b3) var(--b3) var(--b4);
  color: var(--ink-dark);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--u4);
  padding: 0 var(--u6) var(--b1);
}
.btn-ghost, .arrow, .small, #panel-tabs button, .auth-tabs button, .close, .btn.alt {
  border-image-source: url(assets/ui/btn-dark.png); color: var(--ink);
}
#panel-tabs button.on, .auth-tabs button.on { border-image-source: url(assets/ui/btn-on.png); color: var(--ink); }
.btn:hover:not(:disabled), #catch-ok:hover, #btn-join:hover:not(:disabled), #btn-auth:hover:not(:disabled), .btn-ghost:hover, .arrow:hover, .small:hover,
#panel-tabs button:hover, .auth-tabs button:hover, .close:hover { filter: brightness(1.12); }
.btn:active:not(:disabled), #catch-ok:active, #btn-join:active:not(:disabled), #btn-auth:active:not(:disabled), .btn-ghost:active, .arrow:active, .small:active,
#panel-tabs button:active, .auth-tabs button:active, .close:active, #action:active { transform: translateY(var(--px)); filter: brightness(0.94); }
.btn:disabled, #btn-join:disabled, #btn-auth:disabled { filter: grayscale(0.7) brightness(0.8); opacity: 0.7; cursor: default; }
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: calc(var(--px) * 15); height: calc(var(--px) * 23); padding: 0 var(--b3) var(--b1); margin: 0 var(--b1);
  font: inherit; line-height: 1; color: #1c2b29; vertical-align: middle;
  border-style: solid; border-color: transparent; border-width: var(--b3) var(--b3) var(--b4);
  border-image: url(assets/ui/key.png) 3 3 4 3 fill / var(--b3) var(--b3) var(--b4);
}
.auth input, #chat-input {
  border: var(--b3) solid transparent; border-radius: 0; background: none;
  border-image: url(assets/ui/field.png) 3 fill / var(--b3);
  padding: 0 var(--u4) var(--b1);
}
.auth input:focus, #chat.open #chat-input { border-image-source: url(assets/ui/field-on.png); }
/* the browser's saved-password fill would paint the box yellow/blue: keep it the field's colour */
.auth input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px #0f1e20 inset; -webkit-text-fill-color: var(--ink); caret-color: var(--ink); }
.auth input::placeholder { color: var(--ink-dim); }
::-webkit-scrollbar { width: var(--u4); height: var(--u4); }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.25); }
::-webkit-scrollbar-thumb { background: #3f5f5a; border: var(--px) solid var(--line); }

/* ---------- join card ---------- */
.overlay {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(10, 20, 22, 0.25), rgba(10, 20, 22, 0.7));
}
.card {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
  padding: var(--u8) var(--u8) var(--u6);
  filter: drop-shadow(0 var(--b2) 0 rgba(0, 0, 0, 0.35));
}
h1 { margin: 0; font-size: var(--fs-huge); color: #d9efe4; }
.sub { margin: var(--b2) 0 var(--u8); color: var(--ink-dim); }
.creator { display: flex; gap: var(--u8); align-items: flex-start; margin-bottom: var(--u8); }
.preview-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--u4); }
.turn { display: flex; gap: var(--u4); }
.turn .arrow { width: calc(var(--px) * 22); }
#preview { width: calc(96px + var(--b3) * 2); height: calc(144px + var(--b3) * 2); }
#slots { flex: 1; display: grid; gap: var(--b3); }
.slot { display: grid; grid-template-columns: calc(var(--px) * 38) calc(var(--px) * 18) 1fr calc(var(--px) * 18); align-items: center; gap: var(--b2); }
.slot .lbl { color: var(--ink-dim); padding-bottom: var(--b1); }
.slot .val { text-align: center; color: var(--ink-dim); white-space: nowrap; overflow: hidden; padding-bottom: var(--b1); }
.arrow, .small { height: calc(var(--px) * 20); padding: 0 var(--b2) var(--b1); }
.small { padding: 0 var(--u4) var(--b1); }
/* account: two tabs, username, password, one button */
.auth { display: grid; gap: var(--u4); }
.auth-tabs { display: flex; gap: var(--b3); margin-bottom: var(--b2); }
.auth-tabs button { height: calc(var(--px) * 23); padding: 0 var(--u6) var(--b1); color: var(--ink-dim); }
.auth input { width: 100%; height: calc(var(--px) * 25); }
#btn-auth, #btn-join { height: calc(var(--px) * 25); padding: 0 var(--u8) var(--b1); }
#btn-auth { margin-top: var(--b2); }
#look-step { display: grid; }
#look-step[hidden] { display: none; }
.look-acts { display: flex; gap: var(--u4); }
.look-acts #btn-join { flex: 1; }
#btn-look-cancel { height: calc(var(--px) * 25); padding: 0 var(--u8) var(--b1); }
.status { min-height: 24px; margin: var(--u4) 0 0; color: var(--ink-dim); }
.status.bad { color: #f0b49a; }

/* ---------- hud ---------- */
#hud { position: fixed; top: 12px; right: 12px; display: flex; gap: var(--u4); }
.pill {
  display: flex; align-items: center; gap: var(--u4); height: calc(var(--px) * 24);
  padding: 0 var(--u4) var(--b1); white-space: nowrap;
}
.pill.btn-ghost { height: calc(var(--px) * 25); }
.dot { width: var(--b3); height: var(--b3); background: #8fe0b0; box-shadow: 0 0 0 var(--px) var(--line); animation: blink 2s steps(1) infinite;
  transform: translateY(calc(var(--px) * .5)); }   /* lines up with the middle of the capitals */
@keyframes blink { 85% { background: #4f9a6c; } }
/* the players button: just the people icon, with a blue number when friend requests are waiting */
#btn-players { position: relative; padding: 0 var(--u4) var(--b1); }
.count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: calc(var(--px) * 11); height: calc(var(--px) * 11); padding: 0 var(--b2) var(--px);
  color: #fff; line-height: 1; border: var(--b2) solid transparent;
  border-image: url(assets/ui/count.png) 2 fill / var(--b2);
}
#btn-players .count { position: absolute; top: calc(var(--px) * -6); right: calc(var(--px) * -6); pointer-events: none; }
#panel-tabs .count { margin-left: var(--b2); }

/* ---------- chat ---------- */
#chat { position: fixed; left: 12px; bottom: 12px; width: min(480px, calc(100vw - 24px)); }
#chat-log {
  list-style: none; margin: 0 0 var(--b3); padding: 0; display: flex; flex-direction: column; gap: var(--b2);
  pointer-events: none;
  --chat-h: min(42vh, 380px);       /* the chat is never taller than this, open or closed */
}
/* closed: the newest lines sit at the bottom; anything that doesn't fit is cut off at the top */
#chat:not(.open) #chat-log { max-height: var(--chat-h); overflow: hidden; justify-content: flex-end; }
/* lines that don't fit are hidden whole (see updateChatClip in game.js) */
#chat:not(.open) #chat-log .cut { display: none; }
#chat-log li {
  align-self: flex-start; max-width: 100%; line-height: 1; overflow-wrap: anywhere;
  padding: var(--b1) var(--u4) var(--b2);
  border: var(--b1) solid transparent; border-image: url(assets/ui/line.png) 1 fill / var(--b1);
}
#chat:not(.open) #chat-log li { transition: opacity 1.2s steps(6); }
#chat-log li.sys { color: #efe0a6; }            /* announcements: pastel yellow */
#chat-log li.cmd { color: #b9d6e4; }            /* replies to your /commands (only you see them) */
#chat-log li.cmd div + div { margin-top: var(--b2); }
#chat-log li.past { color: #c3cfca; }
#chat-log li.pm { color: #f3c6e3; }               /* private messages between friends: pink */
#chat-log li.pm b { color: #f7a9d6; }
#chat-log b { color: #bfe6d6; font-weight: normal; }
#chat-log .ago { color: #7f948c; margin-left: var(--u6); white-space: nowrap; }
/* closed: only the last few recent lines, fading away after a while */
#chat:not(.open) #chat-log li.fading { opacity: 0; }
#chat:not(.open) #chat-log li.old { display: none; }
#chat:not(.open) #chat-log li:nth-last-child(n+6) { display: none; }
/* open: the recent history in a glass panel, scrollable */
#chat.open #chat-log {
  max-height: var(--chat-h); overflow-y: auto; pointer-events: auto; overscroll-behavior: contain;
  padding: var(--b3) var(--b3) var(--b3) var(--u4);
  border: var(--b3) solid transparent; border-image: url(assets/ui/glass.png) 3 fill / var(--b3);
}
#chat.open #chat-log li { border: 0; border-image: none; padding: var(--b1) 0 var(--b2); }
#chat-input { width: 100%; height: calc(var(--px) * 24); opacity: 0.7; }
#chat.open #chat-input { opacity: 1; }
#chat-input::placeholder { color: var(--ink-dim); }

/* ---------- fishing hud ---------- */
.muted { color: var(--ink-dim); }
#hud-left { position: fixed; top: 12px; left: 12px; display: flex; flex-wrap: wrap; gap: var(--u4); max-width: calc(100vw - 340px); }
.pill.coins { color: var(--gold); }
.pill.buff { color: #ffd59a; }
.item-icon {
  display: inline-block; width: 20px; height: 20px; flex: none;
  background-image: url(assets/items.png?v=10); background-repeat: no-repeat;
}
.fish-icon { display: inline-block; flex: none; background-image: url(assets/fish.png?v=2); background-repeat: no-repeat; }
.fish-icon.unknown { filter: brightness(0) opacity(0.35); }
#event-banner {
  position: fixed; top: 64px; left: 0; right: 0; margin: 0 auto; width: max-content; max-width: calc(100vw - 24px);
  padding: var(--b1) var(--u6) var(--b2); color: #dff8ef; white-space: nowrap; pointer-events: none;
  border-image-source: url(assets/ui/event.png);
}
#toasts { position: fixed; bottom: 124px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: var(--b3); pointer-events: none; z-index: 20; }
.toast {
  padding: var(--b1) var(--u6) var(--b2); white-space: nowrap;
  filter: drop-shadow(0 var(--b2) 0 rgba(0, 0, 0, 0.3));
  animation: toast-in .2s steps(3); transition: opacity .5s steps(5);
}
.toast.good { border-image-source: url(assets/ui/toast-good.png); }
.toast.warn { border-image-source: url(assets/ui/toast-warn.png); }
@keyframes toast-in { from { transform: translateY(calc(var(--px) * -6)); opacity: 0; } }

#prompt {
  position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: 66px;
  display: flex; align-items: center; gap: var(--b2);
  padding: var(--b2) var(--u6) var(--b2) var(--b3); pointer-events: none; white-space: nowrap;
}
#prompt .gap { margin-left: var(--u4); }   /* "Waiting…   Bait: (icon) Worms" */
#prompt.hot { border-image-source: url(assets/ui/hot.png); color: #ffe7a6; animation: hop .5s infinite; }
@keyframes hop { 0%, 49% { transform: none; } 50%, 100% { transform: translateY(calc(var(--px) * -1)); } }
#action {
  position: fixed; right: 18px; bottom: 22px; width: calc(var(--px) * 64); height: calc(var(--px) * 64);
  touch-action: none; line-height: 0.9; text-align: center; padding: 0 var(--b2) var(--b1);
  filter: drop-shadow(0 var(--b2) 0 rgba(0, 0, 0, 0.35));
}
#action.hot { border-image-source: url(assets/ui/btn-gold.png); color: #3a2208; }

/* ---------- reel minigame ---------- */
#reel {
  position: fixed; top: 50%; left: calc(50% + 70px); transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: var(--b3); touch-action: none; user-select: none;
}
#reel-canvas { display: block; filter: drop-shadow(0 var(--b2) 0 rgba(0, 0, 0, 0.35)); }
#reel-hint { display: flex; align-items: center; gap: var(--b2); padding: var(--b2) var(--u4) var(--b2) var(--b3); white-space: nowrap; }

/* ---------- catch card ---------- */
.overlay.soft { background: rgba(10, 20, 22, 0.35); }
.catch-card { width: min(440px, calc(100vw - 32px)); text-align: center; animation: pop .24s steps(4); }
@keyframes pop { from { transform: translateY(calc(var(--px) * 8)); opacity: 0; } }
#catch-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--b3); min-height: 4px; }
.tag {
  padding: 0 var(--u4) var(--b2); border: var(--b3) solid transparent;
  border-image: url(assets/ui/chip.png) 3 fill / var(--b3);
}
.tag.gold { color: #3a2a06; border-image-source: url(assets/ui/chip-gold.png); }
.tag.green { color: #12302a; border-image-source: url(assets/ui/chip-green.png); }
#catch-icon { display: grid; place-items: center; margin: var(--u6) 0 var(--b3); }
#catch-name { margin: 0; font-size: var(--fs-big); }
#catch-meta { margin: var(--b3) 0 var(--u8); color: var(--ink-dim); line-height: 1.1; }
#catch-ok, .btn { height: calc(var(--px) * 24); }
.catch-acts { display: flex; gap: var(--u4); }            /* Release (small, left) and Keep (fills the rest) */
.catch-acts #catch-ok { flex: 1; }
#catch-release { height: calc(var(--px) * 24); padding: 0 var(--u8) var(--b1); }
.btn.sm { height: calc(var(--px) * 22); padding: 0 var(--u4) var(--b1); }

/* ---------- panels ---------- */
/* menus sit between the top bar and the chat box, never on top of them
   (ui.js measures both and sets --safe-top / --safe-bottom; these are the fallbacks) */
#panel { --safe-top: calc(24px + var(--px) * 25); --safe-bottom: calc(24px + var(--px) * 24); padding: var(--safe-top) 16px var(--safe-bottom); }
#panel .panel-card { max-height: calc(100vh - var(--safe-top) - var(--safe-bottom)); }
.panel-card { position: relative; width: min(740px, calc(100vw - 24px)); display: flex; flex-direction: column; padding: var(--u6) var(--u8); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--u4); padding-right: calc(var(--px) * 26); }
/* the title sits level with the close button; everything under it moves up with it */
.panel-head h2 { margin: calc(var(--px) * -3) 0 0; font-size: var(--fs-big); }
.panel-head .close { position: absolute; top: var(--u6); right: var(--u8); }
.panel-head p { margin: var(--b2) 0 0; }
/* left / right arrow buttons (rod picker): drawn arrows, centred on a 14x15 face */
.arrow.ar-l, .arrow.ar-r { width: calc(var(--px) * 20); height: calc(var(--px) * 22); padding: 0; flex: none; }
.arrow.ar-l::after, .arrow.ar-r::after { content: ''; width: calc(var(--px) * 4); height: calc(var(--px) * 7); background: url(assets/ui/icon-left.png) 0 0 / 100% 100% no-repeat; }
.arrow.ar-r::after { background-image: url(assets/ui/icon-right.png); }
.arrow:disabled { filter: brightness(0.65); cursor: default; transform: none; }
.rodpick .acts { gap: var(--b3); }
/* close button: a drawn 7x7 X, centred on the button face (15x15 inside the frame) */
.close { width: calc(var(--px) * 21); height: calc(var(--px) * 22); padding: 0; flex: none; }
.close::after { content: ''; width: calc(var(--px) * 7); height: calc(var(--px) * 7); background: url(assets/ui/icon-x.png) 0 0 / 100% 100% no-repeat; }
#panel-tabs { display: flex; gap: var(--b3); margin: var(--u6) 0 var(--u4); flex-wrap: wrap; }
#panel-tabs button { height: calc(var(--px) * 23); padding: 0 var(--u6) var(--b1); color: var(--ink-dim); }
#panel-tabs button.push { margin-left: auto; }
#panel.nosub #panel-tabs { margin-top: calc(var(--px) * 14); }   /* a bit of air between the title and the tabs */
/* no subtitle and no tabs (your bucket): the same air under the title as there is above it */
#panel.nosub #panel-tabs[hidden] ~ #panel-body { margin-top: calc(var(--px) * 9); }
#panel-body { flex: 1 1 auto; overflow-y: auto; min-height: 120px; padding-right: var(--b2); }
/* tabbed panels (records, Jacob) are always the height of ten list rows; longer tabs scroll */
#panel-body.fixed { flex: 0 1 calc(var(--px) * 281); height: calc(var(--px) * 281); min-height: 0; }
/* journal: the details box stays on top, only the fish grid scrolls */
#panel-body.split { display: flex; flex-direction: column; overflow: hidden; min-height: 0; padding-right: 0;
  flex: 0 1 calc(var(--px) * 314); height: calc(var(--px) * 314); }   /* same overall height as the records board */
#panel-body.split .scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: var(--b2); }
#panel-body.split > :not(.scroll) { flex: none; }
/* your bucket: rod and bait stay put, only the fish scroll; the whole menu is as tall as the journal */
#panel-body.split.bag { --bag-h: 323; flex: 0 1 calc(var(--px) * var(--bag-h)); height: calc(var(--px) * var(--bag-h)); }
.row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--u6);
  padding: var(--b3) var(--u4); margin-bottom: var(--b3);
}
.row .desc { color: var(--ink-dim); margin-top: var(--b1); }
.row .acts { display: flex; gap: var(--b3); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.price { display: inline-flex; align-items: center; gap: var(--b2); color: var(--gold); white-space: nowrap; }
.btn .price { color: inherit; }
.banner {
  padding: var(--b2) var(--u6) var(--b3); margin-bottom: var(--u4); color: #ffe7a6;
  display: flex; align-items: center; gap: var(--u4); border-image-source: url(assets/ui/hot.png);
}
.banner > span:not(.fish-icon) { flex: 1; min-width: 0; }   /* the text wraps next to the fish, the fish stays on the left */
/* rod stats: a label and a meter of 5 boxes, filled boxes = how good the rod is at it */
.stats { display: flex; flex-wrap: wrap; gap: var(--b3) var(--u6); margin-top: var(--b3); }
.stat { display: inline-flex; align-items: center; gap: var(--b3); color: var(--ink-dim); }
.row.rod .acts { min-width: calc(var(--px) * 84); }   /* same width on every rod, so the stats line up */
.meter { display: inline-flex; gap: var(--px); padding: var(--px); background: var(--line); }
.meter i { width: calc(var(--px) * 5); height: calc(var(--px) * 5); background: #1d3432; box-shadow: inset 0 var(--px) 0 #27433f; }
.meter i.on { background: var(--m); box-shadow: inset 0 var(--px) 0 var(--m-hi), inset 0 calc(var(--px) * -1) 0 var(--m-lo); }
.meter.bites { --m: #86d69a; --m-hi: #d4f7dd; --m-lo: #5aa66e; }
.meter.control { --m: #74b8f2; --m-hi: #cfe8fd; --m-lo: #4a86c0; }
.meter.luck { --m: #f4c75c; --m-hi: #fff0b8; --m-lo: #c9962f; }
.grid {
  display: grid; gap: var(--b3);
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--px) * 46), 1fr));
  grid-auto-rows: calc(var(--px) * 30);          /* small tiles, all the same size */
  padding: var(--b2) var(--b2) 0 0;               /* room for NEW badges hanging over the edge */
}
/* journal tiles: background tinted with the fish's rarity colour, brighter outline on hover / selected */
.cell {
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: var(--b3) solid transparent; border-image: url(assets/ui/tile-common.png) 3 fill / var(--b3);
}
.cell.r-uncommon { border-image-source: url(assets/ui/tile-uncommon.png); }
.cell.r-rare { border-image-source: url(assets/ui/tile-rare.png); }
.cell.r-epic { border-image-source: url(assets/ui/tile-epic.png); }
.cell.r-legendary { border-image-source: url(assets/ui/tile-legendary.png); }
.cell.r-common:hover, .cell.r-common.on { border-image-source: url(assets/ui/tile-common-on.png); }
.cell.r-uncommon:hover, .cell.r-uncommon.on { border-image-source: url(assets/ui/tile-uncommon-on.png); }
.cell.r-rare:hover, .cell.r-rare.on { border-image-source: url(assets/ui/tile-rare-on.png); }
.cell.r-epic:hover, .cell.r-epic.on { border-image-source: url(assets/ui/tile-epic-on.png); }
.cell.r-legendary:hover, .cell.r-legendary.on { border-image-source: url(assets/ui/tile-legendary-on.png); }
.cell { position: relative; }
.badge-new {                       /* blue NEW badge, top right: your latest first-time catch, for 30 minutes */
  position: absolute; top: calc(var(--px) * -5); right: calc(var(--px) * -5);   /* hangs over the corner */
  width: calc(var(--px) * 18); height: calc(var(--px) * 9);
  background: url(assets/ui/badge-new.png) 0 0 / 100% 100% no-repeat; pointer-events: none;
}
/* hover name tag */
#tip {
  position: fixed; z-index: 50; pointer-events: none; white-space: nowrap;
  padding: var(--b1) var(--u4) var(--b2);
  border: var(--b3) solid transparent; border-image: url(assets/ui/panel.png) 3 fill / var(--b3);
  filter: drop-shadow(0 var(--b2) 0 rgba(0, 0, 0, 0.35));
}
/* details: picture on the left, text on the right, always the same height */
.detail {
  flex: none; display: grid; grid-template-columns: calc(var(--px) * 72) 1fr; align-items: center; gap: var(--u6);
  min-height: calc(var(--px) * 88); padding: var(--u4) var(--u6); margin-bottom: var(--u6);
}
.detail .pic { display: grid; place-items: center; }
.detail h3 { margin: 0 0 var(--b3); font-size: var(--fs-big); }
.detail p { margin: var(--b1) 0; color: var(--ink-dim); }
.empty { padding: 24px; text-align: center; color: var(--ink-dim); }
/* ---------- players and friends ---------- */
/* search on top, the list scrolls, the pages stay at the bottom; the menu never changes size */
#panel-body.people { display: flex; flex-direction: column; overflow: hidden; padding-right: 0; }
/* no subtitle on this menu, so the list gets that space: the menu is as tall as the journal and records */
#panel-body.fixed.people { flex-basis: calc(var(--px) * 291); height: calc(var(--px) * 291); }
.people .top { flex: none; display: flex; align-items: center; gap: var(--u6); margin-bottom: var(--u4); }
.people .top .online-n { margin-top: 0; white-space: nowrap; }
.search {
  flex: 1; min-width: 0; height: calc(var(--px) * 24); padding: 0 var(--u4) var(--b1);
  border: var(--b3) solid transparent; border-radius: 0; background: none;
  border-image: url(assets/ui/field.png) 3 fill / var(--b3);
}
.search:focus { border-image-source: url(assets/ui/field-on.png); }
.search::placeholder { color: var(--ink-dim); }
.people .scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: var(--b2); }
.pager { flex: none; display: flex; align-items: center; justify-content: center; gap: var(--u6); margin-top: var(--u4); color: var(--ink-dim); }
.sect { color: var(--ink-dim); margin: var(--u4) 0 var(--b2); }
.sect:first-child { margin-top: 0; }
.person {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--u6);
  padding: var(--b2) var(--b2) var(--b3); border-bottom: var(--px) dashed #2e4945; cursor: pointer;
}
.person:hover { background: rgba(159, 216, 196, 0.06); }
.person .who { min-width: 0; }
.person .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .acts { display: flex; gap: var(--b3); align-items: center; justify-content: flex-end; }
.person.muted-p .nm { color: var(--ink-dim); }
.st { display: flex; align-items: center; gap: var(--b3); color: var(--ink-dim); margin-top: var(--b2); }
.st.on { color: #a6e8be; }
.avatar {                          /* a head in a small dark box */
  display: grid; place-items: center; width: calc(var(--px) * 38); height: calc(var(--px) * 38);
  border: var(--b3) solid transparent; border-image: url(assets/ui/slot.png) 3 fill / var(--b3);
}
.portrait { display: block; image-rendering: pixelated; }
.tagline { color: var(--ink-dim); padding: 0 var(--b3); white-space: nowrap; }
.tagline.good { color: #a6e8be; }
#panel-tabs button.back { gap: var(--b3); color: var(--ink); }
.ico-l { width: calc(var(--px) * 4); height: calc(var(--px) * 7); background: url(assets/ui/icon-left.png) 0 0 / 100% 100% no-repeat; }
/* profile: the character and who they are on top, three numbers, then the records they hold */
.detail.prof { position: relative; margin-bottom: var(--u4); }
.detail.prof .info { min-width: 0; }
/* the status sits next to the name; one pixel down puts its letters level with the middle of the name */
.detail.prof .head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--b2) var(--u8); margin-bottom: var(--b3); }
.detail.prof h3 { margin: 0; }
.detail.prof .head .st { margin-top: 0; position: relative; top: var(--px); }
.detail.prof .acts { display: flex; flex-wrap: wrap; gap: var(--b3); margin-top: var(--b3); }
.pstats { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--b3); margin-bottom: var(--u4); }
.pstats > div {
  display: flex; align-items: baseline; justify-content: center; gap: var(--b3); padding: var(--b1) var(--b3) var(--b2); white-space: nowrap;
  border: var(--b3) solid transparent; border-image: url(assets/ui/slot.png) 3 fill / var(--b3);
}
.pstats b { color: var(--gold); }
.pstats span { color: var(--ink-dim); }

/* Wall of Fame: one supporter per row, name in gold */
.fame-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--u8);
  padding: var(--b3) var(--b3) var(--u4); border-bottom: var(--px) dashed #2e4945; }
.fame-row .who { color: var(--gold); }
.fame-row .muted { text-align: right; }

/* fish lists (records, selling, your bucket, the campfire): one fish per row */
table.rec { width: 100%; border-collapse: collapse; }
table.rec td {
  height: calc(var(--px) * 28); padding: 0 var(--b3) var(--b1);
  border-bottom: var(--px) dashed #2e4945; vertical-align: middle; white-space: nowrap;
}
table.rec td.n { color: var(--ink-dim); width: calc(var(--px) * 20); text-align: right; padding-right: var(--u4); }
table.rec td.ic { width: calc(var(--px) * 40); padding-top: var(--b1); }
table.rec td.ic .fish-icon { display: block; }
table.rec td.nm { width: 100%; white-space: normal; }
table.rec td.len { text-align: right; padding-right: var(--u8); }
table.rec td.ex { min-width: calc(var(--px) * 80); }
table.rec td.ex > .pr, table.rec td.ex > .price { display: flex; align-items: center; gap: var(--b2); }
table.rec td.act { text-align: right; padding-right: 0; }
table.rec td.act .btn { height: calc(var(--px) * 21); }

@media (max-width: 560px) {
  #hud-left { max-width: calc(100vw - 24px); top: 62px; }
  #hud { top: 10px; }
  #reel { left: auto; right: 14px; }
  #prompt { bottom: 132px; }
  #event-banner { top: 112px; white-space: normal; text-align: center; }
  #toasts { bottom: 186px; }
  .toast { white-space: normal; max-width: calc(100vw - 24px); }
  .row { grid-template-columns: auto 1fr; }
  .row .acts { grid-column: 1 / -1; }
  .detail { grid-template-columns: calc(var(--px) * 36) 1fr; gap: var(--u4); padding: var(--b3) var(--u4); }
  .card { padding: var(--u6) var(--u6) var(--u4); }
  .creator { flex-direction: column; align-items: center; gap: var(--u4); }
  #btn-join { padding: 0 var(--u4) var(--b1); }
  #slots { width: 100%; }
  #chat { bottom: 8px; left: 8px; width: calc(100vw - 130px); }
  .person { grid-template-columns: auto 1fr; }
  .person .acts { grid-column: 2; justify-content: flex-start; }
  .pstats > div { flex-direction: column; align-items: center; gap: 0; }
}
