/* ============================================================
   Meteor Tower — shared styles
   Palette: the game's night sky, molten meteor orange, high-score yellow
   Type:    Pixelify Sans (display) / Hanken Grotesk (body)
            / Silkscreen (labels + buttons)
   Look:    square corners and hard offset shadows, like the in-game menu
   ============================================================ */

:root {
  --sky:        #05080f;   /* scene::SKY_COLOR */
  --sky-2:      #0b1230;
  --dusk:       #2a1c5c;
  --card:       #0f1736;
  --card-2:     #152049;
  --ink:        #eef1ff;
  --ink-soft:   #aab3d6;
  --ink-faint:  #6f79a3;
  --line:       #26326a;
  --ember:      #ff7a1a;
  --ember-deep: #e2470f;
  --ember-glow: #ffb547;
  --gold:       #fff24d;   /* high_scores::HEADER_COLOR */
  --danger:     #ff6b5a;
  --ok:         #5fdc7a;

  --px: 4px;               /* one chunky pixel */
  --shadow-hard: var(--px) var(--px) 0 #000;
  --shadow-ember: 0 0 0 2px #000, 0 0 28px rgba(255,122,26,.35);

  --maxw: 1100px;

  --font-display: 'Pixelify Sans', ui-monospace, monospace;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-label: 'Silkscreen', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--sky);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* night sky: navy to purple dusk, like the icon */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(90% 60% at 50% 115%, var(--dusk) 0%, transparent 70%),
    linear-gradient(180deg, var(--sky) 0%, var(--sky-2) 55%, #1a1747 100%);
  z-index: -2;
  pointer-events: none;
}

