:root {
  --yellow: #ffed2a;
  --yellow-deep: #ffd200;
  --yellow-soft: #fff5de;
  --ink: #111;
  --muted: #333;
  --line: #fef3b3;
  --white: #fff;
  --header-h: 108px;
  --footer-h: 132px;
  --max: 1200px;
  --font-ui: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  --font-noto: "Noto Sans", "NotoSans-Regular", var(--font-ui);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: #fff;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.page {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: url("./assets/bg.png") center / cover no-repeat;
  overflow: hidden;
}

.bubbles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.header,
.main,
.footer,
.pager {
  position: relative;
}

.header {
  flex: 0 0 var(--header-h);
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 0 30px;
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 1000;
  overflow: visible;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
}
.brand-wordmark {
  height: 30px;
  width: auto;
  display: block;
  object-fit: contain;
}
.brand-text {
  font-family: var(--font-noto);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #111;
}

.nav {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 70px;
}
.nav-link {
  font-family: var(--font-ui);
  font-size: 18px;
  color: var(--muted);
  height: 30px;
  border-bottom: 4px solid transparent;
}
.nav-link.is-active,
.nav-link:hover {
  border-bottom-color: #666;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 0 0 auto;
}

.recharge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 44px;
  padding: 0 22px 0 28px;
  border-radius: 22px;
  background: linear-gradient(90deg, #ffda73, #ffee27 97%);
  font-family: var(--font-ui);
  font-size: 18px;
  color: #000;
  font-weight: 600;
}
.recharge.is-hidden {
  display: none;
}
.recharge-glow {
  position: absolute;
  left: -8px;
  top: -10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffe566 45%, transparent 70%);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.75; }
  50% { transform: scale(1.05); opacity: 1; }
}

.lang {
  position: relative;
  flex: 0 0 auto;
  z-index: 1001;
}
/* Original LangSelector: plain text + ios-arrow-down, no yellow chip */
.lang-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  height: 30px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  background-image: none;
  font-family: "Noto Sans", "NotoSans-Regular", var(--font);
  font-size: 18px;
  font-weight: 400;
  color: #333;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  box-shadow: none;
}
.lang-btn:hover,
.lang-btn:focus,
.lang-btn:focus-visible {
  color: #333;
  outline: none;
  background: transparent;
}
.lang-text {
  color: inherit;
  font-size: 18px;
  font-weight: 400;
  line-height: 30px;
  white-space: nowrap;
}
.lang-caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  flex: 0 0 auto;
  border-style: solid;
  border-width: 5px 4px 0;
  border-color: #333 transparent transparent;
  background: none;
  transition: transform 0.2s ease;
  transform-origin: 50% 40%;
  vertical-align: middle;
}
.lang.is-open .lang-caret {
  transform: rotate(180deg);
}
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  width: max-content;
  margin: 0;
  padding: 5px 0;
  list-style: none;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
  z-index: 1002;
  box-sizing: border-box;
  overflow: visible;
}
.lang.is-open .lang-menu {
  display: block;
}
.lang-option {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 7px 16px;
  font-family: "Noto Sans", "NotoSans-Regular", var(--font);
  font-size: 14px;
  line-height: normal;
  color: #515a6e;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
  box-sizing: border-box;
}
.lang-option:hover {
  background: #f3f3f3;
}
.lang-option.is-active,
.lang-option.is-active:hover {
  background: #f0faff;
  color: #2d8cf0;
}
html[dir="rtl"] .lang-btn {
  padding: 0 4px;
}
html[dir="rtl"] .lang-caret {
  margin-left: 0;
  margin-right: 6px;
}
html[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
}
html[dir="rtl"] .lang-option {
  text-align: right;
}
html[dir="rtl"] .nav-link,
html[dir="rtl"] .feature-copy,
html[dir="rtl"] .about,
html[dir="rtl"] .contact-card,
html[dir="rtl"] .footer-inner {
  direction: rtl;
}

.main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  z-index: 1;
}

.slide {
  min-height: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 30px 24px;
  box-sizing: border-box;
}

.slide-home {
  overflow: hidden;
}

.hero {
  width: min(920px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: rise 0.8s ease both;
}

/* Match original: logo ~80px tall, slogan under it, video 800x440, download row 920 */
.hero-logo {
  height: 80px;
  width: auto;
  max-width: 280px;
  margin-top: 10px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}
.hero-slogan-img {
  margin-top: 10px;
  height: 36px;
  width: auto;
  max-width: 450px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}
.hero-video-wrap {
  margin-top: 30px;
  /* Original PC size 800x440; shrink on short screens so APK stays on first screen */
  width: min(800px, 100%, calc((100vh - var(--header-h) - var(--footer-h) - 270px) * 800 / 440));
  height: min(440px, calc(100vh - var(--header-h) - var(--footer-h) - 270px));
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  flex: 0 0 auto;
  position: relative;
}
.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-video-endcard {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.hero-video-endcard-dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}
.hero-video-endcard-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
}
.hero-video-endcard-logo {
  height: clamp(28px, 8%, 44px);
  width: auto;
  max-width: 21%;
  object-fit: contain;
  display: block;
}
.hero-video-endcard-slogan {
  height: clamp(22px, 6%, 36px);
  width: auto;
  max-width: 70%;
  object-fit: contain;
  display: block;
}

