:root {
  color-scheme: dark;
  --ink: #131e2d;
  --plum: #221824;
  --paper: #eee0be;
  --sea: #9fd3ca;
  --warm: #f7cf86;
  --cream: #fff2c4;
  --amber: #e1a348;
  --coral: #de6d58;
  --text: #f3f2e6;
  --muted: #b6d1cb;
  --nav-height: 54px;
  --safe-bottom: env(safe-area-inset-bottom,0px);
  --pad-left: max(14px,env(safe-area-inset-left,0px));
  --pad-right: max(14px,env(safe-area-inset-right,0px));
  --pad-top: calc(env(safe-area-inset-top,0px) + 12px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  color: var(--text);
  background: #15233c;
  font: 14px/1.45 "Microsoft YaHei","PingFang SC",system-ui,sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; border-radius: 10px; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: .06em; color: var(--cream); text-shadow: 0 2px 0 var(--plum); }
h3 { font-size: 15px; font-weight: 700; letter-spacing: .03em; }

/* Cozy Rounded 28x28 (slice=10) Pixel-Art 9-Slice Surfaces */
.px-slate, .gear-chip, .auto-skill-btn {
  border-style: solid;
  border-width: 3px;
  border-image-source: url("assets/ui-slate.png");
  border-image-slice: 10 fill;
  border-image-width: 11px;
  border-image-repeat: stretch;
  background: transparent;
  image-rendering: pixelated;
}
.tools-sheet, dialog, .mobile-dock, .tackle-popover {
  border-style: solid;
  border-width: 4px;
  border-image-source: url("assets/ui-wood.png");
  border-image-slice: 10 fill;
  border-image-width: 13px;
  border-image-repeat: stretch;
  background: transparent;
  image-rendering: pixelated;
}
.water-cue {
  border-style: solid;
  border-width: 3px;
  border-image-source: url("assets/ui-signal.png");
  border-image-slice: 10 fill;
  border-image-width: 12px;
  border-image-repeat: stretch;
  background: transparent;
  image-rendering: pixelated;
}
.rough-card {
  border-style: solid;
  border-width: 4px;
  border-image-source: url("assets/ui-card.png");
  border-image-slice: 10 fill;
  border-image-width: 12px;
  border-image-repeat: stretch;
  background: transparent;
  image-rendering: pixelated;
}

/* Plush Rounded Pixel Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 6px 16px 8px; line-height: 1.2;
  color: var(--text); font-weight: 600; letter-spacing: .04em;
  text-shadow: 0 1px 0 #101b2e;
  border-style: solid; border-width: 3px;
  border-image-source: url("assets/ui-btn-sea.png");
  border-image-slice: 10 fill; border-image-width: 12px; border-image-repeat: stretch;
  background: transparent; image-rendering: pixelated;
  transition: transform 80ms ease-out, filter 100ms linear;
}
.button.primary {
  color: #26181f; font-weight: 800; letter-spacing: .06em;
  text-shadow: 0 1px 0 #fff2c4aa;
  border-image-source: url("assets/ui-btn-warm.png");
}
button:not(:disabled):hover, .button:not(:disabled):hover { filter: brightness(1.08); }
.button:not(:disabled):active, .gear-chip:not(:disabled):active { transform: translateY(1.5px); }
.button:disabled { opacity: .50; filter: saturate(.65); }
.button.small { min-height: 36px; font-size: 12.5px; padding: 4px 12px 6px; border-image-width: 10px; }
.button.wide { width: 100%; }
.button.square { width: 40px; height: 40px; min-height: 40px; padding: 0; border-image-width: 10px; }

.button.bite-pulse {
  animation: bitePulse 680ms ease-in-out infinite;
}
@keyframes bitePulse {
  0%, 100% { filter: brightness(1.03) drop-shadow(0 0 2px rgba(247,207,134,0.25)); }
  50% { filter: brightness(1.18) drop-shadow(0 0 10px rgba(247,207,134,0.82)); }
}

/* Bespoke Pixel Icons (HUD, Nav, Fish, Baits, Rods, Harbor Gear/Tech) */
.hud-icon, .mobile-nav-icon, .fish-icon, .bait-icon, .rod-icon, .gear-icon, .gear-up-icon {
  display: inline-block; flex: none;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.hud-icon {
  width: 18px; height: 18px;
  background: url("assets/hud-icons.png") no-repeat;
  background-size: 144px 18px;
}
.coin-ico { background-position: 0 0; }
.book-ico { background-position: -18px 0; }
.expand-ico { background-position: -36px 0; }
.bait-ico { background-position: -54px 0; }
.depth-ico { background-position: -72px 0; }
.caret-ico { width: 12px; height: 12px; background-size: 96px 12px; background-position: -60px 0; pointer-events: none; opacity: .9; transition: transform 140ms ease; }
.sound-ico { background-position: -108px 0; }
.mute-ico { background-position: -126px 0; }

/* 8 Bespoke Bait & Lure Icons (baits-icons.png: 160x20 = 8 x 20x20) */
.bait-icon {
  width: 28px; height: 28px;
  background: url("assets/baits-icons.png") no-repeat;
  background-size: 224px 28px;
  background-position: calc(var(--bait-i,0) * -28px) 0;
}
.bait-icon.sm {
  width: 20px; height: 20px;
  background-size: 160px 20px;
  background-position: calc(var(--bait-i,0) * -20px) 0;
}
.bait-icon.mini {
  width: 16px; height: 16px;
  background-size: 128px 16px;
  background-position: calc(var(--bait-i,0) * -16px) 0;
  vertical-align: -3px;
}

/* 3x3 Bespoke Tiered Rod Icons (rods-icons.png: 96x72 = 3 classes x 3 visual levels) */
.rod-icon {
  width: 32px; height: 24px;
  background: url("assets/rods-icons.png") no-repeat;
  background-size: 96px 72px;
  background-position: calc(var(--rod-i,0) * -32px) calc(var(--rod-lv,0) * -24px);
}
.rod-icon.lg {
  width: 48px; height: 36px;
  background-size: 144px 108px;
  background-position: calc(var(--rod-i,0) * -48px) calc(var(--rod-lv,0) * -36px);
}
.rod-icon.mini {
  width: 20px; height: 15px;
  background-size: 60px 45px;
  background-position: calc(var(--rod-i,0) * -20px) calc(var(--rod-lv,0) * -15px);
}

/* 7 Bespoke Harbor Gear & Auto-Skill Device Models (gear-icons.png: 168x24 = 7 x 24x24) */
.gear-icon {
  width: 36px; height: 36px;
  background: url("assets/gear-icons.png") no-repeat;
  background-size: 252px 36px;
  background-position: calc(var(--gear-i,0) * -36px) 0;
}
.gear-icon.sm {
  width: 24px; height: 24px;
  background-size: 168px 24px;
  background-position: calc(var(--gear-i,0) * -24px) 0;
}
.gear-icon.mini {
  width: 18px; height: 18px;
  background-size: 126px 18px;
  background-position: calc(var(--gear-i,0) * -18px) 0;
}
.gear-up-icon {
  --gear-up-img: url("assets/gear-upgrades.png");
  width: 32px; height: 32px;
  background: var(--gear-up-img) no-repeat;
  background-size: 256px 32px;
  background-position: calc(var(--gear-up-i, 0) * -32px) 0;
}
.gear-up-icon.sm {
  width: 22px; height: 22px;
  background-size: 176px 22px;
  background-position: calc(var(--gear-up-i, 0) * -22px) 0;
}
.gear-up-icon.mini {
  width: 16px; height: 16px;
  background-size: 128px 16px;
  background-position: calc(var(--gear-up-i, 0) * -16px) 0;
}

/* Full-Bleed Interactive Pixel Canvas */
.harbor, .shore-view { position: fixed; inset: 0; }
.shore-view { background: #15233c; overflow: hidden; }
body[data-screen="water"] .shore-view { cursor: pointer; }
.shore-view img, .shore-view canvas {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%; image-rendering: pixelated; image-rendering: crisp-edges;
}
.shore-view canvas { pointer-events: none; }

/* Airy Unified Top HUD */
.harbor-hud {
  position: absolute; z-index: 3; top: var(--pad-top); left: var(--pad-left); right: var(--pad-right);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  pointer-events: none;
}
.harbor-hud > * { pointer-events: auto; }
.status-pill, .hud-actions, .tackle-controls, .cast-actions, .mobile-dock,
.auto-skill-btn, .chapter-pill, .bay-badges > *, .tackle-popover, .tools-sheet,
.sanctuary-view { pointer-events: auto; }
.place {
  display: grid; justify-items: start; align-content: center; gap: 1px;
  min-height: 46px; padding: 5px 13px; text-align: left; color: var(--text);
}
.place strong { font-size: 15px; letter-spacing: .08em; color: var(--cream); text-shadow: 0 2px 0 var(--ink); }
.place span { font-size: 11px; color: var(--sea); white-space: nowrap; }

.hud-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: nowrap; }
.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 5px 14px; white-space: nowrap;
}
.tide { display: grid; align-content: center; gap: 1px; }
.tide span { color: var(--muted); font-size: 10px; line-height: 1.2; }
.tide strong { font-weight: 700; font-size: 12px; color: var(--cream); text-shadow: 0 1px 0 var(--ink); }
.hud-sep { width: 2px; height: 20px; border-radius: 2px; background: #3f5f78; box-shadow: 1px 0 0 #101b2e; flex: none; }
.hud-wallet { display: flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.hud-wallet b { color: var(--warm); font-size: 15px; text-shadow: 0 2px 0 var(--plum); }

.hud-actions { display: flex; align-items: center; gap: 6px; }
.hud-actions .button.square { position: relative; }
.btn-dot {
  position: absolute; top: 2px; right: 2px;
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--warm); border: 1px solid var(--plum);
  box-shadow: 0 0 6px var(--warm);
}
#mobileTideButton { white-space: nowrap; min-height: 40px; font-size: 12px; padding: 5px 13px 6px; border-image-width: 10px; }
/* On-Map Clickable Timed Bait Foraging Layer */
.forage-layer {
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none; overflow: hidden;
}
body:not([data-screen="water"]) .forage-layer { opacity: 0; pointer-events: none; }
.forage-node {
  position: absolute; pointer-events: auto;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 5px 3px; border: 0; background: transparent;
  cursor: pointer; z-index: 2;
  animation: forageSpawn 260ms cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes forageSpawn {
  from { opacity: 0; transform: translate(-50%, -35%) scale(0.55); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.forage-orb {
  position: relative;
  width: 34px; height: 34px; border-radius: 999px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(28, 66, 86, 0.88), rgba(15, 31, 48, 0.72));
  border: 2px solid #8ad2c8cc;
  box-shadow: 0 2px 0 rgba(16, 28, 44, 0.75), 0 0 10px rgba(159, 211, 202, 0.36);
  animation: forageBob 2.1s ease-in-out infinite;
  transition: transform 90ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.forage-node.rare-bait .forage-orb {
  border-color: #f7cf86e0;
  background: radial-gradient(circle at 50% 45%, rgba(74, 48, 42, 0.90), rgba(20, 31, 48, 0.78));
  box-shadow: 0 2px 0 rgba(16, 28, 44, 0.75), 0 0 12px rgba(247, 207, 134, 0.48);
}
.forage-node:hover .forage-orb { transform: scale(1.1); border-color: var(--cream); }
.forage-node:active .forage-orb { transform: scale(0.94); }
.forage-node.auto-clicking .forage-orb {
  border-color: var(--cream);
  box-shadow: 0 0 0 4px rgba(247, 207, 134, 0.52), 0 0 18px rgba(255, 242, 196, 0.85);
  transform: scale(1.18);
}
@keyframes forageBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2.5px); }
}
.forage-tag {
  padding: 0 5px; border-radius: 999px;
  background: rgba(14, 27, 42, 0.88); border: 1px solid #59859eaa;
  color: var(--cream); font-size: 9.5px; font-weight: 700; line-height: 1.45;
  white-space: nowrap; text-shadow: 0 1px 0 var(--ink);
}
.forage-node.rare-bait .forage-tag { border-color: #f7cf86b0; color: var(--warm); }
.forage-pop {
  position: absolute; pointer-events: none; z-index: 4;
  transform: translate(-50%, -50%);
  padding: 2px 8px; border-radius: 999px;
  background: #173b46ea; border: 1.5px solid #9fd3ca;
  color: var(--cream); font-size: 11px; font-weight: 800; white-space: nowrap;
  text-shadow: 0 1px 0 var(--ink);
  animation: forageRise 950ms ease-out forwards;
}
.forage-pop.auto { background: #4d3028ee; border-color: #f7cf86; color: var(--cream); }
@keyframes forageRise {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.82); }
  18% { opacity: 1; transform: translate(-50%, -75%) scale(1.04); }
  100% { opacity: 0; transform: translate(-50%, -210%) scale(0.96); }
}

/* Active Skill Button on the Bay Stage */
.auto-skill-btn {
  position: absolute; z-index: 3; right: var(--pad-right); top: calc(var(--pad-top) + 54px);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px 5px 8px; color: var(--text); text-align: left;
  background: rgba(15, 29, 46, 0.62); border-radius: 12px;
  transition: transform 80ms ease, filter 120ms linear;
}
.auto-skill-btn.active {
  filter: brightness(1.12) drop-shadow(0 0 8px rgba(247,207,134,0.52));
}
.auto-skill-btn:active { transform: translateY(1px); }
body:not([data-screen="water"]) .auto-skill-btn { opacity: 0; pointer-events: none; }
.skill-stack { display: flex; flex-direction: column; line-height: 1.18; }
.skill-stack strong { font-size: 11.5px; color: var(--cream); text-shadow: 0 1px 0 var(--ink); }
.skill-stack span { font-size: 9.5px; color: var(--sea); }
.auto-skill-btn.active .skill-stack strong { color: var(--warm); }
.auto-skill-btn.active .skill-stack span { color: var(--cream); }

/* Skill Control Card integrated inside 科技 drawer */
.skill-control-box {
  padding: 10px 11px; margin-bottom: 12px; border-radius: 12px;
  background: #14273c; border: 2px solid #59859e;
  box-shadow: inset 0 2px 0 #0e1a2b;
}
.skill-control-box.active {
  border-color: var(--warm); background: #1d3245;
  box-shadow: inset 0 0 0 1px #f7cf8644;
}
.skill-box-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.skill-box-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.skill-box-title h3 { font-size: 13.5px; color: var(--cream); }

/* Compact Chapter Goal Pill & Living Bay Status Rail (Upper-Left Sky) */
.bay-rail {
  position: absolute; z-index: 3; left: var(--pad-left); top: calc(var(--pad-top) + 54px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  pointer-events: none;
}
body:not([data-screen="water"]) .bay-rail { opacity: 0; pointer-events: none; }
.chapter-pill {
  pointer-events: auto;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  max-width: 210px; padding: 4px 11px 5px; text-align: left; color: var(--text);
  background: rgba(15, 29, 46, 0.54); border-radius: 11px;
  transition: filter 100ms linear, transform 80ms ease;
}
.chapter-pill.ready {
  filter: brightness(1.12) drop-shadow(0 0 8px rgba(247,207,134,0.55));
}
.ch-tag { font-size: 9.5px; font-weight: 700; color: var(--warm); letter-spacing: .05em; line-height: 1.2; }
.chapter-pill strong { font-size: 11.5px; color: var(--cream); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bay-badges { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.bay-badge {
  padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .04em;
  background: #13283ed0; border: 1px solid #59859e; color: var(--sea);
  text-shadow: 0 1px 0 var(--ink);
}
.bay-badge.surge { background: #1e4b4ed8; border-color: #82d3c8; color: var(--cream); }
.bay-badge.streak { background: #5a3228d8; border-color: #f7cf86; color: var(--cream); }
.bay-badge.chum { background: #264638e8; border-color: #9fca89; color: #e3f1cf; }

/* Unified Cozy Lantern Bite Cue */
.water-cue {
  position: absolute; z-index: 2; right: var(--pad-right); top: 29%;
  display: flex; flex-direction: column; gap: 1px; align-items: flex-end;
  padding: 6px 14px 7px; pointer-events: none;
  transition: opacity 120ms linear, transform 140ms ease;
}
.water-cue.biting {
  filter: drop-shadow(0 0 8px rgba(247,207,134,0.45));
  transform: translateY(-2px);
}
body:not([data-screen="water"]) .water-cue { opacity: 0; }
.cue-place { color: var(--sea); font-size: 10px; font-weight: 600; letter-spacing: .05em; text-shadow: 0 1px 0 var(--plum); }
#signalLabel {
  color: var(--cream); font-size: 14px; font-weight: 800;
  letter-spacing: .08em; text-shadow: 0 2px 0 var(--plum);
}

/* Floating Visual Tackle Popovers (Bait Tray & Rod Rack) */
.popover-shade {
  position: absolute; z-index: 4; inset: 0; border: 0; padding: 0;
  background: #0b16264a; cursor: default;
}
.tackle-popover {
  position: absolute; z-index: 6;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 128px);
  width: min(440px, calc(100% - var(--pad-left) - var(--pad-right)));
  max-height: min(62dvh, 450px);
  overflow: auto;
  padding: 10px 12px 12px;
  animation: popRise 140ms ease-out;
}
body.popover-open .cast-hint { opacity: 0; pointer-events: none; }
@keyframes popRise {
  from { opacity: 0; transform: translate(-50%, 8px) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.popover-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 0 2px 8px; margin-bottom: 8px; border-bottom: 1px solid #594142;
}
.popover-head strong { color: var(--cream); font-size: 14px; letter-spacing: .05em; text-shadow: 0 1px 0 var(--plum); }
.popover-head span { color: var(--muted); font-size: 11px; }

/* 8-Bait/Lure Visual Tray Grid (Balanced 4x2) */
.bait-tray-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px;
}
.bait-chum-action { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.bait-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 7px 3px 6px; border-radius: 12px;
  background: #14253a; border: 2px solid #2e4b61;
  color: var(--text); text-align: center;
  box-shadow: inset 0 2px 0 #0e1a2b;
  transition: transform 80ms ease, border-color 120ms ease, background 120ms ease;
}
.bait-tile:hover:not(:disabled) { border-color: #66b0aa; background: #1a314a; }
.bait-tile:active { transform: translateY(1px); }
.bait-tile.active {
  border-color: var(--warm); background: #22354a;
  box-shadow: inset 0 0 0 1px #f7cf8655, 0 0 10px #f7cf8622;
}
.bait-tile.empty { opacity: .68; }
.bait-tile.incompat {
  opacity: .44; border-style: dashed; border-color: #334a5e; background: #0f1c2c;
}
.bait-tile.incompat .bait-icon { filter: saturate(0.35); }
.bait-tile b { font-size: 11px; color: var(--cream); line-height: 1.2; white-space: nowrap; }
.bait-tile small { font-size: 10px; color: var(--sea); font-variant-numeric: tabular-nums; line-height: 1.15; }
.bait-tile.empty small { color: #de8a7a; }
.bait-tile.incompat small { color: #8da6b4; font-size: 9.5px; }
.bait-star {
  position: absolute; top: 3px; right: 4px;
  font-size: 9px; line-height: 1; padding: 1px 4px; border-radius: 999px;
  background: #5b3233; border: 1px solid #f7cf8699; color: var(--cream); font-weight: 700;
}
.bait-excl {
  position: absolute; top: 3px; left: 4px;
  font-size: 8.5px; line-height: 1; padding: 1.5px 4px; border-radius: 999px;
  background: #1e4d55; border: 1px solid #66b0aa99; color: var(--cream); font-weight: 700;
}

/* 3-Rod Visual Rack Cards (Popover + Tech Workshop) */
.rod-rack-list { display: grid; gap: 6px; }
.rod-card {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 12px;
  background: #14253a; border: 2px solid #2e4b61;
  box-shadow: inset 0 2px 0 #0e1a2b;
}
.rod-card.active {
  border-color: var(--warm); background: #1e3348;
  box-shadow: inset 0 0 0 1px #f7cf8650;
}
.rod-card.locked { border-style: dashed; border-color: #3d576e; background: #111f31; }
.rod-card.locked .rod-icon { filter: saturate(0.45) brightness(0.8); }
.rod-art {
  width: 54px; height: 44px; flex: none;
  display: grid; place-items: center; border-radius: 10px;
  background: #0e1a2b; border: 1.5px solid #2c475c;
  position: relative;
}
.rod-art.lv2 {
  background: radial-gradient(circle at 50% 45%, #1c3f52, #0d1b2c);
  border-color: #66b0aa;
  box-shadow: inset 0 0 8px rgba(159,211,202,0.22);
}
.rod-art.lv3 {
  background: radial-gradient(circle at 50% 45%, #4a2e2c, #141d2e);
  border-color: #f7cf86;
  box-shadow: inset 0 0 10px rgba(247,207,134,0.32), 0 0 8px rgba(247,207,134,0.2);
}
.rod-art.lv4 {
  background: radial-gradient(circle at 50% 45%, #66502d, #1e2634);
  border-color: #f3c96d;
  box-shadow: inset 0 0 10px #ffc76e45;
}
.rod-art.lv5 {
  background: radial-gradient(circle at 50% 45%, #464a81, #1a243f);
  border-color: #b9d9ff;
  box-shadow: inset 0 0 10px #b9d9ff55;
}
.rod-look-note { font-size: 10px; color: #f3d1a2; margin-top: 1px; line-height: 1.2; }
.rod-info { flex: 1; min-width: 0; }
.rod-title-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rod-title-row b { color: var(--cream); font-size: 13.5px; }
.depth-pill {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  background: #1d3c52; border: 1px solid #4c7c92; color: var(--sea);
}
.depth-pill.match { background: #215757; border-color: #79cbc1; color: var(--cream); }
.cat-pill {
  display: inline-block; padding: 1px 6px; border-radius: 999px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .03em;
  background: #3a2b36; border: 1px solid #b8815699; color: var(--warm);
}
.rod-desc { font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.25; }
.rod-baits { font-size: 10px; color: var(--cream); opacity: .9; margin-top: 1px; line-height: 1.22; }
.rod-rares { font-size: 10px; color: var(--sea); margin-top: 1px; line-height: 1.22; }
.rod-req { font-size: 10px; color: var(--warm); margin-top: 1px; line-height: 1.22; }
.rod-action { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rod-lv-pill {
  display: inline-block; padding: 1px 6px; border-radius: 999px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .03em;
  background: #1e3b4e; border: 1px solid #66b0aa; color: var(--cream);
}
.rod-lv-pill.max { background: #5c3234; border-color: #f7cf86; color: var(--warm); }
.rod-lv-pill.lv4 { background: #533d22; border-color: #f3c96d; color: #ffe2a0; }
.rod-lv-pill.lv5 { background: #323e6a; border-color: #b9d9ff; color: #e3edff; }
.rod-chip-depth.lv4 { color: #ffe2a0; }
.rod-chip-depth.lv5 { color: #e3edff; }
.rod-loan-pill {
  display: inline-block; padding: 0 4px; border-radius: 999px;
  border: 1px solid #66b0aa80; color: var(--sea); background: #1e3b4e;
  font-size: 9px; line-height: 1.4; white-space: nowrap;
}
.rod-equipped-badge {
  display: inline-block; padding: 4px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; color: var(--cream);
  background: #3d5044; border: 1.5px solid #f7cf8690;
}
.button.mini-up { min-height: 30px; font-size: 11px; padding: 3px 9px 4px; border-image-width: 8px; }

/* Spacious, Grid-Aligned Bottom Helm */
.helms {
  position: absolute; z-index: 5; bottom: calc(var(--nav-height) + var(--safe-bottom) + 18px);
  width: min(740px,calc(100% - var(--pad-left) - var(--pad-right)));
  left: 50%; transform: translateX(-50%);
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; align-items: end;
}
.cast-hint {
  grid-column: 1 / -1; justify-self: center; width: fit-content; max-width: 100%;
  padding: 5px 15px; text-align: center; color: #f4f2e6;
  background: #101e31ad; border: 1px solid #597a9470; border-radius: 999px;
  text-shadow: 0 1px 1px #0d1624; font-size: 12px; letter-spacing: .02em;
}
.tackle-controls, .cast-actions { display: grid; grid-auto-columns: minmax(0,1fr); grid-auto-flow: column; gap: 8px; min-width: 0; }
.gear-chip {
  position: relative;
  display: flex; min-width: 0; gap: 7px; align-items: center; text-align: left;
  min-height: 48px; padding: 4px 11px 5px 9px; white-space: nowrap; color: var(--text);
  background: rgba(14, 28, 45, 0.56); border-radius: 12px;
  transition: transform 80ms ease, filter 100ms linear;
}
.gear-chip[aria-expanded="true"] { filter: brightness(1.14); }
.gear-chip[aria-expanded="true"] .caret-ico { transform: rotate(180deg); }
.gear-chip:disabled { opacity: .86; filter: saturate(.72); }
.gear-stack { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.18; overflow: hidden; }
.gear-label { color: var(--sea); font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.gear-value {
  color: var(--cream); font-size: 13.5px; font-weight: 700;
  text-shadow: 0 1px 0 var(--ink); overflow: hidden; text-overflow: ellipsis;
}
.chip-dot {
  position: absolute; top: 4px; right: 5px;
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--warm); border: 1px solid var(--plum);
  box-shadow: 0 0 6px var(--warm);
}
.cast-actions .button { min-height: 48px; font-size: 15px; white-space: nowrap; }
.cast-actions .cast { max-width: 240px; justify-self: center; width: 100%; }

/* Soft Rounded Carved-Timber Bottom Dock (4 Clean Tabs: 渔讯 · 鱼篓 · 养鱼 · 科技) */
.mobile-dock {
  position: absolute; z-index: 7; bottom: calc(var(--safe-bottom) + 8px); left: 50%; transform: translateX(-50%);
  width: min(392px,calc(100% - var(--pad-left) - var(--pad-right)));
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); align-items: center;
  padding: 3px 5px;
}
.mobile-dock button {
  display: flex; flex-direction: row; min-height: 36px; justify-content: center; align-items: center;
  gap: 5px; width: 100%; min-width: 0; border: 0; background: transparent; position: relative;
  border-radius: 9px; color: #cfe0d8; white-space: nowrap; letter-spacing: .05em; font-size: 12px; font-weight: 600; padding: 3px 4px;
  text-shadow: 0 1px 0 var(--plum);
}
.mobile-dock button[aria-current="page"] {
  background: #2c5266cc; color: var(--cream);
  box-shadow: inset 0 0 0 1px #f7cf8670;
}
.mobile-dock button:disabled { opacity: .5; }
.mobile-dock b {
  position: absolute; right: 5px; top: 1px; padding: 0 5px; border-radius: 999px;
  background: #b64040; border: 1px solid var(--cream); color: var(--cream); font-size: 10px; line-height: 1.35;
}
.mobile-dock b.badge-sea { background: #266b73; border-color: #9fd3ca; }
.mobile-dock i {
  position: absolute; width: 7px; height: 7px; top: 4px; right: 7px; border-radius: 999px;
  background: var(--warm); border: 1px solid var(--plum);
}
.mobile-nav-icon {
  width: 18px; height: 18px;
  background: url("assets/mobile-nav.png") no-repeat;
  background-size: 90px 18px;
  background-position: calc(var(--tab-icon,0) * -18px) 0;
}

/* Tool Drawer Sheet — Soft Rounded Harbor Logbook */
.sheet-shade {
  position: absolute; z-index: 6; inset: 0; width: 100%; height: 100%; padding: 0; border: 0;
  background: #0b16267a; cursor: default;
}
.tools-sheet {
  position: absolute; z-index: 7; right: var(--pad-right); bottom: calc(var(--safe-bottom) + var(--nav-height) + 14px);
  width: min(392px,calc(100% - var(--pad-left) - var(--pad-right)));
  max-height: min(68dvh,620px);
  display: flex; flex-direction: column; padding: 10px 12px;
}
.sheet-top {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 4px 10px; border-bottom: 1px solid #594142;
}
.sheet-scroll { overflow: auto; overscroll-behavior: contain; padding: 12px 4px 6px; }
.sheet-subhead { color: var(--warm); font-size: 12px; font-weight: 700; letter-spacing: .06em; margin-bottom: 8px; }
.sheet-subhead.spaced { margin-top: 14px; padding-top: 10px; border-top: 1px dashed #3d5970; }

.route-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.eyebrow { color: var(--warm); font-size: 11px; letter-spacing: .06em; }
.route-description { color: var(--muted); margin-top: 8px; font-size: 13px; line-height: 1.5; }
.route-fish { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.fish-preview, .fish-row {
  display: flex; align-items: center; gap: 8px; border-radius: 10px;
  background: #132234; border: 2px solid #2e4b61; padding: 6px 9px; min-width: 0;
  box-shadow: inset 0 2px 0 #0e1928;
}
.fish-preview.rare, .fish-row.rare { border-color: #8b5c45; background: #1d2233; }
.fish-preview small { display: block; color: var(--muted); font-size: 10px; }
.fish-preview b { font-size: 12px; white-space: nowrap; color: var(--text); }
.fish-preview.rare b, .fish-row.rare strong { color: var(--warm); }
.fish-icon {
  width: 40px; height: 28px;
  background: url("assets/fish-icons.png") no-repeat;
  background-size: 400px 56px;
  background-position: calc(var(--index,0) * -40px) calc(var(--rarity,0) * -28px);
}
.fish-icon.sm {
  width: 30px; height: 21px;
  background-size: 300px 42px;
  background-position: calc(var(--index,0) * -30px) calc(var(--rarity,0) * -21px);
}
.fish-icon.xs {
  width: 22px; height: 15px;
  background-size: 220px 30px;
  background-position: calc(var(--index,0) * -22px) calc(var(--rarity,0) * -15px);
}
.fish-icon.big {
  width: 80px; height: 56px; background-size: 800px 112px;
  background-position: calc(var(--index,0) * -80px) calc(var(--rarity,0) * -56px);
}
.fish-icon.hero {
  width: 120px; height: 84px; background-size: 1200px 168px;
  background-position: calc(var(--index,0) * -120px) calc(var(--rarity,0) * -84px);
}
.fish-icon.sz-small { transform: scale(0.86); }
.fish-icon.sz-normal { transform: scale(1.0); }
.fish-icon.sz-large { transform: scale(1.10); }
.fish-icon.sz-trophy { transform: scale(1.18); filter: drop-shadow(0 0 4px rgba(247,207,134,0.55)); }

/* Fish Size & Grade Pills */
.fish-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fish-row-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fish-row-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.size-cm { color: var(--cream); font-weight: 700; font-variant-numeric: tabular-nums; }
.size-tier {
  display: inline-block; padding: 1px 6px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; line-height: 1.3;
}
.tier-small  { background: #1d3247; border: 1px solid #496b85; color: #b6d1cb; }
.tier-normal { background: #1c4452; border: 1px solid #5a9da1; color: #d5ece0; }
.tier-large  { background: #4a3524; border: 1px solid #d79c4c; color: #f7cf86; }
.tier-trophy { background: #6b2e36; border: 1px solid #f7cf86; color: #fff2c4; box-shadow: 0 0 8px rgba(247,207,134,0.35); }
.record-pill {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: .04em;
  background: #e1a348; color: #221824; border: 1px solid #fff2c4;
}
.fish-preview .rec-note { display: block; color: var(--sea); font-size: 10px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  background: #1c344a; border: 1.5px solid #43667e; font-size: 11px; color: #c7dcd3; font-weight: 600;
}
.tag.match { background: #1f4f50; border-color: #6db8b2; color: var(--cream); }
.route-hint, .idle-brief, .minor, .idle-label, .empty-message, .save-area { color: var(--muted); font-size: 12px; }
.pack-action { margin-top: 12px; justify-content: space-between; }
.pack-action span { font-size: 12px; font-weight: 800; }
/* Harbor Fish Market (Hot Catch + 2 Dynamic Orders) */
.market-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 9px; margin-bottom: 8px; border-radius: 10px;
  background: #2b2232; border: 1.5px solid #b88156;
  font-size: 11.5px; color: var(--cream);
}
.market-bar b { color: var(--warm); }
.hot-pill {
  display: inline-block; padding: 1px 5px; border-radius: 999px;
  font-size: 9.5px; font-weight: 800; background: #b64040; color: var(--cream);
}
.orders-box { margin-bottom: 10px; padding-bottom: 9px; border-bottom: 1px dashed #3d5970; }
.task-orders-box { margin-bottom: 2px; padding: 9px 10px; border-radius: 12px; background: #122133; border: 1.5px solid #35556c; border-bottom: 1.5px solid #35556c; }
.orders-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 7px; }
.orders-head h3 { font-size: 13px; color: var(--cream); }
.orders-sub { font-size: 10.5px; color: var(--muted); }
.order-list { display: grid; gap: 7px; }
.order-card {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 11px;
  background: #132234; border: 2px solid #2e4b61;
  box-shadow: inset 0 2px 0 #0e1928;
}
.order-card.ready { border-color: var(--warm); background: #1d3142; box-shadow: inset 0 0 0 1px #f7cf8644; }
.order-fish-box {
  position: relative; width: 52px; height: 42px; flex: none;
  display: grid; place-items: center; border-radius: 9px;
  background: #0d1a2a; border: 1.5px solid #33546b;
}
.order-fish-box.rare {
  background: radial-gradient(circle at 50% 45%, #372a36, #101d2e);
  border-color: #d79c4c;
}
.order-qty-badge {
  position: absolute; right: -4px; bottom: -4px;
  padding: 0 5px; border-radius: 999px;
  font-size: 10px; font-weight: 800; line-height: 1.45;
  background: #23495d; border: 1.5px solid #9fd3ca; color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.order-card.ready .order-qty-badge { background: #b64040; border-color: var(--cream); }
.order-fish-tag {
  position: absolute; left: 2px; top: 2px;
  padding: 0 4px; border-radius: 5px;
  font-size: 8px; font-weight: 800; line-height: 1.35;
  background: #1b3b4ee6; color: var(--warm);
}
.order-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.order-info b { display: block; font-size: 12px; color: var(--cream); line-height: 1.25; }
.order-need-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 10.5px; color: var(--sea); }
.order-prog {
  display: inline-block; padding: 0 6px; border-radius: 999px;
  font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: #1a3246; border: 1px solid #436a82; color: var(--muted);
}
.order-prog.ok { background: #1e524e; border-color: #79cbc1; color: var(--cream); }
.order-reward-row {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  font-size: 10.5px; color: var(--warm);
}
.order-card .button { flex: none; min-height: 36px; font-size: 11.5px; padding: 4px 10px 5px; }
.basket-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.basket-head h3 { font-size: 13px; color: var(--cream); }

/* 3-Tab Handbook / Illustrated 12-Species Fish Atlas */
.seg-toggle.tri { grid-template-columns: repeat(3, 1fr); margin-bottom: 10px; }
.sub-panel { display: grid; gap: 8px; }
.chapter-card {
  padding: 10px 12px; border-radius: 12px;
  background: #14253a; border: 2px solid #486f86;
  box-shadow: inset 0 2px 0 #0e1a2b;
}
.chapter-card.ready { border-color: var(--warm); background: #1e3142; }
.chapter-card h3 { color: var(--cream); margin: 2px 0 4px; font-size: 15px; }
.chapter-card p { font-size: 12px; color: var(--muted); line-height: 1.45; }
.chapter-goals { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.chapter-goals li {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 5px 8px; border-radius: 8px; background: #0f1d2e; font-size: 11.5px; color: var(--muted);
}
.chapter-goal-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chapter-goals li.ok { color: var(--cream); background: #183a42; }
.chapter-reward { font-size: 11px; color: var(--warm); margin-bottom: 8px; }
.chapter-roadmap { display: grid; gap: 5px; }
.road-step {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 9px;
  background: #112031; border: 1.5px solid #294256; font-size: 11.5px; color: var(--muted);
}
.road-step.done { border-color: #4f8872; color: var(--sea); }
.road-step.now { border-color: var(--warm); color: var(--cream); background: #192d42; font-weight: 700; }
.road-num {
  width: 20px; height: 20px; border-radius: 999px; flex: none;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 800;
  background: #1c344a; color: var(--cream);
}
.road-step.done .road-num { background: #36725f; }
.road-step.now .road-num { background: #d49643; color: #221824; }

.atlas-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.atlas-head strong { font-size: 13px; color: var(--cream); }
.atlas-legend { font-size: 10px; color: var(--muted); }
.seg-toggle.compact { margin-bottom: 4px; }
.seg-toggle.compact .seg-btn { min-height: 30px; font-size: 11px; }
.milestone-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.milestone-row.quad { grid-template-columns: repeat(2, 1fr); gap: 5px; }
.mile-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 5px 4px; border-radius: 10px;
  background: #132234; border: 1.5px solid #35556c; color: var(--muted); font-size: 10.5px;
}
.mile-btn b { color: var(--cream); font-size: 11px; }
.mile-btn.ready { border-color: var(--warm); background: #4a3327; color: var(--cream); }
.mile-btn.claimed { border-color: #4f8872; background: #19383c; color: var(--sea); }
.atlas-list { display: grid; gap: 7px; }
.atlas-entry {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 8px 9px; border-radius: 11px;
  background: #132234; border: 2px solid #2e4b61;
  box-shadow: inset 0 2px 0 #0e1928;
}
.atlas-entry.rare { border-color: #8b5c45; background: #1b2234; }
.atlas-entry.unseen { opacity: .72; border-style: dashed; }
.atlas-specimen {
  position: relative; width: 58px; min-height: 50px; flex: none;
  display: grid; place-items: center; border-radius: 9px;
  background: #0d1a2a; border: 1.5px solid #2e4c63; padding: 4px;
}
.atlas-entry.rare .atlas-specimen {
  background: radial-gradient(circle at 50% 45%, #372a36, #0f1b2c);
  border-color: #d79c4c;
}
.atlas-entry.unseen .fish-icon { filter: brightness(0) opacity(0.45); }
.atlas-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.atlas-title-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.atlas-title-row b { font-size: 13px; color: var(--cream); }
.atlas-records {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 10.5px; color: var(--sea); font-variant-numeric: tabular-nums;
}
.atlas-rec-pill {
  padding: 1px 6px; border-radius: 999px;
  background: #162e42; border: 1px solid #3c657e; color: var(--cream); font-size: 10px;
}
.atlas-bio { font-size: 11px; color: var(--muted); line-height: 1.4; }
.atlas-crown {
  position: absolute; top: -5px; right: -4px;
  padding: 1px 5px; border-radius: 999px; font-size: 8.5px; font-weight: 800;
}
.crown-bronze { background: #4a352a; border: 1px solid #b88156; color: #f3d1a2; }
.crown-silver { background: #2d4658; border: 1px solid #9fd3ca; color: #d5ece0; }
.crown-gold   { background: #6b2e36; border: 1px solid #f7cf86; color: #fff2c4; }

/* Water Type, Tank Size & Specific-Fish Recipe Chips */
.water-pill {
  display: inline-block; padding: 1px 6px; border-radius: 999px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .03em; line-height: 1.3;
}
.water-pill.salt { background: #163d52; border: 1px solid #59a4b0; color: #c7ece5; }
.water-pill.fresh { background: #1e4234; border: 1px solid #6eb57c; color: #d9f2d4; }
.tank-sz {
  display: inline-block; padding: 1px 5px; border-radius: 999px;
  font-size: 9.5px; font-weight: 700; line-height: 1.3;
}
.tank-sz.sz-S { background: #1d3549; border: 1px solid #55849e; color: #b6d1cb; }
.tank-sz.sz-M { background: #1d444d; border: 1px solid #66b0aa; color: #d5ece0; }
.tank-sz.sz-L { background: #4a3625; border: 1px solid #e1a348; color: #f7cf86; }
.tank-sz.sz-XL { background: #612a36; border: 1px solid #f7cf86; color: #fff2c4; }

.req-fish-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.req-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px 1px 4px; border-radius: 999px;
  background: #102032; border: 1px solid #43647a;
  font-size: 10px; color: #cfe0d8; font-variant-numeric: tabular-nums;
}
.req-chip.ok { background: #173c3c; border-color: #6eb8a6; color: var(--cream); }
.req-chip.short { border-color: #a85f52; color: #f3c4b6; }
.fish-row-btns { display: flex; align-items: center; gap: 5px; flex: none; }
.fish-row-btns .button.small { padding: 4px 8px 5px; font-size: 11px; }

/* Saltwater Aquarium & Freshwater Pond Live Habitat Panel */
.habitat-stage {
  position: relative; margin: 9px 0 7px; border-radius: 12px; overflow: hidden;
  border: 2.5px solid #4e8ca1; background: #0f2438;
  box-shadow: inset 0 0 14px rgba(102,176,170,0.22);
}
.habitat-stage.fresh { border-color: #65a36e; background: #102926; box-shadow: inset 0 0 14px rgba(138,182,116,0.2); }
.habitat-stage canvas { display: block; width: 100%; height: auto; aspect-ratio: 320 / 148; image-rendering: pixelated; image-rendering: crisp-edges; }
.habitat-pill {
  position: absolute; top: 6px; padding: 2px 8px; border-radius: 999px;
  background: rgba(12, 24, 38, 0.82); border: 1px solid #59859eaa;
  color: var(--cream); font-size: 10px; font-weight: 700; pointer-events: none;
}
.habitat-pill.left { left: 7px; }
.habitat-pill.right { right: 7px; color: var(--warm); border-color: #e1a348aa; }
.habitat-meter { display: grid; gap: 4px; margin-bottom: 9px; }
.cap-bar-track { height: 8px; border-radius: 999px; background: #0e1c2c; border: 1px solid #35556c; overflow: hidden; }
.cap-bar-fill { height: 100%; background: linear-gradient(90deg, #469499, #9fd3ca); transition: width 180ms ease; }
.cap-bar-fill.full { background: linear-gradient(90deg, #d78a43, #de6d58); }
.size-rule-note { font-size: 9.5px; color: var(--muted); }
.habitat-income-row { font-size: 11px; color: var(--warm); font-weight: 600; }
.habitat-upgrade-box {
  padding: 8px 10px; margin-bottom: 10px; border-radius: 11px;
  background: #132539; border: 1.5px solid #3d627a;
}
.habitat-up-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.habitat-up-top b { font-size: 12px; color: var(--cream); }
.habitat-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.habitat-sec-head.spaced { margin-top: 12px; padding-top: 9px; border-top: 1px dashed #3d5970; }
.habitat-sec-head h3 { font-size: 13px; color: var(--cream); }
.habitat-list { display: grid; gap: 6px; }
.habitat-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 10px;
  background: #132234; border: 2px solid #2e4b61;
  box-shadow: inset 0 2px 0 #0e1928;
}
.habitat-row.blocked { opacity: .66; border-style: dashed; }
.habitat-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.habitat-row-top { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.habitat-row-top b { font-size: 12.5px; color: var(--cream); }
.habitat-row-meta { font-size: 10.5px; color: var(--muted); }
.habitat-row-meta.warn { color: #f0b19c; }

.fish-list { display: grid; gap: 7px; margin-bottom: 10px; }
.fish-row strong { flex: 1; font-size: 13px; }
.fish-row small { color: var(--muted); }

/* Visual Bait Shop Grid inside 鱼篓 */
.supply { margin-top: 14px; padding-top: 10px; border-top: 1px dashed #3d5970; }
.supply-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 8px; }
.supply h3 { font-size: 13px; color: var(--cream); }
.bait-craft, .condition-fuse {
  padding: 8px 9px;
  border: 1px solid #3f6076;
  border-radius: 10px;
  background: #132234;
}
.bait-craft h4 { margin: 0; color: var(--cream); font-size: 12px; }
.bait-craft-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px;
}
.craft-row { display: grid; gap: 4px; margin-top: 5px; }
.craft-label { color: var(--muted); font-size: 10px; }
.craft-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.craft-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px; border-radius: 6px; border: 1px solid #44687f;
  background: #0e1a29; color: var(--text); font: inherit; font-size: 11px; cursor: pointer;
}
.craft-pill.active {
  border-color: var(--gold); background: #22384c; color: var(--cream);
  box-shadow: 0 0 0 1px #e1a34855;
}
.condition-fuse {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px;
  margin-top: 7px; color: var(--cream); font-size: 11px; line-height: 1.45;
}
.condition-fuse > :first-child { flex: 1 1 180px; }

/* Segmented Pill Toggle (Replaces Native Select in Idle Panel) */
.seg-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 4px; border-radius: 12px;
  background: #112032; border: 2px solid #2e4b61;
}
.seg-btn {
  min-height: 36px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600;
  transition: background 120ms ease, color 120ms ease;
}
.seg-btn.active {
  background: #255066; color: var(--cream);
  box-shadow: inset 0 0 0 1px #f7cf8670;
}
.seg-btn:disabled { opacity: .45; }

.link-button { border: 0; background: none; color: var(--warm); font-size: 13px; display: inline-flex; align-items: center; min-height: 40px; padding: 2px 0; text-align: left; }
.link-button.compact { min-height: 28px; font-size: 12px; }
.link-button:disabled { opacity: .5; }
.link-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.empty-message p { margin: 6px 0 8px; }
.empty-message b { color: var(--cream); font-size: 14px; }
.device-list { display: grid; gap: 8px; }
.tech-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px; border-radius: 12px; border: 2px solid #35556c; background: #132234;
  box-shadow: inset 0 2px 0 #0e1928;
}
.tech-item.owned { border-color: #6ea89c; background: #172d3d; }
.device-art {
  width: 48px; height: 48px; flex: none;
  display: grid; place-items: center; border-radius: 10px;
  background: #0d1a2a; border: 1.5px solid #2e4b61;
}
.tech-item.owned .device-art {
  background: radial-gradient(circle at 50% 45%, #23495c, #0e1d2e);
  border-color: #f7cf86aa;
  box-shadow: inset 0 0 8px rgba(247,207,134,0.22);
}
.tech-item:not(.owned) :is(.gear-icon, .gear-up-icon) { filter: saturate(0.75); }
.device-body { flex: 1; min-width: 0; }
.device-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tech-item h3 { color: var(--cream); font-size: 14px; }
.tech-item p { margin: 3px 0 6px; font-size: 11.5px; color: var(--muted); line-height: 1.38; }
.tech-item .status-hint { display: block; color: var(--sea); font-size: 10.5px; margin-bottom: 6px; }
.tech-item .done {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: #234d4a; border: 1px solid #79cbc1; color: var(--cream); font-size: 10.5px; font-weight: 700;
}
.panel-footnote {
  margin-top: 12px; padding: 7px 10px; border-radius: 9px;
  background: #0f1d2e; border: 1px dashed #3a5a72;
  color: var(--muted); font-size: 11px; text-align: center;
}
.idle-rig-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.idle-rig-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px 3px 5px; border-radius: 999px;
  background: #14283c; border: 1.5px solid #59899e; color: var(--cream); font-size: 10.5px; font-weight: 600;
}
.idle-rig-pill.off { opacity: .45; border-style: dashed; color: var(--muted); }
.idle-label { display: block; margin-top: 8px; margin-bottom: 4px; color: var(--cream); }
.fallback { display: flex; gap: 7px; min-height: 40px; align-items: center; font-size: 12px; color: var(--muted); }
.fallback input { width: 18px; height: 18px; accent-color: var(--amber); }
.plan-summary { padding: 8px 11px; margin: 8px 0; border-radius: 10px; color: var(--cream); background: #132234; border: 2px solid #35556c; font-size: 12px; }
.idle-actions { display: flex; gap: 8px; }
.idle-actions button { flex: 1; }
.minor { margin-top: 5px; font-size: 11px; }
.report { padding: 8px 11px; border-radius: 10px; border: 2px solid #548c60; color: var(--cream); background: #1c4045; font-size: 12px; margin-bottom: 8px; }
.entries { padding: 0; margin: 0; list-style: none; color: var(--muted); }
.entries li { padding: 7px 2px; border-bottom: 1px dashed #3d5970; font-size: 12px; }
.entries li:first-child { color: var(--cream); }
.save-area { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; }

/* Cozy Pixel Catch Celebration Pop */
.catch-banner {
  position: absolute; z-index: 8; left: 50%; top: 24%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 6px 15px 7px;
  border-style: solid; border-width: 3px;
  border-image-source: url("assets/ui-signal.png"); border-image-slice: 10 fill; border-image-width: 12px;
  background: transparent; image-rendering: pixelated; pointer-events: none;
  animation: catchPop 220ms ease-out;
}
.catch-banner.common { border-image-source: url("assets/ui-slate.png"); }
.catch-banner strong { display: block; color: var(--cream); font-size: 14px; letter-spacing: .05em; text-shadow: 0 2px 0 var(--plum); }
.catch-banner small { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; color: var(--sea); font-size: 11px; margin-top: 2px; }
.catch-banner.rare small { color: var(--warm); }
@keyframes catchPop {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Rare Fish Acquisition Celebration Overlay */
.rare-showcase {
  position: absolute; z-index: 14; inset: 0;
  display: grid; place-items: center; padding: 18px;
  background: radial-gradient(circle at 50% 44%, rgba(34, 62, 88, 0.72), rgba(9, 17, 30, 0.84));
  animation: rareFade 180ms ease-out;
}
@keyframes rareFade { from { opacity: 0; } to { opacity: 1; } }
.rare-card {
  width: min(332px, calc(100% - 16px));
  padding: 16px 18px 18px;
  text-align: center;
  border-style: solid; border-width: 4px;
  border-image-source: url("assets/ui-wood.png"); border-image-slice: 10 fill; border-image-width: 14px;
  background: transparent; image-rendering: pixelated;
  filter: drop-shadow(0 0 28px rgba(247, 207, 134, 0.36));
  animation: rareCardPop 280ms cubic-bezier(.2, 1.24, .36, 1);
}
@keyframes rareCardPop {
  from { opacity: 0; transform: translateY(14px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.rare-kicker {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: #4e2b31; border: 1.5px solid #f7cf86;
  color: var(--cream); font-size: 11px; font-weight: 800; letter-spacing: .1em;
  text-shadow: 0 1px 0 var(--plum);
}
.rare-stage {
  position: relative; overflow: hidden;
  width: 176px; height: 126px; margin: 12px auto 10px;
  border-radius: 18px; border: 2px solid #f7cf86aa;
  background: radial-gradient(circle at 50% 50%, #244f66 0%, #132840 70%, #0d1d30 100%);
  display: grid; place-items: center;
  box-shadow: inset 0 0 18px rgba(247, 207, 134, 0.25), 0 0 18px rgba(247, 207, 134, 0.2);
}
.rare-rays {
  position: absolute; inset: -60px;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 242, 196, 0.24) 0deg 10deg,
    rgba(247, 207, 134, 0.0) 10deg 30deg
  );
  animation: spinRays 14s linear infinite;
}
@keyframes spinRays { to { transform: rotate(360deg); } }
.rare-stage .fish-icon.hero {
  position: relative; z-index: 2;
  filter: drop-shadow(0 4px 0 rgba(16, 28, 44, 0.72)) drop-shadow(0 0 12px rgba(255, 242, 196, 0.45));
  animation: rareFishBob 2.1s ease-in-out infinite;
}
@keyframes rareFishBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.rare-sparkles { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.rare-sparkles .sp {
  position: absolute; display: block; width: 4px; height: 4px;
  background: var(--cream); box-shadow: 0 -4px 0 var(--warm), 0 4px 0 var(--warm), -4px 0 0 var(--warm), 4px 0 0 var(--warm);
  animation: twinkle 1.1s steps(2) infinite;
}
.rare-sparkles .s1 { top: 18px; left: 22px; animation-delay: 0ms; }
.rare-sparkles .s2 { top: 16px; right: 26px; animation-delay: 280ms; }
.rare-sparkles .s3 { bottom: 20px; left: 28px; animation-delay: 520ms; }
.rare-sparkles .s4 { bottom: 18px; right: 22px; animation-delay: 160ms; }
.rare-sparkles .s5 { top: 58px; left: 12px; width: 3px; height: 3px; background: var(--sea); box-shadow: none; animation-delay: 420ms; }
.rare-sparkles .s6 { top: 52px; right: 14px; width: 3px; height: 3px; background: var(--warm); box-shadow: none; animation-delay: 680ms; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.rare-card h2 { font-size: 21px; letter-spacing: .1em; color: var(--cream); margin-top: 2px; }
.rare-metrics {
  display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap;
  margin: 7px 0 6px;
}
.rare-metrics .size-cm { font-size: 16px; color: var(--warm); }
.rare-sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }

/* Overlays, Toasts & Soft Parchment Cards */
.toast {
  position: absolute; z-index: 12; left: 50%; bottom: calc(var(--nav-height) + var(--safe-bottom) + 160px);
  transform: translateX(-50%); max-width: calc(100% - 28px); width: max-content;
  padding: 6px 16px; color: var(--cream); font-size: 12px; font-weight: 600;
  border-style: solid; border-width: 3px;
  border-image-source: url("assets/ui-signal.png"); border-image-slice: 10 fill; border-image-width: 11px;
  background: transparent; image-rendering: pixelated; pointer-events: none;
}
body:not([data-screen="water"]) .toast { top: calc(var(--pad-top) + 58px); bottom: auto; }
.toast.error { color: #ffd4c4; }
dialog {
  color: var(--text); padding: 14px 16px;
  max-height: calc(100dvh - 24px); width: min(740px,calc(100% - 24px)); overflow: auto;
}
dialog::backdrop { background: #0a1424a6; }
.dialog-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #594142; }
.dialog-top p, .reset-dialog p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.cards-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.rough-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px 12px; color: #2a2024; }
.rough-card h3 { font-size: 15px; color: #221824; }
.rough-card p, .card-habitat { font-size: 11px; color: #4a3a3a; line-height: 1.45; }
.card-fish { display: grid; place-items: center; border-radius: 10px; background: #16293e; border: 2px solid #634038; padding: 6px; }
.rough-card .button { margin-top: auto; }
.reset-dialog { width: min(390px,calc(100% - 24px)); }
.reset-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.noscript { position: absolute; top: 18%; left: 14px; color: var(--cream); }

/* Portrait Mobile Layout — Unified 358px Rail & Cozy Rounded Popovers */
@media (max-width: 760px), (orientation: portrait) {
  :root {
    --nav-height: 62px;
    --pad-left: max(14px,env(safe-area-inset-left,0px));
    --pad-right: max(14px,env(safe-area-inset-right,0px));
    --pad-top: calc(env(safe-area-inset-top,0px) + 12px);
  }
  .harbor-hud { gap: 8px; }
  .hud-right { flex-direction: column; align-items: flex-end; gap: 7px; }
  .status-pill { min-height: 44px; padding: 4px 12px; gap: 8px; }
  .place { min-height: 44px; padding: 4px 12px; }
  .place strong { font-size: 14px; }
  .place span { font-size: 10px; }
  .hud-actions { gap: 6px; }
  #mobileTideButton { min-height: 36px; font-size: 11px; padding: 4px 12px 5px; }
  .hud-actions .button.square { width: 36px; height: 36px; min-height: 36px; }
  .auto-skill-btn { top: calc(var(--pad-top) + 92px); padding: 3px 9px 4px 7px; }
  .bay-rail { top: calc(var(--pad-top) + 52px); }
  .chapter-pill { max-width: 176px; padding: 3px 9px 4px; }

  .water-cue { top: 40%; right: var(--pad-right); }

  .tackle-popover {
    width: min(358px, calc(100% - var(--pad-left) - var(--pad-right)));
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 134px);
    max-height: min(64dvh, 496px);
  }

  .helms {
    grid-template-columns: 1fr;
    width: min(358px, calc(100% - var(--pad-left) - var(--pad-right)));
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 18px);
    gap: 9px;
  }
  .tackle-controls, .cast-actions { width: 100%; gap: 8px; }
  .cast-actions .cast { max-width: 196px; }
  .cast-actions .button { min-height: 46px; }
  .cast-hint { font-size: 12px; margin-bottom: 1px; }

  .mobile-dock {
    width: min(358px, calc(100% - var(--pad-left) - var(--pad-right)));
    bottom: calc(var(--safe-bottom) + 10px);
    padding: 4px 6px;
  }
  .mobile-dock button {
    flex-direction: column; min-height: 44px; gap: 2px; font-size: 11px; padding: 4px 2px;
  }
  .mobile-nav-icon { width: 20px; height: 20px; background-size: 100px 20px; background-position: calc(var(--tab-icon,0) * -20px) 0; }

  .tools-sheet {
    left: 50%; right: auto; transform: translateX(-50%);
    width: min(358px, calc(100% - var(--pad-left) - var(--pad-right)));
    bottom: calc(var(--safe-bottom) + var(--nav-height) + 18px);
    max-height: min(64dvh,540px);
  }
  .cards-dialog {
    position: fixed; inset: auto 0 0; margin: 0 auto; width: min(590px,100%);
    max-height: calc(100dvh - env(safe-area-inset-top,0px) - 10px);
    padding-bottom: calc(14px + var(--safe-bottom));
  }
  .cards-grid { grid-template-columns: 1fr; }
  .rough-card { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 4px 10px; }
  .rough-card .card-habitat, .rough-card h3, .rough-card p, .rough-card .condition-gear { grid-column: 2; }
  .rough-card .card-fish { grid-column: 1; grid-row: 1 / span 4; }
  .rough-card .button { grid-column: 1 / -1; margin-top: 6px; }
  .rough-card .card-actions-col { grid-column: 1 / -1; }
  .card-fish .fish-icon { width: 40px; height: 28px; background-size: 400px 56px; background-position: calc(var(--index,0) * -40px) calc(var(--rarity,0) * -28px); }
}

/* Landscape Compact Mobile (844x390) */
@media (orientation: landscape) and (max-height: 470px) {
  :root { --nav-height: 44px; --pad-top: 10px; --pad-left: 14px; --pad-right: 14px; }
  .hud-right { flex-direction: row; align-items: center; gap: 7px; }
  .place, .status-pill { min-height: 40px; padding: 4px 12px; }
  .bay-rail { top: calc(var(--pad-top) + 46px); }
  .auto-skill-btn { top: calc(var(--pad-top) + 46px); padding: 3px 9px 4px 7px; }
  .chapter-pill { max-width: 196px; padding: 3px 9px 4px; }
  .hud-actions .button.square { width: 38px; height: 38px; min-height: 38px; }
  #mobileTideButton { min-height: 38px; font-size: 12px; }
  .water-cue { top: 41%; right: var(--pad-right); }
  .tackle-popover {
    width: min(500px, calc(100% - 28px));
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 96px);
    max-height: min(62dvh, 236px);
  }
  .helms {
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
    width: min(760px, calc(100% - 28px));
    gap: 6px 10px;
  }
  .gear-chip { min-height: 42px; padding: 3px 10px 3px 8px; }
  .cast-actions .button { min-height: 42px; font-size: 14px; padding: 4px 14px 6px; }
  .cast-hint { font-size: 11px; padding: 4px 13px; }
  .mobile-dock { width: min(376px, calc(100% - 28px)); bottom: calc(var(--safe-bottom) + 6px); padding: 3px 5px; }
  .mobile-dock button { flex-direction: row; min-height: 30px; gap: 5px; font-size: 11px; }
  .mobile-nav-icon { width: 16px; height: 16px; background-size: 80px 16px; background-position: calc(var(--tab-icon,0) * -16px) 0; }
  .tools-sheet { max-height: calc(100dvh - var(--nav-height) - var(--safe-bottom) - 22px); }
  .rare-card { width: min(360px, calc(100% - 24px)); padding: 11px 16px 12px; }
  .rare-stage { width: 148px; height: 92px; margin: 7px auto 6px; }
  .rare-stage .fish-icon.hero { width: 80px; height: 56px; background-size: 800px 112px; background-position: calc(var(--index,0) * -80px) calc(var(--rarity,0) * -56px); }
  .rare-card h2 { font-size: 18px; }
  .rare-metrics { margin: 4px 0 4px; }
  .rare-sub { margin-bottom: 9px; }
}


/* ============================================================================ */
/* NEW SPRITE SHEETS: ECO (10x1), TECH BRANCH & RELICS (12x1), LEGEND FISH/BAIT */
/* ============================================================================ */
.eco-icon {
  display: inline-block; flex: none; width: 32px; height: 32px;
  background-image: url("assets/eco-icons.png");
  background-size: 320px 32px;
  background-position: calc(var(--eco-i, 0) * -32px) 0;
  image-rendering: pixelated;
}
.eco-icon.sm { width: 24px; height: 24px; background-size: 240px 24px; background-position: calc(var(--eco-i, 0) * -24px) 0; }

.branch-icon {
  display: inline-block; flex: none; width: 32px; height: 32px;
  background-image: url("assets/branch-icons.png");
  background-size: 384px 32px;
  background-position: calc(var(--br-i, 0) * -32px) 0;
  image-rendering: pixelated;
}
.branch-icon.sm { width: 24px; height: 24px; background-size: 288px 24px; background-position: calc(var(--br-i, 0) * -24px) 0; }
.branch-icon.mini { width: 16px; height: 16px; background-size: 192px 16px; background-position: calc(var(--br-i, 0) * -16px) 0; vertical-align: -3px; }

.fish-icon.legend-fish {
  background-image: url("assets/legend-fish.png");
  background-size: 120px 28px;
  background-position: calc(var(--legend-i, 0) * -40px) 0;
}
.fish-icon.sm.legend-fish { width: 30px; height: 21px; background-size: 90px 21px; background-position: calc(var(--legend-i, 0) * -30px) 0; }
.fish-icon.xs.legend-fish { width: 22px; height: 15px; background-size: 66px 15px; background-position: calc(var(--legend-i, 0) * -22px) 0; }
.fish-icon.lg.legend-fish, .fish-icon.big.legend-fish { width: 80px; height: 56px; background-size: 240px 56px; background-position: calc(var(--legend-i, 0) * -80px) 0; }
.fish-icon.hero.legend-fish { width: 120px; height: 84px; background-size: 360px 84px; background-position: calc(var(--legend-i, 0) * -120px) 0; }

.bait-icon.legend-bait {
  background-image: url("assets/legend-baits.png");
  background-size: 72px 24px;
  background-position: calc(var(--lb-i, 0) * -24px) 0;
}
.bait-icon.sm.legend-bait { width: 20px; height: 20px; background-size: 60px 20px; background-position: calc(var(--lb-i, 0) * -20px) 0; }
.bait-icon.mini.legend-bait { width: 16px; height: 16px; background-size: 48px 16px; background-position: calc(var(--lb-i, 0) * -16px) 0; }

/* ============================================================================ */
/* MYTHIC, ORIGIN, GROWABLE, SPECIAL GENE, POWER & SECRET MAP BADGES            */
/* ============================================================================ */
.seg-toggle.quad { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.size-tier.tier-mythic {
  color: #fff2c4;
  background: linear-gradient(135deg, #6d408c, #b64060 52%, #e1a348);
  border-color: #fff2c4;
  box-shadow: 0 0 8px rgba(247, 207, 134, 0.45);
}
.origin-pill, .grow-pill, .gene-pill, .watt-pill, .legend-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 700;
  white-space: nowrap; line-height: 1.4;
}
.origin-pill.wild { background: #3b2d18; color: #f7cf86; border: 1px solid #e1a348; }
.origin-pill.grown { background: #193b37; color: #9fd3ca; border: 1px solid #66b0aa; }
.origin-pill.bred { background: #342342; color: #e2c6ff; border: 1px solid #9e98be; }
.grow-pill.can { background: #1c3d2d; color: #b5e8a3; border: 1px solid #548c60; }
.grow-pill.fixed { background: #1d2d3d; color: #95adb8; border: 1px solid #445c70; }
.gene-pill { background: #2d2144; color: #f4d6ff; border: 1px solid #9e98be; }
.gene-pill.unlim { background: linear-gradient(90deg, #3c2254, #592a48); color: #fff2c4; border-color: #e1a348; }
.watt-pill { background: #3b2919; color: #f7cf86; border: 1px solid #b3722f; }
.legend-pill { background: linear-gradient(90deg, #32245a, #1d4e66); color: #fff2c4; border: 1px solid #9fd3ca; }
.dna-code { font-family: ui-monospace, Consolas, monospace; font-size: 10px; color: #9fd3ca; opacity: 0.9; }

@media (max-width: 540px) {
  .bay-badges { max-width: calc(100vw - 160px); }
}

.bay-badge.secret {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(90deg, rgba(46, 30, 82, 0.94), rgba(22, 64, 88, 0.94));
  color: #fff2c4; border: 1px solid #9fd3ca; padding: 3px 6px 3px 9px;
  box-shadow: 0 2px 10px rgba(102, 176, 170, 0.35);
}
.mini-leave-btn {
  pointer-events: auto;
  border: 1px solid #f7cf86; border-radius: 999px; background: rgba(19, 30, 45, 0.85);
  color: #fff2c4; font-size: 10px; font-weight: 700; padding: 1px 7px; cursor: pointer;
}
.bay-badge.cond { background: rgba(29, 74, 88, 0.92); color: #d5ece0; border: 1px solid #66b0aa; }
.bay-badge.power-warn { background: rgba(114, 42, 42, 0.94); color: #ffd4c4; border: 1px solid #de6d58; }

/* Prismatic Mythic & Cosmic Legendary Showcase Variants */
.rare-card.mythic-mode {
  border-color: #fff2c4;
  background: linear-gradient(175deg, #2b1a44, #1b2848 56%, #2f1f30);
  box-shadow: 0 0 34px rgba(247, 207, 134, 0.42), 0 12px 30px rgba(10, 14, 26, 0.8);
}
.rare-card.legend-mode {
  border-color: #9fd3ca;
  background: linear-gradient(175deg, #162447, #1d3c5a 55%, #232046);
  box-shadow: 0 0 32px rgba(159, 211, 202, 0.42), 0 12px 30px rgba(10, 14, 26, 0.8);
}
.rare-origin-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin: 4px 0 6px; }
.rare-btn-row { display: flex; flex-direction: column; gap: 7px; }

/* ============================================================================ */
/* STANDALONE FULL-SCREEN SANCTUARY (海水鱼水族馆 & 淡水池塘独立界面!)             */
/* ============================================================================ */
body[data-screen="habitats"] .harbor-hud,
body[data-screen="habitats"] .bay-rail,
body[data-screen="habitats"] .helms,
body[data-screen="habitats"] .auto-skill-btn,
body[data-screen="habitats"] .mobile-dock,
body[data-screen="habitats"] .water-cue { display: none !important; }

.sanctuary-view {
  position: fixed; inset: 0; z-index: 48;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0f1c30 0%, #14273e 48%, #101e31 100%);
  color: var(--text);
  padding: env(safe-area-inset-top, 8px) max(10px, env(safe-area-inset-right, 10px)) max(10px, env(safe-area-inset-bottom, 10px)) max(10px, env(safe-area-inset-left, 10px));
  gap: 8px;
  overflow: hidden;
}
.sanctuary-view[hidden] { display: none; }

.sanctuary-head {
  display: flex; align-items: center; justify-content: space-between; gap: 4px; flex-wrap: nowrap;
  padding: 5px 7px; border-radius: 12px;
  background: rgba(19, 34, 54, 0.92); border: 2px solid #48647a;
  flex: none;
}
.sanc-head-left, .sanc-head-right { display: flex; align-items: center; gap: 4px; min-width: 0; flex-shrink: 1; }
.sanctuary-head .button.small { padding: 4px 7px; font-size: 10.5px; min-height: 28px; white-space: nowrap; }
.sanc-wallet {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 6px; border-radius: 999px; background: #142338; border: 1px solid #594a3d;
  font-size: 11px; color: var(--cream); white-space: nowrap;
}
.sanc-power-pill {
  font-size: 9.5px; font-weight: 700; padding: 3px 5px; border-radius: 999px;
  background: #1b2f44; color: #f7cf86; border: 1px solid #6b563c; white-space: nowrap;
}
.sanc-power-pill.outage { background: #5a2229; color: #ffd4c4; border-color: #de6d58; }

.sanctuary-body {
  display: flex; flex-direction: column; gap: 8px;
  flex: 1 1 auto; min-height: 0; overflow: hidden;
}
.sanctuary-visual-col { display: flex; flex-direction: column; gap: 6px; flex: none; }
.sanctuary-deck-col { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.sanctuary-scroll { flex: 1 1 auto; overflow-y: auto; padding-right: 2px; display: flex; flex-direction: column; gap: 8px; }
.sanc-pane { display: flex; flex-direction: column; gap: 8px; }
.sanc-pane[hidden] { display: none; }

.habitat-stage.large {
  position: relative; width: 100%; aspect-ratio: 640 / 340;
  flex: none;
  border-radius: 14px; overflow: hidden;
  border: 2px solid #66b0aa; background: #0e2236;
  box-shadow: inset 0 0 22px rgba(9, 20, 34, 0.7);
  touch-action: none;
}
.habitat-stage.large.fresh { border-color: #8ab674; }
.habitat-stage.large canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

.hab-overlay-top, .hab-overlay-bot {
  position: absolute; left: 6px; right: 6px; display: flex; align-items: center; justify-content: space-between;
  gap: 4px; pointer-events: none;
}
.hab-overlay-top { top: 6px; }
.hab-overlay-bot { bottom: 6px; }
.hab-overlay-right { display: flex; align-items: center; gap: 4px; flex: none; }
.habitat-stage.large .habitat-pill {
  position: static; padding: 2px 6px; border-radius: 999px; font-size: 9.5px; font-weight: 700;
  white-space: nowrap; line-height: 1.35;
  background: rgba(15, 29, 46, 0.86); color: var(--cream); border: 1px solid rgba(159, 211, 202, 0.45);
}
.habitat-pill.o2-good { color: #b5f0c8; border-color: #548c60; }
.habitat-pill.o2-low { color: #f7cf86; border-color: #e1a348; }
.habitat-pill.o2-bad { color: #ffb8aa; border-color: #de6d58; }

.sanc-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.meter-line { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.meter-line .cap-bar-track { flex: 1; height: 7px; }
.meter-val { font-size: 10px; font-weight: 700; color: var(--cream); min-width: 34px; text-align: right; }
.cap-bar-fill.o2 { background: linear-gradient(90deg, #3c9b78, #9fd3ca); }
.cap-bar-fill.o2.low { background: linear-gradient(90deg, #c78634, #f7cf86); }
.cap-bar-fill.o2.bad { background: linear-gradient(90deg, #a63a3a, #de6d58); }

.sanc-quick-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.sanc-income-note { font-size: 11px; color: #f3d1a2; flex: 1 1 160px; line-height: 1.35; }

/* Flora 4-tuft status strip, Eco cards & Power list */
.flora-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px;
}
.flora-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; border-radius: 10px; background: rgba(20, 40, 56, 0.86); border: 1px solid #365a63;
  font-size: 10px; color: var(--muted);
}
.flora-cell.alive { border-color: #548c60; color: #c5e8b7; }
.flora-cell.empty { border-style: dashed; opacity: 0.72; }
.flora-bar { width: 100%; height: 4px; border-radius: 99px; background: #102030; overflow: hidden; }
.flora-bar > i { display: block; height: 100%; background: #8ab674; }

.eco-list, .power-list, .achieve-list, .cond-card-list, .secret-map-list {
  display: flex; flex-direction: column; gap: 7px;
}
.eco-card {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 12px;
  background: rgba(21, 39, 60, 0.9); border: 1px solid #3b5872;
}
.eco-card.owned { border-color: #548c60; background: rgba(22, 48, 52, 0.78); }
.eco-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.eco-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--cream); }
.eco-desc { font-size: 11px; color: var(--muted); line-height: 1.35; }

.power-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-radius: 10px; background: rgba(18, 34, 52, 0.9); border: 1px solid #355068;
  font-size: 12px;
}
.power-summary-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; border-radius: 11px; margin-bottom: 8px;
  background: rgba(20, 36, 54, 0.92); border: 1px solid #4e6274; font-size: 11px; color: #f3d1a2;
}

/* Growth bar inside Sanctuary Fish Cards */
.growth-track {
  width: 100%; height: 5px; border-radius: 99px; background: #102030; overflow: hidden; margin-top: 2px;
}
.growth-fill { height: 100%; background: linear-gradient(90deg, #548c60, #9fd3ca); }
.growth-fill.mythic { background: linear-gradient(90deg, #e1a348, #de6d58, #9e98be); }
.fish-tags-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* Breeding Workbench */
.breed-box {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border-radius: 12px; background: rgba(24, 34, 58, 0.92); border: 1px solid #594b78;
}
.breed-slots { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.breed-slot {
  padding: 8px; border-radius: 10px; background: rgba(15, 25, 42, 0.9); border: 1px dashed #6d6e96;
  min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-align: center; font-size: 11px;
}
.breed-slot.filled { border-style: solid; border-color: #9e98be; }
.breed-plus { font-size: 16px; font-weight: 800; color: #f7cf86; }
.breed-preview { font-size: 11px; color: #d5ece0; line-height: 1.45; padding: 6px 8px; border-radius: 8px; background: rgba(15, 32, 46, 0.8); }
.breed-pool { display: flex; flex-direction: column; gap: 5px; }
.breed-pick-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 7px; align-items: center;
  padding: 6px 8px; border-radius: 10px; background: rgba(18, 32, 48, 0.9); border: 1px solid #355068;
}
.breed-pick-row.selected { border-color: #f7cf86; background: rgba(42, 36, 58, 0.92); }
.breed-pick-row.dim { opacity: 0.56; }

/* Regular Maps, Sub-Spots, Condition Cards & Timed Secret Maps */
.map-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-top: 8px; margin-bottom: 5px; }
.map-section-head.spaced { margin-top: 12px; }
.map-section-head h4 { font-size: 13px; color: var(--cream); }

.map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.map-card {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  padding: 8px 10px; border-radius: 12px; cursor: pointer;
  background: rgba(21, 40, 60, 0.9); border: 1.5px solid #3a5972; color: var(--text);
}
.map-card.active { border-color: #f7cf86; background: rgba(34, 58, 76, 0.95); }
.map-card.locked { opacity: 0.54; cursor: not-allowed; }
.map-card-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 12px; font-weight: 700; color: var(--cream); }
.map-card-sub { font-size: 10px; color: var(--muted); }

.subspot-row { display: flex; flex-wrap: wrap; gap: 6px; }
.subspot-btn {
  padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; cursor: pointer;
  background: #173049; color: #d5ece0; border: 1px solid #3d627a;
}
.subspot-btn.active { background: #2c5c6e; color: #fff2c4; border-color: #f7cf86; }

.cond-card-row, .secret-map-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 12px; background: rgba(20, 38, 58, 0.9); border: 1px solid #3c5d78;
}
.cond-card-row.active-cond { border-color: #9fd3ca; background: rgba(22, 58, 66, 0.92); }
.condition-gear { display: flex; flex-wrap: wrap; gap: 3px 8px; margin-top: 3px; font-size: 11px; }
.condition-gear > span { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.secret-map-row { border-color: #6d6e96; background: linear-gradient(120deg, rgba(28, 25, 56, 0.94), rgba(18, 42, 62, 0.94)); }
.secret-map-row.ready { border-color: #f7cf86; }
.secret-map-row.locked { opacity: 0.72; }

/* Legendary Draw Card Styling inside #cardsDialog */
.rough-card.legend-card {
  background: linear-gradient(170deg, #25204a, #183654); color: #f3f2e6; border: 2px solid #9fd3ca;
}
.rough-card.legend-card h3 { color: #fff2c4; }
.rough-card.legend-card p, .rough-card.legend-card .card-habitat { color: #cfe8e2; }
.card-actions-col { display: flex; flex-direction: column; gap: 5px; margin-top: auto; }

/* Achievements & 4 Key Relics Tray */
.relic-tray-box {
  padding: 9px 10px; border-radius: 12px; margin-bottom: 9px;
  background: rgba(20, 35, 56, 0.92); border: 1px solid #594b78;
}
.relic-tray-box .orders-head { flex-direction: column; align-items: flex-start; gap: 2px; }
.relic-tray-box .orders-head h3 { white-space: nowrap; }
.relic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.relic-chip {
  display: flex; align-items: center; gap: 6px; padding: 5px 7px; border-radius: 10px;
  background: rgba(14, 24, 38, 0.85); border: 1px dashed #4a5a72; font-size: 11px; color: #8c9eb0;
}
.relic-chip.owned { border-style: solid; border-color: #e1a348; color: #fff2c4; background: rgba(46, 36, 28, 0.75); }
.relic-chip .branch-icon { filter: grayscale(0.85) brightness(0.65); }
.relic-chip.owned .branch-icon { filter: none; }
.relic-chip-text { display: flex; flex-direction: column; min-width: 0; }
.relic-chip-text b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.relic-chip-text span { font-size: 9px; opacity: 0.85; }

.achieve-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 9px 10px; border-radius: 12px; background: rgba(20, 36, 56, 0.9); border: 1px solid #3c5870;
}
.achieve-card.ready { border-color: #f7cf86; background: rgba(54, 42, 26, 0.85); }
.achieve-card.claimed { border-color: #46785e; opacity: 0.8; }
.achieve-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.achieve-title { font-size: 13px; font-weight: 700; color: var(--cream); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.achieve-goals { font-size: 11px; color: var(--muted); }
.achieve-reward { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 11px; color: #f7cf86; }

.key-req-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700; background: #362238; color: #f4c6ff; border: 1px solid #9e98be;
}
.key-req-chip.ok { background: #1c3d30; color: #b5e8a3; border-color: #548c60; }

/* Landscape Standalone Sanctuary 2-Column Split (844x390 & desktop) */
@media (min-width: 760px) and (orientation: landscape) {
  .sanctuary-body {
    flex-direction: row; align-items: stretch; gap: 10px;
  }
  .sanctuary-visual-col {
    flex: 0 0 54%; max-width: 54%; justify-content: flex-start; overflow-y: auto; scrollbar-width: thin;
  }
  .sanctuary-deck-col {
    flex: 1 1 46%; min-width: 0;
  }
  .habitat-stage.large { aspect-ratio: 640 / 340; }
}
@media (max-width: 760px), (orientation: portrait) {
  .card-fish .fish-icon.legend-fish { width: 40px; height: 28px; background-size: 120px 28px; background-position: calc(var(--legend-i, 0) * -40px) 0; }
  .card-fish .fish-icon.thermal-fish { width: 40px; height: 28px; background-size: 160px 28px; background-position: calc(var(--thermal-i, 0) * -40px) 0; }
.card-fish .fish-icon.benthic-fish { width: 36px; height: 28px; background-size: 288px 28px; background-position: calc(var(--benthic-i, 0) * -36px) 0; }
}
@media (orientation: landscape) and (max-height: 470px) {
  .sanctuary-head { padding: 4px 8px; }
  .sanctuary-view { gap: 5px; padding: 6px 10px; }
  .sanctuary-visual-col { gap: 4px; }
  .habitat-stage.large { aspect-ratio: 640 / 310; flex: none; }
  .sanctuary-view.stage-expanded .habitat-stage.large { height: calc(100vh - 148px); width: auto; max-width: 100%; margin: 0 auto; aspect-ratio: 640 / 340; flex: none; }
  .rare-stage .fish-icon.hero.legend-fish { width: 80px; height: 56px; background-size: 240px 56px; background-position: calc(var(--legend-i, 0) * -80px) 0; }
  .rare-stage .fish-icon.hero.thermal-fish { width: 80px; height: 56px; background-size: 320px 56px; background-position: calc(var(--thermal-i, 0) * -80px) 0; }
.rare-stage .fish-icon.hero.benthic-fish { width: 72px; height: 56px; background-size: 576px 56px; background-position: calc(var(--benthic-i, 0) * -72px) 0; }
}


/* ============================================================================ */
/* PREDATOR ECOLOGY, MULTI-TANK SANCTUARY, FISH INSPECTOR, ODDS & ITEM ATLAS    */
/* ============================================================================ */
.pred-icon {
  display: inline-block; flex: none;
  width: 24px; height: 24px;
  background-image: url("assets/predator-items.png");
  background-repeat: no-repeat;
  background-size: 240px 24px;
  background-position: calc(var(--pred-i, 0) * -24px) 0;
  image-rendering: pixelated;
}
.pred-icon.sm { width: 20px; height: 20px; background-size: 200px 20px; background-position: calc(var(--pred-i, 0) * -20px) 0; }
.pred-icon.mini { width: 16px; height: 16px; background-size: 160px 16px; background-position: calc(var(--pred-i, 0) * -16px) 0; vertical-align: -3px; margin-right: 3px; }
.pred-icon.lg { width: 36px; height: 36px; background-size: 360px 36px; background-position: calc(var(--pred-i, 0) * -36px) 0; }

.bay-badge.dust {
  background: linear-gradient(90deg, rgba(60, 42, 92, 0.94), rgba(102, 72, 34, 0.94));
  color: #fff2c4; border: 1px solid #f7cf86;
}

/* Multi-Tank & Solo Nursery Selector Strip */
.tank-strip {
  display: flex; align-items: center; gap: 5px; overflow-x: auto; padding-bottom: 1px;
  scrollbar-width: none;
}
.tank-strip::-webkit-scrollbar { display: none; }
.tank-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: rgba(18, 34, 52, 0.92); color: #b8cdd8; border: 1px solid #3c5a6e;
  cursor: pointer; white-space: nowrap;
}
.tank-chip.active { background: #26546a; color: #fff2c4; border-color: #9fd3ca; }
.tank-chip.solo { border-color: #c79a4b; color: #f7cf86; }
.tank-chip.solo.active { background: linear-gradient(90deg, #4b3826, #2b4a5e); border-color: #fff2c4; color: #fff2c4; }
.tank-chip.locked { border-style: dashed; opacity: 0.78; color: #8da5b5; }
.tank-chip .mode-dot {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block;
  background: #66b0aa;
}
.tank-chip .mode-dot.pred { background: #de6d58; }
.tank-chip .mode-dot.mix { background: #e1a348; }
.tank-chip .mode-dot.solo { background: #c8c2f0; }

/* Sanctuary Canvas Modes & Interactive Spatial Drop-Feeding */
.habitat-stage.mode-peaceful { border-color: #66b0aa; box-shadow: inset 0 0 18px rgba(102, 176, 170, 0.22); }
.habitat-stage.mode-predator { border-color: #de6d58; box-shadow: inset 0 0 18px rgba(222, 109, 88, 0.24); }
.habitat-stage.mode-solo { border-color: #f7cf86; box-shadow: inset 0 0 20px rgba(247, 207, 134, 0.24); }
.habitat-stage.drop-armed {
  border-color: #fff2c4 !important;
  box-shadow: 0 0 0 2px rgba(247, 207, 134, 0.55), inset 0 0 22px rgba(255, 242, 196, 0.22);
  cursor: crosshair;
}
.habitat-stage.drop-armed canvas { cursor: crosshair; }
.hab-drop-prompt {
  position: absolute; left: 50%; top: 30px; transform: translateX(-50%);
  max-width: calc(100% - 14px); padding: 3px 9px; border-radius: 10px;
  font-size: 10px; font-weight: 700; text-align: center; line-height: 1.3;
  background: rgba(54, 34, 20, 0.94); color: #fff2c4; border: 1px solid #f7cf86;
  pointer-events: none; z-index: 4;
}
.hab-feed-toast {
  position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%);
  max-width: calc(100% - 16px); padding: 4px 10px; border-radius: 10px;
  font-size: 10.5px; font-weight: 700; text-align: center;
  background: rgba(16, 30, 48, 0.94); color: #fff2c4; border: 1px solid #9fd3ca;
  pointer-events: none; z-index: 5; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}
.hab-feed-toast.snatched { background: rgba(74, 24, 30, 0.95); border-color: #de6d58; color: #ffe0d6; }
.hab-feed-toast.solo { background: rgba(46, 36, 20, 0.95); border-color: #f7cf86; color: #fff2c4; }

.sanc-feed-bar {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.sanc-feed-bar .button.small { padding: 4px 8px; font-size: 11px; min-height: 28px; display: inline-flex; align-items: center; gap: 3px; }
.sanc-feed-bar .solo-pill {
  padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  background: linear-gradient(90deg, #4b3922, #2b4a56); color: #fff2c4; border: 1px solid #f7cf86;
}
.live-prey-picker {
  display: flex; align-items: center; gap: 5px; overflow-x: auto; padding: 5px 7px;
  border-radius: 10px; background: rgba(14, 26, 40, 0.95); border: 1px solid #59859e;
}
.live-prey-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px; border-radius: 8px; font-size: 10.5px; font-weight: 700;
  background: #1a3348; color: #d5ece0; border: 1px solid #486e84; cursor: pointer;
}
.live-prey-chip.active { background: #5a3822; border-color: #f7cf86; color: #fff2c4; }

/* Live Ecosystem Risk Banner */
.sanc-risk-banner {
  padding: 6px 9px; border-radius: 10px; font-size: 11px; line-height: 1.4;
  background: rgba(20, 44, 52, 0.85); border: 1px solid #4a8278; color: #cfe8e0;
}
.sanc-risk-banner.warn { background: rgba(62, 42, 22, 0.88); border-color: #e1a348; color: #ffebc2; }
.sanc-risk-banner.danger { background: rgba(74, 24, 30, 0.90); border-color: #de6d58; color: #ffd4c9; }
.sanc-risk-banner.solo { background: rgba(44, 34, 62, 0.88); border-color: #9e98be; color: #ece6ff; }

/* Diet, Trait, Hunger & Injury Pills */
.diet-pill {
  display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 999px;
  font-size: 9.5px; font-weight: 700; white-space: nowrap;
}
.diet-pill.carnivore { background: #5a2228; color: #ffb8aa; border: 1px solid #de6d58; }
.diet-pill.omnivore-meat { background: #583124; color: #ffd5a8; border: 1px solid #e1a348; }
.diet-pill.omnivore-veg { background: #1e4246; color: #9fd3ca; border: 1px solid #66b0aa; }
.diet-pill.herbivore { background: #1f4432; color: #a8e096; border: 1px solid #548c60; }
.diet-pill.pack { background: #2c2d54; color: #c8c2f0; border: 1px solid #9e98be; }
.diet-pill.blood { background: #6b1a24; color: #ffd0cc; border: 1px solid #ff7b6b; }
.diet-pill.injured { background: #742626; color: #ffe0d6; border: 1px solid #de6d58; }
.diet-pill.hungry { background: #5a3c1a; color: #ffe4a8; border: 1px solid #e1a348; }

.habitat-row.clickable { cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
.habitat-row.clickable:hover { border-color: #9fd3ca; background: rgba(28, 52, 74, 0.92); }
.fish-vitals-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 10px; color: #9fb8c8;
}
.mini-bar-wrap { display: inline-flex; align-items: center; gap: 3px; }
.mini-bar { width: 38px; height: 5px; border-radius: 999px; background: #122132; overflow: hidden; border: 1px solid #30495e; }
.mini-bar i { display: block; height: 100%; background: #66b0aa; }
.mini-bar.hunger i { background: #e1a348; }
.mini-bar.hunger.high i { background: #de6d58; }
.mini-bar.injury i { background: #de6d58; }
.mini-stat-line { font-size: 10px; color: #b6d2dc; font-family: ui-monospace, Consolas, monospace; }
.habitat-row-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex: none; }

/* Multi-Tank Buy, Segregated/Mixed Mode & Meat Processor Boxes */
.habitat-mode-box, .habitat-buy-box, .meat-proc-box {
  padding: 9px 10px; border-radius: 12px; background: rgba(18, 34, 52, 0.92);
  border: 1px solid #3e5e74; display: flex; flex-direction: column; gap: 6px;
}
.mode-compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mode-pro-card {
  padding: 6px 8px; border-radius: 9px; background: rgba(13, 25, 39, 0.85); border: 1px solid #355064;
  font-size: 10px; line-height: 1.4; color: #bdd2dd;
}
.mode-pro-card.active { border-color: #f7cf86; background: rgba(44, 36, 24, 0.72); }
.mode-pro-card b { display: block; color: #fff2c4; font-size: 11px; margin-bottom: 2px; }
.mode-btn-row { display: flex; gap: 5px; flex-wrap: wrap; }
.buy-tank-grid { display: flex; flex-direction: column; gap: 6px; }
.buy-tank-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 7px 8px; border-radius: 10px; background: rgba(14, 27, 42, 0.88); border: 1px solid #3c5870;
}
.buy-tank-row.solo { border-color: #c79a4b; }

.meat-proc-list { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 2px; }
.meat-proc-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: 9px; font-size: 10.5px; font-weight: 700;
  background: #20374c; color: #f3f2e6; border: 1px solid #4c7288; cursor: pointer;
}
.meat-proc-chip:hover { border-color: #f7cf86; }

.hab-event-list {
  display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto;
  padding: 6px 8px; border-radius: 10px; background: rgba(12, 24, 38, 0.85); border: 1px solid #30495e;
  font-size: 11px; color: #c7dae4;
}
.hab-ev-row { display: flex; gap: 6px; align-items: baseline; line-height: 1.35; }
.hab-ev-tick { font-size: 9.5px; color: #84a0b2; flex: none; font-family: ui-monospace, Consolas, monospace; }
.hab-ev-row.combat, .hab-ev-row.predation { color: #ffc8bc; }
.hab-ev-row.feeding { color: #ffe7b8; }
.hab-ev-row.awakening { color: #e2d4ff; font-weight: 700; }

.breed-cat-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 10px; background: rgba(44, 30, 68, 0.88);
  border: 1px solid #9e98be; font-size: 11px; color: #f0e8ff;
}
.breed-cat-bar.armed { border-color: #f7cf86; background: rgba(66, 48, 24, 0.92); color: #fff2c4; }

/* Fish Individual Stats & Care Inspector Modal */
.inspect-dialog {
  width: min(410px, calc(100vw - 20px)); max-height: 86vh;
  padding: 12px 13px; border-radius: 16px;
  background: linear-gradient(180deg, #13253a, #0e1c2e);
  color: var(--text); border: 2px solid #59859e;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
}
.inspect-dialog::backdrop { background: rgba(8, 14, 24, 0.72); backdrop-filter: blur(2px); }
.inspect-title-wrap h2 { margin: 0; font-size: 16px; color: var(--cream); }
.inspect-title-wrap p { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.inspect-body {
  display: flex; flex-direction: column; gap: 9px; margin-top: 8px;
  max-height: calc(86vh - 68px); overflow-y: auto; padding-right: 2px;
}
.inspect-hero {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px;
  background: rgba(18, 36, 56, 0.9); border: 1px solid #3f6076;
}
.inspect-hero-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.awaken-box {
  padding: 7px 9px; border-radius: 10px; background: rgba(44, 30, 22, 0.85);
  border: 1px solid #b3722f; font-size: 11px; color: #ffe4be;
}
.stat-grid-4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.stat-cell {
  padding: 6px 8px; border-radius: 10px; background: rgba(16, 30, 46, 0.92); border: 1px solid #355268;
  display: flex; flex-direction: column; gap: 3px;
}
.stat-cell-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; }
.stat-cell-top b { color: #fff2c4; font-size: 13px; }
.stat-cell-sub { font-size: 9.5px; color: #95b2c2; }
.stat-cell-sub em { font-style: normal; color: #8ab674; font-weight: 700; }
.stat-cell-sub strong { color: #ffb8aa; }
.stat-bar-track { height: 5px; border-radius: 999px; background: #102030; overflow: hidden; }
.stat-bar-fill { height: 100%; background: linear-gradient(90deg, #327c8b, #9fd3ca); border-radius: 999px; }
.stat-bar-fill.ferocity { background: linear-gradient(90deg, #b64040, #f7cf86); }
.stat-bar-fill.agility { background: linear-gradient(90deg, #327c8b, #8ab674); }
.stat-bar-fill.resilience { background: linear-gradient(90deg, #6d6e96, #9fd3ca); }

.stat-log-box {
  padding: 7px 9px; border-radius: 10px; background: rgba(12, 24, 38, 0.88); border: 1px solid #355066;
}
.stat-log-box h4 { margin: 0 0 5px; font-size: 11.5px; color: #f7cf86; }
.stat-log-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; color: #cde0e8; }
.stat-log-list li { display: flex; align-items: baseline; gap: 5px; line-height: 1.35; }
.stat-delta-pill {
  padding: 1px 5px; border-radius: 6px; background: #1e4234; color: #a8e096;
  font-weight: 700; font-size: 9.5px; flex: none;
}
.inspect-actions { display: flex; flex-direction: column; gap: 6px; }
.inspect-btn-row { display: flex; flex-wrap: wrap; gap: 5px; }

/* Special Harbor Orders (4.2% Rare / 0.7% Legendary) */
.order-card.special-rare {
  border-color: #9e98be !important;
  background: linear-gradient(135deg, rgba(44, 28, 72, 0.92), rgba(22, 42, 66, 0.92)) !important;
}
.order-card.special-legendary {
  border-color: #f7cf86 !important;
  background: linear-gradient(135deg, rgba(72, 48, 22, 0.94), rgba(44, 24, 68, 0.94)) !important;
  box-shadow: 0 0 14px rgba(247, 207, 134, 0.28);
}
.order-tier-pill {
  display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 9.5px; font-weight: 700; margin-left: 4px;
}
.order-tier-pill.rare { background: #3c2b64; color: #e2d4ff; border: 1px solid #9e98be; }
.order-tier-pill.legendary { background: #644418; color: #fff2c4; border: 1px solid #f7cf86; }
.order-relic-reward {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px;
  background: rgba(24, 18, 42, 0.86); border: 1px solid #f7cf86; color: #fff2c4; font-size: 10px; font-weight: 700;
}

/* Supply & Rare Relics Mini Grid in Basket Shop */
.supply-mini-grid { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.supply-card-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 7px 9px; border-radius: 10px; background: rgba(18, 34, 52, 0.92); border: 1px solid #3f6076;
}
.supply-card-row.relic { border-color: #8c7db8; background: rgba(32, 26, 54, 0.88); }

/* Tech Size Odds Breakdown Card */
.odds-card {
  padding: 9px 10px; border-radius: 12px; margin-bottom: 8px;
  background: rgba(18, 34, 54, 0.92); border: 1px solid #486b82;
  display: flex; flex-direction: column; gap: 6px;
}
.odds-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.odds-head strong { font-size: 12.5px; color: var(--cream); }
.odds-head span { font-size: 10px; color: #9ab5c4; }
.odds-pills-row { display: flex; flex-wrap: wrap; gap: 4px; }
.odds-pill {
  padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 700;
  background: #14263b; border: 1px solid #3a566c; color: #c7dce6;
}
.odds-pill.large { border-color: #66b0aa; color: #9fd3ca; }
.odds-pill.trophy { border-color: #e1a348; color: #f7cf86; }
.odds-pill.mythic { border-color: #c8c2f0; color: #f4d6ff; }
.odds-explain-list { display: flex; flex-direction: column; gap: 5px; font-size: 10.5px; color: #b9ced9; }
.odds-exp-row { display: flex; flex-direction: column; gap: 1px; line-height: 1.38; opacity: 0.74; }
.odds-exp-row.active { opacity: 1; color: #e8f2f5; }
.odds-exp-row b { color: #f7cf86; font-size: 11px; }

/* Item Atlas Category Pills & Cards */
.item-cat-pills { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; }
.item-cat-btn {
  padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  background: #142538; color: #9fb8c8; border: 1px solid #355066; cursor: pointer;
}
.item-cat-btn.active { background: #26546a; color: #fff2c4; border-color: #9fd3ca; }
.item-atlas-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 9px; align-items: start;
  padding: 9px 10px; border-radius: 12px; background: rgba(18, 34, 52, 0.92); border: 1px solid #3a566c;
}
.item-atlas-card.rare { border-color: #8c7db8; }
.item-atlas-card.legendary { border-color: #e1a348; background: linear-gradient(150deg, rgba(46, 36, 26, 0.9), rgba(24, 34, 54, 0.92)); }
.item-atlas-card.unseen { opacity: 0.68; }
.item-atlas-card.unseen .item-icon-box { filter: brightness(0.45) grayscale(0.6); }
.item-icon-box {
  width: 44px; height: 44px; border-radius: 10px; background: rgba(12, 22, 36, 0.9); border: 1px solid #3f5d74;
  display: flex; align-items: center; justify-content: center;
}
.rarity-tag { padding: 1px 6px; border-radius: 999px; font-size: 9.5px; font-weight: 700; }
.rarity-tag.rare { background: #3b2a62; color: #e2d4ff; border: 1px solid #9e98be; }
.rarity-tag.legendary { background: #5e3e18; color: #fff2c4; border: 1px solid #f7cf86; }
.rarity-tag.cat { background: #1a3346; color: #9fd3ca; border: 1px solid #487484; }
.item-summary { font-size: 11px; color: #f3e4c2; margin: 3px 0 2px; line-height: 1.4; }
.item-lore { font-size: 10.5px; color: #b5cad6; margin: 0; line-height: 1.48; }

/* ============================================================================ */
/* THERMAL FISH, 17 SANCTUARY PROPS, 3-PERSPECTIVE BAR, FREE LAYOUT & THERMOSTAT */
/* ============================================================================ */
.fish-icon.thermal-fish {
  background-image: url("assets/thermal-fish.png");
  background-size: 160px 28px;
  background-position: calc(var(--thermal-i, 0) * -40px) 0;
}
.fish-icon.sm.thermal-fish { width: 30px; height: 21px; background-size: 120px 21px; background-position: calc(var(--thermal-i, 0) * -30px) 0; }
.fish-icon.xs.thermal-fish { width: 22px; height: 15px; background-size: 88px 15px; background-position: calc(var(--thermal-i, 0) * -22px) 0; }
.fish-icon.lg.thermal-fish, .fish-icon.big.thermal-fish { width: 80px; height: 56px; background-size: 320px 56px; background-position: calc(var(--thermal-i, 0) * -80px) 0; }
.fish-icon.hero.thermal-fish { width: 120px; height: 84px; background-size: 480px 84px; background-position: calc(var(--thermal-i, 0) * -120px) 0; }

.fish-icon.benthic-fish {
  background-image: url("assets/benthic-fish.png");
  width: 36px; height: 28px;
  background-size: 288px 28px;
  background-position: calc(var(--benthic-i, 0) * -36px) 0;
}
.fish-icon.sm.benthic-fish { width: 27px; height: 21px; background-size: 216px 21px; background-position: calc(var(--benthic-i, 0) * -27px) 0; }
.fish-icon.xs.benthic-fish { width: 20px; height: 15px; background-size: 160px 15px; background-position: calc(var(--benthic-i, 0) * -20px) 0; }
.fish-icon.lg.benthic-fish, .fish-icon.big.benthic-fish { width: 72px; height: 56px; background-size: 576px 56px; background-position: calc(var(--benthic-i, 0) * -72px) 0; }
.fish-icon.hero.benthic-fish { width: 108px; height: 84px; background-size: 864px 84px; background-position: calc(var(--benthic-i, 0) * -108px) 0; }

.trap-icon {
  display: inline-block; flex: none;
  width: 32px; height: 32px;
  background-image: url("assets/trap-icons.png");
  background-repeat: no-repeat;
  background-size: 160px 32px;
  background-position: calc(var(--trap-i, 0) * -32px) 0;
  image-rendering: pixelated;
}
.trap-icon.sm { width: 24px; height: 24px; background-size: 120px 24px; background-position: calc(var(--trap-i, 0) * -24px) 0; }
.trap-icon.mini { width: 16px; height: 16px; background-size: 80px 16px; background-position: calc(var(--trap-i, 0) * -16px) 0; vertical-align: -3px; }

.prop-icon {
  display: inline-block; flex: none;
  width: 32px; height: 32px;
  background-image: url("assets/sanctuary-props.png");
  background-repeat: no-repeat;
  background-size: 576px 32px;
  background-position: calc(var(--prop-i, 0) * -32px) 0;
  image-rendering: pixelated;
}
.prop-icon.sm { width: 24px; height: 24px; background-size: 432px 24px; background-position: calc(var(--prop-i, 0) * -24px) 0; }
.prop-icon.mini { width: 18px; height: 18px; background-size: 324px 18px; background-position: calc(var(--prop-i, 0) * -18px) 0; vertical-align: -3px; }

.meat-icon {
  display: inline-block; flex: none;
  width: 24px; height: 24px;
  background-image: url("assets/meat-feed.png");
  background-repeat: no-repeat;
  background-size: 96px 24px;
  background-position: calc(var(--meat-i, 3) * -24px) 0;
  image-rendering: pixelated;
}
.meat-icon.mini { width: 18px; height: 18px; background-size: 72px 18px; background-position: calc(var(--meat-i, 3) * -18px) 0; vertical-align: -3px; }

/* Perspective Switcher & Expand / Free-Placement Toolbar */
.sanc-view-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: nowrap;
}
.sanc-view-bar .view-seg { flex: 1 1 auto; max-width: 220px; }
.sanc-view-bar .view-seg .seg-btn { font-size: 11px; padding: 4px 6px; min-height: 28px; }
.sanc-view-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.sanc-view-tools .button.small { padding: 3px 8px; font-size: 11px; min-height: 28px; white-space: nowrap; }

/* Full-Focus Large Stage Expansion Mode */
.sanctuary-view.stage-expanded .sanctuary-deck-col { display: none; }
.sanctuary-view.stage-expanded .sanctuary-visual-col {
  flex: 1 1 auto; max-width: 100%; height: 100%; overflow-y: auto;
}
.sanctuary-visual-col > * { flex: none; }
.sanctuary-view.stage-expanded .habitat-stage.large {
  flex: none; width: auto; max-width: 100%; height: min(62vh, 53vw); margin: 0 auto; aspect-ratio: 640 / 340;
}

/* Free Placement Armed Stage & Draggable Item Tray */
.habitat-stage.layout-armed {
  border-color: #9fd3ca !important;
  box-shadow: 0 0 0 2px rgba(159, 211, 202, 0.52), inset 0 0 24px rgba(159, 211, 202, 0.16);
  cursor: move;
}
.habitat-stage.layout-armed canvas { cursor: grab; }
.habitat-stage.layout-armed.dragging canvas { cursor: grabbing; }

.layout-tray {
  display: flex; align-items: center; gap: 5px; overflow-x: auto; padding: 5px 7px;
  border-radius: 10px; background: rgba(13, 27, 42, 0.96); border: 1.5px solid #66b0aa;
  scrollbar-width: none;
}
.layout-tray::-webkit-scrollbar { display: none; }
.layout-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 8px; font-size: 10.5px; font-weight: 700;
  background: #173046; color: #cde2ec; border: 1px solid #3f6680; cursor: pointer; white-space: nowrap;
}
.layout-chip.active { background: #29596e; color: #fff2c4; border-color: #f7cf86; box-shadow: 0 0 8px rgba(247, 207, 134, 0.3); }
.layout-chip.reset-btn { background: #2d2638; border-color: #8c7db8; color: #e8ddff; }

/* Temperature Badge & Compact Thermostat Control Bar */
.habitat-pill.temp-cold { color: #b8ebff; border-color: #5ca8d6; background: rgba(14, 42, 66, 0.9); }
.habitat-pill.temp-norm { color: #c8f0e4; border-color: #5ca698; }
.habitat-pill.temp-warm { color: #ffd9a8; border-color: #e19848; background: rgba(62, 34, 18, 0.9); }

.sanc-temp-bar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 5px 8px; border-radius: 10px;
  background: rgba(16, 30, 48, 0.92); border: 1px solid #3c5c74;
  font-size: 10.5px; color: #c7dfe8;
}
.sanc-temp-bar.active { border-color: #66b0aa; }
.sanc-temp-bar .temp-readout {
  display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #fff2c4; margin-right: 2px; white-space: nowrap;
}
.sanc-temp-bar .temp-btn {
  padding: 2px 7px; border-radius: 7px; font-size: 10px; font-weight: 700;
  background: #1a3348; color: #d5ece0; border: 1px solid #446982; cursor: pointer; white-space: nowrap;
}
.sanc-temp-bar .temp-btn.active { background: #2d5f72; color: #fff2c4; border-color: #f7cf86; }
.sanc-temp-bar .temp-btn.cold.active { background: #1d4e72; border-color: #78d4ff; color: #dff7ff; }
.sanc-temp-bar .temp-btn.warm.active { background: #6b3b20; border-color: #f7cf86; color: #fff2c4; }

/* Thermal Fish Badges, Flora 6-State Badges & O2 / Shelter Prop Pills */
.temp-pill, .thermal-status-pill, .o2-pill, .shelter-pill {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px; border-radius: 999px; font-size: 9.5px; font-weight: 700; white-space: nowrap;
}
.temp-pill.cold { background: #163954; color: #9ee4ff; border: 1px solid #4ea2d4; }
.temp-pill.temperate { background: #1a3c42; color: #b5e4db; border: 1px solid #4e8c86; }
.temp-pill.warm { background: #562d1b; color: #ffd49e; border: 1px solid #e19848; }

.thermal-status-pill.optimal { background: #194234; color: #a8f0bc; border: 1px solid #54a870; }
.thermal-status-pill.mild { background: #4c3a1a; color: #ffe09e; border: 1px solid #d49c42; }
.thermal-status-pill.severe { background: #692026; color: #ffd0c6; border: 1px solid #e66b58; }

.o2-pill { background: #163b48; color: #a6ebf0; border: 1px solid #4ca6b5; }
.shelter-pill { background: #2b3248; color: #d0d4f0; border: 1px solid #727ba6; }

.flora-cell.seeding { border-color: #f7cf86; color: #fff2c4; background: rgba(44, 46, 26, 0.88); }
.flora-cell.seeding .flora-bar > i { background: linear-gradient(90deg, #8ab674, #f7cf86); }
.flora-cell.stressed { border-color: #de6d58; color: #ffc8bc; background: rgba(58, 28, 28, 0.86); }
.flora-cell.stressed .flora-bar > i { background: #de6d58; }

.thermal-inspect-box {
  padding: 7px 9px; border-radius: 10px; font-size: 11px; line-height: 1.45;
  background: rgba(16, 36, 52, 0.9); border: 1px solid #4a788e; color: #d5ece0;
}
.thermal-inspect-box.optimal { border-color: #54a870; background: rgba(20, 48, 42, 0.9); }
.thermal-inspect-box.mild { border-color: #d49c42; background: rgba(54, 40, 22, 0.9); color: #ffe8bd; }
.thermal-inspect-box.severe { border-color: #e66b58; background: rgba(66, 24, 28, 0.92); color: #ffd6cc; }

/* Interactive Attribute Tooltip (Hover on Desktop + Click/Tap Everywhere + Top-Layer Dialog Safe) */
[data-tip] {
  cursor: help;
}
.habitat-stage:not(.drop-armed):not(.layout-armed) .habitat-pill[data-tip] {
  pointer-events: auto;
  transition: filter 120ms ease, transform 120ms ease;
}
.habitat-stage:not(.drop-armed):not(.layout-armed) .habitat-pill[data-tip]:hover,
.bay-badge[data-tip]:hover,
.stat-cell[data-tip]:hover,
.meter-line[data-tip]:hover,
.flora-cell[data-tip]:hover {
  filter: brightness(1.14);
}
.bay-badge[data-tip] { pointer-events: auto; }
.stat-cell[data-tip], .meter-line[data-tip], .flora-cell[data-tip], .thermal-inspect-box[data-tip] {
  transition: border-color 140ms ease, filter 140ms ease;
}
.stat-cell[data-tip]:hover, .stat-cell[data-tip]:focus-visible,
.flora-cell[data-tip]:hover, .flora-cell[data-tip]:focus-visible {
  border-color: #9fd3ca;
  outline: none;
}
.attr-chip-inline {
  border-bottom: 1px dotted rgba(159, 211, 202, 0.58);
  padding-bottom: 0.5px;
}
.mini-stat-line {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.mini-stat-chip {
  display: inline-flex; align-items: center; gap: 1px;
  padding: 0 3px; border-radius: 4px;
  background: rgba(20, 42, 60, 0.55); border: 1px solid rgba(114, 154, 174, 0.28);
}
.mini-stat-chip:hover { border-color: #9fd3ca; color: #fff2c4; }

.attr-tooltip {
  position: fixed;
  z-index: 9999;
  width: max-content;
  max-width: min(296px, calc(100vw - 20px));
  padding: 9px 11px 10px;
  border-radius: 10px;
  background: rgba(11, 23, 38, 0.97);
  border: 1.5px solid #84c8be;
  box-shadow: 0 10px 28px rgba(4, 10, 18, 0.78), 0 0 0 1px rgba(247, 207, 134, 0.16) inset;
  color: #e4f2ec;
  font-size: 11.5px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 110ms ease, transform 110ms ease;
}
.attr-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}
.attr-tooltip.pinned {
  pointer-events: auto;
  border-color: #f7cf86;
}
.attr-tip-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 4px; padding-bottom: 4px;
  border-bottom: 1px solid rgba(132, 200, 190, 0.25);
}
.attr-tip-head strong {
  color: #fff2c4; font-size: 12.5px; letter-spacing: 0.02em;
}
.attr-tip-tag {
  font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px;
  background: rgba(52, 92, 108, 0.65); color: #b5e8df; white-space: nowrap;
}
.attr-tip-body {
  margin: 0; color: #d5e9e4;
}
.attr-tip-extra {
  margin: 5px 0 0; padding-top: 4px;
  border-top: 1px dashed rgba(159, 211, 202, 0.24);
  color: #f7cf86; font-size: 11px;
}

/* Benthic Species Group Pills (虾/蟹/蛇/鳗) & Ground Trap UI */
.group-pill {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px; border-radius: 999px; font-size: 9.5px; font-weight: 700; white-space: nowrap;
}
.group-pill.shrimp { background: #4a281c; color: #ffcca6; border: 1px solid #d97848; }
.group-pill.crab   { background: #1d4034; color: #a8f0c8; border: 1px solid #58a678; }
.group-pill.snake  { background: #3b2434; color: #ffd0c6; border: 1px solid #cc6670; }
.group-pill.eel    { background: #222e4a; color: #c4d8ff; border: 1px solid #6b88c4; }

.bay-badge.trap-badge {
  pointer-events: auto; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(24, 52, 68, 0.94); color: #d8f2ec; border: 1px solid #66b0aa;
  font-family: inherit;
}
.bay-badge.trap-badge.ready { background: rgba(62, 46, 20, 0.95); color: #fff2c4; border-color: #f7cf86; }
.bay-badge.trap-badge.broken { background: rgba(112, 32, 34, 0.96); color: #ffd4cc; border-color: #ef6f5c; }

.gear-head-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px;
}
.gear-head-row.spaced { margin-top: 12px; }

.trap-bait-box {
  padding: 8px 10px; border-radius: 10px; margin: 8px 0 10px;
  background: rgba(14, 29, 44, 0.88); border: 1px solid #35546a;
}
.trap-bait-box h4 { margin: 0; font-size: 12px; color: #fff2c4; }
.trap-bait-strip {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 6px;
}
.trap-bait-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: 8px; font-size: 11px; font-weight: 700;
  background: #172e44; color: #cde2ec; border: 1px solid #3f6078; cursor: pointer;
}
.trap-bait-chip.strong { border-color: #9e5a44; }
.trap-bait-chip.active { background: #29596e; color: #fff2c4; border-color: #f7cf86; }
.trap-bait-chip:disabled { opacity: 0.42; cursor: not-allowed; }

.trap-list { display: flex; flex-direction: column; gap: 9px; }
.trap-card {
  display: flex; flex-direction: column; gap: 7px;
  padding: 10px; border-radius: 11px;
  background: rgba(16, 33, 50, 0.92); border: 1.5px solid #3c6078;
}
.trap-card.deployed { border-color: #66b0aa; background: rgba(16, 42, 54, 0.94); }
.trap-card.broken { border-color: #de6d58; background: rgba(58, 22, 26, 0.92); }
.trap-card.locked { opacity: 0.68; border-style: dashed; }
.trap-card-top { display: flex; align-items: flex-start; gap: 9px; }
.trap-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.trap-card-head { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.trap-card-head b { font-size: 13px; color: #fff2c4; }

.trap-risk-pill {
  display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 999px;
  font-size: 9.5px; font-weight: 700; white-space: nowrap;
}
.trap-risk-pill.safe   { background: #193d32; color: #a8f0bc; border: 1px solid #4c9c70; }
.trap-risk-pill.warn   { background: #4a3819; color: #ffe09e; border: 1px solid #d49c42; }
.trap-risk-pill.danger { background: #5e2420; color: #ffc8bc; border: 1px solid #e66b58; }
.trap-risk-pill.broken { background: #731d24; color: #ffd4cc; border: 1px solid #ff7a6b; }

.trap-dur-row {
  display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: #b9d4df;
}
.trap-dur-track {
  flex: 1; height: 6px; border-radius: 99px; background: #0e1d2c; overflow: hidden;
  border: 1px solid rgba(114, 154, 174, 0.35);
}
.trap-dur-fill {
  height: 100%; background: linear-gradient(90deg, #4fa888, #9fd3ca); transition: width 180ms ease;
}
.trap-dur-fill.warn { background: linear-gradient(90deg, #d49c42, #f7cf86); }
.trap-dur-fill.danger { background: linear-gradient(90deg, #c9463e, #f07d68); }

.trap-catch-strip {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  padding: 5px 7px; border-radius: 8px; background: rgba(10, 22, 34, 0.72);
}
.trap-catch-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 6px; font-size: 10.5px; font-weight: 700;
  background: rgba(26, 52, 70, 0.85); color: #e6f4ef; border: 1px solid #3f6680;
}
.trap-warn-box {
  padding: 5px 8px; border-radius: 7px; font-size: 11px; line-height: 1.4;
  background: rgba(98, 30, 32, 0.55); border: 1px solid rgba(230, 107, 88, 0.65); color: #ffd6cc;
}
.trap-card-actions {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.atlas-route-note {
  margin-top: 5px; padding: 5px 8px; border-radius: 7px;
  font-size: 10.5px; line-height: 1.45;
  background: rgba(58, 28, 34, 0.52); border: 1px solid rgba(222, 109, 88, 0.45);
  color: #f5d8cc;
}
.atlas-route-note b { color: #ffd49e; }
.atlas-route-teaser {
  margin-top: 5px; padding: 5px 8px; border-radius: 7px;
  font-size: 10.5px; line-height: 1.4; cursor: pointer;
  background: rgba(20, 38, 54, 0.72); border: 1px dashed #4c748c; color: #9fc2d0;
}
.atlas-route-teaser:hover { border-color: #f7cf86; color: #fff2c4; }

/* Euryhaline (广盐性), Salinity Vitality & Knowledge Tomes */
.tome-icon {
  display: inline-block; flex: none;
  width: 32px; height: 32px;
  background-image: url("assets/tome-icons.png");
  background-repeat: no-repeat;
  background-size: 160px 32px;
  background-position: calc(var(--tome-i, 0) * -32px) 0;
  image-rendering: pixelated;
}
.tome-icon.sm { width: 24px; height: 24px; background-size: 120px 24px; background-position: calc(var(--tome-i, 0) * -24px) 0; }
.tome-icon.mini { width: 16px; height: 16px; background-size: 80px 16px; background-position: calc(var(--tome-i, 0) * -16px) 0; vertical-align: -3px; }

.eury-pill {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px; border-radius: 999px; font-size: 9.5px; font-weight: 700; white-space: nowrap;
  background: linear-gradient(90deg, #1a4b68, #1d5748); color: #e2fff4; border: 1px solid #7de0c8;
}
.vitality-pill {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px; border-radius: 999px; font-size: 9.5px; font-weight: 700; white-space: nowrap;
}
.vitality-pill.acclimating, .vitality-pill.recovering { background: #1d3c52; color: #9ee4ff; border: 1px solid #4ea2d4; }
.vitality-pill.weakened { background: #4a351c; color: #ffe09e; border: 1px solid #d49c42; }
.vitality-pill.critical, .vitality-pill.exhausted { background: #642228; color: #ffd4cc; border: 1px solid #e66b58; }
.mini-bar.vitality i { background: linear-gradient(90deg, #4ea2d4, #7de0c8); }
.mini-bar.vitality.low i { background: #de6d58; }

.tome-atlas-grid { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.tome-card {
  display: flex; flex-direction: column; gap: 7px;
  padding: 10px 11px; border-radius: 11px;
  background: rgba(16, 33, 50, 0.94); border: 1.5px solid #5c8a9e;
}
.tome-card.locked {
  border-style: dashed; border-color: #3b586e; background: rgba(14, 26, 39, 0.78);
}
.tome-card.locked .tome-icon { filter: brightness(0.42) saturate(0.35); }
.tome-card-head { display: flex; align-items: flex-start; gap: 9px; }
.tome-card-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tome-card-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tome-card-title b { font-size: 13px; color: #fff2c4; }
.tome-lore { margin: 0; font-size: 11px; line-height: 1.5; color: #a7c6d4; font-style: italic; }
.tome-sections { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; border-top: 1px solid rgba(132, 200, 190, 0.22); }
.tome-sec-item {
  padding: 6px 8px; border-radius: 8px;
  background: rgba(11, 24, 38, 0.78); border-left: 2.5px solid #66b0aa;
}
.tome-sec-item strong { display: block; font-size: 11.5px; color: #f7cf86; margin-bottom: 2px; }
.tome-sec-item p { margin: 0; font-size: 11px; line-height: 1.5; color: #d5ebe4; }

/* Auto-State Machines (运行 / 休眠) & Satiety Meter */
.meat-proc-box .habitat-sec-head { flex-wrap: wrap; gap: 4px 8px; }
.meat-proc-box .habitat-sec-head h3 { flex-wrap: wrap; }
.machine-state-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap;
}
.machine-state-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none;
}
.machine-state-pill.running {
  background: rgba(24, 72, 54, 0.92); color: #b8f6cb; border: 1px solid #59c98a;
}
.machine-state-pill.running::before { background: #6ee89e; box-shadow: 0 0 6px #6ee89e; }
.machine-state-pill.dormant {
  background: rgba(26, 38, 52, 0.88); color: #94aec0; border: 1px solid #486278;
}
.machine-state-pill.dormant::before { background: #6a8396; }
.machine-queue-row {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  padding: 5px 7px; border-radius: 8px; background: rgba(11, 23, 36, 0.78); border: 1px solid #2e4b62;
}
.machine-queue-chip {
  display: inline-flex; align-items: center; gap: 3px; cursor: pointer;
  padding: 2px 7px; border-radius: 7px; font-size: 10.5px; font-weight: 700;
  background: rgba(26, 56, 70, 0.9); color: #ffecc8; border: 1px solid #66a8a2;
}
.machine-queue-chip:hover { border-color: #f7cf86; background: rgba(42, 74, 88, 0.96); }
.mini-bar.satiety i { background: linear-gradient(90deg, #5ea870, #8cd694); }
.mini-bar.satiety.mid i { background: #e1a348; }
.mini-bar.satiety.low i { background: #de6d58; }
