* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
html, body { width:100%; height:100%; overflow:hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Comic Sans MS', sans-serif;
  background:
    radial-gradient(ellipse at top, #1e3a8a 0%, transparent 60%),
    linear-gradient(180deg,
      #0c1e3d 0%,
      #1e3a8a 30%,
      #2c5282 55%,
      #4a90e2 75%,
      #f59e0b 95%,
      #fcd34d 100%);
  color: #FEF3C7;
  user-select: none; -webkit-user-select: none;
}

/* ===== WAVES BACKGROUND (replaces bubbles) ===== */
.bubbles { position:fixed; inset:0; pointer-events:none; z-index:0; overflow:hidden; }
.wave {
  position:absolute; bottom:0; left:0; right:0; height:120px;
  background: radial-gradient(ellipse at 50% 100%, rgba(255,255,255,0.15), transparent 70%);
  animation: waveMove 6s ease-in-out infinite;
}
.wave:nth-child(2) { bottom:30px; opacity:0.5; animation-duration:8s; animation-delay:-2s; }
.wave:nth-child(3) { bottom:60px; opacity:0.3; animation-duration:10s; animation-delay:-4s; }
@keyframes waveMove {
  0%,100% { transform:translateX(-20px) scaleY(1); }
  50% { transform:translateX(20px) scaleY(1.1); }
}
.floating-star {
  position:absolute; font-size:14px; opacity:0.5;
  animation: starTwinkle 3s ease-in-out infinite;
}
@keyframes starTwinkle {
  0%,100% { opacity:0.3; transform:scale(0.8); }
  50% { opacity:0.9; transform:scale(1.1); }
}

/* ===== ANIMATIONS ===== */
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }
@keyframes popIn { 0%{transform:scale(0.6);opacity:0} 70%{transform:scale(1.05)} 100%{transform:scale(1);opacity:1} }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
@keyframes bob { 0%,100%{transform:translateY(0) rotate(-2deg)} 50%{transform:translateY(-6px) rotate(2deg)} }
@keyframes glow { 0%,100%{box-shadow:0 0 20px rgba(252,211,77,0.4)} 50%{box-shadow:0 0 40px rgba(252,211,77,0.8),0 0 80px rgba(252,211,77,0.3)} }
@keyframes slideUp { from{opacity:0;transform:translateY(30px)} to{opacity:1;transform:translateY(0)} }
@keyframes slideDown { from{opacity:0;transform:translateY(-20px)} to{opacity:1;transform:translateY(0)} }
@keyframes fallDown { 0%{top:-80px;opacity:1} 90%{opacity:1} 100%{top:calc(100% - 120px);opacity:0.5} }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }
@keyframes shine {
  0% { background-position:-200% center; }
  100% { background-position:200% center; }
}
@keyframes spin { from{transform:rotate(0)} to{transform:rotate(360deg)} }
@keyframes bounce {
  0%,100% { transform:translateY(0) }
  25% { transform:translateY(-8px) }
  50% { transform:translateY(0) }
  75% { transform:translateY(-4px) }
}

/* ===== APP LAYOUT ===== */
#app { position:relative; z-index:1; width:100%; height:100%; max-width:600px; margin:0 auto; overflow:hidden; }
.screen { display:none; width:100%; height:100%; flex-direction:column; overflow:hidden; }
.screen.active { display:flex; }
.screen-scroll { flex:1; overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch; padding-bottom:100px; }
.screen-scroll::-webkit-scrollbar { width:3px; }
.screen-scroll::-webkit-scrollbar-thumb { background:rgba(252,211,77,0.4); border-radius:4px; }

