/* The game's own palette (the premium client's app.css), so the home site and
   the game read as one place. System fonts only: no font assets here. */
:root {
  --ground: #0a0d18;
  --ground-2: #11141d;
  --panel: #0e1a3c;
  --line: #24345e;
  --rim: #6fa5f6;
  --gold: #edc329;
  --gold-deep: #6b4c00;
  --on-gold: #11141d;
  --text: #eef2f6;
  --muted: #a3b0c8;
  --win: #5fc46a;
  --loss: #c25a5a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--rim); }
a:hover { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h3 { font-size: 1.1rem; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--on-gold); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.top { position: sticky; top: 0; z-index: 5; background: rgba(10, 13, 24, .92); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; text-decoration: none; font-size: 1.1rem; }
.brand img { image-rendering: pixelated; }
.nav ul { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 0; padding: 0; }
.nav ul a:not(.btn) { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav ul a:not(.btn):hover { color: var(--text); }

.btn {
  display: inline-block; padding: 12px 22px; border-radius: 10px;
  background: var(--gold); color: var(--on-gold); font-weight: 700; text-decoration: none;
  border: 2px solid var(--gold); box-shadow: 0 3px 0 var(--gold-deep);
}
.btn:hover { color: var(--on-gold); filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { color: var(--text); border-color: var(--rim); }
.btn-small { padding: 6px 14px; font-size: .9rem; box-shadow: 0 2px 0 var(--gold-deep); }

.hero {
  background:
    radial-gradient(ellipse at 70% 0%, rgba(111, 165, 246, .18), transparent 60%),
    linear-gradient(90deg, rgba(17, 20, 29, .97) 30%, rgba(17, 20, 29, .7)),
    url(https://play.jrpgbattle.com/skin/scenes/throne-room-arena.png) center / cover,
    var(--ground-2);
  image-rendering: pixelated;
  border-bottom: 1px solid var(--line);
}
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding-top: 64px; padding-bottom: 64px; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: .85rem; margin: 0 0 8px; }
h1 { font-size: clamp(2rem, 5.5vw, 3.2rem); }
.lede { color: var(--muted); font-size: 1.12rem; max-width: 38em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 12px; }
.cta.center { justify-content: center; }
.fine { color: var(--muted); font-size: .88rem; }

/* The game's own art, served by the game (see scripts/sprites.mjs): a
   .sprite is one frame, sized in sheet pixels times --z, and a boss's
   class sets --k to draw it bigger, as the game does. */
.sprite {
  --z: 2;
  --s: calc(var(--z) * var(--k, 1));
  display: inline-block; vertical-align: bottom;
  width: calc(var(--w) * 1px * var(--s)); height: calc(var(--h) * 1px * var(--s));
  background-repeat: no-repeat; image-rendering: pixelated;
}
.ico { width: 32px; height: 32px; image-rendering: pixelated; vertical-align: -8px; }

/* The game's frame, nine-sliced as the client does (skin/ui/ui.json). */
.card, .gods li, .descent li, .battle {
  border: 12px solid transparent; border-radius: 0;
  border-image: url(https://play.jrpgbattle.com/skin/ui/frame.png) 6 / 12px; image-rendering: pixelated;
}
.gods li { border-image-source: url(https://play.jrpgbattle.com/skin/ui/frame-showcase.png); }

.battle {
  background: linear-gradient(180deg, rgba(10, 13, 24, .15), rgba(10, 13, 24, .55)), var(--scene) center / cover, var(--panel);
  padding: 14px; box-shadow: 0 20px 40px rgba(0, 0, 0, .45);
  display: grid; gap: 14px;
}
.line { display: flex; justify-content: center; align-items: flex-end; gap: 6px; }
.unit { position: relative; display: grid; justify-items: center; padding-bottom: 10px; }
.unit .sprite { --z: 2; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); }
.unit.boss .sprite { --z: 1.25; }
.unit i { position: absolute; left: 6px; right: 6px; bottom: 0; height: 6px; background: #222b44; border: 1px solid #000; overflow: hidden; }
.unit i::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--hp)); background: url(https://play.jrpgbattle.com/skin/ui/fill-hp.png) 0 0 / 100% 100%; image-rendering: pixelated; }
.enemy .unit i::after { background: var(--loss); }
.unit.active .sprite { animation: bob 1.6s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(237, 195, 41, .8)); }
.unit.broken::before { content: ""; position: absolute; top: -6px; right: -6px; width: 32px; height: 32px; background: url(https://play.jrpgbattle.com/skin/ui/icon-status-broken.png) 0 0 / 100% 100%; image-rendering: pixelated; }
.order { display: flex; justify-content: center; gap: 6px; }
.order > span { width: 40px; height: 40px; display: grid; place-items: center; overflow: hidden; background: rgba(60, 20, 20, .8); border: 2px solid var(--loss); }
.order > span.you { background: rgba(14, 26, 60, .85); border-color: var(--rim); }
.order > span:first-child { outline: 2px solid var(--gold); outline-offset: 2px; }
.order .sprite { --z: 2; }
.menu { display: flex; justify-content: center; gap: 8px; }
.menu span { padding: 6px 14px; background: rgba(14, 26, 60, .9); border: 2px solid var(--line); color: var(--muted); font-weight: 600; font-size: .92rem; }
.menu .sel { color: var(--on-gold); background: var(--gold); border-color: var(--gold); }
@keyframes bob { 50% { transform: translateY(-4px); } }

section { padding: 72px 0; }
.band { background: var(--ground-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sub { color: var(--muted); max-width: 44em; margin: 0 0 32px; }

.grid { display: grid; gap: 18px; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--panel); padding: 12px; }
.mode .scene { height: 110px; margin: -6px -6px 14px; background: var(--scene) center / cover; image-rendering: pixelated; }
.card p { margin: 0; color: var(--muted); }
.mode .tag { display: flex; align-items: center; gap: 8px; color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; margin-bottom: 6px; }

.gods { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.gods li { background: var(--panel); padding: 6px 4px 10px; text-align: center; display: grid; gap: 2px; align-content: start; }
.gods .stage { height: 150px; display: grid; place-items: end center; margin-bottom: 6px; }
.gods .stage .sprite { --z: 3; }
.gods strong { font-size: 1.05rem; }
.gods li > span:not(.stage) { color: var(--gold); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.gods em { color: var(--muted); font-style: normal; font-size: .9rem; margin-top: 6px; }

.descent { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.descent li {
  display: grid; grid-template-columns: 130px 1fr auto; gap: 16px; align-items: center;
  padding: 10px 14px; min-height: 96px;
  background: linear-gradient(90deg, rgba(10, 13, 24, .92) 25%, rgba(10, 13, 24, .55)), var(--scene) center / cover;
}
.floors { color: var(--muted); font-size: .9rem; text-shadow: 0 2px 0 #000; }
.descent strong { font-size: 1.1rem; text-shadow: 0 2px 0 #000; }
.boss { color: var(--gold); font-weight: 700; display: flex; align-items: flex-end; gap: 10px; text-shadow: 0 2px 0 #000; }
.boss .sprite { --z: .9; }
.note { color: var(--muted); max-width: 46em; }

.final { text-align: center; background: radial-gradient(ellipse at 50% 100%, rgba(237, 195, 41, .12), transparent 60%), var(--ground-2); border-top: 1px solid var(--line); }
.final p { color: var(--muted); }

.foot { padding: 32px 0; border-top: 1px solid var(--line); }
.foot p { margin: 4px 0; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .g3 { grid-template-columns: 1fr 1fr; }
  .gods { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  section { padding: 52px 0; }
  .hero-inner { padding-top: 40px; padding-bottom: 40px; }
  .nav ul li:not(:last-child) { display: none; }
  .g3 { grid-template-columns: 1fr; }
  .gods { grid-template-columns: 1fr 1fr; }
  .gods .stage .sprite { --z: 2.5; }
  .battle { padding: 8px; }
  .unit .sprite { --z: 1.4; }
  .unit.boss .sprite { --z: .9; }
  .order { gap: 4px; }
  .order > span { width: 32px; height: 32px; }
  .order .sprite { --z: 1.6; }
  .line { gap: 2px; }
  .menu span { padding: 4px 10px; }
  .descent li { grid-template-columns: 1fr; gap: 2px; }
  .boss .sprite { --z: .6; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .unit.active .sprite { animation: none; }
}
