/* =======================================================================
   SIÊU NHÍ AN TOÀN GIAO THÔNG AI — shared-pages.css
   Dùng chung cho TẤT CẢ các trang con (không phải Landing Page):
   AI Gia sư, AI Camera, AI Mô phỏng, AI Truyện tranh, Game Mini,
   Dashboard Học sinh / Phụ huynh / Giáo viên / Admin.
   Phải load SAU style.css (kế thừa biến màu / font / nút / navbar từ đó).
   ======================================================================= */

:root {
  --red: #f43f5e;
  --panel-fill: linear-gradient(
    160deg,
    var(--glass-fill),
    rgba(255, 255, 255, 0.02)
  );
}

/* Nền chung cho các trang con — cùng tông với Hero nhưng nhẹ hơn */
body {
  background:
    radial-gradient(
      1000px 600px at 12% -10%,
      rgba(139, 92, 246, 0.22),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at 100% 0%,
      rgba(34, 211, 238, 0.15),
      transparent 55%
    ),
    var(--bg-deep-1);
  min-height: 100vh;
}

/* Navbar luôn hiển thị nền mờ (không cần cuộn) cho các trang con */
.navbar.static {
  position: sticky;
  top: 0;
  background: rgba(10, 15, 61, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 0;
}
.back-link {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.back-link:hover {
  color: var(--cyan);
}

/* ---------------- PAGE HEAD (Camera / Mô phỏng / Truyện tranh / Game) ---------------- */
.page-head {
  padding: 56px 0 30px;
  text-align: center;
}
.page-head h1 {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 800;
  margin: 18px 0 12px;
  line-height: 1.15;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-head p {
  color: rgba(255, 255, 255, 0.68);
  max-width: 560px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.6;
}
.cond-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
}
.cond-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  color: rgba(255, 255, 255, 0.72);
}

/* ---------------- APP SHELL (sidebar layout: AI Gia sư + 4 Dashboard) ---------------- */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 18px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 15px;
}
.side-brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    var(--cyan),
    var(--blue) 55%,
    var(--purple)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: var(--shadow-glow-blue);
}
.side-back {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  padding: 0 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.side-back:hover {
  color: var(--cyan);
}
.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  transition: all 0.2s;
}
.side-link .ic {
  font-size: 16px;
  width: 20px;
  text-align: center;
}
.side-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.side-link.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 6px 18px -4px rgba(59, 130, 246, 0.55);
}
.side-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 14px 6px;
}
.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}
.sidebar-foot .av {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.sidebar-foot .txt b {
  display: block;
  font-size: 12.5px;
}
.sidebar-foot .txt span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.main {
  padding: 26px 32px 60px;
  max-width: 1220px;
}
.top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 16px;
}
.greet h1 {
  font-family: "Baloo 2", sans-serif;
  font-size: 25px;
  font-weight: 800;
  margin-bottom: 6px;
}
.greet p {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.55);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.select-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------------- CARDS / STATS / TABLES (shared) ---------------- */
.card {
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--panel-fill);
  padding: 22px;
  margin-bottom: 18px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.card-head h3 {
  font-size: 15px;
  font-weight: 700;
  font-family: "Baloo 2", sans-serif;
}
.card-head a {
  font-size: 12px;
  color: var(--cyan);
  font-weight: 600;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.stat-row.cols-5 {
  grid-template-columns: repeat(5, 1fr);
}
.mini-stat-card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mini-stat-card .st-ic {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--grad-primary);
  margin-bottom: 2px;
}
.mini-stat-card b {
  font-family: "Baloo 2", sans-serif;
  font-size: 22px;
  font-weight: 800;
}
.mini-stat-card span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}
.trend {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}

.grid2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.42);
  padding: 0 10px 10px;
  font-weight: 600;
}
.data-table td {
  font-size: 12.5px;
  padding: 11px 10px;
  border-top: 1px solid var(--glass-border);
  color: rgba(255, 255, 255, 0.72);
  vertical-align: middle;
}
.data-table td b {
  color: #fff;
}
.mini-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  width: 64px;
}
.mini-bar.full {
  width: 100%;
  height: 8px;
  display: block;
  margin: 0;
}
.mini-bar i {
  display: block;
  height: 100%;
  background: var(--grad-primary);
  border-radius: 999px;
}
.row-action {
  font-size: 11px;
  color: var(--cyan);
  font-weight: 600;
  cursor: pointer;
}

.status-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.status-badge.good {
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
}
.status-badge.watch {
  background: rgba(251, 191, 36, 0.15);
  color: var(--yellow);
}
.role-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.role-tag.student {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue-light);
}
.role-tag.parent {
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple);
}
.role-tag.teacher {
  background: rgba(34, 211, 238, 0.15);
  color: var(--cyan);
}
.role-tag.admin {
  background: rgba(244, 63, 94, 0.15);
  color: var(--red);
}

.stu-name {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stu-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.35),
    rgba(139, 92, 246, 0.3)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Notifications */
.notif-item {
  display: flex;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--glass-border);
}
.notif-item:last-child {
  border-bottom: none;
}
.notif-ic {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.notif-text {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
}
.notif-time {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
}

/* Forms (create lesson etc.) */
.form-field label {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
  display: block;
}
.form-field input,
.form-field select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--grad-primary);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  box-shadow: 0 12px 30px -8px rgba(59, 130, 246, 0.6);
  transition: all 0.35s;
  z-index: 200;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =======================================================================
   AI GIA SƯ — chat interface
   ======================================================================= */
