@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
  --bg-deep: #07080d;
  --bg-card: rgba(18, 20, 28, 0.72);
  --bg-card-hover: rgba(24, 27, 38, 0.88);
  --border: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(212, 175, 95, 0.35);
  --text: #f2f3f7;
  --text-muted: #9aa3b5;
  --gold: #d4af5f;
  --gold-light: #f0dfa0;
  --accent: #6b8cff;
  --accent-glow: rgba(107, 140, 255, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  --font: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(107, 140, 255, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(212, 175, 95, 0.08), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(120, 80, 200, 0.1), transparent),
    var(--bg-deep);
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: drift 18s ease-in-out infinite alternate;
}

.ambient::before {
  width: 420px;
  height: 420px;
  background: rgba(107, 140, 255, 0.15);
  top: 10%;
  right: -8%;
}

.ambient::after {
  width: 360px;
  height: 360px;
  background: rgba(212, 175, 95, 0.12);
  bottom: 5%;
  left: -5%;
  animation-delay: -6s;
}

@keyframes drift {
  to { transform: translate(-30px, 20px) scale(1.05); }
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 8, 13, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  white-space: nowrap;
}

.nav-promo {
  flex: 1;
  min-width: 180px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-nav {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.btn-nav:hover {
  border-color: var(--border-gold);
  background: rgba(212, 175, 95, 0.08);
}

.btn-nav-accent {
  border-color: var(--border-gold);
  background: linear-gradient(135deg, rgba(212, 175, 95, 0.22), rgba(212, 175, 95, 0.08));
  color: var(--gold-light);
}

.btn-nav-accent:hover {
  box-shadow: 0 0 24px rgba(212, 175, 95, 0.2);
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.nav-user img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
}

main {
  position: relative;
  z-index: 1;
  padding: 32px 16px 56px;
}

.hero {
  max-width: 1120px;
  margin: 0 auto 40px;
  text-align: center;
  padding: 24px 16px 8px;
}

.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--border-gold);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
  background: rgba(212, 175, 95, 0.06);
}

.hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #fff 0%, #c8cdd8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 24px;
}

.header-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.my-cdks-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.my-cdks-link:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.container { max-width: 1120px; margin: 0 auto; }

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.cs-block { margin-bottom: 36px; }

.cs-card {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
  padding: 2px;
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(
    135deg,
    rgba(212, 175, 95, 0.45) 0%,
    rgba(107, 140, 255, 0.2) 50%,
    rgba(212, 175, 95, 0.15) 100%
  );
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.45);
}

.cs-card-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 60% 80% at 20% 50%, rgba(107, 140, 255, 0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.cs-card > *:not(.cs-card-glow) {
  position: relative;
  z-index: 1;
}

.cs-card {
  background-clip: padding-box;
}

.cs-card::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(16, 18, 26, 0.98) 0%, rgba(10, 11, 16, 0.99) 100%);
  z-index: 0;
}

.cs-text,
.cs-divider,
.cs-qr-row {
  position: relative;
  z-index: 1;
}

.cs-text {
  flex: 1;
  min-width: 240px;
  padding: 36px 32px 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cs-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.cs-eyebrow-line {
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.cs-text h3 {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.cs-text p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 380px;
  margin-bottom: 20px;
}

.cs-perks {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.cs-perks li {
  font-size: 12px;
  font-weight: 500;
  color: var(--gold-light);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  background: rgba(212, 175, 95, 0.06);
}

.cs-divider {
  width: 1px;
  align-self: stretch;
  margin: 28px 0;
  background: linear-gradient(to bottom, transparent, var(--border-gold), transparent);
  opacity: 0.6;
}

.cs-qr-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 28px 36px 28px 24px;
}

.cs-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: 196px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s, box-shadow 0.35s;
}

.cs-qr-wrap:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 175, 95, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.cs-qr-qq:hover { box-shadow: 0 16px 40px rgba(18, 183, 245, 0.12); }
.cs-qr-wechat:hover { box-shadow: 0 16px 40px rgba(7, 193, 96, 0.12); }

.cs-qr-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cs-qr-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  background-size: 55%;
  background-repeat: no-repeat;
  background-position: center;
}

.cs-qr-icon-qq {
  background-color: rgba(18, 183, 245, 0.15);
  border: 1px solid rgba(18, 183, 245, 0.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2312b7f5'%3E%3Cpath d='M12 2C6.48 2 2 6.03 2 11c0 2.91 1.52 5.5 3.89 7.15-.17.62-.62 2.23-.71 2.58-.11.42.16.41.34.3.14-.09 2.23-1.52 3.14-2.14.75.11 1.52.17 2.34.17 5.52 0 10-4.03 10-9S17.52 2 12 2z'/%3E%3C/svg%3E");
}

.cs-qr-icon-wx {
  background-color: rgba(7, 193, 96, 0.12);
  border: 1px solid rgba(7, 193, 96, 0.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2307c160'%3E%3Cpath d='M8.5 4C4.91 4 2 6.46 2 9.5c0 1.68.88 3.19 2.27 4.23L3.5 16l2.72-1.36c.73.2 1.5.31 2.28.31 3.59 0 6.5-2.46 6.5-5.5S12.09 4 8.5 4zm11 3c-3.04 0-5.5 2.01-5.5 4.5s2.46 4.5 5.5 4.5c.65 0 1.27-.09 1.85-.25l2.15 1.08-.65-1.95C21.38 13.42 22 12.01 22 10.5 22 8.01 19.54 7 19.5 7z'/%3E%3C/svg%3E");
}

.cs-qr-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.cs-qr-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 400;
}

.cs-qr-frame {
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.2);
}

