/* ── CSS Variables ── */
:root {
  --bg: #f0f8ff;
  --card: #fffdf5;
  --ink: #2a1f0e;
  --ink-light: #6b4f2a;
  --soft: #fff3d6;
  --primary: #ff8c00;
  --primary-dark: #e06400;
  --ok: #3dba6e;
  --radius-card: 28px;
  --radius-btn: 999px;
  --shadow-card: 0 8px 28px rgba(80, 100, 180, 0.10);
  --shadow-btn: 0 4px 16px rgba(255, 120, 0, 0.28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #d0eeff 0%, #e8f6e8 100%);
  min-height: 100vh;
}

.app {
  width: min(800px, 96vw);
  margin: 0 auto 64px;
  display: grid;
  gap: 16px;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  padding-bottom: env(safe-area-inset-bottom, 20px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ── Generic card ── */
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 22px 22px;
  box-shadow: var(--shadow-card);
}

h1, h2, h3, p { margin: 6px 0; }

/* ══════════════════════════════════════════
   LEARNING TOWN (Home View)
══════════════════════════════════════════ */
.town-scene {
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(180deg,
    #5bc4f5 0%,
    #90d8f8 28%,
    #c8edff 52%,
    #d4f0b8 68%,
    #7cbb5a 100%
  );
  box-shadow: 0 10px 36px rgba(60, 160, 220, 0.28);
}

/* Sun */
.town-sun {
  position: absolute;
  top: 14px;
  right: 20px;
  font-size: 38px;
  z-index: 1;
  animation: sunGlow 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sunGlow {
  0%, 100% { transform: scale(1) rotate(-5deg); filter: brightness(1); }
  50%       { transform: scale(1.1) rotate(5deg); filter: brightness(1.12); }
}

/* Clouds */
.town-cloud {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0.88;
}
.town-cloud-1 {
  font-size: 32px;
  top: 16px;
  left: 18px;
  animation: cloudDrift1 11s ease-in-out infinite;
}
.town-cloud-2 {
  font-size: 22px;
  top: 38px;
  left: 90px;
  opacity: 0.65;
  animation: cloudDrift2 16s ease-in-out infinite;
}

@keyframes cloudDrift1 {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(10px); }
}
@keyframes cloudDrift2 {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(-8px); }
}

/* Main content row: text left + character right */
.town-content {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 60px 22px 48px;
  position: relative;
  z-index: 2;
}

.town-text { flex: 1; min-width: 0; }

.town-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.90);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #1565c0;
  margin: 0 0 10px;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(0, 80, 200, 0.14);
}

h1.town-title {
  font-size: 32px;
  font-weight: 900;
  color: #0d2a50;
  margin: 0 0 4px;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.70);
}

.town-subtitle {
  font-size: 14px;
  font-weight: 700;
  color: #1a3f70;
  margin: 0;
  opacity: 0.90;
}

/* Lumi in home scene */
.town-character {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(180deg, #7dd8f8 0%, #b0e8fc 55%, #c8f0b8 100%);
  border-radius: 22px;
  padding: 10px 10px 0;
  overflow: hidden;
}

.town-lumi {
  height: 168px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  animation: lumiBounce 4s ease-in-out infinite;
}

@keyframes lumiBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* Ground strip */
.town-ground {
  background: linear-gradient(180deg, #66bb6a, #388e3c);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-size: 17px;
}

/* ── Learning Zones section ── */
.zones-section {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 20px 22px 22px;
  box-shadow: var(--shadow-card);
}

.zones-heading {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-light);
  margin: 0 0 14px;
}

.zones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.zone-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 6px 14px;
  border-radius: 20px;
  border: 2px solid transparent;
  font-family: inherit;
  text-align: center;
  cursor: default;
  user-select: none;
  position: relative;
  overflow: hidden;
}

/* Colored top band */
.zone-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 8px;
}

/* English — active */
.zone-english {
  background: linear-gradient(160deg, #fff8e8, #fff0c0);
  border-color: #ffe580;
  cursor: pointer;
  transition: transform 0.13s, box-shadow 0.13s;
  box-shadow: 0 4px 18px rgba(255, 165, 0, 0.22);
}
.zone-english::before {
  background: linear-gradient(90deg, #ffcc44, #ff9a1e);
}
.zone-english:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 165, 0, 0.30);
}
.zone-english:active {
  transform: scale(0.94);
  box-shadow: 0 2px 10px rgba(255, 140, 0, 0.28);
}