.chat-col {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.chat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}
.chat-top h2 {
  font-size: 16.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Baloo 2", sans-serif;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 1.8s infinite;
}
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 26px 0;
}
.chat-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.msg {
  display: flex;
  gap: 12px;
  max-width: 80%;
  animation: msgIn 0.35s ease both;
}
@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.msg.bot {
  align-self: flex-start;
}
.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
.msg.bot .msg-avatar {
  background: var(--grad-primary);
}
.msg.user .msg-avatar {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
}
.msg-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg-bubble {
  padding: 13px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
}
.msg.bot .msg-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-top-left-radius: 4px;
}
.msg.user .msg-bubble {
  background: linear-gradient(
    120deg,
    rgba(59, 130, 246, 0.35),
    rgba(139, 92, 246, 0.3)
  );
  border-top-right-radius: 4px;
}
.msg-tools {
  display: flex;
  gap: 6px;
}
.msg-tool {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  cursor: pointer;
}
.msg-tool:hover {
  color: #fff;
  border-color: var(--cyan);
}
.illus-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  width: 280px;
}
.illus-visual {
  height: 140px;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.35),
    rgba(139, 92, 246, 0.3)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  position: relative;
}
.illus-visual .badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  background: rgba(10, 15, 61, 0.6);
  padding: 3px 8px;
  border-radius: 999px;
}
.illus-caption {
  padding: 10px 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.03);
}
.voice-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  width: 220px;
}
.voice-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 20px;
  flex: 1;
}
.voice-bars i {
  width: 3px;
  border-radius: 2px;
  background: var(--cyan);
  animation: bar 1.2s ease-in-out infinite;
}
.voice-bars i:nth-child(1) {
  height: 40%;
  animation-delay: 0s;
}
.voice-bars i:nth-child(2) {
  height: 80%;
  animation-delay: 0.1s;
}
.voice-bars i:nth-child(3) {
  height: 55%;
  animation-delay: 0.2s;
}
.voice-bars i:nth-child(4) {
  height: 100%;
  animation-delay: 0.3s;
}
.voice-bars i:nth-child(5) {
  height: 65%;
  animation-delay: 0.4s;
}
.voice-bars i:nth-child(6) {
  height: 30%;
  animation-delay: 0.5s;
}
@keyframes bar {
  0%,
  100% {
    transform: scaleY(0.4);
  }
  50% {
    transform: scaleY(1);
  }
}
.typing {
  display: flex;
  gap: 4px;
  padding: 14px 16px;
}
.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  animation: typing 1.2s infinite;
}
.typing span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
.suggest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.suggest-row.chat {
  max-width: 760px;
  margin: 4px auto 0;
  padding: 0 24px 4px;
}
.suggest-chip {
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: all 0.2s;
}
.suggest-chip:hover {
  border-color: var(--cyan);
  color: #fff;
}
.chat-input-wrap {
  padding: 16px 24px 22px;
}
.chat-input-inner {
  max-width: 760px;
  margin: 0 auto;
}
.tutor-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 9px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
}
.tutor-input input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
}
.tutor-input input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.icon-btn-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  border: none;
  color: #fff;
}
.icon-btn-sm:hover {
  background: rgba(255, 255, 255, 0.12);
}
.icon-btn-sm.send {
  background: var(--grad-primary);
}
.input-hint {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 10px;
}

/* =======================================================================
   AI CAMERA
   ======================================================================= */
