/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette derived from the Stardoku icon: deep violet base, gold type, magenta grid */
  --bg:        #120a22;   /* deep violet-black page background */
  --bg-2:      #1a1030;   /* panels */
  --bg-3:      #241640;   /* raised surfaces */
  --bg-glass:  rgba(26, 16, 48, 0.72);

  --violet:       #8b5cf6;
  --violet-light: #b79bff;
  --violet-deep:  #5b21b6;
  --magenta:      #d24fcf;

  --gold:        #ffc93c;
  --gold-light:  #ffe08a;
  --gold-deep:   #f59e0b;

  --text:   #ece8f7;
  --muted:  #a99fc4;
  --line:   rgba(183, 155, 255, 0.16);
  --line-strong: rgba(183, 155, 255, 0.28);

  --glow-violet: rgba(139, 92, 246, 0.35);
  --glow-gold:   rgba(255, 201, 60, 0.30);
}

html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: "Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* faint logic-grid texture for a "puzzle / deduction" feel */
  background-image:
    radial-gradient(1100px 620px at 50% -8%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(210, 79, 207, 0.10), transparent 55%),
    linear-gradient(rgba(183, 155, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(183, 155, 255, 0.035) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--violet-light); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: rgba(255, 201, 60, 0.30); color: #fff; }

/* ===== Layout ===== */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ===== Navigation ===== */
.nav {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 0;
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--line);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; }
.nav-logo-img { height: 30px; width: auto; }
.nav-right { display: flex; align-items: center; gap: 22px; }
.nav-links { display: flex; gap: 26px; list-style: none; }
.nav-links a { color: var(--muted); font-size: 1rem; font-weight: 600; letter-spacing: 0.01em; transition: color 0.2s; }
.nav-links a:hover { color: var(--gold); text-decoration: none; }

/* Language switcher */
.lang-switch {
  appearance: none; -webkit-appearance: none;
  background-color: var(--bg-3); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 8px 32px 8px 14px; font-size: 0.92rem; font-weight: 600;
  font-family: inherit; cursor: pointer; line-height: 1.2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b79bff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 12px;
  transition: border-color 0.2s, color 0.2s;
}
.lang-switch:hover { border-color: var(--gold); color: var(--gold); }
.lang-switch:focus-visible { outline: 2px solid var(--violet-light); outline-offset: 2px; }
.lang-switch option { background: var(--bg-2); color: var(--text); font-weight: 500; }

