/* TS Realm landing — mobile trước. Khung "kính xanh đêm, viền xanh lơ → vàng" như màn đăng nhập trong game. */
:root {
  --night-950: #050d1c;
  --night-900: #071326;
  --night-800: #0b1d38;
  --night-700: #12294d;
  --glass: rgba(9, 27, 54, 0.74);
  --glass-strong: rgba(8, 22, 46, 0.88);
  --cyan: #52e2f6;
  --cyan-2: #1fb6d8;
  --gold: #f5c95c;
  --gold-2: #e09a26;
  --sakura: #f7abc7;
  --purple: #6c3a9e;
  --text: #ecf5ff;
  --muted: #a8bcd6;
  --radius: 18px;
  --gutter: 16px;
  --font-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Baloo 2", "Be Vietnam Pro", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.65 var(--font-body);
  color: var(--text);
  background: var(--night-900);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(82, 226, 246, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 40%, rgba(108, 58, 158, 0.18), transparent 60%),
    linear-gradient(180deg, var(--night-800), var(--night-950));
  background-attachment: fixed;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
code {
  font: 600 0.92em/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: var(--gold);
  background: rgba(245, 201, 92, 0.10);
  padding: 0.12em 0.4em;
  border-radius: 6px;
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--gold); color: #1d1300; padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 820px; position: relative; }

/* ---- Khung kính (glass panel) với viền gradient xanh lơ → vàng ---- */
.panel {
  position: relative;
  background: var(--glass);
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--cyan) 0%, rgba(82, 226, 246, 0.35) 40%, rgba(245, 201, 92, 0.45) 65%, var(--gold) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

/* ---- Nút ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  font: 800 1.06rem/1 var(--font-display);
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn--gold {
  color: #2a1700;
  background: linear-gradient(180deg, #ffe08a 0%, var(--gold) 45%, var(--gold-2) 100%);
  box-shadow: 0 4px 0 #9a5b0c, 0 10px 24px rgba(224, 154, 38, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.btn--gold:hover { color: #2a1700; filter: brightness(1.06); }
.btn--ghost {
  color: var(--text);
  background: rgba(82, 226, 246, 0.10);
  box-shadow: inset 0 0 0 2px rgba(82, 226, 246, 0.65);
}
.btn--ghost:hover { color: #fff; background: rgba(82, 226, 246, 0.2); }
.btn--sm { min-height: 38px; padding: 0 16px; font-size: 0.95rem; box-shadow: 0 3px 0 #9a5b0c, inset 0 1px 0 rgba(255, 255, 255, 0.7); }

/* ---- Thanh điều hướng ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 19, 38, 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(82, 226, 246, 0.18);
}
.nav__in { max-width: 1160px; margin: 0 auto; padding: 8px var(--gutter); display: flex; align-items: center; gap: 12px; }
.nav__brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 800 1.2rem/1 var(--font-display); }
.nav__brand img { border-radius: 10px; box-shadow: 0 0 0 2px rgba(82, 226, 246, 0.5); }
.nav__links { display: none; gap: 22px; margin-left: auto; }
.nav__links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav__links a:hover { color: var(--gold); }
.nav .btn { margin-left: auto; }

/* ---- Hero ---- */
.hero { --hero-h: clamp(250px, 62vw, 520px); --logo-w: min(62vw, 360px); position: relative; isolation: isolate; overflow: hidden; }
.hero__bg { position: absolute; inset: 0 0 auto 0; height: var(--hero-h); z-index: -2; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 72% 30%; }
.hero::after {
  /* chuyển dần từ ảnh sang nền đêm */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 19, 38, 0) 0, rgba(7, 19, 38, 0) calc(var(--hero-h) - 130px), var(--night-800) var(--hero-h));
}
.hero__in { max-width: 1160px; margin: 0 auto; padding: 8px var(--gutter) 40px; }
.hero__logo { margin: 0; width: var(--logo-w); filter: drop-shadow(0 6px 14px rgba(20, 8, 40, 0.45)); }
.hero__panel { margin-top: calc(var(--hero-h) - 8px - var(--logo-w) * 0.408 - 28px); padding: 20px 18px 18px; }
.hero__tag { margin: 0 0 16px; font-size: 1.08rem; line-height: 1.55; }
.hero__tag b { color: var(--gold); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__cta .btn { flex: 1 1 160px; }

/* nút tải game */
.dl { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dl__btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; min-height: 76px;
  border-radius: 14px; text-decoration: none; color: var(--text);
  background: rgba(82, 226, 246, 0.08);
  box-shadow: inset 0 0 0 1.5px rgba(82, 226, 246, 0.45);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.dl__btn svg { width: 26px; height: 26px; fill: currentColor; }
.dl__btn span { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.dl__btn b { font: 800 1rem/1.1 var(--font-display); }
.dl__btn small { font-size: 0.74rem; color: var(--muted); }
.dl__btn:hover { color: #fff; background: rgba(82, 226, 246, 0.18); box-shadow: inset 0 0 0 1.5px var(--cyan); }
.dl__btn.is-soon { opacity: 0.72; cursor: default; }
.dl__btn.is-soon small { color: var(--sakura); }
.dl__btn.is-soon:hover { background: rgba(82, 226, 246, 0.08); box-shadow: inset 0 0 0 1.5px rgba(82, 226, 246, 0.45); }

/* cánh hoa anh đào rơi (tắt khi người dùng giảm chuyển động) */
.petals { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.petals i {
  position: absolute; top: -20px; width: 12px; height: 9px;
  background: var(--sakura); border-radius: 12px 0 12px 0; opacity: 0.85;
  animation: fall 14s linear infinite;
}
.petals i:nth-child(1) { left: 8%;  animation-delay: 0s;   animation-duration: 13s; }
.petals i:nth-child(2) { left: 22%; animation-delay: 3s;   animation-duration: 16s; transform: scale(0.8); }
.petals i:nth-child(3) { left: 37%; animation-delay: 6s;   animation-duration: 12s; }
.petals i:nth-child(4) { left: 52%; animation-delay: 1.5s; animation-duration: 15s; transform: scale(0.7); }
.petals i:nth-child(5) { left: 64%; animation-delay: 8s;   animation-duration: 14s; }
.petals i:nth-child(6) { left: 76%; animation-delay: 4.5s; animation-duration: 17s; transform: scale(0.9); }
.petals i:nth-child(7) { left: 88%; animation-delay: 10s;  animation-duration: 13s; }
.petals i:nth-child(8) { left: 95%; animation-delay: 6.5s; animation-duration: 18s; transform: scale(0.6); }
@keyframes fall {
  0%   { translate: 0 0; rotate: 0deg; }
  50%  { translate: -40px 50vh; rotate: 200deg; }
  100% { translate: 20px 105vh; rotate: 400deg; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .petals { display: none; }
  .btn, .dl__btn { transition: none; }
}

/* ---- Section chung ---- */
.sec { padding: 56px 0; position: relative; }
.sec__title {
  text-align: center;
  font: 800 clamp(1.7rem, 6vw, 2.6rem)/1.15 var(--font-display);
  margin-bottom: 18px;
}
.sec__title span {
  background: linear-gradient(180deg, #fff6d6 0%, var(--gold) 60%, var(--gold-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(108, 58, 158, 0.9));
}
.sec__title::after {
  /* hoạ tiết mây vàng nhỏ dưới tiêu đề */
  content: ""; display: block; width: 120px; height: 10px; margin: 10px auto 0;
  background: radial-gradient(circle at 10px 5px, var(--gold) 4px, transparent 5px) 0 0 / 20px 10px repeat-x;
  opacity: 0.55;
}
.sec__lead { max-width: 760px; margin: 0 auto 28px; text-align: center; color: var(--muted); font-size: 1.05rem; }

/* intro pills */
.pills { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pill { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.pill > svg { flex: 0 0 auto; width: 44px; height: 44px; padding: 9px; border-radius: 12px; fill: var(--cyan); background: rgba(82, 226, 246, 0.12); }
.pill > img { flex: 0 0 auto; width: 56px; height: auto; margin-top: 2px; }
.pill h3 { font: 800 1.2rem/1.2 var(--font-display); color: var(--gold); margin-bottom: 4px; }
.pill p { margin: 0; color: var(--muted); font-size: 0.97rem; }

/* thẻ tính năng */
.cards { display: grid; gap: 18px; }
.card { overflow: hidden; display: flex; flex-direction: column; }
.card picture { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.card picture img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover picture img { transform: scale(1.04); }
.card__body { padding: 16px 18px 20px; }
.card h3 { font: 800 1.32rem/1.2 var(--font-display); color: var(--gold); margin-bottom: 6px; }
.card p { margin: 0; color: var(--muted); font-size: 0.97rem; }

/* các bước */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: s; }
.step { padding: 22px 18px 18px 18px; }
.step__n {
  display: inline-grid; place-items: center; width: 46px; height: 46px; margin-bottom: 10px;
  font: 800 1.5rem/1 var(--font-display); color: #2a1700;
  background: radial-gradient(circle at 35% 30%, #fff1b8, var(--gold) 55%, var(--gold-2));
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(82, 226, 246, 0.55), 0 6px 16px rgba(224, 154, 38, 0.35);
}
.step h3 { font: 800 1.25rem/1.2 var(--font-display); margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); }
.start__cta { margin-top: 26px; text-align: center; }

/* hỏi đáp */
.faq__bdy {
  width: 120px; margin: 0 auto -6px; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
  -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent);
  mask-image: linear-gradient(180deg, #000 82%, transparent);
}
.qa { display: grid; gap: 12px; }
.qa details { padding: 0; }
.qa summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 16px 52px 16px 18px; font-weight: 700; font-size: 1.04rem;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 3px solid var(--cyan); border-bottom: 3px solid var(--cyan);
  transform: rotate(45deg); transition: transform 0.2s ease;
}
.qa details[open] summary::after { transform: rotate(-135deg); margin-top: -3px; border-color: var(--gold); }
.qa details[open] summary { color: var(--gold); }
.qa p { margin: 0; padding: 0 18px 18px; color: var(--muted); }

/* CTA cuối */
.final__box { text-align: center; padding: 30px 20px; background: var(--glass-strong); }
.final__box h2 { font: 800 clamp(1.6rem, 5.5vw, 2.3rem)/1.15 var(--font-display); color: var(--gold); margin-bottom: 8px; }
.final__box p { margin: 0 0 18px; color: var(--muted); }
.final__box .hero__cta { justify-content: center; max-width: 440px; margin: 0 auto; }

/* chân trang */
.foot { padding: 36px 0 calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(82, 226, 246, 0.16); background: rgba(5, 13, 28, 0.6); }
.foot__in { display: grid; gap: 16px; justify-items: center; text-align: center; }
.foot__brand img { width: 180px; }
.foot__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.foot__links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.foot__links a:hover { color: var(--gold); }
.foot__note { max-width: 720px; margin: 0; font-size: 0.85rem; color: #8095b1; }
.foot__copy { margin: 0; font-size: 0.85rem; color: #6d819c; }

[hidden] { display: none !important; }

/* ---- Tablet ---- */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .pills { grid-template-columns: repeat(3, 1fr); }
  .pill { flex-direction: column; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .dl__btn { flex-direction: row; justify-content: center; gap: 10px; min-height: 60px; }
  .dl__btn span { align-items: flex-start; }
}

/* ---- Desktop: chữ bên trái trên vùng mây trống, nhân vật bên phải ---- */
@media (min-width: 960px) {
  .nav__links { display: flex; }
  .nav .btn { margin-left: 8px; }
  .hero { min-height: min(56.25vw, 820px); display: flex; align-items: center; }
  .hero__bg { inset: 0; height: auto; max-height: none; }
  .hero__bg img { object-position: 60% 40%; }
  .hero::after {
    background:
      linear-gradient(90deg, rgba(7, 19, 38, 0.55) 0%, rgba(7, 19, 38, 0.15) 42%, rgba(7, 19, 38, 0) 60%),
      linear-gradient(180deg, rgba(7, 19, 38, 0) 70%, var(--night-800) 100%);
  }
  .hero__in { width: 100%; padding: 40px var(--gutter) 90px; }
  .hero__logo { margin: 0; width: 520px; }
  .hero__panel { margin-top: 6px; max-width: 520px; padding: 22px 24px; }
  .hero__tag { font-size: 1.16rem; }
  .cards { grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .sec { padding: 76px 0; }
  .faq__bdy { position: absolute; right: -40px; top: -30px; width: 170px; margin: 0; transform: rotate(8deg); }
}

/* ghi chú cài iOS dưới các nút tải (hiện khi có link Discord) */
.dl__note{margin:.75rem 0 0;font-size:.85rem;line-height:1.45;color:#b9c6d6}
.dl__note a{color:#ffd166;text-decoration:underline;text-underline-offset:2px}