.cam-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  padding-bottom: 70px;
}
.cam-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--panel-fill);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cam-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 16px 0;
}
.cam-tab {
  padding: 9px 16px;
  border-radius: 10px 10px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.cam-tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-bottom: none;
}
.cam-view {
  position: relative;
  margin: 0 16px 16px;
  border-radius: 16px;
  overflow: hidden;
  height: 420px;
  background: linear-gradient(
    160deg,
    rgba(20, 20, 60, 0.9),
    rgba(10, 10, 35, 0.95)
  );
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cam-scene {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.cam-scene .street {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(
    180deg,
    rgba(30, 42, 80, 0.4),
    rgba(10, 15, 35, 0.8)
  );
}
.cam-scene .lane {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 70%;
  height: 45%;
  transform: translateX(-50%);
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.15) 0 18px,
    transparent 18px 34px
  );
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0% 100%);
}
.kid {
  position: absolute;
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 88px;
  z-index: 2;
}
.helmet-box {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 150px;
  border: 2px solid var(--green);
  border-radius: 14px;
}
.helmet-box::before {
  content: "⛑️ Mũ bảo hiểm · 98%";
  position: absolute;
  top: -26px;
  left: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  background: rgba(10, 15, 61, 0.7);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.sign-box {
  position: absolute;
  top: 16%;
  right: 8%;
  width: 60px;
  height: 60px;
  border: 2px solid var(--cyan);
  border-radius: 10px;
}
.sign-box::before {
  content: "🚸 Biển báo · 95%";
  position: absolute;
  top: -24px;
  right: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(10, 15, 61, 0.7);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.sign-icon {
  position: absolute;
  top: 10%;
  right: 9%;
  font-size: 26px;
}
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: scanline 2.6s linear infinite;
  box-shadow: 0 0 12px var(--cyan);
}
@keyframes scanline {
  0% {
    top: 4%;
  }
  100% {
    top: 94%;
  }
}
.cam-hud-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  z-index: 3;
}
.rec-dot {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--red);
  font-weight: 700;
}
.rec-dot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse-dot 1s infinite;
}
.cam-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 16px 20px;
}
.ctrl-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  color: #fff;
}
.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}
.ctrl-btn.shutter {
  width: 64px;
  height: 64px;
  background: var(--grad-primary);
  box-shadow: var(--shadow-glow-blue);
  font-size: 22px;
}
.upload-hint {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  padding-bottom: 18px;
}
.result-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--panel-fill);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.accuracy-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.detect-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
}
.detect-item .d-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.detect-item.ok .d-icon {
  background: rgba(52, 211, 153, 0.15);
}
.detect-item.warn .d-icon {
  background: rgba(251, 191, 36, 0.15);
}
.detect-item .d-info {
  flex: 1;
}
.detect-item .d-info b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
}
.detect-item .d-info span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}
.detect-bar {
  width: 60px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  flex-shrink: 0;
}
.detect-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
}
.detect-item.ok .detect-bar i {
  background: var(--green);
  width: 98%;
}
.detect-item.warn .detect-bar i {
  background: var(--yellow);
  width: 76%;
}
.advice-box {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.18),
    rgba(139, 92, 246, 0.14)
  );
  border: 1px solid var(--glass-border);
}
.advice-box h4 {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Baloo 2", sans-serif;
}
.advice-box p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.6;
}
.result-actions {
  display: flex;
  gap: 10px;
}
.history-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.hist-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  position: relative;
}
.hist-thumb .hist-status {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  border: 2px solid var(--bg-deep-1);
}
.hist-thumb.ok .hist-status {
  background: var(--green);
}
.hist-thumb.warn .hist-status {
  background: var(--yellow);
}
.catalog {
  padding: 60px 0 90px;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.cat-card {
  padding: 20px;
  border-radius: 16px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  text-align: center;
  transition:
    transform 0.3s,
    border-color 0.3s;
}
.cat-card:hover {
  transform: translateY(-6px);
  border-color: var(--cyan);
}
.cat-card .ic {
  font-size: 30px;
  margin-bottom: 10px;
}
.cat-card h5 {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 4px;
  font-family: "Baloo 2", sans-serif;
}
.cat-card span {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
}

/* =======================================================================
   AI MÔ PHỎNG GIAO THÔNG
   ======================================================================= */
.sim-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 22px;
  padding-bottom: 30px;
}
.board-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--panel-fill);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.board-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.board-top h3 {
  font-size: 15.5px;
  font-weight: 700;
  font-family: "Baloo 2", sans-serif;
}
.score-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: var(--grad-primary);
  padding: 7px 13px;
  border-radius: 999px;
}
.board {
  position: relative;
  height: 420px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, #12173f, #0a0e26);
  border: 1px solid var(--glass-border);
}
.board.night {
  background: linear-gradient(160deg, #070a1c, #03040c);
}
.board.rain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    100deg,
    transparent 0 8px,
    rgba(150, 190, 255, 0.07) 8px 9px
  );
  animation: rainfall 0.4s linear infinite;
}
@keyframes rainfall {
  0% {
    background-position-y: 0;
  }
  100% {
    background-position-y: 18px;
  }
}
.board.fog::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(180, 200, 230, 0.14);
  backdrop-filter: blur(1.5px);
  z-index: 5;
  pointer-events: none;
}
.road-v {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 76px;
  transform: translateX(-50%);
  background: #1f2650;
}
.road-h {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 76px;
  transform: translateY(-50%);
  background: #1f2650;
}
.lane-mark-v {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background-image: linear-gradient(#6472a8 0 12px, transparent 12px 24px);
  background-size: 2px 24px;
}
.lane-mark-h {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(-50%);
  background-image: linear-gradient(
    90deg,
    #6472a8 0 12px,
    transparent 12px 24px
  );
  background-size: 24px 2px;
}
.crosswalk {
  position: absolute;
  background: repeating-linear-gradient(
    90deg,
    #e8ecfb 0 6px,
    transparent 6px 14px
  );
}
.crosswalk.top {
  top: calc(50% - 38px - 26px);
  left: calc(50% - 38px);
  width: 76px;
  height: 20px;
}
.crosswalk.bottom {
  top: calc(50% + 38px + 6px);
  left: calc(50% - 38px);
  width: 76px;
  height: 20px;
}
.crosswalk.left {
  left: calc(50% - 38px - 26px);
  top: calc(50% - 38px);
  height: 76px;
  width: 20px;
  background: repeating-linear-gradient(
    0deg,
    #e8ecfb 0 6px,
    transparent 6px 14px
  );
}
.crosswalk.right {
  left: calc(50% + 38px + 6px);
  top: calc(50% - 38px);
  height: 76px;
  width: 20px;
  background: repeating-linear-gradient(
    0deg,
    #e8ecfb 0 6px,
    transparent 6px 14px
  );
}
.signal {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 32px;
  height: 82px;
  border-radius: 10px;
  background: #10143a;
  border: 2px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  padding: 9px 0;
  z-index: 6;
  box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.5);
}
.signal i {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #2c3566;
  transition: all 0.3s;
}
.signal i.red.on {
  background: var(--red);
  box-shadow: 0 0 18px 3px var(--red);
}
.signal i.yellow.on {
  background: var(--yellow);
  box-shadow: 0 0 18px 3px var(--yellow);
}
.signal i.green.on {
  background: var(--green);
  box-shadow: 0 0 18px 3px var(--green);
}
.kid-avatar {
  position: absolute;
  font-size: 34px;
  z-index: 7;
  left: calc(50% - 38px - 16px);
  top: calc(50% - 38px - 40px);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}