/* square pixel stars */
body::after {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(#8fa0ff, #8fa0ff), linear-gradient(#8fa0ff, #8fa0ff),
    linear-gradient(#6c7ce0, #6c7ce0), linear-gradient(#b8c3ff, #b8c3ff),
    linear-gradient(#6c7ce0, #6c7ce0), linear-gradient(#8fa0ff, #8fa0ff),
    linear-gradient(#b8c3ff, #b8c3ff), linear-gradient(#6c7ce0, #6c7ce0),
    linear-gradient(#8fa0ff, #8fa0ff), linear-gradient(#6c7ce0, #6c7ce0);
  background-size: 4px 4px;
  background-repeat: no-repeat;
  background-position:
    8% 12%, 22% 38%, 37% 8%, 52% 26%, 64% 6%,
    78% 34%, 91% 14%, 15% 72%, 84% 64%, 46% 58%;
  opacity: .7;
  z-index: -1;
  pointer-events: none;
}

a { color: var(--ember-glow); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

img { image-rendering: auto; }
.pixelated { image-rendering: pixelated; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--sky) 72%, transparent);
  border-bottom: 2px solid var(--line);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand img { width: 34px; height: 34px; border: 2px solid #000; box-shadow: 2px 2px 0 #000; }
.brand:hover { color: var(--gold); }

nav.main { display: flex; gap: 4px; align-items: center; }
nav.main a {
  font-family: var(--font-label);
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 7px 12px;
  border: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
nav.main a:hover { color: var(--ink); border-color: var(--line); }
nav.main a[aria-current="page"] { color: var(--gold); border-color: var(--gold); }

/* ---------- buttons (the in-game menu: dark glass, white border) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-label); font-size: 14px;
  padding: 12px 20px;
  color: #fff;
  background: rgba(0,0,0,.5);
  border: 3px solid #fff;
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  text-decoration: none;
  transition: transform .06s ease, background .15s ease;
}
.btn:hover { background: rgba(51,51,77,.7); color: #fff; }
.btn:active { transform: translate(var(--px), var(--px)); box-shadow: none; }
.btn-primary { background: var(--ember); border-color: #000; color: #1a0800; }
.btn-primary:hover { background: var(--ember-glow); color: #1a0800; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* store buttons; .soon until the listing exists */
.store { flex-direction: column; align-items: flex-start; gap: 0; padding: 9px 18px; min-width: 190px; }
.store small { font-family: var(--font-body); font-size: 11px; opacity: .8; letter-spacing: .02em; }
.store span { font-size: 16px; line-height: 1.2; }
.store.soon { opacity: .75; }
.store.soon small::after { content: " · coming soon"; }

/* ---------- generic type ---------- */
.eyebrow {
  font-family: var(--font-label);
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ember-glow);
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; color: var(--ink); }
h1 { font-size: clamp(2.6rem, 6.5vw, 4.4rem); font-weight: 700; margin: .15em 0 .3em; text-shadow: var(--px) var(--px) 0 #000; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 600; margin: .2em 0 .4em; text-shadow: 3px 3px 0 #000; }
h3 { font-size: 1.3rem; font-weight: 600; }
.lede { font-size: clamp(1.05rem, 2vw, 1.22rem); color: var(--ink-soft); max-width: 44ch; }
.hot { color: var(--ember); }

/* ---------- falling meteors (decorative) ---------- */
.meteors { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.meteor {
  position: absolute; top: -120px;
  width: 14px; height: 14px;
  background: var(--ember-glow);
  box-shadow: 0 0 0 4px var(--ember), 0 0 0 8px var(--ember-deep), 0 0 24px 10px rgba(255,122,26,.45);
  animation: fall linear infinite;
}
.meteor::after {
  /* the tail, trailing up and to the left */
  content: ""; position: absolute; right: 50%; bottom: 50%;
  width: 6px; height: 140px;
  transform-origin: bottom center; transform: rotate(-16deg);
  background: linear-gradient(to top, var(--ember), transparent);
}
.meteor:nth-child(1) { left: 12%; animation-duration: 7s;  animation-delay: -1s; }
.meteor:nth-child(2) { left: 48%; animation-duration: 9s;  animation-delay: -5s; transform: scale(.6); }
.meteor:nth-child(3) { left: 76%; animation-duration: 6s;  animation-delay: -3s; }
.meteor:nth-child(4) { left: 90%; animation-duration: 11s; animation-delay: -8s; transform: scale(.5); }
@keyframes fall {
  from { translate: 0 0; }
  to   { translate: 260px 900px; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(40px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); }
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero-icon {
  width: 96px; height: 96px; display: block; margin-bottom: 18px;
  border: 3px solid #000; box-shadow: var(--shadow-ember);
}
.hero .actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero .fineprint { margin-top: 18px; font-size: 12px; color: var(--ink-faint); font-family: var(--font-label); }

/* ---------- picture slots ----------
   Each .slot shows its label until the image file exists; the <img>
   inside removes itself if the file is missing (see onerror in the HTML). */
.slot {
  position: relative; margin: 0;
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(255,255,255,.03) 12px 24px),
    var(--card);
  border: 3px dashed var(--line);
  color: var(--ink-faint);
  font-family: var(--font-label); font-size: 12px; text-align: center;
  overflow: hidden;
}
.slot > span { padding: 12px; line-height: 1.5; }
.slot > span code { display: block; font-family: var(--font-body); font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.slot > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot:has(> img) { border-style: solid; border-color: #000; }

/* phone frame around a portrait screenshot */
.phone {
  aspect-ratio: 9 / 19.5;
  border: 10px solid #000;
  outline: 3px solid #2d3870;
  box-shadow: 8px 8px 0 #000, 0 0 60px rgba(255,122,26,.18);
}
.hero .phone { width: min(300px, 70vw); margin: 0 auto; }

/* ---------- sections ---------- */
section.block { padding: clamp(48px, 8vw, 96px) 0; position: relative; }
.section-head { max-width: 56ch; margin-bottom: 40px; }
.section-head .eyebrow { display: block; margin-bottom: 6px; }
.section-head p { color: var(--ink-soft); margin: 0; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

.card {
  background: var(--card);
  border: 3px solid #000;
  box-shadow: var(--shadow-hard), inset 0 0 0 2px var(--line);
  padding: 24px;
}

/* how to play */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step .n {
  font-family: var(--font-label); font-size: 12px; color: var(--gold);
  display: block; margin-bottom: 10px;
}
.step h3 { margin: 0 0 8px; }
.step p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- elements (the five orbs) ---------- */
.elements { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.element { text-align: center; padding: 26px 12px 20px; }
.orb {
  --c: #888;
  width: 88px; height: 88px; margin: 0 auto 14px;
  border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.75) 0 10%, transparent 26%),
    radial-gradient(circle at 50% 50%, var(--c) 0 55%, color-mix(in srgb, var(--c) 55%, #000) 100%);
  box-shadow: 0 0 0 3px #000, 0 0 26px color-mix(in srgb, var(--c) 45%, transparent);
  font-family: 'Noto Sans JP', sans-serif; font-weight: 700; font-size: 40px;
  color: rgba(0,0,0,.28);               /* ball::GLYPH_COLOR */
  transition: color .2s ease, transform .2s ease;
}
.element:hover .orb { transform: translateY(-4px); }
.bold-glyphs .orb { color: rgba(0,0,0,.7); }  /* ball::BOLD_GLYPH_COLOR */
.orb.fire      { --c: #e6261a; }
.orb.water     { --c: #1a4de6; }
.orb.earth     { --c: #26b333; }
.orb.wind      { --c: #ebe6d9; }
.orb.lightning { --c: #f2d91a; }
.element h3 { margin: 0; font-size: 1.15rem; }
.element .jp { font-family: var(--font-label); font-size: 11px; color: var(--ink-faint); }

.glyph-toggle { margin-top: 26px; text-align: center; }
.toggle {
  font-family: var(--font-label); font-size: 12px;
  background: transparent; color: var(--ink-soft);
  border: 2px solid var(--line); padding: 8px 14px; cursor: pointer;
}
.toggle:hover { color: var(--ink); border-color: var(--ink-faint); }
.toggle[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }

/* ---------- features + high score table ---------- */
.features-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 40px; align-items: start; }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.features li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; color: var(--ink-soft); }
.features li::before {
  content: ""; width: 10px; height: 10px; margin: 8px 0 0 4px;
  background: var(--ember); box-shadow: 0 0 0 3px var(--ember-deep);
}
.features strong { color: var(--ink); }

.scores { font-family: var(--font-label); padding: 22px 22px 18px; }
.scores h3 { font-family: var(--font-label); color: var(--gold); text-align: center; margin: 0 0 14px; font-size: 16px; text-shadow: 2px 2px 0 #000; }
.scores table { width: 100%; border-collapse: collapse; font-size: 14px; }
.scores th { color: var(--gold); font-weight: 400; text-align: left; padding: 4px 6px; }
.scores td { padding: 4px 6px; color: #fff; text-shadow: 2px 2px 0 #000; }
.scores td:nth-child(2), .scores th:nth-child(2) { text-align: right; }
.scores tr.you td { color: var(--ember-glow); }
.scores .note { font-family: var(--font-body); font-size: 12.5px; color: var(--ink-faint); margin: 12px 0 0; text-align: center; }

/* ---------- screenshot gallery ---------- */
.gallery {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.gallery .phone { border-width: 8px; }

/* ---------- trailer slot ---------- */
.trailer { aspect-ratio: 16 / 9; max-width: 880px; margin: 0 auto; box-shadow: 8px 8px 0 #000; }
.trailer > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- call to action band ---------- */
.cta { max-width: 640px; margin: 0 auto; text-align: center; padding: 32px 28px; }
.cta h3 { margin: .1em 0 .4em; font-size: 1.6rem; }
.cta p { color: var(--ink-soft); margin: 0 0 20px; }

/* ---------- prose pages (privacy) ---------- */
.prose { max-width: 70ch; padding: clamp(40px, 7vw, 72px) 24px; }
.prose h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: .15em; }
.prose .updated { font-family: var(--font-label); font-size: 12px; color: var(--ink-faint); margin-bottom: 2.4em; }
.prose h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 1.8em 0 .5em; }
.prose p, .prose li { color: var(--ink-soft); font-size: 16.5px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: .4em 0; }
.prose li::marker { color: var(--ember); }
.prose strong { color: var(--ink); }
.tldr {
  background: var(--card); border: 3px solid #000; box-shadow: var(--shadow-hard), inset 0 0 0 2px var(--ember-deep);
  padding: 18px 22px; margin: 0 0 2em; color: var(--ink);
}
.tldr p { color: var(--ink); margin: 0; }
.tldr .eyebrow { display: block; margin-bottom: 6px; }

/* ---------- support / form ---------- */
.support-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: start; }
.faq { margin-top: 8px; }
.faq details { border-bottom: 2px solid var(--line); padding: 16px 0; }
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 16px; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-label); color: var(--ember); font-size: 18px; }
.faq details[open] summary::after { content: "-"; }
.faq p { margin: 12px 0 2px; color: var(--ink-soft); font-size: 15.5px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 7px; }
.field .hint { font-weight: 400; color: var(--ink-faint); font-size: 13px; }
.input, .textarea {
  width: 100%; font-family: var(--font-body); font-size: 15.5px; color: var(--ink);
  background: var(--sky); border: 2px solid var(--line); border-radius: 0;
  padding: 11px 13px; transition: border-color .15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.input:focus, .textarea:focus { outline: none; border-color: var(--ember); }
.textarea { resize: vertical; min-height: 130px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.seg { display: inline-flex; border: 2px solid var(--line); padding: 4px; gap: 4px; background: var(--sky); }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: inline-block; padding: 7px 18px; cursor: pointer;
  font-family: var(--font-label); font-size: 13px; color: var(--ink-soft);
  transition: background .15s, color .15s;
}
.seg input:checked + span { background: var(--ember); color: #1a0800; }
.seg input:focus-visible + span { outline: 2px solid var(--gold); }

.honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-msg { margin-top: 12px; font-size: 14.5px; min-height: 1.2em; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--danger); }

/* ---------- footer ---------- */
.site-foot { border-top: 2px solid var(--line); margin-top: 40px; padding: 32px 0; color: var(--ink-soft); background: rgba(5,8,15,.6); }
.site-foot .wrap { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-foot a { color: var(--ink-soft); text-decoration: none; font-size: 14.5px; }
.site-foot a:hover { color: var(--gold); }
.site-foot .mark { font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.site-foot .copy { font-size: 13px; color: var(--ink-faint); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .elements { grid-template-columns: repeat(3, 1fr); }
  .features-grid { grid-template-columns: 1fr; }
  .scores { max-width: 380px; width: 100%; margin: 0 auto; }
  .gallery {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 58%;
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px;
  }
  .gallery .slot { scroll-snap-align: center; }
}

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .support-grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .brand span { display: none; }
  nav.main a { padding: 6px 8px; font-size: 12px; }
  .steps { grid-template-columns: 1fr; }
  .elements { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-auto-columns: 72%; }
  .field-row { grid-template-columns: 1fr; }
  .store { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .meteor { animation: none; display: none; }
}
