/* 摸一只鱼 v2 · 样式
 * 原则：屏幕上几乎没有 UI。字是宋体的、细的、少的。
 */
:root {
  --serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
  --ink: rgba(255, 255, 255, 0.86);
  --dim: rgba(255, 255, 255, 0.44);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* 必须最先声明：#menu / #overlay 自带 display:flex，
   否则会盖过 UA 的 [hidden]{display:none}（v1 踩过的同一个坑） */
[hidden] { display: none !important; }
html, body {
  height: 100%; overflow: hidden;
  background: #04121e;
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none;
}
#sea {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; touch-action: none; cursor: none;
}

/* ── 开屏 ─────────────────────────────── */
#veil {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: #030d16;
  transition: opacity 2.4s ease;
  pointer-events: auto;
  cursor: default;
}
#veil.gone { opacity: 0; pointer-events: none; }
.veil-inner { text-align: center; opacity: 0; animation: veilin 2.2s ease 0.3s forwards; }
@keyframes veilin { to { opacity: 1; } }
.veil-inner h1 {
  font-size: 34px; font-weight: 400; letter-spacing: 0.45em;
  margin-left: 0.45em; /* 抵消最后一个字的字距 */
  color: var(--ink);
}
.veil-inner p {
  margin-top: 22px; font-size: 13px; letter-spacing: 0.28em; margin-left: 0.28em;
  color: var(--dim);
}

/* ── 右下角深度 ───────────────────────── */
#corner {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  border: none; cursor: pointer;
  font-family: var(--serif);
  color: rgba(240, 242, 248, 0.92); font-size: 18px; letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(8, 14, 22, 0.42);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
  transition: color 0.6s;
}
#corner:hover { color: var(--ink); }
#corner::before { content: "−"; margin-right: 1px; }
#corner .unit { margin-left: 3px; font-size: 14px; opacity: 0.85; }

#menu {
  position: fixed; right: 20px; bottom: 58px; z-index: 31;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
#menu button {
  background: none; border: none; cursor: pointer;
  font-family: var(--serif); font-size: 13px; letter-spacing: 0.12em;
  color: var(--dim); padding: 7px 4px;
  transition: color 0.3s;
}
#menu button:hover { color: var(--ink); }
#menu button i { font-style: normal; opacity: 0.65; margin-left: 4px; }

/* ── 覆盖层（账单 / 地球 / 说明）────────── */
#overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(2, 8, 14, 0.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 20px;
  opacity: 0; transition: opacity 0.5s ease;
}
#overlay.show { opacity: 1; }
#overlay-body { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; gap: 14px; }
.flip-nav { display: flex; gap: 10px; }
.city-btn.cur { border-color: rgba(242, 214, 160, 0.55); color: #f2d6a0; }

#veil-geo { margin-top: 34px; }
#veil-geo .geo-line {
  font-size: 13px; color: var(--dim); letter-spacing: 0.12em; margin-bottom: 18px;
}
#veil-geo button {
  display: block; margin: 0 auto 12px; cursor: pointer;
  background: none; font-family: var(--serif);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--ink); font-size: 14px; letter-spacing: 0.18em;
  padding: 10px 26px; transition: border-color 0.3s;
}
#veil-geo button:hover { border-color: rgba(255, 255, 255, 0.7); }
#veil-geo #geo-no {
  border-color: transparent; color: var(--dim); font-size: 12px;
}
#overlay-body canvas {
  max-width: min(86vw, 430px); max-height: 72vh;
  width: auto; height: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
#overlay-body .prose {
  max-width: 480px; color: var(--ink);
  font-size: 14px; line-height: 2.2; letter-spacing: 0.06em;
}
#overlay-body .prose p + p { margin-top: 12px; }
#overlay-body .prose small { color: var(--dim); font-size: 12px; }
#overlay-body .about-prose {
  max-height: 78vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 12px 18px 2px; scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.14) transparent;
}
.world-stack {
  margin: 20px 0 16px; border-top: 1px solid rgba(255,255,255,0.12);
  border-bottom: 1px solid rgba(255,255,255,0.12); padding: 12px 0 4px;
}
.world-stack h3 {
  font-size: 13px; font-weight: 400; letter-spacing: 0.22em;
  color: var(--ink); margin-bottom: 10px;
}
.world-layer {
  display: grid; grid-template-columns: minmax(104px, 0.38fr) 1fr;
  column-gap: 12px; row-gap: 3px; padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.world-layer b { font-size: 12.5px; font-weight: 400; color: rgba(255,255,255,0.82); }
.world-layer span { font-size: 12.5px; color: rgba(255,255,255,0.68); }
.world-layer small { grid-column: 2; line-height: 1.65; color: rgba(255,255,255,0.38); }
.tech-state { margin: 8px 0 16px; color: var(--dim); font-size: 12px; }
.tech-state summary { cursor: pointer; color: rgba(255,255,255,0.58); letter-spacing: 0.08em; }
.tech-state small { display: block; padding: 8px 0 0; line-height: 1.8; }
#overlay-actions { display: flex; gap: 26px; }
#overlay-actions button {
  background: none; border: none; cursor: pointer;
  font-family: var(--serif); font-size: 13px; letter-spacing: 0.2em;
  color: var(--dim); padding: 8px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  transition: color 0.3s;
}
#overlay-actions button:hover { color: var(--ink); }
#overlay-actions button:disabled { cursor: default; opacity: 0.7; border-bottom-color: transparent; }