.veh {
  position: absolute;
  font-size: 26px;
  z-index: 4;
}
.veh-h {
  animation: driveH linear infinite;
  transform: scaleX(
    -1
  ); /* icon mặc định quay đầu sang trái -> lật để hướng sang phải (chiều di chuyển) */
}
.veh-h.veh-rev {
  animation: driveH-rev linear infinite; /* làn ngược lại: chạy từ phải sang trái, giữ hướng mặc định (đã quay trái) */
}
.veh-v {
  animation: driveV linear infinite;
}
@keyframes driveH {
  0% {
    left: -8%;
  }
  100% {
    left: 108%;
  }
}
@keyframes driveH-rev {
  0% {
    left: 108%;
  }
  100% {
    left: -8%;
  }
}
@keyframes driveV {
  0% {
    top: -10%;
  }
  100% {
    top: 110%;
  }
}
.ai-callout {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(10, 15, 61, 0.75);
  border: 1px solid var(--glass-border);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 8;
}
.action-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.action-btn {
  padding: 13px 8px;
  border-radius: 14px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.action-btn:hover {
  border-color: var(--cyan);
  transform: translateY(-3px);
}
.action-btn .a-ic {
  font-size: 20px;
}
.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.scenario-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.6;
}
.scenario-list {
  list-style: none;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scenario-list li {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.feedback-box {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.feedback-box.empty {
  align-items: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}
.fb-result {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
}
.fb-result.ok {
  color: var(--green);
}
.fb-result.bad {
  color: var(--red);
}
.fb-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.6;
}
.fb-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.history-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.history-item .h-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.history-item .h-dot.ok {
  background: var(--green);
}
.history-item .h-dot.bad {
  background: var(--red);
}
.history-item span.h-txt {
  flex: 1;
  color: rgba(255, 255, 255, 0.6);
}
.history-item span.h-pt {
  color: #fff;
  font-weight: 700;
}

/* =======================================================================
   AI TRUYỆN TRANH
   ======================================================================= */
.path-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 24px 0 8px;
  flex-wrap: wrap;
}
.path-step {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  transition: all 0.3s;
}
.path-step.done {
  background: var(--cyan);
}
.path-step.now {
  background: var(--grad-primary);
  width: 22px;
  border-radius: 6px;
}
.path-line {
  width: 20px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}
.story-wrap {
  padding-bottom: 70px;
}
.story-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--panel-fill);
  overflow: hidden;
}
.scene-visual {
  position: relative;
  height: 460px;
  overflow: hidden;
  background: #10142c;
}
.scene-stage {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04) translateY(10px);
}
.scene-stage.scene-in {
  animation: sceneReveal 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes sceneReveal {
  from {
    opacity: 0;
    transform: scale(1.05) translateY(14px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.scene-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(10, 15, 61, 0.55);
  border: 1px solid var(--glass-border);
  z-index: 3;
}
.chapter-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--grad-primary);
  z-index: 3;
}
.story-body {
  padding: 26px 30px 30px;
}
.speaker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.speaker .sp-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.speaker b {
  font-size: 13.5px;
  font-family: "Baloo 2", sans-serif;
}
.narration {
  font-size: 15.5px;
  line-height: 1.75;
  color: #fff;
  margin-bottom: 24px;
}
.narration .hl {
  color: var(--cyan);
  font-weight: 600;
}
.choice-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  color: #fff;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.choice-btn:hover {
  border-color: var(--cyan);
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}
.choice-btn .c-ic {
  font-size: 18px;
  flex-shrink: 0;
}
.ending-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}
.ending-badge.good {
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.ending-badge.mid {
  background: rgba(251, 191, 36, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.ending-badge.bad {
  background: rgba(244, 63, 94, 0.15);
  color: var(--red);
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.end-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.library {
  padding: 20px 0 80px;
}
.lib-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.lib-card {
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  overflow: hidden;
  transition:
    transform 0.3s,
    border-color 0.3s;
  cursor: pointer;
}
.lib-card:hover {
  transform: translateY(-6px);
  border-color: var(--cyan);
}
.lib-visual {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.25),
    rgba(139, 92, 246, 0.2)
  );
}
.lib-info {
  padding: 14px 16px;
}
.lib-info h5 {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 4px;
  font-family: "Baloo 2", sans-serif;
}
.lib-info span {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
}
.lib-lock {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* =======================================================================
   GAME MINI
   ======================================================================= */
.status-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
  padding: 16px 24px;
  border-radius: 999px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
}
.status-item .s-ic {
  font-size: 17px;
}
.status-div {
  width: 1px;
  height: 20px;
  background: var(--glass-border);
}
.games {
  padding: 36px 0 70px;
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.game-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  overflow: hidden;
  transition:
    transform 0.3s,
    border-color 0.3s;
  position: relative;
  cursor: pointer;
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--cyan);
}
.game-card.locked {
  cursor: default;
  opacity: 0.55;
  filter: grayscale(0.4);
}
.game-card.locked:hover {
  transform: none;
  border-color: var(--glass-border);
}
.game-card.featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-color: rgba(139, 92, 246, 0.4);
}
.game-visual {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 150px;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.28),
    rgba(139, 92, 246, 0.22)
  );
  position: relative;
}
.game-card.featured .game-visual {
  height: auto;
  font-size: 150px;
  position: relative;
  overflow: hidden;
}
.game-card.featured .game-visual::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(139, 92, 246, 0.35),
    transparent 70%
  );
  filter: blur(4px);
  z-index: -1;
}
.game-card.featured .game-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.14) 1.5px,
    transparent 1.5px
  );
  background-size: 22px 22px;
  opacity: 0.5;
  z-index: -1;
}
.game-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 15, 61, 0.6);
  border: 1px solid var(--glass-border);
}
.game-info {
  padding: 16px 18px;
}
.game-info h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  font-family: "Baloo 2", sans-serif;
}
.game-info p {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
}
.reward-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.reward-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
}
.lock-tag {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.featured-info {
  padding: 26px 26px 26px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-info .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--yellow);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  width: fit-content;
}
.featured-info h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  font-family: "Baloo 2", sans-serif;
}
.featured-info p {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 16px;
  max-width: 380px;
}
.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  background: var(--grad-primary);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-glow-blue);
  width: fit-content;
  transition: transform 0.2s;
}
.play-btn:hover {
  transform: translateY(-2px);
}
.game-panel {
  margin-top: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--panel-fill);
  padding: 26px;
  display: none;
}
.game-panel.active {
  display: block;
  animation: fadeIn 0.4s ease both;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.gp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.gp-top h3 {
  font-size: 17px;
  font-weight: 700;
  font-family: "Baloo 2", sans-serif;
}
.gp-close {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
}
.gp-close:hover {
  color: #fff;
  border-color: var(--cyan);
}
.drag-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.sign-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-content: flex-start;
  justify-content: center;
}
.sign-chip {
  width: 132px;
  height: 132px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  cursor: grab;
  transition:
    transform 0.2s,
    opacity 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.4);
}
.sign-chip:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: var(--cyan);
  box-shadow: 0 14px 28px -10px rgba(34, 211, 238, 0.35);
}
.sign-chip.dragging {
  opacity: 0.35;
}
.sign-chip small {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 8px;
  text-align: center;
  line-height: 1.2;
  padding: 0 6px;
}
.drop-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.drop-slot {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 3px dashed var(--glass-border);
  min-height: 88px;
  transition: all 0.2s;
}
.drop-slot.over {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  transform: scale(1.02);
}
.drop-slot.correct {
  border-style: solid;
  border-color: var(--green);
  background: rgba(52, 211, 153, 0.1);
}
.drop-slot.wrong {
  border-style: solid;
  border-color: var(--red);
  background: rgba(244, 63, 94, 0.1);
}
.drop-slot .slot-label {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.4;
}
.drop-slot .slot-filled {
  font-size: 44px;
  flex-shrink: 0;
}
.gp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.gp-score {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gp-actions {
  display: flex;
  gap: 10px;
}

/* =======================================================================
   DASHBOARD — Học sinh / Phụ huynh / Giáo viên / Admin
   ======================================================================= */
.level-card {
  display: flex;
  align-items: center;
  gap: 16px;
}
.level-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}
.prog-item {
  margin-bottom: 14px;
}
.prog-top {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
}
.mission-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  margin-bottom: 10px;
  transition: all 0.2s;
  cursor: pointer;
}
.mission-item.done {
  opacity: 0.5;
}
.mission-item.done .m-text {
  text-decoration: line-through;
}
.m-check {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: all 0.2s;
}
.mission-item.done .m-check {
  background: var(--green);
  border-color: var(--green);
}
.m-text {
  flex: 1;
  font-size: 13px;
}
.m-reward {
  font-size: 11px;
  color: var(--yellow);
  font-weight: 700;
}
.course-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.course-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  transition: all 0.2s;
}
.course-card:hover {
  border-color: var(--cyan);
  transform: translateX(3px);
}
.course-ic {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.25),
    rgba(139, 92, 246, 0.2) 50%,
    rgba(34, 211, 238, 0.22)
  );
  flex-shrink: 0;
}
.course-info {
  flex: 1;
}
.course-info b {
  font-size: 13.5px;
  display: block;
  margin-bottom: 3px;
}
.course-info span {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
}
.course-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple);
  border: 1px solid rgba(139, 92, 246, 0.3);
  flex-shrink: 0;
}
.sched-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
}
.sched-item:last-child {
  border-bottom: none;
}
.sched-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  width: 52px;
  flex-shrink: 0;
}
.sched-info b {
  font-size: 13px;
  display: block;
}
.sched-info span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 150px;
  padding-top: 10px;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}
