/* ============ Babelisa — giao diện ============
   Bảng màu lấy từ key art: trời xanh ngọc, biển lam, cát vàng nhạt, lá xanh, gỗ nâu ấm.
   Mọi chuyển động chỉ dùng transform + opacity để giữ 60fps trên điện thoại. */
:root {
  --sky: #5ec8f5;
  --sea: #1fa7d6;
  --sand: #efd9a6;
  --leaf: #4caf50;
  --leaf-d: #2e7d32;
  --wood: #a0623a;
  --wood-d: #5a2d0c;
  --orange: #ff7a1a;
  --yellow: #ffd23f;
  --red: #e53935;
  --ink: #2c1b10;
  --paper: #fffaf0;
  --shadow: 0 10px 30px rgba(20, 30, 60, 0.25);
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-ui: 'Nunito', system-ui, sans-serif;
  --radius: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: radial-gradient(120% 90% at 50% 0%, #1d6f96 0%, #0d3b57 55%, #061f30 100%);
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
svg.ico { width: 100%; height: 100%; display: block; }
img.ico { width: 100%; height: 100%; display: block; object-fit: contain; }
img { -webkit-user-drag: none; }

#app { height: 100dvh; }
.screen { position: fixed; inset: 0; display: none; }
.screen.active { display: block; }

/* ---------- Màn hình chờ ---------- */
.loading { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: radial-gradient(120% 90% at 50% 0%, #2a9bd0 0%, #0d3b57 70%); transition: opacity 0.45s ease; }
.loading.out { opacity: 0; pointer-events: none; }
.loading-card { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.loading-lisa { height: min(46vh, 380px); width: auto; animation: loadbob 1.4s ease-in-out infinite; }
@keyframes loadbob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
.loading-dots { display: flex; gap: 10px; }
.loading-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--yellow); animation: dot 1s ease-in-out infinite; }
.loading-dots i:nth-child(2) { animation-delay: 0.15s; }
.loading-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-10px); opacity: 1; } }

/* ---------- Sân khấu dọc (mobile-first, desktop vẫn đẹp) ---------- */
.stage {
  position: relative;
  width: min(100vw, calc(100dvh * 0.58));
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #0d3b57;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.45);
  isolation: isolate;
}