/* Chinese — coming soon */
.zone-chinese {
  background: #fdf5f5;
  border-color: #f0d0d0;
  opacity: 0.58;
}
.zone-chinese::before {
  background: linear-gradient(90deg, #ffaaaa, #ff7777);
}

/* Math — coming soon */
.zone-math {
  background: #f4f5fb;
  border-color: #d0d8f0;
  opacity: 0.58;
}
.zone-math::before {
  background: linear-gradient(90deg, #88aaff, #5577ee);
}

.zone-building { font-size: 20px; line-height: 1; }
.zone-flag     { font-size: 26px; line-height: 1; }

.zone-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}
.zone-soon .zone-name { color: #aaa; }

.zone-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}
.zone-tag-active { background: #d4f5e4; color: #1a7a45; }
.zone-tag-soon   { background: #efefef; color: #aaa; }

/* ══════════════════════════════════════════
   ENGLISH ADVENTURE ROOM
══════════════════════════════════════════ */

/* Adventure header */
.adventure-header {
  background: linear-gradient(135deg, #fffde0, #fff7c0);
  border: 2.5px solid #ffe77a;
  padding: 16px 20px;
}

.adventure-header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Lumi guide character */
.lumi-guide {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
  mix-blend-mode: multiply;
  animation: lumiFloat 3.5s ease-in-out infinite;
}

@keyframes lumiFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.adventure-header-text { flex: 1; min-width: 0; }

.adventure-title {
  font-size: 19px;
  font-weight: 900;
  color: var(--ink);
  margin: 0 0 2px;
}

.adventure-unit {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-light);
  margin: 0 0 8px;
}

/* Status pill */
.status-pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  color: #b06000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}
.status-pill.done {
  background: #e4fff2;
  color: #1a7a45;
}

/* ── Mission Cards ── */
.mission-card { padding: 18px 20px; }

.mission-today {
  background: linear-gradient(130deg, #fffbe0, #fff5c0);
  border: 2.5px solid #ffe580;
  border-left: 6px solid #ffcc44;
}

.mission-today.done-card {
  background: linear-gradient(130deg, #eafff4, #ccf5e2);
  border-color: #7ee8aa;
  border-left-color: #3dba6e;
}

.mission-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.mission-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(120deg, #ff9e30, #ff6200);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(255, 100, 0, 0.24);
  white-space: nowrap;
}

.mission-badge-green {
  background: linear-gradient(120deg, #3dba6e, #1a8a48);
  box-shadow: 0 2px 8px rgba(34, 168, 85, 0.24);
}

.mission-status {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-light);
  margin: 0;
}

/* ── Skeleton Dance card ── */
.mission-song {
  padding: 0;
  overflow: hidden;
  border: 2.5px solid #a8e4c0;
  background: linear-gradient(135deg, #eafff2, #d4f8e4);
}

.skeleton-card-inner {
  display: flex;
  align-items: stretch;
}

.skeleton-thumb {
  width: 112px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 0;
}

.skeleton-card-info {
  flex: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.skeleton-title {
  font-size: 17px;
  font-weight: 900;
  color: var(--ink);
  margin: 5px 0 0;
}

.skeleton-desc {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-light);
  margin: 0;
}

.skeleton-play-btn {
  align-self: flex-start;
  background: linear-gradient(125deg, #3dba6e, #1a8a48);
  color: #fff;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 999px;
  border: 0;
  box-shadow: 0 3px 10px rgba(34, 168, 85, 0.30);
  margin-top: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s, box-shadow 0.12s;
}
.skeleton-play-btn:hover  { box-shadow: 0 5px 16px rgba(34, 168, 85, 0.38); }
.skeleton-play-btn:active { transform: scale(0.95); }

/* ── Video Modal ── */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.80);
}

.video-modal-box {
  position: relative;
  z-index: 1;
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  width: min(92vw, 680px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.70);
}

.video-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.video-close-btn:hover { background: rgba(0, 0, 0, 0.90); }

.skeleton-video {
  display: block;
  width: 100%;
  max-height: 80vh;
}

/* ══════════════════════════════════════════
   HOME — Preview chips
══════════════════════════════════════════ */
.preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--soft);
  color: #7a4800;
  font-size: 14px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  border: 2px solid #ffe099;
}

/* Sticker tilts */
.preview-chip:nth-child(1) { background: #fff0d8; border-color: #ffcc66; color: #a05000; transform: rotate(-1.5deg); }
.preview-chip:nth-child(2) { background: #dff0ff; border-color: #88ccff; color: #1a5c99; transform: rotate( 1.5deg); }
.preview-chip:nth-child(3) { background: #dffff0; border-color: #80e8b0; color: #0e6640; transform: rotate(-1.2deg); }
.preview-chip:nth-child(4) { background: #f0e8ff; border-color: #c8aaff; color: #5a2d99; transform: rotate( 1.2deg); }

.start-main-btn {
  width: 100%;
  margin-top: 4px;
  padding: 18px;
  font-size: 20px;
  border-radius: var(--radius-btn);
}

/* ══════════════════════════════════════════
   HOME — Nav cards (review / history)
══════════════════════════════════════════ */
.home-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.home-nav-card {
  background: var(--card);
  border-radius: 24px;
  padding: 20px 14px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  border: 0;
  font-family: inherit;
  transition: transform 0.13s, box-shadow 0.13s;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Colored top band */
.home-nav-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
}

.home-nav-card.review-card {
  background: linear-gradient(150deg, #e8f4ff, #cce5ff);
  border: 2.5px solid #99ccff;
}
.home-nav-card.review-card::before {
  background: linear-gradient(90deg, #55c0ff, #1e88e0);
}

.home-nav-card.history-card {
  background: linear-gradient(150deg, #f2ebff, #e2d0ff);
  border: 2.5px solid #c8aaff;
}
.home-nav-card.history-card::before {
  background: linear-gradient(90deg, #c8aaff, #9b6dff);
}

.home-nav-card:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.home-nav-card:active { transform: scale(0.95); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10); }

.nav-card-emoji { font-size: 40px; line-height: 1; }

/* SVG icon circle for nav cards */
.nav-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-card-icon svg { width: 24px; height: 24px; }
.nav-card-icon-review {
  background: linear-gradient(145deg, #55c0ff, #1e88e0);
  color: #fff;
  box-shadow: 0 3px 10px rgba(30, 136, 224, 0.28);
}
.nav-card-icon-history {
  background: linear-gradient(145deg, #c8aaff, #9b6dff);
  color: #fff;
  box-shadow: 0 3px 10px rgba(155, 109, 255, 0.28);
}

.nav-card-label {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.nav-card-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-light);
}

.review-count-badge {
  display: inline-block;
  background: #ff8c00;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}

/* ══════════════════════════════════════════
   FLOW VIEW
══════════════════════════════════════════ */
.flow-nav-bar {
  display: flex;
  padding-top: 8px;
}

.back-btn {
  padding: 10px 20px;
  font-size: 15px;
  border-radius: 999px;
}

#flowSection {
  border-radius: var(--radius-card);
  padding: 22px 22px 26px;
  background: linear-gradient(170deg, #fff8e0 0%, #fff2c8 100%);
}

/* ── Step label ── */
.step-label {
  display: inline-block;
  padding: 5px 15px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 8px;
  background: var(--soft);
  color: #7a4800;
  border: 2px solid #ffe099;
}

.step-label.type-word  { background: #fff0d8; border-color: #ffcc66; color: #a05000; }
.step-label.type-speak { background: #dff0ff; border-color: #88ccff; color: #1a5c99; }
.step-label.type-story { background: #dffff0; border-color: #80e8b0; color: #0e6640; }

#flowSection h2,
#reviewFlowSection h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-light);
  margin: 2px 0 8px;
  opacity: 0.70;
}

/* ── Step image ── */
.step-image-wrap {
  display: block;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(160deg, #fef3e2 60%, #fde8c8);
  box-shadow: 0 8px 28px rgba(80, 80, 180, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 2px;
}

.step-image {
  display: block;
  width: 100%;
  height: 340px;
  object-fit: contain;
  background: linear-gradient(160deg, #fef3e2 60%, #fde8c8);
  border: 3px solid #ffcc66;
  border-radius: 24px;
  mix-blend-mode: multiply;
}

/* Step video (for story steps with video field) */
.step-video {
  display: block;
  width: 100%;
  border-radius: 24px;
  border: 3px solid #80e8b0;
  background: #111;
  max-height: 340px;
}

/* ── Step text ── */
.step-text {
  font-size: 32px;
  font-weight: 900;
  text-align: center;
  line-height: 1.45;
  margin: 10px 0 12px;
  letter-spacing: 0.01em;
  color: #bf5600;
  text-shadow: 0 2px 0 rgba(255, 180, 0, 0.16);
  white-space: pre-line;
}

/* ── Density modes — auto-compact when text is long ── */

/* compact: 4–6 estimated visual lines — image height unchanged, only text shrinks */
#flowSection.density-compact { padding: 14px 22px 18px; }
#flowSection.density-compact h2 { margin: 0 0 6px; }
#flowSection.density-compact .step-label { margin-bottom: 6px; }
#flowSection.density-compact .step-text {
  font-size: 22px;
  line-height: 1.32;
  margin: 5px 0 7px;
}

/* dense: 7+ estimated visual lines — image height unchanged, only text shrinks */
#flowSection.density-dense { padding: 10px 22px 14px; }
#flowSection.density-dense h2 { margin: 0 0 4px; font-size: 12px; }
#flowSection.density-dense .step-label { margin-bottom: 4px; padding: 3px 12px; font-size: 12px; }
#flowSection.density-dense .step-text {
  font-size: 17px;
  line-height: 1.27;
  margin: 3px 0 5px;
}

@media (max-width: 600px) {
  #flowSection.density-compact .step-text { font-size: 20px; }
  #flowSection.density-dense   .step-text { font-size: 16px; }
}

/* ── Add to Review button ── */
.review {
  width: 100%;
  margin-top: 6px;
  padding: 9px 13px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-btn);
  color: #7a4800;
  background: linear-gradient(130deg, #fff3c0, #ffe88a);
  box-shadow: 0 2px 8px rgba(200, 120, 0, 0.18);
  border: 1.5px solid #ffc44a;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.review:hover  { box-shadow: 0 4px 14px rgba(200, 120, 0, 0.28); }
.review:active { transform: scale(0.97); }

/* ── Review toast ── */
.review-toast {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #1a7a45;
  background: #d8ffed;
  border-radius: 999px;
  padding: 6px 18px;
  margin: 6px auto 0;
  width: fit-content;
  border: 1.5px solid #80e8aa;
}

/* ── Nav row ── */
.nav-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.nav-row #prevBtn,
.nav-row #reviewPrevBtn {
  flex: 0 0 auto;
  min-width: 110px;
}

.nav-row #nextBtn,
.nav-row #reviewNextBtn { flex: 1; }

#nextBtn, #reviewNextBtn {
  padding: 16px 18px;
  font-size: 18px;
  border-radius: var(--radius-btn);
}

/* ══════════════════════════════════════════
   BUTTONS (global)
══════════════════════════════════════════ */
.btn {
  border: 0;
  border-radius: var(--radius-btn);
  padding: 13px 20px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
}

.primary {
  color: #fff;
  background: linear-gradient(125deg, #ff9e30, #ff6200);
  box-shadow: var(--shadow-btn);
}
.primary:hover  { box-shadow: 0 6px 22px rgba(255, 100, 0, 0.36); }
.primary:active { transform: scale(0.95); opacity: 0.92; }

.secondary {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  border: 2px solid #e0e0e0;
}
.secondary:active { transform: scale(0.97); opacity: 0.88; }

/* ── Remember button (green) ── */
.remember {
  width: 100%;
  margin-top: 10px;
  padding: 15px;
  font-size: 18px;
  border-radius: var(--radius-btn);
  color: #fff;
  background: linear-gradient(125deg, #45d880, #22a855);
  box-shadow: 0 4px 16px rgba(34, 168, 85, 0.30);
  border: 0;
  transition: transform 0.12s, box-shadow 0.12s;
}
.remember:active { transform: scale(0.97); }

/* ══════════════════════════════════════════
   REVIEW LIBRARY VIEW
══════════════════════════════════════════ */
.view-header {
  padding: 16px 20px;
  background: linear-gradient(130deg, #fff9e0, #fff3c0);
  border: 2.5px solid #ffe580;
}

.view-header::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #ffcc44, #ff9a1e);
  border-radius: 999px;
  margin-bottom: 12px;
}

.view-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-header-row h2 {
  margin: 0;
  flex: 1;
  font-size: 19px;
  font-weight: 800;
}

.review-list {
  margin: 8px 0 14px;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.review-list li {
  display: flex;
  align-items: stretch;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  background: #fffbf3;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(200, 120, 0, 0.09);
  border: 1.5px solid #ffe8b0;
}

.review-stripe {
  width: 6px;
  min-width: 6px;
  flex-shrink: 0;
  background: #ffbb44;
}
.review-stripe.stripe-word  { background: #ff9a1e; }
.review-stripe.stripe-speak { background: #4da6ff; }
.review-stripe.stripe-story { background: #3dba6e; }

.review-item-body {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.review-type-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 9px;
  margin-bottom: 2px;
  width: fit-content;
}
.review-type-tag.tag-word  { background: #fff0d8; color: #a05000; }
.review-type-tag.tag-speak { background: #dff0ff; color: #1a5c99; }
.review-type-tag.tag-story { background: #dffff0; color: #0e6640; }

.review-item-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.review-delete-btn {
  flex-shrink: 0;
  align-self: center;
  border: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  margin-right: 8px;
  font-size: 15px;
  font-weight: 900;
  font-family: inherit;
  border-radius: 999px;
  color: #cc4400;
  background: #ffe8dc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s, background 0.12s;
}
.review-delete-btn:hover  { background: #ffd0c0; }
.review-delete-btn:active { transform: scale(0.88); }

.review-empty {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #bbb;
  padding: 24px 0;
  background: none !important;
  box-shadow: none !important;
  border: none !important;
  display: block;
}

#startReviewBtn {
  width: 100%;
  padding: 15px;
  font-size: 18px;
  border-radius: var(--radius-btn);
  background: linear-gradient(125deg, #55c0ff, #1e88e0);
  box-shadow: 0 4px 16px rgba(30, 136, 224, 0.26);
  color: #fff;
  border: 0;
}
#startReviewBtn:active { transform: scale(0.97); }

#reviewFlowSection {
  border-radius: var(--radius-card);
  padding: 22px 22px 26px;
  background: linear-gradient(170deg, #f0f8ff 0%, #e4f2ff 100%);
}

/* ══════════════════════════════════════════
   HISTORY VIEW
══════════════════════════════════════════ */
.history-list {
  margin: 8px 0 6px;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.history-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fffbf3;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 3px 12px rgba(200, 120, 0, 0.08);
  border: 1.5px solid #ffe8b0;
  font-size: 15px;
  font-weight: 700;
}

.history-date-badge {
  background: linear-gradient(120deg, #ff9e30, #ff6200);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(255, 100, 0, 0.22);
}

.history-unit-tag {
  font-size: 12px;
  font-weight: 700;
  color: #7a5020;
  background: #fff3d6;
  border: 1.5px solid #f5d080;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.history-reward { flex: 1; color: var(--ink); }

/* ══════════════════════════════════════════
   VIEW MANAGER
══════════════════════════════════════════ */
.view {
  display: grid;
  gap: 16px;
  padding-top: 12px;
}

.hidden { display: none !important; }

.done { color: #1a7a45; background: #e4fff2; }

/* ══════════════════════════════════════════
   STAR CELEBRATION OVERLAY
══════════════════════════════════════════ */
@keyframes starCelebrate {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-8deg); }
  20%  { opacity: 1; transform: translate(-50%, -60%) scale(1.65) rotate(6deg); }
  55%  { opacity: 1; transform: translate(-50%, -72%) scale(1.38) rotate(-3deg); }
  100% { opacity: 0; transform: translate(-50%, -90%) scale(1.1) rotate(0deg); }
}

.star-celebration {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
}

.star-celebration.celebrating {
  animation: starCelebrate 1.8s ease-out forwards;
}

.star-cel-emoji {
  display: block;
  font-size: 74px;
  line-height: 1;
  filter: drop-shadow(0 4px 14px rgba(255, 180, 0, 0.60));
}

.star-cel-text {
  display: block;
  font-size: 30px;
  font-weight: 900;
  color: #ff8800;
  text-shadow: 0 2px 12px rgba(255, 120, 0, 0.45);
  letter-spacing: 0.03em;
}

/* ══════════════════════════════════════════
   FLOATING STAR BADGE
══════════════════════════════════════════ */
.float-stars {
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 14px));
  right: max(14px, env(safe-area-inset-right, 14px));
  z-index: 1100;
  background: linear-gradient(180deg, #c080ff 0%, #8040d0 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.70),
    0 4px 0 #4a1890,
    0 6px 18px rgba(130, 40, 220, 0.45),
    inset 0 1.5px 0 rgba(220, 170, 255, 0.70);
  pointer-events: none;
  font-family: inherit;
  letter-spacing: 0.01em;
  user-select: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* ══════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════ */

/* View entrance */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.view > * {
  animation: fadeSlideUp 0.40s ease both;
}
.view > *:nth-child(1) { animation-delay: 0.00s; }
.view > *:nth-child(2) { animation-delay: 0.07s; }
.view > *:nth-child(3) { animation-delay: 0.12s; }
.view > *:nth-child(4) { animation-delay: 0.17s; }
.view > *:nth-child(5) { animation-delay: 0.21s; }

.view.hidden > * { animation: none; }

/* Step fade */
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-anim { animation: stepFadeIn 0.26s ease both; }

/* Star pulse */
@keyframes starPulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.28); }
  65%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.float-stars.star-pulse {
  animation: starPulse 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Completion glow */
@keyframes completionGlow {
  0%   { box-shadow: var(--shadow-card); }
  50%  { box-shadow: 0 0 0 4px #ffd700, 0 8px 32px rgba(255, 180, 0, 0.35); }
  100% { box-shadow: var(--shadow-card); }
}

.step-finish { animation: completionGlow 0.8s ease both; }

#flowSection.step-finish::before {
  content: "🎉  🌟  🎊";
  display: block;
  font-size: 30px;
  text-align: center;
  letter-spacing: 8px;
  margin-bottom: 10px;
  animation: fadeSlideUp 0.40s ease both;
}

/* Toast */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.review-toast:not(.hidden) { animation: toastIn 0.22s ease both; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ══════════════════════════════════════════
   MOBILE
══════════════════════════════════════════ */
@media (max-width: 600px) {
  h1.town-title   { font-size: 26px; }
  .town-content   { padding: 50px 18px 42px; }
  .town-lumi      { height: 130px; }

  .lumi-guide        { width: 64px; height: 64px; }
  .adventure-title   { font-size: 16px; }
  .adventure-unit    { font-size: 11px; }

  .skeleton-thumb    { width: 88px; }
  .skeleton-title    { font-size: 15px; }

  .step-image  { height: 240px; }
  .step-text   { font-size: 24px; }

  #nextBtn, #reviewNextBtn { font-size: 17px; padding: 14px; }
  .start-main-btn          { font-size: 18px; padding: 16px; }

  .nav-card-emoji { font-size: 32px; }
  .nav-card-label { font-size: 13px; }

  .float-stars {
    font-size: 14px;
    padding: 6px 12px;
    top: max(10px, env(safe-area-inset-top, 10px));
    right: max(10px, env(safe-area-inset-right, 10px));
  }

  .zones-grid { gap: 8px; }
  .zone-flag  { font-size: 22px; }
  .zone-name  { font-size: 12px; }
  .zone-building { font-size: 18px; }

  .tasks-grid { gap: 8px; }
  .task-card  { padding: 14px 6px 12px; }
  .task-icon-wrap { width: 40px; height: 40px; }
  .task-icon-wrap svg { width: 20px; height: 20px; }
  .task-label { font-size: 12px; }
  .task-sub   { font-size: 10px; }

  .areas-row  { gap: 8px; }
  .area-pill  { padding: 9px 10px; font-size: 13px; }
}

/* ══════════════════════════════════════════
   HOME — Today's Learning hero card
══════════════════════════════════════════ */
.today-hero {
  background: linear-gradient(130deg, #fffbe0 0%, #fff5c0 50%, #ffeebb 100%);
  border: 2.5px solid #ffe580;
  border-left: 6px solid #ffcc44;
  padding: 20px 22px;
}

.today-hero.done-card {
  background: linear-gradient(130deg, #eafff4, #ccf5e2);
  border-color: #7ee8aa;
  border-left-color: #3dba6e;
}

.today-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
  flex-wrap: wrap;
}

.today-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(120deg, #ff9e30, #ff6200);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 7px 16px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(255, 100, 0, 0.26);
  white-space: nowrap;
}

.today-hero-badge .icon-svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  flex-shrink: 0;
}

.today-unit-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-light);
  margin: 0 0 12px;
}

/* ══════════════════════════════════════════
   HOME — My Learning Tasks
══════════════════════════════════════════ */
.tasks-section { display: grid; gap: 12px; }

.section-heading {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-light);
  margin: 0;
}

.tasks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.task-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 8px 16px;
  border-radius: 22px;
  border: 2px solid transparent;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  background: #fffdf5;
  box-shadow: 0 4px 18px rgba(80, 100, 180, 0.10);
  transition: transform 0.13s, box-shadow 0.13s;
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
}

.task-card:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(80, 100, 180, 0.16); }
.task-card:active { transform: scale(0.94); box-shadow: 0 2px 8px rgba(80, 100, 180, 0.10); }

.task-checkin {
  background: linear-gradient(160deg, #fff8e8, #fff0c0);
  border-color: #ffe580;
}
.task-checkin::before { background: linear-gradient(90deg, #ffcc44, #ff9a1e); }

.task-review {
  background: linear-gradient(160deg, #e8f4ff, #cce5ff);
  border-color: #99ccff;
}
.task-review::before { background: linear-gradient(90deg, #55c0ff, #1e88e0); }

.task-history {
  background: linear-gradient(160deg, #f2ebff, #e2d0ff);
  border-color: #c8aaff;
}
.task-history::before { background: linear-gradient(90deg, #c8aaff, #9b6dff); }

.task-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.task-icon-wrap svg { width: 24px; height: 24px; }

.task-icon-checkin {
  background: linear-gradient(145deg, #ffd966, #ff9a1e);
  color: #fff;
  box-shadow: 0 3px 10px rgba(255, 154, 30, 0.35);
}
.task-icon-review {
  background: linear-gradient(145deg, #55c0ff, #1e88e0);
  color: #fff;
  box-shadow: 0 3px 10px rgba(30, 136, 224, 0.30);
}
.task-icon-history {
  background: linear-gradient(145deg, #c8aaff, #9b6dff);
  color: #fff;
  box-shadow: 0 3px 10px rgba(155, 109, 255, 0.30);
}

.task-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 5px;
}

.task-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-light);
}

/* ══════════════════════════════════════════
   HOME — Learning Areas (compact)
══════════════════════════════════════════ */
.areas-section { padding: 16px 20px; }

.areas-heading {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-light);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
}

.areas-row {
  display: flex;
  gap: 10px;
}

.area-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  border: 2px solid transparent;
  font-family: inherit;
  cursor: default;
  user-select: none;
  flex: 1;
}
.area-pill svg { width: 15px; height: 15px; flex-shrink: 0; }

.area-english {
  background: linear-gradient(130deg, #fff8e8, #fff0c0);
  border-color: #ffe580;
  color: #a05000;
  cursor: pointer;
  transition: transform 0.13s, box-shadow 0.13s;
  box-shadow: 0 3px 12px rgba(255, 165, 0, 0.18);
}
.area-english:hover  { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(255, 165, 0, 0.26); }
.area-english:active { transform: scale(0.95); }

.area-chinese { background: #fdf5f5; border-color: #f0d0d0; color: #c08080; }
.area-math    { background: #f4f5fb; border-color: #d0d8f0; color: #8090c0; }
.area-soon    { opacity: 0.62; }

/* ══════════════════════════════════════════
   FLOW — Conversation bubble card
══════════════════════════════════════════ */
.step-conv-card {
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, #e8f4ff, #d4eaff);
  border: 3px solid #88ccff;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  margin-bottom: 2px;
  box-shadow: 0 8px 28px rgba(80, 80, 180, 0.12);
}

.conv-scene {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.conv-lumi {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.14));
}

.conv-bubble {
  flex: 1;
  background: rgba(255, 250, 238, 0.95);
  border-radius: 20px 20px 20px 4px;
  padding: 14px 18px;
  box-shadow: 0 4px 16px rgba(0, 100, 200, 0.14);
  position: relative;
}

.conv-bubble::before {
  content: "";
  position: absolute;
  left: -11px;
  bottom: 18px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 13px solid #fff;
}

.conv-bubble-text {
  font-size: 20px;
  font-weight: 800;
  color: #1a3f70;
  margin: 0;
  line-height: 1.45;
  white-space: pre-line;
}

/* ══════════════════════════════════════════
   FLOW — SVG bone display
══════════════════════════════════════════ */
.svg-bone-display {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  background: linear-gradient(160deg, #fef3e2 60%, #fde8c8);
  border: 3px solid #ffcc66;
  border-radius: 24px;
  margin-bottom: 2px;
  box-shadow: 0 8px 28px rgba(80, 80, 180, 0.12);
}
.svg-bone-display svg {
  width: 75%;
  max-width: 300px;
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(180, 130, 60, 0.28));
}

/* ══════════════════════════════════════════
   ENGLISH VIEW — standalone Start button
══════════════════════════════════════════ */
#englishView > .start-main-btn {
  width: 100%;
  padding: 18px;
  font-size: 20px;
  border-radius: var(--radius-btn);
}

/* ══════════════════════════════════════════
   FINISH / CELEBRATION VIEW
══════════════════════════════════════════ */
.finish-card {
  padding: 0 0 28px;
  overflow: hidden;
  text-align: center;
}

.finish-confetti {
  display: none; /* removed — looked like a rendering artifact */
}

.finish-lumi-stage {
  background: radial-gradient(ellipse at 50% 90%, #fff6b0 0%, #ffd860 45%, #ffaa30 100%);
  padding: 20px 20px 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 220px;
}

.finish-lumi {
  height: 220px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 4px 12px rgba(180, 90, 0, 0.20));
  animation: lumiBounce 4s ease-in-out infinite;
}

.finish-header {
  padding: 20px 24px 8px;
}

.finish-title {
  font-size: 30px;
  font-weight: 900;
  color: #bf4000;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.finish-sub {
  font-size: 16px;
  font-weight: 700;
  color: #7a4400;
  margin: 0;
}

.finish-stars-row {
  display: flex;
  justify-content: center;
  padding: 14px 24px;
}

.finish-stars-badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(160deg, #ffe84a 0%, #ffc400 60%, #f5a800 100%);
  padding: 14px 32px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 3px 10px rgba(160, 100, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.60);
  animation: badgePulse 2.8s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 3px 10px rgba(160,100,0,0.22), inset 0 1px 0 rgba(255,255,255,0.60); }
  50%       { transform: scale(1.03); box-shadow: 0 5px 16px rgba(160,100,0,0.30), inset 0 1px 0 rgba(255,255,255,0.70); }
}

.finish-star-glyph { font-size: 36px; line-height: 1; }

.finish-stars-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #7a4800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.finish-stars-count {
  display: block;
  font-size: 44px;
  font-weight: 900;
  color: #4a2000;
  line-height: 1;
}

.finish-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 24px 0;
}

.finish-btn {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  border-radius: var(--radius-btn);
}

@media (max-width: 600px) {
  .finish-lumi-stage  { min-height: 180px; padding: 16px 16px 0; }
  .finish-lumi        { height: 180px; }
  .finish-header      { padding: 14px 20px 6px; }
  .finish-title       { font-size: 24px; }
  .finish-stars-count { font-size: 36px; }
  .finish-stars-badge { padding: 12px 24px; }
  .finish-actions     { padding: 8px 16px 0; }
}

/* ══════════════════════════════════════════
   ICON SYSTEM — PNG illustration icons
══════════════════════════════════════════ */

/* Task card PNG icons (inside colored circle wrap) */
.task-icon-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* Area pill PNG icons */
.area-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  mix-blend-mode: multiply;
}

/* Nav card (Review / History) PNG icons */
.nav-card-icon-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* Button inline icons */
.btn-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 2px;
  mix-blend-mode: multiply;
}

.btn-icon-right {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  margin-left: 2px;
  mix-blend-mode: multiply;
}

/* Finish page reward icon (replaces ⭐ glyph) */
img.finish-star-glyph {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 2px 6px rgba(255, 180, 0, 0.45));
}

/* ── Conversation card — compact when scene image is above ── */
.step-conv-card {
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, #e8f4ff, #d4eaff);
  border: 2.5px solid #88ccff;
  padding: 14px 18px;
  margin-top: 8px;
  margin-bottom: 2px;
  box-shadow: 0 6px 20px rgba(80, 80, 180, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Lumi inside conv bubble — blend white bg with blue gradient */
.conv-lumi {
  mix-blend-mode: multiply;
}

/* ── Lumi 3D fusion containers ── */

/* Home scene: sky-gradient container already handles multiply */
.town-character {
  background: linear-gradient(170deg, #6ed0f5 0%, #a8e4fc 50%, #c5f0b2 100%);
}

/* English adventure header: Lumi on warm yellow */
.adventure-header .lumi-guide {
  mix-blend-mode: multiply;
}

/* Finish stage: warm golden glow (override — see .finish-lumi-stage above) */


/* Override old min-height now that scene image sits above the bubble */
.step-conv-card { min-height: 0; }

/* ══════════════════════════════════════════════════════════
   AMANDA LEARNING TOWN — Portal Home View  v2
   Scene-depth redesign · pink anime · commercial kid-app
   Sky → horizon → grass · perspective depth · no flat cards
══════════════════════════════════════════════════════════ */

/* ── Portal container (full scene stage) ── */
.town-portal {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  /* Sky-to-ground: warm pink → lavender sky → blue sky → horizon green → grass */
  background: linear-gradient(176deg,
    #fce0f4  0%,
    #f2c8f8  8%,
    #c4dcff 28%,
    #a8d4f6 44%,
    #b8e8a8 60%,
    #7cc450 78%,
    #4eab28 100%
  );
  display: flex;
  flex-direction: column;
  min-height: 580px;
  box-shadow:
    0 20px 60px rgba(200, 60, 140, 0.24),
    0 4px 20px rgba(0, 0, 0, 0.12);
}

/* ── Sky FX layer (absolute, z:1, behind all scene content) ── */
.tp-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.tp-sun {
  position: absolute;
  top: 16px;
  right: 22px;
  font-size: 40px;
  animation: sunGlow 4s ease-in-out infinite;
  filter: drop-shadow(0 0 16px rgba(255, 220, 60, 0.70));
}
.tp-cloud {
  position: absolute;
  opacity: 0.88;
}
.tp-cloud svg {
  display: block;
  filter: drop-shadow(0 4px 10px rgba(200, 160, 240, 0.18));
}
.tp-cloud-1 { top: 18px; left: 14px;  width: 112px; animation: cloudDrift1 14s ease-in-out infinite; }
.tp-cloud-2 { top: 10px; right: 64px; width:  82px; animation: cloudDrift2 18s ease-in-out infinite; }
.tp-cloud-3 { top: 52px; left: 82px;  width:  62px; animation: cloudDrift1 22s ease-in-out infinite reverse; }

/* ── Title bar ── */
.tp-title-bar {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 20px 20px 0;
}
.tp-badge-pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 4px 16px;
  font-size: 11px;
  font-weight: 700;
  color: #b8317a;
  margin: 0 0 10px;
  box-shadow: 0 2px 10px rgba(200, 80, 140, 0.18);
  letter-spacing: 0.4px;
}
.tp-town-title {
  margin: 0;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
/* "Amanda" — big, white, bold with pink outline */
.tp-title-main {
  font-size: clamp(34px, 8vw, 58px);
  font-weight: 900;
  color: #fff;
  text-shadow:
    0 3px 0 #d03088,
    0 6px 20px rgba(180, 40, 100, 0.50),
    0 0 40px rgba(255, 190, 240, 0.55);
  letter-spacing: -1px;
  display: block;
  -webkit-text-stroke: 1.5px rgba(210, 80, 160, 0.30);
}
/* "✦ Learning Town ✦" — pill badge */
.tp-title-sub {
  font-size: clamp(13px, 2.8vw, 19px);
  font-weight: 800;
  display: inline-block;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 4px 20px 5px;
  color: #b030a0;
  letter-spacing: 1.2px;
  box-shadow: 0 2px 12px rgba(180, 60, 180, 0.22);
}

/* ── Main scene container ── */
.tp-scene {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 340px;
}

/* ── Far-background CSS hills (z:2) ── */
.tp-bg-hills {
  position: absolute;
  bottom: 84px;   /* sits on top of ground strip */
  left: 0;
  right: 0;
  height: 140px;
  z-index: 2;
  pointer-events: none;
}
.tp-hill {
  position: absolute;
  bottom: 0;
  border-radius: 50%;
}
.tp-hill-l {
  width: clamp(200px, 35vw, 280px);
  height: clamp(100px, 18vw, 140px);
  left: -40px;
  background: linear-gradient(180deg, #a8d868 0%, #74b038 100%);
  opacity: 0.52;
}
.tp-hill-c {
  width: clamp(240px, 42vw, 340px);
  height: clamp(70px, 12vw, 100px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #b4dca0 0%, #84c060 100%);
  opacity: 0.36;
}
.tp-hill-r {
  width: clamp(180px, 32vw, 260px);
  height: clamp(90px, 16vw, 120px);
  right: -30px;
  background: linear-gradient(180deg, #a8d868 0%, #74b038 100%);
  opacity: 0.52;
}

/* ── Balloon decoration (absolute top-right, z:4) ── */
.tp-balloons {
  position: absolute;
  top: 14px;
  right: 12px;
  width: clamp(58px, 9vw, 88px);
  z-index: 4;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12));
  animation: balloonFloat 5.5s ease-in-out infinite;
  pointer-events: none;
}

/* ── Signpost (absolute left mid-scene, z:6) ── */
.tp-signpost {
  position: absolute;
  left: 10px;
  bottom: 100px;
  width: clamp(52px, 8.5vw, 78px);
  z-index: 6;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.18));
  pointer-events: none;
}

/* ═══════════════════════════════════════════════
   HOUSE WRAPPERS — all absolute-positioned in scene
   English: front-center (large, z:8)
   Chinese: left-rear (small/high, z:5)
   Math:    right-rear (small/high, z:5)
═══════════════════════════════════════════════ */
.tp-house-wrap {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}
button.tp-house-wrap {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}
button.tp-house-wrap:hover .tp-house-img,
button.tp-house-wrap:focus-visible .tp-house-img {
  filter:
    drop-shadow(0 0 22px rgba(255, 180, 80, 0.65))
    drop-shadow(0 10px 28px rgba(255, 130, 0, 0.42));
}
button.tp-house-wrap:active {
  transform: scale(0.93) translateY(4px);
}

/* English House — FRONT CENTER, LARGE */
.tp-en {
  bottom: 60px;        /* nameplate base above grass */
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  width: clamp(170px, 27vw, 255px);
}
/* Chinese House — LEFT REAR, SMALL (higher y = further back) */
.tp-zh {
  bottom: 118px;
  left: 4%;
  z-index: 5;
  width: clamp(88px, 14vw, 130px);
}
/* Math House — RIGHT REAR, SMALL */
.tp-mt {
  bottom: 118px;
  right: 4%;
  z-index: 5;
  width: clamp(88px, 14vw, 130px);
}

/* House body container */
.tp-house-body {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* House images — multiply removes white backgrounds */
.tp-house-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
}
/* English house: warm drop shadow to make it pop */
.tp-en .tp-house-img {
  filter:
    drop-shadow(0 14px 32px rgba(180, 60, 40, 0.26))
    drop-shadow(0 4px 12px rgba(0,0,0,0.18));
}
/* Far houses: atmospheric haze — darker, desaturated, "distant" */
.tp-zh .tp-house-img,
.tp-mt .tp-house-img {
  filter:
    drop-shadow(0 4px 10px rgba(0,0,0,0.14))
    brightness(0.86)
    saturate(0.72);
  opacity: 0.82;
}

/* Oval ground shadow (each house gets one) */
.tp-shadow-oval {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 62%;
  height: 12px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.22) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
/* English house gets a larger, softer shadow */
.tp-shadow-lg {
  width: 78%;
  height: 18px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.26) 0%, transparent 70%);
}

/* English house warm glow ring (shows it's active/clickable) */
.tp-en-glow {
  position: absolute;
  inset: -10px;
  border-radius: 38%;
  background: radial-gradient(ellipse at 50% 85%,
    rgba(255, 200, 80, 0.20) 0%, transparent 68%);
  z-index: -1;
  animation: enGlow 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes enGlow {
  0%, 100% { opacity: 0.55; transform: scale(1);    }
  50%       { opacity: 1.0;  transform: scale(1.08); }
}

/* Name plate below each house */
.tp-nameplate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
}
.tp-house-name {
  font-size: clamp(12px, 2vw, 16px);
  font-weight: 900;
  color: #fff;
  text-shadow:
    0 1px 6px rgba(120, 30, 80, 0.60),
    0 2px 12px rgba(0,0,0,0.22);
  letter-spacing: 0.3px;
}
.tp-nameplate-en .tp-house-name {
  font-size: clamp(15px, 2.4vw, 20px);
}
.tp-status {
  font-size: 10px;
  padding: 2px 10px;
}
.tp-soon-tag {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.88);
  background: rgba(0,0,0,0.22);
  border-radius: 999px;
  padding: 2px 10px;
  letter-spacing: 0.3px;
}

/* Coming-soon: no interaction, atmospheric dimming already in image filter */
.tp-soon {
  pointer-events: none;
  cursor: default;
}

/* ── Lumi (left of English house, scene foreground, z:9) ── */
.tp-lumi {
  position: absolute;
  bottom: 72px;
  /* "right: calc(50% + Xpx)" places element to the LEFT of center */
  right: calc(50% + 38px);
  z-index: 9;
  width: clamp(72px, 11.5vw, 112px);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.tp-lumi-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 6px 18px rgba(200, 80, 160, 0.32));
  animation: lumiFloat 3.4s ease-in-out infinite;
}
.tp-lumi-shadow {
  width: 58%;
  height: 8px;
  background: radial-gradient(ellipse, rgba(150, 50, 130, 0.24) 0%, transparent 70%);
  border-radius: 50%;
  animation: lumiFloat 3.4s ease-in-out infinite reverse;
}

/* ── Ground plane (path + grass, z:3) ── */
.tp-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 86px;
  z-index: 3;
  pointer-events: none;
}
.tp-path-strip {
  height: 26px;
  /* Cobblestone pattern via repeating-linear-gradient */
  background:
    repeating-linear-gradient(90deg,
      rgba(215, 198, 162, 0.90) 0px,  rgba(215, 198, 162, 0.90) 36px,
      rgba(188, 172, 132, 0.85) 36px, rgba(188, 172, 132, 0.85) 40px
    ),
    linear-gradient(180deg, #e8d898 0%, #c8b870 100%);
  box-shadow:
    inset 0 4px 0 rgba(255,255,255,0.32),
    0 -3px 0 rgba(140,110,30,0.24);
}
.tp-grass-strip {
  background: linear-gradient(180deg, #6abc3c 0%, #4c9c24 100%);
  padding: 6px 0 8px;
  text-align: center;
  font-size: 15px;
  letter-spacing: 4px;
  line-height: 1;
}

/* ── Hamsters (foreground path, z:11) ── */
.tp-hamster {
  position: absolute;
  bottom: 28px;
  z-index: 11;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.18));
}
.tp-hamster-w {
  left: 10%;
  width: clamp(48px, 8vw, 68px);
  animation: hamsterBobW 1.9s ease-in-out infinite;
}
.tp-hamster-b {
  right: 10%;
  width: clamp(48px, 8vw, 68px);
  transform: scaleX(-1);
  animation: hamsterBobB 2.3s ease-in-out infinite;
}

/* ── Animations ── */
@keyframes hamsterBobW {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%       { transform: translateY(-8px) rotate(3deg); }
}
@keyframes hamsterBobB {
  0%, 100% { transform: scaleX(-1) translateY(0) rotate(-3deg); }
  50%       { transform: scaleX(-1) translateY(-9px) rotate(3deg); }
}
@keyframes balloonFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%       { transform: translateY(-16px) rotate(4deg); }
}

/* ── CTA button ── */
.tp-cta {
  position: relative;
  z-index: 12;
  display: flex;
  justify-content: center;
  padding: 16px 20px 26px;
}
.tp-go-btn {
  min-width: 220px;
  font-size: 17px;
  font-weight: 800;
  padding: 14px 36px;
  background: linear-gradient(180deg, #ff9de8 0%, #e0189a 100%);
  border: none;
  border-bottom: 4px solid rgba(140, 0, 80, 0.30);
  border-radius: 999px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.22);
  box-shadow:
    0 8px 28px rgba(220, 30, 150, 0.44),
    inset 0 2px 0 rgba(255,255,255,0.22);
  cursor: pointer;
  transition: transform 0.10s ease, box-shadow 0.10s ease, border-bottom-width 0.10s ease;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.2px;
}
.tp-go-btn:hover {
  box-shadow:
    0 10px 36px rgba(220, 30, 150, 0.54),
    inset 0 2px 0 rgba(255,255,255,0.24);
  transform: translateY(-1px);
}
.tp-go-btn:active {
  transform: translateY(3px);
  border-bottom-width: 1px;
  box-shadow:
    0 4px 14px rgba(220, 30, 150, 0.34),
    inset 0 2px 0 rgba(255,255,255,0.16);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Learning Town Portal
   Desktop (>1024): full scene, wide house spread
   Tablet portrait (768–1024): same scene, tighter
   Mobile (<600): scene compressed, houses scaled down
   Mobile small (<400): extra-small adjustments
══════════════════════════════════════════════════════════ */

/* ── Large desktop (>1280px): spread houses further ── */
@media (min-width: 1280px) {
  .tp-zh { left: 6%; }
  .tp-mt { right: 6%; }
}

/* ── Tablet portrait (768–1024px) ── */
@media (max-width: 1024px) {
  .tp-zh { left: 3%; }
  .tp-mt { right: 3%; }
  .tp-lumi {
    right: calc(50% + 34px);
    width: clamp(68px, 11vw, 100px);
  }
}

/* ── Mobile portrait (<600px) ── */
@media (max-width: 600px) {
  .town-portal {
    border-radius: 20px;
    min-height: 480px;
  }
  .tp-title-bar { padding: 14px 16px 0; }
  .tp-scene     { min-height: 280px; }

  /* English house: smaller */
  .tp-en {
    bottom: 56px;
    width: clamp(128px, 38vw, 170px);
  }
  /* Side houses: smaller, higher in scene */
  .tp-zh {
    left: 1%;
    bottom: 104px;
    width: clamp(70px, 19vw, 96px);
  }
  .tp-mt {
    right: 1%;
    bottom: 104px;
    width: clamp(70px, 19vw, 96px);
  }
  /* Lumi: smaller */
  .tp-lumi {
    right: calc(50% + 22px);
    width: 62px;
    bottom: 62px;
  }
  /* Hamsters: smaller */
  .tp-hamster   { bottom: 24px; }
  .tp-hamster-w,
  .tp-hamster-b { width: 42px; }
  /* Ground thinner */
  .tp-ground        { height: 72px; }
  .tp-path-strip    { height: 20px; }
  .tp-grass-strip   { padding: 4px 0 6px; font-size: 13px; }
  /* Hills */
  .tp-bg-hills      { bottom: 72px; height: 100px; }
  /* Signpost */
  .tp-signpost      { width: 42px; bottom: 84px; left: 6px; }
  /* Balloons */
  .tp-balloons      { width: 52px; top: 10px; right: 8px; }
  /* CTA button */
  .tp-go-btn        { min-width: 180px; font-size: 15px; padding: 12px 28px; }
}

/* ── Very small mobile (<400px) ── */
@media (max-width: 400px) {
  .tp-en  { width: 116px; bottom: 52px; }
  .tp-zh  { width: 62px;  bottom: 98px; }
  .tp-mt  { width: 62px;  bottom: 98px; }
  .tp-lumi {
    width: 54px;
    bottom: 58px;
    right: calc(50% + 17px);
  }
  .tp-hamster-w,
  .tp-hamster-b { width: 36px; }
}

/* ======================================================================
   LEARNING TOWN v9 — Amanda UI Kit v1 · TOP NAV BAR BUTTON SYSTEM
   Desktop/landscape  → learning-town-desktop.png  (1672 × 941)
   Portrait           → learning-town-mobile.png   (941 × 1672)
====================================================================== */

#homeView {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  padding: 0;
}

.tbp-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('/public/assets/town/backgrounds/learning-town-desktop.png');
  background-size: cover;
  background-position: center;
  filter: blur(32px) brightness(0.62) saturate(1.5);
  transform: scale(1.12);
  pointer-events: none;
  will-change: transform;
}
@media (orientation: portrait) {
  .tbp-backdrop {
    background-image: url('/public/assets/town/backgrounds/learning-town-mobile.png');
    background-position: center top;
  }
}

.town-bg-portal {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  overflow: visible;
  border-radius: 20px;
  box-shadow:
    0 0 0 1.5px rgba(255,255,255,0.18),
    0 16px 48px rgba(0,0,0,0.40),
    0 4px 16px rgba(100,20,180,0.25);
  aspect-ratio: 1672 / 941;
  width: min(98vw, calc(99svh * 1672 / 941));
  height: auto;
  background-image: url('/public/assets/town/backgrounds/learning-town-desktop.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}
@media (orientation: portrait) {
  .town-bg-portal {
    aspect-ratio: 941 / 1672;
    width: min(96vw, calc(100svh * 941 / 1672));
    background-image: url('/public/assets/town/backgrounds/learning-town-mobile.png');
    background-position: center top;
  }
}

/* ======================================================================
   TOP NAV BAR — 3 subject pill buttons at stage top
   Amanda UI Kit v1 style: two-section pill (icon | label+sub)
   3-layer shadow: white stroke | floor solid | outer glow + inset
   Coming Soon = 2nd line of text in locked buttons (no floating badge)
====================================================================== */

/* Nav bar container */
.tbp-nav-bar {
  position: absolute;
  top: 4%;
  left: 0;
  right: 0;
  z-index: 9;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  pointer-events: none;
}

/* Base pill button */
.tbp-nav-btn {
  pointer-events: all;
  position: relative;
  display: inline-flex;
  align-items: stretch;
  height: 54px;
  padding: 0;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  font-family: inherit;
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.80),
    0 6px 0 rgba(0,0,0,0.22),
    0 10px 26px rgba(0,0,0,0.25);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

/* Glossy dome highlight */
.tbp-nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.48) 0%,
    rgba(255,255,255,0.10) 46%,
    transparent 47%);
  pointer-events: none;
  z-index: 4;
}

.tbp-nav-btn:focus-visible {
  outline: 3px solid rgba(255,255,255,0.85);
  outline-offset: 3px;
}

/* Icon section (left darker strip) */
.tbp-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  font-size: 20px;
  line-height: 1;
  background: rgba(0,0,0,0.18);
  border-right: 1.5px solid rgba(255,255,255,0.22);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* Text section (right main color; flex-col for 2-line) */
.tbp-nav-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  padding: 0 22px 0 14px;
  position: relative;
  z-index: 1;
}

.tbp-nav-label {
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.40);
  letter-spacing: 0.3px;
}

.tbp-nav-sub {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.90);
  line-height: 1;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

/* English (Primary / Active) */
.tbp-nav-en {
  background: linear-gradient(180deg, #ffb84d 0%, #e0720e 100%);
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.85),
    0 7px 0 #9a4200,
    0 12px 30px rgba(255,130,0,0.55),
    inset 0 2px 0 rgba(255,235,130,0.75);
  animation: enBtnGlow 2.8s ease-in-out infinite;
}
.tbp-nav-en .tbp-nav-icon {
  width: 54px;
  font-size: 22px;
}
.tbp-nav-en .tbp-nav-label { font-size: 18px; }
.tbp-nav-en .tbp-nav-text  { padding: 0 24px 0 16px; }

.tbp-nav-btn.tbp-nav-en:active {
  animation: none;
  transform: translateY(6px);
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.65),
    0 1px 0 #9a4200,
    0 4px 12px rgba(255,130,0,0.30),
    inset 0 2px 0 rgba(255,235,130,0.55);
}
@keyframes enBtnGlow {
  0%,100% {
    box-shadow:
      0 0 0 3px rgba(255,255,255,0.85),
      0 7px 0 #9a4200,
      0 12px 30px rgba(255,130,0,0.50),
      inset 0 2px 0 rgba(255,235,130,0.75);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(255,255,255,1.00),
      0 7px 0 #9a4200,
      0 22px 48px rgba(255,165,20,0.75),
      inset 0 2px 0 rgba(255,248,170,0.95);
  }
}

/* Chinese (Secondary / Coming Soon) */
.tbp-nav-zh {
  background: linear-gradient(180deg, #ff9ecf 0%, #d44d96 100%);
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.80),
    0 6px 0 #882260,
    0 10px 24px rgba(200,50,130,0.45),
    inset 0 2px 0 rgba(255,215,240,0.70);
  opacity: 0.90;
}
.tbp-nav-zh:active {
  transform: translateY(5px);
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.60),
    0 1px 0 #882260,
    0 3px 8px rgba(200,50,130,0.25),
    inset 0 2px 0 rgba(255,215,240,0.50);
  opacity: 0.78;
}

/* Math (Secondary / Coming Soon) */
.tbp-nav-mt {
  background: linear-gradient(180deg, #90c4ff 0%, #4070e0 100%);
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.80),
    0 6px 0 #1c3cb0,
    0 10px 24px rgba(50,90,230,0.45),
    inset 0 2px 0 rgba(200,230,255,0.70);
  opacity: 0.90;
}
.tbp-nav-mt:active {
  transform: translateY(5px);
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.60),
    0 1px 0 #1c3cb0,
    0 3px 8px rgba(50,90,230,0.25),
    inset 0 2px 0 rgba(200,230,255,0.50);
  opacity: 0.78;
}

/* All portrait — only adjust nav bar vertical position */
@media (orientation: portrait) {
  .tbp-nav-bar { top: 5%; }
}

/* Small landscape phones ≤ 430px — gentle size reduction (landscape only effect) */
@media (max-width: 430px) and (orientation: landscape) {
  .tbp-nav-bar   { gap: 5px; padding: 0 6px; }
  .tbp-nav-btn   { height: 44px; }
  .tbp-nav-icon  { width: 36px; font-size: 15px; }
  .tbp-nav-text  { padding: 0 13px 0 9px; gap: 1px; }
  .tbp-nav-label { font-size: 12px; }
  .tbp-nav-sub   { font-size: 8px; }
  .tbp-nav-en    { height: 48px; }
  .tbp-nav-en .tbp-nav-icon  { width: 40px; font-size: 17px; }
  .tbp-nav-en .tbp-nav-label { font-size: 14px; }
  .tbp-nav-en .tbp-nav-text  { padding: 0 15px 0 11px; }
}

/* Portrait phone compact nav — flex fill + corner badge clearance */
@media (max-width: 600px) and (orientation: portrait) {
  .tbp-nav-bar {
    gap: 4px;
    padding: 0 54px;
  }
  /* Buttons fill bar equally by default; English gets more weight below */
  .tbp-nav-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 46px;
  }
  /* Icon: compact, no shrink */
  .tbp-nav-icon {
    width: 20px;
    font-size: 12px;
    flex-shrink: 0;
  }
  /* Text area fills remaining button width */
  .tbp-nav-text {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    padding: 0 6px 0 4px;
  }
  /* Label: single line, clip at text area edge */
  .tbp-nav-label {
    font-size: clamp(11px, 3.2vw, 13px);
    white-space: nowrap;
    overflow: hidden;
    width: 100%;
  }
  .tbp-nav-sub { display: none; }
  /* English: 1.5× flex weight to fit "English ▶" without clipping */
  .tbp-nav-en {
    flex: 1.5 1.5 0;
    height: 50px;
  }
  .tbp-nav-en .tbp-nav-icon {
    width: 26px;
    font-size: 15px;
  }
  .tbp-nav-en .tbp-nav-label {
    font-size: clamp(12px, 3.8vw, 15px);
  }
  .tbp-nav-en .tbp-nav-text {
    padding: 0 8px 0 5px;
  }
}

/* Large desktop ≥ 1200px landscape */
@media (min-width: 1200px) and (orientation: landscape) {
  .tbp-nav-bar   { gap: 14px; }
  .tbp-nav-btn   { height: 60px; }
  .tbp-nav-icon  { width: 56px; font-size: 24px; }
  .tbp-nav-text  { padding: 0 26px 0 18px; gap: 3px; }
  .tbp-nav-label { font-size: 18px; }
  .tbp-nav-sub   { font-size: 11px; }
  .tbp-nav-en    { height: 66px; }
  .tbp-nav-en .tbp-nav-icon  { width: 62px; font-size: 26px; }
  .tbp-nav-en .tbp-nav-label { font-size: 22px; }
  .tbp-nav-en .tbp-nav-text  { padding: 0 30px 0 20px; }
}

/* Settings circular button (pink, gear) — fixed corner badge, mirrors .float-stars */
.tbp-settings-btn {
  position: fixed;
  top: max(10px, calc(env(safe-area-inset-top, 0px) + 8px));
  left: max(10px, calc(env(safe-area-inset-left, 0px) + 8px));
  z-index: 1100;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff9ecf 0%, #e040a0 100%);
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.75),
    0 0 0 6px rgba(255,168,212,0.30),
    0 0 12px 8px rgba(255,200,235,0.20),
    0 4px 0 #8c1860,
    0 6px 16px rgba(200,40,130,0.40),
    inset 0 1.5px 0 rgba(255,220,245,0.80);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  user-select: none;
  -webkit-user-select: none;
}
.tbp-settings-btn:active {
  transform: translateY(3px) rotate(30deg);
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.60),
    0 1px 0 #8c1860,
    0 2px 8px rgba(200,40,130,0.25),
    inset 0 1.5px 0 rgba(255,220,245,0.60);
}
.tbp-settings-btn:focus-visible {
  outline: 2px solid rgba(255,255,255,0.80);
  outline-offset: 2px;
}
/* SVG icon sizing helpers */
.tbp-settings-icon {
  display: block;
  flex-shrink: 0;
}
.tbp-book-icon {
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.18));
}

/* Coming Soon toast (center fade-in overlay) */
.tbp-cs-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 20;
  transform: translate(-50%, -50%) scale(0.82);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 999px;
  padding: 12px 32px;
  font-size: 18px;
  font-weight: 900;
  color: #b030a0;
  box-shadow: 0 8px 32px rgba(180,60,180,0.34), 0 2px 8px rgba(0,0,0,0.12);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.tbp-cs-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ════════════════════════════════════════════════════════════════
   ENGLISH PAGE v2 — Module Button Grid
   4 entries: Today's Check-In (primary) + Review / History / Watch & Listen
════════════════════════════════════════════════════════════════ */

.eng-mods {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 2px;
}

.eng-mods-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

/* ── Base module button ────────────────────────────────────── */
.eng-mod-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 22px;
  cursor: pointer;
  font-family: inherit;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.09s ease, box-shadow 0.09s ease;
  text-align: center;
}

/* Glossy dome overlay */
.eng-mod-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.44) 0%,
    rgba(255,255,255,0.10) 44%,
    transparent 45%
  );
  pointer-events: none;
  z-index: 3;
}

/* ── Watch & Listen wrapper (visibility controlled by JS) ──── */
.eng-mod-wrap {
  flex: 1;
  display: flex;
}
.eng-mod-wrap > .eng-mod-btn {
  flex: 1;
}
/* .hidden { display:none !important } already in global styles */

/* ── Today's Check-In — primary, full width ──────────────── */
.eng-mod-checkin {
  width: 100%;
  flex-direction: row;
  gap: 18px;
  padding: 14px 22px;
  min-height: 92px;
  background: linear-gradient(180deg, #ff9ecf 0%, #e03d86 100%);
  border: 3px solid #b02060;
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.82),
    0 7px 0 #7a1245,
    0 10px 30px rgba(220,60,140,0.52),
    inset 0 2px 0 rgba(255,230,245,0.72);
}
.eng-mod-checkin:active {
  transform: translateY(4px);
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.68),
    0 2px 0 #7a1245,
    0 4px 14px rgba(220,60,140,0.32),
    inset 0 2px 0 rgba(255,230,245,0.52);
}

/* ── Review — orange ─────────────────────────────────────── */
.eng-mod-review {
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding: 14px 8px 12px;
  min-height: 128px;
  background: linear-gradient(180deg, #ffb84d 0%, #e07020 100%);
  border: 3px solid #a04c10;
  box-shadow:
    0 0 0 2.5px rgba(255,255,255,0.82),
    0 6px 0 #783610,
    0 9px 24px rgba(220,100,30,0.50),
    inset 0 2px 0 rgba(255,230,150,0.72);
}
.eng-mod-review:active {
  transform: translateY(4px);
  box-shadow:
    0 0 0 2.5px rgba(255,255,255,0.65),
    0 2px 0 #783610,
    0 3px 10px rgba(220,100,30,0.28),
    inset 0 2px 0 rgba(255,230,150,0.52);
}

/* ── History — purple ────────────────────────────────────── */
.eng-mod-history {
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding: 14px 8px 12px;
  min-height: 128px;
  background: linear-gradient(180deg, #c8aaff 0%, #8844e0 100%);
  border: 3px solid #5a28b0;
  box-shadow:
    0 0 0 2.5px rgba(255,255,255,0.82),
    0 6px 0 #3c1880,
    0 9px 24px rgba(120,60,220,0.50),
    inset 0 2px 0 rgba(220,200,255,0.72);
}
.eng-mod-history:active {
  transform: translateY(4px);
  box-shadow:
    0 0 0 2.5px rgba(255,255,255,0.65),
    0 2px 0 #3c1880,
    0 3px 10px rgba(120,60,220,0.28),
    inset 0 2px 0 rgba(220,200,255,0.52);
}

/* ── Watch & Listen — teal ───────────────────────────────── */
.eng-mod-watch {
  flex-direction: column;
  gap: 7px;
  padding: 14px 8px 12px;
  min-height: 128px;
  background: linear-gradient(180deg, #6ad8f8 0%, #1890c8 100%);
  border: 3px solid #0a6898;
  box-shadow:
    0 0 0 2.5px rgba(255,255,255,0.82),
    0 6px 0 #085078,
    0 9px 24px rgba(24,144,200,0.50),
    inset 0 2px 0 rgba(180,240,255,0.72);
}
.eng-mod-watch:active {
  transform: translateY(4px);
  box-shadow:
    0 0 0 2.5px rgba(255,255,255,0.65),
    0 2px 0 #085078,
    0 3px 10px rgba(24,144,200,0.28),
    inset 0 2px 0 rgba(180,240,255,0.52);
}

/* ── Icon box — white circle behind icon ─────────────────── */
.eng-mod-icon-box {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.92);
  border-radius: 50%;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.14),
    inset 0 1px 0 rgba(255,255,255,0.90);
}
.eng-mod-checkin .eng-mod-icon-box {
  width: 68px;
  height: 68px;
}
.eng-mod-review  .eng-mod-icon-box,
.eng-mod-history .eng-mod-icon-box,
.eng-mod-watch   .eng-mod-icon-box {
  width: 56px;
  height: 56px;
}

.eng-mod-icon-img {
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.12));
}
.eng-mod-checkin .eng-mod-icon-img {
  width: 52px;
  height: 52px;
}
.eng-mod-review  .eng-mod-icon-img,
.eng-mod-history .eng-mod-icon-img,
.eng-mod-watch   .eng-mod-icon-img {
  width: 42px;
  height: 42px;
}

