/* 
 * English Adventure Island - Simplified Stylesheet
 * Optimized for absolute beginners. Extra large cards, super simple visual controls,
 * magical 3D card flips, and bouncy cartoon styling.
 */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Lilita+One&display=swap');

:root {
  --color-primary: #FF6B6B;
  --color-secondary: #48DBFB;
  --color-success: #1DD1A1;
  --color-warning: #FF9F43;
  --color-accent: #9B5DE5;
  --color-bg-light: #F8F9FA;
  
  --font-family: 'Fredoka', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Lilita One', cursive, sans-serif;
  
  --shadow-bubbly: 0 10px 0px rgba(0, 0, 0, 0.08), 0 15px 30px rgba(0, 0, 0, 0.08);
  --shadow-bubbly-hover: 0 6px 0px rgba(0, 0, 0, 0.08), 0 10px 20px rgba(0, 0, 0, 0.06);
  --shadow-bubbly-active: 0 0px 0px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, #FFF9F3 0%, #EBF5FB 100%);
  color: #333333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 10px;
}

/* Master Game Container */
#game-container {
  width: 100%;
  max-width: 1050px;
  height: 94vh;
  max-height: 720px;
  background: white;
  border-radius: 40px;
  border: 10px solid #FFF;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Drifting clouds */
.clouds-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
}
.cloud {
  position: absolute;
  background: white;
  border-radius: 100px;
  filter: blur(1px);
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: white;
  border-radius: 50%;
}
.cloud.c1 { width: 120px; height: 40px; top: 10%; left: -150px; animation: drift 32s linear infinite; }
.cloud.c1::before { width: 50px; height: 50px; top: -25px; left: 15px; }
.cloud.c1::after { width: 70px; height: 70px; top: -35px; right: 15px; }

.cloud.c2 { width: 160px; height: 50px; top: 30%; left: -200px; animation: drift 42s linear infinite 4s; }
.cloud.c2::before { width: 70px; height: 70px; top: -35px; left: 20px; }
.cloud.c2::after { width: 90px; height: 90px; top: -45px; right: 25px; }

.cloud.c3 { width: 90px; height: 32px; top: 5%; left: -120px; animation: drift 25s linear infinite 10s; }
.cloud.c3::before { width: 35px; height: 35px; top: -18px; left: 10px; }
.cloud.c3::after { width: 45px; height: 45px; top: -22px; right: 10px; }

@keyframes drift {
  0% { transform: translateX(0); }
  100% { transform: translateX(1250px); }
}

.game-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header Section */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 4px dashed #F1F2F6;
  z-index: 10;
}

.logo {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  font-size: 34px;
  animation: float 2.5s ease-in-out infinite alternate;
}

.stats-bar {
  display: flex;
  gap: 15px;
  align-items: center;
}

.stat-pill {
  background: white;
  border: 4px solid #F1F2F6;
  border-radius: 50px;
  padding: 6px 18px;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}
.stat-pill.stars { border-color: #FEEAA7; color: #E1B12C; }

.btn-pill {
  border: none;
  font-family: var(--font-family);
  font-weight: 700;
  border-radius: 50px;
  padding: 8px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 0px rgba(0, 0, 0, 0.1);
}
.btn-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0px rgba(0, 0, 0, 0.1);
}
.btn-pill:active {
  transform: translateY(2px);
  box-shadow: 0 0px 0px rgba(0, 0, 0, 0.1);
}

.btn-primary { background: var(--color-primary); color: white; }
.btn-secondary { background: var(--color-secondary); color: white; }
.btn-warning { background: var(--color-warning); color: white; }
.btn-accent { background: var(--color-accent); color: white; }
.btn-green { background: var(--color-success); color: white; }

/* Views Grid */
.view {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 20px 30px;
  overflow-y: auto;
  position: relative;
}
.view.active {
  display: flex;
}

/* Animations */
@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(3deg); }
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes jiggle {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-4deg) scale(1.02); }
  75% { transform: rotate(4deg) scale(1.02); }
  100% { transform: rotate(0deg) scale(1); }
}