/* ── 鱼谱 ─────────────────────────────── */
.dex {
  width: min(92vw, 720px); max-height: 76vh;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 14px 22px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent;
}
.dex-title {
  text-align: center; font-weight: 400; font-size: 24px;
  letter-spacing: 0.5em; margin: 10px 0 8px 0.5em; color: var(--ink);
}
.dex-sub { text-align: center; font-size: 12px; color: var(--dim); letter-spacing: 0.08em; margin-bottom: 22px; }
.dex-group h3 {
  font-weight: 400; font-size: 14px; letter-spacing: 0.4em;
  color: var(--dim); margin: 24px 0 12px;
}
.dex-group h3 i { font-style: normal; font-size: 11px; margin-left: 10px; letter-spacing: 0.1em; opacity: 0.75; }
.dex-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.dex-card {
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 12px 14px 14px;
  background: rgba(255, 255, 255, 0.02);
}
.dex-card.lock { opacity: 0.6; }
.dex-fish { width: 100%; height: auto; display: block; margin-bottom: 4px; }
.dex-sil {
  height: 64px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: rgba(255, 255, 255, 0.22); margin-bottom: 4px;
}
.dex-name { font-size: 15px; color: var(--ink); letter-spacing: 0.1em; }
.dex-name i { font-style: normal; font-size: 11px; color: var(--dim); margin-left: 8px; }
.dex-name.dim { color: var(--dim); }
.dex-text { font-size: 12px; line-height: 1.9; color: rgba(255, 255, 255, 0.62); margin-top: 6px; min-height: 44px; }
.dex-text.dim { color: rgba(255, 255, 255, 0.34); }
.dex-meta { font-size: 11px; color: var(--dim); margin-top: 8px; font-variant-numeric: tabular-nums; }
.dex-main { font-size: 12px; color: rgba(255, 220, 200, 0.85); margin-top: 10px; letter-spacing: 0.15em; }
.dex-size {
  margin-top: 12px; height: 3px; background: rgba(255, 255, 255, 0.10);
  position: relative; overflow: hidden;
}
.dex-size i {
  position: absolute; top: 0; bottom: 0; left: 0; display: block;
  background: rgba(151, 206, 216, 0.75);
}
.dex-adopt {
  margin-top: 10px; background: none; cursor: pointer;
  border: none; border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--serif); font-size: 12px; letter-spacing: 0.15em;
  color: var(--dim); padding: 4px 1px; transition: color 0.3s;
}
.dex-adopt:hover { color: var(--ink); }
.dex-log { margin-top: 26px; border-top: 1px solid rgba(255,255,255,0.10); padding-top: 16px; }
.dex-log h3 { font-weight: 400; font-size: 14px; letter-spacing: 0.4em; color: var(--dim); margin-bottom: 12px; }
.dex-log-row { font-size: 12px; line-height: 2.1; color: rgba(255, 255, 255, 0.5); }

/* ── 去别的水 ─────────────────────────── */
.water-card {
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 16px 18px 14px; margin-bottom: 12px;
  transition: border-color 0.3s;
}
.water-card.here { border-color: rgba(151, 206, 216, 0.4); }
.water-name { font-size: 17px; letter-spacing: 0.2em; color: var(--ink); }
.water-name i { font-style: normal; font-size: 11.5px; color: var(--dim); margin-left: 10px; letter-spacing: 0.12em; }
.water-line { font-size: 12.5px; color: rgba(255, 255, 255, 0.48); margin-top: 8px; line-height: 1.8; }
.water-live { font-size: 12px; color: rgba(151, 216, 206, 0.85); margin-top: 8px; letter-spacing: 0.08em; }
.water-here { font-size: 12px; color: rgba(151, 206, 216, 0.9); margin-top: 10px; letter-spacing: 0.15em; }
.water-go {
  margin-top: 10px; background: none; cursor: pointer;
  border: none; border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--serif); font-size: 12.5px; letter-spacing: 0.15em;
  color: var(--dim); padding: 4px 1px; transition: color 0.3s;
}
.water-go:hover { color: var(--ink); }

