/* Giao diện trang chủ cổng game Học Viện Alee */

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
.section { padding: 56px 0; }
.section-head { max-width: 720px; margin: 0 auto 28px; text-align: center; }
.section-head h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
.section-head p { margin: 0; color: var(--text-soft); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 4px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Thanh điều hướng ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.topnav .container { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand img { width: 42px; height: 42px; }
.brand b { font-family: var(--font-display); font-size: 1.2rem; font-weight: 900; letter-spacing: -0.01em; }
.brand b span { color: var(--primary); }
.nav-links { display: flex; gap: 4px; margin: 0 auto 0 12px; }
.nav-links a {
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-actions { display: flex; gap: 8px; margin-left: auto; }
.nav-actions .btn { min-height: 44px; padding: 0.3em 1em; font-size: 0.8rem; }
/* Chữ trên thanh điều hướng luôn nằm một dòng. Mục không đủ chỗ được JS ẩn bớt (fitNav trong index.html);
   overflow: hidden để dù chưa kịp đo cũng không đè lên nút bên phải. */
.brand, .nav-actions { flex: none; }
.brand b, .nav-links a, .nav-actions .btn { white-space: nowrap; }
.nav-links { flex: 1 1 auto; min-width: 0; overflow: hidden; margin-right: 0; }
.nav-actions { margin-left: 0; }

/* Biểu tượng nét vẽ (thay emoji) */
.i { flex: none; width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-svg { color: var(--k, var(--primary)); }
.trust li span { color: var(--primary); }
.trust li span .i { width: 16px; height: 16px; }
.ico-svg .i { width: 30px; height: 30px; stroke-width: 1.8; }
.teach .ico-svg { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: color-mix(in srgb, var(--primary) 12%, transparent); }

/* ---------- Phần mở đầu ---------- */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 56px 0 40px; }
.hero h1 { margin-bottom: 0.4em; font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.08; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--primary), #c04fe0 55%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lead { max-width: 560px; margin: 0 0 24px; color: var(--text-soft); font-size: 1.02rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 24px 0 0; padding: 0; list-style: none; }
.trust li { display: flex; align-items: center; gap: 6px; color: var(--text-soft); font-size: 0.78rem; font-weight: 800; }
.trust li span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); font-size: 0.85rem; }

/* Hình minh họa: máy tính có Alee và các biểu tượng bay quanh */
.hero-art { position: relative; aspect-ratio: 1.12; max-width: 560px; justify-self: center; width: 100%; }
.hero-art .blob {
  position: absolute;
  inset: 6% 4% 10%;
  border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%;
  background: linear-gradient(140deg, #dcd5ff, #ffe1d4 70%, #d9f2ff);
  filter: saturate(1.1);
}
.laptop { position: absolute; left: 12%; right: 12%; top: 20%; }
.laptop-screen {
  position: relative;
  aspect-ratio: 16 / 10;
  padding: 3.5%;
  border-radius: 18px 18px 6px 6px;
  background: #2b2a4a;
  box-shadow: var(--shadow-lg);
}
.laptop-screen > div {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: radial-gradient(120% 90% at 50% 0%, #8b74f7, #4636c2 70%);
}
.laptop-screen img { width: 44%; animation: float 3.4s ease-in-out infinite; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.3)); }
.laptop-screen .scr-bar { position: absolute; left: 6%; right: 6%; bottom: 8%; height: 7%; border-radius: 99px; background: rgba(255, 255, 255, 0.18); }
.laptop-screen .scr-bar i { display: block; width: 62%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffd45c, #ff7a59); }
.laptop-screen .scr-stars { position: absolute; top: 7%; right: 6%; color: #ffd45c; font-size: clamp(0.7rem, 1.6vw, 1rem); letter-spacing: 2px; }
.laptop-base { height: 14px; margin: 0 -7%; border-radius: 4px 4px 16px 16px; background: linear-gradient(180deg, #d6d2e6, #b9b4cc); }
.float-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
  animation: float 4s ease-in-out infinite;
}
.float-chip img { width: 48px; height: auto; margin: -6px 0; }
.float-chip:nth-of-type(2) { animation-delay: -1s; }
.float-chip:nth-of-type(3) { animation-delay: -2s; }
.float-chip:nth-of-type(4) { animation-delay: -3s; }
.float-chip:nth-of-type(5) { animation-delay: -1.5s; }

/* ---------- Dải số liệu ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px; }
.stats > div { padding: 18px 12px; text-align: center; }
.stats > div + div { border-left: 1px solid var(--border); }
.stats b { display: block; font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 900; line-height: 1.1; color: var(--primary); }
.stats small { color: var(--text-soft); font-size: 0.75rem; font-weight: 800; }

/* ---------- Lộ trình học: mỗi bước một hàng (hình · nội dung · trò chơi) ---------- */
.s-1 { --s: #14a38b; }
.s-2 { --s: #3a7bde; }
.s-3 { --s: #7258f0; }
.s-4 { --s: #d63f6f; }
.s-5 { --s: #e8613c; }
.path { position: relative; display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.path::before { content: ""; position: absolute; top: 40px; bottom: 40px; left: 94px; width: 4px; border-radius: 4px; background: linear-gradient(180deg, #4fd1a5, #3a7bde, #8b74f7, #d63f6f, #ff7a59); }
.path-step { position: relative; display: grid; grid-template-columns: 160px minmax(0, 1fr) minmax(0, 1.35fr); gap: 24px; align-items: center; padding: 16px 22px 16px 16px; }
.path-step::after { content: ""; position: absolute; inset: 18px auto 18px 0; width: 5px; border-radius: 0 5px 5px 0; background: var(--s); }
.path-art { position: relative; display: grid; place-items: center; height: 112px; border-radius: 18px; background: radial-gradient(circle at 50% 40%, #fff, color-mix(in srgb, var(--s) 16%, #f4f2fb)); }
.path-art img { width: 120px; height: 92px; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(31, 27, 61, 0.18)); }
.path-no { position: absolute; top: 8px; left: 8px; padding: 3px 11px; border-radius: 999px; background: var(--s); color: #fff; font-size: 0.68rem; font-weight: 900; }
.path-text { display: flex; flex-direction: column; gap: 4px; }
.path-step h3 { margin: 0; font-size: 1.15rem; }
.path-age { color: var(--s); font-size: 0.72rem; font-weight: 900; }
.path-step p { margin: 0; color: var(--text-soft); font-size: 0.8rem; }
.path-games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.path-games a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px 6px 6px; line-height: 1.25; border-radius: 14px; background: var(--surface-2); color: var(--text); font-size: 0.78rem; font-weight: 800; text-decoration: none; transition: background 0.15s; }
.path-games a:hover { background: color-mix(in srgb, var(--s) 14%, var(--surface-2)); }
.path-games img { flex: none; width: 52px; height: 34px; border-radius: 8px; object-fit: cover; }
.path-more { margin: 22px 0 0; text-align: center; }
.meta .meta-step { background: color-mix(in srgb, var(--s, var(--primary)) 13%, transparent); color: var(--s, var(--primary)); }

/* ---------- Học Viện AI nổi bật ---------- */
.feature {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
  overflow: hidden;
  padding: 40px;
  border-radius: 32px;
  background:
    radial-gradient(500px 300px at 90% 10%, rgba(255, 122, 89, 0.35), transparent 70%),
    radial-gradient(600px 400px at 0% 100%, rgba(79, 209, 165, 0.25), transparent 70%),
    linear-gradient(135deg, #2b2370, #4636c2);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.feature .eyebrow { background: rgba(255, 255, 255, 0.14); color: #fff; }
.feature h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
.feature p { margin: 0 0 20px; color: rgba(255, 255, 255, 0.82); }
.tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; }
.tiers li { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.08); }
.tiers li b { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, var(--c1), var(--c2)); font-size: 0.85rem; }
.tiers li span { font-size: 0.78rem; font-weight: 800; line-height: 1.3; }
.tiers li small { display: block; color: rgba(255, 255, 255, 0.65); font-weight: 700; }
.feature-art { overflow: hidden; border-radius: 22px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5); transform: rotate(2deg); }
.feature-art img { width: 100%; }

/* ---------- Kho trò chơi ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: center; margin: 0 0 28px; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: center; padding: 6px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.filter-label { margin: 0 4px 0 10px; color: var(--text-soft); font-size: 0.75rem; font-weight: 900; }
.chip {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--surface); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.grid-caption { margin: -12px 0 20px; color: var(--text-soft); font-size: 0.85rem; font-weight: 800; text-align: center; }
.grid-caption b { color: var(--s, var(--text)); }
.game-card { display: flex; flex-direction: column; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.game-cover { position: relative; display: block; aspect-ratio: 5 / 3; overflow: hidden; background: var(--surface-2); }
.game-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s; }
.game-card:hover .game-cover img { transform: scale(1.04); }
.badge-flag { position: absolute; top: 10px; right: 10px; padding: 3px 12px; border-radius: 999px; color: #fff; font-size: 0.7rem; font-weight: 900; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.35); }
.badge-flag.new { background: #1fae7a; }
.badge-flag.hot { background: #e8613c; }
.game-info { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 16px 18px 18px; }
.game-info h3 { margin: 0; font-size: 1.08rem; }
.game-info p { margin: 0; color: var(--text-soft); font-size: 0.8rem; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 2px; }
.meta span { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 0.7rem; font-weight: 800; color: var(--text-soft); }
.tag { padding: 3px 12px; border-radius: 999px; background: var(--text-soft); color: #fff; font-size: 0.7rem; font-weight: 900; }
.game-actions { display: flex; gap: 10px; margin-top: 6px; }
.game-actions .btn { flex: 1; min-height: 48px; padding: 0.4em 0.8em; font-size: 0.85rem; }
.empty { grid-column: 1 / -1; padding: 32px; color: var(--text-soft); text-align: center; }

/* ---------- Vì sao chọn ---------- */
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.why article { padding: 24px; }
.why .ico { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 14px; border-radius: 16px; background: var(--c); font-size: 1.5rem; }
.why h3 { font-size: 1.02rem; }
.why p { margin: 0; color: var(--text-soft); font-size: 0.8rem; }

/* ---------- Thầy cô và phụ huynh ---------- */
.teach { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.teach article { display: flex; flex-direction: column; gap: 10px; padding: 26px; }
.teach .ico { font-size: 2rem; }
.teach h3 { margin: 0; font-size: 1.1rem; }
.teach p { flex: 1; margin: 0; color: var(--text-soft); font-size: 0.8rem; }
.teach .btn { align-self: flex-start; font-size: 0.85rem; }
.guide { margin-top: 20px; padding: 6px 24px; }
.guide summary { padding: 14px 0; font-weight: 900; cursor: pointer; }
.guide ul { margin: 0 0 18px; padding-left: 1.2em; color: var(--text-soft); font-size: 0.82rem; }
.guide li + li { margin-top: 6px; }

/* ---------- Giới thiệu, bản quyền ---------- */
.about { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }
.about article { padding: 28px; }
.about h3 { margin: 18px 0 8px; font-size: 1.05rem; }
.about p, .about li { color: var(--text-soft); font-size: 0.85rem; }
.about p { margin: 0 0 10px; }
.about ul { margin: 0; padding-left: 1.2em; }
.about li + li { margin-top: 6px; }
.about-ai { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.about-badge { padding: 5px 14px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font-size: 0.75rem; font-weight: 900; }
.about-badge.ok { background: #e3f8ee; color: #14805a; }
.about-copy { display: flex; flex-direction: column; border-top: 6px solid var(--primary); }
.about-copy h3 { margin-top: 0; }
.about-site { margin: auto 0 0 !important; padding-top: 14px; border-top: 1px solid var(--border); font-weight: 800; color: var(--text) !important; }

/* ---------- Chân trang ---------- */
.site-footer { margin-top: 32px; padding: 40px 0 32px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.site-footer .container { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 28px; }
.site-footer p { margin: 10px 0 0; color: var(--text-soft); font-size: 0.78rem; }
.site-footer h4 { margin: 0 0 10px; font-size: 0.8rem; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li a { display: inline-block; padding: 4px 0; color: var(--text-soft); font-size: 0.78rem; font-weight: 700; text-decoration: none; }
.site-footer li a:hover { color: var(--primary); }
.site-footer .copy a { color: var(--primary); font-weight: 800; }
.site-footer .copy { grid-column: 1 / -1; line-height: 1.7; margin: 8px 0 0; padding-top: 18px; border-top: 1px solid var(--border); text-align: center; }

@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .hero, .feature { grid-template-columns: 1fr; }
  .hero { padding-top: 32px; text-align: center; }
  .hero .lead { margin-inline: auto; }
  .hero-cta, .trust { justify-content: center; }
  .hero-art { max-width: 460px; }
  .why, .teach { grid-template-columns: 1fr 1fr; }
  .about { grid-template-columns: 1fr; }
  .path::before { display: none; }
  .path-step { grid-template-columns: 120px minmax(0, 1fr); gap: 16px 20px; }
  .path-art { height: 96px; }
  .path-art img { width: 96px; height: 74px; }
  .path-games { grid-column: 1 / -1; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .feature { padding: 28px; }
  .feature-art { display: none; }
}
@media (max-width: 640px) {
  .section { padding: 40px 0; }
  .nav-actions .nav-class { display: none; }
  /* màn hẹp: nút Cài vào máy chỉ còn biểu tượng để thanh trên không tràn */
  .nav-actions .nav-lbl { display: none; }
  .nav-actions .btn { padding: 0 12px; }
  .brand b { font-size: 1.05rem; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .why, .teach, .tiers { grid-template-columns: 1fr; }
  .path-step { grid-template-columns: 84px minmax(0, 1fr); gap: 12px 14px; padding: 14px; }
  .path-art { height: 76px; }
  .path-art img { width: 64px; height: 50px; }
  .path-no { top: auto; bottom: 6px; left: 50%; transform: translateX(-50%); font-size: 0.6rem; padding: 2px 8px; white-space: nowrap; }
  .path-games { grid-template-columns: 1fr; }
  .site-footer .container { grid-template-columns: 1fr; }
  .float-chip { font-size: 0.62rem; }
  .float-chip img { width: 34px; }
  .filter-group { border-radius: 22px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .game-info { padding: 12px; gap: 6px; }
  .game-info h3 { font-size: 0.95rem; }
  .game-info p { -webkit-line-clamp: 2; line-clamp: 2; font-size: 0.75rem; }
  .meta span:not(.meta-step) { display: none; }
}

@keyframes float { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .float-chip, .laptop-screen img { animation: none; }
}