.bar-fill {
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  background: var(--grad-primary);
  position: relative;
  transition: height 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bar-fill .bar-val {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}
.bar-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
}
.sw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.sw-box {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
}
.sw-box.strong {
  background: rgba(52, 211, 153, 0.06);
  border-color: rgba(52, 211, 153, 0.25);
}
.sw-box.weak {
  background: rgba(244, 63, 94, 0.06);
  border-color: rgba(244, 63, 94, 0.25);
}
.sw-box h5 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sw-box.strong h5 {
  color: var(--green);
}
.sw-box.weak h5 {
  color: var(--red);
}
.sw-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sw-list li {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.68);
  display: flex;
  gap: 8px;
  align-items: center;
}
.risk-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}
.gauge {
  width: 120px;
  height: 120px;
  position: relative;
  flex-shrink: 0;
}
.gauge svg {
  transform: rotate(-90deg);
}
.gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.gauge-label b {
  font-family: "Baloo 2", sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--green);
}
.gauge-label span {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
}
.risk-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.6;
}
.hist-table td b {
  color: #fff;
}
.score-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.score-tag.high {
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
}
.score-tag.mid {
  background: rgba(251, 191, 36, 0.15);
  color: var(--yellow);
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.heat-head {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  margin-bottom: 2px;
}
.heat-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}
.heat-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.42);
}
.heat-legend .lg-cell {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.metric-box {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  text-align: center;
}
.metric-box .m-val {
  font-family: "Baloo 2", sans-serif;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}
.metric-box .m-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 8px;
}

.ai-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  margin-bottom: 10px;
}
.ai-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.ai-info {
  flex: 1;
}
.ai-info b {
  font-size: 13px;
  display: block;
}
.ai-info span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}
.ai-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}
.ai-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.status-dot-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}
.status-dot-row .sdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.status-dot-row.active .sdot {
  background: var(--green);
}
.status-dot-row.pending .sdot {
  background: var(--yellow);
}