/* ── Text section (primary: horizontal layout) ───────────── */
.eng-mod-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex: 1;
  position: relative;
  z-index: 2;
}

/* ── Text labels ─────────────────────────────────────────── */
.eng-mod-name {
  position: relative;
  z-index: 2;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.22);
  line-height: 1.25;
}
.eng-mod-checkin .eng-mod-name {
  font-size: 17px;
  text-align: left;
}
.eng-mod-sub {
  position: relative;
  z-index: 2;
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.86);
  line-height: 1.2;
}
.eng-mod-checkin .eng-mod-sub {
  font-size: 12px;
}

/* ── Responsive ─────────────────────────────────────────── */

/* Very small (≤380px): tighten padding, smaller icons */
@media (max-width: 380px) {
  .eng-mod-checkin { padding: 12px 16px; gap: 12px; min-height: 80px; }
  .eng-mod-checkin .eng-mod-icon-box { width: 56px; height: 56px; }
  .eng-mod-checkin .eng-mod-icon-img { width: 42px; height: 42px; }
  .eng-mod-checkin .eng-mod-name { font-size: 15px; }
  .eng-mod-review  .eng-mod-icon-box,
  .eng-mod-history .eng-mod-icon-box,
  .eng-mod-watch   .eng-mod-icon-box { width: 46px; height: 46px; }
  .eng-mod-review  .eng-mod-icon-img,
  .eng-mod-history .eng-mod-icon-img,
  .eng-mod-watch   .eng-mod-icon-img { width: 34px; height: 34px; }
  .eng-mod-name { font-size: 12px; }
  .eng-mod-sub  { font-size: 9px; }
  .eng-mods-row { gap: 7px; }
}

