/* 主頁專用：覆寫 body 背景層，與 styles.css 變數相容 */

body.home-page {
  font-family:
    "Noto Sans TC",
    "Outfit",
    "Segoe UI",
    "PingFang TC",
    "Microsoft JhengHei",
    sans-serif;
  background: #030712;
  background-image: none;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.home-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.home-aurora__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: homeBlobFloat 18s ease-in-out infinite;
}

.home-aurora__blob--a {
  width: min(72vw, 520px);
  height: min(72vw, 520px);
  background: radial-gradient(circle, rgba(56, 189, 248, 0.9) 0%, transparent 70%);
  top: -12%;
  left: -8%;
  animation-delay: 0s;
}

.home-aurora__blob--b {
  width: min(60vw, 440px);
  height: min(60vw, 440px);
  background: radial-gradient(circle, rgba(167, 139, 250, 0.85) 0%, transparent 68%);
  top: 35%;
  right: -15%;
  animation-delay: -6s;
}

.home-aurora__blob--c {
  width: min(55vw, 400px);
  height: min(55vw, 400px);
  background: radial-gradient(circle, rgba(244, 114, 182, 0.5) 0%, transparent 65%);
  bottom: -10%;
  left: 25%;
  animation-delay: -12s;
}

@keyframes homeBlobFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(4%, 6%) scale(1.06);
  }
  66% {
    transform: translate(-3%, 4%) scale(0.96);
  }
}

.home-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.home {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) 3rem;
}

.home-layout {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 0;
}

@media (min-width: 1080px) {
  .home-layout {
    grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) minmax(96px, 150px);
    column-gap: 0.5rem;
  }
}

.home-main {
  min-width: 0;
}

.home-wing {
  display: none;
  pointer-events: none;
}

@media (min-width: 1080px) {
  .home-wing {
    display: flex;
    justify-content: center;
    padding-top: min(18vh, 9rem);
  }

  .home-wing__img {
    width: min(380px, 42vw);
    max-width: none;
    height: auto;
    filter: drop-shadow(0 14px 36px rgba(0, 0, 0, 0.5));
    animation: homeMascotDriftL 8s ease-in-out infinite;
  }

  .home-wing--left .home-wing__img {
    transform: translateX(-22%);
  }

  .home-wing--right .home-wing__img--mirror {
    transform: scaleX(-1) translateX(-22%);
    animation-name: homeMascotDriftR;
    animation-delay: -3s;
  }
}

@keyframes homeMascotDriftL {
  0%,
  100% {
    transform: translateX(-22%) translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateX(-22%) translateY(-12px) rotate(1deg);
  }
}

@keyframes homeMascotDriftR {
  0%,
  100% {
    transform: scaleX(-1) translateX(-22%) translateY(0) rotate(1deg);
  }
  50% {
    transform: scaleX(-1) translateX(-22%) translateY(-10px) rotate(-1deg);
  }
}

.home-mascots {
  margin: 0 auto 0.2rem;
  text-align: center;
}

.home-mascots img {
  display: block;
  margin: 0 auto;
  max-width: min(520px, 94vw);
  height: auto;
  filter: drop-shadow(0 12px 36px rgba(0, 0, 0, 0.4));
  animation: homeMascotCenter 7s ease-in-out infinite;
}

@keyframes homeMascotCenter {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.home-mascots-note {
  margin: 0 0 1.5rem;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: rgba(148, 163, 184, 0.55);
}

@media (min-width: 1080px) {
  .home-mascots,
  .home-mascots-note {
    display: none;
  }
}

.home-mascots--mini {
  margin: 0 auto 0.75rem;
}

.home-mascots--mini img {
  max-width: min(220px, 55vw);
  height: auto;
  margin: 0 auto;
  display: block;
  opacity: 0.55;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.35));
}

.home-hero {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
}

