﻿:root {
  --ink: #163047;
  --muted: #5a7188;
  --cream: #fff8df;
  --white: #fffef7;
  --aqua: #35c6d4;
  --aqua-dark: #087f9b;
  --navy: #075174;
  --sun: #ffd35c;
  --orange: #ff8f3d;
  --red: #ef476f;
  --green: #22b573;
  --lime: #b8f05a;
  --shadow: rgba(8, 66, 90, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Trebuchet MS", "Comic Sans MS", "Microsoft JhengHei", sans-serif;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, .95) 0 5%, transparent 6%),
    radial-gradient(circle at 78% 9%, rgba(255, 211, 92, .95) 0 7%, transparent 8%),
    linear-gradient(180deg, #82e8ff 0%, #d7fbff 36%, #69d7d9 37%, #0e8eb3 70%, #056080 100%);
  overflow-x: hidden;
}

button { font: inherit; }

.world-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.sun {
  position: absolute;
  right: 7vw;
  top: 5vh;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: var(--sun);
  box-shadow: 0 0 0 18px rgba(255, 211, 92, .22), 0 0 70px rgba(255, 151, 61, .55);
}

.cloud,
.bubble,
.wave { position: absolute; }

.cloud {
  width: 150px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  animation: cloudDrift 16s ease-in-out infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.cloud::before { width: 66px; height: 66px; left: 24px; top: -28px; }
.cloud::after { width: 54px; height: 54px; right: 25px; top: -20px; }
.cloud-a { left: 7vw; top: 9vh; }
.cloud-b { left: 48vw; top: 15vh; transform: scale(.75); animation-duration: 22s; }

.bubble {
  width: 16px;
  height: 16px;
  border: 3px solid rgba(255,255,255,.58);
  border-radius: 50%;
  bottom: 5vh;
  animation: bubbleUp 6s ease-in infinite;
}

.bubble-a { left: 10vw; }
.bubble-b { left: 86vw; width: 25px; height: 25px; animation-delay: 1.8s; }

.wave {
  left: -5vw;
  right: -5vw;
  height: 90px;
  border-radius: 50%;
  background: repeating-radial-gradient(ellipse at center, rgba(255,255,255,.34) 0 8px, transparent 9px 28px);
  opacity: .55;
}

.wave-a { bottom: 13vh; animation: waveMove 8s ease-in-out infinite; }
.wave-b { bottom: 2vh; animation: waveMove 10s ease-in-out infinite reverse; }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0;
}

.hidden { display: none !important; }

.glass-card {
  border: 4px solid rgba(255,255,255,.72);
  border-radius: 34px;
  background: linear-gradient(145deg, rgba(255,255,247,.94), rgba(226,252,255,.88));
  box-shadow: 0 24px 65px var(--shadow), inset 0 0 0 1px rgba(255,255,255,.7);
  backdrop-filter: blur(10px);
}

.start-screen {
  display: grid;
  gap: 22px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 28px;
  min-height: 590px;
  padding: clamp(22px, 5vw, 54px);
  align-items: center;
}

.kicker {
  margin: 0 0 10px;
  color: var(--aqua-dark);
  font-size: .9rem;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  margin-bottom: 20px;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: .88;
  letter-spacing: -.08em;
}

h1 span {
  color: var(--aqua-dark);
  text-shadow: 3px 3px 0 #b8f05a;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4.8vw, 4.2rem);
  line-height: .95;
  letter-spacing: -.05em;
}

.intro,
.chapter-subtitle {
  color: #24465e;
  font-size: clamp(1.1rem, 2.1vw, 1.35rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 26px;
}

.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 16px 30px;
  color: #fff;
  font-size: 1.16rem;
  font-weight: 950;
  background: linear-gradient(135deg, #ff9a3d, #ef476f 70%);
  box-shadow: 0 12px 0 #9f2a43, 0 22px 34px rgba(239, 71, 111, .25);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 0 16px 0 #9f2a43, 0 28px 44px rgba(239, 71, 111, .3);
}

.total-pill {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 11px 18px;
  border: 3px solid rgba(8,127,155,.18);
  border-radius: 999px;
  background: #fff7c7;
  font-weight: 950;
}

.captain-card {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border-radius: 36px;
  background:
    radial-gradient(circle at 70% 72%, rgba(255,255,255,.58), transparent 20%),
    linear-gradient(180deg, #ffe38b 0 27%, #58d5d8 28% 100%);
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.55);
}

.flag {
  position: absolute;
  left: 28px;
  top: 26px;
  padding: 10px 15px;
  border-radius: 999px;
  color: #fff;
  background: var(--navy);
  font-weight: 950;
  letter-spacing: .08em;
}

.island {
  position: absolute;
  left: 36px;
  bottom: 72px;
  width: 205px;
  height: 85px;
  border-radius: 55% 45% 18px 18px;
  background: linear-gradient(180deg, #c68b45, #8d5524);
}

.island::before {
  content: "";
  position: absolute;
  left: 42px;
  top: -75px;
  width: 18px;
  height: 90px;
  border-radius: 999px;
  background: #7a4b28;
  transform: rotate(13deg);
}

.island::after {
  content: "";
  position: absolute;
  left: 42px;
  top: -92px;
  width: 135px;
  height: 70px;
  border-radius: 70% 0 70% 0;
  background: #22b573;
  transform: rotate(-12deg);
  box-shadow: -58px 22px 0 #2dcc82;
}

.boat-wrap {
  position: absolute;
  right: 15%;
  top: 34%;
  animation: bob 2.4s ease-in-out infinite;
}

.boat-body { font-size: 6.2rem; }
.fishing-line {
  position: absolute;
  right: -36px;
  top: 76px;
  width: 3px;
  height: 130px;
  background: rgba(22,48,71,.58);
}

.hook-dot {
  position: absolute;
  right: -46px;
  top: 198px;
  width: 20px;
  height: 20px;
  border-right: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  border-radius: 0 0 18px 0;
}

.fish {
  position: absolute;
  display: grid;
  place-items: center;
  width: 92px;
  height: 54px;
  border-radius: 55% 42% 42% 55%;
  color: #fff;
  font-weight: 950;
  background: var(--red);
  box-shadow: -14px 0 0 -5px rgba(255,255,255,.4);
}

.fish-one { right: 9%; bottom: 16%; animation: swim 3s ease-in-out infinite; }
.fish-two { left: 36%; bottom: 9%; background: var(--green); animation: swim 3.8s ease-in-out infinite reverse; }
.treasure { position: absolute; right: 26%; bottom: 9%; font-size: 3.8rem; animation: sparkle 1.8s ease-in-out infinite; }

.map-panel { padding: clamp(18px, 3vw, 30px); }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: end; }
.section-heading h2 { font-size: clamp(1.8rem, 3.4vw, 3.2rem); }

.chapter-map,
.mini-map {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
}

.map-stop {
  position: relative;
  min-height: 108px;
  padding: 15px;
  border: 3px solid rgba(8,127,155,.18);
  border-radius: 24px;
  background: linear-gradient(145deg, #ffffff, #e5fbff);
  overflow: hidden;
}

.map-stop::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -24px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(53,198,212,.16);
}

.map-stop strong,
.map-stop small,
.map-icon { position: relative; z-index: 1; }
.map-stop strong { display: block; margin-top: 8px; font-size: 1rem; }
.map-stop small { color: var(--muted); font-weight: 900; }
.map-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 15px; background: #fff4b7; font-size: 1.55rem; }
.map-stop.done { background: linear-gradient(145deg, #e4ffe9, #c7f9d8); border-color: rgba(34,181,115,.35); }
.map-stop.active { background: linear-gradient(145deg, #fff2bd, #ffe4c4); border-color: rgba(255,143,61,.55); transform: translateY(-3px); box-shadow: 0 14px 28px rgba(255,143,61,.18); }
.map-stop.locked { opacity: .64; }

.game-screen {
  display: grid;
  place-items: start center;
}

.side-panel,
.play-panel { padding: clamp(18px, 3vw, 30px); }
.game-screen .side-panel,
.game-screen .sea-stage {
  display: none;
}

.play-panel {
  width: min(900px, 100%);
}
.side-panel { position: sticky; top: 18px; }
.mini-map { grid-template-columns: 1fr; gap: 10px; }
.mini-map .map-stop { min-height: auto; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 11px; border-radius: 18px; }
.mini-map .map-stop::after { display: none; }
.mini-map .map-stop strong { margin: 0; font-size: .92rem; }
.mini-map .map-icon { width: 36px; height: 36px; font-size: 1.25rem; }

.score-deck {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
}

.score-deck div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 16px;
  border-radius: 20px;
  background: #fff7c7;
  font-weight: 950;
}

.score-deck span { color: var(--muted); }
.score-deck strong { font-size: 1.55rem; color: var(--aqua-dark); }

.game-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: flex-start;
}

.chapter-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border: 4px solid rgba(255,255,255,.9);
  border-radius: 28px;
  background: linear-gradient(145deg, #fff6ba, #ffcf95);
  font-size: 3rem;
  box-shadow: 0 16px 28px rgba(8,66,90,.14);
}

.game-header .chapter-subtitle {
  display: none;
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  margin: 22px 0;
}

.progress-bar {
  height: 20px;
  border-radius: 999px;
  padding: 4px;
  background: rgba(8,127,155,.15);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lime), var(--green), var(--aqua));
  transition: width .32s ease;
}

.progress-row p { margin: 0; font-weight: 950; }

.sea-stage {
  position: relative;
  min-height: 170px;
  margin-bottom: 20px;
  border-radius: 30px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffe190 0 30%, #57d6dc 31% 100%);
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.46);
}

.sea-stage::after {
  content: "";
  position: absolute;
  left: -8%; right: -8%; bottom: 26px;
  height: 44px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.6) 0 34px, transparent 34px 68px);
  opacity: .55;
  animation: waveSlide 3s linear infinite;
}

