/* =========================================================
   TRANG CHỦ — ĐỘI ĐẶC NHIỆM NHÍ
   ========================================================= */

:root {
  --ink: #17324d;
  --muted: #64748b;
  --teal: #0f766e;
  --teal2: #14b8a6;
  --orange: #f97316;
  --yellow: #fbbf24;
  --purple: #8b5cf6;
}

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


/* =========================================================
   KHÓA SCROLL — Trang chủ không lướt
   ========================================================= */

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;                /* ← KHÓA scroll */
  overscroll-behavior: none;       /* chặn bounce trên iOS */
  -webkit-text-size-adjust: 100%;
  font-family: "Nunito", Inter, ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}

body {
  background: linear-gradient(
    180deg,
    #dff6ff 0%,
    #f8fdff 52%,
    #ecfdf5 100%
  );
}

button {
  font: inherit;
  border: none;
  cursor: pointer;
}

button:focus-visible {
  outline: 4px solid rgba(20, 184, 166, 0.35);
  outline-offset: 3px;
}


/* =========================================================
   DECOR NỀN
   ========================================================= */

#home {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;                 /* tốt hơn cho mobile, không tính thanh địa chỉ */
  overflow: hidden;
  padding-top: 76px;              /* chừa chỗ cho nav float */
  box-sizing: border-box;
}

.sky-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      60% 45% at 50% 0%,
      rgba(255, 255, 255, 0.7) 0%,
      transparent 70%
    );
}

.sun {
  position: absolute;
  top: -70px;
  right: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 50% 50%,
      #fef3c7 0%,
      #fde68a 40%,
      rgba(253, 230, 138, 0) 70%
    );
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
}

.cloud {
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  filter: blur(1px);
  z-index: 0;
  animation: cloud-move 60s linear infinite;
}

.cloud.c1 {
  width: 170px; height: 60px;
  top: 12%; left: 5%;
  animation-duration: 70s;
}

.cloud.c2 {
  width: 220px; height: 80px;
  top: 24%; right: 6%;
  animation-duration: 85s;
  animation-direction: reverse;
}

.cloud.c3 {
  width: 140px; height: 50px;
  top: 48%; left: 20%;
  animation-duration: 95s;
  opacity: 0.6;
}

@keyframes cloud-move {
  from { transform: translateX(-30px); }
  to   { transform: translateX(30px); }
}

.hill {
  position: absolute;
  bottom: -120px;
  pointer-events: none;
  border-radius: 50%;
  z-index: 0;
}

.hill.h1 {
  width: 620px; height: 340px;
  left: -160px;
  background: linear-gradient(180deg, #86efac, #4ade80);
  opacity: 0.35;
}

.hill.h2 {
  width: 520px; height: 300px;
  right: -120px;
  background: linear-gradient(180deg, #6ee7b7, #34d399);
  opacity: 0.3;
}


/* =========================================================
   MAIN — căn giữa, KHÔNG vượt quá viewport
   ========================================================= */

.home-main {
  position: relative;
  z-index: 2;

  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 12px 18px;
  box-sizing: border-box;

  overflow: hidden;                /* ngăn tràn nếu panel quá cao */
}

.home-panel {
  width: min(680px, 100%);
  max-height: 100%;                /* không vượt quá main */
  overflow-y: auto;                /* nếu panel quá cao → tự cuộn bên trong */
  overflow-x: hidden;

  padding: clamp(24px, 4.5vw, 42px);

  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 32px;

  box-shadow:
    0 30px 80px -20px rgba(15, 118, 110, 0.35),
    0 12px 40px -12px rgba(15, 23, 42, 0.12);

  text-align: center;

  animation: fadeUp 0.5s cubic-bezier(.2, .9, .3, 1) both;

  /* Ẩn scrollbar của panel nếu không cần thiết */
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 118, 110, 0.3) transparent;
}

.home-panel::-webkit-scrollbar {
  width: 6px;
}

.home-panel::-webkit-scrollbar-thumb {
  background: rgba(15, 118, 110, 0.3);
  border-radius: 999px;
}

.home-panel::-webkit-scrollbar-track {
  background: transparent;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}


/* =========================================================
   LOGO
   ========================================================= */

.home-logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 30px;
  background: linear-gradient(145deg, #14b8a6, #0f766e);
  color: #fff;
  font-size: 44px;
  box-shadow:
    0 18px 40px -10px rgba(15, 118, 110, 0.55),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
  transform: rotate(-3deg);
  animation: logo-bounce 3s ease-in-out infinite;
}

@keyframes logo-bounce {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50%      { transform: rotate(-3deg) translateY(-6px); }
}


/* =========================================================
   TITLE
   ========================================================= */

.home-eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.home-title {
  margin: 0 0 10px;
  font-family: "Baloo 2", "Nunito", sans-serif;
  font-size: clamp(28px, 5.5vw, 40px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--teal);
}

.home-lead {
  margin: 0 auto 24px;
  max-width: 460px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.6;
}


/* =========================================================
   3 NÚT CHÍNH
   ========================================================= */

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.home-card {
  position: relative;

  display: flex;
  align-items: center;
  gap: 14px;

  padding: 16px 18px;

  border-radius: 20px;

  color: #fff;
  text-align: left;

  box-shadow:
    0 12px 28px -8px rgba(15, 23, 42, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);

  overflow: hidden;

  transition:
    transform 0.2s cubic-bezier(.2, .9, .3, 1),
    box-shadow 0.25s ease,
    filter 0.25s ease;
}

.home-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transform: skewX(-20deg);
  pointer-events: none;
  transition: left 0.7s ease;
}

