/* ABYSS AQUARIUM — pixel management UI */
:root {
  --ink: #050f14;
  --stage: #07141b;
  --panel: #081a22;
  --panel-2: #0b232c;
  --panel-3: #102e37;
  --line: #245257;
  --line-soft: #173a40;
  --brass: #c9a86a;
  --brass-hi: #f0d69a;
  --gold: #f6d78a;
  --aqua: #9ce8d8;
  --teal: #3fa6a0;
  --coral: #e07a5f;
  --bone: #e8dfc8;
  --muted: #7fa39e;
  --dim: #4e716d;
  --font: "Fusion Pixel 12px Monospaced SC", "SimSun", "宋体", monospace;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; }
body {
  background: #040b10;
  color: var(--bone);
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.5;
  -webkit-font-smoothing: none;
  font-smooth: never;
}
button, input, textarea, select { font-family: var(--font); }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.hidden { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
b { font-weight: normal; }

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(20, 64, 66, 0.18), transparent 62%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px),
    #040b10;
}
#app::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 48%, rgba(0, 0, 0, 0.55) 100%);
}

#stage {
  position: relative;
  flex: 0 0 auto;
  width: 1440px;
  height: 810px;
  transform: scale(var(--stage-scale, 1));
  transform-origin: center center;
  background: var(--stage);
  box-shadow: 0 0 0 2px #183a40, 0 0 0 5px #061116, 0 30px 90px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}
#gameCanvas {
  position: absolute;
  inset: 0;
  width: 1440px;
  height: 810px;
  display: block;
  background: #06131a;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
}