.home-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.home-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0c1222;
  background: linear-gradient(135deg, #7dd3fc 0%, #a5f3fc 50%, #c4b5fd 100%);
  border-radius: 999px;
  box-shadow:
    0 0 20px rgba(56, 189, 248, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.home-pill--dim {
  background: rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
  letter-spacing: 0.1em;
}

.home-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.home-title__line {
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.1;
  background: linear-gradient(
    120deg,
    #f8fafc 0%,
    #e0f2fe 25%,
    #7dd3fc 45%,
    #c4b5fd 70%,
    #f9a8d4 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: homeShimmer 8s ease-in-out infinite;
}

.home-title__accent {
  font-family: "Outfit", sans-serif;
  font-size: clamp(0.75rem, 2.5vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.55em;
  padding-left: 0.55em;
  color: rgba(148, 163, 184, 0.55);
}

@keyframes homeShimmer {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.home-tagline {
  margin: 1.1rem auto 0;
  max-width: 26rem;
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
  font-weight: 500;
  line-height: 1.65;
  color: rgba(203, 213, 225, 0.88);
}

.home-showcase__label {
  margin: 0 0 0.85rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.55);
  text-align: center;
}

.game-cards {
  display: grid;
  gap: 1rem;
  text-align: left;
}

@media (min-width: 640px) {
  .game-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
  }
}

@media (min-width: 900px) {
  .game-cards {
    gap: 1.25rem;
  }
}

.game-card {
  --card-hue: 199;
  --card-glow: rgba(56, 189, 248, 0.45);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1.3rem 1.2rem;
  border-radius: 20px;
  text-decoration: none;
  color: #e2e8f0;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.09) 0%,
    rgba(255, 255, 255, 0.02) 45%,
    rgba(15, 23, 42, 0.65) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.game-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    hsla(var(--card-hue), 95%, 65%, 0.95),
    transparent
  );
  opacity: 0.85;
}

.game-card--gomoku {
  --card-hue: 199;
  --card-glow: rgba(56, 189, 248, 0.5);
}

.game-card--go {
  --card-hue: 265;
  --card-glow: rgba(167, 139, 250, 0.55);
}

.game-card--sudoku {
  --card-hue: 330;
  --card-glow: rgba(244, 114, 182, 0.45);
}

.game-card--fighter {
  --card-hue: 32;
  --card-glow: rgba(251, 146, 60, 0.5);
}

.game-card__shine {
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.07) 48%,
    transparent 62%
  );
  transform: translateX(-100%) rotate(12deg);
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.game-card:hover .game-card__shine {
  transform: translateX(100%) rotate(12deg);
}

.game-card__index {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  font-family: "Outfit", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.06);
  user-select: none;
}

.game-card__icon {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.65rem;
  font-size: 1.1rem;
  color: hsl(var(--card-hue), 90%, 78%);
  background: hsla(var(--card-hue), 70%, 50%, 0.18);
  border-radius: 12px;
  border: 1px solid hsla(var(--card-hue), 80%, 60%, 0.25);
}

.game-card__title {
  margin: 0 0 0.2rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f8fafc;
}

.game-card__meta {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: hsla(var(--card-hue), 85%, 72%, 0.95);
  text-transform: uppercase;
}

.game-card__desc {
  margin: 0;
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(186, 198, 216, 0.9);
}

.game-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.15rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
}

.game-card__arrow {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: hsla(var(--card-hue), 70%, 58%, 0.45);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    0 0 40px var(--card-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.game-card:hover .game-card__arrow {
  transform: translateX(4px);
}

.game-card:active {
  transform: translateY(-2px) scale(1.01);
}

.game-card:focus-visible {
  outline: 2px solid hsl(var(--card-hue), 85%, 65%);
  outline-offset: 4px;
}

.home-footer {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  text-align: center;
}

.home-footer p {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: rgba(148, 163, 184, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .home-aurora__blob,
  .home-title__line,
  .home-mascots img,
  .home-wing__img {
    animation: none;
  }

  .home-title__line {
    background-position: 50% 50%;
  }

  .home-wing--left .home-wing__img {
    transform: translateX(-22%);
  }

  .home-wing--right .home-wing__img--mirror {
    transform: scaleX(-1) translateX(-22%);
  }

  .game-card,
  .game-card__shine,
  .game-card__arrow {
    transition-duration: 0.01ms;
  }

  .game-card:hover {
    transform: none;
  }

  .game-card:hover .game-card__shine {
    transform: translateX(-100%) rotate(12deg);
  }
}