.sea-stage[data-sea="history"] { background: linear-gradient(180deg, #ffd2a6 0 30%, #74d0ff 31% 100%); }
.sea-stage[data-sea="firework"] { background: linear-gradient(180deg, #23395b 0 30%, #1a9bb0 31% 100%); }
.sea-stage[data-sea="compass"] { background: linear-gradient(180deg, #c7e8ff 0 30%, #146c94 31% 100%); }
.sea-stage[data-sea="fridge"] { background: linear-gradient(180deg, #e8fbff 0 30%, #5ccfe0 31% 100%); }

.stage-boat { position: absolute; left: 8%; top: 35%; font-size: 4.5rem; z-index: 2; animation: bob 2s ease-in-out infinite; }
.rod-line { position: absolute; left: 38%; top: 38%; width: 3px; height: 92px; background: rgba(22,48,71,.5); z-index: 2; transform: rotate(-16deg); }
.catch-orb { position: absolute; right: 18%; bottom: 32px; z-index: 3; display: grid; place-items: center; width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,.78); font-size: 2.8rem; box-shadow: 0 12px 28px rgba(8,66,90,.18); transition: transform .24s ease; }
.catch-orb.pop { transform: scale(1.24) rotate(-8deg); }
.sea-spark { position: absolute; z-index: 2; width: 12px; height: 12px; border-radius: 50%; background: #fff; opacity: .8; }
.spark-one { left: 55%; bottom: 54px; animation: sparkle 2s ease-in-out infinite; }
.spark-two { right: 8%; bottom: 88px; animation: sparkle 2.4s ease-in-out infinite reverse; }

.question-card {
  padding: clamp(18px, 3.4vw, 34px);
  border: 4px solid rgba(8,127,155,.16);
  border-radius: 30px;
  background: var(--white);
  box-shadow: 0 18px 42px rgba(8, 66, 90, .14);
}

.question-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--aqua-dark);
  font-weight: 950;
}

.question-card h3 {
  margin-bottom: 26px;
  font-size: clamp(1.55rem, 3.4vw, 2.75rem);
  line-height: 1.35;
}

.answers { display: grid; gap: 16px; }

.answer-button {
  position: relative;
  border: 3px solid rgba(8,127,155,.16);
  border-radius: 22px;
  padding: 19px 20px 19px 60px;
  color: var(--ink);
  background: linear-gradient(145deg, #ffffff, #edfbff);
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  font-weight: 900;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.answer-button::before {
  content: "🐠";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.answer-button:hover,
.answer-button:focus-visible {
  transform: translateX(7px);
  border-color: rgba(8,127,155,.48);
}

.answer-button.correct { border-color: rgba(34,181,115,.75); background: linear-gradient(145deg, #dfffe8, #f7fff0); }
.answer-button.correct::before { content: "✅"; }
.answer-button.wrong { border-color: rgba(239,71,111,.75); background: linear-gradient(145deg, #ffe5ec, #fff7f7); }
.answer-button.wrong::before { content: "🪸"; }
.answer-button:disabled { cursor: default; }

.feedback {
  min-height: 68px;
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255,255,255,.58);
  font-size: clamp(1.08rem, 2vw, 1.24rem);
  font-weight: 950;
  line-height: 1.45;
}

.catch-preview {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 14px;
  border: 4px solid rgba(34,181,115,.25);
  border-radius: 26px;
  background: linear-gradient(145deg, #efffed, #e7fbff);
  box-shadow: 0 16px 34px rgba(34,181,115,.14);
  animation: catchPop .26s ease-out;
}

.catch-preview img {
  width: 128px;
  max-width: 100%;
  border-radius: 22px;
}

.catch-preview strong {
  display: block;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  line-height: 1.1;
}

.catch-preview span {
  display: inline-flex;
  margin-top: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-weight: 950;
}

.next-button { margin-top: 8px; }

.chapter-complete,
.final-screen { display: grid; place-items: center; min-height: calc(100vh - 70px); }
.complete-card,
.final-card { width: min(780px, 100%); padding: clamp(24px, 5vw, 54px); text-align: center; }
.complete-card p,
.final-card p { font-size: 1.22rem; line-height: 1.65; }

.reward-badge,
.final-reward {
  display: grid;
  gap: 8px;
  width: min(590px, 100%);
  margin: 24px auto;
  padding: 24px;
  border-radius: 30px;
  background: linear-gradient(135deg, #fff3a8, #ffd3b0);
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.62), 0 16px 34px rgba(255,143,61,.16);
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  font-weight: 950;
}

.reward-badge span { font-size: 3.4rem; }
.reward-badge small { color: var(--aqua-dark); font-size: 1rem; }

.badge-wall,
.collection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 13px;
  margin: 22px 0;
}

.badge-wall span,
.collection span {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 74px;
  padding: 13px;
  border-radius: 22px;
  background: #e8fbff;
  font-weight: 950;
}

.badge-wall b { font-size: 1.8rem; }
.collection-title {
  margin: 24px 0 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.collection {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.collection .fish-card {
  min-height: 166px;
  background: linear-gradient(145deg, #ffffff, #e9fbff);
  border: 3px solid rgba(8,127,155,.12);
  box-shadow: 0 12px 26px rgba(8,66,90,.1);
}

.fish-card img {
  width: 100%;
  max-width: 150px;
  border-radius: 22px;
}

.fish-card strong {
  font-size: .98rem;
}

@keyframes cloudDrift { 0%,100% { translate: -18px 0; } 50% { translate: 36px 0; } }
@keyframes bubbleUp { 0% { transform: translateY(0) scale(.75); opacity: 0; } 20% { opacity: .8; } 100% { transform: translateY(-300px) scale(1.25); opacity: 0; } }
@keyframes waveMove { 0%,100% { translate: -24px 0; } 50% { translate: 34px 0; } }
@keyframes waveSlide { from { translate: 0 0; } to { translate: 68px 0; } }
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 10px; } }
@keyframes swim { 0%,100% { translate: 0 0; } 50% { translate: -24px 8px; } }
@keyframes sparkle { 0%,100% { transform: scale(.9); opacity: .65; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes catchPop { 0% { opacity: 0; transform: translateY(8px) scale(.96); } 100% { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 920px) {
  .hero-panel,
  .game-screen { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .mini-map { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .app-shell { width: min(100% - 18px, 1180px); padding: 16px 0; }
  .hero-panel { min-height: auto; }
  .captain-card { min-height: 330px; }
  .chapter-map,
  .mini-map { grid-template-columns: 1fr; }
  .game-header { display: block; }
  .chapter-icon { margin-top: 14px; width: 70px; height: 70px; border-radius: 22px; font-size: 2.35rem; }
  .progress-row { grid-template-columns: 1fr; }
  .answer-button { padding-left: 48px; font-size: 1.02rem; }
  .catch-preview { grid-template-columns: 92px 1fr; }
  .catch-preview img { width: 92px; }
}