/* ---------- top bar ---------- */
.topbar {
  position: absolute;
  left: 0; top: 0;
  width: 1440px; height: 56px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: linear-gradient(180deg, #0a2029 0%, #06151c 100%);
  border-bottom: 2px solid var(--line);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: 2px;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(201, 168, 106, 0.5) 0 6px, transparent 6px 12px);
  pointer-events: none;
}
.brand { width: 230px; flex: 0 0 230px; display: flex; flex-direction: column; line-height: 1; letter-spacing: 0.18em; }
.brand-abyss { color: var(--gold); font-size: 20px; letter-spacing: 0.24em; text-shadow: 2px 2px 0 #09232a; }
.brand-aquarium { color: var(--aqua); font-size: 9px; letter-spacing: 0.38em; margin-top: 3px; }
.brand-deep { display: none; }
.topstats { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; }
.topstat {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--line-soft);
  background: #071820;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.topstat .lbl { color: var(--dim); font-size: 9px; letter-spacing: 0.08em; }
.topstat b { color: var(--bone); font-size: 14px; line-height: 1; }
.daystat b { color: var(--gold); font-size: 15px; }
.clock { color: var(--aqua); font-size: 13px; margin-left: 4px; }
.moneystat { min-width: 106px; }
.moneystat b { color: var(--gold); font-size: 16px; }
.moneystat .lbl { color: var(--brass); }
.coin { width: 8px; height: 8px; display: inline-block; background: var(--gold); box-shadow: 2px 0 0 #b9873d, 0 2px 0 #b9873d, 2px 2px 0 #8c6129; }
.repstat b { color: var(--gold); letter-spacing: 1px; }
.topactions { display: flex; gap: 5px; flex: 0 0 auto; }

/* ---------- buttons ---------- */
.pixel-btn {
  background: #0d2933;
  color: var(--bone);
  border: 2px solid #2d6266;
  padding: 5px 9px;
  font-size: 11px;
  line-height: 1.25;
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.32), inset 2px 2px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
}
.pixel-btn:hover { background: #12343e; border-color: var(--gold); color: var(--gold); }
.pixel-btn:active { transform: translate(1px, 1px); box-shadow: none; }
.pixel-btn.primary { background: var(--gold); border-color: var(--brass-hi); color: #14211e; }
.pixel-btn.primary:hover { background: #ffe7a8; color: #0b1713; }
.pixel-btn.ghost { background: transparent; border-color: #2d6266; color: var(--muted); }
.pixel-btn.ghost:hover { color: var(--gold); border-color: var(--gold); }
.pixel-btn.danger { border-color: #713c35; color: var(--coral); }
.pixel-btn.danger:hover { background: #331d1a; border-color: var(--coral); color: #ffb099; }
.pixel-btn.small { font-size: 10px; padding: 4px 6px; }
.pixel-btn.square { width: 30px; height: 30px; padding: 0; font-size: 13px; }
.pixel-btn:disabled { opacity: 0.4; cursor: not-allowed; filter: saturate(0.5); }
.pixel-btn:disabled:hover { background: #0d2933; border-color: #2d6266; color: var(--bone); }

/* ---------- sidebar ---------- */
.sidebar {
  position: absolute;
  right: 32px; top: 64px;
  width: 304px; height: 726px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px;
  background:
    linear-gradient(180deg, rgba(20, 52, 58, 0.22), transparent 26%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px),
    #071820;
  border: 2px solid var(--brass);
  box-shadow: 0 0 0 2px #092028, 6px 6px 0 rgba(0, 0, 0, 0.42);
}
.sidebar::before {
  content: "";
  position: absolute;
  left: 6px; right: 6px; top: 4px;
  height: 1px;
  background: rgba(240, 214, 154, 0.35);
  pointer-events: none;
}
.side-head { height: 24px; display: flex; align-items: center; gap: 7px; border-bottom: 1px solid var(--line-soft); padding-bottom: 5px; }
.side-mark { width: 9px; height: 9px; background: var(--aqua); box-shadow: 2px 0 0 #2c7772, 0 2px 0 #2c7772, 2px 2px 0 #164b48; }
.side-title { flex: 1; color: var(--gold); font-size: 14px; letter-spacing: 0.16em; }
.side-day { color: var(--dim); font-size: 9px; letter-spacing: 0.1em; }

.selection {
  min-height: 216px;
  border: 1px solid var(--line-soft);
  background: #06141a;
  padding: 8px;
}
.selection-empty {
  min-height: 198px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--dim);
  text-align: center;
  border: 1px dashed #1a3d42;
}
.selection-empty p { font-size: 11px; line-height: 1.8; color: #6f938d; }
.cursor-mark { width: 24px; height: 24px; position: relative; opacity: 0.8; }
.cursor-mark::before, .cursor-mark::after {
  content: "";
  position: absolute;
  background: var(--aqua);
  opacity: 0.7;
}
.cursor-mark::before { left: 11px; top: 0; width: 2px; height: 24px; }
.cursor-mark::after { left: 0; top: 11px; width: 24px; height: 2px; }
.cursor-mark { box-shadow: inset 0 0 0 2px transparent; }

.selection-top { display: flex; gap: 8px; align-items: flex-start; }
#fishPreview {
  width: 112px; height: 72px;
  flex: 0 0 112px;
  background: radial-gradient(ellipse at 50% 50%, #0d2e37, #051116);
  border: 1px solid #1d4348;
  image-rendering: pixelated;
}
.fish-id { min-width: 0; padding-top: 2px; }
.fish-id h3 { color: var(--gold); font-size: 16px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fish-id p { color: var(--muted); font-size: 10px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rarity { display: inline-block; margin-top: 6px; padding: 1px 5px; border: 1px solid #2d6266; color: var(--aqua); font-size: 8px; letter-spacing: 0.08em; }
.rarity.rare { color: var(--gold); border-color: #7b6338; }
.rarity.legendary { color: var(--coral); border-color: #7c4238; }

.bars { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: flex; align-items: center; gap: 6px; }
.bar-row > span { width: 28px; color: var(--dim); font-size: 9px; flex: 0 0 28px; }
.bar {
  flex: 1;
  height: 8px;
  background: #10252c;
  border: 1px solid #1d3f45;
  overflow: hidden;
}
.bar-fill { display: block; height: 100%; width: 50%; transition: width 0.25s steps(5); }
.bar-fill.hunger { background: repeating-linear-gradient(90deg, #d9b15f 0 5px, transparent 5px 7px); }
.bar-fill.happiness { background: repeating-linear-gradient(90deg, #64c7b9 0 5px, transparent 5px 7px); }
.bar-fill.bond { background: repeating-linear-gradient(90deg, #d98670 0 5px, transparent 5px 7px); }

.fish-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 8px; }
.fish-hint { margin-top: 6px; color: #62817b; font-size: 9px; line-height: 1.55; min-height: 14px; }

.side-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.nav-btn {
  min-height: 41px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  text-align: left;
  padding: 5px 7px;
  background: #0a222b;
  border: 1px solid #1d464c;
  color: var(--bone);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.nav-btn:hover { border-color: var(--brass); background: #102f38; }
.nav-main { font-size: 12px; color: var(--bone); letter-spacing: 0.06em; }
.nav-btn:hover .nav-main { color: var(--gold); }
.nav-sub { font-size: 8px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-btn.has-alert .nav-sub { color: var(--gold); }

.side-stats {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.8fr;
  gap: 4px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 5px 0;
}
.side-stats > div { min-width: 0; padding: 0 4px; border-right: 1px solid #143238; }
.side-stats > div:last-child { border-right: none; }
.stat-k { display: block; color: var(--dim); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-stats b { color: var(--aqua); font-size: 13px; }
.stat-u { color: var(--dim); font-size: 8px; margin-left: 1px; }

.log-panel { flex: 1; min-height: 112px; display: flex; flex-direction: column; border: 1px solid #173a40; background: #051319; overflow: hidden; }
.log-head { height: 22px; flex: 0 0 22px; display: flex; align-items: center; justify-content: space-between; padding: 0 7px; border-bottom: 1px solid #173a40; color: var(--muted); font-size: 9px; letter-spacing: 0.08em; }
.log-live { color: var(--teal); font-size: 8px; animation: blink 1.8s steps(2) infinite; }
.log-list { flex: 1; overflow-y: auto; padding: 4px 7px 6px; font-size: 9px; line-height: 1.55; color: #7fa39e; }
.log-entry { padding: 2px 0; border-bottom: 1px dotted rgba(126, 163, 158, 0.12); }
.log-entry:last-child { border-bottom: none; }
.log-t { color: var(--brass); margin-right: 4px; }
.log-entry.good { color: var(--aqua); }
.log-entry.warn { color: var(--coral); }

/* ---------- overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.overlay.hidden { display: none; }

.start-screen {
  background:
    radial-gradient(ellipse at 50% 38%, rgba(16, 58, 62, 0.36), rgba(2, 8, 11, 0.9) 68%),
    linear-gradient(180deg, rgba(3, 12, 16, 0.84), rgba(2, 7, 10, 0.96));
  z-index: 60;
}
.start-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(124, 198, 190, 0.028) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(201, 168, 106, 0.018) 0 1px, transparent 1px 6px);
  pointer-events: none;
}
.start-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 22% 26%, rgba(68, 156, 146, 0.22), transparent 45%),
    radial-gradient(ellipse at 78% 74%, rgba(201, 168, 106, 0.1), transparent 42%);
  pointer-events: none;
}
.start-inner {
  position: relative;
  width: 640px;
  padding: 30px 42px 26px;
  text-align: center;
  background: rgba(5, 17, 23, 0.82);
  border: 2px solid var(--brass);
  box-shadow: 0 0 0 2px #081a20, 0 0 0 5px rgba(201, 168, 106, 0.12), 0 30px 90px rgba(0, 0, 0, 0.6);
}
.start-inner::before, .start-inner::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border: 2px solid var(--brass);
  pointer-events: none;
}
.start-inner::before { left: -7px; top: -7px; border-right: none; border-bottom: none; }
.start-inner::after { right: -7px; bottom: -7px; border-left: none; border-top: none; }
.start-kicker { color: var(--aqua); font-size: 9px; letter-spacing: 0.28em; opacity: 0.8; }
.start-logo { display: flex; flex-direction: column; align-items: center; margin: 16px 0 0; color: var(--gold); line-height: 0.9; text-shadow: 3px 3px 0 #0a2c32, 6px 6px 0 rgba(0, 0, 0, 0.35); }
.start-logo span:first-child { font-size: 64px; letter-spacing: 0.12em; }
.start-logo span:last-child { font-size: 27px; letter-spacing: 0.34em; color: var(--bone); margin-top: 7px; text-shadow: 2px 2px 0 #082229; }
.start-cn { margin-top: 15px; color: var(--aqua); font-size: 22px; letter-spacing: 0.42em; }
.start-copy { margin-top: 12px; color: #87a7a0; font-size: 11px; line-height: 1.85; }
.start-rule { width: 78%; height: 2px; margin: 20px auto 18px; background: repeating-linear-gradient(90deg, var(--brass) 0 7px, transparent 7px 13px); opacity: 0.6; }
.start-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.start-btn { min-width: 132px; height: 38px; font-size: 12px; letter-spacing: 0.08em; }
.start-foot { margin-top: 16px; color: #53736e; font-size: 9px; letter-spacing: 0.04em; }

.pause-screen { z-index: 70; background: rgba(2, 8, 11, 0.78); }
.pause-card { width: 360px; padding: 28px 30px; text-align: center; background: #081a22; border: 2px solid var(--brass); box-shadow: 0 0 0 2px #061116, 8px 8px 0 rgba(0, 0, 0, 0.35); }
.pause-kicker { color: var(--aqua); font-size: 9px; letter-spacing: 0.28em; }
.pause-card h2 { margin: 10px 0 8px; color: var(--gold); font-size: 24px; letter-spacing: 0.12em; }
.pause-card p { color: var(--muted); font-size: 11px; margin-bottom: 20px; }

/* ---------- modals ---------- */
.modal-layer { z-index: 80; background: rgba(2, 8, 11, 0.8); }
.pixel-window {
  width: 880px;
  max-height: 744px;
  display: flex;
  flex-direction: column;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.016) 0 1px, transparent 1px 3px),
    #081a22;
  border: 3px solid var(--brass);
  box-shadow: 0 0 0 3px #07141b, 10px 10px 0 rgba(0, 0, 0, 0.42);
}
.pw-head {
  height: 42px;
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 14px;
  background: #0c2730;
  border-bottom: 2px solid var(--line);
}
.pw-kicker { color: var(--brass); font-size: 8px; letter-spacing: 0.18em; opacity: 0.8; }
.pw-title { flex: 1; color: var(--gold); font-size: 16px; letter-spacing: 0.1em; }
.pw-close {
  width: 26px; height: 26px;
  background: #071820;
  border: 2px solid #2d6266;
  color: var(--bone);
  font-size: 13px;
  line-height: 1;
  padding: 0;
}
.pw-close:hover { border-color: var(--coral); color: var(--coral); }
.pw-body { padding: 14px 16px 18px; overflow-y: auto; }
.pw-body::-webkit-scrollbar, .log-list::-webkit-scrollbar, .mail-list::-webkit-scrollbar, .letter-view::-webkit-scrollbar { width: 8px; }
.pw-body::-webkit-scrollbar-track, .log-list::-webkit-scrollbar-track, .mail-list::-webkit-scrollbar-track, .letter-view::-webkit-scrollbar-track { background: #041015; }
.pw-body::-webkit-scrollbar-thumb, .log-list::-webkit-scrollbar-thumb, .mail-list::-webkit-scrollbar-thumb, .letter-view::-webkit-scrollbar-thumb { background: #285a5c; border: 2px solid #041015; }
.tabs { display: flex; gap: 3px; margin-bottom: 12px; border-bottom: 1px solid #1a4147; }
.tab {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--muted);
  font-size: 11px;
}
.tab:hover { color: var(--gold); }
.tab.active { background: #0c2730; border-color: #2b5b60; color: var(--gold); margin-bottom: -1px; }
.empty { padding: 34px 20px; text-align: center; color: var(--dim); font-size: 11px; line-height: 1.9; border: 1px dashed #1b4045; }
.modal-note { color: var(--dim); font-size: 9.5px; line-height: 1.7; margin-top: 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; padding-top: 10px; border-top: 1px solid #173a40; }

/* shop */
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shop-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 9px;
  min-height: 104px;
  padding: 8px;
  background: #0a212a;
  border: 1px solid #1d464c;
}
.shop-card:hover { border-color: var(--brass); background: #0e2a34; }
.shop-thumb { width: 104px; height: 78px; background: radial-gradient(ellipse at 50% 50%, #0d2d36, #051116); border: 1px solid #173a40; image-rendering: pixelated; align-self: center; }
.shop-info { min-width: 0; display: flex; flex-direction: column; }
.shop-name { color: var(--bone); font-size: 13px; line-height: 1.25; display: flex; align-items: center; gap: 5px; }
.shop-en { color: var(--dim); font-size: 8px; letter-spacing: 0.08em; }
.rarity-tag { display: inline-block; padding: 0 4px; border: 1px solid #2a5c60; color: var(--aqua); font-size: 8px; line-height: 1.5; }
.rarity-tag.rare { color: var(--gold); border-color: #74603a; }
.rarity-tag.legendary { color: var(--coral); border-color: #743f36; }
.shop-desc { color: #6f8f89; font-size: 9px; line-height: 1.55; margin-top: 4px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-buy { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 5px; }
.price { color: var(--gold); font-size: 13px; }
.price::after { content: " G"; color: var(--brass); font-size: 9px; }
.shop-buy .pixel-btn { min-width: 56px; }

/* letter */
.letter-layout { display: grid; grid-template-columns: 236px 1fr; gap: 10px; min-height: 420px; }
.mail-list { max-height: 470px; overflow-y: auto; border: 1px solid #1a4147; background: #06141a; }
.mail-item { padding: 8px 9px; border-bottom: 1px solid #14343a; cursor: pointer; }
.mail-item:hover { background: #0c2830; }
.mail-item.active { background: #10323a; border-left: 2px solid var(--gold); }
.mail-item.unread .mail-from { color: var(--gold); }
.mail-from { display: flex; justify-content: space-between; gap: 4px; color: var(--aqua); font-size: 11px; }
.mail-date { color: var(--dim); font-size: 8px; }
.mail-sub { color: var(--muted); font-size: 9px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-gift { color: var(--coral); font-size: 8px; margin-top: 2px; }
.letter-view { max-height: 470px; overflow-y: auto; padding: 2px; }
.letter-paper {
  position: relative;
  min-height: 350px;
  padding: 24px 26px 22px;
  background:
    repeating-linear-gradient(0deg, rgba(84, 67, 40, 0.04) 0 1px, transparent 1px 22px),
    #e8dfc8;
  color: #253431;
  border: 2px solid #b9a77f;
  box-shadow: inset 0 0 0 5px #e8dfc8, inset 0 0 0 6px rgba(84, 67, 40, 0.15), 4px 4px 0 rgba(0, 0, 0, 0.25);
}
.letter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(84, 67, 40, 0.32); padding-bottom: 9px; margin-bottom: 14px; }
.letter-kicker { color: #806f4e; font-size: 8px; letter-spacing: 0.2em; }
.letter-title { color: #2b3e37; font-size: 18px; letter-spacing: 0.08em; margin-top: 3px; }
.letter-stamp { width: 34px; height: 40px; border: 2px dashed #9b5d4b; color: #a34f3d; display: grid; place-items: center; font-size: 13px; transform: rotate(3deg); opacity: 0.8; flex: 0 0 auto; }
.letter-body { font-size: 12px; line-height: 2; color: #35443d; white-space: pre-wrap; }
.letter-sign { text-align: right; color: #79684b; font-size: 10px; margin-top: 22px; }
.letter-gift { margin-top: 14px; padding: 6px 8px; border: 1px dashed #b08b5e; color: #8b5c3d; font-size: 10px; background: rgba(255, 250, 238, 0.32); }
.letter-empty { min-height: 350px; display: grid; place-items: center; color: var(--dim); font-size: 11px; text-align: center; border: 1px dashed #1a4147; line-height: 1.9; }
.letter-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--dim); font-size: 9px; }
.compose-layout { display: grid; grid-template-columns: 1fr 300px; gap: 14px; }
.compose-form { border: 1px solid #1a4147; padding: 12px; background: #071a21; }
.form-label { display: block; color: var(--muted); font-size: 10px; margin: 9px 0 5px; }
.form-label:first-child { margin-top: 0; }
.fish-choice-row { display: flex; flex-wrap: wrap; gap: 4px; }
.fish-choice { padding: 4px 7px; background: #0b232c; border: 1px solid #235158; color: var(--muted); font-size: 10px; }
.fish-choice:hover { border-color: var(--brass); color: var(--bone); }
.fish-choice.active { background: #143b43; border-color: var(--gold); color: var(--gold); }
.prompt-chips { display: flex; flex-direction: column; gap: 5px; }
.prompt-chip { display: block; width: 100%; text-align: left; padding: 7px 9px; background: #0b232c; border: 1px solid #235158; color: var(--bone); font-size: 10px; line-height: 1.5; }
.prompt-chip:hover { border-color: var(--brass); }
.prompt-chip.active { border-color: var(--gold); background: #12363e; color: var(--gold); }
.prompt-chip span { color: var(--dim); font-size: 8px; margin-left: 5px; }
.pixel-textarea {
  width: 100%;
  min-height: 62px;
  resize: none;
  background: #041016;
  border: 1px solid #1f4b50;
  color: var(--bone);
  padding: 7px 8px;
  font-size: 11px;
  line-height: 1.7;
}
.pixel-textarea::placeholder { color: #496a65; }
.textarea-count { text-align: right; color: var(--dim); font-size: 8px; margin-top: 2px; }
.compose-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.compose-aside { border: 1px solid #1a4147; background: #06141a; padding: 12px; color: var(--muted); font-size: 10px; line-height: 1.8; }
.compose-aside h4 { color: var(--gold); font-size: 11px; margin-bottom: 7px; }
.compose-aside p { color: #6a8b84; font-size: 9.5px; }
.compose-aside .letter-paper { margin-top: 9px; min-height: 150px; padding: 12px 14px; }
.compose-aside .letter-paper .letter-body { font-size: 10px; line-height: 1.8; }

/* staff */
.staff-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.staff-card { display: flex; flex-direction: column; gap: 7px; padding: 9px; background: #0a212a; border: 1px solid #1d464c; min-height: 222px; }
.staff-card.hired { border-color: #7d6a43; background: #0f2a32; }
.staff-portrait { width: 100%; height: 108px; background: radial-gradient(ellipse at 50% 50%, #0d2d36, #051116); border: 1px solid #173a40; image-rendering: pixelated; }
.staff-name { color: var(--bone); font-size: 13px; display: flex; justify-content: space-between; gap: 4px; }
.staff-role { color: var(--dim); font-size: 8px; }
.staff-desc { color: #71918a; font-size: 9px; line-height: 1.6; flex: 1; }
.staff-salary { color: var(--gold); font-size: 10px; }
.staff-actions { display: flex; gap: 4px; }
.staff-actions .pixel-btn { flex: 1; }

/* decor */
.decor-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.decor-card { padding: 6px; background: #0a212a; border: 1px solid #1d464c; display: flex; flex-direction: column; gap: 4px; min-height: 136px; }
.decor-card:hover { border-color: var(--brass); }
.decor-thumb { width: 100%; height: 74px; background: radial-gradient(ellipse at 50% 60%, #0d2d36, #051116); border: 1px solid #173a40; image-rendering: pixelated; }
.decor-name { color: var(--bone); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.decor-meta { display: flex; justify-content: space-between; color: var(--dim); font-size: 8px; }
.decor-meta b { color: var(--aqua); font-weight: normal; }
.decor-card .pixel-btn { width: 100%; margin-top: auto; }
.decor-card.placed { border-color: #5a5f42; }
.decor-card.placed .decor-name { color: var(--gold); }
.section-title { display: flex; align-items: center; gap: 7px; color: var(--gold); font-size: 12px; margin: 4px 0 8px; letter-spacing: 0.08em; }
.section-title::after { content: ""; flex: 1; height: 1px; background: #1e464c; }

/* music */
.music-layout { display: grid; grid-template-columns: 1fr 250px; gap: 14px; }
.track-list { display: flex; flex-direction: column; gap: 5px; }
.track { display: flex; align-items: center; gap: 9px; padding: 8px; background: #0a212a; border: 1px solid #1d464c; color: var(--bone); text-align: left; }
.track:hover { border-color: var(--brass); }
.track.active { border-color: var(--gold); background: #12343d; }
.track-index { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #2d6266; color: var(--aqua); font-size: 9px; }
.track.active .track-index { color: var(--gold); border-color: var(--gold); }
.track-main { flex: 1; }
.track-title { font-size: 11px; }
.track-desc { color: var(--dim); font-size: 8px; margin-top: 2px; }
.track-state { color: var(--dim); font-size: 8px; }
.track.active .track-state { color: var(--gold); }
.music-side { border: 1px solid #1a4147; padding: 12px; background: #06141a; }
.volume-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.volume-row input[type="range"] { flex: 1; accent-color: var(--gold); height: 4px; }
.music-side .pixel-btn { width: 100%; margin-top: 8px; }
.music-now { margin-top: 16px; padding-top: 10px; border-top: 1px solid #1a4147; color: var(--dim); font-size: 9px; line-height: 1.7; }
.music-now b { color: var(--aqua); font-weight: normal; }

/* help */
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.help-block { border: 1px solid #1a4147; padding: 10px; background: #071a21; }
.help-block h4 { color: var(--gold); font-size: 11px; margin-bottom: 6px; }
.help-block p, .help-block li { color: #71918a; font-size: 9.5px; line-height: 1.75; }
.help-block ul { margin: 0; padding-left: 14px; }
.key { display: inline-block; padding: 0 4px; border: 1px solid #2d6266; color: var(--aqua); font-size: 8px; line-height: 1.5; }
.tutorial { padding: 4px 2px; }
.tutorial-step { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dotted #1a4147; }
.tutorial-step:last-child { border-bottom: none; }
.tutorial-num { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border: 1px solid var(--brass); color: var(--gold); font-size: 10px; }
.tutorial-step h4 { color: var(--bone); font-size: 11px; margin-bottom: 3px; }
.tutorial-step p { color: #71918a; font-size: 9.5px; line-height: 1.7; }

/* summary */
.summary-hero { text-align: center; padding: 8px 0 14px; border-bottom: 1px solid #1a4147; }
.summary-hero .kicker { color: var(--aqua); font-size: 9px; letter-spacing: 0.24em; }
.summary-hero h3 { color: var(--gold); font-size: 26px; margin: 6px 0 4px; letter-spacing: 0.1em; }
.summary-hero p { color: var(--muted); font-size: 10px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; }
.summary-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 9px; border: 1px solid #173a40; background: #071a21; color: var(--muted); font-size: 10px; }
.summary-row b { color: var(--bone); }
.summary-row.total { grid-column: 1 / -1; border-color: var(--brass); color: var(--gold); }
.summary-row.total b { color: var(--gold); font-size: 15px; }
.summary-actions { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }

/* toast + scanlines */
.toast-layer {
  position: absolute;
  top: 66px; left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}
.toast {
  max-width: 520px;
  padding: 6px 12px;
  background: #0b2530;
  border: 2px solid var(--brass);
  color: var(--bone);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
  animation: toast-in 0.18s steps(2) both, toast-out 0.25s 2.4s steps(2) forwards;
}
.toast.good { border-color: var(--teal); color: var(--aqua); }
.toast.warn { border-color: var(--coral); color: #ffb39d; }
.scanlines {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.1) 0 1px, transparent 1px 3px);
  opacity: 0.32;
  mix-blend-mode: multiply;
}

/* animations */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes pulse-glow { 0%, 100% { opacity: 0.65; } 50% { opacity: 1; } }

.rotate-hint {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  color: var(--aqua);
  background: #040b10;
  font-size: 14px;
  line-height: 2;
}
@media (max-width: 820px) and (orientation: portrait) {
  .rotate-hint { display: flex; }
}

/* readability and density pass */
.brand-aquarium { font-size: 10px; }
.topstat { font-size: 11px; }
.topstat .lbl { font-size: 10px; }
.topstat b { font-size: 15px; }
.clock { font-size: 14px; }
.side-day { font-size: 10px; }
.fish-id p { font-size: 11px; }
.rarity { font-size: 9px; }
.bar-row > span { font-size: 10px; width: 32px; flex-basis: 32px; }
.fish-hint { font-size: 10.5px; }
.nav-sub { font-size: 10px; }
.nav-btn { min-height: 44px; }
.log-head { font-size: 10px; }
.log-list { font-size: 10.5px; line-height: 1.6; }
.side-stats .stat-k { font-size: 9px; }
.side-stats b { font-size: 14px; }
.start-kicker { font-size: 10px; }
.start-copy { font-size: 11.5px; }
.start-foot { font-size: 10px; }
.pw-kicker { font-size: 9px; }
.tab { font-size: 12px; }
.shop-name { font-size: 14px; }
.shop-en { font-size: 9px; }
.shop-desc { font-size: 11px; line-height: 1.6; }
.shop-card { min-height: 120px; }
.price { font-size: 14px; }
.rarity-tag { font-size: 9px; }
.modal-note { font-size: 10.5px; }
.empty { font-size: 11px; }
.mail-from { font-size: 12px; }
.mail-date { font-size: 10px; color: #8fb0a7; }
.mail-sub { font-size: 10.5px; }
.mail-gift { font-size: 9.5px; }
.letter-kicker { font-size: 9px; }
.letter-body { font-size: 13px; line-height: 2; }
.letter-sign { font-size: 11px; }
.letter-gift { font-size: 11px; }
.letter-toolbar { font-size: 10px; }
.form-label { font-size: 11px; }
.fish-choice { font-size: 11px; }
.prompt-chip { font-size: 11px; }
.pixel-textarea { font-size: 12px; }
.textarea-count { font-size: 9px; }
.compose-aside { font-size: 11px; }
.compose-aside h4 { font-size: 12px; }
.compose-aside p { font-size: 10.5px; }
.staff-name { font-size: 14px; }
.staff-role { font-size: 9px; }
.staff-desc { font-size: 10.5px; }
.staff-salary { font-size: 11px; }
.staff-card { min-height: 244px; }
.decor-name { font-size: 11px; }
.decor-meta { font-size: 9px; }
.decor-card { min-height: 144px; }
.track-title { font-size: 12px; }
.track-desc { font-size: 9px; }
.track-state { font-size: 9px; }
.music-now { font-size: 10px; }
.help-block p, .help-block li { font-size: 10.5px; }
.tutorial-step p { font-size: 10.5px; }
.summary-row { font-size: 11px; }
.toast { font-size: 11px; }
.mood-whisper { font-size: 11px; }
.hotspot .spot-label { font-size: 11px; }

.top-ticker {
  width: 280px;
  flex: 0 0 280px;
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-left: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-ticker::before { content: "›"; color: var(--gold); margin-right: 6px; }

/* final legibility bump */
.brand-aquarium { font-size: 11px; }
.topstat, .topstat .lbl { font-size: 11px; }
.side-day { font-size: 11px; }
.nav-sub { font-size: 11px; }
.log-list { font-size: 11px; }
.fish-hint { font-size: 11px; }
.modal-note { font-size: 11px; }
.mail-sub { font-size: 11px; }
.shop-en { font-size: 10px; }
.staff-role { font-size: 10px; }
.decor-meta { font-size: 10px; }
.track-desc, .track-state { font-size: 10px; }
.textarea-count { font-size: 10px; }
.side-stats .stat-k { font-size: 10px; }
.top-ticker { font-size: 11px; }
.side-stats .stat-k { font-size: 11px; }
.shop-en { font-size: 11px; }
.rarity-tag { font-size: 11px; }
.pw-kicker { font-size: 10px; }
.start-kicker, .start-foot { font-size: 11px; }
.mail-date { font-size: 11px; }
.letter-kicker { font-size: 10px; }
.textarea-count { font-size: 11px; }
.staff-role { font-size: 11px; }
.decor-meta { font-size: 11px; }
.track-desc, .track-state, .music-now { font-size: 11px; }
.log-head { font-size: 11px; }
.pixel-btn.small { font-size: 11px; }
.rarity { font-size: 11px; }
.bar-row > span { font-size: 11px; }
.empty { font-size: 11px; }
.pw-kicker { font-size: 11px; }




