/* ========== RESET / BASE ========== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background-color: #ede9fe;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}
#app { padding-top: 90px; text-align: center; min-height: 100vh; position: relative; }
img { display: block; max-width: 100%; }
a { text-decoration: none; }

/* ========== FIXED HEADER ========== */
.fixed-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: linear-gradient(180deg, #c4b4ff, rgba(221,214,255,0.85));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(77,23,154,0.1);
}
@supports not ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .fixed-header { background-color: rgba(196,181,253,0.95); }
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-icon-img {
  height: 48px;
  width: auto;
}
.brand-text {
  font-size: 22px;
  font-weight: 800;
  color: #4d179a;
  letter-spacing: 1px;
}

/* ========== SNOWFALL BG ========== */
.snowfall-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.snowfall-container canvas { display: block; width: 100%; height: 100%; }

/* ========== MAIN CONTENT ========== */
.main-content {
  position: relative;
  z-index: 1;
  padding: 0 16px;
}

/* ========== HERO ========== */
.hero-section { position: relative; margin-bottom: 40px; }
.section-title {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 24px;
  color: #4d179a;
  text-shadow: 0 2px 8px rgba(255,255,255,0.6);
}
@media (min-width: 768px) {
  .section-title { font-size: 36px; margin-bottom: 32px; }
}

/* ========== CAROUSEL ========== */
.carousel-container {
  position: relative;
  border-radius: 16px;
  border: 1px solid #4d179a;
  overflow: hidden;
  max-width: 1024px;
  margin: 0 auto;
  box-shadow: 0 10px 25px -5px rgba(77,23,154,0.2);
}
.carousel {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
}
@media (min-width: 768px) {
  .carousel { padding-bottom: 37.5%; }
}
@media (max-width: 767px) {
  .carousel { padding-bottom: 43.75%; }
}
.carousel-track {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  transition: transform 0.6s ease;
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(77,23,154,0.5);
  border: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-nav:hover { background: rgba(77,23,154,0.85); }
.carousel-nav.prev { left: 12px; }
.carousel-nav.next { right: 12px; }
.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  padding: 0;
}
.carousel-dot.active {
  background: #fff;
  width: 24px;
  border-radius: 5px;
}

/* ========== GAMES SECTION ========== */
.games-section { padding: 0 0 28px; }
.games-container { max-width: 1024px; margin: 0 auto; }
.games-grid {
  display: flex;
  flex-direction: column;
  margin: -12px;
}
@media (min-width: 768px) {
  .games-grid { flex-direction: row; flex-wrap: wrap; }
}
.game-card-wrapper {
  width: 100%;
  padding: 12px;
  box-sizing: border-box;
  overflow: visible;
}
@media (min-width: 768px) {
  .game-card-wrapper { width: 50%; }
  .game-card-wrapper:first-child { width: 100%; }
}