/* Tablet portrait (768px+): wider buttons */
@media (min-width: 768px) {
  .eng-mods { max-width: 600px; margin-left: auto; margin-right: auto; }
  .eng-mod-checkin { min-height: 108px; padding: 18px 28px; gap: 22px; }
  .eng-mod-checkin .eng-mod-icon-box { width: 80px; height: 80px; }
  .eng-mod-checkin .eng-mod-icon-img { width: 62px; height: 62px; }
  .eng-mod-checkin .eng-mod-name { font-size: 20px; }
  .eng-mod-review  .eng-mod-icon-box,
  .eng-mod-history .eng-mod-icon-box,
  .eng-mod-watch   .eng-mod-icon-box { width: 66px; height: 66px; }
  .eng-mod-review  .eng-mod-icon-img,
  .eng-mod-history .eng-mod-icon-img,
  .eng-mod-watch   .eng-mod-icon-img { width: 52px; height: 52px; }
  .eng-mod-name { font-size: 17px; }
  .eng-mod-sub  { font-size: 12px; }
  .eng-mods-row { gap: 14px; }
}

/* Landscape / desktop (1024px+): constrain width */
@media (min-width: 1024px) {
  .eng-mods { max-width: 680px; }
}

/* ════════════════════════════════════════════════════════════════
   ENGLISH HOUSE v4 — Clean, warm, cohesive sub-page
   One hero card: sky scene → grass bridge → action zone
════════════════════════════════════════════════════════════════ */