.jelly-btn {
  border: none;
  background: white;
  border-radius: 24px;
  font-family: var(--font-family);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow-bubbly);
  border: 5px solid #FFF;
}
.jelly-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-bubbly-hover);
}
.jelly-btn:active {
  transform: translateY(4px) scale(0.98);
  box-shadow: var(--shadow-bubbly-active);
}

/* ========================================================
   1. SELECT CHARACTER VIEW
   ======================================================== */
.select-char-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--color-accent);
  margin-top: 15px;
  margin-bottom: 5px;
}
.select-char-subtitle {
  text-align: center;
  color: #747D8C;
  font-size: 16px;
  margin-bottom: 30px;
}

.companions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.companion-card {
  background: white;
  border: 5px solid #E5E9F0;
  border-radius: 32px;
  padding: 25px 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.companion-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-bubbly);
  border-color: var(--theme-color, #E5E9F0);
}

.companion-card.selected {
  border-color: var(--theme-color);
  background: linear-gradient(to bottom, #FFFFFF 50%, var(--bg-soft));
  box-shadow: var(--shadow-bubbly);
  transform: scale(1.04);
}
.companion-card.selected::before {
  content: '✓';
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--theme-color);
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.companion-avatar-big {
  font-size: 80px;
  margin-bottom: 12px;
  display: inline-block;
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0% { transform: scale(1); }
  50% { transform: scale(1.08) translateY(-4px); }
  100% { transform: scale(1); }
}

.companion-name {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 8px;
  color: #2F3542;
}
.companion-desc {
  font-size: 14px;
  color: #747D8C;
  line-height: 1.5;
  flex-grow: 1;
}

.start-btn-container {
  display: flex;
  justify-content: center;
  margin-top: 35px;
}
.btn-large {
  font-family: var(--font-display);
  font-size: 26px;
  padding: 14px 50px;
  border-radius: 40px;
}

/* ========================================================
   2. ISLAND MAP VIEW
   ======================================================== */
.map-layout {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.map-title {
  text-align: center;
  font-family: var(--font-display);
  color: #3B3B98;
  font-size: 30px;
  margin-bottom: 20px;
  position: relative;
  z-index: 5;
}

.map-canvas-container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
}

.islands-path {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  max-width: 900px;
  margin: auto;
  position: relative;
  z-index: 3;
}

.island-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
  width: 160px;
}

.island-avatar {
  width: 100px;
  height: 100px;
  background: white;
  border-radius: 50%;
  border: 6px solid #FFF;
  box-shadow: var(--shadow-bubbly);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.island-node:hover .island-avatar {
  transform: translateY(-8px) scale(1.08);
  box-shadow: var(--shadow-bubbly-hover);
}

.island-node.locked {
  cursor: not-allowed;
}
.island-node.locked .island-avatar {
  background: #E4E7EB;
  filter: grayscale(100%);
  border-color: #D2D7DF;
  box-shadow: 0 4px 0px rgba(0, 0, 0, 0.04);
}
.island-node.locked .lock-overlay {
  position: absolute;
  font-size: 26px;
  color: #57606F;
  background: rgba(255,255,255,0.9);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 28px;
  left: 58px;
  border: 3px solid #D2D7DF;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 4;
}

.island-node.active-node .island-avatar {
  border-color: var(--color-success);
  animation: gentlePulse 2s infinite alternate;
}

.island-stars {
  margin-top: 8px;
  font-size: 16px;
  color: #FFD254;
  height: 20px;
  display: flex;
  justify-content: center;
  gap: 2px;
}

.island-label {
  margin-top: 8px;
  font-weight: 700;
  font-size: 16px;
  color: #2F3542;
  background: white;
  padding: 4px 16px;
  border-radius: 20px;
  border: 2px solid #E5E9F0;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.island-node.locked .island-label {
  color: #747D8C;
  background: #F1F2F6;
}

/* Position tracking head marker */
.companion-marker {
  position: absolute;
  top: -32px;
  font-size: 34px;
  background: white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  border: 3.5px solid var(--color-warning);
  animation: bounceMarker 1s infinite alternate;
  z-index: 5;
}

@keyframes bounceMarker {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-8px) scale(1.05); }
}

