/* Banners of the Daimyo: the game's UI look (game/scripts/ui/ui_theme.gd): black lacquer, thin gold rules,
   vermilion for the one call to action. Pixel art is drawn at whole-number scales only (zoom 1 or 2). */

@font-face {
  font-family: "Kaisei Tokumin";
  src: url("/fonts/kaisei-tokumin-extrabold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "BIZ UDPGothic";
  src: url("/fonts/biz-udpgothic-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "BIZ UDPGothic";
  src: url("/fonts/biz-udpgothic-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --lacquer: #16110f;
  --lacquer-hi: #2c221c;
  --inset: #0a0807;
  --rule: #685236;
  --gold: #d6b062;
  --gold-hi: #f6d88c;
  --gold-dim: #8c7042;
  --paper: #ece2c8;
  --text: #f1eada;
  --text-dim: #b8ac94;
  --muted: #847a68;
  --vermilion: #be3a28;
  --vermilion-hi: #e26042;
  --display: "Kaisei Tokumin", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --body: "BIZ UDPGothic", "Segoe UI", system-ui, sans-serif;
  --z: 1; /* pixel-art zoom */
  --gutter: 16px;
  color-scheme: dark;
}
@media (min-width: 760px) {
  :root { --z: 2; --gutter: 32px; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: #100c0b;
  color: var(--text);
  font: 400 1.0625rem/1.75 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
.px, .spr { image-rendering: pixelated; image-rendering: crisp-edges; }
.px { image-rendering: pixelated; }
a { color: var(--gold-hi); text-underline-offset: 3px; }
a:hover { color: #fff; }

/* ---------------------------------------------------------------- sprites: horizontal strips, stepped */
.spr {
  display: inline-block;
  width: calc(var(--w) * 1px);
  height: calc(var(--h) * 1px);
  background-repeat: no-repeat;
  background-position: 0 0;
  animation: play calc(var(--n) / var(--fps) * 1s) steps(var(--n)) infinite;
  image-rendering: pixelated;
}
@keyframes play { to { background-position: calc(var(--w) * var(--n) * -1px) 0; } }
@media (prefers-reduced-motion: reduce) {
  .spr { animation: none; }
}

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 56px var(--gutter) 0;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 72%, rgba(190, 58, 40, 0.16), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 0%, #241a15 0%, var(--lacquer) 55%, #0d0a09 100%);
  border-bottom: 1px solid var(--rule);
}
.hero::before { /* faint seigaiha waves, gold */
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.07;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'%3E%3Cg fill='none' stroke='%23d6b062' stroke-width='1'%3E%3Ccircle cx='24' cy='24' r='22'/%3E%3Ccircle cx='24' cy='24' r='16'/%3E%3Ccircle cx='24' cy='24' r='10'/%3E%3Ccircle cx='0' cy='12' r='22'/%3E%3Ccircle cx='0' cy='12' r='16'/%3E%3Ccircle cx='0' cy='12' r='10'/%3E%3Ccircle cx='48' cy='12' r='22'/%3E%3Ccircle cx='48' cy='12' r='16'/%3E%3Ccircle cx='48' cy='12' r='10'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%);
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}
.hero-text { position: relative; max-width: 760px; margin: 0 auto; }
.kanji-title {
  margin: 0 0 8px;
  font: 800 1.125rem/1 var(--display);
  letter-spacing: 0.5em;
  padding-left: 0.5em;
  color: var(--vermilion-hi);
}
h1 {
  margin: 0;
  font: 800 clamp(2.5rem, 9vw, 4.75rem)/1.08 var(--display);
  color: var(--gold-hi);
  text-shadow: 0 2px 0 #000, 0 0 32px rgba(214, 176, 98, 0.18);
  text-wrap: balance;
}
.tagline {
  margin: 20px auto 0;
  max-width: 34ch;
  font: 800 clamp(1.125rem, 3.4vw, 1.5rem)/1.5 var(--display);
  color: var(--paper);
  text-wrap: balance;
}
.pitch { margin: 12px auto 0; max-width: 46ch; color: var(--text-dim); }
.soon {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px 18px;
  margin-top: 28px;
}
.seal {
  display: inline-block;
  padding: 12px 22px;
  background: var(--vermilion);
  color: #fff6e6;
  font: 700 1rem/1.2 var(--body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--vermilion-hi);
  outline: 1px solid var(--gold-dim);
  outline-offset: 3px;
  box-shadow: 0 6px 24px rgba(190, 58, 40, 0.35);
}
.platform {
  font: 700 0.875rem/1 var(--body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

/* The stage is laid out in 1x pixels; zoom doubles it on wider screens. */
.stage {
  position: relative;
  width: 340px;
  height: 312px;
  margin: 36px auto 0;
  zoom: var(--z);
}
.sun {
  position: absolute;
  left: 50%;
  top: 4px;
  width: 196px;
  height: 196px;
  margin-left: -98px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #cf4630 0%, #b8321f 62%, #9c2818 100%);
  box-shadow: 0 0 0 1px rgba(246, 216, 140, 0.25), 0 0 60px rgba(190, 58, 40, 0.35);
}
.castle {
  position: absolute;
  left: 23px;
  top: 24px;
  width: 294px;
  max-width: none;
}
.stage .std { position: absolute; }
.std-l1 { left: -8px; top: 84px; }
.std-l2 { left: 22px; top: 118px; animation-delay: -0.4s !important; }
.std-r1 { right: -8px; top: 84px; animation-delay: -0.2s !important; }
.std-r2 { right: 22px; top: 118px; animation-delay: -0.6s !important; }
.lineup {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  white-space: nowrap;
}
.lineup::before { /* ground shadow under the line */
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 2px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), transparent 70%);
}
.lineup .spr { position: relative; margin: 0 -9px; }
.lineup .spr:nth-child(2n) { animation-delay: -0.5s; }
.lineup .spr:nth-child(3n) { animation-delay: -0.25s; }
.wide-only { display: none !important; }
@media (min-width: 1100px) {
  .wide-only { display: inline-block !important; }
}

/* ---------------------------------------------------------------- features */
main { padding: 0 var(--gutter); }
.feature {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 0;
  display: grid;
  gap: 32px;
  justify-items: center;
  border-bottom: 1px solid rgba(104, 82, 54, 0.45);
  position: relative;
}
.feature::after { /* small gold lozenge on the rule */
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: var(--lacquer);
  border: 1px solid var(--gold-dim);
  transform: rotate(45deg);
}
.copy { max-width: 620px; width: 100%; }
.hanko {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  width: 48px;
  height: 64px;
  margin-bottom: 18px;
  background: var(--vermilion);
  color: #fff3df;
  font: 800 1.25rem/1 var(--display);
  letter-spacing: 0.08em;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px rgba(255, 243, 223, 0.18);
}
h2 {
  margin: 0 0 14px;
  font: 800 clamp(1.75rem, 5vw, 2.5rem)/1.2 var(--display);
  color: var(--gold-hi);
  text-wrap: balance;
}
.copy p { margin: 0; color: var(--text); }
.art { margin: 0; width: 100%; display: grid; justify-items: center; gap: 14px; min-width: 0; }
.art figcaption { color: var(--muted); font-size: 0.875rem; text-align: center; }

.frame {
  position: relative;
  padding: 3px;
  background: var(--inset);
  border: 1px solid var(--rule);
  box-shadow: 0 0 0 1px #000, 0 18px 48px rgba(0, 0, 0, 0.55);
  max-width: 100%;
  line-height: 0;
}
.frame img { display: block; }

/* seasons: four crops of the same hamlet, cross-fading */
.seasons .frame { width: calc(326px * var(--z)); }
.seasons .frame img { width: calc(320px * var(--z)); }
.season { position: absolute; top: 3px; left: 3px; opacity: 0; transition: opacity 0.9s ease; }
.season.is-on { position: relative; top: 0; left: 0; opacity: 1; }
.season-tabs { display: none; gap: 4px; flex-wrap: wrap; justify-content: center; }
.js .season-tabs { display: flex; }
.season-tabs button {
  font: 700 0.875rem/1 var(--body);
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: var(--lacquer);
  border: 1px solid var(--rule);
  padding: 10px 12px;
  cursor: pointer;
}
.season-tabs button:hover { color: var(--text); background: var(--lacquer-hi); }
.season-tabs button[aria-pressed="true"] { color: var(--gold-hi); background: var(--lacquer-hi); border-color: var(--gold-dim); }
.season-tabs button:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

/* workers and duel strips under the copy */
.workers, .duel { display: flex; gap: 6px; margin-top: 22px; zoom: var(--z); }
.duel { gap: 0; }
.duel .spr:first-child { margin-right: -14px; }

/* eras: a swipeable row on phones, a 2 x 2 grid where there is room */
.eras {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 2px 12px;
  scrollbar-color: var(--rule) transparent;
}
.eras img { flex: 0 0 auto; max-width: none; scroll-snap-align: center; }
@media (min-width: 640px) {
  .eras {
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: center;
    align-items: end;
    justify-items: center;
    overflow: visible;
    gap: 16px 12px;
  }
}

/* battle */
.field { zoom: var(--z); padding: 3px; }
.field img { background: radial-gradient(ellipse at 50% 60%, #22301d 0%, #18140f 70%); }

/* generals */
.generals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 0;
  width: 100%;
  max-width: 600px;
}
.generals li { flex: 0 0 33.333%; padding: 0 6px; }
@media (min-width: 560px) { .generals li { flex-basis: 25%; } }
.generals li { display: grid; justify-items: center; text-align: center; gap: 2px; min-width: 0; }
.generals img {
  width: 96px;
  max-width: 100%;
  border: 1px solid var(--rule);
  outline: 1px solid #000;
  background: var(--inset);
  margin-bottom: 6px;
}
.generals b { font: 700 0.8125rem/1.3 var(--body); color: var(--text); }
.generals span { font: 800 0.8125rem/1.3 var(--display); color: var(--gold); letter-spacing: 0.06em; }
.generals i { font: 400 0.75rem/1.3 var(--body); font-style: normal; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }

/* co-op banners and allies */
.banners { display: flex; justify-content: center; zoom: var(--z); }
.banners .spr { margin: 0 -4px; }
.banners .spr:nth-child(2n) { animation-delay: -0.35s; }
.banners .spr:nth-child(3n) { animation-delay: -0.7s; }
.allies { display: flex; align-items: flex-end; justify-content: center; margin-top: -40px; zoom: var(--z); }
.allies .spr { margin: 0 -4px; }

@media (min-width: 1180px) {
  .feature {
    grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    gap: 56px;
    padding: 96px 0;
  }
  .feature .art { justify-items: center; }
  .feature.flip .copy { order: 2; }
  .feature.flip .art { order: 1; }
}

/* ---------------------------------------------------------------- finale and footer */
.finale {
  text-align: center;
  padding: 80px var(--gutter) 72px;
  background: radial-gradient(ellipse 60% 80% at 50% 40%, rgba(190, 58, 40, 0.14), transparent 70%);
}
.emblem { width: 128px; height: 128px; image-rendering: auto; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.6)); }
.finale h2 { margin: 24px 0 8px; }
.finale p { margin: 0; color: var(--text-dim); }
footer {
  border-top: 1px solid var(--rule);
  padding: 28px var(--gutter) 40px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.7;
}
footer p { margin: 0 auto 6px; max-width: 70ch; }
