/* 合成钓鱼 · 深海荧光（D1）
 * 竖屏 390×844 优先，不横向溢出；桌面居中显示。
 * 深蓝底 + 荧光青 + 珊瑚橙 + 金色，全部内联 SVG / CSS，无外部图片、无外部字体、无网络请求。
 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg1: #061A33;
  --bg2: #0B2A52;
  --bg3: #12406E;
  --accent: #3EF5E6;
  --accent-dim: rgba(62,245,230,.15);
  --coral: #FF6B4A;
  --coral-lite: #ff8a68;
  --coral-deep: #c94a2f;
  --gold: #FFD45A;
  --gold-deep: #d9a02a;
  --ink: #F2F7FF;
  --ink-dim: #9FB8D6;
  --card: rgba(13,42,82,.72);
  --stroke: rgba(62,245,230,.35);
  --font: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background: #040c18;
  color: var(--ink);
  font-family: var(--font);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#app {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg3) 0%, var(--bg2) 45%, var(--bg1) 100%);
  position: relative;
  overflow: hidden;
}

/* ---------- 气泡 ---------- */
.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(62,245,230,.14);
  border: 1px solid rgba(62,245,230,.35);
  pointer-events: none;
}

/* ---------- 顶栏 HUD ---------- */
#hud {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 8px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  z-index: 10;
}
.hud-right { display: flex; align-items: center; gap: 8px; }

.timer-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 9px 15px;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
.timer-chip .timer-ico { color: var(--accent); display: flex; }
.timer-chip .timer-txt { display: flex; align-items: baseline; }
.timer-chip .timer-txt b {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 16px rgba(62,245,230,.5);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.timer-chip .timer-txt i { font-style: normal; font-size: 11px; color: var(--ink-dim); margin-left: 3px; }
.timer-chip.low b { color: var(--coral); text-shadow: 0 0 16px rgba(255,107,74,.6); }
.timer-chip.low .timer-ico { color: var(--coral); }

.coins-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 9px 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
.coins-pill b { font-size: 17px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }

.coin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex: none;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--gold) 60%, var(--gold-deep));
  border: 1px solid #b47c1c;
  box-shadow: 0 0 8px rgba(255,212,90,.5);
}

.earning-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-dim);
  background: rgba(62,245,230,.08);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 6px 11px;
}
.earning-pill b { font-size: 13px; color: var(--accent); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- 海面（抛竿区） ---------- */
#water {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  min-height: 140px;
  margin: 8px 12px 0;
  border-radius: 24px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(18,64,110,.55), rgba(6,26,51,.85));
  border: 1.5px solid var(--stroke);
  box-shadow: inset 0 0 40px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  cursor: pointer;
  touch-action: manipulation;
}
.pool-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 25% 72%, rgba(62,245,230,.10), transparent 46%),
    radial-gradient(circle at 80% 28%, rgba(255,107,74,.08), transparent 45%);
}
.pool-bubbles { position: absolute; inset: 0; pointer-events: none; }
.pool-bubbles .bubble {
  bottom: -30px;
  animation: rise linear infinite;
}
@keyframes rise {
  0%   { transform: translateY(0); opacity: 0; }
  12%  { opacity: .8; }
  100% { transform: translateY(-360px); opacity: 0; }
}

#waves { position: absolute; bottom: -2px; left: 0; width: 100%; height: 46%; }
.wave { fill: var(--accent); opacity: .14; }
.w2 { opacity: .10; }
.w3 { opacity: .06; }
.w1 { animation: bob 3.2s ease-in-out infinite; }
.w2 { animation: bob 4.1s ease-in-out infinite reverse; }
.w3 { animation: bob 5.0s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

#cast-hint {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 14px;
  color: var(--ink);
  pointer-events: none;
  background: rgba(13,42,82,.72);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 7px 16px;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

/* 上钩弹出的鱼 */
#catch-pop {
  position: absolute;
  top: 34%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
#catch-pop .fish-svg { width: 120px; height: auto; }
#catch-pop.hidden { display: none; }
#catch-pop.pop { animation: pop 0.9s ease-out forwards; }
@keyframes pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  35%  { opacity: 1; transform: translate(-50%, -62%) scale(1.25); }
  100% { opacity: 0; transform: translate(-50%, -95%) scale(1.5); }
}