/* ── Page header ── */
.erv-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 2px;
}

.erv-back-btn {
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 800;
  color: #2a4a70;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.11);
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.erv-back-btn:active { transform: translateY(2px); }

.erv-header-title {
  flex: 1;
  font-size: 15px;
  font-weight: 900;
  color: #2a3a5e;
  text-align: center;
  white-space: nowrap;
}

.erv-status {
  flex-shrink: 0;
  font-size: 12px;
  padding: 5px 14px;
}

/* ── Hero card (one seamless unit) ── */
.erv-hero-card {
  background: linear-gradient(175deg,
    #5ac8f0  0%,
    #90dcf8 28%,
    #b8eafc 50%,
    #bce8a0 70%,
    #6eba40 100%
  );
  border-radius: 26px;
  overflow: hidden;
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.28),
    0 8px 28px rgba(50,130,190,0.18);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Sky layer */
.erv-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.erv-cloud {
  position: absolute;
  background: rgba(255,255,255,0.88);
  border-radius: 999px;
}
.erv-cloud::before, .erv-cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 999px;
}
.erv-c1 { width: 68px; height: 24px; top: 20px; left: 16px; animation: cloudDrift1 14s ease-in-out infinite; }
.erv-c1::before { width: 38px; height: 28px; top: -12px; left: 14px; }
.erv-c1::after  { width: 26px; height: 20px; top: -7px;  left: 36px; }
.erv-c2 { width: 48px; height: 17px; top: 16px; right: 48px; opacity: 0.62; animation: cloudDrift2 20s ease-in-out infinite; }
.erv-c2::before { width: 28px; height: 22px; top: -10px; left: 10px; }

