/* Trang giới thiệu Thạch Sanh 2D: tông sơn mài (nâu đen, đỏ son, vàng kim) giống giao diện trong game */
:root {
  --bg: #140b07;
  --bg2: #1e110b;
  --panel: #2a1810;
  --line: rgba(232, 192, 106, 0.22);
  --gold: #e8c06a;
  --gold2: #b8894a;
  --cinnabar: #b8382f;
  --cream: #f3e6c8;
  --muted: #c8b48e;
  --green: #8fd86a;
  --wrap: 1180px;
  --r: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: 'Noto Serif', Georgia, serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--gold); }
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; line-height: 1.15; margin: 0; }
.hn { line-height: 1; }
.wrap { width: min(var(--wrap), 100% - 32px); margin: 0 auto; }
.wrap.narrow { width: min(820px, 100% - 32px); }
/* ảnh pixel art: giữ nét khi phóng to */
.hero-shot img, .act img, .zone img, .feat-pics img, .social img, .hc-pic img, .hc-skills img, .icons-row img, .evo img, .mobs img, .brand img, .soon-art img { image-rendering: pixelated; }

/* ---------- thông báo trên cùng ---------- */
.notice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 12px;
  padding: 8px 16px;
  background: linear-gradient(90deg, #5a1612, #7a221d 50%, #5a1612);
  color: #ffe9b0;
  font-size: 14px;
  text-align: center;
}
.notice .hn { color: #ffd76a; margin-right: 4px; vertical-align: -1px; }
.notice .dot { opacity: 0.5; }
.age { display: inline-block; padding: 0 6px; border-radius: 4px; background: #ffd76a; color: #3a1408; font-family: 'Playfair Display', serif; font-weight: 900; font-size: 0.9em; margin-right: 4px; }

/* ---------- đầu trang ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px max(16px, calc((100% - var(--wrap)) / 2));
  background: rgba(20, 11, 7, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.top.scrolled { border-bottom-color: var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold); font-family: 'Playfair Display', serif; font-weight: 900; font-size: 22px; white-space: nowrap; }
.brand small { font-size: 0.6em; color: var(--muted); }
.nav { display: flex; gap: 22px; flex: 1; justify-content: center; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; transition: color 0.15s; }
.nav a:hover { color: var(--gold); }

/* ---------- nút ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 12px;
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 18px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-play { color: #2b1410; background: linear-gradient(180deg, #ffe08a, #d9a030); border: 2px solid #fff0c0; box-shadow: 0 6px 0 #8a5a18, 0 14px 30px rgba(255, 200, 90, 0.25); }
.btn-play:hover { filter: brightness(1.06); box-shadow: 0 8px 0 #8a5a18, 0 18px 36px rgba(255, 200, 90, 0.35); }
.btn-play.sm { padding: 9px 18px; font-size: 16px; box-shadow: 0 4px 0 #8a5a18; }
.btn-play.lg { padding: 18px 40px; font-size: 22px; }
.btn-ghost { color: var(--cream); border: 2px solid var(--gold2); background: rgba(232, 192, 106, 0.06); }
.btn-ghost:hover { border-color: var(--gold); }

/* ---------- mở đầu ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 88px; }
.hero-bg {
  position: absolute;
  inset: -40px 0 0;
  background: url('/assets/screens/night.webp') center 30% / cover no-repeat;
  image-rendering: pixelated;
  filter: saturate(1.1);
  opacity: 0.55;
}
.hero-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 40%, rgba(20, 11, 7, 0.35), rgba(20, 11, 7, 0.92) 70%), linear-gradient(180deg, transparent 60%, var(--bg)); }
.hero-in { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--gold); font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 10px; }
.hero h1 { font-size: clamp(56px, 9vw, 104px); font-weight: 900; color: #ffe7a8; text-shadow: 0 4px 0 #5a1612, 0 0 40px rgba(255, 190, 90, 0.35); }
.lead { font-size: 18px; color: #ecdcbb; margin: 18px 0 22px; max-width: 34em; }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0 0 28px; }
.badges li { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(42, 24, 16, 0.8); border: 1px solid var(--line); font-size: 14px; color: #f0dcae; }
.badges .hn { color: var(--gold); }
.cta { display: flex; flex-wrap: wrap; gap: 14px; }
.note { margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.hero-shot { margin: 0; position: relative; transform: rotate(1.2deg); }
.hero-shot img, .act > img, .zone > img, .feat-pics img, .social img {
  width: 100%;
  height: auto;
  border-radius: var(--r);
  border: 3px solid var(--gold2);
  box-shadow: var(--shadow);
  cursor: zoom-in;
  background: #000;
}
.hero-shot figcaption { margin-top: 10px; text-align: right; color: var(--muted); font-size: 14px; font-style: italic; }

/* ---------- miễn phí ---------- */
.free { padding: 0 0 24px; }
.free-in {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  padding: 32px 36px;
  border-radius: 20px;
  background: linear-gradient(135deg, #3a1f12, #2a1810);
  border: 2px solid var(--gold2);
  box-shadow: var(--shadow), inset 0 0 0 4px rgba(232, 192, 106, 0.08);
}
.free-mark { width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; align-content: center; gap: 4px; background: radial-gradient(circle, #c8452f, #7a221d); border: 4px solid #ffd76a; box-shadow: 0 0 30px rgba(255, 200, 90, 0.35); color: #ffe9b0; }
.free-mark .hn { font-size: 34px; }
.free-mark b { font-family: 'Playfair Display', serif; font-size: 22px; }
.free h2 { font-size: 32px; color: var(--gold); margin-bottom: 8px; }
.free p { margin: 0 0 10px; color: #ecdcbb; }
.free .sub { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- khung mục ---------- */
.sec { padding: 96px 0; }
.sec.alt { background: linear-gradient(180deg, var(--bg), var(--bg2) 12%, var(--bg2) 88%, var(--bg)); }
.sec-head { text-align: center; max-width: 760px; margin: 0 auto 48px; }
.sec-head h2 { font-size: clamp(32px, 4.4vw, 46px); color: #ffe7a8; margin-bottom: 14px; }
.sec-head p { color: var(--muted); margin: 0; }

/* câu chuyện */
.acts { display: grid; grid-template-columns: 1fr 1fr 0.8fr; gap: 26px; }
.act { display: flex; flex-direction: column; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.act > img { border: 0; border-radius: 0; box-shadow: none; aspect-ratio: 16 / 9; object-fit: cover; object-position: center 40%; }
.act-body { padding: 22px 24px 26px; }
.act-no { display: inline-block; padding: 2px 10px; border-radius: 6px; background: var(--cinnabar); color: #ffe9b0; font-size: 13px; font-weight: 700; letter-spacing: 0.05em; }
.act h3 { font-size: 26px; color: var(--gold); margin: 10px 0 8px; }
.act p { margin: 0; color: #e2d0aa; font-size: 15.5px; }
.act.soon { background: repeating-linear-gradient(135deg, #24150d, #24150d 12px, #2a1810 12px, #2a1810 24px); }
.soon-art { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: radial-gradient(circle, #3a2214, #1a0e08); }
.soon-art img { width: 96px; filter: grayscale(0.7) brightness(0.6); }
.soon-art .hn { position: absolute; right: 18px; top: 16px; font-size: 26px; color: var(--gold); }

/* nhân vật */
.heroes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.hero-card { padding: 24px 22px; border-radius: 18px; background: linear-gradient(180deg, #2e1a10, #22130c); border: 1px solid var(--line); text-align: center; transition: transform 0.2s, border-color 0.2s; }
.hero-card:hover { transform: translateY(-6px); border-color: var(--gold2); }
.hc-pic { width: 150px; height: 150px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgba(232, 192, 106, 0.22), transparent 70%); }
.hc-pic img { width: 144px; height: 144px; }
.hero-card h3 { font-size: 22px; color: #ffe7a8; }
.hc-role { color: var(--gold); font-size: 14px; margin: 4px 0 10px; }
.hero-card p { color: #e2d0aa; font-size: 15px; margin: 0 0 14px; }
.hc-skills { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; text-align: left; }
.hc-skills li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: #f0dcae; padding: 4px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.18); }
.hc-skills img { width: 30px; height: 30px; border-radius: 4px; border: 1px solid var(--gold2); }
.hc-skills li.ult { color: #ffd76a; background: rgba(184, 56, 47, 0.28); }

/* thế giới */
.zones { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.zone { margin: 0; position: relative; }
.zone.big { grid-column: 1 / -1; }
.zone > img { aspect-ratio: 16 / 7; object-fit: cover; object-position: center 45%; }
.zone.big > img { aspect-ratio: 16 / 6; }
.zone figcaption {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 26px 18px 14px;
  border-radius: 0 0 11px 11px;
  background: linear-gradient(180deg, transparent, rgba(12, 6, 3, 0.9) 45%);
  pointer-events: none;
}
.zone figcaption b { font-family: 'Playfair Display', serif; font-size: 20px; color: #ffe7a8; }
.zone figcaption em { font-style: normal; font-family: 'Noto Serif', serif; font-size: 13px; color: #2b1410; background: var(--gold); padding: 1px 8px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; }
.zone figcaption span { color: #e2d0aa; font-size: 14.5px; }
.mobs { display: flex; gap: 6px; }
.mobs img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 2px #000); }

/* tính năng */
.feat { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; margin-bottom: 84px; }
.feat:last-child { margin-bottom: 0; }
.feat.rev .feat-text { order: 2; }
.feat h3 { font-size: 32px; color: #ffe7a8; margin-bottom: 14px; display: flex; align-items: center; gap: 12px; }
.feat h3 .hn { color: var(--gold); font-size: 28px; }
.feat p { color: #e2d0aa; margin: 0 0 18px; }
.feat-pics { display: grid; gap: 16px; position: relative; }
.feat-pics img.ui { width: 78%; justify-self: end; margin-top: -90px; position: relative; border-color: var(--gold); }
.feat-pics.one img.ui { width: 100%; margin: 0; }
.tiers { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tiers li { padding: 8px 14px; border-radius: 10px; background: rgba(0, 0, 0, 0.22); border-left: 4px solid; font-size: 15px; color: #e2d0aa; }
.tiers b { margin-right: 6px; }
.tiers .t1 { border-color: #a8a090; }
.tiers .t1 b { color: #e8dcc0; }
.tiers .t2 { border-color: #5ab0ff; }
.tiers .t2 b { color: #9ad8ff; }
.tiers .t3 { border-color: #ffb040; }
.tiers .t3 b { color: #ffd060; }
.tiers .t4 { border-color: #d070ff; box-shadow: inset 0 0 18px rgba(208, 112, 255, 0.18); }
.tiers .t4 b { color: #f0a8ff; }
.icons-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.icons-row img { width: 48px; height: 48px; border-radius: 8px; }
.icons-row img:nth-child(4) { box-shadow: 0 0 16px rgba(255, 216, 74, 0.6); }
.icons-row .sep { width: 1px; height: 36px; background: var(--line); margin: 0 4px; }
.evo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.evo > div { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 12px 26px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); }
.evo img { width: 56px; height: 56px; object-fit: contain; opacity: 0.85; }
.evo img.big { width: 84px; height: 84px; opacity: 1; filter: drop-shadow(0 0 10px rgba(255, 200, 90, 0.55)); }
.evo .hn { color: var(--gold); }
.evo span { position: absolute; left: 12px; bottom: 6px; font-size: 13px; color: var(--muted); }

/* chơi cùng nhau */
.social { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.social figure { margin: 0; }
.perks { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.perks li { display: flex; gap: 14px; align-items: flex-start; }
.perks .hn { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: rgba(184, 56, 47, 0.35); border: 1px solid var(--gold2); color: var(--gold); font-size: 22px; }
.perks b { display: block; color: #ffe7a8; font-size: 18px; }
.perks span { color: #e2d0aa; font-size: 15px; }

/* cách chơi */
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.keys > div { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.keys span { margin-left: 6px; color: #e2d0aa; font-size: 15px; }
kbd { display: inline-block; min-width: 34px; padding: 4px 9px; border-radius: 7px; background: linear-gradient(180deg, #fff3cf, #d8c08a); color: #2b1410; font-family: 'Noto Serif', serif; font-weight: 700; font-size: 14px; text-align: center; box-shadow: 0 3px 0 #8a6a38; }

/* hỏi đáp */
.faq { display: grid; gap: 12px; }
.faq details { border-radius: 14px; background: var(--panel); border: 1px solid var(--line); padding: 4px 20px; }
.faq details[open] { border-color: var(--gold2); }
.faq summary { cursor: pointer; padding: 14px 0; font-family: 'Playfair Display', serif; font-weight: 700; font-size: 19px; color: #ffe7a8; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--gold); font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq p { margin: 0 0 18px; color: #e2d0aa; }

/* kêu gọi cuối */
.final { position: relative; overflow: hidden; padding: 110px 0; text-align: center; }
.final-bg { position: absolute; inset: 0; background: url('/assets/screens/village.webp') center 40% / cover no-repeat; image-rendering: pixelated; opacity: 0.4; }
.final-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, var(--bg), rgba(20, 11, 7, 0.55) 40%, rgba(20, 11, 7, 0.55) 60%, var(--bg)); }
.final-in { position: relative; }
.final h2 { font-size: clamp(36px, 6vw, 64px); color: #ffe7a8; text-shadow: 0 3px 0 #5a1612; }
.final p { color: var(--cream); margin: 10px 0 28px; font-size: 19px; }

/* chân trang */
.foot { border-top: 1px solid var(--line); background: #0e0805; padding: 40px 0 48px; }
.foot-in { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr; gap: 28px; align-items: start; }
.rating { display: flex; gap: 16px; align-items: flex-start; }
.rate-box { flex: none; width: 74px; height: 86px; display: grid; place-items: center; align-content: center; border: 3px solid #ffd76a; border-radius: 10px; background: #3a1408; }
.rate-box b { font-family: 'Playfair Display', serif; font-size: 30px; color: #ffd76a; line-height: 1; }
.rate-box small { color: #ffe9b0; font-size: 13px; }
.rating b, .health b { color: #ffe7a8; }
.rating p, .health p, .free-note p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
.health, .free-note { display: flex; gap: 12px; align-items: flex-start; }
.health .hn, .free-note .hn { font-size: 26px; color: var(--gold); margin-top: 4px; }
.copy { grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid var(--line); color: #8a7a60; font-size: 14px; text-align: center; }

/* xem ảnh lớn */
.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; align-content: center; gap: 12px; padding: 24px; background: rgba(8, 4, 2, 0.92); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1400px, 100%); max-height: 82vh; border: 3px solid var(--gold2); border-radius: 12px; image-rendering: pixelated; }
.lb-cap { margin: 0; color: var(--muted); text-align: center; }
.lb-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--gold2); background: rgba(42, 24, 16, 0.9); color: var(--cream); font-size: 20px; cursor: pointer; }

/* hiện dần khi cuộn tới */
/* chỉ ẩn khi JS chạy được (html.anim), có hẹn giờ dự phòng hiện hết */
.anim .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.anim .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- màn hình vừa / nhỏ ---------- */
@media (max-width: 1080px) {
  .nav { display: none; }
  .top { justify-content: space-between; }
  .heroes { grid-template-columns: repeat(2, 1fr); }
  .acts { grid-template-columns: 1fr 1fr; }
  .act.soon { grid-column: 1 / -1; flex-direction: row; }
  .act.soon .soon-art { width: 40%; aspect-ratio: auto; }
}
@media (max-width: 820px) {
  body { font-size: 16px; }
  .hero { padding: 40px 0 56px; }
  .hero-in, .feat, .social, .free-in, .foot-in { grid-template-columns: 1fr; }
  .hero-shot { transform: none; }
  .feat.rev .feat-text { order: 0; }
  .feat-pics img.ui { width: 100%; margin: 0; }
  .free-in { padding: 26px 22px; text-align: center; }
  .free-mark { margin: 0 auto; width: 110px; height: 110px; }
  .zones { grid-template-columns: 1fr; }
  .zone > img, .zone.big > img { aspect-ratio: 16 / 9; }
  .sec { padding: 68px 0; }
  .acts { grid-template-columns: 1fr; }
  .act.soon { flex-direction: column; }
  .act.soon .soon-art { width: auto; aspect-ratio: 16 / 7; }
  .copy { grid-column: auto; }
}
@media (max-width: 560px) {
  .heroes { grid-template-columns: 1fr; }
  .evo { grid-template-columns: 1fr; }
  .notice { font-size: 13px; }
  .notice .dot { display: none; }
  .brand { font-size: 19px; }
  .btn { padding: 12px 20px; font-size: 17px; }
  .cta .btn { flex: 1 1 auto; justify-content: center; }
}