@keyframes gentlePulse {
  0% { box-shadow: 0 8px 0px rgba(0, 0, 0, 0.1), 0 0 0 0px rgba(29, 209, 161, 0.4); }
  100% { box-shadow: 0 8px 0px rgba(0, 0, 0, 0.1), 0 0 0 12px rgba(29, 209, 161, 0); }
}

/* Level Top Advice Board */
.companion-panel {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #FFF9F3;
  border: 4px solid #FFEAA7;
  border-radius: 28px;
  padding: 12px 22px;
  margin-bottom: 20px;
  position: relative;
  box-shadow: var(--shadow-bubbly-hover);
}
.companion-panel-avatar {
  font-size: 44px;
  cursor: pointer;
  transition: transform 0.2s;
  animation: float 2.5s ease-in-out infinite alternate;
}
.companion-panel-avatar:hover {
  transform: scale(1.15) rotate(5deg);
}
.companion-panel-bubble {
  background: white;
  border: 3px solid #FFEAA7;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 16px;
  font-weight: 700;
  color: #5D4037;
  flex: 1;
  position: relative;
}
.companion-panel-bubble::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 15px;
  border-width: 8px 10px 8px 0;
  border-style: solid;
  border-color: transparent #FFEAA7 transparent transparent;
}
.companion-panel-bubble::after {
  content: '';
  position: absolute;
  left: -6px;
  top: 15px;
  border-width: 8px 10px 8px 0;
  border-style: solid;
  border-color: transparent white transparent transparent;
}

.audio-play-btn {
  background: var(--color-secondary);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 8px;
  box-shadow: 0 4px 0 #2980B9;
  vertical-align: middle;
  transition: all 0.1s;
  font-size: 16px;
}
.audio-play-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #2980B9;
}

/* ========================================================
   3. LEVEL 1: SOUND MAGIC FLIP CARDS
   ======================================================== */
.magic-cards-deck {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  flex: 1;
  align-items: center;
  justify-content: center;
  perspective: 1000px; /* Enable 3D transitions */
  min-height: 260px;
}