.erv-star {
  position: absolute;
  pointer-events: none;
  color: rgba(255,242,80,0.90);
  animation: erStarTwinkle 2.5s ease-in-out infinite;
}
.erv-st1 { top:  7%; left:  44%; font-size: 10px; animation-delay: 0.0s; }
.erv-st2 { top:  5%; right: 22%; font-size: 14px; animation-delay: 0.9s; }
.erv-st3 { top: 15%; left:  22%; font-size:  8px; animation-delay: 1.6s; }
.erv-st4 { top: 10%; right: 40%; font-size: 11px; animation-delay: 0.5s; }

/* Scene row: house frame + Lumi */
.erv-scene-row {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  padding: 46px 18px 0;
  flex: 1;
}

/* House img — clean transparent PNG, sits directly on sky gradient */
.erv-house-img {
  width: 148px;
  height: 148px;
  object-fit: contain;
  object-position: center bottom;
  flex-shrink: 0;
  align-self: flex-end;
  display: block;
}

/* Lumi grounded on same baseline */
.erv-lumi-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  align-self: flex-end;
}

.erv-bubble {
  background: rgba(255,255,255,0.96);
  border-radius: 14px 14px 14px 3px;
  padding: 6px 13px;
  font-size: 11.5px;
  font-weight: 800;
  color: #1a3f70;
  box-shadow: 0 2px 8px rgba(0,0,0,0.11);
  white-space: nowrap;
  margin-bottom: 5px;
}