/* ---------- Thế giới + camera ---------- */
.world { position: absolute; inset: 0; z-index: 0; transform-origin: 0 0; transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1); will-change: transform; }
/* ---------- Lớp bối cảnh (ảnh nền tách 3 lớp parallax) ---------- */
.scene-layer { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.scene-layer.dim::after { opacity: 1; background: rgba(10, 30, 50, 0.4); }
.scene-frame { position: absolute; inset: 0; opacity: 0; transition: opacity 0.9s ease; }
.scene-frame.in { opacity: 1; }
.scene-frame.out { opacity: 0; }
.bg-frame { position: absolute; inset: 0; overflow: hidden; }
.bg-layer { position: absolute; inset: -6%; transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1); will-change: transform; }
/* .bg-inner mô phỏng object-fit: cover, nên các hiệu ứng đặt theo % toạ độ ảnh gốc 1072x1920 */
.bg-inner {
  position: absolute; left: 50%; top: 50%;
  aspect-ratio: 1072 / 1920;
  min-width: 100%; min-height: 100%;
  width: auto; height: auto;
  transform: translate(-50%, -50%) scale(1.04);
  background-size: cover; background-position: center;
  animation: parallax 36s ease-in-out infinite alternate;
  will-change: transform;
}
.layer-sky .bg-inner { animation-duration: 60s; }
.layer-fore .bg-inner { animation-duration: 26s; animation-direction: alternate-reverse; }
@keyframes parallax { from { transform: translate(-50.6%, -50.4%) scale(1.04); } to { transform: translate(-49.4%, -49.6%) scale(1.06); } }
.bg-fx, .bg-objects, .night-sky { position: absolute; inset: 0; pointer-events: none; }
/* Chim bay xa + tia nắng rừng */
.birds { position: absolute; inset: 0; }
.birds i { position: absolute; left: -10%; top: 11%; width: 18px; height: 8px; border: 2px solid rgba(40, 40, 60, 0.6); border-width: 2px 0 0; border-radius: 50% 50% 0 0; animation: birdfly 22s linear infinite; }
.birds i::before, .birds i::after { content: ''; position: absolute; top: -2px; width: 9px; height: 8px; border-top: 2px solid rgba(40, 40, 60, 0.6); border-radius: 50% 50% 0 0; }
.birds i::before { left: -8px; } .birds i::after { right: -8px; }
@keyframes birdfly { from { transform: translate(0, 0); } 50% { transform: translate(60vw, -14px); } to { transform: translate(120vw, 6px); } }
.sunrays { position: absolute; inset: 0; overflow: hidden; }
.sunrays i { position: absolute; top: -20%; left: 30%; width: 14%; height: 90%; background: linear-gradient(180deg, rgba(255, 245, 190, 0.35), rgba(255, 245, 190, 0)); transform: rotate(18deg); animation: rays 7s ease-in-out infinite alternate; }
.sunrays i:nth-child(2) { left: 48%; width: 8%; animation-delay: -2s; } .sunrays i:nth-child(3) { left: 62%; width: 18%; animation-delay: -4s; }
@keyframes rays { from { opacity: 0.4; } to { opacity: 0.9; } }
/* Vật thể chạm được trong cảnh */
.hotspots { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.hotspots .tile.hotspot { position: absolute; width: clamp(64px, 19vmin, 92px); aspect-ratio: 1; transform: translate(-50%, -50%); padding: 11px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); pointer-events: auto; animation: hotspot 1.6s ease-in-out infinite; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5), 0 10px 20px rgba(0, 0, 0, 0.3); touch-action: none; }
.hotspots .tile.hotspot .ico { width: 100%; height: 100%; flex: none; }
.hotspots .tile.hotspot .ring { position: absolute; inset: -10px; border-radius: 50%; border: 3px solid rgba(255, 210, 63, 0.9); animation: ring-pulse 1.6s ease-out infinite; pointer-events: none; }
@keyframes hotspot { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -52%) scale(1.05); } }
@keyframes ring-pulse { from { transform: scale(0.8); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.hotspots .tile.hotspot.ok { animation: none; transform: translate(-50%, -50%) scale(1.15); }
.hotspots .tile.hotspot.bad { animation: shake 0.45s ease; }
.hotspots .tile.hotspot.selected { transform: translate(-50%, -60%) scale(1.1); animation: none; }
.hotspots .tile.hotspot.dim { opacity: 0.25; }
/* Nhãn từ gắn lên vật thể trong cảnh */
.worldprop { position: absolute; transform: translate(-50%, -50%) scale(0.5); opacity: 0; width: clamp(72px, 22vmin, 104px); background: #fff; border-radius: 22px; padding: 8px 8px 5px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--font-display); font-weight: 700; font-size: clamp(14px, 4.2vmin, 20px); color: var(--wood-d); pointer-events: auto; transition: transform 0.45s cubic-bezier(0.2, 1.4, 0.4, 1), opacity 0.3s; }
.worldprop.pop { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.worldprop .ico { width: 70%; height: auto; }
.worldprop .ring { position: absolute; inset: -12px; border-radius: 50%; border: 3px solid rgba(255, 210, 63, 0.9); animation: ring-pulse 1.6s ease-out infinite; pointer-events: none; }
/* Đoạn đường (travel): nền cuộn 3 lớp, vật thể trôi qua */
.travel-frame { position: absolute; inset: 0; overflow: hidden; }
.tl { position: absolute; inset: 0; }
.tstrip { position: absolute; left: 0; top: 0; height: 100%; display: flex; will-change: transform; }
.ttile { height: 100%; flex: none; background-size: cover; background-position: center; }
.ttile.flip { transform: scaleX(-1); }
.travel-frame.time-night .time-tint { background: linear-gradient(180deg, rgba(6, 14, 48, 0.55), rgba(8, 20, 60, 0.45)); }
.travel-frame.variant.time-night .time-tint { background: linear-gradient(180deg, rgba(8, 18, 60, 0.18), rgba(10, 25, 70, 0.1)); }
.travel-frame.time-evening .time-tint { background: linear-gradient(180deg, rgba(70, 30, 120, 0.26), rgba(255, 120, 60, 0.18) 55%, rgba(30, 15, 60, 0.36)); }
.hotspots .tobj { top: auto; bottom: 26%; transform: translate(-50%, 0); animation: none; }
.hotspots .tobj.pick { width: clamp(64px, 19vmin, 92px); pointer-events: none; opacity: 0.95; }
.hotspots .tobj.pick .ring { display: none; }
.hotspots .tobj.pick.armed { pointer-events: auto; animation: hotspot 1.6s ease-in-out infinite; }
.hotspots .tobj.pick.armed .ring { display: block; }
.hotspots .tobj.obstacle { width: clamp(100px, 30vmin, 170px); bottom: 25%; pointer-events: none; }
.hotspots .tobj.obstacle svg { width: 100%; display: block; }
.hotspots .tobj.obstacle.armed::after { content: ''; position: absolute; inset: -14px; border-radius: 50%; border: 3px solid rgba(255, 210, 63, 0.9); animation: ring-pulse 0.9s ease-out infinite; }
.stage.travel .hotspots { pointer-events: none; }
.travel-progress { width: 100%; max-width: 420px; display: flex; align-items: center; gap: 12px; }
.tp-track { flex: 1; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.55); position: relative; }
.tp-dot { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); }
.tp-dot.start { left: 0; } .tp-dot.end { left: 100%; background: var(--yellow); }
.tp-marker { position: absolute; top: 50%; left: 0; width: 38px; height: 38px; border-radius: 50%; background: #fff; padding: 3px; transform: translate(-50%, -50%); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); transition: left 0.15s linear; }
.btn-round.go { width: 62px; height: 62px; }
.btn-round.go.on { background: var(--leaf); color: #fff; box-shadow: 0 4px 0 #2e7d32; }
.actor.flying .sprite { animation: fly 0.7s ease-in-out infinite alternate; }
@keyframes fly { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-12%) rotate(2deg); } }
/* ---------- Trắc trở ---------- */
/* suối trơn */
.stream { position: absolute; left: -5%; right: -5%; top: 62%; height: 16%; background: linear-gradient(180deg, rgba(79, 184, 230, 0.35), rgba(31, 147, 199, 0.75)); border-radius: 50% 50% 40% 40% / 30% 30% 20% 20%; overflow: hidden; }
.stream::after { content: ''; position: absolute; top: 0; bottom: 0; left: -64px; right: 0; will-change: transform; background: repeating-linear-gradient(100deg, transparent 0 30px, rgba(255, 255, 255, 0.35) 30px 34px); animation: streamflow 2.2s linear infinite; }
@keyframes streamflow { from { transform: translateX(0); } to { transform: translateX(64px); } }
.stone-step { position: absolute; top: 70%; width: clamp(54px, 15vmin, 76px); aspect-ratio: 1.4; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(ellipse at 40% 35%, #b5b5b5, #7d7f86 70%); box-shadow: 0 6px 0 #4e4f55, 0 10px 16px rgba(0, 0, 0, 0.35); pointer-events: auto; }
.stone-step.slippery { background: radial-gradient(ellipse at 40% 35%, #e9f6ff, #8fb6c9 70%); }
.stone-step.slippery i { position: absolute; left: 30%; top: 22%; width: 24%; height: 18%; border-radius: 50%; background: rgba(255, 255, 255, 0.85); filter: blur(1px); }
.stone-step.done { background: radial-gradient(ellipse at 40% 35%, #c8e6c9, #7cb342 70%); }
.stone-step.bad { animation: shake 0.45s ease; }
.stage.stream-trial .hotspots { pointer-events: none; }
/* bóng tối (Ngày 6) */
.scene-layer::after, .actors::after { content: ''; position: absolute; inset: 0; z-index: 5; background: #030b17; opacity: 0; transition: opacity 0.9s; pointer-events: none; }
.stage.dark .scene-layer::after { opacity: 0.8; }
.stage.dark .actors::after { opacity: 0.55; }
.stage.dark .tile { box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.6), 0 0 24px rgba(255, 210, 63, 0.5); }
/* đồng hồ trắc trở: đàn ong, bão */
.meter { position: absolute; inset: 0; pointer-events: none; }
.meter.bees i { position: absolute; width: 14px; height: 10px; border-radius: 50%; background: #ffd23f; box-shadow: inset 0 0 0 2px #2c1b10; top: 40%; left: calc(110% - var(--t, 0) * 70%); animation: bee 0.5s ease-in-out infinite alternate; }
.meter.bees i:nth-child(2) { top: 46%; animation-delay: -0.1s; margin-left: 24px; }
.meter.bees i:nth-child(3) { top: 36%; animation-delay: -0.2s; margin-left: 40px; }
.meter.bees i:nth-child(4) { top: 52%; animation-delay: -0.3s; margin-left: 12px; }
.meter.bees i:nth-child(5) { top: 43%; animation-delay: -0.15s; margin-left: 56px; }
.meter.bees i:nth-child(6) { top: 33%; animation-delay: -0.35s; margin-left: 30px; }
.meter.bees i:nth-child(7) { top: 49%; animation-delay: -0.25s; margin-left: 66px; }
@keyframes bee { from { transform: translate(0, 0); } to { transform: translate(-8px, -10px); } }
.meter.storm .cloud-dark { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30, 35, 60, calc(var(--t, 0) * 0.75)), rgba(30, 35, 60, calc(var(--t, 0) * 0.35)) 60%, transparent); }
.meter.storm .rain { position: absolute; left: 0; right: 0; top: -100px; height: calc(100% + 100px); opacity: var(--t, 0); background: repeating-linear-gradient(110deg, transparent 0 14px, rgba(200, 220, 255, 0.35) 14px 16px); animation: rain 0.45s linear infinite; will-change: transform; }
@keyframes rain { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, 94px, 0); } }
.flash.dark { background: #06121e; animation: darkflash 1.2s ease-out forwards; }
@keyframes darkflash { 0% { opacity: 0.95; } 100% { opacity: 0; } }
.flash.sting { background: radial-gradient(circle at 50% 50%, rgba(229, 57, 53, 0) 40%, rgba(229, 57, 53, 0.55)); animation: splash 0.9s ease-out forwards; }
/* Cutscene letterbox */
.bars { position: absolute; inset: 0; z-index: 9; pointer-events: none; }
.bar { position: absolute; left: 0; right: 0; height: 9%; background: #06121e; transform: scaleY(0); transition: transform 0.6s ease; }
.bar.top { top: 0; transform-origin: top; } .bar.bottom { bottom: 0; transform-origin: bottom; }
.stage.cinema .bar { transform: scaleY(1); }
.stage.cinema .hud, .stage.cinema .dock { opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.hud, .dock { transition: opacity 0.4s; }

/* Mây */
.cloud { position: absolute; height: 6%; opacity: 0.8; animation: drift linear infinite; background:
  radial-gradient(circle at 20% 72%, #fff 0 24%, transparent 25%),
  radial-gradient(circle at 40% 46%, #fff 0 33%, transparent 34%),
  radial-gradient(circle at 62% 52%, #fff 0 30%, transparent 31%),
  radial-gradient(circle at 82% 70%, #fff 0 21%, transparent 22%),
  radial-gradient(ellipse 36% 26% at 50% 84%, #fff 0 98%, transparent 100%),
  radial-gradient(circle at 42% 90%, rgba(190, 215, 240, 0.9) 0 40%, transparent 41%); }
@keyframes drift { from { transform: translateX(-30%); } to { transform: translateX(130%); } }
/* Sóng lấp lánh */
.sparkle { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.9); animation: twinkle ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(0.4); } 50% { opacity: 0.95; transform: scale(1); } }
/* Đom đóm */
.firefly { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #e8ff7a; box-shadow: 0 0 10px 3px rgba(220, 255, 120, 0.8); animation: fly ease-in-out infinite alternate; }
@keyframes fly { 0% { transform: translate(0, 0); opacity: 0.2; } 50% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)); opacity: 0.3; } }
/* Khói bếp */
.smoke { position: absolute; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 70%); transform: translate(-50%, -50%); animation: smoke 4.4s linear infinite; }
@keyframes smoke { 0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; } 20% { opacity: 0.6; } 100% { transform: translate(10px, -140px) scale(2.2); opacity: 0; } }
/* Đêm */
.night-sky .star { position: absolute; aspect-ratio: 1; border-radius: 50%; background: #fff; animation: twinkle 2.6s ease-in-out infinite; }
.moon { position: absolute; left: 72%; top: 9%; width: 9%; aspect-ratio: 1; border-radius: 50%; background: #fff6c8; box-shadow: 0 0 40px 16px rgba(255, 246, 200, 0.45); }
.evening-sun { position: absolute; left: 12%; top: 40%; width: 16%; aspect-ratio: 1; border-radius: 50%; background: #ffd36b; box-shadow: 0 0 60px 30px rgba(255, 170, 80, 0.5); opacity: 0.9; }
/* Tint thời điểm trong ngày */
.time-tint { position: absolute; inset: 0; pointer-events: none; transition: opacity 1.2s ease; }
.time-morning .time-tint { opacity: 0; }
.time-afternoon .time-tint { background: linear-gradient(180deg, rgba(255, 220, 150, 0.08), rgba(255, 180, 90, 0.18)); }
.time-evening .time-tint { background: linear-gradient(180deg, rgba(70, 30, 120, 0.3), rgba(255, 120, 60, 0.2) 55%, rgba(30, 15, 60, 0.42)); }
.time-night .time-tint { background: linear-gradient(180deg, rgba(5, 12, 45, 0.66), rgba(8, 20, 60, 0.52)); }
.time-night .bg-inner::after { content: ''; position: absolute; inset: 0; background: rgba(20, 30, 80, 0.25); }
.bg-frame.variant.time-night .time-tint { background: linear-gradient(180deg, rgba(8, 18, 60, 0.18), rgba(10, 25, 70, 0.1)); }
.bg-frame.variant.time-night .bg-inner::after { background: transparent; }
.bg-frame.variant.time-evening .time-tint { background: linear-gradient(180deg, rgba(120, 60, 160, 0.15), rgba(255, 120, 60, 0.12)); }
.bg-frame.variant .night-sky .moon { display: none; }

/* Lửa trại (overlay) */
.campfire { position: absolute; width: 22%; transform: translate(-50%, -85%) scale(var(--s, 1)); }
.campfire svg { width: 100%; display: block; position: relative; z-index: 1; }
.campfire .flames { transform-origin: 60px 100px; animation: flicker 0.32s ease-in-out infinite alternate; }
@keyframes flicker { from { transform: scale(1, 1); } to { transform: scale(1.08, 0.93) rotate(-2deg); } }
.fire-glow { position: absolute; left: 50%; top: 55%; width: 340%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(255, 160, 60, 0.45) 0%, rgba(255, 160, 60, 0) 65%); animation: glow 1.1s ease-in-out infinite alternate; pointer-events: none; }
@keyframes glow { from { opacity: 0.7; } to { opacity: 1; } }
.ember { position: absolute; left: 44%; top: 40%; width: 5px; height: 5px; border-radius: 50%; background: #ffd23f; animation: ember 2.1s ease-out infinite; z-index: 2; }
@keyframes ember { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(18px, -140px); opacity: 0; } }
.stage.fire-big .campfire { --s: 1.35; }
/* Thủy triều */
.tide { position: absolute; left: 0; right: 0; bottom: 0; height: 60%; transform: translateY(100%); transition: transform 0.4s linear; }
.tide svg { width: 100%; height: 100%; display: block; }
.tide-wave, .tide-foam { animation: tidewave 3s linear infinite; }
@keyframes tidewave { from { transform: translateX(0); } to { transform: translateX(40px); } }
/* Thỏ */
.rabbit { position: absolute; left: -16%; top: 74%; width: 14%; opacity: 0; }
.rabbit.run { animation: rabbitrun 1.6s ease-in-out forwards; }
@keyframes rabbitrun { 0% { transform: translate(0, 0); opacity: 1; } 25% { transform: translate(200%, -30px); } 50% { transform: translate(400%, 0); } 75% { transform: translate(600%, -30px); } 100% { transform: translate(820%, 0); opacity: 1; } }
/* Vẽ trên cát */
.sand-drawing { position: absolute; left: 10%; top: 86%; width: 38%; opacity: 0; transition: opacity 0.8s ease; }
.sand-drawing.show { opacity: 1; }
/* Bia chữ trên tháp (phủ lên ký tự trang trí của ảnh) */
.tower-plaque {
  position: absolute; left: 57.5%; top: 11.5%; width: 15.5%; min-height: 32%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2%;
  padding: 6% 2%;
  background: linear-gradient(180deg, #b8b39a, #8f8a72);
  border-radius: 10px; box-shadow: inset 0 0 0 3px rgba(60, 70, 40, 0.5), inset 0 -8px 0 rgba(0, 0, 0, 0.2), 0 6px 10px rgba(0, 0, 0, 0.3);
  background-image: radial-gradient(circle at 20% 30%, rgba(90, 140, 60, 0.55) 0 10%, transparent 30%), radial-gradient(circle at 80% 70%, rgba(90, 140, 60, 0.5) 0 12%, transparent 32%), linear-gradient(180deg, #b8b39a, #8f8a72);
}
.tower-plaque span { font-family: var(--font-display); font-weight: 700; font-size: clamp(16px, 3.6vmin, 30px); line-height: 1.05; color: #3f4b2e; text-shadow: 0 1px 0 #d7d3bb, 0 -1px 0 #2a301c; }
.tower-plaque.glow span { color: #ffd23f; text-shadow: 0 0 10px rgba(255, 210, 63, 0.9); animation: glow 1.2s ease-in-out infinite alternate; }
.tower-glow { position: absolute; left: 65%; top: 28%; width: 30%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 220, 100, 0.6), rgba(255, 220, 100, 0) 65%); animation: glow 1.4s ease-in-out infinite alternate; }

/* ---------- Nhân vật (sprite ảnh) ---------- */
.actors { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.actor {
  position: absolute;
  bottom: 27%;
  height: 42%;
  transform: translateX(-50%) scale(calc(var(--scale, 1) * var(--boost, 1)));
  transform-origin: 50% 100%;
  transition: left 0.6s ease, bottom 0.6s ease, opacity 0.4s ease, transform 0.6s ease;
  pointer-events: auto;
}
.actor .char-svg { height: 100%; width: auto; display: block; }
.actors.crowded .actor { height: 36%; }
.actors.crowded .actor[data-id='lisa'] { left: 17% !important; }
.actors.crowded .actor[data-id='leo'] { left: 83% !important; }
.actors.crowded .actor[data-id='pablo'] { height: 15%; left: 32% !important; }
.actor.enter { opacity: 0; transform: translateX(-50%) translateY(16px) scale(var(--scale, 1)); }
.actor.leave { opacity: 0; }
.actor.hidden { opacity: 0; }
.actor.far { bottom: 46% !important; left: 26% !important; transform: translateX(-50%) scale(0.42); }
.stage.tall-dock .actors .actor { bottom: 42%; height: 30%; }
.stage.tall-dock .actors .actor.far { bottom: 52% !important; }
.stage.tall-dock .actors .actor[data-id='pablo'] { bottom: 44%; left: 54%; height: 12%; }
.actor[data-id='pablo'] { cursor: pointer; }

.sprite { position: relative; height: 100%; aspect-ratio: 520 / 1200; transform-origin: 50% 100%; animation: breathe 3.6s ease-in-out infinite; animation-delay: var(--breath-delay, 0s); }
.actor[data-id='pablo'] .sprite { aspect-ratio: 760 / 1200; animation-duration: 2.6s; }
@keyframes breathe { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-1.5%) scaleY(1.015); } }
.pose-img { position: absolute; left: 50%; bottom: 0; height: 100%; width: auto; transform: translateX(-50%); opacity: 0; transition: opacity 0.22s ease; }
.pose-img.on { opacity: 1; }
/* hoạt hình sprite sheet (khung xếp ngang) */
.anim { position: absolute; left: 50%; bottom: 0; height: 100%; transform: translateX(-50%); background-repeat: no-repeat; background-position: 0 0; opacity: 0; transition: opacity 0.22s ease; }
.anim.on { opacity: 1; }
@keyframes sheet { from { background-position: 0 0; } to { background-position: 100% 0; } }
.actor.flip .anim { transform: translateX(-50%) scaleX(-1); }
/* quay người sang trái (sprite gốc hướng phải) */
.actor.flip .pose-img { transform: translateX(-50%) scaleX(-1); }
.actor.flip .eyes { transform: scaleX(-1); }
/* đi bộ: nhún bước */
.actor.walking .sprite { animation: walk 0.42s ease-in-out infinite; }
@keyframes walk { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-3%) rotate(1.5deg); } }
/* mí mắt chớp (chỉ tư thế stand) */
.eyes { position: absolute; inset: 0; pointer-events: none; }
.eye { position: absolute; transform: translate(-50%, -50%) scaleY(0); transform-origin: 50% 0; border-radius: 50%; animation: blink 4.6s ease-in-out infinite; animation-delay: var(--blink-delay, 0s); }
@keyframes blink { 0%, 93% { transform: translate(-50%, -50%) scaleY(0); } 96% { transform: translate(-50%, -50%) scaleY(1); } 100% { transform: translate(-50%, -50%) scaleY(0); } }
/* nói: nảy nhẹ */
.actor.talking .sprite { animation: talk 0.42s ease-in-out infinite; }
@keyframes talk { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-2.5%) scale(1.01, 0.99); } }
/* vui: nhảy lên */
.actor.jump { animation: jump 0.7s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes jump { 0% { transform: translateX(-50%) scale(var(--scale, 1)); } 35% { transform: translateX(-50%) translateY(-9%) scale(calc(var(--scale, 1) * 1.03)); } 70% { transform: translateX(-50%) translateY(0) scale(calc(var(--scale, 1) * 0.98)); } 100% { transform: translateX(-50%) scale(var(--scale, 1)); } }
/* ngạc nhiên: giật nhẹ */
.actor.shake { animation: shakeChar 0.5s ease; }
@keyframes shakeChar { 0%, 100% { transform: translateX(-50%) scale(var(--scale, 1)); } 25% { transform: translateX(-52%) rotate(-2deg) scale(var(--scale, 1)); } 50% { transform: translateX(-48%) rotate(2deg) scale(var(--scale, 1)); } 75% { transform: translateX(-51%) rotate(-1deg) scale(var(--scale, 1)); } }
.actor.bounce { animation: bounce 0.6s ease; }
@keyframes bounce { 0% { transform: translateX(-50%) scale(var(--scale, 1)); } 40% { transform: translateX(-50%) translateY(-14%) scale(var(--scale, 1)); } 100% { transform: translateX(-50%) scale(var(--scale, 1)); } }
.actor.tilt .sprite { animation: tilt 0.9s ease-in-out; }
@keyframes tilt { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-9deg); } 70% { transform: rotate(6deg); } }
.actor.target::after {
  content: ''; position: absolute; inset: -6% -14%; border-radius: 50%;
  border: 4px dashed var(--yellow); animation: ring 1.2s linear infinite; pointer-events: none;
}
.actor.target.hover::after { border-style: solid; border-color: #fff; background: rgba(255, 210, 63, 0.18); }
@keyframes ring { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ---------- Bong bóng thoại ---------- */
.bubble {
  position: absolute; z-index: 5; top: 68px; max-width: 78%;
  background: #fff; border-radius: 26px; padding: 12px 14px 12px 12px;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow);
  font-family: var(--font-display); font-weight: 600; font-size: clamp(22px, 6.4vmin, 32px); line-height: 1.15; color: var(--ink);
}
.bubble[data-side='left'] { left: 5%; }
.bubble[data-side='right'] { right: 5%; }
.bubble[data-side='center'] { left: 50%; transform: translateX(-50%); }
.bubble::after { content: ''; position: absolute; bottom: -14px; width: 26px; height: 26px; background: #fff; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.bubble[data-side='left']::after { left: 28px; }
.bubble[data-side='right']::after { right: 28px; }
.bubble[data-side='center']::after { left: calc(50% - 13px); }
.bubble.pop { animation: pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
.bubble[data-side='center'].pop { animation-name: popcenter; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes popcenter { from { transform: translateX(-50%) scale(0.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.bubble-who { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; overflow: hidden; background: #f3f3f3; }
.bubble-text { flex: 1; }
.bubble-text .w { display: inline-block; animation: wordin 0.35s ease backwards; }
@keyframes wordin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.bubble-speak { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; background: var(--sea); color: #fff; padding: 8px; box-shadow: 0 3px 0 #15779b; }
.bubble-speak:active { transform: translateY(2px); box-shadow: none; }

/* ---------- Vật thể Lisa đang cầm ---------- */
.prop {
  position: absolute; z-index: 4; left: 50%; top: 36%; transform: translate(-50%, 0);
  width: clamp(96px, 28vmin, 130px); background: #fff; border-radius: 24px; padding: 10px 10px 6px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-family: var(--font-display); font-weight: 700; font-size: 20px; cursor: pointer;
}
.prop.pop { animation: propin 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes propin { from { transform: translate(-50%, 20px) scale(0.5); opacity: 0; } to { transform: translate(-50%, 0) scale(1); opacity: 1; } }
.prop-label { color: var(--wood-d); }

/* ---------- HUD ---------- */
.hud { position: absolute; z-index: 8; top: 0; left: 0; right: 0; height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-right { display: flex; gap: 8px; }
.hud-btn { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: var(--wood-d); padding: 9px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); position: relative; }
.hud-btn:active { transform: scale(0.94); }
.hud-btn .badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.hud-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hud-title { width: 36px; height: 36px; display: block; color: #fff; }
.day-dots { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); }
.dot.done { background: var(--leaf); }
.dot.now { background: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.4); }
.planks-mini { display: flex; gap: 3px; background: rgba(0, 0, 0, 0.25); padding: 4px 6px; border-radius: 10px; }
.pm { width: 10px; height: 16px; border-radius: 3px; background: rgba(255, 255, 255, 0.35); }
.pm.on { background: var(--wood); box-shadow: inset 0 -3px 0 var(--wood-d); }
.planks-mini.big .pm { width: 18px; height: 30px; }

/* ---------- Dock (vùng tương tác dưới) ---------- */
.dock {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: 0; min-height: 26%;
  padding: 10px 14px max(14px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px;
  pointer-events: none;
}
.dock > * { pointer-events: auto; }
.btn-next {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(180deg, #ffa24d, var(--orange)); color: #fff; padding: 16px;
  box-shadow: 0 6px 0 #c75a0a, 0 12px 24px rgba(0, 0, 0, 0.25); align-self: flex-end;
  animation: nudge 1.6s ease-in-out infinite;
}
.btn-next:active { transform: translateY(4px); box-shadow: 0 2px 0 #c75a0a; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }

.tiles { display: grid; gap: 12px; width: 100%; max-width: 420px; }
.tiles.cols-2 { grid-template-columns: repeat(2, 1fr); }
.tiles.cols-3 { grid-template-columns: repeat(3, 1fr); }
.tiles.small { gap: 8px; }
.tile {
  position: relative; aspect-ratio: 1; background: #fff; border-radius: var(--radius); padding: 12%;
  box-shadow: 0 5px 0 #d9cdb3, 0 10px 20px rgba(0, 0, 0, 0.2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: transform 0.15s ease, opacity 0.3s ease, box-shadow 0.15s ease;
  font-family: var(--font-display); font-weight: 700;
}
.tiles.cols-2 .tile { max-height: 150px; }
.tile.small { padding: 6% 10%; border-radius: 16px; aspect-ratio: 1.45; }
.tile:active { transform: translateY(3px); box-shadow: 0 2px 0 #d9cdb3, 0 6px 12px rgba(0, 0, 0, 0.2); }
.tile .ico { width: 100%; height: auto; flex: 1; min-height: 0; }
.tile-label { font-size: clamp(14px, 4vmin, 20px); color: var(--wood-d); line-height: 1; }
.tile-label.reveal { animation: pop 0.3s ease; }
.tile.ok { background: #e8f8e9; box-shadow: 0 0 0 4px var(--leaf), 0 10px 20px rgba(0, 0, 0, 0.2); transform: scale(1.05); }
.tile.bad { animation: shake 0.45s ease; box-shadow: 0 0 0 4px var(--red), 0 10px 20px rgba(0, 0, 0, 0.2); }
.tile.dim { opacity: 0.3; pointer-events: none; }
.tile.hint { animation: hint 0.9s ease-in-out infinite; }
.tile.selected { box-shadow: 0 0 0 4px var(--yellow), 0 10px 20px rgba(0, 0, 0, 0.2); transform: translateY(-6px); }
.tile.ghost { position: fixed; z-index: 100; width: 96px; pointer-events: none; transform: translate(-50%, -50%) scale(1.1) rotate(-4deg); opacity: 0.95; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes hint { 0%, 100% { box-shadow: 0 5px 0 #d9cdb3, 0 0 0 0 rgba(255, 210, 63, 0.9); } 50% { box-shadow: 0 5px 0 #d9cdb3, 0 0 0 10px rgba(255, 210, 63, 0); } }
.tiles.draggable .tile { touch-action: none; cursor: grab; }

.steps { display: flex; gap: 8px; }
.step { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, 0.6); border: 2px solid #fff; }
.step.done { background: var(--leaf); }
.timer { width: 100%; max-width: 420px; height: 14px; border-radius: 7px; background: rgba(0, 0, 0, 0.35); overflow: hidden; border: 2px solid rgba(255, 255, 255, 0.6); }
.timer-fill { height: 100%; background: linear-gradient(90deg, var(--leaf), var(--yellow), var(--red)); transform-origin: left; transform: scaleX(1); }

.judge { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; max-width: 360px; }
.judge .tile { padding: 14%; }

.speak-dock { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.mic {
  position: relative; width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(180deg, #ff6b6b, var(--red)); color: #fff; padding: 24px;
  box-shadow: 0 6px 0 #a32020, 0 12px 24px rgba(0, 0, 0, 0.3); touch-action: none;
}
.mic.on { transform: scale(1.08); box-shadow: 0 2px 0 #a32020, 0 12px 24px rgba(0, 0, 0, 0.3); }
.mic-ring { position: absolute; inset: -8px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.7); opacity: 0; }
.mic.on .mic-ring { animation: micring 1s ease-out infinite; }
@keyframes micring { from { transform: scale(0.9); opacity: 0.9; } to { transform: scale(1.5); opacity: 0; } }
.speak-side { display: flex; gap: 14px; }
.btn-round { width: 54px; height: 54px; border-radius: 50%; background: #fff; color: var(--wood-d); padding: 13px; box-shadow: 0 4px 0 #d9cdb3; }
.btn-round:disabled { opacity: 0.4; }
.btn-round.primary { background: var(--orange); color: #fff; box-shadow: 0 4px 0 #c75a0a; }
.speak-status { width: 40px; height: 40px; }

.stone-read { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.stone-read .tiles.cols-2 .tile { max-height: 120px; }
.stone-tablet {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, #a9abb3, #7d7f86);
  border-radius: 18px 18px 26px 26px / 14px 14px 30px 30px; padding: 12px 18px;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 9vmin, 44px); letter-spacing: 4px;
  color: #3b3c44; text-shadow: 0 1px 0 #c9cbd2, 0 -1px 0 #4a4b52;
  box-shadow: inset 0 -6px 0 #5f6168, 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* ---------- Hiệu ứng ---------- */
.fx-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.word-toast {
  position: absolute; left: 50%; top: 20%; transform: translate(-50%, 20px); opacity: 0;
  display: flex; align-items: center; gap: 10px; background: var(--yellow); color: var(--wood-d);
  border-radius: 999px; padding: 8px 18px 8px 8px; font-family: var(--font-display); font-weight: 700; font-size: 22px;
  box-shadow: var(--shadow); transition: transform 0.4s ease, opacity 0.4s ease;
}
.word-toast .ico { width: 40px; height: 40px; }
.word-toast.go { opacity: 1; transform: translate(-50%, 0); }
.float-icon { position: absolute; width: 72px; height: 72px; transform: translate(-50%, -20%); opacity: 0; transition: transform 1s ease, opacity 0.9s ease; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.3)); }
.float-icon.go { opacity: 1; transform: translate(-50%, -110%); }
.float-icon.fade.go { opacity: 0.2; }
.flash { position: absolute; inset: 0; }
.flash.gust { background: repeating-linear-gradient(100deg, transparent 0 40px, rgba(255, 255, 255, 0.35) 40px 46px); animation: gust 1.2s ease-out forwards; }
@keyframes gust { from { transform: translateX(-120%); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }
.flash.splash { background: radial-gradient(ellipse at 50% 100%, rgba(31, 167, 214, 0.9), rgba(31, 167, 214, 0) 70%); animation: splash 1.3s ease-out forwards; }
@keyframes splash { 0% { transform: translateY(60%); opacity: 1; } 60% { transform: translateY(-10%); opacity: 0.9; } 100% { transform: translateY(-30%); opacity: 0; } }
.blackout { position: absolute; inset: 0; background: #06121e; transition: opacity 1.3s ease; }
.blackout.open { opacity: 0; }
.plank-fly { position: absolute; left: 50%; top: 45%; width: 90px; height: 90px; transform: translate(-50%, -50%) scale(1.3); transition: transform 0.9s cubic-bezier(0.4, 0, 0.6, 1), opacity 0.9s; }
.plank-fly.go { transform: translate(140%, 200%) scale(0.3) rotate(40deg); opacity: 0.3; }
.confetti { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 2px; animation: fall 2s linear forwards; }
@keyframes fall { from { transform: translateY(0) rotate(0); opacity: 1; } to { transform: translateY(110vh) rotate(720deg); opacity: 0.6; } }
/* Sao / lá bay ra từ nhân vật */
.particle { position: absolute; width: 14px; height: 14px; animation: burst 1.1s ease-out forwards; }
.particle.star { background: var(--yellow); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.particle.leaf { background: var(--leaf); border-radius: 0 60% 0 60%; }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(0.4) rotate(0); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); opacity: 0; } }
/* Lá rơi khi chuyển cảnh */
.leaf-fall { position: absolute; top: -30px; width: 16px; height: 16px; background: var(--leaf-d); border-radius: 0 70% 0 70%; opacity: 0.9; animation: leaffall linear forwards; }
@keyframes leaffall { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(var(--sway), 28vh) rotate(90deg); } 50% { transform: translate(0, 55vh) rotate(180deg); } 75% { transform: translate(var(--sway), 82vh) rotate(270deg); } 100% { transform: translate(0, 110vh) rotate(360deg); opacity: 0.2; } }

/* ---------- Overlay cuối ngày ---------- */
.overlay { position: absolute; inset: 0; z-index: 20; background: rgba(10, 25, 50, 0.72); display: flex; align-items: center; justify-content: center; padding: 20px; }
.dayend { width: 100%; max-width: 420px; background: var(--paper); border-radius: 30px; padding: 22px 18px; display: flex; flex-direction: column; align-items: center; gap: 14px; box-shadow: var(--shadow); animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); max-height: 90%; overflow: auto; }
.dayend-stars { display: flex; gap: 4px; color: var(--yellow); }
.dayend-stars .ico { width: 44px; height: 44px; filter: drop-shadow(0 2px 0 #d9a21b); }
.dayend-stars .ico:nth-child(2) { width: 56px; height: 56px; margin-top: -8px; }
.dayend-boat { display: flex; align-items: center; gap: 12px; }
.dayend-boat .ico { width: 80px; height: 80px; }
.dayend-streak { display: flex; gap: 4px; }
.dayend-streak .ico { width: 28px; height: 28px; }
.dayend-words { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.wordcard { position: relative; background: #fff; border-radius: 18px; padding: 10px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--wood-d); box-shadow: 0 4px 0 #e7dcc3; }
.wordcard .ico { width: 54px; height: 54px; }
.wordcard.bounce { animation: cardbounce 0.5s ease; }
@keyframes cardbounce { 50% { transform: translateY(-6px) scale(1.05); } }
.wordcard .box { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: #ddd; }
.box-2 { background: #90caf9 !important; } .box-3 { background: #ffd23f !important; } .box-4 { background: #ff9f1a !important; } .box-5 { background: var(--leaf) !important; }
.btn-big { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 84px; height: 72px; padding: 0 22px; border-radius: 999px; background: linear-gradient(180deg, #ffa24d, var(--orange)); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 24px; box-shadow: 0 7px 0 #c75a0a, 0 14px 28px rgba(0, 0, 0, 0.3); }
.btn-big .ico { width: 36px; height: 36px; }
.btn-big:active { transform: translateY(5px); box-shadow: 0 2px 0 #c75a0a; }
.btn-big.wide { width: 100%; }

/* ---------- Màn hình mở đầu ---------- */
.title-actors { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.title-actors .actor { bottom: 24%; }
.title-bubble { position: absolute; top: 40%; width: 64px; height: 64px; background: #fff; border-radius: 50% 50% 50% 8px; padding: 12px; box-shadow: var(--shadow); font-family: var(--font-display); font-weight: 700; font-size: 38px; display: flex; align-items: center; justify-content: center; color: var(--ink); animation: floaty 3s ease-in-out infinite; }
.title-bubble.left { left: 32%; }
.title-bubble.right { right: 6%; border-radius: 50% 50% 8px 50%; animation-delay: -1.5s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.title-top { position: absolute; z-index: 3; top: 6%; left: 0; right: 0; text-align: center; padding: 0 20px; }
.logo { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(44px, calc(min(100vw, 100dvh * 0.58) * 0.185), 96px); line-height: 1; letter-spacing: -0.01em; display: flex; justify-content: center; }
.logo span {
  display: inline-block;
  background: linear-gradient(180deg, #ffd27a 0%, #f2a24a 45%, #b8641e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2px #5a2d0c;
  filter: drop-shadow(0 5px 0 #5a2d0c) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35));
  animation: logoIn 0.8s cubic-bezier(0.2, 1.4, 0.4, 1) backwards;
}
.logo span:nth-child(odd) { transform: rotate(-4deg) translateY(2px); }
.logo span:nth-child(even) { transform: rotate(3deg) translateY(-3px); }
.logo span:nth-child(n) { animation-delay: calc(var(--i, 0) * 0.06s); }
.logo span:nth-child(2) { --i: 1; } .logo span:nth-child(3) { --i: 2; } .logo span:nth-child(4) { --i: 3; } .logo span:nth-child(5) { --i: 4; } .logo span:nth-child(6) { --i: 5; } .logo span:nth-child(7) { --i: 6; } .logo span:nth-child(8) { --i: 7; }
@keyframes logoIn { from { opacity: 0; transform: translateY(-40px) scale(0.6); } }
.tagline { margin: 14px auto 0; max-width: 300px; color: #fff; font-weight: 800; font-size: 16px; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.title-bottom { position: absolute; z-index: 3; bottom: 5%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.btn-big.play { width: 96px; height: 96px; padding: 0; border-radius: 50%; animation: pulse 1.8s ease-in-out infinite; }
.btn-big.play .ico { width: 48px; height: 48px; margin-left: 6px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 7px 0 #c75a0a, 0 0 0 0 rgba(255, 122, 26, 0.6); } 50% { box-shadow: 0 7px 0 #c75a0a, 0 0 0 18px rgba(255, 122, 26, 0); } }
.ui-lang { display: flex; gap: 6px; background: rgba(0, 0, 0, 0.3); padding: 4px; border-radius: 999px; }
.ui-lang button { color: #fff; font-weight: 800; font-size: 13px; padding: 6px 12px; border-radius: 999px; opacity: 0.7; }
.ui-lang button.on { background: #fff; color: var(--wood-d); opacity: 1; }

/* ---------- Bảng (setup / settings / notebook) ---------- */
.panel-stage { display: flex; flex-direction: column; }
.panel {
  position: relative; z-index: 2;
  margin: auto 16px; width: calc(100% - 32px); max-height: calc(100% - 90px);
  overflow: auto; background: var(--paper); border-radius: 30px; padding: 22px 20px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow);
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.panel-stage .hud + .panel { margin-top: 70px; }
.panel h2 { margin: 0; font-family: var(--font-display); font-size: 24px; color: var(--wood-d); text-align: center; }
.panel-lisa { height: 132px; margin: -4px auto -6px; }
.panel-lisa img { height: 100%; width: auto; animation: loadbob 3s ease-in-out infinite; }
.lang-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lang-card { position: relative; background: #fff; border-radius: 22px; padding: 18px 12px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: 0 5px 0 #e7dcc3; border: 3px solid transparent; transition: transform 0.15s; }
.lang-card.on { border-color: var(--leaf); background: #f1fbf1; }
.lang-card:active { transform: translateY(3px); }
.lang-name { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--ink); }
.lang-sample { font-family: var(--font-display); font-size: 18px; color: var(--sea); }
.lang-hear { width: 34px; height: 34px; border-radius: 50%; background: var(--sea); color: #fff; padding: 7px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 14px; color: #6b5a44; }
.field input { font: 700 20px var(--font-display); padding: 12px 14px; border-radius: 16px; border: 3px solid #e7dcc3; background: #fff; color: var(--ink); outline: none; }
.field input:focus { border-color: var(--sea); }
.privacy { margin: 0; font-size: 12px; color: #8a7a62; text-align: center; }
.note { margin: 4px 0 0; font-size: 13px; color: #8a4b2a; background: #fff2e4; padding: 8px 10px; border-radius: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; font-size: 15px; }
.row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.row.toggle input { position: absolute; opacity: 0; }
.row.toggle i { width: 54px; height: 32px; border-radius: 16px; background: #ccc; position: relative; transition: background 0.2s; flex: 0 0 54px; }
.row.toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left 0.2s; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
.row.toggle input:checked + i { background: var(--leaf); }
.row.toggle input:checked + i::after { left: 25px; }
.radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 13px; line-height: 1.35; color: #4a3d2e; }
.radio input { margin-top: 3px; accent-color: var(--leaf); }
.radio.disabled { opacity: 0.5; }
.btn-small { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; background: #fff; color: var(--wood-d); font-weight: 800; font-size: 14px; box-shadow: 0 4px 0 #e7dcc3; align-self: flex-start; }
.btn-small .ico { width: 22px; height: 22px; }
.btn-small:active { transform: translateY(3px); box-shadow: none; }
.btn-small.danger { color: var(--red); }
.btn-small.armed { background: var(--red); color: #fff; box-shadow: 0 4px 0 #a32020; }

/* Sổ từ */
.notebook { position: relative; z-index: 2; margin: 70px 12px 12px; max-height: calc(100% - 82px); overflow: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; }
.nb-day { background: var(--paper); border-radius: 24px; padding: 14px; box-shadow: var(--shadow); }
.nb-day h3 { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 20px; color: var(--wood-d); }
.nb-day h3 .ico { width: 30px; height: 30px; }
.nb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.nb-empty { height: 220px; display: flex; justify-content: center; }
.nb-empty img { height: 100%; width: auto; }

/* ---------- Trang mở đầu (thiết kế mới) ---------- */
.title-vignette { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(120% 80% at 50% 30%, transparent 55%, rgba(5, 25, 45, 0.45)), linear-gradient(180deg, rgba(5, 25, 45, 0.35) 0%, transparent 22%, transparent 58%, rgba(4, 22, 40, 0.75) 100%); }
.title-actors .actor { bottom: 31%; height: 36%; }
.title-bubble { top: 38%; }
.title-topbar { position: absolute; z-index: 4; top: max(10px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.profile-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(6, 30, 50, 0.72); border: 1px solid rgba(255, 255, 255, 0.18); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.profile-chip .avatar { width: 34px; height: 34px; border-radius: 50%; background: #fff; overflow: hidden; flex: none; }
.profile-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.profile-text b { font-family: var(--font-display); font-size: 15px; }
.profile-text small { font-size: 11px; opacity: 0.85; display: flex; align-items: center; gap: 4px; }
.profile-text small .ico { width: 14px; height: 14px; }
.title-icons { display: flex; gap: 8px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; padding: 9px; background: rgba(6, 30, 50, 0.72); border: 1px solid rgba(255, 255, 255, 0.18); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.icon-btn:active { transform: scale(0.94); }
.title-top { top: 11%; }
.logo-vine { width: min(78%, 320px); height: auto; margin: -6px auto 0; display: block; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }
.title-stage .tagline { margin-top: 6px; font-size: 15px; max-width: 320px; }
.title-panel {
  position: absolute; z-index: 5; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
  padding: 12px 12px 10px; border-radius: 28px;
  background: linear-gradient(180deg, rgba(8, 40, 64, 0.86), rgba(5, 26, 44, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex; flex-direction: column; gap: 10px; color: #fff;
}
.chapter-card { background: rgba(255, 255, 255, 0.08); border-radius: 18px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.chapter-head { display: flex; align-items: center; gap: 10px; }
.chapter-badge { width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(180deg, #ffd96b, #f0a93a); color: #5a2d0c; padding: 7px; flex: none; box-shadow: 0 3px 0 #b8641e; }
.chapter-text { flex: 1; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.chapter-text b { font-family: var(--font-display); font-size: 16px; }
.chapter-text small { font-size: 12px; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.2); color: #fff; font-weight: 800; font-size: 13px; }
.lang-chip .ico { width: 16px; height: 16px; }
.planks-row { display: flex; gap: 6px; }
.planks-row .plank { flex: 1; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.18); }
.planks-row .plank.on { background: linear-gradient(90deg, #ffd96b, #f0a93a); box-shadow: 0 0 10px rgba(255, 210, 63, 0.5); }
.btn-cta {
  display: flex; align-items: center; justify-content: center; gap: 12px; height: 64px; border-radius: 999px;
  background: linear-gradient(180deg, #ffb13d, #ff7a1a); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: 0.01em;
  box-shadow: 0 6px 0 #c75a0a, 0 14px 28px rgba(255, 122, 26, 0.35); animation: pulse 2s ease-in-out infinite;
}
.btn-cta:active { transform: translateY(4px); box-shadow: 0 2px 0 #c75a0a; }
.btn-cta .cta-icon { width: 34px; height: 34px; }
.title-actions { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px; }
.title-actions::-webkit-scrollbar { display: none; }
.mini-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.16); color: #fff; font-weight: 800; font-size: 13px; }
.mini-btn .ico { width: 18px; height: 18px; }
.mini-btn.gold { background: linear-gradient(180deg, #ffd96b, #f0a93a); color: #5a2d0c; border-color: transparent; }
.mini-btn:active { transform: scale(0.96); }
.title-panel .ui-lang { align-self: center; background: rgba(0, 0, 0, 0.25); }
.title-bottom { display: none; }
/* modal */
.modal { position: absolute; inset: 0; z-index: 30; background: rgba(4, 22, 40, 0.7); display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal-card { width: 100%; max-width: 400px; background: var(--paper); border-radius: 26px; padding: 20px 18px 16px; display: flex; flex-direction: column; gap: 12px; align-items: center; box-shadow: var(--shadow); animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); max-height: 88%; overflow: auto; }
.modal-card h3 { margin: 0; font-family: var(--font-display); font-size: 22px; color: var(--wood-d); }
.about-p { margin: 0; font-size: 14px; line-height: 1.5; color: #4a3d2e; text-align: center; }
.about-small { margin: 0; font-size: 12px; color: #8a7a62; text-align: center; }
.howto { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.how { background: #fff; border-radius: 16px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12.5px; line-height: 1.3; color: #4a3d2e; box-shadow: 0 4px 0 #e7dcc3; }
.how img { height: 90px; width: auto; }
.how .how-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--red); color: #fff; padding: 14px; }
.how .how-icon.pablo { background: #fff; padding: 4px; box-shadow: 0 0 0 3px #ffd23f; }
.modal-close { width: 56px; height: 56px; }
/* màn hình chờ */
.loading { background: #0b2a3f url('/assets/bg/bg_beach.webp') center/cover; }
.loading::before { content: ''; position: absolute; inset: 0; background: rgba(5, 26, 44, 0.62); }
.loading-card { position: relative; }
.loading-logo { font-family: var(--font-display); font-weight: 700; font-size: 34px; color: #ffd96b; letter-spacing: 0.06em; text-shadow: 0 3px 0 #5a2d0c, 0 8px 20px rgba(0, 0, 0, 0.5); }
.loading-bar { width: 180px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.loading-bar i { display: block; height: 100%; width: 40%; border-radius: 4px; background: linear-gradient(90deg, #ffd96b, #ff7a1a); animation: loadbar 1.2s ease-in-out infinite; }
@keyframes loadbar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }


/* ---------- Bản đồ hành trình (thiết kế mới) ---------- */
.map-stage { background: #06202f; }
.map-scroll { position: absolute; inset: 0; z-index: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.map-scroll::-webkit-scrollbar { display: none; }
.map-track { position: relative; width: 100%; }
.map-sec { position: relative; height: 64dvh; overflow: hidden; }
.map-sec + .map-sec { margin-top: -18dvh; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18dvh); mask-image: linear-gradient(180deg, transparent 0, #000 18dvh); }
.sec-bg { position: absolute; inset: -14% 0; background-position: center 40%; background-size: cover; will-change: transform; }
.sec-tint { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 22, 40, 0.1), rgba(4, 22, 40, 0.28)); }
.map-sec.time-evening .sec-tint { background: linear-gradient(180deg, rgba(120, 60, 160, 0.2), rgba(255, 120, 60, 0.18)); }
.map-sec.time-night .sec-tint { background: linear-gradient(180deg, rgba(8, 18, 60, 0.3), rgba(10, 25, 70, 0.4)); }
.map-sec.locked .sec-bg { filter: saturate(0.55) brightness(0.72); }
.map-sec.locked .sec-tint { background: linear-gradient(180deg, rgba(10, 20, 40, 0.35), rgba(10, 20, 40, 0.55)); }
.sec-fx { position: absolute; inset: 0; pointer-events: none; }
.sec-fx .campfire { left: 48%; top: 80%; width: 18%; }
.sec-fx .rabbit, .sec-fx .tower-plaque, .sec-fx .sand-drawing, .sec-fx .tide { display: none; }
.sec-fx .night-sky { position: absolute; inset: 0; }
.map-shade { position: absolute; left: 0; right: 0; z-index: 3; pointer-events: none; height: 26%; }
.map-shade.top { top: 0; background: linear-gradient(180deg, rgba(4, 22, 40, 0.75), transparent); height: 18%; }
.map-shade.bottom { bottom: 0; background: linear-gradient(0deg, rgba(4, 22, 40, 0.9) 0%, rgba(4, 22, 40, 0.5) 55%, transparent); height: 34%; }

/* đường mòn */
.trail { position: absolute; left: 0; top: 0; width: 100%; z-index: 1; pointer-events: none; overflow: visible; }
.trail path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.trail-shadow { stroke: rgba(0, 0, 0, 0.35); stroke-width: 18; filter: blur(4px); }
.trail-ahead { stroke: rgba(255, 248, 230, 0.55); stroke-width: 6; stroke-dasharray: 2 16; animation: trailflow 1.6s linear infinite; }
.trail-walked { stroke: #ffe6a8; stroke-width: 11; opacity: 0.95; }
.trail-steps { stroke: #b07a3a; stroke-width: 5; stroke-dasharray: 0.1 18; opacity: 0.8; }
@keyframes trailflow { to { stroke-dashoffset: -18; } }

/* huy hiệu chặng */
.stops { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.stop { position: absolute; transform: translate(-50%, -50%); width: 96px; height: 96px; pointer-events: auto; transition: transform 0.2s; }
.stop:active { transform: translate(-50%, -50%) scale(0.94); }
.stop.bump { animation: stopbump 0.5s ease; }
@keyframes stopbump { 30% { transform: translate(-50%, -50%) scale(1.12); } 100% { transform: translate(-50%, -50%) scale(1); } }
.stop-glow { position: absolute; inset: -22%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 220, 110, 0.75), rgba(255, 200, 80, 0) 65%); opacity: 0; }
.stop.now .stop-glow { opacity: 1; animation: stopglow 1.8s ease-in-out infinite; }
@keyframes stopglow { 0%, 100% { transform: scale(0.9); opacity: 0.7; } 50% { transform: scale(1.15); opacity: 1; } }
.stop-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff9ea, #f1dfb8 70%);
  box-shadow: 0 0 0 5px #c98a3c, 0 0 0 8px #7a4a1c, 0 10px 0 #5a3410, 0 18px 30px rgba(0, 0, 0, 0.45), inset 0 -6px 0 rgba(0, 0, 0, 0.08);
  display: flex; align-items: center; justify-content: center;
}
.stop-face { width: 58%; height: 58%; display: block; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.25)); }
.stop.done .stop-ring { background: radial-gradient(circle at 35% 30%, #fff6cf, #ffd36b 70%); box-shadow: 0 0 0 5px #f0a93a, 0 0 0 8px #9a5b14, 0 10px 0 #6b3d0a, 0 18px 30px rgba(0, 0, 0, 0.45), 0 0 26px rgba(255, 210, 90, 0.5); }
.stop.locked .stop-ring { background: radial-gradient(circle at 35% 30%, #d7d9dd, #9fa3aa 70%); box-shadow: 0 0 0 5px #6f7378, 0 0 0 8px #44474c, 0 10px 0 #2d2f33, 0 18px 30px rgba(0, 0, 0, 0.45); }
.stop.locked .stop-face { filter: grayscale(1) brightness(0.85); opacity: 0.8; }
.stop.pulse .stop-ring { animation: stopfloat 2.4s ease-in-out infinite; }
@keyframes stopfloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.stop-num { position: absolute; top: -10px; left: -6px; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(180deg, #7a4a1c, #4a2a0c); color: #ffe6a8; font-family: var(--font-display); font-weight: 700; font-size: 18px; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 #2d1706, 0 6px 12px rgba(0, 0, 0, 0.35); border: 2px solid #ffd36b; }
.stop-flag { position: absolute; right: -8px; bottom: -4px; width: 36px; height: 36px; border-radius: 50%; padding: 7px; color: #fff; background: #777; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3), 0 6px 12px rgba(0, 0, 0, 0.35); border: 2px solid #fff; }
.stop.done .stop-flag { background: var(--leaf); }
.stop.now .stop-flag { background: var(--orange); animation: flagpop 1.2s ease-in-out infinite; }
@keyframes flagpop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.stars { display: inline-flex; gap: 2px; }
.stars i { width: 20px; height: 20px; display: block; color: #c9c9c9; filter: grayscale(1) opacity(0.6); }
.stars i.on { color: #ffd23f; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); animation: starpop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) backwards; }
.stars i:nth-child(2) { animation-delay: 0.12s; } .stars i:nth-child(3) { animation-delay: 0.24s; }
@keyframes starpop { from { transform: scale(0); } to { transform: scale(1); } }
.stop .stars { position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); background: rgba(4, 22, 40, 0.55); padding: 3px 6px; border-radius: 999px; }
.stop .stars i { width: 16px; height: 16px; }

/* nhân vật trên bản đồ */
.map-actors { position: absolute; z-index: 2; width: 0; height: 0; pointer-events: none; }
.map-actors .actor { position: absolute; bottom: 0; height: 19dvh; transform: translateX(-50%); }
.map-actors .actor[data-id='lisa'] { left: 0; }
.map-actors .actor[data-id='leo'] { left: 58px; height: 17.5dvh; }
.map-actors .actor[data-id='pablo'] { left: 40px; height: 7dvh; bottom: 9dvh; }
.map-actors.flip .actor[data-id='leo'] { left: -58px; }
.map-actors.flip .actor[data-id='pablo'] { left: -40px; }
.map-actors.flip .actor .sprite { transform: scaleX(-1); }
.map-actors .actor .sprite { height: 100%; }
.pablo-fly { position: absolute; z-index: 3; top: 20%; left: -30%; height: 9dvh; pointer-events: none; animation: pablofly 16s linear infinite; animation-delay: 3s; }
.pablo-fly .sprite { height: 100%; animation: pablobob 0.8s ease-in-out infinite alternate; }
@keyframes pablofly { 0% { transform: translate(0, 0); } 10% { transform: translate(40vw, -20px); } 20% { transform: translate(80vw, 10px); } 30% { transform: translate(130vw, -14px); } 30.01%, 100% { transform: translate(130vw, -14px); } }
@keyframes pablobob { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-6px) rotate(3deg); } }

/* thanh trên */
.map-top { z-index: 6; }
.boat-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(6, 30, 50, 0.72); border: 1px solid rgba(255, 255, 255, 0.18); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.boat-ico { width: 26px; height: 26px; display: block; }
.planks-row.small { gap: 3px; }
.planks-row.small .plank { width: 9px; height: 16px; }
.icon-btn .badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid #072a44; }
.icon-btn { position: relative; }

/* khối dưới: thống kê + nút chơi */
.map-dock { position: absolute; z-index: 6; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; border-radius: 18px; background: rgba(8, 40, 64, 0.86); border: 1px solid rgba(255, 255, 255, 0.16); color: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); font-family: var(--font-display); }
.stat b { font-size: 18px; line-height: 1; }
.stat small { font-size: 10px; font-weight: 700; opacity: 0.8; font-family: var(--font-body, inherit); letter-spacing: 0.02em; }
.stat-ico { width: 26px; height: 26px; display: block; }
.stat-ico.shell { color: #ffd23f; }
.stat-ring { width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(#ffd23f calc(var(--p, 0) * 1%), rgba(255, 255, 255, 0.15) 0); display: flex; align-items: center; justify-content: center; margin: -2px 0 -4px; }
.stat-ring i { width: 30px; height: 30px; border-radius: 50%; background: #0b3350; font-style: normal; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.stat.review { cursor: pointer; }
.stat.review:disabled { opacity: 0.5; }
.stat.review.hot { background: linear-gradient(180deg, #ffd96b, #f0a93a); color: #5a2d0c; border-color: transparent; }
.stat.review.hot .stat-ico { animation: spin 3s linear infinite; }
.stat.review.hot small { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-cta.map-cta { position: relative; }
.btn-cta .cta-sub { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; opacity: 0.9; }
.btn-cta.small { padding: 10px 18px; font-size: 20px; }
.btn-cta.small .cta-icon { width: 26px; height: 26px; }
.mini-btn.big { padding: 10px 14px; font-size: 14px; background: rgba(90, 45, 12, 0.08); border-color: rgba(90, 45, 12, 0.15); color: var(--wood-d); }
.mini-btn.big .ico { width: 20px; height: 20px; }

/* thẻ chặng (trượt từ dưới) */
.modal.sheet { align-items: flex-end; padding: 0; }
.sheet-card { width: 100%; max-width: 480px; margin: 0 auto; background: var(--paper); border-radius: 28px 28px 0 0; padding: 0 0 max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4); animation: sheetup 0.4s cubic-bezier(0.2, 1.2, 0.4, 1); max-height: 86%; overflow: auto; }
@keyframes sheetup { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.dc-hero { position: relative; height: 150px; border-radius: 28px 28px 0 0; background-size: cover; background-position: center 35%; display: flex; align-items: flex-end; gap: 10px; padding: 12px; color: #fff; overflow: hidden; }
.dc-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 22, 40, 0.1), rgba(4, 22, 40, 0.75)); }
.dc-hero.time-night::before { background: linear-gradient(180deg, rgba(8, 18, 60, 0.3), rgba(4, 22, 40, 0.85)); }
.dc-hero > * { position: relative; }
.dc-badge { width: 56px; height: 56px; border-radius: 18px; background: radial-gradient(circle at 35% 30%, #fff9ea, #f1dfb8 70%); padding: 9px; box-shadow: 0 0 0 3px #c98a3c, 0 6px 0 #5a3410, 0 10px 18px rgba(0, 0, 0, 0.4); flex: none; }
.dc-title { flex: 1; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.dc-title b { font-family: var(--font-display); font-size: 22px; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); }
.dc-title small { font-size: 12px; font-weight: 700; opacity: 0.95; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.dc-trial { width: 20px; height: 20px; display: inline-block; vertical-align: middle; background: rgba(255, 255, 255, 0.2); border-radius: 6px; padding: 2px; }
.dc-state { width: 40px; height: 40px; border-radius: 50%; padding: 8px; background: rgba(255, 255, 255, 0.25); }
.dc-state.now { background: var(--orange); }
.dc-hero .stars i { width: 24px; height: 24px; }
.dc-words { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px; justify-content: center; }
.wchip { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; border-radius: 16px; background: #fff; box-shadow: 0 3px 0 #e7dcc3; font-family: var(--font-display); font-weight: 700; font-size: 11px; color: var(--wood-d); position: relative; animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) backwards; }
.wchip:nth-child(2) { animation-delay: 0.04s; } .wchip:nth-child(3) { animation-delay: 0.08s; } .wchip:nth-child(4) { animation-delay: 0.12s; } .wchip:nth-child(5) { animation-delay: 0.16s; } .wchip:nth-child(6) { animation-delay: 0.2s; } .wchip:nth-child(7) { animation-delay: 0.24s; } .wchip:nth-child(8) { animation-delay: 0.28s; } .wchip:nth-child(9) { animation-delay: 0.32s; } .wchip:nth-child(10) { animation-delay: 0.36s; }
.wchip .ico { width: 38px; height: 38px; }
.wchip small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wchip.mystery .ico { filter: brightness(0) opacity(0.25); }
.wchip.mystery small { color: #b5a98f; }
.wchip.known::after { content: ''; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #ddd; }
.wchip.box-2::after { background: #90caf9; } .wchip.box-3::after { background: #ffd23f; } .wchip.box-4::after { background: #ff9f1a; } .wchip.box-5::after { background: var(--leaf); }
.dc-hint { margin: 0; padding: 0 16px; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 13px; color: #6d5a44; }
.dc-hint .ico { width: 20px; height: 20px; }
.dc-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px; justify-content: center; align-items: center; }
.dc-actions .btn-cta { flex: 1 1 100%; }
.boat-sheet { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 16px 6px; }
.boat-big { width: 110px; height: 110px; display: block; animation: loadbob 3s ease-in-out infinite; }
.map-stage .title-topbar { position: absolute; }


/* ---------- Thẻ, biểu tượng, avatar, chấm cảnh (làm mới) ---------- */
img.ico-img { filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.22)); }
.tile {
  background: linear-gradient(180deg, #fffdf8 0%, #f8efdc 100%);
  border: 2px solid #efe3c8;
  box-shadow: 0 6px 0 #d5bd91, 0 12px 22px rgba(0, 0, 0, 0.22), inset 0 2px 0 #fff;
  overflow: hidden;
}
.tile::before { content: ''; position: absolute; left: -40%; top: -60%; width: 60%; height: 220%; background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0) 100%); transform: rotate(12deg); pointer-events: none; opacity: 0; }
.tile.ok::before { animation: shine 0.9s ease-out; }
@keyframes shine { from { left: -60%; opacity: 1; } to { left: 120%; opacity: 0; } }
.tile .ico { filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.18)); transition: transform 0.2s; }
.tiles .tile { animation: tilein 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) backwards; }
.tiles .tile:nth-child(2) { animation-delay: 0.06s; } .tiles .tile:nth-child(3) { animation-delay: 0.12s; } .tiles .tile:nth-child(4) { animation-delay: 0.18s; } .tiles .tile:nth-child(5) { animation-delay: 0.24s; } .tiles .tile:nth-child(6) { animation-delay: 0.3s; }
@keyframes tilein { from { transform: translateY(26px) scale(0.8); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.tiles .tile .ico { animation: icofloat 3.2s ease-in-out infinite; }
.tiles .tile:nth-child(2n) .ico { animation-delay: -1.1s; } .tiles .tile:nth-child(3n) .ico { animation-delay: -2.2s; }
@keyframes icofloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.tile.ok { background: linear-gradient(180deg, #f1fbf1, #dff3e0); box-shadow: 0 0 0 4px var(--leaf), 0 0 24px rgba(76, 175, 80, 0.55), 0 10px 20px rgba(0, 0, 0, 0.2); transform: scale(1.06); }
.tile.ok .ico { animation: okbounce 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes okbounce { 30% { transform: scale(1.25) rotate(-6deg); } 60% { transform: scale(0.95) rotate(3deg); } 100% { transform: scale(1); } }
.tile.bad { background: linear-gradient(180deg, #fff3f2, #fde3e1); }
.tile.nudge { animation: nudgepulse 1.1s ease-in-out infinite; }
@keyframes nudgepulse { 0%, 100% { transform: translateY(0); box-shadow: 0 6px 0 #d5bd91, 0 12px 22px rgba(0, 0, 0, 0.22); } 50% { transform: translateY(-5px); box-shadow: 0 10px 0 #d5bd91, 0 0 0 6px rgba(255, 210, 63, 0.45), 0 16px 26px rgba(0, 0, 0, 0.25); } }
.tile.coach-target { box-shadow: 0 6px 0 #d5bd91, 0 0 0 5px var(--yellow), 0 0 28px rgba(255, 210, 63, 0.8); }
.tile-label { text-shadow: 0 1px 0 #fff; }
/* chấm cảnh: quả cầu kính */
.hotspots .tile.hotspot { background: radial-gradient(circle at 35% 28%, #ffffff 0%, #f1f8ff 55%, #d6e9f8 100%); border: 3px solid rgba(255, 255, 255, 0.95); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.35), 0 0 22px rgba(255, 255, 255, 0.5), 0 12px 22px rgba(0, 0, 0, 0.3), inset 0 -6px 10px rgba(80, 140, 200, 0.18); overflow: visible; }
.hotspots .tile.hotspot .ico { animation: icofloat 2.6s ease-in-out infinite; }
.hotspots .tile.hotspot.ok { background: radial-gradient(circle at 35% 28%, #ffffff, #dff3e0 70%); }
.hotspots .tile.hotspot.coach-target { box-shadow: 0 0 0 5px var(--yellow), 0 0 30px rgba(255, 210, 63, 0.9), 0 12px 22px rgba(0, 0, 0, 0.3); }
/* avatar trong bong bóng, thẻ tên */
.bubble-who { background: radial-gradient(circle at 35% 30%, #fff, #ffe9b8); box-shadow: 0 0 0 2px #ffd36b, 0 0 0 4px #c98a3c, 0 3px 6px rgba(0, 0, 0, 0.25); }
.bubble-who .ico { transform: scale(1.08); }
.bubble.pop .bubble-who { animation: avatartalk 0.55s ease-in-out 5; }
@keyframes avatartalk { 0%, 100% { transform: rotate(0) translateY(0); } 30% { transform: rotate(-5deg) translateY(-2px); } 70% { transform: rotate(4deg) translateY(-1px); } }
.profile-chip .avatar, .stop-face, .tp-marker { box-shadow: 0 0 0 2px #ffd36b, 0 0 0 4px #c98a3c; }
.tp-marker .ico { transform: scale(1.08); }
/* thẻ từ (sổ từ, cuối ngày, thẻ chặng) */
.wordcard { background: linear-gradient(180deg, #fffdf8, #f8efdc); border: 2px solid #efe3c8; box-shadow: 0 5px 0 #d5bd91, 0 8px 16px rgba(0, 0, 0, 0.12); transition: transform 0.15s; }
.wordcard:active { transform: translateY(3px); box-shadow: 0 2px 0 #d5bd91; }
.wordcard .ico { filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.18)); }
.wordcard .box { width: 12px; height: 12px; box-shadow: 0 0 0 2px #fff; }
.wchip { background: linear-gradient(180deg, #fffdf8, #f8efdc); border: 2px solid #efe3c8; }
.wchip .ico { filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.18)); }
.word-toast .ico { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2)); animation: okbounce 0.7s cubic-bezier(0.2, 1.4, 0.4, 1); }
.worldprop { background: linear-gradient(180deg, #fffdf8, #f8efdc); border: 2px solid #efe3c8; }
/* nút tiếp / nút đi */
.btn-next { position: relative; overflow: visible; background: linear-gradient(180deg, #ffb060, #ff7a1a 60%, #f06a0a); box-shadow: 0 6px 0 #c75a0a, 0 12px 24px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.45); }
.btn-next .ripple { position: absolute; inset: -6px; border-radius: 50%; border: 3px solid rgba(255, 210, 63, 0.9); animation: ring-pulse 1.4s ease-out infinite; pointer-events: none; }
.btn-next.coach-target { box-shadow: 0 6px 0 #c75a0a, 0 0 0 6px rgba(255, 210, 63, 0.6), 0 0 30px rgba(255, 210, 63, 0.9); }
.btn-walk { position: relative; width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(180deg, #fffdf8, #f3e7cf); color: var(--wood-d); box-shadow: 0 6px 0 #d5bd91, 0 12px 22px rgba(0, 0, 0, 0.25), inset 0 2px 0 #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.btn-walk .walk-ico { width: 34px; height: 34px; display: block; animation: nudge 1.6s ease-in-out infinite; }
.btn-walk .walk-feet { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 3px; }
.btn-walk .walk-feet i { width: 7px; height: 10px; border-radius: 50%; background: var(--wood); opacity: 0.6; animation: feet 0.8s ease-in-out infinite; }
.btn-walk .walk-feet i:nth-child(2) { animation-delay: -0.4s; margin-top: -4px; }
@keyframes feet { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 0.9; transform: translateY(-3px); } }
.btn-walk.on { background: linear-gradient(180deg, #6fd36f, #43a047); color: #fff; box-shadow: 0 6px 0 #2e7d32, 0 12px 22px rgba(0, 0, 0, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.4); }
.btn-walk.on .walk-ico { animation: none; }
.btn-walk.on .walk-feet i { background: #fff; }
.btn-walk.coach-target { box-shadow: 0 6px 0 #d5bd91, 0 0 0 6px rgba(255, 210, 63, 0.6), 0 0 30px rgba(255, 210, 63, 0.9); }
.btn-walk:active { transform: translateY(4px); box-shadow: 0 2px 0 #d5bd91; }
.tp-track { height: 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.3); border: 2px solid rgba(255, 255, 255, 0.55); overflow: visible; }
.tp-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 6px; background: linear-gradient(90deg, #ffe6a8, #ffd23f); box-shadow: 0 0 10px rgba(255, 210, 63, 0.6); transition: width 0.15s linear; }
.tp-dot { width: 26px; height: 26px; padding: 4px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); z-index: 1; }
.tp-dot.end { background: linear-gradient(180deg, #ffd96b, #f0a93a); }
.tp-marker { z-index: 2; width: 42px; height: 42px; }
/* tia lấp lánh khi đúng */
.spark { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #ffd23f; box-shadow: 0 0 8px 2px rgba(255, 210, 63, 0.9); transform: translate(-50%, -50%); animation: sparkfly 0.85s ease-out forwards; }
@keyframes sparkfly { 0% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2); opacity: 0; } }

/* ---------- Dải hướng dẫn (coach) ---------- */
.coach { align-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: rgba(8, 40, 64, 0.86); border: 1px solid rgba(255, 255, 255, 0.2); color: #fff; font-weight: 800; font-size: 13px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); max-width: 94%; pointer-events: none; }
.coach.pop { animation: coachin 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes coachin { from { transform: translateY(10px) scale(0.9); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.coach-g { width: 34px; height: 34px; display: block; flex: none; }
.coach-g svg { width: 100%; height: 100%; display: block; overflow: visible; }
.coach-text { line-height: 1.15; }
.g-tap .hand { transform-origin: 30px 40px; animation: gtap 1.2s ease-in-out infinite; }
@keyframes gtap { 0%, 100% { transform: translate(6px, 8px) scale(0.9); } 50% { transform: translate(0, 0) scale(0.9); } }
.g-tap .ripple { transform-origin: 26px 22px; animation: ring-pulse 1.2s ease-out infinite; }
.g-drag .hand { animation: gdrag 1.4s ease-in-out infinite; }
@keyframes gdrag { 0%, 100% { transform: translate(-6px, 6px) scale(0.85); } 50% { transform: translate(14px, 6px) scale(0.85); } }
.g-speak .ring { transform-origin: 32px 30px; animation: ring-pulse 1.1s ease-out infinite; }
.g-listen .w1 { animation: wave 1s ease-in-out infinite; } .g-listen .w2 { animation: wave 1s ease-in-out infinite 0.2s; }
@keyframes wave { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.g-walk .f1 { animation: footstep 0.9s ease-in-out infinite; } .g-walk .f2 { animation: footstep 0.9s ease-in-out infinite 0.45s; }
@keyframes footstep { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.g-judge { animation: judgewobble 1.4s ease-in-out infinite; }
@keyframes judgewobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.g-fast { animation: fastblink 0.5s ease-in-out infinite alternate; }
@keyframes fastblink { from { transform: scale(0.9); opacity: 0.7; } to { transform: scale(1.1); opacity: 1; } }
.coach-fast { background: linear-gradient(180deg, #ffd96b, #f0a93a); color: #5a2d0c; border-color: transparent; }
/* con trỏ hướng dẫn: mũi tên đỏ nhún về phía mục tiêu + bàn tay gõ */
.coach-pointer { position: absolute; z-index: 20; width: 0; height: 0; pointer-events: none; }
.coach-pointer .arrow { position: absolute; left: 0; bottom: calc(var(--ty, 30px) + 4px); width: 44px; height: 60px; transform: translateX(-50%); animation: arrowbob 0.7s ease-in-out infinite alternate; }
.coach-pointer .arrow svg { width: 100%; height: 100%; display: block; }
.coach-pointer.below .arrow { bottom: auto; top: calc(var(--ty, 30px) + 4px); transform: translateX(-50%) rotate(180deg); animation-name: arrowbob-up; }
.coach-pointer .hand { position: absolute; left: 6px; top: -4px; width: 56px; height: 56px; animation: handtap 1s ease-in-out infinite; }
.coach-pointer .hand svg { width: 100%; height: 100%; display: block; }
@keyframes arrowbob { from { transform: translateX(-50%) translateY(-10px); } to { transform: translateX(-50%) translateY(2px); } }
@keyframes arrowbob-up { from { transform: translateX(-50%) rotate(180deg) translateY(-10px); } to { transform: translateX(-50%) rotate(180deg) translateY(2px); } }
@keyframes handtap { 0%, 100% { transform: scale(1); } 50% { transform: translateY(6px) scale(0.9); } }
.stone-step.coach-target { box-shadow: 0 6px 0 #4e4f55, 0 0 0 5px var(--yellow), 0 0 26px rgba(255, 210, 63, 0.9); }
.tobj.coach-target { filter: drop-shadow(0 0 12px rgba(255, 210, 63, 0.9)); }


/* ---------- Màn hình chờ (thiết kế mới) ---------- */
.loading { background: #0b2a3f url("/assets/bg/bg_beach.webp") center 30% / cover; overflow: hidden; }
.loading::before { content: ''; position: absolute; inset: 0; background: inherit; }
.loading::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 80% at 50% 20%, rgba(255, 255, 255, 0.08), transparent 55%), linear-gradient(180deg, rgba(5, 26, 44, 0.25) 0%, rgba(5, 26, 44, 0.1) 40%, rgba(5, 26, 44, 0.75) 100%); }
.loading-card, .loading-sky, .loading-sea { z-index: 1; }
.loading-sea { display: none; }
.loading-sky { position: absolute; inset: 0; pointer-events: none; }
.lcloud { position: absolute; height: 5%; width: 26%; border-radius: 999px; background: radial-gradient(ellipse at 30% 60%, #fff 0 40%, rgba(255, 255, 255, 0) 70%), radial-gradient(ellipse at 65% 40%, #fff 0 45%, rgba(255, 255, 255, 0) 72%); opacity: 0.9; animation: lcloud linear infinite; }
.lcloud.c1 { top: 8%; left: -30%; animation-duration: 38s; }
.lcloud.c2 { top: 16%; left: -30%; width: 18%; animation-duration: 52s; animation-delay: -20s; }
.lcloud.c3 { top: 5%; left: -30%; width: 32%; animation-duration: 64s; animation-delay: -40s; opacity: 0.7; }
@keyframes lcloud { to { transform: translateX(520%); } }
.loading-sea { position: absolute; left: -10%; right: -10%; top: 58%; height: 16%; pointer-events: none; }
.loading-sea i { position: absolute; inset: 0; border-radius: 50% 50% 0 0 / 100% 100% 0 0; background: rgba(255, 255, 255, 0.22); animation: lwave 4.5s ease-in-out infinite; }
.loading-sea i:nth-child(2) { top: 20%; background: rgba(255, 255, 255, 0.14); animation-delay: -2.2s; animation-duration: 6s; }
@keyframes lwave { 0%, 100% { transform: translateX(-3%) scaleY(1); } 50% { transform: translateX(3%) scaleY(1.12); } }
.loading-card { gap: 10px; width: min(92vw, 420px); }
.loading-stage { position: relative; height: min(40vh, 340px); width: 100%; display: flex; justify-content: center; align-items: flex-end; }
.loading-shadow { position: absolute; bottom: -4px; left: 50%; width: 42%; height: 18px; border-radius: 50%; background: rgba(5, 26, 44, 0.35); transform: translateX(-50%); filter: blur(4px); animation: lshadow 3.6s ease-in-out infinite; }
@keyframes lshadow { 0%, 100% { transform: translateX(-50%) scaleX(1); } 50% { transform: translateX(-50%) scaleX(0.92); } }
.loading-lisa { position: relative; height: 100%; display: flex; align-items: flex-end; animation: none; }
.loading-lisa img { height: 100%; width: auto; display: block; animation: breathe 3.6s ease-in-out infinite; transform-origin: 50% 100%; }
.loading-lisa .sprite { height: 100%; }
.loading-pablo { position: absolute; left: 8%; top: 10%; height: 24%; animation: lpablo 7s ease-in-out infinite; }
.loading-pablo img { height: 100%; width: auto; display: block; animation: pablobob 0.7s ease-in-out infinite alternate; }
.loading-pablo .sprite { height: 100%; }
@keyframes lpablo { 0% { transform: translate(0, 0); } 25% { transform: translate(60%, -30%); } 50% { transform: translate(160%, 10%); } 75% { transform: translate(90%, 40%); } 100% { transform: translate(0, 0); } }
.loading-logo { font-size: clamp(40px, 12vw, 64px); }
.loading-tip { margin: 2px 0 0; min-height: 2.6em; color: #fff; font-weight: 800; font-size: 14px; text-align: center; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); opacity: 0; transform: translateY(6px); max-width: 320px; }
.loading-tip.in { animation: tipin 0.45s ease forwards; }
@keyframes tipin { to { opacity: 1; transform: translateY(0); } }
.loading-bar { width: 220px; height: 12px; border-radius: 6px; background: rgba(5, 26, 44, 0.35); border: 2px solid rgba(255, 255, 255, 0.7); overflow: hidden; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25); }
.loading-bar i { width: 0; animation: none; transition: width 0.35s ease; background: linear-gradient(90deg, #ffd96b, #ff7a1a); box-shadow: 0 0 10px rgba(255, 210, 63, 0.7); position: relative; }
.loading-bar i::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(100deg, transparent 0 10px, rgba(255, 255, 255, 0.35) 10px 16px); animation: lstripes 0.8s linear infinite; }
@keyframes lstripes { to { background-position: 26px 0; } }
.loading-pct { color: #fff; font-weight: 800; font-size: 12px; opacity: 0.9; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }


/* ván thuyền bằng ảnh khi có icon_plank */
.has-plank-icon .pm, .has-plank-icon .plank { background: url("/assets/icons/icon_plank.webp") center / contain no-repeat !important; box-shadow: none !important; filter: grayscale(1) brightness(0.55) opacity(0.5); border-radius: 0; }
.has-plank-icon .pm.on, .has-plank-icon .plank.on { filter: none; }
.has-plank-icon .pm { width: 14px; height: 20px; }
.has-plank-icon .planks-mini.big .pm { width: 24px; height: 36px; }
.has-plank-icon .planks-row .plank { height: 22px; flex: 1; }
.has-plank-icon .planks-row.small .plank { width: 12px; height: 18px; }
.dayend-medal { width: 110px; height: 110px; animation: pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35)); }


/* ---------- Nội dung bài học: hàng từ trên HUD, thẻ mở đầu ngày, thẻ từ mới ---------- */
.word-row { display: flex; gap: 4px; }
.wslot { width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, 0.25); border: 2px solid rgba(255, 255, 255, 0.45); display: flex; align-items: center; justify-content: center; padding: 2px; }
.wslot.on { background: #fff; border-color: #ffd23f; box-shadow: 0 0 8px rgba(255, 210, 63, 0.6); }
.wslot.pop { animation: okbounce 0.7s cubic-bezier(0.2, 1.4, 0.4, 1); }
.overlay.intro { background: rgba(10, 25, 50, 0.45); }
.day-intro { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 20px 18px; border-radius: 30px; background: linear-gradient(180deg, rgba(8, 40, 64, 0.8), rgba(5, 26, 44, 0.9)); border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); color: #fff; animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); max-width: 340px; }
.di-badge { width: 110px; height: 110px; border-radius: 30px; background: radial-gradient(circle at 35% 30%, #fff9ea, #f1dfb8 70%); padding: 14px; box-shadow: 0 0 0 4px #c98a3c, 0 8px 0 #5a3410, 0 14px 24px rgba(0, 0, 0, 0.4); animation: loadbob 3s ease-in-out infinite; }
.di-num { font-family: var(--font-display); font-size: 40px; line-height: 1; color: #ffd96b; text-shadow: 0 3px 0 #5a2d0c, 0 8px 16px rgba(0, 0, 0, 0.5); }
.di-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 300px; }
.di-words i { width: 44px; height: 44px; border-radius: 14px; background: rgba(255, 255, 255, 0.12); padding: 6px; animation: tilein 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) backwards; }
.di-words i .ico { filter: brightness(0) invert(1) opacity(0.55); }
.di-words i.known { background: #fff; }
.di-words i.known .ico { filter: none; }
.di-trial { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(180deg, #ffd96b, #f0a93a); padding: 9px; box-shadow: 0 4px 0 #b8641e; animation: flagpop 1.2s ease-in-out infinite; }
.word-reveal { position: absolute; left: 50%; top: 24%; transform: translate(-50%, 20px) scale(0.9); opacity: 0; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 12px; border-radius: 24px; background: linear-gradient(180deg, #fffdf8, #f8efdc); border: 2px solid #efe3c8; box-shadow: 0 0 0 4px rgba(255, 210, 63, 0.7), 0 14px 30px rgba(0, 0, 0, 0.35); transition: transform 0.45s cubic-bezier(0.2, 1.4, 0.4, 1), opacity 0.3s; z-index: 5; }
.word-reveal.go { opacity: 1; transform: translate(-50%, 0) scale(1); }
.word-reveal.out { opacity: 0; transform: translate(-50%, -16px) scale(0.9); }
.wr-new { position: absolute; top: -16px; left: -12px; width: 36px; height: 36px; color: #ffd23f; animation: starpop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) 0.2s backwards; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)); }
.wr-ico { width: 72px; height: 72px; display: block; animation: okbounce 0.8s cubic-bezier(0.2, 1.4, 0.4, 1) 0.15s backwards; }
.wr-text { font-family: var(--font-display); font-size: 28px; color: var(--wood-d); text-shadow: 0 1px 0 #fff; }
.word-toast { display: none; }


/* ---------- Bước chân: bóng chạm đất, dấu chân lún, bụi bắn, cây cỏ bị gạt ---------- */
.ground-back, .ground-front { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ground-front { z-index: 2; }
.actor { }
.gshadow { position: absolute; left: 50%; bottom: -2%; width: 64%; height: 6%; border-radius: 50%; background: radial-gradient(ellipse at 50% 50%, rgba(10, 20, 30, 0.42), rgba(10, 20, 30, 0.18) 45%, rgba(10, 20, 30, 0) 72%); transform: translateX(-50%); pointer-events: none; transition: opacity 0.3s; }
.actor[data-id='pablo'] .gshadow { display: none; } /* vẹt bay, không có bóng chạm đất */
.actor.has-walk .gshadow, .actor.walking .gshadow { animation: gshadow 0.8s ease-in-out infinite; }
@keyframes gshadow { 0%, 100% { transform: translateX(-50%) scale(1, 1); opacity: 1; } 50% { transform: translateX(-50%) scale(0.86, 0.9); opacity: 0.75; } }
.actor.jump .gshadow { animation: gshjump 0.7s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes gshjump { 0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; } 35% { transform: translateX(-50%) scale(0.6); opacity: 0.45; } 70% { transform: translateX(-50%) scale(1.12, 0.9); } }
.actor.far .gshadow, .actor.flying .gshadow { opacity: 0.3; }
.stage.thud { animation: thud 0.26s ease-out; }
@keyframes thud { 0% { transform: translateY(0); } 30% { transform: translateY(3px); } 60% { transform: translateY(-1px); } 100% { transform: translateY(0); } }
/* dấu chân: cát/đất in rõ, cỏ dẹp xuống, nước là vòng sóng */
.fp { position: absolute; width: var(--w); height: calc(var(--w) * 0.6); transform: translate(-50%, -50%) scaleX(var(--fx, 1)) rotate(var(--r, 0deg)); animation: fp 4.2s linear forwards; opacity: 0; }
.fp svg { width: 100%; height: 100%; display: block; overflow: visible; }
.fp.g-sand svg { fill: rgba(112, 82, 44, 0.42); filter: drop-shadow(0 -1px 0 rgba(255, 250, 230, 0.6)) drop-shadow(0 1.5px 0 rgba(90, 60, 30, 0.25)); }
.fp.g-dirt svg { fill: rgba(44, 28, 14, 0.5); filter: drop-shadow(0 -1px 0 rgba(255, 240, 210, 0.3)); }
.fp.g-grass { animation-duration: 1.8s; }
.fp.g-grass svg { fill: rgba(30, 80, 25, 0.35); }
.stage[data-time='night'] .fp svg { fill: rgba(5, 10, 30, 0.5); }
@keyframes fp { 0% { opacity: 0; transform: translate(-50%, -50%) scaleX(var(--fx, 1)) rotate(var(--r, 0deg)) scale(0.75); } 6% { opacity: 1; transform: translate(-50%, -50%) scaleX(var(--fx, 1)) rotate(var(--r, 0deg)) scale(1.06); } 12% { transform: translate(-50%, -50%) scaleX(var(--fx, 1)) rotate(var(--r, 0deg)) scale(1); } 60% { opacity: 1; } 100% { opacity: 0; } }
.ripple { position: absolute; width: var(--w); height: calc(var(--w) * 0.42); border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 50%; transform: translate(-50%, -50%) scale(0.2); box-shadow: 0 0 6px rgba(255, 255, 255, 0.5); animation: ripple 0.9s ease-out forwards; }
.ripple::after { content: ''; position: absolute; inset: 25%; border: 2px solid rgba(255, 255, 255, 0.6); border-radius: 50%; }
@keyframes ripple { 0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.2); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); } }
/* bụi / giọt nước */
.puff { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); opacity: 0.85; animation: puff 0.6s ease-out forwards; }
.puff.g-water { border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; filter: none; box-shadow: inset -1px -1px 0 rgba(0, 120, 200, 0.35); animation-name: splash; }
@keyframes puff { 0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.9; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.9); opacity: 0; } }
@keyframes splash { 0% { transform: translate(-50%, -50%) scale(0.6); opacity: 1; } 55% { transform: translate(calc(-50% + var(--dx) * 0.8), calc(-50% + var(--dy))) scale(1); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) * 0.1)) scale(0.7); opacity: 0; } }
/* lá rơi, bướm bay lên khi chạm bụi cây */
.bit { position: absolute; width: 7px; height: 5px; border-radius: 50% 0 50% 0; background: #7cd05a; transform: translate(-50%, -50%); animation: bit 1.1s ease-in forwards; }
.bit.dry { background: #d8c98a; }
@keyframes bit { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(0); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)); } }
.flutter { position: absolute; width: 14px; height: 10px; transform: translate(-50%, -50%); animation: flutter 2.1s ease-out forwards; opacity: 0; }
.flutter i { position: absolute; top: 0; width: 7px; height: 10px; border-radius: 60% 60% 40% 40%; background: var(--c, #ffd23f); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); animation: wing 0.16s ease-in-out infinite alternate; }
.flutter i:first-child { left: 0; transform-origin: 100% 50%; }
.flutter i:last-child { right: 0; transform-origin: 0 50%; animation-direction: alternate-reverse; }
@keyframes wing { from { transform: rotateY(10deg); } to { transform: rotateY(70deg); } }
@keyframes flutter { 0% { opacity: 0; transform: translate(-50%, -50%); } 10% { opacity: 1; } 50% { transform: translate(calc(-50% + var(--dx) * 0.4), calc(-50% + var(--dy) * 0.5)); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))); } }
/* cây cỏ ven đường: đung đưa nhẹ, bị gạt sang khi nhân vật đi qua rồi bật lại */
.tuft { position: absolute; bottom: var(--b, 25.5%); height: var(--h, 7%); aspect-ratio: 1; transform: translateX(-50%) rotate(var(--sw, 0deg)) scaleX(var(--sx, 1)); transform-origin: 50% 100%; transition: transform 0.28s cubic-bezier(0.3, 1.9, 0.5, 1); will-change: transform; animation: fadein 0.6s ease; }
.tuft svg { width: 100%; height: 100%; display: block; overflow: visible; transform-origin: 50% 100%; animation: tuftsway var(--sway, 3.2s) ease-in-out infinite alternate; animation-delay: var(--sd, 0s); }
.tuft.front { }
@keyframes tuftsway { from { transform: skewX(-3deg); } to { transform: skewX(3deg); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.stage.tall-dock .tuft { bottom: calc(var(--b, 25.5%) + 15%); }
.stage[data-time='night'] .tuft { filter: brightness(0.5) saturate(0.7); }
.stage[data-time='evening'] .tuft { filter: sepia(0.25) brightness(0.85); }


/* ---------- Cảnh vật sống: gió, tán cây đung đưa, biển dềnh, bọt nước, động vật ---------- */
.sway { position: absolute; inset: 0; background-image: inherit; background-size: cover; background-position: center; pointer-events: none; will-change: transform; }
.sway.top { transform-origin: 50% 0; transform: skewX(calc(var(--wind, 0) * var(--amp, 1) * 1deg)); }
.sway.bottom { transform-origin: 50% 100%; transform: skewX(calc(var(--wind, 0) * var(--amp, 1) * -1deg)); }
.shimmer { position: absolute; left: 0; opacity: 0.28; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent); mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent); pointer-events: none; }
.shimmer.night { opacity: 0.3; } .shimmer.evening { opacity: 0.5; }
.shimmer::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: calc(100% + 90px); background: repeating-linear-gradient(100deg, transparent 0 22px, rgba(255, 255, 255, 0.5) 22px 26px, transparent 26px 44px); animation: shimmer 5s linear infinite; will-change: transform; }
@keyframes shimmer { to { transform: translate3d(-89.3px, 0, 0); } }
.foam { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.foam path { fill: none; stroke: #fff; stroke-width: 3px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-dasharray: 14 9 24 7 10 12; opacity: 0.8; animation: foamroll 3.6s ease-in-out infinite; }
.foam path.b { stroke-width: 2px; opacity: 0.5; animation-delay: -1.8s; stroke-dasharray: 8 14 18 9; }
@keyframes foamroll { 0%, 100% { opacity: 0.35; transform: translateY(1.1px); stroke-dashoffset: 0; } 50% { opacity: 0.9; transform: translateY(-0.7px); stroke-dashoffset: -40; } }
/* mòng biển */
.gull { position: absolute; left: -12%; width: 7%; aspect-ratio: 2; animation: gullfly linear infinite; }
.gull svg { width: 100%; display: block; overflow: visible; }
.gull .wing { transform-origin: 30px 16px; animation: gullwing 0.55s ease-in-out infinite alternate; }
.gull .wing.r { animation-name: gullwing-r; }
@keyframes gullwing { from { transform: rotate(16deg); } to { transform: rotate(-24deg); } }
@keyframes gullwing-r { from { transform: rotate(-16deg); } to { transform: rotate(24deg); } }
@keyframes gullfly { 0% { left: -12%; transform: translateY(0) scale(var(--s, 1)); } 25% { transform: translateY(-16px) scale(var(--s, 1)); } 50% { transform: translateY(4px) scale(var(--s, 1)); } 75% { transform: translateY(-12px) scale(var(--s, 1)); } 100% { left: 112%; transform: translateY(0) scale(var(--s, 1)); } }
/* cua bò ngang */
.crab { position: absolute; width: 9%; transform: translate(-50%, -50%); }
.crab.flip { transform: translate(-50%, -50%) scaleX(-1); }
.crab svg { width: 100%; display: block; overflow: visible; }
.crab.walk svg { animation: crabbob 0.22s ease-in-out infinite alternate; }
@keyframes crabbob { from { transform: translateY(0); } to { transform: translateY(-6%); } }
.crab .leg { transform-origin: 40px 32px; }
.crab.walk .leg { animation: crableg 0.22s ease-in-out infinite alternate; }
.crab.walk .leg.l2, .crab.walk .leg.r2 { animation-delay: -0.11s; }
@keyframes crableg { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
.crab .claw.cl { transform-origin: 20px 24px; } .crab .claw.cr { transform-origin: 60px 24px; }
.crab.wave .claw.cl { animation: clawwave 0.35s ease-in-out 4 alternate; }
.crab.wave .claw.cr { animation: clawwave-r 0.35s ease-in-out 4 alternate; }
@keyframes clawwave { from { transform: rotate(0); } to { transform: rotate(-32deg); } }
@keyframes clawwave-r { from { transform: rotate(0); } to { transform: rotate(32deg); } }
/* bướm lượn */
.bfly { position: absolute; width: 16px; height: 12px; animation: bflywander ease-in-out infinite; }
.bfly .bw { position: absolute; top: 0; width: 7px; height: 11px; border-radius: 60% 60% 45% 45%; background: var(--c, #ffd23f); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); animation: wing 0.14s ease-in-out infinite alternate; }
.bfly .bw.l { left: 0; transform-origin: 100% 50%; }
.bfly .bw.r { right: 0; transform-origin: 0 50%; animation-direction: alternate-reverse; }
.bfly .bb { position: absolute; left: 50%; top: 1px; width: 2px; height: 10px; margin-left: -1px; background: #2c1b10; border-radius: 1px; }
@keyframes bflywander { 0% { transform: translate(0, 0); } 20% { transform: translate(var(--dx1), var(--dy1)); } 45% { transform: translate(calc(var(--dx1) + var(--dx2)), calc(var(--dy1) * 0.4)); } 70% { transform: translate(var(--dx2), var(--dy2)); } 100% { transform: translate(0, 0); } }
/* gà mổ thóc */
.hen { position: absolute; width: 8%; transform: translate(-50%, -100%) scale(var(--s, 1)); transform-origin: 50% 100%; }
.hen.flip { transform: translate(-50%, -100%) scale(var(--s, 1)) scaleX(-1); }
.hen svg { width: 100%; display: block; overflow: visible; }
.hen .hhead { transform-origin: 44px 24px; animation: henhead 0.9s ease-in-out infinite alternate; }
.hen.peck .hhead { animation: henpeck 0.4s ease-in-out 4 alternate; }
.hen .hleg { transform-origin: 26px 41px; } .hen .hleg.b { transform-origin: 34px 41px; }
.hen.walk .hleg { animation: henleg 0.25s ease-in-out infinite alternate; }
.hen.walk .hleg.b { animation-delay: -0.125s; }
.hen .htail { transform-origin: 14px 26px; animation: hentail 1.3s ease-in-out infinite alternate; }
@keyframes henhead { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes henpeck { from { transform: rotate(0); } to { transform: rotate(38deg) translate(2px, 0); } }
@keyframes henleg { from { transform: rotate(-20deg); } to { transform: rotate(20deg); } }
@keyframes hentail { from { transform: rotate(-5deg); } to { transform: rotate(6deg); } }
/* ếch nhảy */
.frog { position: absolute; width: 7%; transform: translate(-50%, -100%); }
.frog.flip { transform: translate(-50%, -100%) scaleX(-1); }
.frog svg { width: 100%; display: block; overflow: visible; transform-origin: 50% 100%; animation: frogbreathe 1.6s ease-in-out infinite alternate; }
.frog.hop svg { animation: froghop 0.6s ease-out; }
@keyframes frogbreathe { from { transform: scale(1, 1); } to { transform: scale(1.03, 0.97); } }
@keyframes froghop { 0% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(2px) scale(1.1, 0.85); } 50% { transform: translateY(-28px) scale(0.95, 1.1); } 85% { transform: translateY(0) scale(1.05, 0.9); } 100% { transform: translateY(0); } }
/* dơi chập tối */
.bat { position: absolute; width: 6%; animation: batfly ease-in-out infinite alternate; }
.bat svg { width: 100%; display: block; overflow: visible; }
.bat .wing { transform-origin: 30px 16px; animation: batwing 0.12s ease-in-out infinite alternate; }
.bat .wing.r { animation-name: batwing-r; }
@keyframes batwing { from { transform: rotate(20deg); } to { transform: rotate(-30deg); } }
@keyframes batwing-r { from { transform: rotate(-20deg); } to { transform: rotate(30deg); } }
@keyframes batfly { 0% { transform: translate(0, 0); } 20% { transform: translate(60px, -40px); } 40% { transform: translate(-30px, 20px); } 60% { transform: translate(90px, 10px); } 80% { transform: translate(20px, -50px); } 100% { transform: translate(-60px, 0); } }
/* lá rơi đều, lá bay theo cơn gió, vệt gió */
.leafdrift { position: absolute; top: -6%; width: 12px; height: 12px; background: var(--c, #7cb342); border-radius: 0 70% 0 70%; opacity: 0.85; animation: leafdrift linear infinite; }
@keyframes leafdrift { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 8% { opacity: 0.85; } 30% { transform: translate(var(--sw), 30vh) rotate(120deg); } 60% { transform: translate(calc(var(--sw) * -0.5), 60vh) rotate(260deg); } 100% { transform: translate(var(--sw), 108vh) rotate(400deg); opacity: 0.4; } }
.blown { position: absolute; width: 12px; height: 9px; background: var(--c, #c5b358); border-radius: 0 70% 0 70%; opacity: 0; animation: blown linear forwards; }
.blown.palm { width: 16px; height: 5px; border-radius: 50%; }
.blown.petal { border-radius: 60% 60% 60% 10%; }
@keyframes blown { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 10% { opacity: 0.9; } 50% { transform: translate(calc(var(--dx) * 0.5), calc(var(--dy) * 0.5 - var(--sw))) rotate(calc(var(--rot) * 0.5)); } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }
.gustline { position: absolute; width: 60%; height: 4%; opacity: 0; animation: gustline linear forwards; }
.gustline svg { width: 100%; height: 100%; overflow: visible; opacity: 0.5; }
@keyframes gustline { 0% { transform: translateX(0) scaleX(var(--dir, 1)); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateX(calc(var(--dir, 1) * 260%)) scaleX(var(--dir, 1)); opacity: 0; } }
/* cá nhảy, bọt sóng vỗ đá, sao băng */
.fishjump { position: absolute; width: 7%; transform: translate(-50%, -50%); animation: fishjump 1.1s ease-in-out forwards; }
.fishjump svg { width: 100%; display: block; overflow: visible; transform: scaleX(var(--dir, 1)); }
.fishjump .tail { transform-origin: 14px 15px; animation: fishtail 0.15s ease-in-out infinite alternate; }
@keyframes fishjump { 0% { transform: translate(-50%, -10%) rotate(calc(var(--dir, 1) * -50deg)); opacity: 0; } 15% { opacity: 1; } 50% { transform: translate(calc(-50% + var(--dir, 1) * 36px), -150%) rotate(0deg); } 85% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--dir, 1) * 72px), 0%) rotate(calc(var(--dir, 1) * 50deg)); opacity: 0; } }
@keyframes fishtail { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
.splashdrop { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #e8f7ff; box-shadow: 0 0 2px rgba(255, 255, 255, 0.8); animation: splashdrop 0.7s ease-out forwards; }
.splashdrop.big { animation-duration: 1.1s; }
@keyframes splashdrop { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 55% { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 1; } 100% { transform: translate(calc(var(--dx) * 1.3), calc(var(--dy) * -0.35)) scale(0.6); opacity: 0; } }
.mist { position: absolute; width: 24%; aspect-ratio: 1.6; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(ellipse, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 70%); filter: blur(3px); animation: mist 1.5s ease-out forwards; }
@keyframes mist { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); } 25% { opacity: 0.9; } 100% { opacity: 0; transform: translate(-50%, -85%) scale(1.7); } }
.shooting { position: absolute; width: 90px; height: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff); border-radius: 2px; transform-origin: 100% 50%; animation: shooting 1.3s ease-out forwards; opacity: 0; }
.shooting::after { content: ''; position: absolute; right: -2px; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 3px rgba(255, 255, 255, 0.9); }
@keyframes shooting { 0% { transform: rotate(30deg) translateX(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: rotate(30deg) translateX(220px); opacity: 0; } }
/* cỏ ven đường nghiêng theo gió */
.tuft { transform: translateX(-50%) rotate(calc(var(--sw, 0deg) + var(--wind, 0) * 6deg)) scaleX(var(--sx, 1)); }


/* ---------- Khuôn mặt & tóc: bảng "nói", mí mắt mọi tư thế, tóc Lisa đung đưa ---------- */
.actor.has-talk.talking .sprite { animation: breathe 3.6s ease-in-out infinite; }
.hair { position: absolute; inset: 0; pointer-events: none; transform-origin: 50% var(--oy, 25%); transform: rotate(calc(var(--wind, 0) * 1.6deg)); will-change: transform; }
.hair-in { position: absolute; inset: 0; background-size: 100% 100%; background-repeat: no-repeat; transform-origin: 50% var(--oy, 25%); animation: hairsway 3.4s ease-in-out infinite alternate; animation-delay: var(--breath-delay, 0s); }
@keyframes hairsway { from { transform: skewX(-1.6deg) translateX(-0.6%); } to { transform: skewX(1.6deg) translateX(0.6%); } }
.actor.walking .hair-in { animation: hairbounce 0.42s ease-in-out infinite; }
@keyframes hairbounce { 0%, 100% { transform: skewX(-2deg) translateY(0); } 50% { transform: skewX(2deg) translateY(1.2%); } }
.actor.talking .hair-in { animation: hairtalk 0.84s ease-in-out infinite; }
@keyframes hairtalk { 0%, 100% { transform: skewX(-1.2deg) translateY(0); } 50% { transform: skewX(1.2deg) translateY(0.6%); } }
.actor.flip .hair { transform: scaleX(-1) rotate(calc(var(--wind, 0) * -1.6deg)); }


/* ---------- Logo chữ (ảnh) ---------- */
.logo-img { display: block; width: min(88%, 440px); height: auto; margin: 0 auto; animation: logoIn 0.8s cubic-bezier(0.2, 1.4, 0.4, 1) backwards; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35)); }
.loading-logo .logo-img { width: min(80%, 360px); filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45)); }
.logo:has(.logo-img) { font-size: 0; line-height: 0; }


/* ---------- Hướng dẫn cài ứng dụng ---------- */
.install-help { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.install-help img { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); }
.install-help p { margin: 0; color: var(--ink); line-height: 1.45; font-size: 15px; }
.install-help b { color: var(--wood-d); }


/* ---------- Chương 2: thanh sao, tiêu đề chương trên bản đồ, thanh toán ---------- */
.planks-row .plank.star { border-radius: 50%; height: 12px; width: 12px; flex: none; background: rgba(255, 255, 255, 0.18); }
.planks-row .plank.star.on { background: radial-gradient(circle, #ffd96b, #f0a93a); box-shadow: 0 0 10px rgba(255, 210, 63, 0.6); }
.planks-row:has(.plank.star) { justify-content: center; gap: 8px; }
.map-chapter { position: relative; height: 92px; display: flex; align-items: center; justify-content: center; gap: 10px; background: linear-gradient(180deg, rgba(5, 26, 44, 0.92), rgba(8, 40, 64, 0.88)); color: #fff; border-top: 1px solid rgba(255, 255, 255, 0.14); border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.map-chapter .mc-ico { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(180deg, #ffd96b, #f0a93a); padding: 8px; box-shadow: 0 3px 0 #b8641e; }
.map-chapter b { font-family: var(--font-display); font-size: 20px; }
.map-chapter small { font-size: 14px; opacity: 0.85; }
.map-chapter.locked { filter: saturate(0.4); opacity: 0.8; }
.pay { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.pay-price { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 18px; padding: 6px 14px; box-shadow: var(--shadow); font-family: var(--font-display); font-size: 28px; color: var(--wood-d); }
.pay-price .ico { width: 36px; height: 36px; }
.pay-coins { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pay-coin { width: 58px; height: 58px; border-radius: 50%; background: #fff; padding: 8px; box-shadow: 0 4px 0 #d9cdb3, 0 8px 16px rgba(0, 0, 0, 0.2); transition: transform 0.25s, opacity 0.25s; }
.pay-coin:active { transform: translateY(3px); }
.pay-coin.taken { transform: translateY(-40px) scale(0.5); opacity: 0; pointer-events: none; }
.pay-coin.back { transform: translateY(40px) scale(0.5); opacity: 0; pointer-events: none; }
.pay-coin.bad { animation: shake 0.45s ease; box-shadow: 0 0 0 4px var(--red); }
.pay-box { width: 64px; height: 64px; }
.pay-box.pop { animation: okbounce 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); }


/* mưa ở chợ (chương 2): dải mưa trượt bằng transform */
.rainfall { position: absolute; left: 0; right: 0; top: -100px; height: calc(100% + 100px); opacity: 0.55; background: repeating-linear-gradient(110deg, transparent 0 16px, rgba(220, 235, 255, 0.45) 16px 18px); animation: rain 0.5s linear infinite; will-change: transform; pointer-events: none; }


/* ---------- Phòng luyện phát âm ---------- */
.actor[style*="--boost"] { transition: left 0.6s ease, bottom 0.6s ease, opacity 0.4s ease, transform 0.08s linear; }
.actor.listening .sprite { animation: listen 1.2s ease-in-out infinite alternate; }
@keyframes listen { from { transform: rotate(-2deg) translateY(0); } to { transform: rotate(3deg) translateY(-1%); } }
.pro { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.pro-phrase { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 5.4vmin, 26px); color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55); }
.pw { padding: 2px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.28); transition: background 0.3s, color 0.3s, transform 0.3s; }
.pw.ok { background: var(--leaf); color: #fff; transform: translateY(-3px); box-shadow: 0 4px 0 #2e7d32; }
.pro-stage { display: flex; align-items: center; justify-content: center; gap: 18px; }
.pro-micwrap { position: relative; width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; }
.pro-wave { position: absolute; inset: -25px; width: 200px; height: 200px; pointer-events: none; }
.pro-mic { width: 104px; height: 104px; background: linear-gradient(180deg, #ff7a7a, #e53935); box-shadow: 0 6px 0 #a32020, 0 0 0 6px rgba(255, 255, 255, 0.35), 0 14px 28px rgba(0, 0, 0, 0.35); padding: 26px; }
.pro-mic.on { background: linear-gradient(180deg, #4fd36f, #2e9e4f); box-shadow: 0 2px 0 #1e6b35, 0 0 0 8px rgba(79, 211, 111, 0.35), 0 14px 28px rgba(0, 0, 0, 0.35); transform: scale(1.06); }
.pro-timer { position: absolute; right: 6px; top: 6px; min-width: 26px; height: 26px; border-radius: 13px; background: #fff; color: var(--red); font-weight: 900; font-size: 14px; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.pro-timer:empty { display: none; }
.pro-slow { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--sea); padding: 0; }
.pro-hint { margin: 0; color: #fff; font-weight: 800; font-size: 14px; text-align: center; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55); min-height: 1.3em; }
.pro-result { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); }
.pro-score { position: relative; width: 70px; height: 70px; }
.pro-score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pro-track { fill: none; stroke: rgba(255, 255, 255, 0.3); stroke-width: 8; }
.pro-fill { fill: none; stroke: #ffd23f; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.9s cubic-bezier(0.2, 0.9, 0.3, 1); }
.pro-fill[data-level="3"] { stroke: var(--leaf); } .pro-fill[data-level="1"] { stroke: var(--orange); } .pro-fill[data-level="0"] { stroke: var(--red); }
.pro-score b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 22px; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); }
.pro-stars { display: flex; gap: 4px; }
.pro-stars i { width: 30px; height: 30px; color: #cfcfcf; opacity: 0.6; transition: transform 0.4s cubic-bezier(0.2, 1.4, 0.4, 1), color 0.3s, opacity 0.3s; }
.pro-stars i.on { color: #ffd23f; opacity: 1; transform: scale(1.25); }
.pro-judge { display: flex; gap: 12px; }
.pro-judge .tile { width: 64px; height: 64px; padding: 14px; }
.pro-actions { display: flex; gap: 10px; }
.pro-actions .btn-round.primary.pulse { animation: pulse 1.2s ease-in-out infinite; }

/* ---------- Giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .bg-inner { animation: none; transform: translate(-50%, -50%); }
  .pose-img { transition: none; }
}
