:root {
  --bg: #0b1026;
  --bg-2: #141a3d;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef1ff;
  --muted: #a9b0d6;
  --gold: #ffd166;
  --gold-dark: #c99a2e;
  --ice: #8be9fd;
  --radius: 4px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-pixel: "Pixelify Sans", "Inter", monospace;
  --max: 1100px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% -10%, #2a2f6b 0%, var(--bg-2) 35%, var(--bg) 75%) fixed;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body[data-lang="ja"] { --font-body: "Noto Sans JP", "Inter", system-ui, sans-serif; }
body[data-lang="ja"] p { line-height: 1.9; }

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

a { color: var(--ice); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; }
h2 { font-family: var(--font-pixel); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; }
body[data-lang="ja"] h2 { font-family: var(--font-body); }
h3 { font-size: 1.15rem; }

/* SGA joke mode */
.sga-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: #6b3fd4;
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
}
.sga-banner button {
  font: inherit;
  font-weight: 600;
  color: #6b3fd4;
  background: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 4px 12px;
  cursor: pointer;
}
body[data-lang="sga"] [data-i18n] { cursor: help; }
body[data-lang="sga"] .hero__tagline,
body[data-lang="sga"] h2 { letter-spacing: 0.05em; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background 0.2s, border-color 0.2s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(11, 16, 38, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: var(--border);
}
.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 1.4rem;
  font-weight: 700;
}
.logo img { image-rendering: pixelated; }
.nav__links { display: flex; gap: 22px; margin-left: auto; }
.nav__links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav__links a:hover { color: var(--text); }

.lang {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}
.lang button {
  font: 600 0.8rem var(--font-body);
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 7px 10px;
  cursor: pointer;
  min-width: 40px;
}
.lang button + button { border-left: 1px solid var(--border); }
.lang button:hover { color: var(--text); background: var(--surface-hover); }
.lang button[aria-pressed="true"] { background: var(--gold); color: #1a1430; }
.lang button:focus-visible { outline: 2px solid var(--ice); outline-offset: -2px; }

/* Hero */
.hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 72px 16px 96px;
  text-align: center;
}
.eyebrow {
  display: inline-block;
  margin: 0 0 20px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ice);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.hero__title {
  font-family: var(--font-pixel);
  font-size: clamp(3.5rem, 13vw, 7.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  color: var(--gold);
  perspective: 900px;
}
/* --rx/--ry (tilt), --sx/--sy (extrusion offset), --lx/--ly/--shine (reflection) are set from main.js. */
.hero__title-text {
  position: relative;
  display: inline-block;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  text-shadow: var(--sx, 0px) var(--sy, 6px) 0 var(--gold-dark), 0 0 60px rgba(255, 209, 102, 0.35);
  will-change: transform;
}
/* Reflection that slides across the letters as the logo turns. */
.hero__title-text::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  text-shadow: none;
  background: radial-gradient(ellipse 30% 90% at var(--lx, 50%) var(--ly, 50%), rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  opacity: var(--shine, 0);
  pointer-events: none;
}
/* A glint of light that sweeps across the letters every few seconds. */
.hero__title-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  text-shadow: none;
  background: linear-gradient(110deg, transparent 42%, rgba(255, 255, 255, 0.95) 50%, transparent 58%);
  background-size: 250% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  pointer-events: none;
  animation: glint 7s ease-in-out 1.5s infinite;
}
@keyframes glint {
  0%, 60% { background-position: 100% 0; }
  85%, 100% { background-position: 0% 0; }
}
.sparkle {
  position: absolute;
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath fill='%23fff1c4' d='M3 0h1v7H3zM0 3h7v1H0z'/%3E%3Cpath fill='%23fff' d='M2 2h3v3H2z'/%3E%3C/svg%3E") center / contain no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 6px rgba(255, 236, 180, 0.9));
  pointer-events: none;
  animation: twinkle var(--duration) ease-in-out forwards;
}
@keyframes twinkle {
  0% { transform: scale(0); opacity: 0; }
  45% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}

.hero__tagline {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 600;
  margin: 0 0 12px;
}
.hero__sub {
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 40px;
  font-size: 1.05rem;
}

