/* ============================================================
   css/style.css — Giao diện game "Robot Cả Tin" (mobile-first)
   ============================================================ */

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

:root {
  --blue: #4f83ff;
  --blue-dark: #3356c8;
  --ink: #1b2340;
  --bg-top: #cfe6ff;
  --bg-bottom: #eaf6ff;
  --danger: #ef4444;
  --good: #22c55e;
  --warn: #f59e0b;
  --card: #ffffff;
  --shadow: 0 6px 24px rgba(20, 40, 90, 0.18);
  --radius: 18px;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  position: fixed;
  inset: 0;
  touch-action: manipulation;
}

/* Nền sân khấu (canvas Phaser nằm trong này, nền trong suốt) */
#game-container {
  position: fixed;
  inset: 0;
  z-index: 1;
}
#game-container canvas { display: block; }

/* Lớp overlay UI (chữ + nút) */
#ui {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* ---------- HUD ---------- */
.hud {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 0;
  pointer-events: none;
}
.hud__item {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.hud__money { color: #b45309; }
.hud__info { color: var(--ink); }
.mute-btn {
  margin-left: auto;
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  font-size: 20px;
  cursor: pointer;
}

/* ---------- Đếm ngược ---------- */
.countdown {
  align-self: center;
  margin-top: 10px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fff 0%, #ffe0e0 100%);
  border: 3px solid var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', sans-serif;
  font-size: 34px;
  font-weight: 800;
  color: var(--danger);
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.18);
  animation: countdown-pulse 1s ease-in-out infinite;
}
@keyframes countdown-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

/* ---------- Tiêu đề màn / kết quả / toast ---------- */
.level-title, .result-banner {
  align-self: center;
  margin-top: 90px;
  background: rgba(27, 35, 64, 0.9);
  color: #fff;
  padding: 14px 22px;
  border-radius: 16px;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow);
  animation: pop-in 0.35s ease;
  max-width: 90%;
}
.result-banner { background: rgba(34, 197, 94, 0.95); margin-top: 30px; }

