:root {
  color-scheme: dark;
  --ink: #f7f3e8;
  --muted: #aebbb5;
  --green: #72d6a1;
  --green-dark: #1f7c63;
  --gold: #e5c878;
  --panel: rgba(21, 41, 40, .82);
  --line: rgba(218, 235, 225, .14);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #0c1c1d; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 4%, rgba(222, 200, 119, .16), transparent 30%),
    linear-gradient(165deg, #183536 0%, #0c1d20 58%, #081416 100%);
  font-family: ui-rounded, "SF Pro Rounded", "Noto Sans TC", system-ui, sans-serif;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.pond-glow {
  position: fixed;
  inset: auto -30vw -25vw;
  height: 70vw;
  background: radial-gradient(ellipse, rgba(47, 151, 135, .2), transparent 67%);
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: auto;
  padding: max(18px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(114, 214, 161, .38);
  border-radius: 13px;
  color: var(--green);
  background: rgba(114, 214, 161, .08);
  font-weight: 900;
}
.brand b, .brand small { display: block; }
.brand b { letter-spacing: .14em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.line-chip {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d4e1dc;
  background: rgba(5, 13, 13, .22);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
}
.line-chip i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #06c755; }

.hero { padding: 48px 3px 26px; }
.eyebrow { margin: 0 0 11px; color: var(--green); font-size: 11px; font-weight: 900; letter-spacing: .19em; }
.hero h1 { margin: 0; font-size: clamp(35px, 10vw, 50px); line-height: 1.13; letter-spacing: -.055em; }
.hero h1 span { color: var(--gold); }
.hero > p:last-child { max-width: 410px; margin: 17px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }

.pond-card {
  position: relative;
  height: 244px;
  overflow: hidden;
  border: 1px solid rgba(175, 221, 202, .2);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(10, 32, 33, .05) 0 42%, rgba(39, 116, 111, .35) 43%, rgba(19, 61, 63, .8) 100%),
    radial-gradient(circle at 72% 22%, rgba(239, 218, 145, .25), transparent 24%),
    #12292b;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .25), inset 0 1px rgba(255, 255, 255, .04);
}
.moon { position: absolute; top: 28px; right: 40px; width: 50px; height: 50px; border-radius: 50%; background: #e7d899; box-shadow: 0 0 34px rgba(231, 216, 153, .3); }
.bamboo { position: absolute; bottom: 41%; display: flex; gap: 8px; align-items: end; }
.bamboo-left { left: 18px; }
.bamboo-right { right: 13px; transform: scaleX(-1); }
.bamboo i { display: block; width: 7px; height: 95px; border-radius: 5px 5px 0 0; background: repeating-linear-gradient(180deg, #49896b 0 22px, #1f5849 23px 26px); transform: rotate(-8deg); transform-origin: bottom; }
.bamboo i:nth-child(2) { height: 120px; transform: rotate(5deg); }
.bamboo i:nth-child(3) { height: 76px; transform: rotate(14deg); }
.water-lines { position: absolute; inset: 44% 0 0; overflow: hidden; }
.water-lines i { position: absolute; left: -10%; width: 120%; height: 1px; background: linear-gradient(90deg, transparent, rgba(178, 229, 219, .24), transparent); }
.water-lines i:nth-child(1) { top: 20%; }
.water-lines i:nth-child(2) { top: 49%; transform: translateX(8%); }
.water-lines i:nth-child(3) { top: 76%; transform: translateX(-7%); }
.bobber { position: absolute; top: 111px; left: 56%; width: 2px; height: 47px; background: rgba(229, 238, 224, .6); transform-origin: top; animation: bob 2.8s ease-in-out infinite; }
.bobber::before { content: ""; position: absolute; top: -78px; left: 0; width: 130px; height: 80px; border-top: 1px solid rgba(229, 238, 224, .42); border-radius: 60% 0 0; transform: translateX(-129px) rotate(18deg); }
.bobber span { position: absolute; left: -5px; bottom: -3px; width: 12px; height: 16px; border-radius: 8px; background: linear-gradient(#e96962 0 48%, #eee7d1 49%); }
.fish-shadow { position: absolute; width: 48px; height: 14px; border-radius: 50%; background: rgba(3, 15, 17, .38); filter: blur(2px); }
.fish-shadow::after { content: ""; position: absolute; right: -9px; top: 1px; border: 7px solid transparent; border-left-color: rgba(3, 15, 17, .38); }
.fish-one { left: 20%; bottom: 39px; transform: rotate(-8deg); animation: swim 5.5s ease-in-out infinite; }
.fish-two { right: 16%; bottom: 67px; transform: scale(.72) rotate(8deg); animation: swim 4.4s ease-in-out infinite reverse; }
.pond-copy { position: absolute; left: 20px; bottom: 17px; }
.pond-copy small { display: block; color: #bed4cc; font-size: 11px; }
.pond-copy strong { display: block; margin-top: -2px; color: white; font-size: 32px; letter-spacing: -.04em; }
.pond-copy strong span { margin-left: 4px; color: #9bb7ae; font-size: 14px; }
.pond-hint {
  position: absolute;
  right: 17px;
  bottom: 19px;
  max-width: 58%;
  margin: 0;
  color: #a9c8be;
  font-size: 10px;
  text-align: right;
  letter-spacing: .03em;
}
.bite-ripple {
  position: absolute;
  top: 151px;
  left: calc(56% - 20px);
  width: 40px;
  height: 14px;
  border: 1px solid rgba(194, 239, 227, .62);
  border-radius: 50%;
  opacity: 0;
  transform: scale(.25);
}
.pond-card.is-casting .bobber { animation-duration: .8s; }
.pond-card.has-bite .bobber { animation: bite .22s ease-in-out infinite alternate; }
.pond-card.has-bite .bite-ripple { animation: ripple .75s ease-out infinite; }
.pond-card.has-bite { box-shadow: 0 0 0 2px rgba(229, 200, 120, .34), 0 24px 80px rgba(0, 0, 0, .25); }
.pond-card.is-reeling .bobber { animation: reel .65s ease-in forwards; }

.status-card, .link-card {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 16px 45px rgba(0, 0, 0, .15);
  backdrop-filter: blur(18px);
}
.status-card { display: flex; gap: 14px; align-items: center; }
.status-card b { font-size: 15px; }
.status-card p, .link-card p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.status-card.success { align-items: flex-start; }
.status-body { flex: 1; min-width: 0; }
.status-body > small { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.status-body h2, .link-card h2 { margin: 4px 0 0; font-size: 21px; }
.spinner { width: 22px; height: 22px; flex: 0 0 auto; border: 2px solid rgba(114, 214, 161, .18); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.status-icon, .mail-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #09221a; background: var(--green); font-weight: 1000; }
.mail-icon { margin-bottom: 12px; color: #342e17; background: var(--gold); }
.identity-row { display: flex; align-items: center; gap: 11px; margin: 17px 0; padding: 11px; border: 1px solid var(--line); border-radius: 15px; background: rgba(0, 0, 0, .13); }
.player-avatar { display: grid; width: 42px; height: 42px; place-items: center; overflow: hidden; border-radius: 13px; color: var(--green); background: #253e39; font-weight: 900; }
.player-avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.identity-row small, .identity-row b { display: block; }
.identity-row small { color: var(--muted); font-size: 9px; letter-spacing: .12em; }
.identity-row b { margin-top: 3px; }

.link-card form { margin-top: 19px; }
.link-card label { display: block; margin-bottom: 7px; color: #d7e1dd; font-size: 12px; font-weight: 800; }
.link-card input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid rgba(196, 221, 211, .2); border-radius: 13px; outline: none; color: var(--ink); background: rgba(3, 14, 15, .42); }
.link-card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(114, 214, 161, .1); }
.primary-button, .secondary-button { width: 100%; min-height: 48px; margin-top: 12px; border: 0; border-radius: 14px; font-weight: 900; cursor: pointer; }
.primary-button { color: #09251a; background: var(--green); }
.primary-button:disabled { cursor: default; color: #9bb1a8; background: #314b45; }
.cast-button:not(:disabled) { box-shadow: 0 10px 28px rgba(77, 190, 137, .19); }
.cast-button.bite-action:not(:disabled) {
  color: #2d2408;
  background: var(--gold);
  animation: button-pulse .55s ease-in-out infinite alternate;
}
.secondary-button { color: var(--ink); border: 1px solid var(--line); background: rgba(255, 255, 255, .04); }
.text-link { display: block; margin-top: 13px; color: #c7ddd5; text-align: center; font-size: 12px; }
.form-message { min-height: 20px; color: var(--gold) !important; }
.link-card.error .status-icon { margin-bottom: 12px; color: #351817; background: #e88882; }

.catch-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  overflow: hidden;
  margin-top: 16px;
  padding: 17px 48px 17px 17px;
  border: 1px solid rgba(229, 200, 120, .34);
  border-radius: 22px;
  background: linear-gradient(125deg, rgba(55, 89, 73, .94), rgba(20, 39, 39, .94));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .19);
  animation: catch-in .42s cubic-bezier(.22, .9, .3, 1.2);
}
.catch-card.rarity-legendary, .catch-card.rarity-lucky {
  border-color: rgba(229, 200, 120, .7);
  background: linear-gradient(125deg, rgba(101, 82, 38, .84), rgba(24, 44, 42, .96));
}
.catch-burst {
  position: absolute;
  left: 40px;
  width: 75px;
  height: 75px;
  border: 1px solid rgba(229, 200, 120, .25);
  border-radius: 50%;
  animation: burst 1.8s ease-out infinite;
}
.catch-icon { position: relative; z-index: 1; width: 54px; flex: 0 0 auto; font-size: 40px; text-align: center; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .28)); }
.catch-copy { min-width: 0; }
.catch-copy small { color: var(--gold); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.catch-copy h2 { margin: 3px 0 0; font-size: 22px; }
.catch-copy p { margin: 4px 0 0; color: #bbcec7; font-size: 12px; line-height: 1.5; }
.catch-close { position: absolute; top: 9px; right: 9px; width: 32px; height: 32px; border: 0; border-radius: 50%; color: #b7c9c2; background: transparent; font-size: 23px; cursor: pointer; }

.basket-card {
  margin-top: 16px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(12, 29, 30, .78);
}
.basket-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.basket-heading .eyebrow { margin-bottom: 4px; }
.basket-heading h2 { margin: 0; font-size: 21px; }
.basket-value { text-align: right; }
.basket-value small { display: block; color: var(--muted); font-size: 9px; }
.basket-value strong { color: var(--gold); font-size: 27px; }
.basket-stats { display: flex; gap: 8px; margin: 15px 0 12px; }
.basket-stats span { flex: 1; padding: 9px 11px; border-radius: 12px; color: #a9beb7; background: rgba(255, 255, 255, .04); font-size: 11px; }
.basket-stats b { color: var(--ink); font-size: 15px; }
.catch-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.catch-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; min-height: 50px; padding: 7px 10px; border: 1px solid rgba(218, 235, 225, .08); border-radius: 13px; background: rgba(2, 11, 12, .2); }
.catch-row-icon { font-size: 25px; text-align: center; }
.catch-row b, .catch-row small { display: block; }
.catch-row b { font-size: 13px; }
.catch-row small { margin-top: 2px; color: #7f9990; font-size: 9px; }
.catch-row strong { color: #a8d6bd; font-size: 11px; }
.catch-row.rarity-legendary strong, .catch-row.rarity-lucky strong { color: var(--gold); }
.catch-empty { padding: 20px 8px; color: #80978f; text-align: center; font-size: 12px; }
.sync-note { margin: 13px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: #7f9990; font-size: 10px; line-height: 1.6; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 25px 3px 4px; color: #789189; font-size: 10px; }
footer span { color: #a7bdb5; font-weight: 800; letter-spacing: .1em; }
footer small { text-align: right; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(4px) rotate(2deg); } }
@keyframes swim { 0%, 100% { translate: -7px 0; } 50% { translate: 14px 4px; } }
@keyframes bite { from { transform: translateY(-2px) rotate(-5deg); } to { transform: translateY(12px) rotate(6deg); } }
@keyframes ripple { from { opacity: .8; transform: scale(.25); } to { opacity: 0; transform: scale(2.2); } }
@keyframes reel { to { transform: translate(-65px, -125px) rotate(-28deg); opacity: 0; } }
@keyframes button-pulse { to { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(229, 200, 120, .25); } }
@keyframes catch-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes burst { from { opacity: .7; transform: scale(.35); } to { opacity: 0; transform: scale(1.35); } }

@media (max-width: 370px) {
  .shell { padding-inline: 15px; }
  .hero { padding-top: 36px; }
  .pond-card { height: 220px; }
  .line-chip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
