/* ========================================================
   蛙蛙池塘 — 像素风复古主题（固定布局版）
   ======================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== 像素渲染 ===== */
img {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* ===== 自定义光标 ===== */
html { cursor: url('images/cursor_frog.webp') 2 2, auto; }
body { cursor: url('images/cursor_frog.webp') 2 2, auto; }
.interactive, .el, a, button {
  cursor: url('images/cursor_frog_hover.webp') 2 2, pointer;
}

/* ===== CSS 变量 ===== */
:root {
  --cream: #f0ebe3;
  --water1: #daeef6;
  --water2: #b8dce8;
  --water3: #8ec4d6;
  --mint: #8cc9a1;
  --text: #4a6b52;
  --text2: #7a9e86;
  --pf: 'Silkscreen', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--pf);
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/* ===== 标题 ===== */
.title {
  text-align: center;
  font-size: clamp(0.7rem, 2.6vw, 1.15rem);
  font-weight: 700;
  color: #3b8a4a;
  padding: 16px 12px 10px;
  animation: titleFloat 3.5s ease-in-out infinite;
  -webkit-font-smoothing: none;
}
@keyframes titleFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* ==========================================================
   池塘主容器 — 桌面端用 pond.png（第2张池塘图）
   ========================================================== */
.pond {
  position: relative;
  width: 96vw;
  max-width: 1100px;
  height: calc(100vh - 110px);
  min-height: 400px;
  max-height: 700px;
  background: url('images/pond.webp') center/contain no-repeat;
  border-radius: 6px;
  overflow: hidden;
}

/* 竖屏/移动端 切换竖版池塘 */
@media (orientation: portrait) {
  .pond {
    background-image: url('images/pond_mobile.webp');
    width: 94vw;
    height: calc(94vw * 1.247);
    max-height: calc(100vh - 100px);
    min-height: 280px;
  }
  .el-grass     { width: 8% !important; }
  .el-fish       { width: 10% !important; }
  .el-flower { width: 7% !important; }
  .el-lily       { width: 8% !important; }
  .el-lily-lg    { width: 10% !important; }
  .el-stone  { width: 8% !important; }
  .el-reed   { width: 10% !important; }
  .think-bubble { width: clamp(168px, 31%, 232px); }
  .think-nav { width: 40px; height: 40px; }
  .think-nav-left { left: -40px; }
  .think-nav-right { right: -40px; }
  .think-arrow { width: 22px; height: 22px; }
  .think-link { width: 40px; height: 40px; }
  .think-icon { font-size: clamp(1.1rem, 4vw, 1.6rem); }
  .frog-wrap  { width: clamp(80px, 18%, 130px); }
}

/* ===== 抹鱼计数器包裹 ===== */
.counter-wrap {
  position: absolute;
  top: 5%;
  right: 4%;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  user-select: none;
}
.counter-icon {
  width: clamp(16px, 2.5vw, 26px);
  height: auto;
  image-rendering: pixelated;
  pointer-events: none;
}
.catch-counter {
  font-family: var(--pf);
  font-size: clamp(1rem, 2.8vw, 1.6rem);
  font-weight: 700;
  color: #3b6b8a;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.6);
  letter-spacing: 2px;
  -webkit-font-smoothing: none;
  transition: transform 0.2s ease;
}
.catch-counter.pop {
  animation: counterPop 0.35s ease;
}
@keyframes counterPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* ==========================================================
   通用装饰元素 — 所有位置固定，不随机
   ========================================================== */
.el {
  position: absolute;
  pointer-events: auto;
}

/* ===== 芦苇 ===== */
.el-reed {
  width: 7%;
  height: auto;
  z-index: 12;
  transform-origin: bottom center;
  animation: reedSway 5s ease-in-out infinite;
}
.el-reed-flip {
  transform: scaleX(-1);
  animation: reedSwayFlip 5s ease-in-out infinite;
}
@keyframes reedSway {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(2.5deg); }
}
@keyframes reedSwayFlip {
  0%, 100% { transform: scaleX(-1) rotate(0deg); }
  50%      { transform: scaleX(-1) rotate(2.5deg); }
}

