/* =========================================================
   Idle Battle — site styles
   Palette pulled from TownPalette.cs and the in-game HUD:
   charcoal plates, cream text, gold accents, purple pennants.
   ========================================================= */

:root {
  --bg:        #1e1b26;
  --bg-2:      #262230;
  --panel:     #2b2834;
  --raised:    #3a3646;
  --plate:     #2f2c39;
  --plate-hi:  #4a4657;
  --edge:      #5b5568;
  --ink:       #14121a;

  --text:      #fff2d6;
  --muted:     #cfc0a3;
  --gold:      #f2c877;
  --gold-2:    #efc26e;
  --gold-deep: #b8842e;
  --amber:     #d9a14a;
  --purple:    #7c5cc4;
  --leaf:      #8ec55b;

  --font-head: "Josefin Sans", "Trebuchet MS", sans-serif;
  --font-body: "Alata", "Segoe UI", system-ui, sans-serif;

  --radius: 10px;
  --shadow-plate: 0 2px 0 #0e0c12, 0 6px 14px rgba(0,0,0,.45);
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; margin: 0; line-height: 1.1; letter-spacing: .01em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); color: var(--gold); text-shadow: 0 2px 0 #000; }
h3 { font-size: 1.25rem; }
p { margin: 0; }
strong { color: var(--gold); font-weight: 600; }

/* ---------- Buttons (game plates) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 700; font-size: 1rem; letter-spacing: .02em;
  padding: .75rem 1.5rem; border-radius: var(--radius); text-decoration: none; cursor: pointer;
  border: 1px solid var(--plate-hi);
  background: linear-gradient(#3b3847, #2a2733);
  color: var(--text);
  box-shadow: var(--shadow-plate), inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.12); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #0e0c12, 0 3px 8px rgba(0,0,0,.4); }
.btn--gold {
  background: linear-gradient(#d8a34f, #a9741f);
  border-color: #f2c877; color: #2a1c08; text-shadow: 0 1px 0 rgba(255,255,255,.25);
  box-shadow: var(--shadow-plate), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn--plate { background: linear-gradient(#4a4657, #2f2c39); }
.btn--lg { font-size: 1.15rem; padding: 1rem 2rem; }
.btn--sm { font-size: .9rem; padding: .5rem 1rem; }

/* ---------- HUD bar ---------- */
.hud {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .6rem 1.25rem;
  background: linear-gradient(#242130, #1c1924);
  border-bottom: 2px solid #0f0d14;
  box-shadow: 0 2px 0 rgba(242,200,119,.25), 0 8px 20px rgba(0,0,0,.4);
}
.hud__brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--gold); }
.hud__title { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; }
.hud__nav { display: flex; gap: .25rem; margin-left: auto; }
.hud__nav a {
  font-family: var(--font-head); font-weight: 600; color: var(--muted); text-decoration: none;
  padding: .5rem .9rem; border-radius: 8px; border: 1px solid transparent; transition: .15s;
}
.hud__nav a:hover { color: var(--gold); background: var(--plate); border-color: var(--plate-hi); }
.hud__right { display: flex; align-items: center; gap: 1rem; }
.hud__burger { display: none; background: none; border: 1px solid var(--plate-hi); border-radius: 8px; padding: .5rem; cursor: pointer; }
.hud__burger span { display: block; width: 22px; height: 2px; background: var(--gold); margin: 4px 0; }

@media (max-width: 820px) {
  .hud { gap: .75rem; }
  .hud__burger { display: block; }
  .hud__nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; padding: .75rem;
    background: #1c1924; border-bottom: 2px solid #0f0d14;
    display: none;
  }
  .hud__nav.is-open { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 92vh; display: grid; place-items: center;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden; isolation: isolate;
}
.hero__bg, .hero__bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; z-index: -2; }
.hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at center 45%, rgba(20,18,26,.15), rgba(20,18,26,.55) 70%),
    linear-gradient(to bottom, rgba(20,18,26,.35), rgba(20,18,26,0) 30%, rgba(30,27,38,.9) 100%);
}
.hero__content { text-align: center; padding: 4rem 1.25rem 6rem; width: 100%; max-width: 820px; min-width: 0; }
.hero__logo {
  position: relative; width: min(640px, 92vw); margin: 0 auto .5rem; aspect-ratio: 864 / 504;
  /* transform-only animation: stays on the compositor, no per-frame repaint */
  /* tune here: duration = one full up-and-down, distance in @keyframes float */
  animation: float 2.4s ease-in-out -0.6s infinite;
  will-change: transform; transform: translate3d(0, 0, 0) rotate(.01deg);
  backface-visibility: hidden;
}
/* static warm halo behind the lettering (cheap; replaces per-frame drop-shadow filters) */
.hero__logo::before {
  content: ""; position: absolute; inset: 8% 10%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255,160,60,.28), rgba(255,120,40,.10) 45%, transparent 70%);
}
.hero__logo-poster, .hero__logo-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block;
  background: transparent;
}
.hero__logo-video { opacity: 0; transition: opacity .6s ease; }
/* iOS-only WebKit feature: belt-and-braces guard so the alpha-less video can never show there */
@supports (-webkit-touch-callout: none) {
  .hero__logo-video { display: none !important; }
  .hero__logo.is-playing .hero__logo-poster { opacity: 1 !important; }
}
.hero__logo.is-playing .hero__logo-video { opacity: 1; }
.hero__logo.is-playing .hero__logo-poster { opacity: 0; transition: opacity .6s ease; }
/* the .01deg rotation is deliberate: it stops Chromium pixel-snapping the video layer,
   which otherwise turns a slow drift into visible 1px steps */
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(.01deg); }
  50%      { transform: translate3d(0, -14px, 0) rotate(.01deg); }
}
.hero__tag {
  font-family: var(--font-head); font-weight: 600; font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.8), 0 0 24px rgba(0,0,0,.6);
  margin-bottom: 1.75rem;
}
.hero__tag em { display: block; margin-top: .25em; color: var(--gold); font-style: normal; }
.hero__cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
/* Platform groups: PC (Steam) and Mobile (App Store, Google Play) */
.platforms {
  display: flex; flex-direction: column; align-items: center;
  gap: .4rem; margin-top: 2rem;
}
.platforms__group { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.platforms__label {
  font-family: var(--font-head); font-weight: 600; font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.stores {
  list-style: none; margin: 0; padding: 0; display: flex; gap: .8rem; justify-content: center; align-items: center; flex-wrap: wrap;
}
.store { display: flex; align-items: center; padding: 20px 0; } /* same label-to-logo spacing as the Steam clear space */
.store img { display: block; width: auto; height: 50px; }
/* Steam Brand Guidelines: inverse (white) logo, minimum 50px tall on screen, clear space on every side
   of at least the crank diameter (~0.4 x logo height = 20px at 50px). The padding IS that clear space;
   no plate, border or other element is combined with the logo. */
.store--steam { padding: 20px; }
@media (max-width: 600px) {
  .platforms { gap: .3rem; }
  .store { padding: 16px 0; }
  .store img { height: 44px; }
  .store--steam img { height: 50px; }
  .store--steam { padding: 16px 20px 20px; }
}
.hero__ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: linear-gradient(transparent, var(--bg));
}

/* ---------- Sections ---------- */
.section { padding: 5rem 1.25rem; max-width: var(--max); margin: 0 auto; }
.section__head { text-align: center; max-width: 720px; margin: 0 auto 2.5rem; }
.section__head p { color: var(--muted); margin-top: .9rem; }
.eyebrow {
  display: inline-block; font-family: var(--font-head); font-weight: 600; font-size: .8rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--purple); margin-bottom: .6rem;
  filter: brightness(1.4);
}

