:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #121210;
  color: #f8eedb;
  line-height: 1.55;
}

* { box-sizing: border-box; }
body { margin: 0; }
body, h1, h2, h3, p { overflow-wrap: break-word; }
a { color: #f7ce79; }
:focus-visible { outline: 3px solid #fff0b5; outline-offset: 4px; }

.hero {
  padding: clamp(3rem, 9vw, 7rem) 1rem 2.5rem;
  text-align: center;
  background: linear-gradient(180deg, #08080555, #121210 98%), url("/tai-game/nen.jpg") center 42% / cover;
}

.hero h1 { margin: 0 auto 1.75rem; max-width: 30rem; }
.hero img { display: block; width: 100%; height: auto; filter: drop-shadow(0 4px 12px #000); }
.download-info { margin: .75rem 0 0; color: #f2e1c0; font-size: .95rem; }

.button {
  display: inline-block;
  padding: .9rem 2.9rem;
  border: 1px solid #ffe2a3;
  border-radius: .35rem;
  background: linear-gradient(#ffe2a3, #e6aa4e);
  color: #281606;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { background: #ffdfa0; }
.button:disabled { opacity: .65; cursor: wait; }
.guide { max-width: 72rem; margin: auto; padding: 0 1rem 3rem; }
h2 { text-align: center; font: 700 clamp(1.75rem, 4vw, 2.5rem) Georgia, serif; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; counter-reset: steps; }
.steps li { display: block; padding: 1.25rem; border: 1px solid #5a4730; border-radius: .5rem; background: #211c16; counter-increment: steps; }
.steps li::before { content: counter(steps, decimal-leading-zero); color: #f7ce79; font-weight: 700; }
.steps h3 { margin: .5rem 0; font-size: 1.05rem; }
.steps p, footer { margin: 0; color: #dfd1b9; }
footer { margin-top: 2rem; text-align: center; }
footer p { margin: .5rem 0; }

.register { max-width: 32rem; margin: 2rem auto; padding: 1.5rem; }
.register label { display: block; margin-bottom: 1rem; }
.register input { display: block; width: 100%; margin-top: .3rem; padding: .65rem; border: 1px solid #92734b; border-radius: .25rem; background: #211c16; color: inherit; font: inherit; }

@media (max-width: 54rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 32rem) { .steps { grid-template-columns: 1fr; } }

/* Trang chủ */
.home {
  background: radial-gradient(ellipse at 50% 58%, #182a2c, transparent 64%), #101b20;
  color: #f4eee2;
  --line: #ddd0ae26;
  --muted: #c5ceca;
}
.home .shell { width: min(72rem, calc(100% - 3rem)); margin-inline: auto; }
.home h2 { font: 650 clamp(1.65rem, 3.5vw, 2.35rem)/1.25 system-ui, sans-serif; text-align: left; }
.home section[id] { scroll-margin-top: 6rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: #101b20f2;
  backdrop-filter: blur(12px);
}
.site-nav, .site-nav nav, .site-footer .shell { display: flex; align-items: center; }
.site-nav { min-height: 4.25rem; justify-content: space-between; gap: 1rem; }
.site-nav nav { gap: clamp(.75rem, 3vw, 2.5rem); }
.site-nav a, .site-footer a { text-decoration: none; }
.site-nav nav a, .site-footer a { color: #d6ddd6; }
.site-nav nav a:hover, .site-footer a:hover { color: #ffe6ab; text-decoration: underline; }
.wordmark { font-size: 1rem; font-weight: 700; color: #f4eee2; }
.nav-brand { display: inline-flex; align-items: center; gap: .55rem; }
.nav-brand img { flex: none; display: block; object-fit: contain; }
.brand-name > span { color: #e8c891; }
.nav-register {
  padding: .45rem .9rem;
  border: 1px solid #c9aa745c;
  border-radius: .75rem;
  color: #efdab2;
  white-space: nowrap;
}
.nav-register:hover { background: #b8956226; }

.home .hero {
  display: grid;
  align-items: center;
  min-height: clamp(30rem, 79svh, 49rem);
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
  text-align: left;
  background:
    linear-gradient(0deg, #101b20 0%, #101b2099 14%, transparent 52%),
    linear-gradient(90deg, #0d191ee8 0%, #14242bb8 31%, #14242b36 69%, #14242b08 100%),
    url("/tai-game/nen.jpg") center 52% / cover;
}
.home .hero h1 { width: min(27rem, 100%); margin: 0 0 1.75rem; }
.home .hero h2 { max-width: 33rem; margin: 0 0 .75rem; text-wrap: balance; }
.intro { max-width: 30rem; margin: 0 0 1.65rem; color: #f1eee4; line-height: 1.7; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.home .button { padding: .8rem 1.35rem; border-radius: .85rem; font-weight: 700; background: linear-gradient(145deg, #f2deb5, #dfb878); border-color: #efd4a8; box-shadow: 0 .4rem 1.25rem #080c1026; }
.home .button:hover { background: #f2dfb6; }
.download { min-width: 14rem; }
.download strong, .download small { display: block; }
.download strong { letter-spacing: .045em; }
.download strong span { float: right; }
.download small { font-weight: 600; }
.home .secondary { display: inline-grid; place-items: center; background: #14232bc9; color: #f3e5cc; border-color: #ead8b470; }
.home .secondary:hover { background: #293335; }
.home .download-info { color: #e1dacc; font-size: .875rem; }

.features { padding-block: clamp(2.25rem, 5vw, 4.5rem) clamp(3rem, 7vw, 6rem); }
.features h2 { margin-block: 0 1.35rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.85rem, 2vw, 1.5rem); }
.feature-grid article {
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: linear-gradient(145deg, #263937, #1a282e);
  box-shadow: 0 .5rem 1.75rem #08101327;
}
.feature-grid h3 { margin: 0 0 .55rem; font-size: 1.15rem; font-weight: 650; color: #eed9b3; }
.section-icon {
  display: block;
  flex: none;
  width: 2.65rem;
  height: 2.65rem;
  padding: .52rem;
  border: 1px solid #d9b27760;
  border-radius: .75rem;
  background: #be905918;
  color: #e9c68b;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature-grid .section-icon { margin-bottom: .9rem; }
.icon-heading { display: flex; align-items: center; gap: .75rem; }
.profile-facts .section-icon { width: 1.85rem; height: 1.85rem; padding: .3rem; border-radius: .5rem; }
.feature-grid p, .guide-aside p { margin: 0; color: var(--muted); line-height: 1.7; }

.home .guide {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.25fr);
  gap: clamp(1.5rem, 6vw, 5rem);
  align-items: start;
  margin-bottom: clamp(3rem, 7vw, 6rem);
  padding: clamp(1.25rem, 5vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: #141f25d9;
}
.guide-aside h2 { margin: 0 0 1rem; }
.guide-aside .button { margin-block: 1.15rem .75rem; }
.home .steps { display: block; }
.home .steps li { display: grid; grid-template-columns: 2.35rem minmax(0, 1fr); column-gap: .8rem; padding: .8rem 0; border: 0; border-radius: 0; background: transparent; }
.home .steps li + li { border-top: 1px solid var(--line); }
.home .steps li:first-child { padding-top: 0; }
.home .steps li:last-child { padding-bottom: 0; }
.home .steps li::before { grid-row: span 2; align-self: start; padding: .35rem 0; text-align: center; border-radius: .65rem; background: #dfbc8420; color: #f2d5a3; }
.home .steps h3 { margin: 0; font-family: inherit; }
.home .steps p { color: var(--muted); }

.site-footer { margin: 0; padding-block: 1.5rem; border-top: 1px solid var(--line); background: #0d161a; }
.site-footer .shell { justify-content: space-between; gap: 1rem; text-align: left; }

.site-nav a[aria-current="page"] { color: #f4d5a0; text-decoration: underline; text-underline-offset: .35em; }
.portal-page {
  background: linear-gradient(180deg, #101b2057, #101b20 28rem), url("/tai-game/nen.jpg") top center / auto 29rem no-repeat, #101b20;
  min-height: 100vh;
}
.portal-content { padding-block: clamp(2.5rem, 6vw, 5rem) 4rem; }
.portal-content > h1 { margin: 0 0 1.5rem; font-size: clamp(2rem, 5vw, 3rem); }
#portal-status:empty { display: none; }
#portal-status { color: #f2d5a3; }
.portal-card, .profile-facts > div {
  padding: clamp(1.1rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: #18272e;
}
.portal-card h2 { margin: 0 0 1rem; font-size: 1.35rem; }
.portal-card p, .profile-facts dt { color: var(--muted); }
.portal-card p:first-child { margin-top: 0; }
.portal-list { margin: 0; padding: 0; list-style: none; }
.portal-list li { padding: .85rem 0; }
.portal-list li + li { border-top: 1px solid var(--line); }
.portal-list small { display: block; color: #e8c891; margin-bottom: .25rem; }
#characters li, .identity { display: flex; justify-content: space-between; gap: .75rem 1rem; align-items: center; flex-wrap: wrap; }
.identity { background: linear-gradient(120deg, #233934, #18272e); }
.identity h2, .identity p { margin: .15rem 0; }
.identity h2 { font-size: clamp(1.65rem, 4vw, 2.35rem); overflow-wrap: anywhere; }
#player-id { overflow-wrap: anywhere; }
.profile-facts, .profile-grid { display: grid; gap: 1rem; }
.profile-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 1rem 0; }
.profile-facts dd { margin: .25rem 0 0; font-weight: 650; }
.profile-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.login-card { max-width: 29rem; }
.portal-card label { display: grid; gap: .4rem; margin-bottom: 1rem; }
.portal-card input {
  width: 100%;
  padding: .7rem .8rem;
  border: 1px solid #c9bca552;
  border-radius: .65rem;
  background: #101b20;
  color: inherit;
  font: inherit;
}
.profile-links { text-align: right; }

@media (max-width: 61rem) {
  .site-nav { flex-wrap: wrap; padding-block: .65rem; gap: .5rem 1rem; }
  .site-nav nav { order: 1; width: 100%; flex-wrap: wrap; gap: .35rem 1rem; }
  .home section[id] { scroll-margin-top: 8rem; }
}

@media (max-width: 46rem) {
  .home .shell { width: min(72rem, calc(100% - 2rem)); }
  .home .hero { min-height: 33rem; background-position: center, center, 62% center; }
  .feature-grid, .home .guide, .profile-grid, .profile-facts { grid-template-columns: 1fr; }
}

@media (max-width: 32rem) {
  .home section[id] { scroll-margin-top: 8rem; }
  .site-nav { flex-wrap: wrap; gap: .5rem 1rem; padding-block: .75rem; }
  .site-nav nav { font-size: .875rem; }
  .home .hero {
    text-align: center;
    background-image:
      linear-gradient(0deg, #101b20 0%, #101b20ed 22%, #101b2099 55%, #101b201f 100%),
      url("/tai-game/nen.jpg");
    background-position: center, 60% center;
    background-size: cover;
    background-repeat: no-repeat;
  }
  .home .hero h1 { width: min(20rem, 92%); margin-inline: auto; }
  .home .hero h2 { text-align: center; }
  .intro { max-width: 24rem; margin-inline: auto; }
  .actions { max-width: 22rem; margin-inline: auto; }
  .actions > a { width: 100%; }
}
