/* Trang chủ: cảnh hero theo từng giao diện + hoạt cảnh (xuất hiện, lơ lửng, nghiêng thẻ, chuyển giao diện).
   Nạp sau style.css. Màu theo giao diện vẫn nằm trong style.css; file này thay hue-rotate cũ bằng cảnh riêng. */

:root {
  --em1: #ff7859;
  --em2: #ffb347;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-pop: cubic-bezier(0.3, 1.5, 0.5, 1);
}
html[data-theme="dark"] {
  --em1: #9d7bff;
  --em2: #5ee7ff;
}
html[data-theme="halloween"] {
  --em1: #ff7a18;
  --em2: #ffd23f;
}
html[data-theme="christmas"] {
  --em1: #d53f45;
  --em2: #2e9e6a;
}
html[data-theme="tet"] {
  --em1: #d73f1b;
  --em2: #f2b01e;
}

/* ---------- nền hạt (canvas) ---------- */
.fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
/* bỏ chuỗi ký tự tĩnh cũ, giờ đã có hạt động */
html[data-theme] body::before {
  content: none;
}

/* ---------- đổi giao diện: màu mới lan ra từ nút chọn ---------- */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-new(root) {
  animation: vtReveal 0.75s cubic-bezier(0.65, 0, 0.25, 1);
}
@keyframes vtReveal {
  from {
    clip-path: circle(0 at var(--vt-x, 90%) var(--vt-y, 0));
  }
  to {
    clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 90%) var(--vt-y, 0));
  }
}

/* ---------- vào trang ---------- */
.topbar {
  animation: dropIn 0.7s var(--ease-out) backwards;
}
.hero-copy > * {
  animation: riseIn 0.8s var(--ease-out) backwards;
}
.hero-copy > :nth-child(1) {
  animation-delay: 0.1s;
}
.hero-copy > :nth-child(2) {
  animation-delay: 0.2s;
}
.hero-copy > :nth-child(3) {
  animation-delay: 0.32s;
}
.hero-copy > :nth-child(4) {
  animation-delay: 0.44s;
}
@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
}
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(26px);
    filter: blur(6px);
  }
}

/* tiêu đề: chữ màu ánh chạy */
.hero h1 em {
  background: linear-gradient(100deg, var(--em1) 0%, var(--em2) 30%, var(--em1) 60%, var(--em2) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: -250% 0;
  }
}
.eyebrow span {
  animation: lineGrow 0.9s 0.3s var(--ease-out) both;
  transform-origin: left;
}
@keyframes lineGrow {
  from {
    transform: scaleX(0);
  }
}

/* nút chính: vệt sáng quét qua */
.primary-button {
  position: relative;
  display: inline-block;
  overflow: hidden;
}
.primary-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%);
}
.primary-button:hover::after {
  transform: translateX(120%);
  transition: transform 0.75s ease;
}
.primary-button span {
  display: inline-block;
  animation: nudgeDown 1.6s ease-in-out infinite;
}
@keyframes nudgeDown {
  50% {
    transform: translateY(3px);
  }
}
.play-button span {
  display: inline-block;
  transition: transform 0.25s var(--ease-out);
}
.play-button:hover span {
  transform: translateX(4px);
}

.status-pill i {
  animation: pulseDot 1.8s ease-out infinite;
}
@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(113, 207, 124, 0.7);
  }
  80%,
  100% {
    box-shadow: 0 0 0 7px rgba(113, 207, 124, 0);
  }
}
.brand-mark {
  transition: transform 0.5s var(--ease-pop);
}
.brand:hover .brand-mark {
  transform: rotate(180deg) scale(1.08);
}
.theme-menu:not([hidden]) {
  animation: menuIn 0.22s var(--ease-out);
  transform-origin: top right;
}
@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }
}
.theme-menu button > span {
  transition: transform 0.25s var(--ease-pop);
}
.theme-menu button:hover > span {
  transform: scale(1.25) rotate(-8deg);
}