.erv-lumi-img {
  height: 108px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* Soft grass strip */
.erv-grass {
  background: linear-gradient(180deg, #70c050 0%, #4e9a28 100%);
  height: 48px;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  margin-top: -1px;
}

/* CSS grass tufts along the top edge */
.erv-grass::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 14px;
  background:
    radial-gradient(ellipse 12px 14px at 8%   0%, #88d055 100%, transparent 100%),
    radial-gradient(ellipse 10px 12px at 18%  0%, #70c844 100%, transparent 100%),
    radial-gradient(ellipse 14px 14px at 30%  0%, #8cd458 100%, transparent 100%),
    radial-gradient(ellipse  8px 10px at 42%  0%, #78cc48 100%, transparent 100%),
    radial-gradient(ellipse 12px 14px at 58%  0%, #88d055 100%, transparent 100%),
    radial-gradient(ellipse 10px 12px at 70%  0%, #70c844 100%, transparent 100%),
    radial-gradient(ellipse 14px 14px at 82%  0%, #8cd458 100%, transparent 100%),
    radial-gradient(ellipse  8px 10px at 92%  0%, #78cc48 100%, transparent 100%);
  background-color: transparent;
}

.erv-path {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 100%;
  background: linear-gradient(180deg, #d8bc80 0%, #c4a060 100%);
}

/* Dotted centre line on path */
.erv-path::after {
  content: '';
  position: absolute;
  top: 6px; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  background: repeating-linear-gradient(
    180deg,
    rgba(255,255,255,0.55) 0px,
    rgba(255,255,255,0.55) 6px,
    transparent 6px,
    transparent 12px
  );
  border-radius: 2px;
}

/* Action zone — white, rounded bottom corners, seamless below grass */
.erv-action-zone {
  background: #ffffff;
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  border-radius: 0 0 24px 24px;
}

.erv-unit-tag {
  display: inline-flex;
  align-self: flex-start;
  background: #fff0e0;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #a06030;
}

/* Check-in button — warm, softer than before */
.erv-checkin-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  background: linear-gradient(130deg, #ff7050 0%, #e02870 100%);
  border: none;
  border-radius: 18px;
  cursor: pointer;
  box-shadow:
    0 4px 0 rgba(160,20,60,0.32),
    0 6px 18px rgba(220,50,80,0.22);
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.erv-checkin-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(160,20,60,0.24), 0 3px 8px rgba(220,50,80,0.16);
}

.erv-checkin-icon-wrap {
  background: rgba(255,255,255,0.92);
  border-radius: 50%;
  width: 50px; height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.10);
}

.erv-checkin-icon { width: 36px; height: 36px; object-fit: contain; }

.erv-checkin-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  text-align: left;
}

.erv-checkin-title {
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.15);
  line-height: 1.2;
  display: block;
}

.erv-checkin-sub {
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.84);
  display: block;
}

/* ── Quick access: lightweight flat cards ── */
.erv-quick-row {
  display: flex;
  gap: 10px;
}

.erv-quick-card {
  flex: 1;
  background: #ffffff;
  border: none;
  border-radius: 18px;
  padding: 14px 8px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  border-top: 3px solid transparent;
}
.erv-quick-card:active {
  transform: translateY(2px);
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

/* Subtle colour accent on top border */
.erv-qc-review  { border-top-color: #ffaa44; }
.erv-qc-history { border-top-color: #9966dd; }
.erv-qc-watch   { border-top-color: #44aadd; }

.erv-quick-icon { width: 38px; height: 38px; object-fit: contain; }

.erv-quick-label {
  font-size: 12px;
  font-weight: 800;
  color: #2a3a5e;
  line-height: 1.2;
  text-align: center;
  display: block;
}

.erv-quick-sub {
  font-size: 10px;
  font-weight: 600;
  color: #8a9ab8;
  text-align: center;
  display: block;
  line-height: 1.2;
}

.erv-quick-wrap       { flex: 1; display: flex; }
.erv-quick-wrap > .erv-quick-card { flex: 1; }

/* ── Responsive ── */
@media (max-width: 380px) {
  .erv-house-img  { width: 106px; height: 106px; }
  .erv-lumi-img   { height: 84px; }
  .erv-checkin-title { font-size: 14px; }
  .erv-quick-label   { font-size: 11px; }
  .erv-quick-icon    { width: 32px; height: 32px; }
}

@media (min-width: 768px) {
  .erv-house-img  { width: 180px; height: 180px; }
  .erv-lumi-img   { height: 140px; }
  .erv-bubble     { font-size: 13px; padding: 8px 16px; }
  .erv-scene-row  { padding-top: 56px; gap: 14px; }
  .erv-grass      { height: 52px; }
  .erv-checkin-btn { padding: 15px 22px; }
  .erv-checkin-icon-wrap { width: 60px; height: 60px; }
  .erv-checkin-icon  { width: 44px; height: 44px; }
  .erv-checkin-title { font-size: 19px; }
  .erv-quick-icon    { width: 46px; height: 46px; }
  .erv-quick-label   { font-size: 13px; }
  .erv-quick-sub     { font-size: 11px; }
  .erv-quick-card    { padding: 17px 10px 14px; border-radius: 20px; }
}

@media (min-width: 1024px) {
  .erv-hero-card  { max-width: 700px; margin: 0 auto; width: 100%; }
  .erv-quick-row  { max-width: 700px; margin: 0 auto; }
  .erv-header     { max-width: 700px; margin: 0 auto; width: 100%; }
}

/* ════════════════════════════════════════════════════════════════
   ENGLISH HOUSE SCENE — v3 (kept for reference, no longer used)
════════════════════════════════════════════════════════════════ */

/* Scene stage container */
.er-stage {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg,
    #42b8f0  0%,
    #72ccf2 22%,
    #a8e0fa 44%,
    #c8edb0 64%,
    #6eb84a 100%
  );
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.22),
    0 12px 40px rgba(60,160,220,0.28),
    0 4px 16px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

/* ── Sky: CSS clouds ── */
.er-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.er-cloud {
  position: absolute;
  background: rgba(255,255,255,0.90);
  border-radius: 999px;
}
.er-cloud::before,
.er-cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 999px;
}

.er-cloud-a {
  width: 76px; height: 26px;
  top: 24px; left: 18px;
  animation: cloudDrift1 13s ease-in-out infinite;
}
.er-cloud-a::before { width: 44px; height: 30px; top: -14px; left: 14px; }
.er-cloud-a::after  { width: 30px; height: 22px; top: -8px;  left: 40px; }

.er-cloud-b {
  width: 54px; height: 19px;
  top: 18px; right: 56px;
  opacity: 0.72;
  animation: cloudDrift2 18s ease-in-out infinite;
}
.er-cloud-b::before { width: 32px; height: 24px; top: -12px; left: 12px; }

.er-cloud-c {
  width: 40px; height: 15px;
  top: 52px; left: 110px;
  opacity: 0.52;
  animation: cloudDrift1 22s ease-in-out infinite reverse;
}
.er-cloud-c::before { width: 24px; height: 18px; top: -9px; left: 8px; }

/* ── Sky: CSS stars ── */
.er-star {
  position: absolute;
  color: rgba(255,240,80,0.90);
  line-height: 1;
  pointer-events: none;
  z-index: 1;
  animation: erStarTwinkle 2.5s ease-in-out infinite;
}
.er-s1 { top:  7%; left:  44%; font-size: 11px; animation-delay: 0.0s; }
.er-s2 { top:  5%; left:  70%; font-size: 15px; animation-delay: 0.9s; }
.er-s3 { top: 16%; left:  16%; font-size:  9px; animation-delay: 1.5s; }
.er-s4 { top: 11%; right: 14%; font-size: 13px; animation-delay: 0.4s; }

@keyframes erStarTwinkle {
  0%, 100% { opacity: 0.90; transform: scale(1);    }
  50%       { opacity: 0.22; transform: scale(0.55); }
}

/* ── Top controls bar ── */
.er-top-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.er-back-btn {
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 800;
  color: #2a4a70;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease;
}
.er-back-btn:active { transform: translateY(2px); }

/* ── Scene body: house + Lumi ── */
.er-scene-body {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  padding: 52px 12px 0;
  flex: 1;
}

.er-house-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.er-house-img {
  height: 172px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  animation: erHouseFloat 6s ease-in-out infinite;
}
@keyframes erHouseFloat {
  0%, 100% { transform: translateY(0);    }
  50%       { transform: translateY(-5px); }
}

.er-unit-tag {
  background: rgba(255,255,255,0.88);
  border-radius: 999px;
  padding: 4px 13px;
  font-size: 10px;
  font-weight: 800;
  color: #2a4870;
  margin-top: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.er-lumi-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  margin-left: -8px;
}

.er-speech-bubble {
  background: rgba(255,255,255,0.96);
  border-radius: 14px 14px 14px 4px;
  padding: 6px 13px;
  font-size: 11.5px;
  font-weight: 800;
  color: #1a3f70;
  box-shadow: 0 2px 10px rgba(0,0,0,0.13);
  white-space: nowrap;
  margin-bottom: 5px;
}

.er-lumi-img {
  height: 116px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  animation: lumiFloat 3.5s ease-in-out infinite;
}

/* ── Ground strip: grass + path + deco ── */
.er-ground {
  position: relative;
  background: linear-gradient(180deg, #6ebd52 0%, #4a9a28 100%);
  height: 72px;
  flex-shrink: 0;
  overflow: hidden;
}

.er-path {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 100%;
  background: linear-gradient(180deg, #d8bc88 0%, #c4a060 100%);
  border-left:  2px solid rgba(255,255,255,0.25);
  border-right: 2px solid rgba(255,255,255,0.25);
}

.er-signpost {
  position: absolute;
  left: 12px;
  bottom: 0;
  height: 72px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.22));
}

.er-balloons {
  position: absolute;
  right: 10px;
  bottom: 0;
  height: 76px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.18));
  animation: erBalloonSway 4.5s ease-in-out infinite;
}
@keyframes erBalloonSway {
  0%, 100% { transform: rotate(-2deg) translateY(0);    }
  50%       { transform: rotate( 2deg) translateY(-3px); }
}

/* ── Responsive: small screens ── */
@media (max-width: 380px) {
  .er-stage    { min-height: 270px; }
  .er-house-img { height: 134px; }
  .er-lumi-img  { height: 88px;  }
  .er-ground, .er-signpost { height: 56px; }
  .er-balloons  { height: 60px; }
  .er-speech-bubble { font-size: 10.5px; padding: 5px 11px; }
}

/* ── Responsive: tablet (768px+) ── */
@media (min-width: 768px) {
  .er-stage     { min-height: 400px; }
  .er-house-img { height: 220px; }
  .er-lumi-img  { height: 152px; }
  .er-ground, .er-signpost { height: 90px; }
  .er-balloons  { height: 96px; }
  .er-speech-bubble { font-size: 13px; padding: 8px 16px; }
  .er-unit-tag  { font-size: 12px; padding: 5px 16px; margin-top: 8px; }
  .er-scene-body { padding-top: 60px; gap: 8px; }
}

/* ── Responsive: desktop (1200px+) ── */
@media (min-width: 1200px) {
  .er-stage     { min-height: 480px; }
  .er-house-img { height: 280px; }
  .er-lumi-img  { height: 200px; }
  .er-ground, .er-signpost { height: 110px; }
  .er-balloons  { height: 116px; }
}

/* ════════════════════════════════════════════════════════════════
   ENGLISH HOUSE v5 — Hero-background layout (ehv-*)
   Wide scene image · overlaid CTA on grass · mini cards below
════════════════════════════════════════════════════════════════ */

/* Reset view grid gap so header + hero are flush */
#englishView {
  gap: 0;
  padding-top: 0;
}

/* ── Header bar ── */
.ehv-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px 16px 0 0;
}

.ehv-back-btn {
  background: rgba(255,255,255,0.95);
  border: none;
  border-radius: 22px;
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: #2a6aba;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  white-space: nowrap;
  transition: opacity 0.15s;
}
.ehv-back-btn:active { opacity: 0.7; }

.ehv-header-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  color: #1a3f70;
}

/* status-pill is already defined globally; just position it */
.ehv-status { flex-shrink: 0; }

/* ── Hero image zone ── */
.ehv-hero {
  position: relative;
  width: 100%;
  height: 260px;
  background-image: url('/public/assets/town/backgrounds/english-house-hero-wide.png');
  background-size: cover;
  background-position: center 30%;
  overflow: hidden;
  flex-shrink: 0;
}

/* Unit label floating top-left */
.ehv-unit-tag {
  position: absolute;
  top: 10px;
  left: 12px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 20px;
  padding: 4px 13px;
  font-size: 11.5px;
  font-weight: 700;
  color: #2a5a30;
  z-index: 2;
  white-space: nowrap;
}

/* Gradient scrim + CTA pinned to bottom of hero image */
.ehv-cta-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 44px 12px 14px;
  background: linear-gradient(to top,
    rgba(0,0,0,0.38) 0%,
    rgba(0,0,0,0.12) 60%,
    transparent 100%
  );
  z-index: 3;
}

/* Check-in primary button */
.ehv-checkin-btn {
  display: flex;
  align-items: center;
  width: 100%;
  background: linear-gradient(135deg, #ff7a3d 0%, #ff4f6a 100%);
  border: none;
  border-radius: 16px;
  padding: 0;
  cursor: pointer;
  box-shadow:
    0 4px 18px rgba(255,70,60,0.45),
    0 0 0 2px rgba(255,255,255,0.45);
  overflow: hidden;
  transition: transform 0.12s, box-shadow 0.12s;
}
.ehv-checkin-btn:hover  { transform: translateY(-1px); }
.ehv-checkin-btn:active { transform: scale(0.97); box-shadow: 0 2px 10px rgba(255,70,60,0.35); }

.ehv-checkin-icon-wrap {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.20);
  flex-shrink: 0;
}
.ehv-checkin-icon { width: 32px; height: 32px; object-fit: contain; }

.ehv-checkin-text {
  flex: 1;
  padding: 0 14px;
  text-align: left;
}
.ehv-checkin-title {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
}
.ehv-checkin-sub {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.80);
  margin-top: 2px;
}

/* ── Mini cards row (below hero, flush) ── */
.ehv-mini-row {
  display: flex;
  gap: 8px;
  padding: 10px 0 4px;
}

.ehv-mini-wrap {
  flex: 1;
  display: flex;
}
.ehv-mini-wrap > .ehv-mini-card { flex: 1; }

.ehv-mini-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,0.70);
  border-radius: 14px;
  padding: 12px 8px 10px;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.ehv-mini-card:active { transform: scale(0.96); background: rgba(255,255,255,0.95); }

.ehv-mini-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.ehv-mini-label {
  font-size: 12px;
  font-weight: 700;
  color: #1a3f70;
  text-align: center;
  line-height: 1.2;
}