.download-row {
  margin-top: 30px;
  width: min(920px, 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.download-row.compact {
  justify-content: flex-start;
  margin-top: 24px;
  width: auto;
}
.badge {
  display: block;
  width: 210px;
  height: 69px;
  transition: transform 0.2s ease;
}
.badge-apk {
  width: 210px;
  height: 69px;
}
.badge:hover { transform: translateY(-2px); }
.badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.feature {
  width: min(var(--max), 100%);
  display: flex;
  align-items: center;
  gap: 50px;
  animation: rise 0.7s ease both;
}
.feature-art {
  width: min(560px, 48%);
  max-height: 700px;
  height: auto;
  aspect-ratio: 560 / 700;
  object-fit: contain;
  flex: 0 0 auto;
}
#moments .feature-art,
#party .feature-art,
#live .feature-art {
  width: auto;
  height: 560px;
  max-height: 560px;
  max-width: min(560px, 48%);
  aspect-ratio: auto;
  object-fit: contain;
}
.feature-copy {
  max-width: 500px;
}
.feature-copy h2 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.2;
}
.feature-copy p {
  margin: 10px 0 0;
  font-family: var(--font-ui);
  font-size: 18px;
  line-height: 1.6;
  color: #000;
}

.about, .contact-card {
  width: min(720px, 100%);
  text-align: center;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(8px);
  border: 4px solid var(--line);
  border-radius: 20px;
  padding: 48px 40px;
  animation: rise 0.7s ease both;
}
.about h2, .contact-card h2 {
  margin: 0 0 18px;
  font-size: 40px;
}
.about p, .contact-card p {
  margin: 0;
  font-size: 18px;
  line-height: 1.7;
}
.about-brand {
  margin-top: 24px !important;
  font-weight: 700;
  color: #444;
}

.contact-form {
  margin-top: 28px;
  display: grid;
  gap: 14px;
  text-align: left;
}
.contact-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}
.contact-form input {
  height: 44px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 16px;
}
.contact-form button {
  margin-top: 8px;
  height: 64px;
  border: 0;
  border-radius: 32px;
  background: linear-gradient(90deg, #ffe566 1%, #ffd200);
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
}

.pager {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 5;
}
.pager button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  background: #8f8f87;
  cursor: pointer;
  padding: 0;
}
.pager button.is-active {
  background: var(--yellow-deep);
  transform: scale(1.2);
}

.footer {
  flex: 0 0 var(--footer-h);
  background: #fff;
  color: #000;
  z-index: 3;
}
.footer-inner {
  width: min(var(--max), 100%);
  height: 100%;
  margin: 0 auto;
  padding: 16px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}
.footer-name {
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #000;
  line-height: 1;
}
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
}
.footer-links a {
  color: #2f6fdb;
}
.footer-links a:hover {
  text-decoration: underline;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  :root {
    --header-h: 72px;
    --footer-h: auto;
  }
  body { overflow: auto; }
  .page { height: auto; min-height: 100vh; }
  .header {
    height: var(--header-h);
    padding: 0 16px;
    gap: 12px;
  }
  .nav { display: none; }
  .brand-logo { width: 42px; height: 42px; }
  .brand-wordmark { height: 24px; }
  .brand-text { font-size: 22px; }
  .hero-logo { height: 64px; width: auto; }
  .hero-slogan-img { height: 28px; }
  .recharge { min-width: 96px; height: 38px; font-size: 15px; }
  .main {
    overflow: visible;
    scroll-snap-type: none;
    min-height: 0;
  }
  .slide {
    height: auto;
    min-height: auto;
    padding: 28px 16px;
    overflow: visible;
  }
  .slide-home { overflow: visible; }
  .hero {
    max-height: none;
  }
  .hero-logo {
    height: 64px;
    width: auto;
    max-width: 220px;
  }
  .hero-slogan-img { height: 28px; }
  .hero-video-wrap {
    margin-top: 20px;
    width: min(800px, 100%);
    height: auto;
    aspect-ratio: 800 / 440;
  }
  .download-row { justify-content: center; }
  .download-row.compact { justify-content: center; }
  .badge,
  .badge-apk { width: 180px; height: 58px; }
  .feature {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  .feature-art { width: min(420px, 100%); max-height: 525px; }
  #moments .feature-art,
  #party .feature-art,
  #live .feature-art { width: auto; height: auto; max-height: 420px; max-width: min(420px, 100%); }
  .feature-copy { max-width: none; }
  .download-row.compact { justify-content: center; }
  .pager { display: none; }
  .footer {
    padding-bottom: 12px;
    height: auto;
  }
  .footer-inner {
    padding: 16px;
    gap: 10px;
  }
  .footer-name { font-size: 22px; }
}