.magic-card-container {
  height: 240px;
  position: relative;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.magic-card-container.flipped {
  transform: rotateY(180deg);
}

.magic-card-front, .magic-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 28px;
  border: 5px solid #FFF;
  box-shadow: var(--shadow-bubbly);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Front side card face (Question mark card) */
.magic-card-front {
  background: linear-gradient(135deg, #FFEAA7 0%, #FEF9E7 100%);
  border-color: #F39C12;
}
.magic-card-front-shining {
  font-size: 72px;
  animation: breathe 2s infinite;
}

/* Back side card face (Visual recognition details) */
.magic-card-back {
  background: white;
  border-color: var(--color-success);
  transform: rotateY(180deg);
}
.magic-card-back.color-0 { border-color: #FF6B6B; background: #FFF5F5; }
.magic-card-back.color-1 { border-color: #48DBFB; background: #EBF5FB; }
.magic-card-back.color-2 { border-color: #1DD1A1; background: #E8F8F5; }
.magic-card-back.color-3 { border-color: #FF9F43; background: #FFF9F3; }

.magic-card-letter {
  font-family: var(--font-display);
  font-size: 38px;
  color: #2F3542;
  margin-top: 5px;
}
.magic-card-emoji {
  font-size: 64px;
  margin: 10px 0;
  animation: float 2.5s ease-in-out infinite alternate;
}
.magic-card-word {
  font-family: var(--font-display);
  font-size: 24px;
  color: #2C3E50;
}
.magic-card-trans {
  font-size: 14px;
  color: #7F8C8D;
  font-weight: 700;
}

.level1-btn-bar {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

/* ========================================================
   4. LEVEL 2: FIND ANIMAL FRIENDS (三选一)
   ======================================================== */
.find-friend-playground {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  flex: 1;
  min-height: 280px;
}

.find-friend-prompt {
  background: white;
  border: 4px solid #E5E9F0;
  border-radius: 30px;
  padding: 15px 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow-bubbly-hover);
  margin-bottom: 20px;
}
.find-friend-prompt-text {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--color-accent);
}

.find-friend-options-grid {
  display: flex;
  justify-content: center;
  gap: 30px;
  width: 100%;
}

.friend-face-card {
  width: 150px;
  height: 150px;
  background: white;
  border: 6px solid #E5E9F0;
  border-radius: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  cursor: pointer;
  box-shadow: var(--shadow-bubbly);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.friend-face-card:hover {
  transform: translateY(-8px) scale(1.04);
  border-color: var(--color-secondary);
}

.friend-face-card.success-jiggle {
  animation: jiggle 0.5s ease-in-out infinite;
  border-color: var(--color-success);
  background: #E8F8F5;
}

/* ========================================================
   5. LEVEL 3: LETTER BALLOON POP (防呆版气球碰碰消)
   ======================================================== */
.balloon-playground {
  flex: 1;
  background: linear-gradient(180deg, #EBF5FB 0%, #FFF 100%);
  border-radius: 30px;
  border: 4px solid #E5E9F0;
  position: relative;
  overflow: hidden;
  min-height: 260px;
}

.balloon-prompt {
  text-align: center;
  padding: 14px;
  background: white;
  border-bottom: 3.5px dashed #E5E9F0;
  font-size: 22px;
  font-weight: 700;
  color: #2F3542;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.target-letter-box {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--color-primary);
  background: #FFF5F5;
  border: 4px dashed var(--color-primary);
  padding: 0px 18px;
  border-radius: 14px;
  min-width: 70px;
  display: inline-block;
  vertical-align: middle;
}

.balloon {
  position: absolute;
  width: 90px;
  height: 110px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 38px;
  color: white;
  cursor: pointer;
  user-select: none;
  box-shadow: inset -8px -10px 0 rgba(0,0,0,0.12), 0 8px 18px rgba(0,0,0,0.06);
  bottom: -130px;
  transition: transform 0.1s;
}
.balloon:active {
  transform: scale(0.9);
}

.balloon::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 41px;
  width: 8px;
  height: 8px;
  border-left: 2px solid transparent;
  border-right: 2px solid transparent;
  border-bottom: 10px solid rgba(0,0,0,0.15);
}
.balloon-string {
  position: absolute;
  bottom: -36px;
  left: 44px;
  width: 2px;
  height: 28px;
  background: rgba(0,0,0,0.12);
}

/* Floating particles */
.particle {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
}

/* ========================================================
   6. STICKER NOTEBOOK PLAYROOM (免费快乐贴纸画板)
   ======================================================== */
.sticker-layout {
  display: grid;
  grid-template-columns: 2.2fr 1.1fr;
  gap: 20px;
  flex: 1;
  min-height: 340px;
}

.sticker-left {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sticker-canvas {
  flex: 1;
  background: linear-gradient(135deg, #E8F8F5 0%, #D4EFDF 100%);
  border-radius: 32px;
  border: 8px solid #FFF;
  box-shadow: var(--shadow-bubbly);
  position: relative;
  overflow: hidden;
  min-height: 260px;
}

.sticker-canvas.bg-meadow { background: linear-gradient(135deg, #E8F8F5 0%, #D4EFDF 100%); }
.sticker-canvas.bg-sky { background: linear-gradient(135deg, #EBF5FB 0%, #AED6F1 100%); }
.sticker-canvas.bg-candy { background: linear-gradient(135deg, #FDEDEC 0%, #FADBD8 100%); }

.placed-sticker {
  position: absolute;
  font-size: 54px; /* Giant stickers for babies */
  cursor: move;
  user-select: none;
  z-index: 10;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.placed-sticker:hover {
  outline: 3px dashed var(--color-secondary);
  border-radius: 12px;
}

.placed-sticker.selected::after {
  content: '✕';
  position: absolute;
  top: -12px;
  right: -12px;
  background: var(--color-primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sticker-theme-picker {
  display: flex;
  gap: 10px;
  align-items: center;
  background: white;
  border-radius: 50px;
  padding: 6px 18px;
  align-self: flex-start;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  border: 3px solid #F1F2F6;
}

.theme-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid #FFF;
  box-shadow: 0 0 0 2.5px #E5E9F0;
  transition: all 0.2s;
}
.theme-dot.active {
  box-shadow: 0 0 0 3px var(--color-accent);
}

/* Free Bag Inventory right panel */
.sticker-right {
  background: white;
  border-radius: 32px;
  border: 4px solid #F1F2F6;
  box-shadow: 0 10px 25px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.store-tabs {
  background: #F8F9FA;
  border-bottom: 3.5px dashed #E5E9F0;
  text-align: center;
  padding: 12px;
  font-weight: 700;
  font-size: 16px;
  color: var(--color-accent);
}

.store-content-panel {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.my-stickers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.my-sticker-item {
  background: #F8F9FA;
  border: 4px solid #FFF;
  border-radius: 20px;
  font-size: 34px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  position: relative;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  transition: transform 0.2s;
}
.my-sticker-item:hover {
  transform: scale(1.1);
  background: white;
  border-color: var(--color-secondary);
}
.my-sticker-item.locked {
  filter: grayscale(100%);
  opacity: 0.35;
  cursor: not-allowed;
}
.my-sticker-item.locked::after {
  content: '🔒';
  font-size: 12px;
  position: absolute;
  bottom: -2px;
  right: -2px;
}

/* ========================================================
   7. GRAND VICTORY CERTIFICATE & CELEBRATIONS
   ======================================================== */
.victory-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  position: relative;
}

.victory-title {
  font-family: var(--font-display);
  font-size: 42px;
  color: var(--color-warning);
  margin-top: 15px;
  animation: float 2.5s ease-in-out infinite alternate;
}

.victory-stars {
  font-size: 48px;
  color: #FFD254;
  margin: 10px 0;
  display: flex;
  gap: 10px;
}

.victory-badge {
  font-size: 120px;
  animation: popBadge 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popBadge {
  0% { transform: scale(0.2) rotate(-30deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.certificate-card {
  width: 100%;
  max-width: 600px;
  background: white;
  border: 14px double #FFD254;
  border-radius: 28px;
  padding: 30px 40px;
  margin: 20px 0;
  box-shadow: 0 15px 35px rgba(0,0,0,0.05);
}
.certificate-title {
  font-family: var(--font-display);
  font-size: 26px;
  color: #E67E22;
  margin-bottom: 12px;
  letter-spacing: 2px;
}
.certificate-name {
  font-family: var(--font-display);
  font-size: 34px;
  color: #2C3E50;
  border-bottom: 3.5px dashed #E5E9F0;
  display: inline-block;
  padding: 0 35px 5px 35px;
  margin-bottom: 12px;
}
.certificate-text {
  font-size: 16px;
  color: #57606F;
  line-height: 1.8;
  font-weight: 600;
}
.certificate-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 25px;
}
.cert-date { font-size: 14px; color: #95A5A6; }
.cert-seal { font-size: 40px; line-height: 1; }

.victory-actions {
  display: flex;
  gap: 20px;
}

/* Modals System (Simple mistakes book) */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(47, 53, 66, 0.45);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active {
  display: flex;
}

.modal-frame {
  width: 90%;
  max-width: 540px;
  background: white;
  border-radius: 36px;
  border: 6px solid #FFF;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  max-height: 80%;
  overflow: hidden;
  animation: bounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
  padding: 15px 25px;
  border-bottom: 3.5px dashed #E5E9F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--color-accent);
}
.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #A0AAB9;
}

.modal-body {
  padding: 20px 25px;
  overflow-y: auto;
  flex: 1;
}

.mistake-list-empty {
  text-align: center;
  padding: 30px;
  color: #95A5A6;
  font-size: 16px;
}
.mistake-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFF5F5;
  border: 2px solid #FEDBD0;
  border-radius: 20px;
  padding: 12px 18px;
  margin-bottom: 8px;
}
.mistake-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mistake-item-emoji { font-size: 28px; }
.mistake-item-word { font-family: var(--font-display); font-size: 20px; color: #2C3E50; }

#confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

/* ========================================================
   FOOTER BAR CONTROLS
   ======================================================== */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-top: 4px dashed #F1F2F6;
  z-index: 10;
}
.footer-left, .footer-right {
  display: flex;
  gap: 12px;
}

/* ========================================================
   MONSTER BATTLE STYLES
   ======================================================== */
.monster-battle-panel {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #FFF5F6;
  border: 4px solid #FFCCD2;
  border-radius: 28px;
  padding: 12px 25px;
  margin-bottom: 20px;
  position: relative;
  box-shadow: var(--shadow-bubbly-hover);
  animation: bounceIn 0.3s;
}

.monster-avatar-container {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.monster-avatar {
  font-size: 50px;
  display: inline-block;
  transition: transform 0.15s;
  animation: breathe 2s ease-in-out infinite;
}

.monster-avatar.hit-shake {
  animation: monsterHitShake 0.4s ease-out;
}

@keyframes monsterHitShake {
  0% { transform: scale(1.2) rotate(0deg); filter: sepia(100%) saturate(1000%) hue-rotate(-50deg); }
  20% { transform: scale(1.1) rotate(-8deg); }
  40% { transform: scale(1.1) rotate(8deg); }
  60% { transform: scale(1.1) rotate(-8deg); }
  80% { transform: scale(1.1) rotate(8deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.monster-damage-bubble {
  position: absolute;
  top: -15px;
  right: -15px;
  background: var(--color-primary);
  color: white;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
  border: 2px solid white;
  z-index: 100;
}

.monster-damage-bubble.pop-damage {
  animation: popDamageLabel 0.8s ease-out forwards;
}

@keyframes popDamageLabel {
  0% { opacity: 0; transform: translateY(10px) scale(0.6); }
  30% { opacity: 1; transform: translateY(-15px) scale(1.2); }
  80% { opacity: 1; transform: translateY(-20px) scale(1.0); }
  100% { opacity: 0; transform: translateY(-30px) scale(0.8); }
}

.monster-info-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.monster-label {
  font-weight: 700;
  font-size: 16px;
  color: #C0392B;
  display: flex;
  justify-content: space-between;
}

.monster-hp-track {
  width: 100%;
  height: 20px;
  background: #E5E9F0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #FFF;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.monster-hp-bar {
  height: 100%;
  background: linear-gradient(to right, #FF4D4D, #FF7575);
  border-radius: 8px;
  width: 100%;
  transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

/* ========================================================
   RESPONSIVE MOBILE ADAPTATION (手机端自动适配)
   ======================================================== */
@media (max-width: 768px) {
  body {
    padding: 0;
    align-items: stretch;
  }

  #game-container {
    height: 100vh;
    max-height: 100%;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  header {
    padding: 10px 15px;
  }
  .logo { font-size: 20px; }
  .logo-icon { font-size: 24px; }
  .stat-pill { padding: 4px 10px; font-size: 14px; }
  #btn-open-dashboard { padding: 6px 12px; font-size: 13px; }

  .view {
    padding: 12px 15px;
  }

  /* select companion screen */
  .select-char-title { font-size: 24px; margin-top: 5px; }
  .select-char-subtitle { font-size: 13px; margin-bottom: 15px; }
  .companions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 10px;
  }
  .companion-card {
    border-radius: 20px;
    padding: 15px 10px;
  }
  .companion-avatar-big { font-size: 54px; }
  .companion-name { font-size: 16px; }
  .companion-desc { font-size: 11px; }
  .btn-large { font-size: 20px; padding: 10px 30px; }

  /* Map Screen */
  .map-title { font-size: 22px; margin-bottom: 10px; }
  .islands-path {
    flex-direction: column;
    gap: 25px;
    padding: 20px 0;
    height: 90%;
    justify-content: space-around;
  }
  .island-node {
    width: 140px;
  }
  .island-avatar {
    width: 74px;
    height: 74px;
    font-size: 34px;
    border-width: 4px;
  }
  .island-node.locked .lock-overlay {
    top: 18px;
    left: 45px;
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  .island-stars { font-size: 12px; height: 14px; }
  .island-label { font-size: 13px; padding: 2px 10px; }
  .companion-marker {
    width: 36px;
    height: 36px;
    font-size: 24px;
    top: -24px;
  }

  /* Level view bubble */
  .companion-panel {
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 18px;
    gap: 8px;
  }
  .companion-panel-avatar { font-size: 32px; }
  .companion-panel-bubble { font-size: 13px; padding: 6px 12px; border-radius: 14px; }
  .companion-panel-bubble::before { top: 10px; }
  .companion-panel-bubble::after { top: 10px; }
  .audio-play-btn { width: 32px; height: 32px; font-size: 13px; box-shadow: 0 2px 0 #2980B9; }

  /* Monster Battle Panel */
  .monster-battle-panel {
    padding: 6px 12px;
    gap: 10px;
    margin-bottom: 10px;
    border-radius: 18px;
  }
  .monster-avatar { font-size: 32px; }
  .monster-avatar-container { width: 40px; height: 40px; }
  .monster-label { font-size: 12px; }
  .monster-hp-track { height: 12px; }

  /* Level 1: 3D magic flip card deck */
  .magic-cards-deck {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px 0;
  }
  .magic-card-container {
    height: 140px;
  }
  .magic-card-front-shining { font-size: 40px; }
  .magic-card-letter { font-size: 24px; }
  .magic-card-emoji { font-size: 44px; margin: 4px 0; }
  .magic-card-word { font-size: 16px; }
  .magic-card-trans { font-size: 11px; }

  /* Level 2: Three choices matching */
  .find-friend-prompt {
    padding: 8px 15px;
    margin-bottom: 15px;
    border-radius: 20px;
  }
  .find-friend-prompt-text { font-size: 18px; }
  .friend-face-card {
    width: 80px;
    height: 80px;
    font-size: 44px;
    border-width: 4px;
    border-radius: 20px;
  }
  .find-friend-options-grid {
    gap: 15px;
  }

  /* Level 3: Balloon Playground */
  .balloon-prompt { font-size: 16px; padding: 8px; }
  .target-letter-box { font-size: 24px; min-width: 50px; border-width: 2px; }
  .balloon {
    width: 64px;
    height: 80px;
    font-size: 28px;
  }
  .balloon::after { left: 28px; bottom: -8px; border-bottom-width: 8px; }
  .balloon-string { left: 31px; height: 20px; bottom: -28px; }

  /* Sticker drawing board layout */
  .sticker-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1.4fr 1fr;
    gap: 10px;
    height: 90%;
  }
  .sticker-canvas {
    min-height: 180px;
  }
  .placed-sticker {
    font-size: 38px;
  }
  .sticker-theme-picker {
    padding: 4px 12px;
  }
  .theme-dot {
    width: 20px;
    height: 20px;
  }
  .my-stickers-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .my-sticker-item {
    width: 50px;
    height: 50px;
    font-size: 28px;
  }
  .sticker-right {
    border-radius: 24px;
  }
  .store-tabs {
    padding: 8px;
    font-size: 14px;
  }

  /* Victory Certificate Screen */
  .victory-title { font-size: 24px; }
  .victory-badge { font-size: 70px; }
  .victory-stars { font-size: 28px; }
  .certificate-card {
    border-width: 8px;
    padding: 15px 20px;
    margin: 10px 0;
  }
  .certificate-title { font-size: 16px; }
  .certificate-name { font-size: 20px; }
  .certificate-text { font-size: 12px; line-height: 1.5; }
  .certificate-footer { margin-top: 15px; }
  .cert-seal { font-size: 28px; }

  /* Footer Controls */
  footer {
    padding: 10px 15px;
  }
  .btn-pill {
    padding: 6px 12px;
    font-size: 13px;
  }
}
