/* ============================================================
   edu.hivanthanh.com – Global Styles
   Palette watercolor pastel: #F7F7EB · #FAEEDC · #FAE4DF · #DAE7EA · #F9E9D0
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream:   #F7F7EB;   /* nền trang chính – trắng kem    */
  --peach:   #FAEEDC;   /* nền card, section phụ           */
  --blush:   #FAE4DF;   /* accent hồng nhạt                */
  --sky:     #DAE7EA;   /* accent xanh da trời             */
  --sand:    #F9E9D0;   /* vàng cát ấm                     */

  /* Text tones – warm neutral */
  --text:    #3D2B1F;   /* nâu đậm – dễ đọc               */
  --mid:     #7A5C4A;   /* nâu trung                       */
  --soft:    #B5A99A;   /* xám ấm nhạt                     */
  --muted:   #D4C9BC;   /* border nhạt                     */

  /* Alias cũ */
  --green:    var(--sand);
  --green-d:  #9C7040;
  --green-l:  var(--peach);
  --blue:     var(--sky);
  --blue-d:   #5A8090;
  --blue-l:   #EDF4F6;
  --amber:    var(--sand);
  --amber-l:  var(--peach);
  --red:      #E8927A;
  --purple:   #C4AECF;
  --bg:       var(--cream);
  --card:     #FFFFFF;
  --text-mid: var(--mid);
  --text-soft:var(--soft);
  --border:   var(--peach);

  --radius-sm:10px;
  --radius:   16px;
  --radius-lg:24px;
  --shadow:   0 4px 16px rgba(122,92,74,.08);
  --shadow-md:0 8px 28px rgba(122,92,74,.14);
  --font:     'Nunito', 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--mid); text-decoration: none; }
a:hover { color: var(--text); }

h1 { font-size: 2rem; font-weight: 900; }
h2 { font-size: 1.5rem; font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 800; }
p  { color: var(--mid); }

.container    { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 720px;  margin: 0 auto; padding: 0 20px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 50px; border: none;
  font-family: var(--font); font-weight: 800; font-size: 15px;
  cursor: pointer; transition: all .2s; text-decoration: none;
}
.btn-primary {
  background: var(--blush); color: var(--text);
  border: 1.5px solid #EFCDC7;
  box-shadow: 0 4px 14px rgba(250,228,223,.6);
}
.btn-primary:hover { background: #F5D4CE; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(250,228,223,.8); color: var(--text); }
.btn-secondary {
  background: white; color: var(--mid);
  border: 1.5px solid var(--peach);
  box-shadow: var(--shadow);
}
.btn-secondary:hover { background: var(--peach); border-color: #EED8C4; color: var(--text); }
.btn-amber {
  background: var(--sand); color: var(--text);
  border: 1.5px solid #EDD8B8;
  box-shadow: 0 4px 14px rgba(249,233,208,.6);
}
.btn-amber:hover { background: #F0DFC0; transform: translateY(-2px); color: var(--text); }
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 17px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Topbar ── */
.topbar {
  background: #5C3D2A;
  padding: 8px 5%; display: flex; align-items: center;
  justify-content: space-between; font-size: 13px; color: rgba(255,255,255,.65);
}
.topbar a { color: var(--sand); font-weight: 800; }
.topbar a:hover { color: white; }
.topbar-domain { color: rgba(255,255,255,.35); font-weight: 700; font-size: 12px; }

/* ── Navbar ── */
.navbar {
  background: rgba(247,247,235,.97);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--peach);
  padding: 12px 5%;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(122,92,74,.07);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, var(--blush), var(--sand));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 3px 10px rgba(250,228,223,.5);
}
.logo-name {
  font-size: 18px; font-weight: 900;
  background: linear-gradient(90deg, #A0644A, #7A5C4A);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-sub { font-size: 11px; font-weight: 700; color: var(--soft); display: block; letter-spacing:.5px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 14px; border-radius: 50px; font-weight: 700; font-size: 14px;
  color: var(--mid); transition: all .2s; white-space: nowrap;
}
.nav-link:hover, .nav-link.active { background: var(--blush); color: var(--text); }
.nav-link.active { font-weight: 900; }
.xp-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--sand); border: 1.5px solid #EDD8B8;
  border-radius: 50px; padding: 6px 14px;
  font-weight: 900; font-size: 14px; color: var(--text);
}
.hamburger { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }

/* ── Cards ── */
.card {
  background: var(--card); border-radius: var(--radius);
  border: 1.5px solid var(--border); box-shadow: var(--shadow);
  padding: 20px; transition: all .2s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-grid   { display: grid; gap: 16px; }
.card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Badge pill ── */
.badge-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 50px; font-size: 12px; font-weight: 800;
}
.badge-green  { background: var(--sand);  color: #7A5020; }
.badge-blue   { background: var(--sky);   color: #3D6A78; }
.badge-amber  { background: var(--peach); color: #7A5020; }
.badge-red    { background: var(--blush); color: #8B4A42; }
.badge-purple { background: #EDE4F0;      color: #6B4E7A; }

/* ── Progress bar ── */
.prog-bar  { background: var(--peach); border-radius: 99px; overflow: hidden; height: 10px; }
.prog-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--blush), var(--sand));
  transition: width .6s ease;
}

/* ── Stars ── */
.stars { display: flex; gap: 3px; }
.star  { font-size: 20px; filter: grayscale(1) opacity(.3); transition: all .3s; }
.star.lit { filter: none; }

/* ── Chinese text ── */
.zh-big   { font-size: 2.5rem; font-weight: 700; font-family: 'Noto Sans SC', sans-serif; line-height: 1.2; }
.zh-med   { font-size: 1.6rem; font-weight: 700; font-family: 'Noto Sans SC', sans-serif; }
.zh-small { font-size: 1.1rem; font-weight: 500; font-family: 'Noto Sans SC', sans-serif; }
.pinyin   { font-size: .9rem; font-weight: 700; color: #5A8090; letter-spacing: .5px; }
.viet     { font-size: .85rem; font-weight: 700; color: #7A5C4A; }

/* ── Section headers ── */
.section-header { margin-bottom: 24px; }
.section-title  { font-size: 1.4rem; font-weight: 900; color: var(--text); display: flex; align-items: center; gap: 10px; }
.section-sub    { font-size: .9rem; color: var(--soft); margin-top: 4px; font-weight: 700; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: white; padding: 12px 24px; border-radius: 50px;
  font-weight: 800; font-size: 14px; z-index: 999; box-shadow: 0 8px 28px rgba(0,0,0,.2);
  animation: slideUp .3s ease;
}
.toast.success { background: #7A9E7E; color: white; }
.toast.error   { background: #C47A6A; color: white; }
.toast.info    { background: #5A8090; color: white; }
@keyframes slideUp {
  from { opacity:0; transform: translateX(-50%) translateY(20px); }
  to   { opacity:1; transform: translateX(-50%) translateY(0); }
}

/* ── XP burst ── */
.xp-burst {
  position: fixed; pointer-events: none; z-index: 9999;
  font-size: 20px; font-weight: 900; color: #9C7040;
  text-shadow: 0 2px 8px rgba(0,0,0,.15);
  animation: xpBurst .8s ease forwards;
}
@keyframes xpBurst {
  0%   { opacity:1; transform: translateY(0) scale(1); }
  100% { opacity:0; transform: translateY(-60px) scale(1.4); }
}

/* ── Confetti ── */
@keyframes confettiFall {
  0%   { transform: translateY(-10px) rotate(0); opacity:1; }
  100% { transform: translateY(100px) rotate(360deg); opacity:0; }
}
.confetti-piece {
  position: fixed; width: 10px; height: 10px; border-radius: 2px;
  pointer-events: none; z-index: 9999;
  animation: confettiFall .9s ease forwards;
}

/* ── Mascot ── */
.mascot    { font-size: 3rem; animation: mascotBob 2s ease-in-out infinite; display: inline-block; }
.mascot-sm { font-size: 1.8rem; animation: mascotBob 2.5s ease-in-out infinite; display: inline-block; }
@keyframes mascotBob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

/* ── Footer ── */
.footer {
  background: #5C3D2A; color: rgba(255,255,255,.65);
  text-align: center; padding: 24px; font-size: 13px; font-weight: 700;
  margin-top: 60px;
}
.footer a { color: var(--sand); }
.footer a:hover { color: white; }

/* ── Page hero ── */
.page-hero {
  background: linear-gradient(135deg, #6E4530 0%, #4A2E1A 100%);
  color: white; padding: 48px 5% 40px; text-align: center;
}
.page-hero h1 { font-size: 2.2rem; font-weight: 900; margin-bottom: 8px; }
.page-hero p  { color: rgba(255,255,255,.75); font-size: 1rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links  { display: none; }
  .hamburger  { display: block; }
  .card-grid-2, .card-grid-3, .card-grid-4 { grid-template-columns: 1fr; }
  .zh-big { font-size: 2rem; }
  h1 { font-size: 1.6rem; }
  .btn-lg { padding: 14px 28px; font-size: 15px; }
}
@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .topbar { display: none; }
}

/* ── Utility ── */
.mt-4{margin-top:4px} .mt-8{margin-top:8px} .mt-16{margin-top:16px}
.mt-24{margin-top:24px} .mt-40{margin-top:40px} .mb-16{margin-bottom:16px}
.mb-24{margin-bottom:24px} .text-center{text-align:center}
.flex{display:flex} .flex-center{display:flex;align-items:center;justify-content:center}
.gap-8{gap:8px} .gap-12{gap:12px} .gap-16{gap:16px} .gap-24{gap:24px}
.w-full{width:100%} .hidden{display:none!important} .opacity-50{opacity:.5}
.rounded{border-radius:var(--radius)} .fw-900{font-weight:900}