/* ---------- 鱼篓（合成区） ---------- */
#basket {
  flex: 0 0 auto;
  margin: 8px 12px 0;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.basket-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
#basket-label { font-size: 13px; color: var(--ink); font-weight: 700; }
#basket-label span { color: var(--accent); font-variant-numeric: tabular-nums; }
.basket-tip { font-size: 11px; color: var(--ink-dim); }

#slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-height: 84px;
}
.slot {
  position: relative;
  background: rgba(62,245,230,.06);
  border: 1px solid rgba(62,245,230,.18);
  border-radius: 16px;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fish {
  width: 100%;
  height: 100%;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  cursor: grab;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  position: relative;
}
.fish:active { cursor: grabbing; }
.fish-art { display: flex; align-items: center; justify-content: center; line-height: 0; }
.fish .lvl {
  font-size: 11px;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 8px;
  background: rgba(0,0,0,.35);
  color: var(--ink-dim);
  font-weight: 600;
}
.fish.sel {
  transform: scale(1.05);
  background: rgba(62,245,230,.10);
  box-shadow: 0 0 0 2px var(--accent), 0 0 14px rgba(62,245,230,.4);
}
.fish.merge-target {
  transform: scale(1.10);
  background: rgba(62,245,230,.14);
  box-shadow: 0 0 0 2px var(--accent), 0 0 18px rgba(62,245,230,.6);
}
.fish.dragging {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  transform: scale(1.15);
}

/* 卖鱼区 */
#sell-zone {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed rgba(255,212,90,.45);
  border-radius: 14px;
  padding: 10px;
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
  min-height: 44px;
}
#sell-zone .sell-ico { display: flex; color: var(--gold); }
#sell-zone.hot {
  background: rgba(255,212,90,.16);
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(255,212,90,.35);
}

/* ---------- 底部操作 ---------- */
#dock {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  padding: 12px 12px 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.dock-btn {
  flex: 1;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  color: var(--ink);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 3px 0 rgba(0,0,0,.3);
  transition: transform .08s ease, box-shadow .08s ease;
}
.dock-btn .dock-ico { flex: none; display: flex; color: var(--accent); }
.dock-btn .dock-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dock-btn .dock-title { font-size: 14px; font-weight: 700; }
.dock-btn .dock-meta { font-size: 11px; color: var(--ink-dim); margin-top: 1px; }
.dock-btn .dock-meta b { color: var(--ink); font-weight: 700; }
.dock-btn .dock-cost {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
  font-size: 14px;
  color: var(--gold);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.dock-btn .dock-cost .coin-dot { width: 15px; height: 15px; }
.dock-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.dock-btn:disabled { opacity: .45; }
.dock-btn.max .dock-cost .coin-dot { display: none; }
.dock-btn.max .dock-cost { color: var(--ink-dim); font-size: 12px; font-weight: 600; }

/* ---------- 按钮 ---------- */
button {
  border: none;
  font-family: var(--font);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.primary, .ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.primary {
  height: 56px;
  border-radius: 28px;
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(var(--coral-lite), var(--coral));
  color: #fff;
  box-shadow: 0 4px 0 var(--coral-deep), 0 10px 22px rgba(255,107,74,.35), inset 0 0 0 1px var(--accent);
  transition: transform .08s ease, box-shadow .08s ease;
}
.primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--coral-deep), 0 5px 12px rgba(255,107,74,.3), inset 0 0 0 1px var(--accent);
}
.primary.gold {
  background: linear-gradient(#ffe08a, var(--gold));
  color: #3a2a00;
  box-shadow: 0 4px 0 var(--gold-deep), 0 10px 22px rgba(255,212,90,.35), inset 0 0 0 1px #fff3c4;
}
.primary.gold:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--gold-deep), 0 5px 12px rgba(255,212,90,.3), inset 0 0 0 1px #fff3c4;
}
.ghost {
  height: 48px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 700;
  background: var(--card);
  color: var(--accent);
  border: 1px solid var(--stroke);
  box-shadow: 0 3px 0 rgba(0,0,0,.3);
  transition: transform .08s ease, box-shadow .08s ease;
}
.ghost:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.ghost:disabled { opacity: .5; }

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