.log-console {
  background: rgba(4, 6, 20, 0.65);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px 16px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 11.5px;
  max-height: 220px;
  overflow-y: auto;
}
.log-line {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  color: rgba(255, 255, 255, 0.6);
}
.log-line .lt {
  color: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}
.log-line.info .lv {
  color: var(--cyan);
}
.log-line.warn .lv {
  color: var(--yellow);
}
.log-line.ok .lv {
  color: var(--green);
}

.mod-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  margin-bottom: 8px;
}
.mod-ic {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.mod-info {
  flex: 1;
}
.mod-info b {
  font-size: 12.5px;
  display: block;
}
.mod-info span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}
.mod-actions {
  display: flex;
  gap: 6px;
}
.mini-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--glass-border);
}
.mini-btn.approve {
  color: var(--green);
}
.mini-btn.reject {
  color: var(--red);
}

/* =======================================================================
   TRANG ĐĂNG NHẬP / ĐĂNG KÝ
   ======================================================================= */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}
.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(
      900px 560px at 15% -10%,
      rgba(139, 92, 246, 0.32),
      transparent 60%
    ),
    radial-gradient(
      800px 500px at 100% 10%,
      rgba(34, 211, 238, 0.2),
      transparent 55%
    );
}
.auth-back {
  position: absolute;
  top: 24px;
  left: 28px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}
.auth-back:hover {
  color: var(--cyan);
}
.auth-theme-btn {
  position: absolute;
  top: 20px;
  right: 28px;
  z-index: 2;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: linear-gradient(
    160deg,
    var(--glass-fill-strong),
    rgba(255, 255, 255, 0.03)
  );
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 38px 36px 32px;
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow-soft);
}
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 26px;
}
.auth-brand .logo-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 24px;
  margin-bottom: 14px;
}
.auth-brand h1 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}
.auth-brand p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.role-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 26px;
}
.role-tabs.cols-3 {
  display: flex;
  justify-content: center;
  grid-template-columns: none;
}
.role-tabs.cols-3 .role-tab {
  flex: 0 1 auto;
  padding: 10px 20px;
}
.role-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  background: none;
}
.role-tab .rt-ic {
  font-size: 18px;
}
.role-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.role-tab.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(59, 130, 246, 0.6);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.68);
}
.auth-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  transition: border-color 0.2s;
}
.auth-input-wrap:focus-within {
  border-color: var(--cyan);
}
.auth-input-wrap .fi {
  font-size: 15px;
  opacity: 0.7;
}
.auth-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
}
.auth-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.auth-toggle-pw {
  font-size: 13px;
  cursor: pointer;
  opacity: 0.6;
  background: none;
  border: none;
  color: #fff;
}
.auth-toggle-pw:hover {
  opacity: 1;
}

.auth-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}
.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
}
.auth-check input {
  accent-color: var(--blue);
  width: 15px;
  height: 15px;
}
.auth-link {
  color: var(--cyan);
  font-weight: 600;
}
.auth-link:hover {
  text-decoration: underline;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 13px;
  border-radius: 12px;
  font-size: 14.5px;
  margin-top: 4px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.4);
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}
.auth-foot {
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}
.auth-error {
  font-size: 12.5px;
  color: var(--red);
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 10px 14px;
  border-radius: 10px;
  display: none;
}
.auth-error.show {
  display: block;
}
.auth-success {
  font-size: 12.5px;
  color: var(--green);
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 10px 14px;
  border-radius: 10px;
  display: none;
}
.auth-success.show {
  display: block;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px 24px;
  }
  .role-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =======================================================================
   HỆ THỐNG 5 MINI GAME MỚI — game-engine.js UI
   ======================================================================= */
@keyframes geFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ge-shell {
  max-width: 900px;
  margin: 0 auto;
}

/* Intro screen */
.ge-intro {
  text-align: center;
  padding: 50px 20px 40px;
  animation: geFadeIn 0.4s ease both;
}
.ge-intro-icon {
  font-size: 84px;
  margin-bottom: 18px;
  filter: drop-shadow(0 10px 24px rgba(59, 130, 246, 0.4));
  animation: floaty 3.5s ease-in-out infinite;
}
.ge-intro-title {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 800;
  margin-bottom: 14px;
}
.ge-intro-desc {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.68);
  max-width: 560px;
  margin: 0 auto 24px;
  line-height: 1.7;
}
.ge-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 32px;
}
.ge-feature-chip {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}
.ge-big-btn {
  padding: 16px 34px;
  font-size: 16px;
  border-radius: 16px;
}

/* Instructions screen */
.ge-instructions {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
  animation: geFadeIn 0.4s ease both;
}
.ge-instr-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
}
.ge-instr-list {
  text-align: left;
  list-style: none;
  counter-reset: instr;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}
.ge-instr-list li {
  counter-increment: instr;
  position: relative;
  padding: 14px 18px 14px 52px;
  border-radius: 14px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}
.ge-instr-list li::before {
  content: counter(instr);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  font-weight: 800;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Gameplay shell */
.ge-gameplay {
  animation: geFadeIn 0.35s ease both;
}
.ge-gp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.ge-gp-top h3 {
  font-size: 18px;
  font-weight: 800;
}
.ge-progress-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cyan);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  padding: 6px 14px;
  border-radius: 999px;
}