/* ---------- tranh hero ---------- */
.hero-art {
  animation:
    artIn 1s 0.2s var(--ease-pop) both,
    artFloat 8s 1.2s ease-in-out infinite;
  transition:
    background 0.5s,
    box-shadow 0.5s;
}
@keyframes artIn {
  from {
    opacity: 0;
    transform: rotate(-4deg) scale(0.85);
  }
  to {
    transform: rotate(3deg);
  }
}
@keyframes artFloat {
  0%,
  100% {
    transform: rotate(3deg) translateY(0);
  }
  50% {
    transform: rotate(1.5deg) translateY(-10px);
  }
}
/* parallax theo con trỏ: dùng thuộc tính translate để không đè animation transform */
.hero-art > :not(.island),
.island > * {
  translate: calc(var(--px, 0) * var(--depth, 10) * 1px) calc(var(--py, 0) * var(--depth, 10) * 1px);
  transition: translate 0.5s var(--ease-out);
}
.sun {
  --depth: 12;
  animation: sunGlow 4s ease-in-out infinite;
}
.sun::before {
  content: "";
  position: absolute;
  inset: -34px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 213, 110, 0.55) 0 7deg, transparent 7deg 22deg);
  -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%, #000 70%, transparent 72%);
  mask: radial-gradient(circle, transparent 54%, #000 56%, #000 70%, transparent 72%);
  animation: spin 24s linear infinite;
}
@keyframes sunGlow {
  50% {
    box-shadow: 0 0 46px 10px rgba(255, 213, 110, 0.55);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.cloud {
  --depth: 22;
}
.cloud-a {
  animation: driftA 14s ease-in-out infinite;
}
.cloud-b {
  animation: driftB 18s ease-in-out infinite;
}
@keyframes driftA {
  50% {
    transform: translateX(46px);
  }
}
@keyframes driftB {
  0%,
  100% {
    transform: scale(0.7) translateX(0);
  }
  50% {
    transform: scale(0.7) translateX(-60px);
  }
}
.island-ground {
  --depth: 6;
  transition:
    translate 0.5s var(--ease-out),
    background 0.5s;
}
.island-tree {
  --depth: 12;
  transform-origin: 50% 95%;
  animation: sway 4.5s ease-in-out infinite;
}
@keyframes sway {
  50% {
    transform: rotate(-5deg);
  }
}
.hero-snake {
  --depth: 26;
  transform-origin: 50% 100%;
  animation: snakeWiggle 2.6s ease-in-out infinite;
}
@keyframes snakeWiggle {
  25% {
    transform: rotate(-6deg) scaleY(1.04);
  }
  75% {
    transform: rotate(5deg) scaleY(0.97);
  }
}
.hero-bird {
  --depth: 34;
  animation: birdBob 2.2s ease-in-out infinite;
}
@keyframes birdBob {
  50% {
    transform: translate(12px, -16px) rotate(-8deg);
  }
}
.spark {
  --depth: 30;
  animation: twinkle 2.4s ease-in-out infinite;
}
.spark-b {
  animation-delay: -1.2s;
}
@keyframes twinkle {
  0%,
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.6) rotate(45deg);
  }
}

