:root {
  --nau: #5a1606;
  --nau-dam: #2a0b03;
  --kem: #fff2d2;
  --vang: #ffd45a;
  --cam: #f5a524;
  --dau-cao: 60px;
  --font: "Nunito", "Arial Rounded MT Bold", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

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

html, body { margin: 0; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--nau-dam);
  color: var(--kem);
  font-family: var(--font);
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: none; -webkit-user-select: none; user-select: none; }

a { color: inherit; text-decoration: none; }

.an {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.dau {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: var(--dau-cao);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: linear-gradient(rgba(42, 11, 3, .78), rgba(42, 11, 3, .42));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 212, 140, .16);
}

.dau__ten {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 19px; font-weight: 900; letter-spacing: .2px;
  color: #ffe6a6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
  white-space: nowrap;
}

.dau__bieu-tuong {
  width: 38px; height: 38px; flex: none;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 35%, #fff4d6 0, #ffc76a 60%, #f08a2a 100%);
  box-shadow: 0 0 0 1.5px rgba(255, 228, 170, .7), 0 2px 6px rgba(0, 0, 0, .4);
}

.dau__menu { display: flex; align-items: center; gap: 4px; }
.dau__menu a {
  padding: 8px 14px; border-radius: 999px;
  font-size: 15px; font-weight: 800; color: #fff1cf;
  transition: background-color .15s ease, transform .15s ease;
}
.dau__menu a:hover { background: rgba(255, 200, 120, .16); }
.dau__menu a:focus-visible { outline: 2px solid var(--vang); outline-offset: 2px; }
.dau__menu .dau__choi {
  margin-left: 6px;
  color: var(--nau);
  background: linear-gradient(#ffeb94, var(--cam));
  box-shadow: inset 0 -2px 0 rgba(120, 40, 0, .35), 0 2px 8px rgba(0, 0, 0, .3);
}
.dau__menu .dau__choi:hover { background: linear-gradient(#fff3b8, #ffb43a); transform: translateY(-1px); }

@media (max-width: 640px) {
  .dau__menu a:not(.dau__choi) { display: none; }
  .dau__ten { font-size: 18px; }
}

main { flex: 1; display: flex; }

.hero {
  position: relative; flex: 1;
  min-height: 520px;
  overflow: hidden;
  background: #6b2a0c;
  isolation: isolate;
}

.hero__nen {
  position: absolute; left: -2%; top: -2%;
  width: 104%; height: 104%;
  object-fit: cover; object-position: 50% 62%;
  z-index: -2;
}

.hero__phu {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(rgba(42, 11, 3, .55), rgba(42, 11, 3, 0) 26%),
    linear-gradient(to top, rgba(60, 14, 2, .55), rgba(60, 14, 2, 0) 32%),
    radial-gradient(ellipse at 70% 45%, rgba(255, 220, 150, .18), rgba(255, 220, 150, 0) 55%);
}

.den { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.den i {
  position: absolute; bottom: -24px;
  width: 10px; height: 13px; border-radius: 45% 45% 40% 40%;
  background: radial-gradient(circle at 50% 60%, #fff3c4 0, #ffb347 45%, rgba(255, 120, 30, 0) 75%);
  box-shadow: 0 0 14px 4px rgba(255, 160, 60, .45);
  opacity: 0;
  animation: bay 14s linear infinite;
}
.den i:nth-child(1) { left: 8%;  animation-duration: 15s; animation-delay: -2s; }
.den i:nth-child(2) { left: 19%; animation-duration: 12s; animation-delay: -7s; transform: scale(.7); }
.den i:nth-child(3) { left: 31%; animation-duration: 17s; animation-delay: -4s; }
.den i:nth-child(4) { left: 44%; animation-duration: 13s; animation-delay: -10s; }
.den i:nth-child(5) { left: 56%; animation-duration: 16s; animation-delay: -1s; }
.den i:nth-child(6) { left: 67%; animation-duration: 11s; animation-delay: -6s; }
.den i:nth-child(7) { left: 76%; animation-duration: 18s; animation-delay: -12s; }
.den i:nth-child(8) { left: 86%; animation-duration: 14s; animation-delay: -3s; }
.den i:nth-child(9) { left: 94%; animation-duration: 12.5s; animation-delay: -9s; }

@keyframes bay {
  0%   { opacity: 0; translate: 0 0; }
  10%  { opacity: .9; }
  50%  { translate: 18px -55vh; }
  85%  { opacity: .7; }
  100% { opacity: 0; translate: -10px -110vh; }
}

.hero__san {
  position: absolute; inset: 0;
  container: hero / size;
}

.nhom-tho {
  --gh: min(90cqh, 54cqw / 1.11);
  position: absolute; left: 3cqw; bottom: 0;
  height: var(--gh);
  aspect-ratio: 700 / 630;
}
.tho { position: absolute; height: auto; pointer-events: none; will-change: transform; }
.tho--sao { left: 0; bottom: 0; width: 58.1%; z-index: 2; }
.tho--dan { left: 41%; bottom: 5%; width: 56.4%; z-index: 1; }

.not-nhac { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.not {
  position: absolute; left: var(--x); top: var(--y);
  width: calc(var(--w) * var(--gh) / 630 * 1.8); height: auto;
  opacity: 0;
  animation: not-bay var(--tg) ease-out var(--tre) infinite;
}
@keyframes not-bay {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(0deg); }
  14%  { opacity: 1; }
  50%  { transform: translate(calc(-50% + var(--gh) * var(--ngang) * .45 + 10px), calc(-50% - var(--gh) * var(--cao) * .5)) scale(.95) rotate(calc(var(--xoay) * -.4)); }
  75%  { opacity: .9; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--gh) * var(--ngang)), calc(-50% - var(--gh) * var(--cao))) scale(1.15) rotate(var(--xoay)); }
}

.hero__noi {
  position: absolute; top: 0; right: 0; bottom: 0;
  left: calc(3cqw + min(90cqh, 54cqw / 1.11) * 1.11 * .9);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(10px, 2.4cqh, 22px);
  padding: calc(var(--dau-cao) + 2cqh) 3cqw 8cqh;
}

.logo {
  width: min(100%, 620px, 110cqh);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(60, 16, 0, .45));
}

.phien-ban {
  margin: 0;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: clamp(14px, 2.2cqh, 18px); font-weight: 800; letter-spacing: .4px;
  color: #fff4d6;
  background: rgba(58, 16, 4, .55);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 140, .28);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}