/* ---------- Newsletter popup ---------- */
.newsletter { padding-top: 3rem; }
.popup {
  max-width: 640px; margin: 0 auto; border-radius: 16px; overflow: hidden;
  border: 2px solid var(--edge); box-shadow: 0 0 0 1px rgba(242,200,119,.25), 0 30px 60px rgba(0,0,0,.6);
  background: var(--panel);
}
.popup__bar {
  display: flex; align-items: center; justify-content: space-between; padding: .7rem 1.25rem;
  background: linear-gradient(#242130, #1c1924); border-bottom: 2px solid var(--gold-deep);
}
.popup__title { font-family: var(--font-head); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.popup__badge {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--purple); color: #fff; font-weight: 700; font-family: var(--font-head);
}
.popup__body { padding: 2rem 1.5rem 1.75rem; text-align: center; }
.popup__body h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: .6rem; }
.popup__body > p { color: var(--muted); margin-bottom: 1.5rem; }
.signup { text-align: left; display: grid; gap: .8rem; }
.signup__label { font-family: var(--font-head); font-weight: 600; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.signup__row { display: flex; gap: .6rem; }
.signup__input {
  flex: 1; min-width: 0; font: inherit; color: var(--text); padding: .8rem 1rem; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--edge); box-shadow: inset 0 2px 6px rgba(0,0,0,.5);
}
.signup__input:focus { outline: none; border-color: var(--gold); box-shadow: inset 0 2px 6px rgba(0,0,0,.5), 0 0 0 3px rgba(242,200,119,.2); }
.signup__input.is-invalid { border-color: #e0605a; }
.signup__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.signup__consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--muted); cursor: pointer; }
.signup__consent input { margin-top: .25rem; accent-color: var(--gold-deep); }
.signup__consent a { color: var(--gold); }
.signup__fine { font-size: .8rem; color: #9d927f; line-height: 1.5; }
.signup__msg { min-height: 1.4em; font-size: .92rem; }
.signup__msg.is-ok { color: var(--leaf); }
.signup__msg.is-err { color: #f0a49b; }
.signup.is-done .signup__row, .signup.is-done .signup__consent, .signup.is-done .signup__label, .signup.is-done .signup__fine { display: none; }
.signup.is-done .signup__msg { text-align: center; font-size: 1.05rem; padding: 1rem; background: var(--bg-2); border-radius: var(--radius); border: 1px solid var(--leaf); }
@media (max-width: 520px) { .signup__row { flex-direction: column; } }

/* ---------- Footer ---------- */
.footer {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem; flex-wrap: wrap;
  padding: 2.5rem 1.25rem 3rem; color: var(--muted); font-size: .9rem;
  border-top: 1px solid var(--edge); background: #17151e;
}
.footer img { width: 70px; opacity: .9; }
.footer__text { text-align: center; max-width: 640px; }
.footer__legal { font-size: .72rem; color: #8f8578; margin-top: .4rem; line-height: 1.5; }
.footer nav { display: flex; gap: 1rem; }
.footer nav a { color: var(--muted); text-decoration: none; }
.footer nav a:hover { color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .hero__logo { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Privacy page ---------- */
.legal { max-width: 760px; }
.legal__title { color: var(--gold); font-size: 2rem; margin: .4rem 0 1rem; }
.legal h2 { font-size: 1.3rem; color: var(--gold); margin: 2rem 0 .6rem; text-shadow: none; }
.legal p, .legal li { color: var(--muted); }
.legal ul { padding-left: 1.2rem; }
.legal .todo { color: #f0a49b; font-style: italic; }