/* ── 城市自选 ─────────────────────────── */
.city-grid {
  display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 18px;
  max-width: 480px;
}
.city-btn {
  background: none; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--serif); font-size: 13px; letter-spacing: 0.1em;
  color: var(--ink); padding: 7px 14px;
  transition: border-color 0.3s, color 0.3s;
}
.city-btn:hover { border-color: rgba(255, 255, 255, 0.5); }
.city-btn.dim { color: var(--dim); border-style: dashed; }

/* ── 鱼谱 · 我的鱼牌 ───────────────────── */
.dex-me {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin: 4px 0 18px; padding: 16px 12px 18px;
  border: 1px solid rgba(120, 116, 100, 0.22); border-radius: 8px;
}
.dex-me-name {
  font-size: 24px; letter-spacing: 0.22em; cursor: pointer;
  border-bottom: 1px dashed rgba(120, 116, 100, 0.35); padding-bottom: 2px;
}
.dex-me-name:hover { border-bottom-color: rgba(178, 58, 44, 0.6); }
.dex-me-meta { font-size: 12.5px; letter-spacing: 0.12em; color: var(--dim); }
.dex-me-acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* ── 孵化卡：三选一 + 起名 ─────────────── */
#hatch-row { display: flex; gap: 14px; justify-content: center; margin: 18px 0 6px; }
.hatch-card {
  cursor: pointer; padding: 10px 8px 8px; border-radius: 8px;
  border: 1px solid rgba(120, 116, 100, 0.25);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: border-color 0.3s, transform 0.3s;
}
.hatch-card canvas { width: 132px; height: 70px; }
.hatch-card span { font-size: 13px; letter-spacing: 0.14em; color: var(--dim); }
.hatch-card:hover { border-color: rgba(120, 116, 100, 0.5); }
.hatch-card.on { border-color: rgba(178, 58, 44, 0.7); transform: translateY(-3px); }
.hatch-card.on span { color: var(--ink); }
#hatch-name-row { display: flex; gap: 8px; justify-content: center; margin: 14px 0 4px; }
#hatch-name {
  background: none; border: none; border-bottom: 1px solid rgba(120, 116, 100, 0.4);
  color: var(--ink); font-family: var(--serif); font-size: 16px; letter-spacing: 0.1em;
  padding: 7px 4px; width: 190px; text-align: center; outline: none;
}
#hatch-dice {
  background: none; border: 1px solid rgba(120, 116, 100, 0.35); border-radius: 6px;
  color: var(--dim); font-size: 18px; width: 38px; cursor: pointer;
}
#hatch-dice:hover { color: var(--ink); border-color: rgba(120, 116, 100, 0.6); }
#hatch-go {
  display: block; margin: 14px auto 0; cursor: pointer;
  background: none; font-family: var(--serif);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--ink); font-size: 14px; letter-spacing: 0.18em;
  padding: 10px 26px; transition: border-color 0.3s;
}
#hatch-go:hover { border-color: rgba(255, 255, 255, 0.7); }
@media (max-width: 560px) {
  #hatch-row { gap: 8px; }
  .hatch-card canvas { width: 96px; height: 51px; }
}

/* ── 四海志印章册 ─────────────────────── */
.seas-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 10px; margin: 18px 0;
}
.sea-seal {
  aspect-ratio: 1; border-radius: 50%;
  border: 1.5px dashed rgba(120, 116, 100, 0.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: rgba(120, 116, 100, 0.5);
  font-family: var(--serif);
}
.sea-seal__name { font-size: 13px; letter-spacing: 0.1em; writing-mode: vertical-rl; max-height: 62px; }
.sea-seal__date { font-size: 10px; opacity: 0.75; }
.sea-seal.got {
  border: 2px solid rgba(178, 58, 44, 0.75);
  color: rgba(178, 58, 44, 0.92);
  box-shadow: inset 0 0 0 3px rgba(178, 58, 44, 0.12);
  transform: rotate(-3deg);
}
.sea-seal.got:nth-child(2n) { transform: rotate(2.5deg); }
.sea-seal.got:nth-child(3n) { transform: rotate(-1deg); }

@media (max-width: 560px) {
  .veil-inner h1 { font-size: 27px; }
  #corner { right: 16px; bottom: 14px; }
}

/* 路上的一行小字（玩法章程 D-060 §一）：要等的事说一声，点它出发 */
.waysign {
  position: fixed; z-index: 50; transform: translate(-50%, -100%);
  background: rgba(6, 8, 16, 0.78); border: 1px solid rgba(233, 235, 245, 0.16);
  color: rgba(233, 235, 245, 0.85);
  font: 13px/1.5 -apple-system, "PingFang SC", "Hiragino Sans GB", sans-serif;
  letter-spacing: 0.06em; padding: 7px 14px; border-radius: 4px;
  cursor: pointer; appearance: none; min-height: 32px; white-space: nowrap;
}
.waysign:hover { color: #fff; border-color: rgba(233, 235, 245, 0.4); }