/* ===== 水草 ===== */
.el-grass {
  height: auto;
  z-index: 3;
  transform-origin: bottom center;
  animation: grassSway 4.5s ease-in-out infinite;
}
.el-grass.el-grass-flip {
  transform: scaleX(-1);
  animation: grassSwayFlip 4.5s ease-in-out infinite;
}
.el-grass.shake { animation: elShake 0.5s ease-in-out !important; }
.el-grass.el-grass-flip.shake { animation: elShake 0.5s ease-in-out !important; }

/* 水草大小变体 */
.el-grass-lg { width: 7%; }
.el-grass-md { width: 5.5%; }
.el-grass-sm { width: 4%; }
@keyframes grassSway {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(3deg); }
}
@keyframes grassSwayFlip {
  0%, 100% { transform: scaleX(-1) rotate(0deg); }
  50%      { transform: scaleX(-1) rotate(3deg); }
}

/* ===== 花朵 ===== */
.el-flower {
  width: 5%;
  height: auto;
  z-index: 6;
  animation: flowerBob 3.5s ease-in-out infinite;
}
.el-flower.shake { animation: elShake 0.5s ease-in-out !important; }
@keyframes flowerBob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-3px) rotate(2deg); }
}

/* ===== 通用摇晃动画 ===== */
@keyframes elShake {
  0%   { transform: rotate(0); }
  25%  { transform: rotate(12deg); }
  50%  { transform: rotate(-10deg); }
  75%  { transform: rotate(6deg); }
  100% { transform: rotate(0); }
}

/* ===== 芦苇点击摇晃 ===== */
.el-reed.shake {
  animation: reedShake 0.6s ease-in-out !important;
}
@keyframes reedShake {
  0%   { transform: rotate(0); }
  20%  { transform: rotate(6deg); }
  40%  { transform: rotate(-5deg); }
  60%  { transform: rotate(4deg); }
  80%  { transform: rotate(-2deg); }
  100% { transform: rotate(0); }
}
.el-reed-flip.shake {
  animation: reedShakeFlip 0.6s ease-in-out !important;
}
@keyframes reedShakeFlip {
  0%   { transform: scaleX(-1) rotate(0); }
  20%  { transform: scaleX(-1) rotate(6deg); }
  40%  { transform: scaleX(-1) rotate(-5deg); }
  60%  { transform: scaleX(-1) rotate(4deg); }
  80%  { transform: scaleX(-1) rotate(-2deg); }
  100% { transform: scaleX(-1) rotate(0); }
}