.countdown { margin: 0 auto 36px; }
.countdown__label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
body[data-lang="ja"] .countdown__label { text-transform: none; letter-spacing: 0.05em; }
.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 96px));
  gap: 12px;
  justify-content: center;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25);
}
.tile__num {
  font-family: var(--font-pixel);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tile__unit { color: var(--muted); font-size: 0.78rem; margin-top: 6px; }
.countdown__note { margin: 12px 0 0; color: var(--muted); font-size: 0.85rem; }
.countdown__live {
  font-family: var(--font-pixel);
  font-size: 2rem;
  color: var(--gold);
  margin: 0;
}

.hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s, background 0.2s;
}
.btn--primary {
  background: var(--gold);
  color: #1a1430;
  box-shadow: 0 4px 0 var(--gold-dark);
}
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--gold-dark); }
.btn--primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-dark); }
.btn--ghost { color: var(--text); border: 1px solid var(--border); background: var(--surface); }
.btn--ghost:hover { background: var(--surface-hover); }

.ip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.ip__label { color: var(--muted); }
.ip__value { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--ice); }
.ip__copy {
  font: 600 0.8rem var(--font-body);
  color: var(--text);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
  cursor: pointer;
}

/* Sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px 16px;
}
.section__sub { color: var(--muted); max-width: 620px; margin: -4px 0 36px; font-size: 1.05rem; }

.about {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
}
.about p { color: var(--muted); font-size: 1.05rem; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.stats li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
}
.stats strong {
  font-family: var(--font-pixel);
  font-size: 2rem;
  color: var(--gold);
  min-width: 90px;
}
.stats span { color: var(--muted); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-3px); background: var(--surface-hover); border-color: rgba(255, 209, 102, 0.4); }
.card__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  font-size: 1.3rem;
  background: rgba(139, 233, 253, 0.1);
  border: 1px solid rgba(139, 233, 253, 0.3);
  border-radius: var(--radius);
}
.card p { color: var(--muted); margin: 0; }

.timeline {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ice), var(--gold), rgba(255, 255, 255, 0.15));
}
.timeline li { position: relative; padding-top: 32px; }
.timeline li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  background: var(--bg);
  border: 2px solid var(--muted);
}
.timeline li.is-done::before { background: var(--ice); border-color: var(--ice); }
.timeline li.is-highlight::before {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 16px var(--gold);
}
.timeline__when { color: var(--ice); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.timeline li.is-highlight .timeline__when { color: var(--gold); }
.timeline h3 { margin: 6px 0 6px; }
.timeline p { color: var(--muted); margin: 0; font-size: 0.95rem; }

.faq { display: grid; gap: 10px; max-width: 800px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.faq summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-pixel); color: var(--gold); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 20px 18px; color: var(--muted); }

.join {
  text-align: center;
  max-width: 760px;
  margin: 40px auto 0;
  padding: 64px 32px;
  background: linear-gradient(160deg, rgba(255, 209, 102, 0.12), rgba(139, 233, 253, 0.08));
  border: 1px solid rgba(255, 209, 102, 0.3);
  border-radius: var(--radius);
}
.join p { color: var(--muted); font-size: 1.05rem; margin: 0 auto 28px; max-width: 520px; }

.footer {
  max-width: var(--max);
  margin: 0 auto;
  /* Bottom padding leaves room for the snow pile (PILE_MAX in main.js) below the text. */
  padding: 64px 16px 170px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer p { margin: 0 0 6px; }
.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-bottom: 20px;
}
.footer__links a { color: var(--text); text-decoration: none; font-weight: 500; }
.footer__links a:hover { color: var(--gold); }
.footer__legal { font-size: 0.78rem; opacity: 0.75; }

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; gap: 24px; }
  .timeline { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .timeline::before { display: none; }
}

@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav__inner { justify-content: space-between; gap: 12px; }
  .lang button { padding: 7px 8px; min-width: 0; }
  .hero { padding-top: 48px; }
  .countdown__grid { gap: 8px; }
  .section { padding: 56px 16px; }
  .join { margin: 24px 16px 0; padding: 48px 20px; }
}

@media (max-width: 480px) {
  .timeline { grid-template-columns: 1fr; }
  .logo span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn { transition: none; }
  .hero__title-text::after { animation: none; }
}