.nut-choi {
  position: relative; display: block;
  width: clamp(200px, 24cqw, 290px);
  margin-top: clamp(4px, 1.5cqh, 14px);
  border-radius: 46px;
  filter: drop-shadow(0 8px 14px rgba(40, 12, 0, .45));
  transition: transform .18s ease, filter .18s ease;
  cursor: pointer;
}
.nut-choi__anh, .nut-choi__bam { width: 100%; height: auto; }
.nut-choi__bam { position: absolute; inset: 0; opacity: 0; }
.nut-choi:hover { transform: translateY(-3px) scale(1.04); filter: drop-shadow(0 12px 18px rgba(40, 12, 0, .5)) brightness(1.06); }
.nut-choi:active { transform: translateY(1px) scale(.98); }
.nut-choi:active .nut-choi__bam { opacity: 1; }
.nut-choi:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

.nut-choi__loe {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  -webkit-mask: url(assets/nut-vao-game.webp) center / 100% 100% no-repeat;
  mask: url(assets/nut-vao-game.webp) center / 100% 100% no-repeat;
}
.nut-choi__loe span {
  position: absolute; top: 0; bottom: 0; left: -45%; width: 32%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent);
  animation: loe 3.4s ease-in-out 1.6s infinite;
}
@keyframes loe {
  0%   { translate: 0 0; }
  45%, 100% { translate: 470% 0; }
}

.nut-choi.cho { cursor: default; filter: grayscale(.45) brightness(.96) drop-shadow(0 8px 14px rgba(40, 12, 0, .4)); }
.nut-choi.cho:hover, .nut-choi.cho:active { transform: none; }
.nut-choi.cho .nut-choi__loe { display: none; }
.nut-choi__ghi {
  margin: -4px 0 0;
  font-size: 15px; font-weight: 800; color: #ffe9b0;
  text-shadow: 0 1px 0 var(--nau), 0 0 8px rgba(0, 0, 0, .55);
}

@container hero (orientation: portrait) {
  .nhom-tho {
    --gh: min(46cqh, 92cqw / 1.11, 100cqh - 370px);
    left: 50%; translate: -52% 0;
  }
  .hero__noi {
    left: 0; bottom: auto;
    justify-content: flex-start;
    gap: 10px;
    padding: calc(var(--dau-cao) + 3cqh) 6cqw 0;
  }
  .logo { width: min(94cqw, 480px); }
  .nut-choi { width: min(58cqw, 250px); margin-top: 2px; }
}

.tho--sao { animation: vao-trai .95s cubic-bezier(.2, .8, .2, 1) .15s both, bong 3.8s ease-in-out 1.2s infinite alternate; }
.tho--dan { animation: vao-trai .95s cubic-bezier(.2, .8, .2, 1) .35s both, bong 4.4s ease-in-out 1.4s infinite alternate-reverse; }
.logo     { animation: vao-logo .8s cubic-bezier(.2, .9, .3, 1.2) .55s both; }
.phien-ban, .nut-choi, .nut-choi__ghi { animation: vao-len .6s ease-out .9s both; }
.hero__nen { animation: keo 2.2s ease-out both; }

@keyframes vao-trai { from { opacity: 0; transform: translate(-22%, 10%) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes vao-logo { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
@keyframes vao-len  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes keo      { from { transform: scale(1.07); } to { transform: none; } }
@keyframes bong     { from { transform: translateY(0); } to { transform: translateY(-1.6%); } }

.js .hero:not(.san-sang) .tho,
.js .hero:not(.san-sang) .logo,
.js .hero:not(.san-sang) .phien-ban,
.js .hero:not(.san-sang) .nut-choi,
.js .hero:not(.san-sang) .nut-choi__ghi,
.js .hero:not(.san-sang) .hero__nen { animation-play-state: paused; }

.khong-dong *, .khong-dong *::before, .khong-dong *::after { animation: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .not-nhac { display: none; }
}

.chan {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px;
  padding: 14px max(16px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  font-size: 14px; color: rgba(255, 238, 205, .72);
  background: var(--nau-dam);
  border-top: 1px solid rgba(255, 212, 140, .12);
}
.chan a { color: #ffe3a0; font-weight: 800; }
.chan a:hover { text-decoration: underline; }