.home-card:hover {
  transform: translateY(-3px) scale(1.008);
  box-shadow:
    0 20px 40px -10px rgba(15, 23, 42, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  filter: brightness(1.05);
}

.home-card:hover::before {
  left: 125%;
}

.home-card:active {
  transform: translateY(0) scale(0.99);
  box-shadow:
    0 6px 16px -4px rgba(15, 23, 42, 0.24);
}

.home-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 26px;
  backdrop-filter: blur(4px);
}

.home-card-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.home-card-text strong {
  font-family: "Baloo 2", "Nunito", sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1.2;
}

.home-card-text small {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.92;
  line-height: 1.35;
}

.home-card-arrow {
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 900;
  opacity: 0.8;
  transition: transform 0.25s ease;
}

.home-card:hover .home-card-arrow {
  transform: translateX(4px);
}


/* =========================================================
   MÀU TỪNG NÚT
   ========================================================= */

.home-card-game {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}

.home-card-quiz {
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
}

.home-card-knowledge {
  background: linear-gradient(135deg, #ea580c 0%, #fbbf24 100%);
}


/* =========================================================
   NOTE
   ========================================================= */

.home-note {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}


/* =========================================================
   MÀN HÌNH THẤP — cho phép panel cuộn bên trong
   ========================================================= */

@media (max-height: 720px) {

  #home {
    padding-top: 68px;
  }

  .home-main {
    padding: 8px 14px;
  }

  .home-panel {
    padding: 20px 22px;
  }

  .home-logo {
    width: 72px;
    height: 72px;
    font-size: 36px;
    margin-bottom: 10px;
  }

  .home-title {
    font-size: 26px;
  }

  .home-lead {
    margin-bottom: 18px;
  }

  .home-card {
    padding: 13px 16px;
  }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 500px) {

  #home {
    padding-top: 66px;
  }

  .home-main {
    padding: 10px 12px;
  }

  .home-panel {
    padding: 22px 18px 20px;
    border-radius: 24px;
  }

  .home-logo {
    width: 72px;
    height: 72px;
    font-size: 36px;
    margin-bottom: 12px;
    border-radius: 24px;
  }

  .home-title {
    font-size: 26px;
  }

  .home-lead {
    font-size: 13.5px;
    margin-bottom: 20px;
  }

  .home-card {
    padding: 14px 15px;
    border-radius: 17px;
    gap: 12px;
  }

  .home-card-icon {
    width: 42px;
    height: 42px;
    font-size: 22px;
    border-radius: 12px;
  }

  .home-card-text strong {
    font-size: 13.5px;
  }

  .home-card-text small {
    font-size: 11px;
  }

  .home-card-arrow {
    font-size: 17px;
  }

  .home-note {
    font-size: 11px;
  }
}


/* =========================================================
   ĐIỆN THOẠI NẰM NGANG — thu gọn tối đa
   ========================================================= */

@media (max-height: 500px) and (orientation: landscape) {

  #home {
    padding-top: 58px;
  }

  .home-main {
    padding: 6px 12px;
    align-items: flex-start;
  }

  .home-panel {
    padding: 14px 20px;
    max-height: calc(100dvh - 70px);
  }

  .home-logo {
    width: 48px;
    height: 48px;
    font-size: 24px;
    margin-bottom: 6px;
    border-radius: 16px;
  }

  .home-eyebrow {
    font-size: 10px;
  }

  .home-title {
    font-size: 20px;
    margin-bottom: 4px;
  }

  .home-lead {
    font-size: 12px;
    margin-bottom: 12px;
  }

  .home-card {
    padding: 10px 14px;
    gap: 10px;
  }

  .home-card-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .home-card-text strong {
    font-size: 12.5px;
  }

  .home-card-text small {
    display: none;                /* ẩn sub-text để tiết kiệm chỗ */
  }

  .home-note {
    display: none;
  }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  .cloud,
  .home-logo {
    animation: none;
  }

  .home-panel,
  .home-card,
  .home-card::before,
  .home-card-arrow {
    transition: none;
  }
}