/* AI comment bubble (dùng chung trong gameplay + kết quả) */
.ge-ai-bubble {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  margin-bottom: 18px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
}
.ge-ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.ge-ai-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  padding-top: 6px;
}
.ge-ai-bubble.ge-ai-good {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.08);
}
.ge-ai-bubble.ge-ai-good .ge-ai-avatar {
  background: linear-gradient(135deg, var(--green), var(--cyan));
}
.ge-ai-bubble.ge-ai-bad {
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.08);
}
.ge-ai-bubble.ge-ai-bad .ge-ai-avatar {
  background: linear-gradient(135deg, var(--red), #f97316);
}

/* Results screen */
.ge-results {
  text-align: center;
  padding: 44px 20px;
  animation: geFadeIn 0.4s ease both;
}
.ge-result-icon {
  font-size: 72px;
  margin-bottom: 12px;
}
.ge-results h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 10px;
}
.ge-result-summary {
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.68);
  max-width: 520px;
  margin: 0 auto 20px;
  line-height: 1.6;
}
.ge-reward-row {
  justify-content: center;
  margin-bottom: 6px;
}
.ge-result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}
.ge-results.ge-win .ge-result-icon {
  animation: floaty 2.5s ease-in-out infinite;
}

/* Common scenario board used across games (crossing/route/map scenes) */
.ge-scene {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(160deg, #12173f, #0a0e26);
  border: 1px solid var(--glass-border);
  min-height: 280px;
}
.ge-scene-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(10, 15, 61, 0.65);
  border: 1px solid var(--glass-border);
}
.ge-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.ge-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 10px;
  border-radius: 16px;
  background: var(--glass-fill);
  border: 2px solid var(--glass-border);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 600;
}
.ge-choice-btn .gc-ic {
  font-size: 32px;
}
.ge-choice-btn:hover {
  border-color: var(--cyan);
  transform: translateY(-4px);
}
.ge-choice-btn.selected-ok {
  border-color: var(--green);
  background: rgba(52, 211, 153, 0.12);
}
.ge-choice-btn.selected-bad {
  border-color: var(--red);
  background: rgba(244, 63, 94, 0.12);
}
.ge-choice-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

/* Route cards (Game 4) */
.ge-route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.ge-route-card {
  border-radius: 18px;
  padding: 22px;
  background: var(--glass-fill);
  border: 2px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.ge-route-card:hover {
  border-color: var(--cyan);
  transform: translateY(-4px);
}
.ge-route-card h4 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
}
.ge-route-hazards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ge-route-hazards span {
  font-size: 14.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.ge-route-card.selected-ok {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}
.ge-route-card.selected-bad {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.2);
}

/* City hero hotspots (Game 5) */
.ge-city-board {
  position: relative;
  min-height: 460px;
  background: linear-gradient(160deg, #1a1450, #0a0e26);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  overflow: hidden;
}
.ge-hotspot {
  position: absolute;
  width: 104px;
  height: 104px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  cursor: pointer;
  transition: all 0.2s;
}
.ge-hotspot:hover {
  border-color: var(--cyan);
  transform: scale(1.05);
}
.ge-hotspot.fixed {
  background: rgba(52, 211, 153, 0.18);
  border-color: var(--green);
  cursor: default;
  transform: none;
}
.ge-hotspot.wrong-flash {
  background: rgba(244, 63, 94, 0.22);
  border-color: var(--red);
}
.ge-city-progress {
  margin-top: 16px;
}

/* Sign detective grid (Game 3) */
.ge-sign-map {
  position: relative;
  min-height: 520px;
  background: linear-gradient(160deg, #12173f, #0a0e26);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  overflow: hidden;
}
.ge-sign-item {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 3px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 84px;
  cursor: pointer;
  transition: all 0.2s;
}
.ge-sign-item:hover {
  border-color: var(--cyan);
  transform: scale(1.06);
}
.ge-sign-item.found {
  border-color: var(--green);
  background: rgba(52, 211, 153, 0.15);
  cursor: default;
}
.ge-collection {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.ge-collection-item {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.ge-collection-item.empty {
  opacity: 0.25;
}

/* Helmet game steps (Game 2) — mỗi lựa chọn có ảnh minh hoạ đầu + mũ riêng để so sánh trực quan */
.helmet-options {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.helmet-choice {
  padding: 18px 14px 16px;
}
.helmet-preview {
  position: relative;
  width: 108px;
  height: 116px;
  margin: 0 auto 10px;
}
.helmet-preview svg {
  display: block;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}
.hp-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-deep-2);
  border: 2px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  z-index: 3;
}
.helmet-choice-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}
.helmet-choice.selected-ok .hp-badge {
  background: rgba(52, 211, 153, 0.9);
  border-color: var(--green);
}
.helmet-choice.selected-bad .hp-badge {
  background: rgba(244, 63, 94, 0.9);
  border-color: var(--red);
}

/* Nút Hướng dẫn nổi (xem theo yêu cầu) + modal */
.ge-help-fab {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 150;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--grad-primary);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 26px -8px rgba(59, 130, 246, 0.55);
  transition: transform 0.2s;
}
.ge-help-fab:hover {
  transform: translateY(-3px) scale(1.03);
}
.ge-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 6, 20, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: geFadeIn 0.25s ease both;
}
.ge-modal-box {
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  background: linear-gradient(
    160deg,
    var(--glass-fill-strong),
    rgba(255, 255, 255, 0.03)
  );
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 26px;
}
.ge-modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.ge-modal-top h3 {
  font-size: 17px;
  font-weight: 800;
}
.ge-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