.toast {
  align-self: center;
  margin-top: 12px;
  background: rgba(27, 35, 64, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  animation: pop-in 0.3s ease;
}

@keyframes pop-in {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- Viền đỏ nhấp nháy ---------- */
.redflash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 0 rgba(239, 68, 68, 0);
  transition: box-shadow 0.2s;
}
.redflash.on {
  animation: redflash-pulse 1s ease-in-out infinite;
}
@keyframes redflash-pulse {
  0%, 100% { box-shadow: inset 0 0 60px 8px rgba(239, 68, 68, 0.45); }
  50% { box-shadow: inset 0 0 30px 2px rgba(239, 68, 68, 0.2); }
}

/* ---------- Hộp thoại ---------- */
.dialog {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  pointer-events: auto;
  animation: slide-up 0.3s ease;
}
.dialog__name {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 6px;
  font-size: 16px;
}
.dialog__text {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 10px;
}
.dialog-next {
  display: block;
  margin-left: auto;
  border: none;
  background: var(--blue);
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 16px;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  min-height: 48px;
}
@keyframes slide-up {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------- 3 siêu năng lực ---------- */
.powers {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}
.power-btn {
  border: none;
  border-radius: 14px;
  min-height: 54px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
  padding: 10px 14px;
}
.power-btn--cham_lai { background: linear-gradient(180deg, #60a5fa, #3b82f6); }
.power-btn--kiem_tra { background: linear-gradient(180deg, #34d399, #10b981); }
.power-btn--dung_lai { background: linear-gradient(180deg, #f87171, #ef4444); }
.power-btn:active { transform: scale(0.97); }
.power-btn.disabled { opacity: 0.5; }

/* ---------- Thẻ tin nhắn lừa đảo ---------- */
.scam-card {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 110px;
  background: #1b2340;
  color: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  animation: pop-in 0.35s ease;
  max-height: 46vh;
  overflow-y: auto;
}
.scam-card__watermark {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  transform: rotate(-8deg);
  pointer-events: none;
}
.scam-content { font-size: 15px; line-height: 1.5; }
.scam-popup {
  background: #fff;
  color: #111;
  border-radius: 12px;
  padding: 12px;
  margin-top: 4px;
}
.scam-popup__head {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  color: #dc2626;
  font-size: 17px;
  margin-bottom: 8px;
}
.scam-popup p { margin: 6px 0; }
.scam-popup b { color: #dc2626; }
.scam-voice { font-style: italic; color: #333; }
.scam-url { font-family: monospace; color: #7c3aed; word-break: break-all; }

/* ---------- Tìm dấu hiệu đỏ ---------- */
.search {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 100px;
  bottom: 90px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  animation: slide-up 0.3s ease;
}
.search__title {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 17px;
  margin-bottom: 10px;
  color: var(--blue-dark);
}
.search-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.search-item {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  background: #f8fafc;
}
.search-item__text { font-weight: 700; color: #b91c1c; }
.search-item__explain { margin-top: 6px; font-size: 13px; color: #166534; }
.search-item.found { border-color: var(--good); background: #f0fdf4; }
.search-done {
  margin-top: 10px;
  border: none;
  background: var(--good);
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 16px;
  min-height: 48px;
  border-radius: 12px;
  cursor: pointer;
}

/* ---------- Pha B: dạy Tin ---------- */
.phaseb {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  pointer-events: auto;
  max-height: 64vh;
  overflow-y: auto;
  animation: slide-up 0.3s ease;
}
.phaseb__misconception {
  background: #fff7ed;
  border-left: 4px solid var(--warn);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.phaseb__tag { font-weight: 700; color: #b45309; font-size: 13px; margin-bottom: 4px; }
.phaseb__text { font-size: 15px; line-height: 1.5; }
.phaseb__prompt { font-weight: 700; margin-bottom: 8px; font-size: 15px; }
.phaseb__choices { display: flex; flex-direction: column; gap: 8px; }
.choice-btn {
  border: 2px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  min-height: 48px;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
}
.choice-btn:active { border-color: var(--blue); background: #eff6ff; }
.phaseb__counter {
  background: #fef2f2;
  border-left: 4px solid var(--danger);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.teach-input {
  width: 100%;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  font-family: inherit;
  min-height: 110px;
  resize: vertical;
}
.teach-input:focus { outline: none; border-color: var(--blue); }
.phaseb__actions { display: flex; gap: 10px; margin-top: 10px; }
.teach-voice {
  flex: 0 0 auto;
  border: 2px solid var(--blue);
  background: #eff6ff;
  color: var(--blue-dark);
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 15px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  cursor: pointer;
}
.teach-send {
  flex: 1;
  border: none;
  background: var(--good);
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 16px;
  min-height: 48px;
  border-radius: 12px;
  cursor: pointer;
}
.phaseb__hint { margin-top: 8px; font-size: 12px; color: #94a3b8; }

/* ---------- Màn hình bắt đầu / kết thúc ---------- */
.start, .end {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  padding: 20px;
  z-index: 20;
}
.start__inner, .end__inner {
  text-align: center;
  max-width: 420px;
  width: 100%;
}
.start__logo, .end__logo { font-size: 72px; animation: float 2.4s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.start__title {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 40px;
  color: var(--blue-dark);
  margin-top: 6px;
}
.start__sub { font-size: 17px; color: #3356c8; font-weight: 500; margin-top: 2px; }
.start__note {
  margin-top: 14px;
  font-size: 14px;
  color: #475569;
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.start-btn {
  margin-top: 22px;
  width: 100%;
  border: none;
  background: linear-gradient(180deg, #34d399, #10b981);
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 22px;
  min-height: 60px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}
.start-btn:active { transform: scale(0.97); }
.start-mode {
  margin-top: 12px;
  font-size: 13px;
  color: #64748b;
}

.end__title { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 30px; color: var(--blue-dark); }
.end-body { margin-top: 12px; font-size: 17px; line-height: 1.6; }
.end-hint { color: #64748b; font-size: 14px; margin-top: 8px; }
.end-btn {
  margin-top: 20px;
  width: 100%;
  border: none;
  background: linear-gradient(180deg, #60a5fa, #3b82f6);
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 20px;
  min-height: 56px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

/* ---------- Desktop / máy chiếu (màn rộng) ---------- */
@media (min-width: 720px) {
  .dialog, .powers, .phaseb, .scam-card, .search {
    left: 50%;
    transform: translateX(-50%);
    width: 620px;
    right: auto;
  }
  .dialog { animation: slide-up 0.3s ease; }
  .powers { width: 520px; }
  .search { width: 620px; }
  .start__inner, .end__inner { max-width: 520px; }
}

/* ---------- Tôn trọng người nhạy cảm ánh sáng ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .countdown { animation: none; }
  .redflash.on { animation: none; box-shadow: inset 0 0 30px 4px rgba(239, 68, 68, 0.35); }
}

/* ============================================================
   Màn hình toàn màn (screens.js)
   ============================================================ */
#screens {
  position: fixed;
  inset: 0;
  z-index: 30;
}

/* ---------- Start: ô nhập lớp/biệt danh ---------- */
.field { display: block; margin-top: 12px; text-align: left; }
.field__label { display: block; font-weight: 700; font-size: 14px; color: #334155; margin-bottom: 4px; }
.field__input {
  width: 100%;
  min-height: 48px;
  border: 2px solid #dbe4f0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.field__input:focus { outline: none; border-color: var(--blue); }
.start__privacy {
  margin-top: 12px;
  font-size: 13px;
  color: #b45309;
  background: #fffbeb;
  border-radius: 10px;
  padding: 8px 12px;
}

/* ---------- Trắc nghiệm (quiz) ---------- */
.quiz, .survey, .growth, .summary {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.quiz__top { text-align: center; margin-bottom: 14px; }
.quiz__title { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 26px; color: var(--blue-dark); }
.quiz__sub { font-size: 14px; color: #475569; margin-top: 2px; }
.quiz__progress {
  display: inline-block;
  margin-top: 8px;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 700;
  font-size: 14px;
}
.quiz__timer {
  width: 100%;
  max-width: 420px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
}
.quiz__timer-fill {
  height: 100%;
  width: 100%;
  background: var(--good);
  border-radius: 3px;
  animation: quiz-timer 30s linear forwards;
}
@keyframes quiz-timer { from { width: 100%; } to { width: 0%; } }

.quiz__question {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 14px;
}
.quiz__options { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 10px; }
.quiz-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 2px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  min-height: 48px;
  cursor: pointer;
}
.quiz-opt:active { border-color: var(--blue); background: #eff6ff; }
.quiz-opt__letter {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
}
.quiz-opt__text { font-size: 15px; line-height: 1.4; }

/* ---------- Khảo sát ---------- */
.survey__top { text-align: center; margin-bottom: 16px; }
.survey__title { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 24px; color: var(--blue-dark); }
.survey__progress { margin-top: 6px; color: #64748b; font-weight: 700; }
.survey__question {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 20px;
  text-align: center;
}
.survey__stars { display: flex; gap: 10px; }
.star-btn {
  width: 60px;
  height: 60px;
  border: none;
  background: #f1f5f9;
  border-radius: 14px;
  font-size: 32px;
  color: #cbd5e1;
  cursor: pointer;
  transition: transform 0.1s;
}
.star-btn:active { transform: scale(0.9); color: #f59e0b; background: #fef3c7; }
.survey__choices { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 420px; }
.survey-choice {
  border: 2px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  min-height: 52px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.survey-choice:active { border-color: var(--blue); }
.survey__open {
  width: 100%;
  max-width: 480px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  font-family: inherit;
  min-height: 120px;
  resize: vertical;
}
.survey__send {
  margin-top: 12px;
  width: 100%;
  max-width: 480px;
  border: none;
  background: var(--blue);
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 17px;
  min-height: 48px;
  border-radius: 12px;
  cursor: pointer;
}

/* ---------- Twist bất ngờ ---------- */
.twist-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 40, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.twist-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, #fff7ed, #fff);
  border: 3px solid #f59e0b;
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: pop-in 0.4s ease;
}
.twist-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 18px;
  cursor: pointer;
}
.twist-emoji { font-size: 56px; }
.twist-title { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 22px; color: #b45309; margin-top: 6px; }
.twist-text { margin-top: 10px; font-size: 15px; color: #334155; line-height: 1.5; }
.twist-text b { color: #dc2626; }
.twist-input {
  margin-top: 14px;
  width: 100%;
  min-height: 48px;
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 16px;
  text-align: center;
}
.twist-claim {
  margin-top: 12px;
  width: 100%;
  border: none;
  background: linear-gradient(180deg, #f97316, #ea580c);
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 18px;
  min-height: 52px;
  border-radius: 12px;
  cursor: pointer;
}
.twist-safe {
  margin-top: 10px;
  width: 100%;
  border: 2px solid #10b981;
  background: #fff;
  color: #047857;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 15px;
  min-height: 46px;
  border-radius: 12px;
  cursor: pointer;
}

/* ---------- Biểu đồ tăng trưởng ---------- */
.growth__title { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 26px; color: var(--blue-dark); margin-bottom: 20px; }
.growth__bars { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.growth__row { display: flex; align-items: center; gap: 10px; }
.growth__label { flex: 0 0 52px; font-weight: 700; font-size: 15px; }
.growth__bar { flex: 1; height: 26px; background: #e2e8f0; border-radius: 13px; overflow: hidden; }
.growth__fill { height: 100%; border-radius: 13px; transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.growth__fill--before { background: linear-gradient(180deg, #94a3b8, #64748b); }
.growth__fill--after { background: linear-gradient(180deg, #34d399, #10b981); }
.growth__val { flex: 0 0 48px; font-weight: 800; text-align: right; }
.growth__msg { margin-top: 20px; font-size: 17px; font-weight: 700; color: #166534; text-align: center; }
.growth__next {
  margin-top: 18px;
  border: none;
  background: var(--blue);
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 17px;
  min-height: 50px;
  padding: 10px 28px;
  border-radius: 12px;
  cursor: pointer;
}

/* ---------- Tổng kết ---------- */
.summary__logo { font-size: 64px; animation: float 2.4s ease-in-out infinite; }
.summary__title { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 28px; color: var(--blue-dark); margin-top: 4px; }
.summary__stats { display: flex; gap: 16px; margin-top: 16px; }
.summary__stat {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px 22px;
  text-align: center;
  min-width: 110px;
}
.summary__stat b { display: block; font-family: 'Baloo 2', sans-serif; font-size: 30px; color: var(--blue-dark); }
.summary__stat span { font-size: 13px; color: #64748b; }
.summary__lesson {
  width: 100%;
  max-width: 460px;
  margin-top: 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
  text-align: left;
}
.summary__lesson-tag { font-weight: 700; color: var(--blue-dark); margin-bottom: 6px; font-size: 14px; }
.summary__lesson-text { font-size: 15px; line-height: 1.6; color: #334155; }
.summary__btn {
  margin-top: 12px;
  width: 100%;
  max-width: 460px;
  border: none;
  background: var(--blue);
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 17px;
  min-height: 52px;
  border-radius: 14px;
  cursor: pointer;
}
.summary__btn--share { background: linear-gradient(180deg, #34d399, #10b981); }

/* ---------- Chế độ máy chiếu (?mode=lop): chữ to, nút lớn ---------- */
body.mode-lop .dialog__text { font-size: 24px; line-height: 1.6; }
body.mode-lop .dialog__name { font-size: 20px; }
body.mode-lop .dialog-next { font-size: 22px; padding: 16px 28px; min-height: 60px; }
body.mode-lop .power-btn { font-size: 22px; min-height: 72px; }
body.mode-lop .scam-popup, body.mode-lop .scam-content { font-size: 20px; }
body.mode-lop .search-item__text { font-size: 20px; }
body.mode-lop .search-item__explain { font-size: 17px; }
body.mode-lop .choice-btn { font-size: 19px; padding: 16px; }
body.mode-lop .phaseb__text { font-size: 20px; }
body.mode-lop .phaseb__counter { font-size: 18px; }
body.mode-lop .teach-input { font-size: 22px; min-height: 140px; }
body.mode-lop .teach-send, body.mode-lop .teach-voice { font-size: 20px; min-height: 60px; }
body.mode-lop .quiz__question { font-size: 24px; }
body.mode-lop .quiz-opt__text { font-size: 20px; }
body.mode-lop .countdown { width: 96px; height: 96px; font-size: 44px; }
body.mode-lop .hud__item { font-size: 20px; padding: 10px 18px; }
body.mode-lop .toast { font-size: 18px; }
body.mode-lop .survey__question { font-size: 22px; }
body.mode-lop .star-btn { width: 72px; height: 72px; font-size: 40px; }






/* ============================================================
   PLAYGROUND 2D (Pha A) — bảng nhiệm vụ, joystick ảo, nút tương tác
   ============================================================ */

/* Bảng nhiệm vụ — nằm trong luồng flex của #ui, xếp ngay dưới đồng hồ
   đếm ngược (KHÔNG dùng position:absolute để tránh đè lên .countdown/.toast) */
.objective {
  align-self: center;
  margin-top: 10px;
  max-width: min(92vw, 640px);
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.82);
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  animation: pop-in 0.3s ease;
}
.objective b { color: #fde047; }
.objective .objective__count { color: #4ade80; }

/* Khu điều khiển cảm ứng: khung trong suốt, không chặn cảm ứng toàn màn hình */
.world-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.joystick {
  position: absolute;
  left: 22px;
  bottom: 26px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  border: 2px solid rgba(255, 255, 255, 0.35);
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.joystick__knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #93c5fd, #2563eb);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  will-change: transform;
}

.interact-btn {
  position: absolute;
  right: 26px;
  bottom: 44px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.5);
  background: radial-gradient(circle at 35% 30%, #fbbf24, #f59e0b);
  color: #3b2100;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 30px;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.interact-btn:active { transform: scale(0.94); }
/* Nút Ⓐ sáng lên khi có vật thể tương tác được ở gần */
.interact-btn.ready {
  animation: interact-pulse 0.9s ease-in-out infinite;
  background: radial-gradient(circle at 35% 30%, #86efac, #22c55e);
}
@keyframes interact-pulse {
  0%, 100% { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(34, 197, 94, 0.7); }
  50% { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), 0 0 0 18px rgba(34, 197, 94, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .interact-btn.ready { animation: none; }
}

/* Chế độ máy chiếu: chữ to, nút lớn hơn */
body.mode-lop .objective { font-size: 21px; }
body.mode-lop .joystick { width: 168px; height: 168px; }
body.mode-lop .joystick__knob { width: 74px; height: 74px; margin: -37px 0 0 -37px; }
body.mode-lop .interact-btn { width: 116px; height: 116px; font-size: 38px; }