/* ===== 石头 ===== */
.el-stone {
  width: 6%;
  height: auto;
  z-index: 13;
  transition: transform 0.2s ease;
}
.el-stone-lg { width: 7%; }
.el-stone-md { width: 5%; }
.el-stone-sm { width: 3.5%; }
.el-stone-water { width: 2.8%; z-index: 13; opacity: 0.85; }
.el-stone.bounce {
  animation: stoneBounce 0.35s ease !important;
}
@keyframes stoneBounce {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

/* ===== 荷叶 ===== */
.el-lily {
  width: 6%;
  height: auto;
  z-index: 5;
  transition: transform 0.3s ease;
}
.el-lily-lg { width: 8%; }
.el-lily-flip { transform: scaleX(-1); }
.el-lily:hover { filter: brightness(1.06); }
.el-lily.wobble { animation: wobble 0.8s ease-in-out; }
.el-lily.el-lily-flip.wobble { animation: wobbleFlip 0.8s ease-in-out; }
@keyframes wobble {
  0%   { transform: rotate(0deg); }
  20%  { transform: rotate(8deg); }
  40%  { transform: rotate(-6deg); }
  60%  { transform: rotate(4deg); }
  80%  { transform: rotate(-2deg); }
  100% { transform: rotate(0deg); }
}
@keyframes wobbleFlip {
  0%   { transform: scaleX(-1) rotate(0deg); }
  20%  { transform: scaleX(-1) rotate(8deg); }
  40%  { transform: scaleX(-1) rotate(-6deg); }
  60%  { transform: scaleX(-1) rotate(4deg); }
  80%  { transform: scaleX(-1) rotate(-2deg); }
  100% { transform: scaleX(-1) rotate(0deg); }
}

/* ===== 小鱼 — 平滑游动 ===== */
.el-fish {
  width: 7%;
  height: auto;
  z-index: 4;
  --fish-dir: 1;
  touch-action: none;
  transition: left 3s linear, top 3s linear, transform 0.4s ease;
}
/* 点击后加速逃跑 */
.el-fish.fast {
  transition: left 1.5s cubic-bezier(0.2,0.7,0.3,1), top 1.5s cubic-bezier(0.2,0.7,0.3,1), transform 0.3s ease;
}
.el-fish.grabbed {
  z-index: 15;
  transition: none !important;
  animation: fishStruggle 0.22s ease-in-out infinite;
  filter: brightness(1.05) saturate(1.08);
}
/* 鱼躲藏状态 */
.el-fish.hiding {
  opacity: 0;
  transition: left 2s linear, top 2s linear, transform 0.4s ease, opacity 0.5s ease;
  pointer-events: none;
}
.el-fish.emerging {
  opacity: 1;
  transition: left 1.5s cubic-bezier(0.2,0.7,0.3,1), top 1.5s cubic-bezier(0.2,0.7,0.3,1), transform 0.3s ease, opacity 0.4s ease;
}
@keyframes fishStruggle {
  0%   { transform: scaleX(var(--fish-dir)) translate(0, 0) rotate(0deg); }
  25%  { transform: scaleX(var(--fish-dir)) translate(-2px, -1px) rotate(-8deg); }
  50%  { transform: scaleX(var(--fish-dir)) translate(2px, 1px) rotate(7deg); }
  75%  { transform: scaleX(var(--fish-dir)) translate(-1px, 1px) rotate(-5deg); }
  100% { transform: scaleX(var(--fish-dir)) translate(0, 0) rotate(0deg); }
}

/* ==========================================================
   青蛙（固定中央）
   ========================================================== */
.frog-wrap {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(70px, 12%, 120px);
}
.frog-seat {
  position: absolute;
  width: 160%;
  height: auto;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
}
.frog-wrap img.frog {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: auto;
}
.frog-wrap:hover { transform: translate(-50%, -50%) scale(1.05); }
.frog-wrap.jumping { animation: fJump 0.5s ease-out; }
@keyframes fJump {
  0%   { transform: translate(-50%, -50%) translateY(0); }
  35%  { transform: translate(-50%, -50%) translateY(-14px) scaleY(1.04); }
  60%  { transform: translate(-50%, -50%) translateY(-16px); }
  80%  { transform: translate(-50%, -50%) translateY(-4px) scaleY(0.97); }
  100% { transform: translate(-50%, -50%) translateY(0); }
}
.frog-shadow {
  position: absolute;
  bottom: -4px;
  left: 15%;
  width: 70%;
  height: 10px;
  border-radius: 50%;
  background: rgba(100,160,180,0.15);
  pointer-events: none;
}

/* ==========================================================
   思考气泡 — 青蛙上方
   ========================================================== */
.think-bubble {
  position: absolute;
  z-index: 16;
  bottom: calc(50% + clamp(40px, 7%, 68px));
  left: 50%;
  transform: translateX(-50%) scale(0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s;
  width: clamp(126px, 18%, 190px);
}
.think-bubble.show {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}
.think-img { width: 100%; height: auto; display: block; }
.think-content {
  position: absolute;
  top: 31%;
  left: 50%;
  transform: translateX(-50%);
  width: 84%;
  pointer-events: none;
}
.think-items {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.think-items.switching-prev {
  transform: translateX(10px) scale(0.95);
  opacity: 0.72;
}
.think-items.switching-next {
  transform: translateX(-10px) scale(0.95);
  opacity: 0.72;
}
.think-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.52);
  border: 2px solid rgba(140,201,161,0.22);
  transition: transform 0.24s ease, background 0.24s ease, opacity 0.24s ease, border-color 0.24s ease;
  pointer-events: auto;
}
.think-link:hover { background: rgba(140,201,161,0.25); }
.think-link:active { transform: scale(0.9); }
.think-link-side {
  opacity: 0.68;
  transform: scale(0.82);
}
.think-link-current {
  opacity: 1;
  transform: scale(1.08);
  border-color: rgba(120,191,150,0.75);
  background: rgba(255,255,255,0.72);
  box-shadow: 0 0 0 1px rgba(95,160,120,0.35);
}
.think-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(115,165,145,0.55);
  border-radius: 6px;
  background: rgba(244,253,248,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: transform 0.16s ease, background 0.16s ease;
}
.think-nav-left { left: -36px; }
.think-nav-right { right: -36px; }
.think-nav:hover {
  background: rgba(203,238,222,0.78);
  transform: translateY(-50%) scale(1.06);
}
.think-nav:active {
  transform: translateY(-50%) scale(0.92);
}
.think-arrow {
  width: 20px;
  height: 20px;
  object-fit: contain;
  pointer-events: none;
}
.think-nav.click-feedback { animation: arrowBounce 0.28s ease; }
@keyframes arrowBounce {
  0%   { transform: translateY(-50%) scale(1); }
  45%  { transform: translateY(-50%) scale(0.78); }
  100% { transform: translateY(-50%) scale(1); }
}
.think-icon {
  font-size: clamp(1rem, 2.8vw, 1.55rem);
  line-height: 1;
  user-select: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

/* ==========================================================
   水波纹 + 气泡
   ========================================================== */
.ripple {
  position: absolute;
  pointer-events: none;
  z-index: 8;
  animation: ripEx 1.5s ease-out forwards;
}
.ripple img { width: 100%; height: 100%; image-rendering: pixelated; }
@keyframes ripEx {
  0%   { width: 20px; height: 20px; opacity: 0.9; transform: translate(-50%,-50%) scale(0.5); }
  50%  { opacity: 0.5; }
  100% { width: 90px; height: 90px; opacity: 0; transform: translate(-50%,-50%) scale(1.5); }
}

.bubble {
  position: absolute;
  pointer-events: none;
  z-index: 8;
  animation: bubUp 2.4s ease-out forwards;
}
.bubble img { display: block; image-rendering: pixelated; }
@keyframes bubUp {
  0%   { opacity: 0.9; transform: translateY(0) scale(1); }
  100% { opacity: 0;   transform: translateY(-75px) scale(0.3); }
}

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  font-family: var(--pf);
  font-size: clamp(0.55rem, 1.5vw, 0.75rem);
  color: var(--text2);
  padding: 12px;
  -webkit-font-smoothing: none;
  letter-spacing: 1px;
}

/* ===== 跳转通知浮层 ===== */
.pond-notify {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 50;
  font-family: var(--pf);
  font-size: clamp(0.75rem, 2.2vw, 1.1rem);
  font-weight: 700;
  color: #3b8a4a;
  background: rgba(220,245,230,0.92);
  border: 3px solid #6ab87a;
  border-radius: 8px;
  padding: 14px 22px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s;
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
  box-shadow: 0 2px 12px rgba(60,140,80,0.18);
}
.pond-notify.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* ==========================================================
   响应式适配
   ========================================================== */
@media (max-width: 768px) {
  .pond { width: 98vw; max-height: 600px; }
  .frog-wrap { width: clamp(55px, 16%, 100px); }
  .think-bubble { width: clamp(142px, 28%, 205px); }
  .think-nav { width: 32px; height: 32px; }
  .think-nav-left { left: -32px; }
  .think-nav-right { right: -32px; }
  .think-arrow { width: 18px; height: 18px; }
}
@media (max-width: 480px) {
  .title { font-size: 0.6rem; padding: 10px 8px 6px; }
  .pond { width: 99vw; min-height: 280px; border-radius: 8px; }
  .frog-wrap { width: clamp(48px, 20%, 85px); }
  .think-bubble { width: clamp(132px, 35%, 188px); }
  .think-nav { width: 30px; height: 30px; }
  .think-nav-left { left: -28px; }
  .think-nav-right { right: -28px; }
  .think-arrow { width: 18px; height: 18px; }
}