/* ===================== Mô phỏng qua đường thật (Game 1) ===================== */
.cross-sim {
  position: relative;
  height: 520px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: linear-gradient(180deg, #1a2140 0%, #141a35 55%, #10142a 100%);
}
.cross-sim.is-night {
  background: linear-gradient(180deg, #060814 0%, #0a0e1f 55%, #0d1120 100%);
}
.cross-sim.is-rain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background: repeating-linear-gradient(
    100deg,
    transparent 0 10px,
    rgba(150, 190, 255, 0.08) 10px 11px
  );
  animation: rainfall 0.35s linear infinite;
}
.cs-sidewalk {
  position: absolute;
  left: 0;
  right: 0;
  height: 15%;
  background: #2a3358;
}
.cs-sidewalk.top {
  top: 0;
}
.cs-sidewalk.bottom {
  bottom: 0;
}
.cs-sidewalk-texture {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0 2px,
    transparent 2px 30px
  );
}
.cs-goal-flag {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 26px;
}
.cs-road {
  position: absolute;
  left: 0;
  right: 0;
  top: 15%;
  bottom: 15%;
  background: #23283f;
  display: flex;
  flex-direction: column;
}
.cs-lane {
  position: relative;
  flex: 1 1 0;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.22);
}
.cs-lane:last-child {
  border-bottom: none;
}
.cs-crosswalk {
  position: absolute;
  left: 50%;
  top: 15%;
  bottom: 15%;
  width: 84px;
  transform: translateX(-50%);
  z-index: 2;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.85) 0 12px,
    transparent 12px 28px
  );
  opacity: 0.65;
}
.cs-stopline {
  position: absolute;
  left: calc(50% - 42px);
  width: 2px;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.35);
}
.cs-car {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 42px;
  z-index: 3;
  transition: left 0.05s linear;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}
.cs-car.flip {
  transform: translate(-50%, -50%) scaleX(-1);
}
.cs-player {
  position: absolute;
  left: 50%;
  transform: translate(-50%, 0);
  z-index: 5;
  transition: bottom 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
}
.cs-player svg {
  width: 56px;
  height: 76px;
  display: block;
}
.cs-player.crashed {
  animation: csShake 0.4s ease;
}
@keyframes csShake {
  0%,
  100% {
    transform: translate(-50%, 0) rotate(0);
  }
  25% {
    transform: translate(-58%, 0) rotate(-12deg);
  }
  75% {
    transform: translate(-42%, 0) rotate(12deg);
  }
}
.cs-signal-box {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: rgba(6, 9, 22, 0.75);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 16px 18px;
  backdrop-filter: blur(6px);
}
.cs-trafficlight {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0b0f22;
  border: 2px solid #1e2340;
}
.cs-trafficlight i {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2a3358;
  transition: all 0.25s;
}
.cs-trafficlight i.red.on {
  background: var(--red);
  box-shadow: 0 0 18px var(--red);
}
.cs-trafficlight i.yellow.on {
  background: var(--yellow);
  box-shadow: 0 0 18px var(--yellow);
}
.cs-trafficlight i.green.on {
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}
.cs-ped-icon {
  font-size: 46px;
  line-height: 1;
  transition: opacity 0.2s;
}
.cs-ped-icon.blink {
  animation: pulse-dot 0.5s infinite;
}
.cs-signal-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
}
.cs-signal-label.walk {
  color: var(--green);
}
.cs-signal-label.warn {
  color: var(--yellow);
}
.cs-signal-label.stop {
  color: var(--red);
}
.cs-timer-bar {
  width: 84px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.cs-timer-bar i {
  display: block;
  height: 100%;
}
.cs-hud-top {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 8;
  display: flex;
  gap: 10px;
  align-items: center;
}
.cs-hud-chip {
  background: rgba(6, 9, 22, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 700;
}
.cs-lives {
  display: flex;
  gap: 3px;
  font-size: 16px;
}
.cs-controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}
.cs-move-btn {
  padding: 16px 30px;
  border-radius: 16px;
  background: var(--grad-primary);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 24px -8px rgba(59, 130, 246, 0.55);
  transition: transform 0.15s;
}
.cs-move-btn:hover {
  transform: translateY(-2px);
}
.cs-move-btn:active {
  transform: scale(0.96);
}
.cs-move-btn.secondary {
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  box-shadow: none;
}
.cs-hint {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 10px;
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1080px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .side-back,
  .side-divider {
    display: none;
  }
  .sidebar-foot {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
  }
  .stat-row,
  .stat-row.cols-5 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .sw-grid {
    grid-template-columns: 1fr;
  }
  .cam-layout,
  .sim-layout {
    grid-template-columns: 1fr;
  }
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .game-grid {
    grid-template-columns: 1fr 1fr;
  }
  .game-card.featured {
    grid-column: span 2;
    grid-template-columns: 1fr;
  }
  .drag-area {
    grid-template-columns: 1fr;
  }
  .lib-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .action-row {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .main {
    padding: 20px 16px 40px;
  }
  .ge-sign-item {
    width: 100px;
    height: 100px;
    font-size: 46px;
    border-radius: 20px;
  }
  .ge-sign-map {
    min-height: 380px;
  }
  .stat-row,
  .stat-row.cols-5 {
    grid-template-columns: 1fr 1fr;
  }
  .data-table,
  .hist-table {
    display: block;
    overflow-x: auto;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .cat-grid,
  .game-grid,
  .lib-grid {
    grid-template-columns: 1fr;
  }
  .game-card.featured {
    grid-column: span 1;
  }
  .board {
    height: 320px;
  }
  .cam-view {
    height: 320px;
  }
  .action-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .cross-sim {
    height: 420px;
  }
  .cs-player svg {
    width: 36px;
    height: 49px;
  }
  .cs-car {
    font-size: 34px;
  }
  .cs-move-btn {
    padding: 14px 20px;
    font-size: 13.5px;
  }
  .ge-help-fab {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    font-size: 12.5px;
  }
}
