/* =========================================================
   梦幻水族箱 · DREAM AQUARIUM
   原创钓鱼 + 养鱼小游戏 · 深色冷调海洋风格
   所有图形均由 Canvas / CSS 程序化绘制
   ========================================================= */

:root {
  --bg: #050d13;
  --ink-soft: #07161e;
  --panel: #0a1a23;
  --panel-2: #0c212c;
  --paper: #eef6f8;
  --ice: #8fe3e8;
  --ice-strong: #b5f4f6;
  --blue: #7fb3ff;
  --gold: #f4c86a;
  --coral: #ff8f7a;
  --muted: #8fa9b3;
  --muted-dim: #5c7781;
  --line: rgba(160, 220, 235, 0.1);
  --line-strong: rgba(160, 220, 235, 0.18);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC",
    "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  margin: 0;
  overflow: hidden;
  background: #030a0e;
  color: var(--paper);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

button {
  font-family: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-drag: none;
}

input,
textarea,
[contenteditable="true"],
.selectable {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

.app,
.app * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.app input,
.app textarea,
.app [contenteditable="true"],
.app .selectable {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

a,
button,
canvas,
img,
svg {
  -webkit-user-drag: none;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(120% 60% at 50% 36%, rgba(28, 78, 96, 0.24) 0%, rgba(3, 10, 14, 0) 68%),
    linear-gradient(180deg, #07131b 0%, #040c11 100%);
}

@media (min-width: 500px) {
  .app {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: relative;
  z-index: 12;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 50px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #07151d 0%, #050e14 100%);
}

.back-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.back-links a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 30px;
  padding: 0 7px;
  border-radius: 999px;
  color: rgba(238, 246, 248, 0.62);
  font-size: 11.5px;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.back-links a svg {
  width: 12px;
  height: 12px;
}

.back-links a:hover {
  color: var(--ice);
  background: rgba(143, 227, 232, 0.08);
}

.title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.title-mark {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.title-mark i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ice);
  opacity: 0.42;
}

.title-mark i:nth-child(2) {
  width: 7px;
  height: 7px;
  opacity: 1;
  box-shadow: 0 0 8px rgba(143, 227, 232, 0.65);
}

.title-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.title-copy strong {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.title-copy em {
  color: rgba(238, 246, 248, 0.35);
  font-family: var(--mono);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.18em;
  white-space: nowrap;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.sound-toggle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: rgba(238, 246, 248, 0.66);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sound-toggle svg {
  width: 16px;
  height: 16px;
}

.sound-toggle .sound-body {
  fill: currentColor;
}

.sound-toggle .sound-wave {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
}

.sound-toggle .sound-slash {
  fill: none;
  stroke: var(--coral);
  stroke-width: 1.3;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.sound-toggle.is-muted {
  color: rgba(238, 246, 248, 0.36);
}

.sound-toggle.is-muted .sound-wave {
  opacity: 0.22;
}

.sound-toggle.is-muted .sound-slash {
  opacity: 1;
}

.sound-toggle:hover {
  border-color: rgba(143, 227, 232, 0.3);
  color: var(--ice);
}

.tag {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid rgba(143, 227, 232, 0.22);
  border-radius: 4px;
  color: rgba(143, 227, 232, 0.7);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

/* ---------------- 数据栏 ---------------- */

.hud {
  position: relative;
  z-index: 11;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  padding: 6px 12px 7px;
  border-bottom: 1px solid var(--line);
  background: #07151d;
}

.hud-stat {
  position: relative;
  min-width: 0;
  text-align: center;
}

.hud-stat + .hud-stat::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: -3px;
  width: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.hud-label {
  display: block;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.hud-stat strong {
  display: block;
  margin-top: 1px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.hud-stat strong em {
  margin-left: 1px;
  color: var(--muted-dim);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0;
}

.hud-points strong {
  color: var(--gold);
}

.hud-stat strong.bump {
  animation: stat-bump 0.27s ease;
}

@keyframes stat-bump {
  0% { transform: scale(1); }
  42% { transform: scale(1.16); color: var(--ice); }
  100% { transform: scale(1); }
}

/* ---------------- 主区域 ---------------- */

.main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 8px 8px 12px;
  overflow: hidden;
}

/* ---------------- 鱼缸 ---------------- */

.tank-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 140px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #06131b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -18px 34px rgba(0, 0, 0, 0.34),
    0 10px 26px rgba(0, 0, 0, 0.28);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#tank {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.tank-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 14px;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 26%),
    radial-gradient(120% 90% at 50% 108%, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 58%);
  pointer-events: none;
}

.tank-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  padding: 3px 7px;
  border: 1px solid rgba(143, 227, 232, 0.2);
  border-radius: 999px;
  background: rgba(4, 14, 20, 0.6);
  color: rgba(143, 227, 232, 0.82);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.tank-hint {
  position: absolute;
  right: 9px;
  bottom: 8px;
  z-index: 3;
  color: rgba(238, 246, 248, 0.36);
  font-size: 8px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.tank-hint.is-hidden {
  opacity: 0;
}

.tank-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 0 18px;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.35s ease;
}

.tank-empty.is-hidden {
  opacity: 0;
}

.empty-fish {
  position: relative;
  width: 34px;
  height: 17px;
  margin-bottom: 6px;
  border: 1px solid rgba(143, 227, 232, 0.3);
  border-radius: 50% 60% 60% 50%;
  background: linear-gradient(180deg, rgba(143, 227, 232, 0.12), rgba(143, 227, 232, 0.03));
}

.empty-fish::before {
  content: "";
  position: absolute;
  top: 4px;
  right: -11px;
  width: 0;
  height: 0;
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
  border-left: 10px solid rgba(143, 227, 232, 0.24);
}

.empty-fish::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 7px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(143, 227, 232, 0.55);
}

.tank-empty p {
  color: rgba(238, 246, 248, 0.62);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.tank-empty em {
  color: var(--muted-dim);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.05em;
}

/* 鱼详情卡 */

.fish-card {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  z-index: 6;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(32, 82, 98, 0.28) 0%, rgba(5, 16, 22, 0) 70%),
    rgba(5, 16, 22, 0.94);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.46);
  animation: card-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fc-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.fc-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.fc-name {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc-en {
  overflow: hidden;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc-badge {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  opacity: 0.9;
}

.fc-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.fc-stat {
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.028);
}

.fc-stat span {
  display: block;
  color: var(--muted-dim);
  font-size: 7.5px;
  letter-spacing: 0.08em;
}

.fc-stat strong {
  display: block;
  margin-top: 1px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.fc-stat strong i {
  margin-left: 1px;
  color: var(--muted-dim);
  font-size: 7.5px;
  font-style: normal;
}

.fc-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.55;
}

.fc-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.fc-actions button {
  flex: 1 1 0;
  height: 32px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.fc-actions button:active {
  transform: scale(0.97);
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  color: rgba(238, 246, 248, 0.78);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  border-color: rgba(143, 227, 232, 0.4);
  color: var(--ice);
}

.btn-sell {
  border: 1px solid rgba(244, 200, 106, 0.42);
  background: rgba(244, 200, 106, 0.12);
  color: var(--gold);
}

.btn-sell:hover {
  background: rgba(244, 200, 106, 0.2);
}

/* ---------------- 控制台 ---------------- */

.console {
  position: relative;
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  height: clamp(232px, 40vh, 320px);
  min-height: 200px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #081822 0%, #061119 100%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

.tabs {
  position: relative;
  z-index: 2;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 36px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 16, 22, 0.7);
}

.tab {
  position: relative;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  transition: color 0.18s ease;
}

.tab::after {
  content: "";
  position: absolute;
  right: 28%;
  bottom: -1px;
  left: 28%;
  height: 2px;
  border-radius: 2px;
  background: var(--ice);
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tab:hover {
  color: rgba(238, 246, 248, 0.8);
}

.tab.is-active {
  color: var(--ice);
}

.tab.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.panels {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------------- 钓鱼面板 ---------------- */

.lake-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #06131b;
}

.lake-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 0;
  background: radial-gradient(110% 80% at 50% 0%, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0) 60%);
  pointer-events: none;
  transition: box-shadow 0.2s ease;
}

.lake-wrap.is-bite::after {
  box-shadow: inset 0 0 34px rgba(244, 200, 106, 0.2);
}

#lake {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.lake-chips {
  position: absolute;
  top: 7px;
  right: 8px;
  left: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}

.chip {
  max-width: 52%;
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 13, 19, 0.64);
  color: rgba(238, 246, 248, 0.66);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.chip-time {
  color: rgba(143, 227, 232, 0.78);
  border-color: rgba(143, 227, 232, 0.18);
}

.bite-timer {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 4;
  height: 2px;
  background: rgba(244, 200, 106, 0.1);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.panel-fish[data-phase="bite"] .bite-timer {
  opacity: 1;
}

.bite-timer i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--coral));
  transform-origin: left center;
}

.lake-foot {
  position: absolute;
  right: 8px;
  bottom: 6px;
  left: 8px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.fish-status {
  align-self: flex-start;
  max-width: 100%;
  padding: 3px 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 13, 19, 0.72);
  color: rgba(238, 246, 248, 0.72);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.fish-status.is-warn {
  border-color: rgba(255, 143, 122, 0.35);
  color: var(--coral);
}

.fish-status.is-good {
  border-color: rgba(244, 200, 106, 0.36);
  color: var(--gold);
}

.power {
  padding: 5px 7px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(4, 13, 19, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.power-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.power-head span {
  color: var(--ice);
  font-family: var(--mono);
}

.power-head em {
  color: var(--muted-dim);
  font-style: normal;
  font-size: 7px;
  white-space: nowrap;
}

.power-track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.power-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7fd8c8 0%, #8fe3e8 42%, #f4c86a 100%);
  box-shadow: 0 0 10px rgba(143, 227, 232, 0.4);
}

.power-track .tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(4, 13, 19, 0.85);
}

.power-track .t1 { left: 38%; }
.power-track .t2 { left: 72%; }

.reel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 7px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(4, 13, 19, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.reel-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.reel-row > span {
  flex: 0 0 22px;
  color: var(--muted-dim);
  font-size: 7.5px;
  letter-spacing: 0.06em;
}

.reel-track {
  position: relative;
  flex: 1 1 auto;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.reel-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7fd8c8, #f4c86a);
  transition: background 0.15s ease;
}

.reel-track .safe-band {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 14%;
  width: 76%;
  border-left: 1px dashed rgba(143, 227, 232, 0.5);
  border-right: 1px dashed rgba(143, 227, 232, 0.5);
  background: rgba(143, 227, 232, 0.07);
}

.reel-tension.is-danger i {
  background: linear-gradient(90deg, var(--coral), #ff5f52);
}

.reel-track .progress-fill {
  background: linear-gradient(90deg, #5fb6ce, var(--ice));
}

.fish-controls {
  flex: 0 0 auto;
  padding: 7px 9px 8px;
  border-top: 1px solid var(--line);
  background: rgba(5, 14, 20, 0.55);
}

.cast-btn {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 46px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a5eff2 0%, #7fd6dd 100%);
  color: #06161c;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow:
    0 7px 18px rgba(53, 160, 172, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.13s ease;
}

.cast-btn svg {
  width: 17px;
  height: 17px;
}

.cast-btn:active {
  transform: scale(0.985);
}

.cast-btn.is-charging {
  background: linear-gradient(180deg, #f7d894 0%, #e9b95c 100%);
  box-shadow:
    0 7px 20px rgba(244, 200, 106, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.cast-btn.is-bite {
  background: linear-gradient(180deg, #ffb49c 0%, #ff7f6b 100%);
  color: #1c0805;
  animation: bite-pulse 0.55s ease-in-out infinite alternate;
}

@keyframes bite-pulse {
  0% { box-shadow: 0 0 0 rgba(255, 143, 122, 0), 0 7px 18px rgba(255, 127, 107, 0.2); }
  100% { box-shadow: 0 0 22px rgba(255, 143, 122, 0.55), 0 7px 20px rgba(255, 127, 107, 0.32); }
}

.cast-btn.is-reeling {
  border: 1px solid rgba(143, 227, 232, 0.42);
  background: rgba(143, 227, 232, 0.1);
  color: var(--ice);
  box-shadow: none;
}

.cast-btn.is-reeling.is-hold {
  background: rgba(143, 227, 232, 0.9);
  color: #06161c;
}

.cast-btn.is-dim {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(238, 246, 248, 0.52);
  box-shadow: none;
}

.cast-btn:disabled {
  cursor: default;
  opacity: 0.5;
}

/* ---------------- 商店 ---------------- */

.panel-scroll {
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 10px 14px;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.up-card {
  position: relative;
  padding: 10px 11px;
  overflow: hidden;
  border: 1px solid rgba(143, 227, 232, 0.2);
  border-radius: 11px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(143, 227, 232, 0.12) 0%, rgba(143, 227, 232, 0) 62%),
    rgba(255, 255, 255, 0.025);
}

.up-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.up-head span {
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.up-head strong {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.up-head em {
  margin-left: auto;
  color: var(--ice);
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
}

.up-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.55;
}

.up-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.up-cap {
  flex: 1 1 auto;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
}

.up-btn {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--ice);
  color: #06161c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  transition: background 0.15s ease, transform 0.13s ease;
}

.up-btn:active {
  transform: scale(0.97);
}

.up-btn.is-locked {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.up-btn.is-max {
  border: 1px solid rgba(244, 200, 106, 0.34);
  background: rgba(244, 200, 106, 0.1);
  color: var(--gold);
}

.shop-cat {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 13px 1px 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.shop-cat em {
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 6.5px;
  font-style: normal;
  letter-spacing: 0.14em;
}

.shop-cat::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

.decor-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
}

.decor-row + .decor-row {
  margin-top: 5px;
}

.decor-row.is-equipped {
  border-color: rgba(143, 227, 232, 0.28);
  background: rgba(143, 227, 232, 0.045);
}

.decor-preview {
  display: block;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: radial-gradient(110% 110% at 50% 100%, rgba(34, 84, 98, 0.4), rgba(5, 15, 21, 0.9));
}

.decor-info {
  min-width: 0;
}

.decor-name {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.decor-name b {
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decor-name em {
  flex: 0 0 auto;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 6px;
  font-style: normal;
  letter-spacing: 0.06em;
}

.decor-desc {
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted-dim);
  font-size: 7.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decor-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.decor-price {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.decor-price.is-owned {
  color: var(--muted-dim);
}

.decor-btn {
  min-width: 52px;
  height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.13s ease;
}

.decor-btn:active {
  transform: scale(0.96);
}

.decor-btn.is-buy {
  background: var(--ice);
  color: #06161c;
}

.decor-btn.is-equip {
  border: 1px solid rgba(143, 227, 232, 0.38);
  background: rgba(143, 227, 232, 0.08);
  color: var(--ice);
}

.decor-btn.is-equipped {
  border: 1px solid rgba(244, 200, 106, 0.4);
  background: rgba(244, 200, 106, 0.1);
  color: var(--gold);
}

.decor-btn.is-locked {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-dim);
}

/* ---------------- 图鉴 ---------------- */

.dex-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

.dex-summary b {
  color: var(--ice);
  font-family: var(--mono);
  font-size: 10px;
}

.dex-tip {
  margin: -1px 2px 8px;
  color: var(--muted-dim);
  font-size: 7.5px;
  line-height: 1.5;
}

.dex-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.dex-card {
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.022);
}

.dex-card.is-locked {
  opacity: 0.58;
}

.dex-canvas {
  display: block;
  width: 100%;
  height: 50px;
  border-radius: 6px;
  background: radial-gradient(110% 100% at 50% 100%, rgba(34, 84, 98, 0.34), rgba(4, 13, 19, 0.9));
}

.dex-name {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  min-width: 0;
}

.dex-name b {
  overflow: hidden;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dex-name span {
  margin-left: auto;
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.04em;
}

.dex-meta {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 1px;
  color: var(--muted-dim);
  font-size: 7px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.dex-meta b {
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 600;
}

/* ---------------- 结算 / 引导浮层 ---------------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 16px;
  background: rgba(2, 8, 12, 0.72);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overscroll-behavior: contain;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sheet {
  width: min(100%, 330px);
  max-height: 100%;
  margin: auto;
  padding: 20px 18px 16px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(42, 102, 118, 0.32) 0%, rgba(8, 20, 27, 0) 62%),
    linear-gradient(160deg, #0d222c 0%, #07141b 100%);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.58);
  text-align: center;
  transform: translateY(10px) scale(0.97);
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.overlay.show .sheet {
  transform: translateY(0) scale(1);
}

.sheet-kicker {
  color: rgba(143, 227, 232, 0.72);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.2em;
}

.sheet h2 {
  margin-top: 6px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.sheet-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.steps {
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.steps li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.steps li + li {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

.steps b {
  color: var(--ice);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sheet-btn {
  display: block;
  width: 100%;
  height: 42px;
  margin-top: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a5eff2 0%, #7fd6dd 100%);
  color: #06161c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition: filter 0.16s ease, transform 0.15s ease, background 0.16s ease;
}

.sheet-btn:hover {
  filter: brightness(1.06);
}

.sheet-btn:active {
  transform: scale(0.985);
}

.sheet-btn:disabled {
  cursor: default;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted-dim);
  filter: none;
}

.sheet-btn-ghost {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: 6px;
  border: 1px solid rgba(244, 200, 106, 0.38);
  border-radius: 999px;
  background: rgba(244, 200, 106, 0.08);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: background 0.16s ease, transform 0.15s ease;
}

.sheet-btn-ghost:hover {
  background: rgba(244, 200, 106, 0.16);
}

.sheet-btn-ghost:active {
  transform: scale(0.985);
}

.sheet-btn-ghost:disabled {
  cursor: default;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-dim);
}

.ov-tip {
  margin-top: 8px;
  color: var(--muted-dim);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.catch-sheet {
  padding-top: 16px;
}

.catch-preview {
  position: relative;
  height: 86px;
  margin: 8px 0 2px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background:
    radial-gradient(110% 130% at 50% 115%, rgba(44, 104, 120, 0.44) 0%, rgba(5, 15, 21, 0) 68%),
    rgba(4, 13, 19, 0.72);
}

.catch-preview canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.catch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 7px;
}

.catch-head h2 {
  margin: 0;
  font-size: 19px;
}

.catch-head em {
  flex-basis: 100%;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.18em;
}

.rarity-badge {
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.rarity-badge[data-r="common"] {
  color: #7fd8c8;
  background: rgba(127, 216, 200, 0.1);
}

.rarity-badge[data-r="rare"] {
  color: #7fb3ff;
  background: rgba(127, 179, 255, 0.1);
}

.rarity-badge[data-r="legendary"] {
  color: var(--gold);
  background: rgba(244, 200, 106, 0.1);
}

.catch-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.catch-stats > div {
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.catch-stats span {
  display: block;
  color: var(--muted-dim);
  font-size: 7.5px;
  letter-spacing: 0.08em;
}

.catch-stats strong {
  display: block;
  margin-top: 1px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.catch-stats strong em {
  margin-left: 1px;
  color: var(--muted-dim);
  font-size: 7.5px;
  font-style: normal;
}

.catch-note {
  min-height: 30px;
  margin-top: 9px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.022);
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.6;
  text-align: left;
}

.catch-actions {
  margin-top: 10px;
}

/* ---------------- 提示条 ---------------- */

.toasts {
  position: absolute;
  bottom: 58px;
  left: 50%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: calc(100% - 32px);
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(6, 19, 26, 0.94);
  color: rgba(238, 246, 248, 0.86);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38);
  animation: toast-in 0.2s ease, toast-out 0.3s ease 1.9s forwards;
  white-space: nowrap;
}

.toast.is-gold {
  border-color: rgba(244, 200, 106, 0.36);
  color: var(--gold);
}

.toast.is-warn {
  border-color: rgba(255, 143, 122, 0.36);
  color: var(--coral);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(-4px); }
}

/* ---------------- 页脚 ---------------- */

.foot {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  padding: 10px 12px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: #050e14;
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.34);
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3px 15px;
}

.foot-nav a {
  display: inline-block;
  padding: 2px 0;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  transition: color 0.18s ease;
}

.foot-nav a:hover {
  color: var(--ice);
}

.foot p {
  margin-top: 4px;
  color: var(--muted-dim);
  font-size: 8px;
  letter-spacing: 0.03em;
  text-align: center;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #030a0e;
  color: var(--paper);
  font-size: 13px;
  text-align: center;
}

/* ---------------- 小屏适配 ---------------- */

@media (max-width: 359px) {
  .topbar {
    padding: 0 10px;
  }

  .title-copy em {
    display: none;
  }

  .tag {
    display: none;
  }

  .back-links a {
    padding: 0 5px;
    font-size: 11px;
  }

  .hud {
    padding-right: 8px;
    padding-left: 8px;
  }

  .hud-stat strong {
    font-size: 16px;
  }

  .hud-label {
    font-size: 6.5px;
    letter-spacing: 0.08em;
  }

  .fish-status {
    font-size: 8px;
  }

  .decor-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 6px;
  }

  .decor-preview {
    width: 40px;
    height: 40px;
  }

  .decor-desc {
    display: none;
  }
}

@media (max-height: 700px) {
  .topbar {
    height: 44px;
  }

  .hud {
    padding-top: 4px;
    padding-bottom: 5px;
  }

  .hud-stat strong {
    font-size: 16.5px;
  }

  .main {
    gap: 6px;
    padding: 6px 6px 10px;
  }

  .console {
    height: clamp(228px, 40vh, 280px);
  }

  .tabs {
    height: 33px;
  }

  .fish-controls {
    padding: 6px 8px 7px;
  }

  .cast-btn {
    height: 42px;
  }

  .sheet {
    padding: 16px 16px 13px;
  }

  .sheet h2 {
    font-size: 19px;
  }

  .steps li + li {
    margin-top: 5px;
    padding-top: 5px;
  }

  .foot p {
    display: none;
  }

  .foot {
    padding-top: 8px;
  }
}

@media (max-height: 620px) {
  .tank-hint {
    display: none;
  }

  .catch-preview {
    height: 68px;
  }

  .steps {
    display: none;
  }
}

/* ---------------- 减少动态效果 ---------------- */

@media (prefers-reduced-motion: reduce) {
  .overlay,
  .sheet,
  .panel,
  .fish-card,
  .cast-btn {
    transition-duration: 0.01ms;
  }

  .cast-btn.is-bite,
  .toast {
    animation: none;
  }
}