.screen-header {
  display:flex; align-items:center; gap:12px; padding:12px 16px;
  background: linear-gradient(180deg, rgba(146,64,14,0.85), rgba(146,64,14,0.6));
  backdrop-filter: blur(10px); flex-shrink:0; z-index:3;
  border-bottom: 2px solid rgba(252,211,77,0.4);
}
.screen-title { font-size:18px; font-weight:900; color:#FCD34D; text-shadow:2px 2px 0 rgba(0,0,0,0.4); }
.back-btn {
  width:42px; height:42px; border-radius:50%; border:3px solid rgba(252,211,77,0.6);
  background:rgba(146,64,14,0.7); color:#FCD34D; font-size:20px; font-weight:900;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 0 rgba(0,0,0,0.3);
}
.back-btn:active { background:rgba(146,64,14,0.9); transform:translateY(2px); box-shadow:0 2px 0 rgba(0,0,0,0.3); }

/* ===== BOTTOM NAV (wooden plank look) ===== */
.bottom-nav {
  position:fixed; bottom:0; left:0; right:0; z-index:50;
  display:flex; max-width:600px; margin:0 auto;
  background:
    linear-gradient(180deg, rgba(120,53,15,0.95), rgba(78,32,6,0.98));
  backdrop-filter: blur(15px);
  border-top: 3px solid rgba(252,211,77,0.4);
  padding: 8px 8px max(12px, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}
.nav-btn {
  flex:1; display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:8px 4px; border:none; background:transparent; color:#fbbf24aa;
  font-size:12px; cursor:pointer; border-radius:12px; transition:all 0.2s;
}
.nav-btn.active {
  color:#FCD34D; background:rgba(252,211,77,0.18);
  transform:translateY(-4px);
  text-shadow:0 0 8px rgba(252,211,77,0.6);
}
.nav-btn:active { transform:scale(0.95); }
.nav-icon { font-size:24px; line-height:1; }
.nav-label { font-size:11px; font-weight:800; }

/* ===== BUTTONS ===== */
.btn {
  padding:14px 28px; border-radius:18px; border:none; font-size:16px;
  font-weight:800; cursor:pointer; font-family:inherit; transition:all 0.15s;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  position:relative;
}
.btn:active { transform:translateY(3px); }
.btn-primary {
  background: linear-gradient(180deg, #F59E0B 0%, #D97706 50%, #92400E 100%);
  color:#FEF3C7;
  border:3px solid #FCD34D;
  box-shadow: 0 5px 0 #78350F, 0 10px 20px rgba(252,211,77,0.3);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
.btn-primary:active { box-shadow: 0 2px 0 #78350F, 0 4px 8px rgba(252,211,77,0.3); }
.btn-danger {
  background:linear-gradient(180deg, #DC2626, #991B1B);
  color:#FEF3C7;
  border:3px solid #F87171;
  box-shadow: 0 4px 0 #7F1D1D;
}
.btn-danger:active { box-shadow: 0 1px 0 #7F1D1D; }
.btn-ghost {
  background:rgba(146,64,14,0.4); color:#FEF3C7;
  border:3px solid rgba(252,211,77,0.4);
  box-shadow: 0 4px 0 rgba(0,0,0,0.3);
}
.btn-ghost:active { box-shadow: 0 1px 0 rgba(0,0,0,0.3); }
.btn-lg { padding:18px 40px; font-size:20px; border-radius:22px; }
.btn-sm { padding:8px 16px; font-size:13px; border-radius:12px; }
.gold { color:#FCD34D; font-weight:900; }

/* ============================================ */
/* ===== ADVENTURE HOME (Captain's Deck) ===== */
/* ============================================ */
.adventure-home {
  display:flex; flex-direction:column; gap:16px;
  padding:14px 16px 30px; animation:slideUp 0.5s ease;
}

.captain-banner {
  display:flex; align-items:center; gap:12px;
  background:
    linear-gradient(135deg, rgba(254,243,199,0.96), rgba(254,215,170,0.92));
  border:3px solid #92400E;
  border-radius:20px;
  padding:12px 16px;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.6),
    0 4px 12px rgba(0,0,0,0.3);
  position:relative;
}
.captain-banner::before {
  content:'⚓'; position:absolute; top:-12px; left:12px; font-size:18px;
  background:#92400E; padding:2px 6px; border-radius:50%;
}
.captain-avatar {
  font-size:50px; line-height:1;
  animation: bob 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}
.captain-info { flex:1; }
.captain-name {
  font-size:16px; font-weight:900; color:#78350F;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.6);
}
.captain-stats {
  display:flex; gap:10px; margin-top:4px;
  font-size:13px; font-weight:700; color:#92400E;
}
.captain-stats span { display:inline-flex; align-items:center; gap:2px; }

/* Quest card — today's adventure */
.quest-card {
  background:
    linear-gradient(180deg, rgba(254,243,199,0.95), rgba(253,224,167,0.95));
  border:4px solid #92400E;
  border-radius:24px;
  padding:18px;
  position:relative;
  box-shadow:
    inset 0 2px 6px rgba(255,255,255,0.6),
    0 8px 20px rgba(0,0,0,0.4);
}
.quest-card::before {
  content:'📜 今日任务';
  position:absolute; top:-14px; left:50%; transform:translateX(-50%);
  background:#92400E; color:#FCD34D;
  padding:4px 14px; border-radius:14px;
  font-size:12px; font-weight:900; letter-spacing:1px;
  border:2px solid #FCD34D;
}
.quest-day-num {
  display:inline-block;
  background:#92400E; color:#FCD34D;
  padding:4px 12px; border-radius:10px;
  font-size:13px; font-weight:900; margin-bottom:8px;
}
.quest-island-name {
  font-size:26px; font-weight:900; color:#78350F;
  text-shadow:2px 2px 0 rgba(252,211,77,0.5);
  margin-bottom:6px;
}
.quest-island-emoji {
  font-size:48px; margin-bottom:4px;
  animation: float 3s ease-in-out infinite;
  display:block;
}
.quest-objective {
  font-size:15px; color:#92400E; font-weight:600;
  margin-bottom:12px; line-height:1.4;
}
.quest-modes {
  display:flex; gap:6px; flex-wrap:wrap;
}
.mode-chip {
  padding:6px 10px; background:rgba(146,64,14,0.15);
  border:2px solid rgba(146,64,14,0.4); border-radius:10px;
  font-size:12px; font-weight:700; color:#78350F;
}

/* Set Sail mega button */
.set-sail-btn {
  position:relative;
  width:100%; padding:18px 20px;
  background: linear-gradient(180deg, #F59E0B 0%, #D97706 50%, #92400E 100%);
  border:4px solid #FCD34D;
  border-radius:24px;
  color:#FEF3C7;
  font-size:22px; font-weight:900;
  cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:12px;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.3),
    0 6px 0 #78350F,
    0 12px 30px rgba(252,211,77,0.4);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.4);
  animation: glow 2.5s ease-in-out infinite;
}
.set-sail-btn:active {
  transform:translateY(4px);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.3), 0 2px 0 #78350F, 0 4px 8px rgba(252,211,77,0.4);
}
.set-sail-btn::before {
  content:''; position:absolute; top:0; left:0; right:0; bottom:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  background-size:200% 100%;
  animation: shine 3s ease-in-out infinite;
  border-radius:20px;
  pointer-events:none;
}
.set-sail-btn .ship-emoji {
  font-size:32px;
  animation: bob 1.5s ease-in-out infinite;
}

/* Treasure progress */
.treasure-progress {
  background: rgba(78,32,6,0.5);
  border:2px solid rgba(252,211,77,0.4);
  border-radius:14px;
  padding:10px 14px;
  text-align:center;
}
.progress-track {
  height:14px; background:rgba(0,0,0,0.4);
  border-radius:10px; overflow:hidden;
  border:2px solid rgba(252,211,77,0.3);
  margin-bottom:6px;
}
.progress-fill {
  height:100%;
  background: linear-gradient(90deg, #FCD34D, #F59E0B, #DC2626);
  border-radius:8px;
  transition:width 0.6s ease;
  box-shadow: 0 0 10px rgba(252,211,77,0.6);
}
.progress-text {
  font-size:13px; font-weight:800; color:#FCD34D;
  letter-spacing:1px;
}

.home-secondary {
  display:flex; gap:10px; flex-direction:column;
}
.checkin-reward {
  background: rgba(74,222,128,0.15); border:2px dashed rgba(74,222,128,0.5);
  border-radius:12px; padding:8px 14px;
  font-size:13px; color:#86EFAC; text-align:center; font-weight:700;
}

/* ============================================ */
/* ===== TREASURE MAP (Day Map) ===== */
/* ============================================ */
.treasure-map {
  padding:20px 14px 40px;
  position:relative;
}
.map-banner {
  text-align:center; margin-bottom:24px;
  background:
    linear-gradient(180deg, rgba(254,243,199,0.95), rgba(253,224,167,0.9));
  border:3px solid #92400E;
  border-radius:20px;
  padding:14px;
  position:relative;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.5), 0 6px 16px rgba(0,0,0,0.3);
}
.map-banner::before, .map-banner::after {
  content:'🗡️'; position:absolute; top:8px; font-size:18px;
}
.map-banner::before { left:14px; transform:rotate(-30deg); }
.map-banner::after { right:14px; transform:rotate(30deg) scaleX(-1); }
.map-title {
  font-size:22px; font-weight:900; color:#78350F;
  text-shadow:2px 2px 0 rgba(252,211,77,0.6);
  letter-spacing:1px;
}
.map-subtitle { font-size:13px; color:#92400E; margin-top:4px; font-weight:700; }

/* Island path — vertical zigzag */
.islands-path { position:relative; padding:10px 0; }
.islands-path::before {
  content:''; position:absolute;
  top:0; bottom:0; left:50%; width:2px;
  background:
    repeating-linear-gradient(to bottom,
      rgba(252,211,77,0.6) 0px,
      rgba(252,211,77,0.6) 6px,
      transparent 6px,
      transparent 12px);
  z-index:0;
}
.island {
  position:relative; z-index:1;
  width:80%; max-width:280px;
  margin:8px 0;
  display:flex; align-items:center; gap:14px;
  background:
    linear-gradient(135deg, rgba(254,243,199,0.95), rgba(253,224,167,0.9));
  border:3px solid #92400E;
  border-radius:18px;
  padding:14px;
  cursor:pointer; transition:all 0.2s;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.6), 0 4px 10px rgba(0,0,0,0.3);
  animation: slideUp 0.4s ease backwards;
}
.island:nth-child(odd) { margin-left:auto; margin-right:14px; }
.island:nth-child(even) { margin-left:14px; }
.island:nth-child(1) { animation-delay:0s; }
.island:nth-child(2) { animation-delay:0.05s; }
.island:nth-child(3) { animation-delay:0.1s; }
.island:nth-child(4) { animation-delay:0.15s; }
.island:nth-child(5) { animation-delay:0.2s; }
.island:nth-child(6) { animation-delay:0.25s; }
.island:nth-child(7) { animation-delay:0.3s; }
.island:nth-child(8) { animation-delay:0.35s; }
.island:nth-child(9) { animation-delay:0.4s; }
.island:nth-child(10) { animation-delay:0.45s; }

.island:active { transform:scale(0.96); }
.island.current {
  border-color:#FCD34D;
  background: linear-gradient(135deg, #FEF3C7, #FCD34D);
  animation: glow 2s ease-in-out infinite, slideUp 0.4s ease backwards;
}
.island.current::after {
  content:'⛵'; position:absolute;
  right:-18px; top:50%; transform:translateY(-50%);
  font-size:36px;
  animation: bob 2s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  z-index:2;
}
.island.completed {
  background: linear-gradient(135deg, rgba(187,247,208,0.9), rgba(134,239,172,0.85));
  border-color:#15803D;
}
.island.completed::before {
  content:'🚩'; position:absolute;
  top:-10px; right:-6px; font-size:24px;
}
.island.locked {
  background: linear-gradient(135deg, rgba(120,113,108,0.4), rgba(87,83,78,0.4));
  border-color:rgba(120,113,108,0.6);
  opacity:0.7; pointer-events:none;
}
.island.locked .island-emoji { filter:grayscale(1); }
.island.locked .island-name { color:#78716C; }
.island-num-tag {
  background:#92400E; color:#FCD34D;
  padding:2px 8px; border-radius:8px;
  font-size:11px; font-weight:900;
  position:absolute; top:-10px; left:10px;
  border:2px solid #FCD34D;
}
.island.locked .island-num-tag { background:#57534E; color:#A8A29E; border-color:#A8A29E; }
.island-emoji {
  font-size:42px; line-height:1; flex-shrink:0;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.island-info { flex:1; min-width:0; }
.island-name {
  font-size:16px; font-weight:900; color:#78350F;
  margin-bottom:2px;
}
.island-grammar { font-size:11px; color:#92400E; margin-bottom:4px; font-weight:600; }
.island-stars-row { font-size:14px; }

/* ============================================ */
/* ===== GAME CONTAINER ===== */
/* ============================================ */
.game-container { padding:14px; animation:slideUp 0.3s ease; }
.game-header {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:14px;
  background: linear-gradient(135deg, rgba(146,64,14,0.7), rgba(120,53,15,0.6));
  border:2px solid rgba(252,211,77,0.4);
  border-radius:14px;
  padding:10px 14px;
}
.game-title { font-size:18px; font-weight:900; color:#FCD34D; text-shadow:2px 2px 0 rgba(0,0,0,0.3); }
.game-info { font-size:14px; color:#FEF3C7; font-weight:800; }
.game-msg { min-height:30px; text-align:center; font-size:16px; font-weight:800; margin-top:12px; color:#FEF3C7; }

.review-banner {
  background:rgba(245,158,11,0.25);
  border:2px solid rgba(252,211,77,0.5);
  border-radius:14px; padding:12px; text-align:center; font-size:15px;
  color:#FCD34D; font-weight:800; margin-bottom:14px;
}

/* ===== FLIP CARDS ===== */
.flip-grid {
  display:grid; gap:10px; padding:8px 0;
}
.flip-card {
  aspect-ratio:1; border-radius:14px; cursor:pointer; perspective:600px;
}
.flip-inner {
  width:100%; height:100%; position:relative;
  transition:transform 0.5s; transform-style:preserve-3d;
}
.flip-card.flipped .flip-inner,
.flip-card.matched .flip-inner { transform:rotateY(180deg); }
.flip-front, .flip-back {
  position:absolute; inset:0; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  backface-visibility:hidden; font-size:28px; font-weight:800;
  box-shadow:inset 0 2px 4px rgba(255,255,255,0.3), 0 3px 6px rgba(0,0,0,0.3);
}
.flip-front {
  background: linear-gradient(145deg, #92400E, #78350F);
  border:3px solid #FCD34D;
  color:#FCD34D;
}
.flip-back {
  background: linear-gradient(145deg, #FEF3C7, #FDE68A);
  border:3px solid #92400E;
  transform:rotateY(180deg); font-size:15px; padding:6px;
  text-align:center; line-height:1.3; flex-direction:column; gap:2px;
  color:#78350F;
}
.flip-en { color:#92400E; font-weight:900; }
.flip-zh { color:#78350F; }
.flip-card.matched .flip-back {
  background: linear-gradient(145deg, #BBF7D0, #86EFAC);
  border-color:#15803D;
}

/* ===== SPELLING ===== */
.spell-area { display:flex; flex-direction:column; align-items:center; gap:12px; }
.sound-btn {
  width:74px; height:74px; border-radius:50%;
  border:4px solid #FCD34D;
  background: radial-gradient(circle at 30% 30%, #F59E0B, #92400E);
  font-size:34px; cursor:pointer; color:#FEF3C7;
  display:flex; align-items:center; justify-content:center;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.3),
    0 0 25px rgba(252,211,77,0.4),
    0 4px 0 #78350F;
  transition:all 0.15s;
}
.sound-btn:active { transform:translateY(3px); box-shadow: inset 0 2px 4px rgba(255,255,255,0.3), 0 0 35px rgba(252,211,77,0.6), 0 1px 0 #78350F; }
.sound-btn.big { width:96px; height:96px; font-size:46px; }
.spell-emoji { font-size:54px; animation:float 3s ease-in-out infinite; }
.spell-zh {
  font-size:24px; font-weight:900; color:#FCD34D;
  text-shadow:2px 2px 0 rgba(0,0,0,0.3);
  background:rgba(146,64,14,0.4);
  padding:6px 16px; border-radius:14px;
  border:2px solid rgba(252,211,77,0.4);
}
.spell-hint { font-size:14px; color:#FEF3C7; min-height:20px; font-weight:600; }
.spell-slots {
  display:flex; gap:8px; justify-content:center; flex-wrap:wrap;
  min-height:58px; align-items:center;
}
.spell-slot {
  width:46px; height:56px; border-radius:12px;
  border:3px dashed rgba(252,211,77,0.5);
  background:rgba(146,64,14,0.3);
  display:flex; align-items:center; justify-content:center;
  font-size:26px; font-weight:900; color:#FCD34D;
  transition:all 0.15s;
}
.spell-slot.filled {
  border-style:solid; border-color:#FCD34D;
  background:rgba(252,211,77,0.2);
  box-shadow: 0 0 10px rgba(252,211,77,0.4);
}
.spell-slot.correct {
  border-color:#22C55E; color:#86EFAC; background:rgba(34,197,94,0.2);
  animation:popIn 0.3s;
}
.spell-slot.wrong {
  border-color:#EF4444; color:#FCA5A5; background:rgba(239,68,68,0.2);
  animation:shake 0.4s;
}
.spell-slot.hint-letter { color:#60A5FA; border-color:#60A5FA; background:rgba(96,165,250,0.15); }
.spell-keyboard {
  display:grid; grid-template-columns:repeat(6,1fr); gap:6px;
  width:100%; max-width:360px;
}
.spell-key {
  height:50px; border-radius:12px;
  background: linear-gradient(180deg, #B45309, #78350F);
  border:2px solid #FCD34D;
  color:#FCD34D; font-size:18px; font-weight:900; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 3px 0 #451A03;
  transition:all 0.1s;
}
.spell-key:active { transform:translateY(2px); box-shadow: 0 1px 0 #451A03; }
.spell-key.vowel-hint {
  border-color:#FCD34D;
  background: linear-gradient(180deg, #FCD34D, #F59E0B);
  color:#78350F;
  animation:pulse 1.5s ease-in-out infinite;
}
.spell-actions { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }

.ai-hint {
  background:
    linear-gradient(135deg, rgba(254,243,199,0.95), rgba(253,224,167,0.9));
  border:2px solid #92400E;
  border-radius:14px; padding:12px 16px; font-size:14px; color:#78350F;
  text-align:center; margin-top:8px; line-height:1.6; animation:slideUp 0.3s;
  font-weight:600;
}

/* ===== LISTENING ===== */
.listen-area { display:flex; flex-direction:column; gap:14px; }
.listen-prompt {
  background:
    linear-gradient(135deg, rgba(146,64,14,0.6), rgba(120,53,15,0.5));
  border:3px solid rgba(252,211,77,0.5);
  border-radius:20px; padding:20px; text-align:center;
  display:flex; flex-direction:column; align-items:center; gap:10px;
  box-shadow: inset 0 2px 6px rgba(255,255,255,0.1), 0 4px 12px rgba(0,0,0,0.3);
}
.listen-text { font-size:18px; font-weight:800; color:#FCD34D; text-shadow:1px 1px 0 rgba(0,0,0,0.4); }
.listen-zh { font-size:14px; color:#FEF3C7; }
.listen-choices { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.listen-choice {
  background:
    linear-gradient(180deg, rgba(254,243,199,0.85), rgba(253,224,167,0.7));
  border:3px solid #92400E;
  border-radius:16px; padding:18px 10px; color:#78350F; font-size:16px;
  font-weight:800; cursor:pointer; text-align:center; transition:all 0.15s;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3);
}
.listen-choice:active { transform:translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.3); }
.listen-choice.correct { background: linear-gradient(180deg, #BBF7D0, #86EFAC); border-color:#15803D; color:#14532D; animation:popIn 0.3s; }
.listen-choice.wrong { background: linear-gradient(180deg, #FCA5A5, #F87171); border-color:#991B1B; color:#7F1D1D; }

/* ===== SENTENCE WORKSHOP ===== */
.sentence-area { display:flex; flex-direction:column; gap:14px; }
.sentence-zh {
  font-size:22px; font-weight:900; color:#FCD34D; text-align:center;
  background:rgba(146,64,14,0.4);
  padding:10px 16px; border-radius:14px;
  border:2px solid rgba(252,211,77,0.4);
  text-shadow:2px 2px 0 rgba(0,0,0,0.3);
}
.sentence-hint { font-size:13px; color:#FEF3C7; text-align:center; font-weight:600; }
.sentence-slots {
  min-height:64px;
  background:rgba(78,32,6,0.4);
  border:3px dashed rgba(252,211,77,0.5); border-radius:16px;
  padding:12px; display:flex; flex-wrap:wrap; gap:8px;
  align-items:center; justify-content:center;
}
.sentence-placeholder { color:#FEF3C7; font-size:14px; font-weight:600; opacity:0.7; }
.sentence-pool {
  display:flex; flex-wrap:wrap; gap:8px; justify-content:center;
  padding:8px 0;
}
.word-chip {
  padding:10px 18px; border-radius:14px; font-size:16px; font-weight:800;
  cursor:pointer; transition:all 0.15s; border:none;
  background: linear-gradient(180deg, #FEF3C7, #FDE68A);
  border:3px solid #92400E;
  color:#78350F;
  box-shadow: 0 3px 0 rgba(0,0,0,0.3);
}
.word-chip:active { transform:translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.3); }
.word-chip.placed {
  background:linear-gradient(180deg, #FCD34D, #F59E0B);
  border-color:#78350F;
  color:#451A03;
}
.word-chip.correct { background: linear-gradient(180deg, #BBF7D0, #86EFAC); border-color:#15803D; color:#14532D; }

/* ===== WORD SHOOTER ===== */
.shoot-area {
  display:flex; flex-direction:column; align-items:center; gap:14px;
  min-height:300px; position:relative;
}
.shoot-falling {
  width:100%; height:260px; position:relative; overflow:hidden;
  background:
    radial-gradient(ellipse at center top, rgba(252,211,77,0.15), transparent 60%),
    linear-gradient(180deg, rgba(30,58,138,0.4), rgba(30,58,138,0.1));
  border-radius:20px;
  border:3px solid rgba(252,211,77,0.4);
}
.shoot-word {
  position:absolute; left:50%; transform:translateX(-50%);
  font-size:44px; text-align:center; animation:fallDown linear forwards;
  animation-duration: inherit;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
}
.shoot-word span { font-size:20px; color:#FCD34D; font-weight:900; display:block; text-shadow:2px 2px 0 rgba(0,0,0,0.5); }
.shoot-choices { display:grid; grid-template-columns:1fr 1fr; gap:10px; width:100%; }
.shoot-choice {
  padding:16px; border-radius:16px; font-size:17px; font-weight:800;
  cursor:pointer; text-align:center; transition:all 0.15s;
  background: linear-gradient(180deg, #FEF3C7, #FDE68A);
  border:3px solid #92400E;
  color:#78350F;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3);
}
.shoot-choice:active { transform:translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.3); }
.shoot-choice.correct { background: linear-gradient(180deg, #BBF7D0, #86EFAC); border-color:#15803D; color:#14532D; }
.shoot-choice.wrong { background: linear-gradient(180deg, #FCA5A5, #F87171); border-color:#991B1B; color:#7F1D1D; }

/* ===== AI CHAT ===== */
.chat-area {
  flex:1; overflow-y:auto; padding:8px 0; display:flex;
  flex-direction:column; gap:10px; max-height:45vh;
  -webkit-overflow-scrolling:touch;
}
.chat-bubble {
  max-width:85%; padding:12px 16px; border-radius:18px;
  font-size:15px; line-height:1.5; animation:slideUp 0.3s ease;
  word-break:break-word; font-weight:600;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}
.chat-bubble.ai {
  align-self:flex-start;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border:2px solid #92400E;
  color:#78350F;
  border-bottom-left-radius:4px;
}
.chat-bubble.user {
  align-self:flex-end;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border:2px solid #FCD34D;
  color:#FEF3C7;
  border-bottom-right-radius:4px;
}
.chat-options {
  display:flex; flex-direction:column; gap:8px; padding:8px 0;
}
.chat-option {
  padding:14px 16px; border-radius:16px; font-size:15px; font-weight:700;
  cursor:pointer; text-align:left; transition:all 0.15s;
  background: linear-gradient(180deg, rgba(254,243,199,0.85), rgba(253,224,167,0.7));
  border:3px solid #92400E;
  color:#78350F;
  box-shadow: 0 3px 0 rgba(0,0,0,0.3);
}
.chat-option:active { transform:translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.3); }

/* ===== COMPLETE SCREEN ===== */
.complete-screen {
  display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:18px; padding:40px 20px;
  text-align:center; animation:slideUp 0.5s ease;
  min-height:50vh;
}
.complete-emoji {
  font-size:84px;
  animation: bounce 1.5s ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(252,211,77,0.6));
}
.complete-title {
  font-size:28px; font-weight:900; color:#FCD34D;
  text-shadow:3px 3px 0 #92400E, 5px 5px 0 rgba(0,0,0,0.3);
}
.complete-stars { font-size:42px; letter-spacing:6px; }
.complete-score {
  font-size:20px; color:#FEF3C7; font-weight:800;
  background:rgba(146,64,14,0.6);
  padding:10px 22px; border-radius:14px;
  border:2px solid rgba(252,211,77,0.4);
}
.day-reward {
  background:
    linear-gradient(135deg, #FEF3C7, #FDE68A);
  border:3px solid #92400E;
  border-radius:16px; padding:12px 20px; color:#78350F; font-size:16px;
  font-weight:800; animation:popIn 0.6s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.day-preview { font-size:14px; color:#FEF3C7; font-weight:600; }

/* ===== FREE PLAY ===== */
.freeplay-screen {
  display:flex; flex-direction:column; align-items:center;
  gap:16px; padding:24px 16px;
}
.freeplay-title {
  font-size:26px; font-weight:900; color:#FCD34D;
  text-shadow:2px 2px 0 #92400E, 4px 4px 0 rgba(0,0,0,0.3);
}
.freeplay-subtitle { font-size:14px; color:#FEF3C7; font-weight:600; }
.freeplay-grid {
  display:grid; grid-template-columns:repeat(2,1fr); gap:14px; width:100%;
}
.freeplay-card {
  background:
    linear-gradient(135deg, rgba(254,243,199,0.95), rgba(253,224,167,0.9));
  border:3px solid #92400E;
  border-radius:20px; padding:20px 12px; text-align:center;
  cursor:pointer; transition:all 0.2s;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.5), 0 5px 0 rgba(120,53,15,0.8);
}
.freeplay-card:active { transform:translateY(3px); box-shadow: inset 0 2px 4px rgba(255,255,255,0.5), 0 2px 0 rgba(120,53,15,0.8); }
.fp-icon { font-size:42px; margin-bottom:6px; animation:float 3s ease-in-out infinite; }
.fp-name { font-size:16px; font-weight:900; color:#78350F; }
.fp-desc { font-size:12px; color:#92400E; margin-top:4px; font-weight:600; }

/* ===== SETTINGS ===== */
.settings-screen { padding:24px 16px; display:flex; flex-direction:column; gap:16px; }
.settings-title {
  font-size:26px; font-weight:900; color:#FCD34D; text-align:center;
  text-shadow:2px 2px 0 #92400E;
}
.settings-section {
  background:
    linear-gradient(135deg, rgba(254,243,199,0.92), rgba(253,224,167,0.85));
  border:3px solid #92400E;
  border-radius:16px; padding:16px;
  display:flex; flex-direction:column; gap:8px;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.5), 0 4px 10px rgba(0,0,0,0.3);
}
.settings-label { font-size:14px; font-weight:900; color:#92400E; }
.settings-stat { font-size:14px; color:#78350F; font-weight:600; }

/* ===== BATTLE INTRO (between mini-games) ===== */
.battle-intro {
  position:fixed; inset:0; z-index:100;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  background: radial-gradient(circle at center, rgba(146,64,14,0.85), rgba(0,0,0,0.95));
  animation: slideUp 0.4s ease;
}
.battle-intro-title {
  font-size:36px; font-weight:900; color:#FCD34D;
  text-shadow:3px 3px 0 #92400E, 5px 5px 0 rgba(0,0,0,0.5);
  animation: popIn 0.6s ease;
}
.battle-intro-sub {
  font-size:18px; color:#FEF3C7; font-weight:700;
  margin-top:10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 380px) {
  .spell-slot { width:38px; height:48px; font-size:22px; }
  .spell-key { height:44px; font-size:16px; }
  .spell-keyboard { grid-template-columns:repeat(5,1fr); }
  .flip-grid { gap:6px; }
  .listen-choices { gap:6px; }
  .listen-choice { padding:14px 6px; font-size:14px; }
  .btn { padding:12px 22px; font-size:14px; }
  .btn-lg { padding:14px 32px; font-size:17px; }
  .game-title { font-size:17px; }
  .spell-emoji { font-size:42px; }
  .spell-zh { font-size:20px; }
  .complete-emoji { font-size:64px; }
  .complete-title { font-size:24px; }
  .quest-island-name { font-size:22px; }
  .quest-island-emoji { font-size:42px; }
  .set-sail-btn { font-size:19px; padding:16px; }
  .set-sail-btn .ship-emoji { font-size:28px; }
  .captain-avatar { font-size:42px; }
  .island { padding:12px; }
  .island-emoji { font-size:36px; }
  .island-name { font-size:14px; }
}

@media (min-width: 768px) {
  #app { max-width:500px; }
  .spell-slot { width:54px; height:66px; font-size:30px; }
  .spell-key { height:58px; font-size:20px; }
  .flip-back { font-size:18px; }
}
