:root {
  color-scheme: light;
  /* Game tokens (unchanged) */
  --ink: #351b4c;
  --muted: #7e56c4;
  --pink: #f33991;
  --pink-deep: #d91d78;
  --pink-light: #ff96cf;
  --violet: #7e56c4;
  --orange: #ee9440;
  --grass: #7fc875;
  --grass-dark: #3d9f6d;
  --clay: #d68858;
  --blue: #5bc8ff;
  --cream: #fff8f0;
  --sky: #f8fbff;
  --panel: rgba(255, 255, 255, 0.84);
  --shadow: 0 18px 44px rgba(76, 42, 52, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--cream);
}

body {
  position: relative;
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--ink);
  font-family: "Outfit", "Noto Sans TC", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 53% 47%, rgb(255 255 255 / 92%) 0 15%, transparent 42%),
    linear-gradient(135deg, #fff8ee 0%, #fff2f7 50%, #f7f2ff 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgb(100 61 130 / 14%) 0.7px, transparent 0.7px);
  background-size: 11px 11px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 84%);
}

button,
img {
  -webkit-tap-highlight-color: transparent;
}

.game {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 0;
  gap: clamp(8px, 2svh, 18px);
}

.hud-row {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 15;
  pointer-events: none;
}

.scorebar {
  width: auto;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(30, 20, 24, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.metric {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.metric__label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  min-width: 18px;
  text-align: right;
  font-size: 17px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 10px var(--pink);
}

.status {
  width: 100%;
  flex-shrink: 0;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 6px;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0;
  background: linear-gradient(90deg, var(--pink), var(--orange));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field {
  position: relative;
  width: min(1180px, 100%);
  height: 100%;
  min-height: clamp(300px, 52svh, 430px);
  max-height: 620px;
  justify-self: center;
  align-self: center;
  overflow: hidden;
  border: 1px solid rgba(96, 124, 98, 0.18);
  border-radius: 8px;
  background: url("./bg.webp") no-repeat center center;
  background-size: cover;
  box-shadow: var(--shadow);
  user-select: none;
  touch-action: manipulation;
}

.dome-line {
  display: none;
  position: absolute;
  left: 7%;
  right: 7%;
  height: 42%;
  border: 2px solid rgba(93, 137, 162, 0.16);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  pointer-events: none;
}

.dome-line--back {
  top: 10%;
}

.dome-line--front {
  top: 18%;
  left: 14%;
  right: 14%;
  opacity: 0.66;
}

.base-line {
  display: none;
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 13%;
  height: 18%;
  background:
    linear-gradient(8deg, transparent 47%, rgba(214, 136, 88, 0.62) 48% 52%, transparent 53%),
    linear-gradient(-8deg, transparent 47%, rgba(214, 136, 88, 0.62) 48% 52%, transparent 53%);
  opacity: 0.66;
  pointer-events: none;
}

.sprite {
  position: absolute;
  width: clamp(150px, 25vw, 284px);
  aspect-ratio: 307 / 420;
  display: grid;
  place-items: end center;
  filter: drop-shadow(0 18px 20px rgba(64, 34, 42, 0.14));
  pointer-events: none;
}

.sprite img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
}

.pitcher-mound {
  position: absolute;
  bottom: calc(-4% - 20px);
  left: 50%;
  transform: translate(-50%, 0) scaleY(0.35);
  width: 110%;
  height: 38%;
  background: radial-gradient(ellipse at 50% 50%, #c68858 0%, #b27343 72%, transparent 100%);
  border-radius: 50%;
  z-index: 1;
}

.pitcher-plate {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26%;
  height: 12%;
  background: #ffffff;
  border-radius: 1px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.batter-box-area {
  position: absolute;
  bottom: -4%;
  left: 45%;
  transform: translate(-50%, 0) skewX(-12deg);
  width: 105%;
  height: 21.33%;
  z-index: 1;
}

.batter-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(198, 136, 88, 0.8);
  border-radius: 3px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.15);
}

.home-plate {
  position: absolute;
  top: calc(15% + 120px);
  left: 50%;
  transform: translateX(-50%);
  width: 20%;
  height: 70%;
  background: #ffffff;
  clip-path: polygon(0% 50%, 35% 0%, 100% 0%, 100% 100%, 35% 100%);
}

.sprite--cheerleader {
  bottom: 34%; /* Percentage-based for consistent ground positioning */
  width: clamp(90px, 16vw, 150px);
  aspect-ratio: 324 / 543;
  filter: drop-shadow(0 10px 14px rgba(64, 34, 42, 0.12));
  z-index: 2;
}

.cheerleader-pos--left {
  left: 50%;
  transform: translateX(calc(-150% - 12px));
}

.cheerleader-pos--middle {
  left: 50%;
  transform: translate(-50%, 20px);
}

.cheerleader-pos--right {
  left: 50%;
  transform: translateX(calc(50% + 12px));
}

.sprite--pitcher {
  right: clamp(12px, 5.2vw, 76px);
  bottom: calc(clamp(22px, 8vh, 68px) - 20px);
  z-index: 3;
}

.sprite--pitcher img {
  transform: scaleX(-1);
}

.sprite--batter {
  left: clamp(10px, 4.2vw, 58px);
  bottom: clamp(14px, 6.8vh, 56px);
  width: clamp(164px, 27vw, 306px);
  z-index: 3;
}

.sprite--batter img {
  transform: none;
}

@media (min-width: 721px) {
  .sprite--pitcher {
    width: clamp(120px, 20vw, 227px);
  }

  .sprite--batter {
    width: clamp(131px, 21.6vw, 245px);
  }
}

@media (min-width: 1025px) {
  .field {
    min-height: clamp(420px, 62svh, 560px);
    max-height: 680px;
  }
}

.ball {
  --ball-size: clamp(24px, 3.2vw, 40px);
  position: absolute;
  left: 0;
  top: 0;
  width: var(--ball-size);
  height: var(--ball-size);
  border: 2px solid #6e2c32;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, #fff 0 20%, #fff8ee 70%, #ead4bd 100%);
  box-shadow: 0 9px 16px rgba(80, 38, 44, 0.16);
  opacity: 0;
  transform: translate3d(-100px, -100px, 0) rotate(0deg);
  pointer-events: none;
  z-index: 4;
}

.ball::before,
.ball::after {
  content: "";
  position: absolute;
  top: 17%;
  bottom: 17%;
  width: 38%;
  border: 2px dashed #df6066;
  border-top: 0;
  border-bottom: 0;
}

.ball::before {
  left: 12%;
  border-right: 0;
  border-radius: 100% 0 0 100%;
}

.ball::after {
  right: 12%;
  border-left: 0;
  border-radius: 0 100% 100% 0;
}

.ball.is-visible {
  opacity: 1;
}

.strike-zone {
  position: absolute;
  border: 2px dashed rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 0 14px rgba(255, 255, 255, 0.25),
    0 0 0 1px rgba(64, 34, 42, 0.22),
    0 4px 14px rgba(64, 34, 42, 0.16);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
  z-index: 2;
}

.strike-zone.is-visible {
  opacity: 1;
}

.result-pop {
  position: absolute;
  left: clamp(180px, 22vw, 280px);
  top: 31%;
  min-width: 82px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0 14px;
  border-radius: 8px;
  color: #fff;
  font-weight: 950;
  background: var(--pink);
  box-shadow: 0 10px 24px rgba(233, 93, 146, 0.3);
  opacity: 0;
  transform: translateY(10px) scale(0.92);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
  z-index: 6;
}

.result-pop.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.start-overlay {
  position: absolute;
  inset: 0;
  z-index: 19;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(53 27 76 / 55%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.start-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.start-panel {
  width: min(390px, 92%);
  padding: 22px 26px 26px;
  color: var(--ink);
  text-align: center;
  background: rgb(255 255 255 / 84%);
  border: 1px solid rgb(53 27 76 / 10%);
  border-radius: 20px;
  box-shadow:
    0 20px 48px rgb(64 35 81 / 16%),
    0 0 0 1px rgb(255 255 255 / 70%) inset;
  transform: scale(0.92);
  transition: transform 0.24s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.start-overlay.is-visible .start-panel {
  transform: scale(1);
}

.start-panel h2 {
  margin: 0 0 8px;
  color: var(--pink-deep);
  font-size: 24px;
  text-shadow: 0.03em 0.04em 0 #ffd0e8;
}

.start-countdown {
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  margin: 2px auto 12px;
  padding: 6px 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink) 0%, var(--orange) 100%);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.start-rule {
  margin: 0 0 10px;
  color: rgb(53 27 76 / 76%);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.65;
  text-align: left;
}

.start-rule strong {
  color: var(--pink-deep);
  font-weight: 900;
}

.start-button {
  min-width: 148px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 10px 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 100%);
  box-shadow: 0 7px 18px rgb(236 45 137 / 28%);
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.start-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgb(236 45 137 / 36%);
}

.start-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.notice-toast {
  position: absolute;
  left: 50%;
  top: clamp(86px, 14%, 120px);
  z-index: 40;
  max-width: min(360px, calc(100% - 32px));
  padding: 10px 16px;
  color: #fff;
  background: rgb(53 27 76 / 88%);
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 999px;
  box-shadow: 0 14px 30px rgb(53 27 76 / 24%);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px) scale(0.96);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.notice-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.notice-toast--success {
  background: rgb(16 126 89 / 92%);
}

.notice-toast--error {
  background: rgb(217 29 120 / 92%);
}



/* BSOP Scoreboard */
.bsop {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(30, 20, 24, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.bsop__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bsop__label {
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.6);
  width: 14px;
  text-align: center;
}

.bsop__dots {
  display: flex;
  gap: 6px;
}

.bsop__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.05);
  transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.bsop__dot--ball.active {
  background: #10b981;
  box-shadow: 0 0 8px #10b981, inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

.bsop__dot--strike.active {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b, inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

.bsop__dot--out.active {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444, inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

/* Game Over Overlay */
.game-over-overlay {
  position: absolute;
  inset: 0;
  background: rgb(53 27 76 / 55%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 20;
}

.game-over-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.game-over-box {
  background: rgb(255 255 255 / 82%);
  border: 1px solid rgb(53 27 76 / 10%);
  border-radius: 24px;
  padding: 24px 32px;
  text-align: center;
  box-shadow:
    0 20px 48px rgb(64 35 81 / 16%),
    0 0 0 1px rgb(255 255 255 / 70%) inset;
  color: var(--ink);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-over-overlay.is-visible .game-over-box {
  transform: scale(1);
}

.game-over-box h2 {
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--pink-deep);
  text-shadow: 0.03em 0.04em 0 #ffd0e8;
}

.game-over-box p {
  font-size: 16px;
  margin-bottom: 8px;
  color: rgb(53 27 76 / 65%);
}

.game-over-box strong {
  color: var(--ink);
  font-size: 20px;
}

.restart-button {
  margin-top: 16px;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 100%);
  border: none;
  color: white;
  padding: 10px 24px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 7px 18px rgb(236 45 137 / 28%);
  transition: all 0.2s ease;
}

.restart-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgb(236 45 137 / 36%);
}

/* Base Running Board */
.bases {
  position: relative;
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(30, 20, 24, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.base-diamond {
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
  transform: rotate(45deg);
  transition: all 0.3s ease;
}

.base-diamond--2nd {
  top: 12px;
}

.base-diamond--3rd {
  left: 12px;
}

.base-diamond--1st {
  right: 12px;
}

.base-diamond.occupied {
  background: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 0 10px #f59e0b, inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

@media (max-width: 720px) {
  .hud-row {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .bases {
    width: 60px;
    height: 60px;
  }
  .base-diamond {
    width: 12px;
    height: 12px;
    border-width: 1.5px;
  }
  .base-diamond--2nd {
    top: 9px;
  }
  .base-diamond--3rd {
    left: 9px;
  }
  .base-diamond--1st {
    right: 9px;
  }
  .bsop {
    padding: 8px 10px;
    gap: 6px;
  }
  .bsop__dot {
    width: 9px;
    height: 9px;
  }
  .bsop__label {
    font-size: 11px;
    width: 10px;
  }
  .game {
    grid-template-rows: 1fr auto;
    padding-inline: 10px;
    gap: 8px;
  }

  .scorebar {
    min-width: 108px;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 8px;
  }

  .metric {
    height: 26px;
    gap: 3px;
    padding: 0 5px;
  }

  .metric__label {
    font-size: 10px;
  }

  .metric strong {
    min-width: 14px;
    font-size: 13px;
  }

  .status {
    width: 100%;
    flex-shrink: 0;
    height: 26px;
    padding-inline: 6px;
    font-size: 11px;
  }

  .field {
    min-height: clamp(292px, 54svh, 470px);
    border-radius: 8px;
  }

  .sprite {
    width: clamp(136px, 38vw, 178px);
  }

  .sprite--pitcher {
    right: clamp(-8px, 1.6vw, 18px);
    bottom: calc(clamp(38px, 16%, 86px) - 20px);
  }

  .sprite--batter {
    left: clamp(-6px, 1.2vw, 10px);
    bottom: clamp(36px, 14%, 72px);
    width: clamp(142px, 42vw, 184px);
  }

  .ball {
    --ball-size: clamp(24px, 7vw, 32px);
  }

  .result-pop {
    left: clamp(112px, 33vw, 180px);
    top: 34%;
    height: 36px;
    min-width: 74px;
    font-size: 14px;
  }



  .home-plate {
    top: calc(15% + 75px);
  }
}

@media (max-width: 430px) {
  .game {
    grid-template-rows: 1fr auto;
    padding-inline: 8px;
  }

  .field {
    min-height: clamp(280px, 52svh, 430px);
  }

  .sprite {
    width: clamp(128px, 40vw, 160px);
  }

  .sprite--batter {
    left: clamp(-2px, 1.6vw, 6px);
    width: clamp(136px, 43vw, 168px);
  }



  .home-plate {
    top: calc(15% + 65px);
  }
}

@media (max-height: 620px) {
  .game {
    grid-template-rows: 1fr auto;
    padding-block: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-bottom));
  }

  .field {
    min-height: 250px;
  }

  .sprite {
    width: clamp(118px, 32vw, 148px);
  }

  .sprite--batter {
    width: clamp(126px, 34vw, 158px);
  }


}

@media (orientation: portrait) {
  .sprite {
    width: clamp(72px, 22.4vw, 109px);
  }

  .sprite--pitcher {
    right: clamp(-6px, 1.2vw, 12px);
    bottom: calc(clamp(34px, 14%, 80px) - 20px);
  }

  .sprite--batter {
    left: clamp(-4px, 1.2vw, 8px);
    width: clamp(78px, 24.8vw, 117px);
    bottom: clamp(32px, 12%, 66px);
  }

  .result-pop {
    left: clamp(86px, 25vw, 130px);
  }

  .home-plate {
    top: calc(15% + 60px);
  }

  .sprite--cheerleader {
    width: clamp(66px, 19vw, 98px);
    bottom: 34%; /* Raised higher on mobile */
  }
}

/* Leaderboard Overlay */
.leaderboard-overlay {
  position: absolute;
  inset: 0;
  background: rgb(53 27 76 / 55%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 25;
}

.leaderboard-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.leaderboard-box {
  width: min(420px, 92%);
  background: rgb(255 255 255 / 82%);
  border: 1px solid rgb(53 27 76 / 10%);
  border-radius: 20px;
  padding: 20px 24px;
  text-align: center;
  box-shadow:
    0 20px 48px rgb(64 35 81 / 14%),
    0 0 0 1px rgb(255 255 255 / 70%) inset;
  color: var(--ink);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.leaderboard-overlay.is-visible .leaderboard-box {
  transform: scale(1);
}

.leaderboard-box h2 {
  font-size: 22px;
  color: var(--pink-deep);
  text-shadow: 0.02em 0.03em 0 #ffd0e8;
  margin: 0;
}

.leaderboard-my-rank {
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--pink-deep);
  background: rgb(243 57 145 / 8%);
  padding: 8px;
  border-radius: 6px;
  border: 1px dashed rgb(243 57 145 / 25%);
}


.cheer-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cheer-templates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 2px;
}

.cheer-template-chip {
  background: rgb(255 255 255 / 60%);
  border: 1px solid rgb(53 27 76 / 10%);
  color: rgb(53 27 76 / 75%);
  border-radius: 6px;
  padding: 6px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgb(53 27 76 / 6%);
}

.cheer-template-chip:hover {
  background: rgb(243 57 145 / 10%);
  border-color: rgb(243 57 145 / 35%);
  color: var(--pink-deep);
}

#cheerInput {
  background: rgb(255 255 255 / 55%);
  border: 1px solid rgb(53 27 76 / 12%);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  resize: none;
  height: 64px;
}

#cheerInput:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 8px rgb(243 57 145 / 18%);
}

.cheer-submit-btn {
  background: rgb(255 255 255 / 60%);
  border: 1px solid rgb(53 27 76 / 12%);
  color: var(--ink);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgb(64 35 81 / 7%);
}

.cheer-submit-btn:hover {
  background: rgb(243 57 145 / 10%);
  border-color: rgb(243 57 145 / 30%);
  color: var(--pink-deep);
}

.cheer-sent-message {
  display: none;
  margin: 0;
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  color: var(--pink-deep);
  background: rgb(255 255 255 / 55%);
  border: 1px solid rgb(243 57 145 / 20%);
  border-radius: 8px;
}

.cheer-panel.is-sent .cheer-templates,
.cheer-panel.is-sent #cheerInput,
.cheer-panel.is-sent .cheer-submit-btn {
  display: none;
}

.cheer-panel.is-sent .cheer-sent-message {
  display: block;
}

/* Input elements in Game Over modal */
.game-over-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.game-over-input {
  background: rgb(255 255 255 / 55%);
  border: 1px solid rgb(53 27 76 / 12%);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: center;
}

.game-over-input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 8px rgb(243 57 145 / 18%);
}

.submit-score-btn {
  background: linear-gradient(135deg, #e95d92 0%, #d23a74 100%);
  border: none;
  color: white;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(233, 93, 146, 0.3);
  transition: all 0.2s ease;
}

.submit-score-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 93, 146, 0.4);
}

/* App Container layout */
.app-container {
  position: relative;
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px;
  gap: 36px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.baseball-page .app-container {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  max-width: 1540px;
  min-height: calc(100svh - 3rem);
  padding: clamp(0.75rem, 2.5vw, 2rem);
}

.game-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.baseball-page .game-page-toolbar {
  width: min(1380px, 100%);
  margin-inline: auto;
}

.baseball-page .game {
  width: 100%;
}

.baseball-page .field {
  width: min(1380px, 100%);
  min-height: clamp(360px, 72svh, 760px);
  max-height: 780px;
}

/* Page glow orbs (matches reference site) */
.app-container::before,
.app-container::after {
  position: fixed;
  z-index: -2;
  width: min(42rem, 100vw);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.25;
  pointer-events: none;
  content: "";
}

.app-container::before {
  top: -18rem;
  left: 0;
  background: #ff5fac;
}

.app-container::after {
  right: 0;
  bottom: -21rem;
  background: #70ccff;
}

.site-disclaimer {
  width: min(1120px, calc(100% - 32px));
  margin: -16px auto 24px;
  color: rgb(53 27 76 / 56%);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
}

.language-control {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  background: rgb(255 255 255 / 68%);
  border: 1px solid rgb(53 27 76 / 10%);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgb(64 35 81 / 6%);
}

.language-label {
  color: rgb(53 27 76 / 58%);
  font-size: 12px;
  font-weight: 900;
}

.language-select {
  min-width: 116px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.language-select:focus {
  outline: 2px solid rgb(243 57 145 / 32%);
  outline-offset: 2px;
}

.leaderboard-page {
  min-height: 100vh;
}

.leaderboard-page-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 18px;
}

.leaderboard-page-header {
  display: grid;
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
}

.leaderboard-back-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 100%);
  border-radius: 999px;
  box-shadow: 0 7px 18px rgb(236 45 137 / 24%);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.leaderboard-page-kicker {
  color: var(--pink-deep);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.leaderboard-page-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 950;
  line-height: 1;
  text-shadow: 0.04em 0.055em 0 #ffd0e8;
}

.leaderboard-page-header p {
  max-width: 620px;
  margin: 0;
  color: rgb(53 27 76 / 68%);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.7;
}

.leaderboard-page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.leaderboard-page-meta span {
  padding: 6px 10px;
  color: rgb(53 27 76 / 72%);
  background: rgb(255 255 255 / 64%);
  border: 1px solid rgb(53 27 76 / 9%);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.leaderboard-page-table-wrap {
  overflow: hidden;
  background: rgb(255 255 255 / 74%);
  border: 1px solid rgb(53 27 76 / 10%);
  border-radius: 16px;
  box-shadow:
    0 20px 50px rgb(64 35 81 / 10%),
    0 0 0 1px rgb(255 255 255 / 60%) inset;
}

.leaderboard-page-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.leaderboard-page-table th,
.leaderboard-page-table td {
  padding: 14px 16px;
  text-align: center;
  border-bottom: 1px solid rgb(53 27 76 / 8%);
}

.leaderboard-page-table th {
  color: rgb(53 27 76 / 52%);
  background: rgb(243 57 145 / 7%);
  font-size: 13px;
  font-weight: 900;
}

.leaderboard-page-table td {
  color: var(--ink);
  font-weight: 800;
}

.leaderboard-page-table tr:last-child td {
  border-bottom: 0;
}

.leaderboard-page-table tr.top-rank-1 td { color: #d97706; }
.leaderboard-page-table tr.top-rank-2 td { color: var(--violet); }
.leaderboard-page-table tr.top-rank-3 td { color: #b45309; }

.leaderboard-page-table tr.is-me td {
  background: rgb(243 57 145 / 10%);
  box-shadow: inset 3px 0 0 var(--pink);
}

.leaderboard-page-my-rank {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 800;
  color: var(--pink-deep);
  background: rgb(243 57 145 / 8%);
  border: 1px dashed rgb(243 57 145 / 30%);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgb(64 35 81 / 8%);
}

.leaderboard-page-my-rank[hidden] {
  display: none;
}

/* Promo Hero Column */
.promo-hero {
  flex: 0 0 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  background: rgb(255 255 255 / 58%);
  border: 1px solid rgb(53 27 76 / 10%);
  border-radius: 24px;
  padding: 36px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 20px 50px rgb(64 35 81 / 10%),
    0 0 0 1px rgb(255 255 255 / 60%) inset;
  color: var(--ink);
  animation: fadeIn 0.8s ease-out;
}

.promo-badge {
  align-self: flex-start;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 1px;
  box-shadow: 0 7px 18px rgb(236 45 137 / 28%);
}

.promo-title {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.highlight-pink {
  color: var(--pink);
  text-shadow: 0.04em 0.055em 0 #ffd0e8;
  font-size: 36px;
}

.promo-date {
  font-size: 14px;
  font-weight: 800;
  color: var(--pink-deep);
  border-bottom: 2px solid rgb(243 57 145 / 15%);
  padding-bottom: 14px;
  letter-spacing: 0.04em;
}

.promo-desc {
  font-size: 13.5px;
  line-height: 1.7;
  color: rgb(53 27 76 / 72%);
  margin: 0;
}

.promo-desc strong {
  color: var(--ink);
}

.promo-songs-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--pink-deep);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.promo-songs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.promo-songs-list li {
  background: rgb(255 255 255 / 66%);
  border: 1px solid rgb(53 27 76 / 11%);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 4px 10px rgb(64 35 81 / 7%);
}

.promo-callout {
  font-size: 13px;
  line-height: 1.65;
  color: rgb(53 27 76 / 65%);
  border-left: 3px solid var(--pink);
  padding-left: 12px;
  margin: 0;
}

.promo-ticket {
  margin: 0;
  padding: 10px 12px;
  color: rgb(53 27 76 / 72%);
  background: rgb(255 255 255 / 58%);
  border: 1px solid rgb(243 57 145 / 18%);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.65;
}

.promo-ticket a {
  color: var(--pink-deep);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.promo-actions {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.promo-link-button {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--violet) 0%, var(--pink-deep) 100%);
  border-radius: 999px;
  box-shadow: 0 7px 18px rgb(126 86 196 / 22%);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.promo-link-button--primary {
  background: linear-gradient(135deg, var(--pink) 0%, var(--orange) 100%);
  box-shadow: 0 7px 18px rgb(243 57 145 / 24%);
}

.promo-link-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgb(126 86 196 / 30%);
}

.promo-link-button--primary:hover {
  box-shadow: 0 10px 24px rgb(243 57 145 / 32%);
}

.promo-footer {
  font-size: 11px;
  color: rgb(53 27 76 / 40%);
  text-align: center;
  border-top: 1px dashed rgb(53 27 76 / 12%);
  padding-top: 12px;
  margin-top: 4px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
    padding: 16px;
    gap: 20px;
    align-items: stretch;
  }

  .promo-hero {
    flex: none;
    width: 100%;
    padding: 24px;
    box-sizing: border-box;
  }

  .promo-title {
    font-size: 26px;
  }

  .highlight-pink {
    font-size: 30px;
  }

  .baseball-page .app-container {
    padding: 0.75rem;
  }
}

/* ========== 釣魚頁 fish.html ========== */
.fish-page {
  min-height: 100vh;
}

.fish-shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 18px;
}

.fish-header {
  display: grid;
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
}

.fish-header h1 {
  margin: 0;
  color: var(--pink-deep);
  font-size: clamp(26px, 5vw, 38px);
  text-shadow: 0.03em 0.04em 0 #ffd0e8;
}

.fish-header p {
  margin: 0;
  color: rgb(53 27 76 / 76%);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
}

.fish-game-wrap {
  padding: 14px;
  background: var(--panel);
  border: 1px solid rgb(53 27 76 / 8%);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.fish-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.fish-hud-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 14px;
  background: #fff;
  border: 1px solid rgb(53 27 76 / 10%);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  color: rgb(53 27 76 / 70%);
}

.fish-hud-item strong {
  color: var(--pink-deep);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.fish-hud-timer.is-urgent strong {
  color: #e02b2b;
  animation: fishUrgentPulse 1s infinite;
}

@keyframes fishUrgentPulse {
  50% { opacity: 0.45; }
}

.fish-dex {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid rgb(53 27 76 / 10%);
  border-radius: 999px;
}

.fish-dex-slot {
  width: 40px;
  height: auto;
  filter: grayscale(1) opacity(0.35);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.fish-dex-slot.is-caught {
  filter: none;
  transform: scale(1.08);
}

.fish-sea {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: clamp(560px, 82vh, 720px);
  max-height: 760px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffe9f4 0%, #ffd7ec 30%, #ffc9e3 45%, #7fc3ef 45%, #4f9fd9 78%, #3c7fc0 100%);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.fish-clouds {
  position: absolute;
  inset: 0 0 55%;
  background:
    radial-gradient(38px 20px at 22% 55%, #fff 60%, transparent 62%),
    radial-gradient(52px 24px at 30% 46%, #fff 60%, transparent 62%),
    radial-gradient(34px 18px at 74% 33%, #fffdfd 60%, transparent 62%),
    radial-gradient(48px 22px at 82% 42%, #fff 60%, transparent 62%);
  opacity: 0.9;
  animation: fishCloudDrift 26s linear infinite alternate;
}

@keyframes fishCloudDrift {
  to { transform: translateX(-26px); }
}

.fish-water {
  position: absolute;
  inset: 45% 0 0;
  overflow: hidden;
}

.fish-wave {
  position: absolute;
  left: -60px;
  right: -60px;
  height: 26px;
  background: radial-gradient(24px 14px at 12px 0, rgb(255 255 255 / 35%) 60%, transparent 62%);
  background-size: 48px 26px;
  background-repeat: repeat-x;
}

.fish-wave--back {
  top: 8px;
  opacity: 0.5;
  animation: fishWaveMove 7s linear infinite;
}

.fish-wave--front {
  top: 26px;
  animation: fishWaveMove 5s linear infinite reverse;
}

@keyframes fishWaveMove {
  to { transform: translateX(48px); }
}

.fish-silhouette {
  position: absolute;
  width: 84px;
  height: auto;
  filter: brightness(0) opacity(0.22);
  animation: fishSwim 11s linear infinite;
}

.fish-silhouette--1 { top: 34%; animation-delay: 0s; }
.fish-silhouette--2 { top: 58%; width: 66px; animation-delay: -4s; animation-duration: 14s; }
.fish-silhouette--3 { top: 76%; width: 74px; animation-delay: -8s; animation-duration: 9s; }

@keyframes fishSwim {
  0% { transform: translateX(-120px) scaleX(-1); }
  49.9% { transform: translateX(760px) scaleX(-1); }
  50% { transform: translateX(760px) scaleX(1); }
  100% { transform: translateX(-120px) scaleX(1); }
}

.fish-angler {
  position: absolute;
  z-index: 4;
  top: auto;
  bottom: calc(55% - 60px);
  left: 50%;
  width: clamp(280px, 58%, 430px);
  height: auto;
  max-height: calc(45% + 60px);
  object-fit: contain;
  transform: translateX(-50%);
  transform-origin: 50% 66%;
  pointer-events: none;
  filter: drop-shadow(0 12px 14px rgb(53 27 76 / 18%));
}

.fish-angler-badge {
  position: absolute;
  z-index: 9;
  top: 12px;
  left: 12px;
  max-width: calc(100% - 24px);
  padding: 7px 12px;
  color: #fff;
  background: rgb(53 27 76 / 78%);
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 999px;
  box-shadow: 0 5px 14px rgb(53 27 76 / 16%);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
  pointer-events: none;
}

/* 開始畫面先隱藏釣手，避免預設圖片載入後再切換造成閃爍。 */
.fish-sea.is-ready .fish-angler,
.fish-sea.is-ready .fish-angler-badge {
  visibility: hidden;
  animation: none;
}

.fish-line {
  display: none;
  position: absolute;
  top: 26%;
  left: 50%;
  width: 2px;
  height: 0;
  background: rgb(255 255 255 / 85%);
  transition: height 0.35s ease;
}

.fish-line.is-cast {
  height: 27%;
}

.fish-bobber {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  margin-left: -12px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff4b6e 0 48%, #fff 48%);
  border: 2px solid rgb(53 27 76 / 35%);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.fish-bobber.is-cast {
  opacity: 1;
  animation: fishBobberFloat 1.6s ease-in-out infinite;
}

.fish-bobber.is-bite {
  animation: fishBobberBite 0.4s ease-in-out infinite;
}

@keyframes fishBobberFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

@keyframes fishBobberBite {
  0%, 100% { transform: translateY(10px); }
  50% { transform: translateY(16px) rotate(-8deg); }
}

.fish-exclaim {
  position: absolute;
  z-index: 7;
  top: 34%;
  left: 50%;
  transform: translateX(-50%) scale(0);
  color: #ffe14b;
  font-size: 56px;
  font-weight: 900;
  text-shadow: 0 3px 0 rgb(53 27 76 / 45%), 0 0 18px rgb(255 225 75 / 65%);
  transition: transform 0.12s ease;
  pointer-events: none;
}

.fish-exclaim.is-visible {
  transform: translateX(-50%) scale(1);
  animation: fishExclaimShake 0.35s ease-in-out infinite;
}

@keyframes fishExclaimShake {
  0%, 100% { transform: translateX(-50%) scale(1) rotate(-6deg); }
  50% { transform: translateX(-50%) scale(1.12) rotate(6deg); }
}

.fish-catch-fly {
  position: absolute;
  z-index: 6;
  top: 52%;
  left: 50%;
  width: 96px;
  height: auto;
  opacity: 0;
  pointer-events: none;
}

.fish-catch-fly.is-flying {
  animation: fishFlyUp 0.9s ease-out forwards;
}

@keyframes fishFlyUp {
  0% { opacity: 1; transform: translate(-50%, 0) rotate(0); }
  60% { opacity: 1; transform: translate(-50%, -150px) rotate(-14deg); }
  100% { opacity: 0; transform: translate(-50%, -190px) rotate(-20deg) scale(0.9); }
}

.fish-jump {
  position: absolute;
  top: 46%;
  left: 40%;
  z-index: 6;
  width: 92px;
  height: auto;
  opacity: 0;
  transform: translateY(60px) scaleX(-1);
  pointer-events: none;
  filter: drop-shadow(0 10px 12px rgb(53 27 76 / 28%));
  cursor: pointer;
}

.fish-jump.is-jumping {
  pointer-events: auto;
  animation: fishJumpArc 1.5s ease-in-out;
}

@keyframes fishJumpArc {
  0% { opacity: 0; transform: translateY(70px) rotate(12deg) scaleX(-1); }
  18% { opacity: 1; transform: translateY(-30px) rotate(-14deg) scaleX(-1); }
  50% { opacity: 1; transform: translateY(-96px) rotate(0deg) scaleX(-1); }
  82% { opacity: 1; transform: translateY(-30px) rotate(16deg) scaleX(-1); }
  100% { opacity: 0; transform: translateY(70px) rotate(24deg) scaleX(-1); }
}

.fish-pop {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%) scale(0.6);
  padding: 8px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 100%);
  border-radius: 999px;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.fish-pop.is-visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.fish-status {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  color: #fff;
  background: rgb(53 27 76 / 62%);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

.fish-catch-card {
  position: absolute;
  top: 44%;
  left: 50%;
  z-index: 8;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 14px 22px 12px;
  background: rgb(255 255 255 / 94%);
  border: 2px solid var(--pink-light);
  border-radius: 18px;
  box-shadow: 0 16px 36px rgb(64 35 81 / 22%);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.4);
  pointer-events: none;
}

.fish-catch-card.is-visible {
  transform: translate(-50%, -50%) scale(1);
}

.fish-catch-card img {
  width: 120px;
  height: auto;
}

.fish-catch-card-name {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.fish-catch-card-plus {
  color: var(--pink-deep);
  font-size: 18px;
  font-weight: 900;
}

/* 結束畫面 */
.fish-end-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: safe center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  background: rgb(53 27 76 / 55%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.fish-end-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.fish-end-panel {
  width: min(400px, 100%);
  padding: 20px 22px 22px;
  color: var(--ink);
  text-align: center;
  background: rgb(255 255 255 / 92%);
  border: 1px solid rgb(53 27 76 / 10%);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgb(64 35 81 / 16%);
}

.fish-end-panel h2 {
  margin: 0 0 6px;
  color: var(--pink-deep);
  font-size: 24px;
  text-shadow: 0.03em 0.04em 0 #ffd0e8;
}

.fish-end-count {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 900;
}

.fish-end-dex {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.fish-end-dex .fish-dex-slot {
  width: 52px;
}

.fish-lucky {
  margin: 0 0 12px;
  padding: 14px 12px;
  background: linear-gradient(160deg, #fff3f9 0%, #ffe6f2 100%);
  border: 2px dashed var(--pink-light);
  border-radius: 16px;
}

.fish-lucky-title {
  color: var(--pink-deep);
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 6px;
}

.fish-lucky-img {
  width: 150px;
  height: auto;
  animation: fishLuckyWiggle 2.4s ease-in-out infinite;
}

@keyframes fishLuckyWiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg) translateY(-4px); }
}

.fish-lucky-name {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.fish-lucky-blessing {
  margin: 6px 0 0;
  color: rgb(53 27 76 / 80%);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
}

.fish-end-bonus {
  margin: 0 0 12px;
  padding: 10px 12px;
  color: #9a3d00;
  background: linear-gradient(135deg, #fff4d6 0%, #ffe9b3 100%);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.6;
}

.fish-cheer-group {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.fish-cheer-group .game-over-input {
  flex: 1;
}

#fishCheerTemplates .cheer-template-chip {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.4;
  text-overflow: clip;
  white-space: normal;
}

.fish-end-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
}

.fish-leaderboard-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--violet) 0%, #5e3a9e 100%);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.fish-page .notice-toast {
  position: fixed;
  top: 18px;
}

@media (max-width: 560px) {
  .fish-dex {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .fish-dex-slot {
    width: 34px;
  }

  .fish-sea {
    aspect-ratio: 3 / 4;
  }

  .fish-end-actions {
    flex-direction: column;
  }
}

/* 排行榜頁雙分頁 */
.leaderboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.leaderboard-tab {
  flex: 1 1 150px;
  min-height: 40px;
  padding: 8px 20px;
  background: #fff;
  color: rgb(53 27 76 / 65%);
  border: 2px solid rgb(53 27 76 / 12%);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.leaderboard-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 100%);
  border-color: transparent;
}

/* 釣魚難度選擇 */
.fish-mode-select {
  margin: 0 0 14px;
}

.fish-mode-label {
  margin-bottom: 8px;
  color: var(--pink-deep);
  font-size: 13px;
  font-weight: 900;
}

.fish-mode-options {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.fish-mode-option {
  flex: 1;
  max-width: 170px;
  display: grid;
  gap: 4px;
  padding: 10px 8px;
  background: rgb(255 255 255 / 70%);
  border: 2px solid rgb(53 27 76 / 12%);
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.fish-mode-option:hover {
  transform: translateY(-2px);
}

.fish-mode-option.is-selected {
  background: #fff;
  border-color: var(--pink-deep);
  box-shadow: 0 6px 14px rgb(236 45 137 / 22%);
}

.fish-mode-name {
  color: rgb(53 27 76 / 75%);
  font-size: 14px;
  font-weight: 900;
}

.fish-mode-option.is-selected .fish-mode-name {
  color: var(--pink-deep);
}

.fish-mode-desc {
  color: rgb(53 27 76 / 55%);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

/* 高級版拉扯戰進度條 */
.fish-struggle {
  position: absolute;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  width: min(320px, 84%);
  display: grid;
  gap: 6px;
  padding: 10px 14px 12px;
  background: rgb(53 27 76 / 72%);
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.fish-struggle.is-visible {
  opacity: 1;
}

.fish-struggle-label {
  color: #ffe14b;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  animation: fishUrgentPulse 0.6s infinite;
}

.fish-struggle-bar {
  height: 16px;
  overflow: hidden;
  background: rgb(255 255 255 / 25%);
  border-radius: 999px;
}

.fish-struggle-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--pink) 0%, #ffe14b 100%);
  border-radius: 999px;
  transition: width 0.08s linear;
}

.fish-struggle-timer {
  height: 5px;
  overflow: hidden;
  background: rgb(255 255 255 / 20%);
  border-radius: 999px;
}

.fish-struggle-timer-fill {
  width: 100%;
  height: 100%;
  background: #7ff0a8;
  border-radius: 999px;
  transition: width 0.1s linear;
}

/* 雙魚釣獲卡與總分 */
.fish-catch-card-imgs {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.fish-catch-card-imgs img {
  width: 110px;
  height: auto;
}

.fish-end-score {
  margin: -4px 0 10px;
  color: var(--pink-deep);
  font-size: 14px;
  font-weight: 900;
}

/* Ping Doongs 釣手動態 */
.fish-angler {
  animation: fishRodIdle 3.4s ease-in-out infinite;
}

@keyframes fishRodIdle {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-0.6deg); }
  50% { transform: translateX(-50%) translateY(5px) rotate(0.6deg); }
}

.fish-angler.is-casting {
  animation: fishRodCast 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes fishRodCast {
  0% { transform: translateX(-50%) rotate(0); }
  32% { transform: translateX(-50%) translateY(-5px) rotate(-2deg); }
  70% { transform: translateX(-50%) translateY(3px) rotate(1.5deg); }
  100% { transform: translateX(-50%) rotate(0); }
}

.fish-angler.is-bite {
  animation: fishRodShake 0.16s linear infinite;
}

@keyframes fishRodShake {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-1deg); }
  25% { transform: translateX(calc(-50% + 2px)) translateY(2px) rotate(1deg); }
  75% { transform: translateX(calc(-50% - 2px)) translateY(-2px) rotate(-1deg); }
}

.fish-angler.is-catch {
  animation: fishRodPull 0.55s ease-out;
}

@keyframes fishRodPull {
  0% { transform: translateX(-50%) rotate(0); }
  38% { transform: translateX(-50%) translateY(-12px) rotate(-2deg) scale(1.02); }
  70% { transform: translateX(-50%) translateY(2px) rotate(1deg); }
  100% { transform: translateX(-50%) rotate(0); }
}