/* ===== Hero ===== */
.hero {
  position: relative;
  text-align: center;
  padding: 84px 20px 96px;
  overflow: hidden;
}
.hero::after {
  /* gold sweep under the logo */
  content: "";
  position: absolute; left: 50%; top: 120px;
  width: 460px; height: 460px; transform: translateX(-50%);
  background: radial-gradient(circle, var(--glow-gold), transparent 62%);
  filter: blur(8px); pointer-events: none; z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.hero-logo {
  width: 200px; max-width: 64%; height: auto; margin: 0 auto 30px;
  filter: drop-shadow(0 14px 40px rgba(139, 92, 246, 0.55));
  animation: float 5.5s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.hero-title {
  font-size: 2.5rem; font-weight: 900; margin-bottom: 18px; line-height: 1.12;
  letter-spacing: -0.02em; color: var(--text);
}
.hero-title .accent {
  background: linear-gradient(120deg, var(--gold) 0%, var(--gold-light) 50%, var(--magenta) 120%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.hero-subtitle { font-size: 1.2rem; color: var(--muted); margin: 0 auto 36px; max-width: 580px; }

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #2a1500;
  padding: 15px 36px; border-radius: 999px;
  font-weight: 800; font-size: 1rem; letter-spacing: 0.01em; text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 10px 30px var(--glow-gold);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 16px 40px var(--glow-gold); text-decoration: none; }

.download-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.btn-store {
  display: inline-flex; align-items: center;
  transition: transform 0.2s, filter 0.2s;
}
.btn-store:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-store img { display: block; width: auto; }
/* Google 官方徽章自带留白，放大约 1.3 倍以与 App Store 徽章视觉对齐 */
.btn-store.store-apple img { height: 44px; }
.btn-store.store-google img { height: 58px; }

/* ===== Games / Portfolio ===== */
.games { padding: 96px 0; }
.section-title { text-align: center; font-size: 2rem; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.01em; color: var(--text); }
.section-subtitle {
  text-align: center; color: var(--gold); margin-bottom: 52px;
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.22em;
}

.game-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 36px;
  background: linear-gradient(160deg, var(--bg-2) 0%, var(--bg-3) 100%);
  border: 1px solid var(--line);
  border-radius: 24px; padding: 36px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.game-card::before {
  /* blurred Stardoku large image as the card backdrop; dark overlay keeps copy legible */
  content: "";
  position: absolute; inset: -24px;
  background:
    linear-gradient(160deg, rgba(26, 16, 48, 0.82) 0%, rgba(36, 22, 64, 0.88) 100%),
    url("../images/stardoku-large.png") center / cover no-repeat;
  filter: blur(20px) saturate(1.05);
  z-index: 0;
  pointer-events: none;
}
.game-card > * { position: relative; z-index: 1; }
.game-shot {
  width: 100%; max-width: 290px; height: auto;
  border: 1px solid var(--line-strong);
  border-radius: 22px; flex-shrink: 0; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 0 6px rgba(183, 155, 255, 0.05);
}
.game-info { text-align: center; }
.game-info h3 {
  font-size: 1.7rem; font-weight: 800; margin-bottom: 14px;
  background: linear-gradient(120deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.game-info p { font-size: 1.08rem; color: var(--muted); line-height: 1.75; margin-bottom: 26px; }
.game-info .download-buttons { justify-content: center; }

/* ===== About ===== */
.about { padding: 96px 0; text-align: center; border-top: 1px solid var(--line); }
.about p { max-width: 680px; margin: 0 auto; font-size: 1.15rem; color: var(--text); line-height: 1.85; }

/* ===== Contact ===== */
.contact { text-align: center; padding: 90px 20px; border-top: 1px solid var(--line); }
.contact-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 12px; color: var(--text); }
.contact-text { font-size: 1.08rem; color: var(--muted); margin-bottom: 26px; }
.contact-email {
  display: inline-block; font-size: 1.18rem; font-weight: 800;
  background: linear-gradient(120deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.contact-email:hover { text-decoration: underline; }

/* ===== Footer ===== */
.footer {
  background: #0d0719; color: var(--muted);
  text-align: center; padding: 40px 20px; font-size: 0.9rem;
  border-top: 1px solid var(--line);
}
.footer-logo { height: 26px; width: auto; margin: 0 auto 18px; opacity: 0.9; }
.footer-links { display: flex; gap: 24px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text); font-weight: 600; }
.footer-links a:hover { color: var(--gold); text-decoration: none; }

/* ===== Document Pages (privacy / terms) ===== */
.doc-page { padding: 64px 0; }
.doc-page .back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); margin-bottom: 32px; font-size: 0.95rem; font-weight: 600; }
.doc-page h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.doc-page .last-updated { color: var(--muted); font-size: 0.9rem; margin-bottom: 40px; }
.doc-page h2 { font-size: 1.2rem; font-weight: 700; margin: 32px 0 12px; color: var(--violet-light); }
.doc-page p, .doc-page ul, .doc-page ol { font-size: 1.02rem; color: var(--muted); line-height: 1.85; margin-bottom: 16px; }
.doc-page ul, .doc-page ol { padding-left: 24px; }
.doc-page li { margin-bottom: 8px; }
.doc-page a { color: var(--gold); }

/* ===== Responsive ===== */
@media (max-width: 560px) {
  .nav-right { gap: 12px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 0.85rem; }
  .lang-switch { padding: 7px 28px 7px 11px; font-size: 0.82rem; }
}
@media (max-width: 400px) {
  .nav-links { display: none; }
}
@media (min-width: 768px) {
  .hero-title { font-size: 3.6rem; }
  .hero-logo { width: 240px; }
  .game-card { flex-direction: row; text-align: left; padding: 52px; gap: 52px; }
  .game-info { text-align: left; }
  .game-info .download-buttons { justify-content: flex-start; }
}
@media (min-width: 1024px) {
  .hero { padding: 120px 20px 130px; }
  .game-shot { max-width: 320px; }
}

/* 「浏览器直接玩」入口：放在商店徽章之上，是转化路径里最短的一步 */
.btn-play-web {
  display: inline-block;
  margin: 4px 0 18px;
}