.cs-qr {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

.cs-qr-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.04em;
}

@media (max-width: 900px) {
  .cs-divider { display: none; }
  .cs-card { flex-direction: column; }
  .cs-text {
    padding: 28px 24px 8px;
    text-align: center;
    align-items: center;
  }
  .cs-eyebrow { justify-content: center; }
  .cs-perks { justify-content: center; }
  .cs-qr-row { padding: 16px 20px 28px; }
}

@media (max-width: 640px) {
  .cs-qr-row { flex-direction: column; width: 100%; }
  .cs-qr-wrap { width: 100%; max-width: 220px; }
}

.upcoming-events {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.upcoming-events h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.event-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.event-item:last-child { margin-bottom: 0; }

.event-title { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.event-time { color: var(--text-muted); font-size: 13px; }

.event-countdown {
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, rgba(212, 175, 95, 0.25), rgba(212, 175, 95, 0.1));
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  min-width: 88px;
  text-align: center;
  flex-shrink: 0;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 440px;
  backdrop-filter: blur(12px);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s, box-shadow 0.35s;
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(212, 175, 95, 0.25);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(212, 175, 95, 0.08);
}

.game-cover-wrap {
  position: relative;
  height: 188px;
  overflow: hidden;
  background: #12141a;
}

.game-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.game-card:hover .game-cover { transform: scale(1.04); }

.game-cover-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 8, 13, 0.85) 0%, transparent 50%);
  pointer-events: none;
}

.game-cover-fallback {
  height: 188px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: linear-gradient(145deg, #1a1d28, #0f1118);
}

.game-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.game-content { flex: 1; display: flex; flex-direction: column; }

.game-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.game-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-actions { margin-top: 16px; }

.action-row {
  display: flex;
  gap: 8px;
}

.action-row + .action-row { margin-top: 8px; }

.btn-claim,
.btn-video,
.btn-guide,
.btn-download,
.btn-wechat {
  flex: 1;
  font-family: inherit;
  padding: 11px 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.btn-claim {
  background: linear-gradient(135deg, #c9a24d 0%, #8b6914 100%);
  color: #0a0a0c;
  box-shadow: 0 4px 16px rgba(201, 162, 77, 0.25);
}

.btn-claim:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201, 162, 77, 0.35); }

.btn-video {
  background: rgba(107, 140, 255, 0.15);
  color: #a8bcff;
  border: 1px solid rgba(107, 140, 255, 0.35);
}

.btn-guide {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 500;
}

.btn-download {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 500;
}

.btn-wechat {
  width: 100%;
  background: linear-gradient(135deg, rgba(82, 196, 26, 0.25), rgba(56, 158, 13, 0.15));
  color: #9ae67d;
  border: 1px solid rgba(82, 196, 26, 0.35);
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.lottery-cta {
  text-align: center;
  margin-top: 48px;
}

.btn-lottery {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 36px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gold-light);
  background: transparent;
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s, box-shadow 0.25s;
}

.btn-lottery:hover {
  background: rgba(212, 175, 95, 0.1);
  box-shadow: 0 0 32px rgba(212, 175, 95, 0.15);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal {
  background: #12141c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  position: relative;
  text-align: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { color: var(--text); border-color: var(--border-gold); }

.modal-body { padding: 24px; }

.modal-rule {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  line-height: 1.7;
  color: var(--text-muted);
  font-size: 14px;
}

.modal-rule h4 { color: var(--text); margin-bottom: 8px; }

.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.btn-primary {
  font-family: inherit;
  background: linear-gradient(135deg, #c9a24d, #8b6914);
  color: #0a0a0c;
  border: none;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.btn-gray {
  font-family: inherit;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.claim-success-content { text-align: center; padding: 8px 0; }

.claim-success-content h3 {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 12px;
}

.claim-success-content p { color: var(--text-muted); font-size: 13px; margin-bottom: 15px; }

.cdk-display {
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin: 15px 0;
  font-family: "DM Sans", ui-monospace, monospace;
  font-size: 17px;
  font-weight: 600;
  color: var(--gold-light);
  word-break: break-all;
  letter-spacing: 0.04em;
}

.btn-copy {
  font-family: inherit;
  background: rgba(107, 140, 255, 0.2);
  color: #a8bcff;
  border: 1px solid rgba(107, 140, 255, 0.4);
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.toast-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #12141c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  z-index: 3000;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.toast-modal .toast-msg { margin-bottom: 20px; color: var(--text); font-size: 15px; }

.toast-modal button {
  font-family: inherit;
  background: linear-gradient(135deg, #c9a24d, #8b6914);
  color: #0a0a0c;
  border: 0;
  padding: 10px 24px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 640px) {
  .nav-promo { order: 3; width: 100%; text-align: left; font-size: 12px; }
  .games-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 8px; }
}
