:root {
  --night: #120d1f;
  --dusk: #3a1c3c;
  --ember: #e8792b;
  --ember-hot: #ffb347;
  --blood: #c4302b;
  --paper: #fdf3e1;
  --ink: #2a1d14;
  --text: #f6ecdc;
  --muted: #cbb9a2;
  --card: rgba(26, 17, 30, 0.82);
  --line: rgba(255, 196, 120, 0.22);
  --error: #ff8a7a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---- Home: night village scene ---- */

.home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: linear-gradient(180deg, #0d0a1c 0%, #2b1534 45%, #6b2a2e 78%, #c4562b 100%);
}

.scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.moon {
  position: absolute;
  top: 9vh;
  right: 12vw;
  width: min(28vw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fff6dc 0%, #ffd98f 55%, #f0a24a 100%);
  box-shadow: 0 0 80px 20px rgba(255, 190, 110, 0.35);
}

.hills {
  position: absolute;
  left: 0;
  width: 100%;
  height: 34vh;
  bottom: 0;
}

.hills.far path { fill: #2a1424; }
.hills.near { height: 22vh; }
.hills.near path { fill: #120a14; }

.pagoda {
  position: absolute;
  bottom: 12vh;
  left: 7vw;
  width: min(14vw, 110px);
  fill: #120a14;
}

.leaf {
  position: absolute;
  top: -5vh;
  width: 14px;
  height: 9px;
  border-radius: 9px 0;
  background: var(--blood);
  opacity: 0.75;
  animation: fall 14s linear infinite;
}

.l1 { left: 12%; animation-delay: 0s; }
.l2 { left: 34%; animation-delay: -4s; animation-duration: 17s; }
.l3 { left: 58%; animation-delay: -9s; }
.l4 { left: 76%; animation-delay: -2s; animation-duration: 19s; background: var(--ember); }
.l5 { left: 90%; animation-delay: -11s; }

@keyframes fall {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-40px, 55vh) rotate(200deg); }
  100% { transform: translate(30px, 110vh) rotate(420deg); }
}

@media (prefers-reduced-motion: reduce) {
  .leaf { animation: none; display: none; }
}

.hero {
  position: relative;
  flex: 1;
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 48px 20px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  align-items: center;
}

.kicker {
  margin: 0 0 6px;
  color: var(--ember-hot);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.logo {
  margin: 0;
  font-size: clamp(54px, 9vw, 104px);
  line-height: 0.92;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.logo span {
  display: block;
  background: linear-gradient(180deg, #fff3cf 0%, #ffb347 55%, #e05a1e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 #3b120c) drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}

.logo span + span { margin-left: 0.6em; }

.lead {
  max-width: 30em;
  margin: 18px 0 22px;
  font-size: 18px;
  color: var(--text);
}

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

.perks li {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 10, 20, 0.45);
  font-size: 14px;
  color: var(--muted);
}

.perks b { color: var(--text); font-weight: 600; }

.card {
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  backdrop-filter: blur(8px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.card h2 { margin: 0 0 6px; font-size: 24px; }
.muted { color: var(--muted); margin: 0 0 18px; }
.small { font-size: 13px; margin: 14px 0 0; }
.who { margin: -12px 0 18px; font-size: 28px; font-weight: 800; color: var(--ember-hot); }
.error { color: var(--error); margin: 14px 0 0; }

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.button:active { transform: translateY(1px); }
.button:focus-visible { outline: 3px solid var(--ember-hot); outline-offset: 3px; }

.button.play {
  background: linear-gradient(180deg, var(--ember-hot) 0%, var(--ember) 55%, #c9531a 100%);
  color: #2b0f05;
  box-shadow: 0 4px 0 #7d2a0d, 0 10px 24px rgba(232, 121, 43, 0.35);
}

.button.google {
  background: #fff;
  color: #1f1f1f;
  box-shadow: 0 4px 0 #b9ad9d, 0 10px 24px rgba(0, 0, 0, 0.3);
}

.button.google svg { width: 22px; height: 22px; }

.link {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

form { display: grid; gap: 10px; }
label { font-size: 14px; color: var(--muted); }

input {
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(10, 6, 12, 0.6);
  color: var(--text);
  font: inherit;
}

input:focus { outline: 2px solid var(--ember); border-color: transparent; }

.spinner {
  width: 34px;
  height: 34px;
  margin: 4px auto 12px;
  border: 3px solid var(--line);
  border-top-color: var(--ember-hot);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

#loading { text-align: center; }

@keyframes spin { to { transform: rotate(360deg); } }

.foot {
  position: relative;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(10, 6, 12, 0.6);
}

.foot a { color: var(--text); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
  .logo span + span { margin-left: 0.35em; }
  .moon { top: 4vh; right: 6vw; }
}