/* ========== CARD STYLE 1 ========== */
.card-style1 {
  position: relative;
  background-color: #8e51ff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(77,23,154,0.3);
  border: 1px solid transparent;
  overflow: hidden;
  transition: all .3s ease;
}
.card-style1:hover {
  box-shadow: 0 10px 15px rgba(77,23,154,0.6);
  border-color: #4d179a;
  transform: translateY(-2px);
}
@media (min-width: 768px) { .card-style1 { padding: 16px; } }
.card-style1-glow {
  position: absolute;
  z-index: 1;
  top: -200px; right: -100px;
  width: 200px; height: 200px;
  border-radius: 50%;
  opacity: .5;
  background-color: #ddd6ff;
  pointer-events: none;
  transform: scale(1.5);
  filter: blur(20px);
}
.card-style1-content {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 16px;
}
.card-style1-logo {
  cursor: pointer;
  height: 112px; width: 112px;
  padding: 8px;
  box-shadow: 0 10px 15px rgba(77,23,154,0.6);
  background-color: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #4d179a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .card-style1-logo { height: 144px; width: 144px; }
}
.card-style1-logo img { max-width: 100%; max-height: 100%; }
.card-style1-logo-dark { background-color: #000 !important; }
.card-style1-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
}
.card-style1-title {
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 8px;
  color: #fff;
  text-align: left;
}
@media (min-width: 768px) {
  .card-style1-title { font-size: 24px; margin-bottom: 12px; }
}
.card-style1-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-style1-button {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background-color: #7f22fe;
  color: #fff;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 15px;
  transition: background-color .3s ease;
}
.card-style1-button:hover { background-color: #5d0ec0; }
.card-style1-button-icon { font-size: 20px; margin-left: 8px; }

.card-style1-marquee-container {
  position: relative;
  z-index: 2;
  display: flex;
  height: 48px;
  width: 100%;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 12px;
}
.card-style1-marquee-content {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #ffffff;
  font-size: 14px;
  white-space: nowrap;
  font-weight: 500;
}
@media (min-width: 768px) {
  .card-style1-marquee-content { font-size: 15px; }
}
.card-style1-gradient-left,
.card-style1-gradient-right {
  pointer-events: none;
  position: absolute;
  top: 0; bottom: 0;
  width: 16.666667%;
  z-index: 3;
}
.card-style1-gradient-left { left: 0; background: linear-gradient(90deg, #8e51ff, transparent); }
.card-style1-gradient-right { right: 0; background: linear-gradient(270deg, #8e51ff, transparent); }

/* ========== CARD STYLE 2 (featured) ========== */
.card-style2 {
  position: relative;
  width: 100%;
  overflow: visible;
}
.card-style2-logo-container {
  position: relative;
  z-index: 5;
  height: 80px;
}
.card-style2-logo {
  height: 80px;
  margin: 0 auto;
  width: 260px;
  padding: 10px 24px;
  box-shadow: 0 20px 25px 1px rgba(77,23,154,0.7);
  background-color: #4d179a;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.card-style2-logo-image {
  height: 50px;
  width: auto;
  object-fit: contain;
  filter: brightness(1.8);
}
.card-style2-logo-label {
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1px;
  white-space: nowrap;
}
.card-style2-logo-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
}
.ball-icon { font-size: 26px; }
.card-style2-left-triangle,
.card-style2-right-triangle {
  position: absolute;
  top: 0;
  width: 0; height: 0;
  border-top: 17px solid #1a0633;
  z-index: 6;
  transform: rotate(180deg);
}
.card-style2-left-triangle {
  left: calc(50% - 147px);
  border-right: 17px solid transparent;
}
.card-style2-right-triangle {
  right: calc(50% - 147px);
  border-left: 17px solid transparent;
}
.card-style2-content {
  position: relative;
  margin-top: -40px;
  overflow: hidden;
  background-color: #7f22fe;
  border-radius: 16px;
  padding: 72px 24px 24px;
  border: 1px solid #8e51ff;
  transition: all .3s ease;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 0),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 0);
  background-size: 20px 20px;
}
.card-style2-content:hover { border-color: #a684ff; }
.card-style2-glow-1, .card-style2-glow-2 {
  position: absolute;
  z-index: 3;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(20px);
}
.card-style2-glow-1 {
  top: -100px; left: -100px;
  width: 300px; height: 300px;
  opacity: .3;
  background-color: #c4b4ff;
}
.card-style2-glow-2 {
  bottom: -50px; right: -50px;
  width: 200px; height: 200px;
  opacity: .2;
  background-color: #ddd6ff;
}
.card-style2-buttons-container {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
}
.card-style2-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}
.card-style2-button {
  display: flex;
  padding: 14px 0;
  align-items: center;
  gap: 8px;
  justify-content: center;
  border-radius: 12px;
  background-color: #5d0ec0;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
  width: 100%;
  transition: all .3s ease;
}
.card-style2-button:hover {
  background-color: #4d179a;
  transform: translateY(-2px);
}
.card-style2-button-icon { font-size: 22px; }

.card-style2-marquee-container {
  position: relative;
  z-index: 2;
  display: flex;
  height: 56px;
  width: 100%;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 16px;
}
.card-style2-marquee-content {
  display: flex;
  align-items: center;
  gap: 24px;
  color: #ffffff;
  padding: 0 16px;
  white-space: nowrap;
  font-size: 15px;
}
.card-style2-description { font-weight: 500; }
.card-style2-dot { color: #c4b4ff; opacity: .7; }
.card-style2-gradient-left,
.card-style2-gradient-right {
  pointer-events: none;
  position: absolute;
  top: 0; bottom: 0;
  width: 16.666667%;
  z-index: 3;
}
.card-style2-gradient-left { left: 0; background: linear-gradient(90deg, #7f22fe, transparent); }
.card-style2-gradient-right { right: 0; background: linear-gradient(270deg, #7f22fe, transparent); }

/* ========== MARQUEE ========== */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
.marquee-content {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 16px;
  padding-right: 16px;
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ========== FEATURED / PROMO ========== */
.featured-section { padding: 24px 16px 48px; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.featured-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 24px;
  color: #4d179a;
}
@media (min-width: 768px) { .featured-title { font-size: 30px; } }

.promo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 720px;
  margin: 0 auto;
  background: rgba(142,81,255,0.08);
  border: 1px solid rgba(142,81,255,0.25);
  border-radius: 20px;
  padding: 32px 24px;
}
@media (min-width: 600px) {
  .promo-card {
    flex-direction: row;
    align-items: center;
    padding: 32px 40px;
  }
}
.promo-info {
  flex: 1;
  text-align: center;
}
@media (min-width: 600px) {
  .promo-info { text-align: left; }
}
.promo-text {
  font-size: 16px;
  color: #35495e;
  margin: 0 0 8px;
  line-height: 1.6;
}
.promo-text strong { color: #4d179a; }
.promo-detail {
  font-size: 15px;
  color: #555;
  margin: 0 0 8px;
  line-height: 1.6;
}
.promo-divider {
  width: 60px;
  height: 2px;
  background: #c4b4ff;
  margin: 14px 0;
  border-radius: 2px;
}
@media (min-width: 600px) {
  .promo-divider { margin: 14px 0; }
}
@media (max-width: 599px) {
  .promo-divider { margin: 14px auto; }
}
.promo-ios { margin-top: 6px; }
.invite-code {
  display: inline-block;
  background: #7f22fe;
  color: #fff;
  padding: 2px 14px;
  border-radius: 6px;
  font-size: 1.05em;
  letter-spacing: 2px;
}
.promo-link {
  color: #7f22fe;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.promo-link:hover { color: #5d0ec0; }
.promo-qr {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.promo-qr img {
  width: 160px;
  height: 160px;
  border-radius: 12px;
  border: 2px solid #c4b4ff;
}
.promo-qr-label {
  font-size: 13px;
  color: #7f22fe;
  font-weight: 600;
}

/* ========== FOOTER ========== */
.footer {
  text-align: center;
  padding: 20px 16px;
  background-color: rgba(142,81,255,0.1);
  color: #35495e;
  position: relative;
  z-index: 1;
  font-size: 14px;
}

/* ========== SCROLL-TO-TOP BUTTON ========== */
.scroll-button {
  position: fixed;
  bottom: 32px;
  left: 50%;
  z-index: 50;
  width: 48px;
  height: 48px;
  background-color: #8e51ff;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid #4d179a;
  box-shadow: 0 10px 15px -3px rgba(77,23,154,0.8);
  animation: bounce-mobile 2s infinite;
}
@media (min-width: 768px) {
  .scroll-button {
    left: auto;
    right: 24px;
    bottom: 40px;
    animation: bounce-desktop 2s infinite;
  }
}
.arrow-up { font-size: 22px; line-height: 1; font-weight: 700; }
@keyframes bounce-mobile {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}
@keyframes bounce-desktop {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}