/* 首页：全屏深海渐变（不是暗灰遮罩） */
#start-screen {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  background: linear-gradient(180deg, var(--bg3) 0%, var(--bg2) 45%, var(--bg1) 100%);
}
#start-screen .bubble { animation: bob 4s ease-in-out infinite; }
.start-inner {
  width: 100%;
  max-width: 342px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  text-shadow: 0 0 26px rgba(62,245,230,.5);
}
.hero .sub { margin-top: 10px; font-size: 15px; color: var(--ink-dim); }
.stage { position: relative; width: 100%; height: 210px; margin-top: 20px; }
.stage .fish {
  position: absolute;
  animation: swim 4s ease-in-out infinite;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.4));
}
.stage .fish svg { width: 100%; height: auto; display: block; }
.stage .fish.flip svg { transform: scaleX(-1); }
@keyframes swim { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.howto { display: flex; gap: 10px; margin: 20px 0 24px; width: 100%; }
.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 13px 6px;
}
.step .step-ico { display: flex; color: var(--accent); height: 22px; align-items: center; justify-content: center; }
.step span:last-child { font-size: 12px; color: var(--ink); line-height: 1.2; }

/* 结算 / 广告：暗化 + 模糊，露出冻结的局内 */
#end-screen, #ad-screen {
  flex-direction: column;
  background: rgba(3,10,22,.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.end-wrap { width: 100%; max-width: 342px; display: flex; flex-direction: column; }
.sheet {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  padding: 28px 22px 22px;
  text-align: center;
}
.result-kicker { font-size: 13px; color: var(--ink-dim); letter-spacing: 3px; }
.result-score {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}
.result-score .num {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 26px rgba(62,245,230,.55);
  font-variant-numeric: tabular-nums;
}
.result-score .unit { font-size: 20px; color: var(--ink-dim); font-weight: 600; }
.result-stats { margin-top: 20px; display: flex; justify-content: center; gap: 10px; }
.rs {
  background: rgba(62,245,230,.08);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 10px 12px;
  min-width: 78px;
}
.rs b {
  display: block;
  font-size: 18px;
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rs span { font-size: 11px; color: var(--ink-dim); }
.result-coins { position: relative; height: 34px; margin-top: 8px; }
.result-coins .coin {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--gold) 60%, var(--gold-deep));
  border: 1px solid #b47c1c;
  box-shadow: 0 0 12px rgba(255,212,90,.6);
  animation: coinfly 1.6s ease-in-out infinite;
}
.result-coins .coin:nth-child(1) { left: 92px; top: 6px; animation-delay: 0s; }
.result-coins .coin:nth-child(2) { left: 156px; top: 0; animation-delay: .5s; }
.result-coins .coin:nth-child(3) { left: 220px; top: 8px; animation-delay: 1s; }
@keyframes coinfly {
  0%   { transform: translateY(14px); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(-10px); opacity: 0; }
}
.end-debug { margin-top: 14px; font-size: 11px; color: var(--ink-dim); opacity: .75; }
.end-btns { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }

/* 广告面板 */
.panel {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  padding: 26px 22px;
  text-align: center;
}
.ad-ico { display: flex; justify-content: center; color: var(--accent); margin-bottom: 6px; }
.panel .ad-title { font-size: 20px; font-weight: 800; color: var(--ink); }
.panel .sub { font-size: 13px; color: var(--ink-dim); margin: 10px 0 4px; line-height: 1.6; }
#ad-countdown {
  font-size: 44px;
  font-weight: 800;
  margin: 12px 0;
  color: var(--accent);
  text-shadow: 0 0 18px rgba(62,245,230,.5);
  font-variant-numeric: tabular-nums;
}

.hint { font-size: 12px; color: var(--ink-dim); margin-top: 12px; text-align: center; }
.hint.hidden { display: none; }

/* ---------- 金币飞入动画（局内） ---------- */
.coin-fly {
  position: fixed;
  z-index: 200;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--gold) 60%, var(--gold-deep));
  border: 1px solid #b47c1c;
  box-shadow: 0 0 10px rgba(255,212,90,.6);
  pointer-events: none;
  animation: coinUp 0.8s ease-out forwards;
}
@keyframes coinUp {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-60px); }
}