/* ── Responsive ── */
@media (min-width: 480px) {
  .ehv-hero { height: 300px; }
  .ehv-checkin-title { font-size: 18px; }
}

@media (min-width: 768px) {
  .ehv-hero { height: 390px; }
  .ehv-unit-tag { font-size: 13px; padding: 6px 16px; }
  .ehv-checkin-btn { border-radius: 18px; }
  .ehv-checkin-icon-wrap { width: 62px; height: 62px; }
  .ehv-checkin-icon { width: 38px; height: 38px; }
  .ehv-checkin-title { font-size: 20px; }
  .ehv-checkin-sub  { font-size: 12.5px; }
  .ehv-mini-icon  { width: 40px; height: 40px; }
  .ehv-mini-label { font-size: 13px; }
  .ehv-mini-card  { padding: 14px 10px 12px; border-radius: 16px; }
  .ehv-header     { border-radius: 20px 20px 0 0; padding: 12px 18px; }
  .ehv-back-btn   { font-size: 14px; }
  .ehv-header-title { font-size: 19px; }
}

@media (min-width: 1024px) {
  /* Cap the card at 700px centered */
  #englishView > .ehv-header,
  #englishView > .ehv-hero,
  #englishView > .ehv-mini-row {
    max-width: 700px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  .ehv-hero { height: 430px; }
}


/* ══════════════════════════════════════════
   UNIT SWITCHER — Change Unit button + collapsible list
══════════════════════════════════════════ */
.unit-sel-wrap {
  padding: 0;
}

/* When embedded inside adventure-header card */
.adventure-header .unit-sel-wrap {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1.5px solid rgba(255, 200, 80, 0.35);
}

/* Small inline pill button */
.change-unit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid #e0c88a;
  background: #fff8ee;
  color: #7a5020;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.10s;
}
.change-unit-btn:active { transform: scale(0.96); }
.change-unit-btn.open {
  background: linear-gradient(130deg, #fff3c0, #ffe88a);
  border-color: #ffc44a;
  color: #6a3800;
}

/* Collapsible list — scrollable, inline (not floating) */
.unit-card-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  max-height: 240px;
  overflow-y: auto;
  border-radius: 16px;
  border: 1.5px solid #e0c88a;
  background: #fffbf3;
  padding: 6px;
  box-shadow: 0 4px 16px rgba(200, 120, 0, 0.10);
}

.unit-card-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  background: transparent;
  color: #7a5020;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s, border-color 0.12s, transform 0.10s;
}
.unit-card-btn:not(.active):hover { background: #fff3d6; }
.unit-card-btn:active { transform: scale(0.97); }
.unit-card-btn.active {
  background: linear-gradient(130deg, #fff3c0, #ffe88a);
  border-color: #ffc44a;
  color: #6a3800;
  box-shadow: 0 2px 8px rgba(200, 120, 0, 0.15);
}

/* ══════════════════════════════════════════
   RESPONSIVE — English view
   ①  Phone portrait      ≤ 599px    single col, compact
   ②  Tablet portrait  600–1023px    single col, spacious
   ③  Desktop / iPad ≥  1024px      2-column layout
══════════════════════════════════════════ */

/* ── ① Phone portrait (≤ 599px) ── */
@media (max-width: 599px) {
  #englishView {
    gap: 10px !important;
    padding-top: 8px !important;
  }
  .adventure-header { padding: 12px 14px; }
  .lumi-guide       { width: 58px; height: 58px; }
  .adventure-title  { font-size: 16px; }
  .adventure-unit   { font-size: 11px; }

  .eng-mods         { padding: 0; }
  .eng-mod-checkin  { min-height: 76px; padding: 10px 14px; gap: 12px; }
  .eng-mod-checkin .eng-mod-icon-box { width: 54px; height: 54px; }
  .eng-mod-checkin .eng-mod-icon-img { width: 40px; height: 40px; }
  .eng-mod-checkin .eng-mod-name     { font-size: 14px; }
  .eng-mod-review,
  .eng-mod-history,
  .eng-mod-watch    { min-height: 100px; }
  .eng-mods-row     { gap: 7px; }
}

/* ── ② Tablet portrait (600–1023px) ── */
@media (min-width: 600px) and (max-width: 1023px) {
  #englishView {
    gap: 14px !important;
    padding-top: 10px !important;
  }
  .adventure-header { padding: 18px 22px; }
  .lumi-guide       { width: 88px; height: 88px; }
  .adventure-title  { font-size: 21px; }

  .eng-mod-checkin  { min-height: 100px; padding: 16px 24px; gap: 20px; }
  .eng-mod-checkin .eng-mod-icon-box { width: 76px; height: 76px; }
  .eng-mod-checkin .eng-mod-icon-img { width: 58px; height: 58px; }
  .eng-mod-checkin .eng-mod-name     { font-size: 19px; }
  .eng-mod-review,
  .eng-mod-history,
  .eng-mod-watch    { min-height: 128px; }
  .eng-mods-row     { gap: 12px; }
}

/* ── ③ Desktop / iPad landscape / phone landscape ── */
@media (min-width: 1024px), (orientation: landscape) and (min-width: 600px) {
  /* Two-column grid: left = unit info, right = action buttons */
  #englishView {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    padding-top: max(12px, env(safe-area-inset-top, 0px)) !important;
    align-items: start;
  }

  /* Back button spans both cols */
  #englishView > .flow-nav-bar { grid-column: 1 / -1; }

  /* Left col row 2: adventure header (now contains unitSelWrap inside) */
  #englishView > .adventure-header.card {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
  }

  /* Left col row 3: module buttons */
  #englishView > .eng-mods {
    grid-column: 1;
    grid-row: 3;
    align-self: start;
    max-width: none !important;
    margin: 0 !important;
  }

  /* Right col rows 2–3: companion card fills full height */
  #englishView > #engCompanion {
    display: flex;
    grid-column: 2;
    grid-row: 2 / 4;
    align-self: stretch;
  }

  .eng-mod-checkin  { min-height: 96px; padding: 14px 22px; gap: 18px; }
  .eng-mod-checkin .eng-mod-name { font-size: 18px; }
  .eng-mod-review,
  .eng-mod-history,
  .eng-mod-watch    { min-height: 118px; }
  .eng-mods-row     { gap: 12px; }
}

/* ══════════════════════════════════════════
   PHONE LANDSCAPE — one-screen compact fit
   Targets real phone landscape only (height ≤ 480px).
   Does NOT affect iPad landscape or desktop.
══════════════════════════════════════════ */
@media (orientation: landscape) and (max-height: 480px) {
  /* Tighten outer grid */
  #englishView {
    gap: 6px !important;
    padding-top: 6px !important;
  }

  /* Back button row — remove top padding, shrink button */
  #englishView > .flow-nav-bar { padding-top: 0; }
  .back-btn { padding: 6px 14px; font-size: 13px; }

  /* Adventure header — compact */
  .adventure-header { padding: 6px 12px; }
  .lumi-guide       { width: 40px; height: 40px; }
  .adventure-title  { font-size: 14px; }
  .adventure-unit   { font-size: 10px; margin-bottom: 4px; }

  /* Change Unit — minimal spacing */
  .adventure-header .unit-sel-wrap {
    margin-top: 4px;
    padding-top: 4px;
  }
  .change-unit-btn { padding: 4px 12px; font-size: 11px; }

  /* Module buttons — compact */
  .eng-mods        { gap: 6px; }
  .eng-mod-checkin { min-height: 52px; padding: 8px 14px; gap: 12px; }
  .eng-mod-checkin .eng-mod-icon-box { width: 36px; height: 36px; }
  .eng-mod-checkin .eng-mod-icon-img { width: 28px; height: 28px; }
  .eng-mod-checkin .eng-mod-name     { font-size: 14px; }
  .eng-mod-review,
  .eng-mod-history { min-height: 62px; padding: 8px 6px 6px; }
  .eng-mod-review .eng-mod-icon-box,
  .eng-mod-history .eng-mod-icon-box { width: 36px; height: 36px; }
  .eng-mod-review .eng-mod-icon-img,
  .eng-mod-history .eng-mod-icon-img { width: 28px; height: 28px; }
  .eng-mod-review .eng-mod-name,
  .eng-mod-history .eng-mod-name { font-size: 13px; }
  .eng-mods-row    { gap: 6px; }

  /* Companion card — compact, hide cheer text */
  .eng-companion             { gap: 6px; padding: 10px 14px; }
  .eng-companion-lumi-wrap   { min-height: 50px; max-height: 90px; }
  .eng-companion-lumi-img    { height: 90px; }
  .eng-companion-greeting    { font-size: 12px; }
  .eng-companion-cheer       { display: none; }
  .eng-companion-stars-box   { padding: 6px 14px; }
  .eng-companion-star-num    { font-size: 18px; }
  .eng-companion-unit-label  { font-size: 10px; padding: 2px 10px; }
}

/* ══════════════════════════════════════════
   ENGLISH LANDSCAPE COMPANION CARD
══════════════════════════════════════════ */

/* Hidden in portrait — shown only by landscape media query above */
.eng-companion {
  display: none;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 20px 18px 24px;
  background: linear-gradient(160deg, #d8eeff 0%, #c0d8ff 40%, #a8c8f8 80%, #98baf0 100%);
  border: 2px solid rgba(160, 200, 255, 0.70);
  overflow: hidden;
}

/* Inner radial glow — top-centre highlight */
.eng-companion::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 20%, rgba(255,255,255,0.48) 0%, transparent 62%);
  border-radius: inherit;
  pointer-events: none;
}

.eng-companion-lumi-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 120px;
  max-height: 200px;
}

.eng-companion-lumi-img {
  height: 170px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: normal;
  filter: drop-shadow(0 6px 14px rgba(30, 80, 200, 0.18));
}

.eng-companion-greeting {
  position: relative;
  z-index: 1;
  font-size: 15px;
  font-weight: 800;
  color: #0e2a60;
  margin: 0;
  line-height: 1.3;
}

.eng-companion-stars-box {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(160deg, #ffe84a 0%, #ffc400 60%, #f5a800 100%);
  padding: 10px 22px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 3px 10px rgba(160, 100, 0, 0.20), inset 0 1px 0 rgba(255,255,255,0.55);
}

.eng-companion-star-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  mix-blend-mode: multiply;
  flex-shrink: 0;
}

.eng-companion-star-num {
  font-size: 26px;
  font-weight: 900;
  color: #4a2000;
  line-height: 1;
}

.eng-companion-star-label {
  font-size: 11px;
  font-weight: 800;
  color: #7a4800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.eng-companion-unit-label {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
  color: #1a3060;
  margin: 0;
  max-width: 210px;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.38);
  padding: 4px 12px;
  border-radius: 999px;
}

.eng-companion-cheer {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 600;
  color: #2a4898;
  margin: 0;
  font-style: italic;
  opacity: 0.85;
}

/* ── Word audio listen button ──────────────────────────── */
#flowSection {
  position: relative;
}
.listen-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 16px;
  border: 1.5px solid #ffb84a;
  border-radius: 999px;
  background: linear-gradient(130deg, #fff3cc, #ffe080);
  color: #a05000;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(200, 110, 0, 0.18);
  transition: transform 0.12s, box-shadow 0.12s;
  z-index: 1;
}
.listen-btn:hover {
  box-shadow: 0 4px 12px rgba(200, 110, 0, 0.28);
}
.listen-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 4px rgba(200, 110, 0, 0.18);
}
.listen-btn.hidden {
  display: none;
}

/* ══════════════════════════════════════════
   ENGLISH ADVENTURE — MAGIC CLASSROOM BACKGROUND
   Applied to body when English views are active.
   Uses CSS :has() (Chrome 105+, Safari 15.4+, Firefox 121+).
   Mobile-first: bg-mobile default, swap to bg-desktop at 768px.
══════════════════════════════════════════ */
body:has(#englishView:not(.hidden)),
body:has(#flowView:not(.hidden)) {
  background:
    url('/public/assets/backgrounds/english/bg-checkin-magic-classroom-mobile.png')
    center top / cover no-repeat fixed;
}

@media (min-width: 768px) {
  body:has(#englishView:not(.hidden)),
  body:has(#flowView:not(.hidden)) {
    background-image: url('/public/assets/backgrounds/english/bg-checkin-magic-classroom-desktop.png');
    background-position: center center;
  }
}