/* đồ trang trí theo giao diện: ẩn mặc định */
.prop,
.sky-stars,
.shooting-star {
  display: none;
  position: absolute;
  --depth: 28;
}
.sky-stars {
  inset: 0;
  --depth: 4;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent),
    radial-gradient(1px 1px at 22% 42%, #fff, transparent),
    radial-gradient(2px 2px at 34% 12%, #fff, transparent),
    radial-gradient(1px 1px at 46% 30%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 58% 8%, #fff, transparent),
    radial-gradient(1px 1px at 66% 46%, #fff, transparent),
    radial-gradient(2px 2px at 78% 60%, #fff, transparent),
    radial-gradient(1px 1px at 88% 24%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 8% 56%, #fff, transparent),
    radial-gradient(1px 1px at 40% 58%, #fff, transparent);
  animation: starsBlink 3s ease-in-out infinite alternate;
}
@keyframes starsBlink {
  to {
    opacity: 0.4;
  }
}
.shooting-star {
  top: 40px;
  left: 30%;
  width: 120px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff);
  transform: rotate(-25deg);
  opacity: 0;
  animation: shoot 6s 2s ease-in infinite;
}
@keyframes shoot {
  0% {
    opacity: 0;
    transform: rotate(-25deg) translateX(-120px);
  }
  4% {
    opacity: 1;
  }
  12%,
  100% {
    opacity: 0;
    transform: rotate(-25deg) translateX(320px);
  }
}

/* ---------- Tối · Neon đêm ---------- */
html[data-theme] .hero-art {
  filter: none;
}
html[data-theme="dark"] .hero-art {
  background: radial-gradient(circle at 70% 25%, #3b2f8f, transparent 55%), linear-gradient(180deg, #151a44, #24185a);
  box-shadow:
    inset 0 -20px #5b3fd6,
    0 0 0 2px rgba(125, 107, 255, 0.45),
    0 0 50px rgba(125, 107, 255, 0.35);
}
html[data-theme="dark"] .sun {
  background: transparent;
  box-shadow: inset -30px 10px 0 0 #efeaff;
  filter: drop-shadow(0 0 18px rgba(200, 190, 255, 0.8));
  animation: moonGlow 5s ease-in-out infinite;
}
html[data-theme="dark"] .sun::before {
  display: none;
}
@keyframes moonGlow {
  50% {
    filter: drop-shadow(0 0 30px rgba(200, 190, 255, 1));
  }
}
html[data-theme="dark"] .cloud {
  background: #3a3580;
  opacity: 0.7;
}
html[data-theme="dark"] .island-ground {
  background: linear-gradient(#1d4f63, #123345);
  box-shadow: 0 -3px 0 #3ee6ff, 0 -6px 22px rgba(62, 230, 255, 0.6);
}
html[data-theme="dark"] .island-tree {
  filter: brightness(0.55) saturate(1.4) drop-shadow(0 0 8px rgba(62, 230, 255, 0.6));
}
html[data-theme="dark"] .hero-snake {
  filter: drop-shadow(0 0 10px rgba(94, 231, 255, 0.8));
}
html[data-theme="dark"] .spark {
  color: #5ee7ff;
  text-shadow: 0 0 12px #5ee7ff;
}
html[data-theme="dark"] .hero-bird {
  display: none;
}
html[data-theme="dark"] .sky-stars,
html[data-theme="dark"] .shooting-star,
html[data-theme="dark"] .p-ufo {
  display: block;
}
.p-ufo {
  top: 92px;
  left: 150px;
  font-size: 54px;
  --depth: 34;
  animation: ufoHover 5s ease-in-out infinite;
}
.p-ufo::after {
  content: "";
  position: absolute;
  top: 82%;
  left: 18%;
  width: 64%;
  height: 90px;
  background: linear-gradient(rgba(94, 231, 255, 0.55), transparent);
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
  animation: beam 2.5s ease-in-out infinite;
}
@keyframes ufoHover {
  0%,
  100% {
    transform: translate(0, 0) rotate(-6deg);
  }
  50% {
    transform: translate(70px, -14px) rotate(6deg);
  }
}
@keyframes beam {
  50% {
    opacity: 0.3;
  }
}

/* ---------- Halloween ---------- */
html[data-theme="halloween"] .hero-art {
  background: radial-gradient(circle at 72% 28%, #7a2f6b, transparent 55%), linear-gradient(180deg, #2a0f3a, #44183f);
  box-shadow:
    inset 0 -20px #6b2a3f,
    0 0 50px rgba(255, 122, 24, 0.25);
}
html[data-theme="halloween"] .sun {
  background:
    radial-gradient(circle at 35% 40%, #ffd27a 0 18%, transparent 19%),
    radial-gradient(circle at 62% 64%, #f59a3a 0 10%, transparent 11%),
    radial-gradient(circle at 40% 70%, #f59a3a 0 7%, transparent 8%),
    #ffb347;
  box-shadow: 0 0 60px 14px rgba(255, 140, 40, 0.55);
  animation: none;
}
html[data-theme="halloween"] .sun::before {
  display: none;
}
html[data-theme="halloween"] .cloud {
  background: #5a2c63;
  opacity: 0.85;
}
html[data-theme="halloween"] .island-ground {
  background: linear-gradient(#2b1636, #1a0c22);
}
html[data-theme="halloween"] .island-tree {
  filter: brightness(0) drop-shadow(0 0 1px #000);
  opacity: 0.85;
}
html[data-theme="halloween"] .hero-bird {
  display: none;
}
html[data-theme="halloween"] .spark {
  color: #ffd23f;
}
html[data-theme="halloween"] .sky-stars,
html[data-theme="halloween"] .p-bat,
html[data-theme="halloween"] .p-pumpkin,
html[data-theme="halloween"] .p-ghost {
  display: block;
}
.p-bat {
  font-size: 30px;
  --depth: 40;
  filter: brightness(0.35);
}
.bat-a {
  top: 70px;
  left: 120px;
  animation:
    batFly 7s ease-in-out infinite,
    flap 0.25s ease-in-out infinite alternate;
}
.bat-b {
  top: 130px;
  left: 260px;
  font-size: 22px;
  animation:
    batFly 9s -3s ease-in-out infinite,
    flap 0.2s ease-in-out infinite alternate;
}
.bat-c {
  top: 36px;
  left: 330px;
  font-size: 18px;
  animation:
    batFly 8s -5s ease-in-out infinite reverse,
    flap 0.22s ease-in-out infinite alternate;
}
@keyframes batFly {
  0%,
  100% {
    margin: 0;
  }
  25% {
    margin: -20px 0 0 60px;
  }
  50% {
    margin: 14px 0 0 110px;
  }
  75% {
    margin: 30px 0 0 40px;
  }
}
@keyframes flap {
  to {
    transform: scaleY(0.55) scaleX(1.12);
  }
}
.p-pumpkin {
  --depth: 14;
  transform-origin: 50% 100%;
  animation: pumpkinGlow 2.2s ease-in-out infinite;
}
.pumpkin-a {
  bottom: 34px;
  left: 196px;
  font-size: 48px;
}
.pumpkin-b {
  bottom: 52px;
  left: 262px;
  font-size: 32px;
  animation-delay: -1.1s;
}
@keyframes pumpkinGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 4px rgba(255, 140, 40, 0.5));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(255, 140, 40, 1));
    transform: scale(1.06, 0.96);
  }
}
.p-ghost {
  top: 120px;
  left: 300px;
  font-size: 46px;
  --depth: 36;
  animation: ghostFloat 5s ease-in-out infinite;
}
@keyframes ghostFloat {
  0%,
  100% {
    transform: translate(0, 0);
    opacity: 0.9;
  }
  50% {
    transform: translate(-40px, -18px);
    opacity: 0.35;
  }
}

/* ---------- Giáng Sinh ---------- */
html[data-theme="christmas"] .hero-art {
  background: linear-gradient(180deg, #cdeffc, #eefaff 70%);
  box-shadow: inset 0 -20px #bfe3f2;
}
html[data-theme="christmas"] .sun {
  background: #fff1c2;
  animation: none;
  box-shadow: 0 0 40px 8px rgba(255, 241, 194, 0.9);
}
html[data-theme="christmas"] .sun::before {
  background: repeating-conic-gradient(from 0deg, rgba(255, 236, 170, 0.7) 0 6deg, transparent 6deg 24deg);
}
html[data-theme="christmas"] .cloud {
  background: #fff;
}
html[data-theme="christmas"] .island-ground {
  background: linear-gradient(#ffffff, #e4f4fb);
  box-shadow: 0 -4px 14px rgba(120, 190, 220, 0.35);
}
html[data-theme="christmas"] .island-tree {
  display: none;
}
html[data-theme="christmas"] .spark {
  color: #e3b341;
}
html[data-theme="christmas"] .p-xtree,
html[data-theme="christmas"] .p-snowman,
html[data-theme="christmas"] .p-gift,
html[data-theme="christmas"] .p-snow {
  display: block;
}
.p-xtree {
  bottom: 40px;
  left: 78px;
  font-size: 92px;
  --depth: 12;
  animation: treeTwinkle 2s steps(2) infinite;
}
@keyframes treeTwinkle {
  50% {
    filter: drop-shadow(0 0 10px rgba(255, 220, 120, 0.9)) brightness(1.08);
  }
}
.p-snowman {
  bottom: 46px;
  left: 222px;
  font-size: 62px;
  --depth: 16;
  transform-origin: 50% 100%;
  animation: sway 3.5s ease-in-out infinite;
}
.p-gift {
  bottom: 40px;
  left: 178px;
  font-size: 34px;
  --depth: 14;
  transform-origin: 50% 100%;
  animation: giftHop 2.8s ease-in-out infinite;
}
@keyframes giftHop {
  0%,
  70%,
  100% {
    transform: translateY(0) scale(1);
  }
  78% {
    transform: translateY(0) scale(1.15, 0.85);
  }
  86% {
    transform: translateY(-16px) scale(0.95, 1.05);
  }
}
.p-snow {
  inset: -40px 0 0;
  --depth: 18;
  background-image:
    radial-gradient(3px 3px at 20px 30px, #fff, transparent),
    radial-gradient(2px 2px at 80px 70px, #fff, transparent),
    radial-gradient(3px 3px at 140px 20px, #fff, transparent),
    radial-gradient(2px 2px at 60px 110px, #fff, transparent),
    radial-gradient(2.5px 2.5px at 170px 90px, #fff, transparent),
    radial-gradient(2px 2px at 110px 150px, #fff, transparent);
  background-size: 190px 170px;
  filter: drop-shadow(0 0 1px rgba(90, 150, 190, 0.8));
  animation: snowFall 7s linear infinite;
}
@keyframes snowFall {
  to {
    background-position:
      30px 170px,
      -20px 170px,
      20px 170px,
      -30px 170px,
      10px 170px,
      -10px 170px;
  }
}

/* ---------- Tết ---------- */
html[data-theme="tet"] .hero-art {
  background: radial-gradient(circle at 75% 25%, #ffe08a, transparent 50%), linear-gradient(180deg, #ffd27a, #ffb35c);
  box-shadow:
    inset 0 -20px #e4572e,
    0 0 50px rgba(242, 176, 30, 0.35);
}
html[data-theme="tet"] .sun {
  background: radial-gradient(circle, #fff1a8, #ffc93c 70%);
}
html[data-theme="tet"] .sun::before {
  background: repeating-conic-gradient(from 0deg, rgba(215, 63, 27, 0.5) 0 6deg, transparent 6deg 20deg);
}
html[data-theme="tet"] .cloud {
  background: #fff3d6;
}
html[data-theme="tet"] .island-ground {
  background: linear-gradient(#f0a23b, #d9772a);
}
html[data-theme="tet"] .island-tree {
  display: none;
}
html[data-theme="tet"] .spark {
  color: #d73f1b;
}
html[data-theme="tet"] .p-lantern,
html[data-theme="tet"] .p-envelope,
html[data-theme="tet"] .p-mai {
  display: block;
}
.p-lantern {
  top: 0;
  font-size: 44px;
  --depth: 20;
  transform-origin: 50% -40px;
  animation: lanternSwing 3.2s ease-in-out infinite;
}
.p-lantern::before {
  content: "";
  position: absolute;
  bottom: 88%;
  left: 50%;
  width: 2px;
  height: 40px;
  background: #8a2b16;
}
.lantern-a {
  top: 34px;
  left: 300px;
}
.lantern-b {
  top: 14px;
  left: 372px;
  font-size: 34px;
  animation-delay: -1.4s;
}
@keyframes lanternSwing {
  0%,
  100% {
    transform: rotate(-7deg);
  }
  50% {
    transform: rotate(7deg);
  }
}
.p-envelope {
  bottom: 40px;
  left: 210px;
  font-size: 46px;
  --depth: 16;
  transform-origin: 50% 100%;
  animation: giftHop 3s ease-in-out infinite;
}
.p-mai {
  top: 10px;
  left: 10px;
  width: 230px;
  height: 120px;
  --depth: 10;
  transform-origin: 0 0;
  animation: branchSway 6s ease-in-out infinite;
}
.p-mai::before {
  content: "";
  position: absolute;
  top: 20px;
  left: -20px;
  width: 240px;
  height: 90px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 90'><path d='M0 80 Q60 0 140 10 T240 40' fill='none' stroke='%236b3a1e' stroke-width='6' stroke-linecap='round'/><path d='M100 12 Q118 36 108 58' fill='none' stroke='%236b3a1e' stroke-width='3' stroke-linecap='round'/></svg>")
    no-repeat center / contain;
}
.p-mai i {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #e36a16 0 18%, transparent 20%),
    conic-gradient(
      from 18deg,
      #ffd23f 0 14%,
      transparent 14% 20%,
      #ffd23f 20% 34%,
      transparent 34% 40%,
      #ffd23f 40% 54%,
      transparent 54% 60%,
      #ffd23f 60% 74%,
      transparent 74% 80%,
      #ffd23f 80% 94%,
      transparent 94%
    );
  animation: bloom 3s ease-in-out infinite;
}
.p-mai i:nth-child(1) {
  top: 53px;
  left: -2px;
}
.p-mai i:nth-child(2) {
  top: 29px;
  left: 32px;
  animation-delay: -0.6s;
}
.p-mai i:nth-child(3) {
  top: 16px;
  left: 66px;
  width: 30px;
  height: 30px;
  animation-delay: -1.2s;
}
.p-mai i:nth-child(4) {
  top: 19px;
  left: 127px;
  animation-delay: -1.8s;
}
.p-mai i:nth-child(5) {
  top: 31px;
  left: 175px;
  width: 20px;
  height: 20px;
  animation-delay: -2.4s;
}
@keyframes bloom {
  50% {
    transform: scale(1.15) rotate(20deg);
  }
}
@keyframes branchSway {
  50% {
    transform: rotate(2.5deg);
  }
}

/* ---------- thẻ game: hiện dần, nghiêng theo chuột, ánh sáng lướt ---------- */
.fx-reveal {
  opacity: 0;
  transform: translateY(30px);
}
.fx-reveal.fx-in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.7s ease var(--d, 0s),
    transform 0.7s var(--ease-out) var(--d, 0s);
}
.game-card {
  position: relative;
}
.game-card.fx-reveal {
  transform: translateY(36px) scale(0.97);
}
.game-card.fx-reveal.fx-in {
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  transition:
    opacity 0.6s ease var(--d, 0s),
    transform 0.6s var(--ease-out) var(--d, 0s),
    box-shadow 0.35s ease,
    background 0.45s ease,
    border-color 0.35s ease;
}
.game-card.fx-reveal.fx-in.fx-tilt {
  transition:
    transform 0.12s linear,
    box-shadow 0.35s ease,
    background 0.45s ease;
}
.game-card:hover {
  --lift: -6px;
  box-shadow: 0 26px 50px rgba(25, 34, 56, 0.16);
}
html:is([data-theme="dark"], [data-theme="halloween"]) .game-card:hover {
  box-shadow:
    0 26px 54px rgba(0, 0, 0, 0.5),
    0 0 0 1px color-mix(in srgb, var(--orange) 55%, transparent);
}
.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.16), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.game-card:hover::after {
  opacity: 1;
}
.game-card .game-icon {
  transition: transform 0.4s var(--ease-pop);
}
.game-card:hover .game-icon {
  transform: rotate(-10deg) scale(1.12);
}
.cover-visual img {
  transition:
    transform 0.6s var(--ease-out),
    filter 0.4s;
}
.game-card:hover .cover-visual img {
  transform: scale(1.06);
  filter: saturate(1.12);
}
.page-button {
  transition:
    transform 0.25s var(--ease-pop),
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
}
.page-button:active {
  transform: scale(0.9);
}

/* ---------- chi tiết màu cho giao diện tối ---------- */
html:is([data-theme="dark"], [data-theme="halloween"]) .card-description {
  color: var(--muted);
}
html:is([data-theme="dark"], [data-theme="halloween"]) .network-note {
  background: rgba(80, 200, 140, 0.1);
  border-color: rgba(80, 200, 140, 0.3);
  color: #8fe3b5;
}
html:is([data-theme="dark"], [data-theme="halloween"]) .game-icon {
  background: rgba(255, 255, 255, 0.08);
}
html:is([data-theme="dark"], [data-theme="halloween"]) .page-button:not(.active):not(:hover) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--ink);
}
html[data-theme="halloween"] .tag {
  background: #3a1f44;
  color: #e6c2d0;
}
html:is([data-theme="christmas"], [data-theme="tet"]) .page-button.active,
html:is([data-theme="christmas"], [data-theme="tet"]) .page-button:hover {
  background: var(--orange);
  border-color: var(--orange);
}

/* ---------- màn hình nhỏ: tranh hero hẹp, đặt theo phần trăm để không chồng nhau ---------- */
@media (max-width: 760px) {
  .sun {
    width: 92px;
    height: 92px;
    top: 34px;
    right: 9%;
  }
  .sun::before {
    inset: -24px;
  }
  .cloud-a {
    top: 60px;
    left: 8%;
  }
  .cloud-b {
    top: 110px;
    right: 4%;
  }
  .hero-bird {
    top: 34%;
    left: 36%;
    font-size: 44px;
  }
  .hero-snake {
    right: 7%;
    bottom: 36px;
    font-size: 58px;
  }
  .island-ground {
    left: 6%;
    width: 88%;
  }
  .island-tree {
    left: 9%;
    font-size: 60px;
  }
  .p-ufo {
    left: 34%;
    top: 22%;
    font-size: 42px;
  }
  .p-ghost {
    left: 46%;
    top: 26%;
    font-size: 38px;
  }
  .pumpkin-a {
    left: 31%;
    bottom: 28px;
    font-size: 40px;
  }
  .pumpkin-b {
    left: 49%;
    bottom: 44px;
    font-size: 28px;
  }
  .bat-a {
    left: 20%;
  }
  .bat-b {
    left: 52%;
  }
  .bat-c {
    left: 40%;
  }
  .p-xtree {
    left: 6%;
    font-size: 70px;
  }
  .p-gift {
    left: 31%;
    font-size: 30px;
  }
  .p-snowman {
    left: 45%;
    font-size: 48px;
  }
  .p-envelope {
    left: 38%;
    bottom: 34px;
    font-size: 38px;
  }
  .p-mai {
    transform-origin: 0 0;
    scale: 0.75;
  }
  .lantern-a {
    left: 56%;
    top: 30px;
    font-size: 36px;
  }
  .lantern-b {
    left: 70%;
    top: 12px;
    font-size: 28px;
  }
}

/* ---------- người dùng tắt chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fx-reveal {
    opacity: 1;
    transform: none;
  }
}
