/* ── Root Variables ───────────────────────────────────────── */
:root {
  --bg-1: #060810;
  --bg-2: #0c1120;
  --bg-3: #111828;
  --primary: #f59e0b;
  --primary-soft: rgba(245,158,11,.15);
  --primary-strong: #d97706;
  --accent: #a78bfa;
  --accent-soft: #c4b5fd;
  --accent-warm: #fb923c;
  --role-tank: #3b82f6;
  --role-dps: #f87171;
  --role-mage: #a78bfa;
  --role-support: #34d399;
  --role-ranger: #38bdf8;
  --text-main: #f0f2ff;
  --text-muted: rgba(240,242,255,.62);
  --panel: rgba(6,8,16,.75);
  --border: rgba(255,255,255,.09);
  --border-gold: rgba(245,158,11,.25);
  --shadow: 0 28px 64px rgba(6,8,16,.6);
  --radius: 22px;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(ellipse 70% 50% at 10% 5%,  rgba(167,139,250,.14) 0%, transparent 55%),
    radial-gradient(ellipse 55% 40% at 90% 80%,  rgba(245,158,11,.12) 0%, transparent 50%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 50%, #0d1520 100%);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Glow orbs ────────────────────────────────────────────── */
body::before, body::after {
  content: "";
  position: fixed;
  width: 420px; height: 420px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .28;
  pointer-events: none;
  z-index: 0;
}
body::before { top: -140px; left: -80px; background: rgba(167,139,250,.5); }
body::after  { bottom: -160px; right: -80px; background: rgba(245,158,11,.4); }

.page { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ── Language Switch ─────────────────────────────────────── */
.lang-switch {
  position: fixed; top: 16px; right: 20px; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel);
  backdrop-filter: blur(12px); font-size: 13px;
}
.lang-switch-sep { color: var(--border); user-select: none; }
.lang-switch-btn {
  margin: 0; padding: 4px 9px; border: none; border-radius: 999px;
  font: inherit; color: var(--text-muted); background: transparent; cursor: pointer;
  transition: color .15s, background .15s;
}
.lang-switch-btn:hover { color: var(--text-main); }
.lang-switch-btn.is-active { color: var(--accent); background: rgba(167,139,250,.15); font-weight: 600; }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
  padding: 20px 0 10px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 20px; font-weight: 800; letter-spacing: .03em;
  color: var(--text-main);
}
.brand-logo {
  width: 44px; height: 44px;
  object-fit: contain; border-radius: 10px;
  box-shadow: 0 0 20px rgba(245,158,11,.35);
}

/* ── Main layout ──────────────────────────────────────────── */
main {
  flex: 1;
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
  padding: 8px 0 40px;
}

/* ── Eyebrow ──────────────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid rgba(245,158,11,.3);
  background: rgba(245,158,11,.1);
  color: #fde68a;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: 14px;
}

/* ── Hero section ─────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 32px 0 8px;
}
.hero-copy h1 {
  font-size: clamp(28px, 4.2vw, 50px);
  font-weight: 900; line-height: 1.1; letter-spacing: -.02em;
}
.lead {
  margin: 18px 0 0;
  font-size: clamp(14px, 1.7vw, 17px);
  line-height: 1.9; color: var(--text-muted); max-width: 520px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.primary-btn, .ghost-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 148px; padding: 14px 24px; border-radius: 999px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.primary-btn {
  color: #fff; border: none;
  background: linear-gradient(90deg, var(--primary), var(--accent-warm));
  box-shadow: 0 14px 32px rgba(245,158,11,.32);
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(245,158,11,.42); }
.ghost-btn {
  color: var(--text-main);
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
}
.ghost-btn:hover { transform: translateY(-2px); background: rgba(255,255,255,.11); }

/* ── Battle Card ──────────────────────────────────────────── */
.battle-card {
  position: relative;
  min-height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.map-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.map-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(6,8,16,.75) 0%, rgba(6,8,16,.45) 50%, rgba(6,8,16,.72) 100%);
}
.hero-formation {
  position: absolute;
  bottom: 70px; left: 24px;
  display: flex; flex-direction: row; align-items: center; gap: 10px;
}
.formation-back {
  display: flex; flex-direction: column; gap: 10px;
}
.hero-unit {
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: rgba(167,139,250,.18);
  border: 1px solid rgba(167,139,250,.3);
  backdrop-filter: blur(8px);
  animation: float 4s ease-in-out infinite;
  box-shadow: 0 8px 24px rgba(6,8,16,.4), inset 0 1px 0 rgba(255,255,255,.08);
}
.hero-unit img { object-fit: contain; image-rendering: pixelated; }
.unit-front { width: 88px; height: 88px; animation-delay: 0s; }
.unit-mid   { width: 68px; height: 68px; animation-delay: .4s; }
.unit-back  { width: 68px; height: 68px; animation-delay: .8s; }
.vs-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 11px; font-weight: 900; letter-spacing: .12em;
  color: var(--primary); padding: 6px 10px;
  border-radius: 8px; background: rgba(245,158,11,.18);
  border: 1px solid rgba(245,158,11,.35);
  backdrop-filter: blur(6px);
}
.battle-logo {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 210px; height: 100px;
  object-fit: contain;
  z-index: 2;
}

/* ── Section base ─────────────────────────────────────────── */
.section {
  margin-top: 20px;
  padding: 28px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  box-shadow: var(--shadow);
}
.section-header { margin-bottom: 24px; }
.section-header h2 { margin: 10px 0 0; font-size: clamp(22px, 2.8vw, 34px); font-weight: 800; }
.section-header > p:last-child { margin: 12px 0 0; color: var(--text-muted); line-height: 1.8; max-width: 680px; font-size: 15px; }

/* ── Stats panel ──────────────────────────────────────────── */
.stats-panel {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  background: linear-gradient(135deg, rgba(167,139,250,.07), rgba(245,158,11,.05));
}
.stats-panel article {
  padding: 20px 18px; border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
}
.stats-panel strong { display: block; font-size: 17px; color: #fde68a; margin-bottom: 7px; }
.stats-panel span { font-size: 13px; line-height: 1.7; color: var(--text-muted); }

/* ── Hero Roster ──────────────────────────────────────────── */
.roster-section {
  background: linear-gradient(135deg, rgba(167,139,250,.06), rgba(6,8,16,0));
  border-color: rgba(167,139,250,.18);
}
.roster-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.hero-card {
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  cursor: default;
}
.hero-card:hover {
  transform: translateY(-4px);
  border-color: rgba(167,139,250,.4);
  box-shadow: 0 16px 40px rgba(6,8,16,.45), 0 0 20px rgba(167,139,250,.12);
}
.hero-card-img-wrap {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(167,139,250,.12), rgba(245,158,11,.08));
  padding: 24px 12px 12px;
  min-height: 120px;
}
.hero-card-img {
  width: 72px; height: 72px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 18px rgba(6,8,16,.6));
}
.hero-card-body { padding: 10px 14px 14px; }
.hero-card-body h4 { font-size: 14px; font-weight: 700; margin-top: 6px; }
.role-badge {
  display: inline-block;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
}
.role-tank    { background: rgba(59,130,246,.2);  color: #93c5fd; border: 1px solid rgba(59,130,246,.3); }
.role-dps     { background: rgba(248,113,113,.2); color: #fca5a5; border: 1px solid rgba(248,113,113,.3); }
.role-mage    { background: rgba(167,139,250,.2); color: #c4b5fd; border: 1px solid rgba(167,139,250,.3); }
.role-support { background: rgba(52,211,153,.2);  color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); }
.role-ranger  { background: rgba(56,189,248,.2);  color: #7dd3fc; border: 1px solid rgba(56,189,248,.3); }

/* ── Items Section ────────────────────────────────────────── */
.items-section {
  background: linear-gradient(135deg, rgba(245,158,11,.06), rgba(6,8,16,0));
  border-color: rgba(245,158,11,.16);
}
.items-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.item-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  transition: background .2s, border-color .2s;
}
.item-card:hover { background: rgba(255,255,255,.07); border-color: rgba(245,158,11,.25); }
.item-icon-wrap {
  flex-shrink: 0;
  padding: 12px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.12);
}
.item-icon-wrap.item-gold   { background: rgba(245,158,11,.2); }
.item-icon-wrap.item-purple { background: rgba(167,139,250,.2); }
.item-icon-wrap.item-red    { background: rgba(248,113,113,.2); }
.item-icon-wrap.item-green  { background: rgba(52,211,153,.2); }
.item-icon-wrap.item-blue   { background: rgba(56,189,248,.2); }
.item-icon { width: 90px; height: 90px; object-fit: contain; image-rendering: pixelated; }
.item-name { display: block; font-size: 13px; font-weight: 700; color: #fde68a; margin-bottom: 4px; }
.item-desc { font-size: 12px; line-height: 1.6; color: var(--text-muted); }

.props-header { margin: 22px 0 12px; }
.props-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.props-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.prop-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  transition: background .2s, transform .2s;
  cursor: default;
}
.prop-card:hover { background: rgba(255,255,255,.08); transform: translateY(-3px); }
.prop-icon { width: 90px; height: 90px; object-fit: contain; image-rendering: pixelated; }
.prop-card span { font-size: 12px; font-weight: 600; color: var(--text-muted); text-align: center; }

/* ── Maps Section ─────────────────────────────────────────── */
.maps-section { border-color: rgba(255,255,255,.08); }
.maps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.map-card {
  border-radius: 18px; overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  transition: transform .25s, box-shadow .25s;
  cursor: default;
}
.map-card:hover { transform: translateY(-4px); box-shadow: 0 20px 50px rgba(6,8,16,.5); }
.map-img { width: 100%; aspect-ratio: 16/7; object-fit: cover; display: block; }
.map-info {
  padding: 18px 20px;
  background: linear-gradient(0deg, rgba(6,8,16,.95) 0%, rgba(6,8,16,.7) 70%, transparent 100%);
  position: absolute; bottom: 0; left: 0; right: 0;
}
.map-info h3 { font-size: 16px; font-weight: 800; margin-bottom: 5px; color: #fde68a; }
.map-info p { font-size: 13px; line-height: 1.65; color: var(--text-muted); }

/* ── Features (card grid) ─────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.info-card {
  padding: 22px; border-radius: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  transition: background .2s, border-color .2s;
}
.info-card:hover { background: rgba(255,255,255,.07); border-color: rgba(167,139,250,.25); }
.icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 14px;
  background: rgba(255,255,255,.07); border: 1px solid var(--border);
  font-size: 14px; font-weight: 800; color: #fde68a; margin-bottom: 14px;
}
.icon.icon-img { background: rgba(167,139,250,.12); }
.card-icon-img { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; }
.info-card h3 { margin: 0 0 9px; font-size: 17px; font-weight: 700; }
.info-card p { margin: 0; font-size: 14px; line-height: 1.75; color: var(--text-muted); }

/* ── CTA Panel ────────────────────────────────────────────── */
.cta-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: radial-gradient(circle at top right, rgba(167,139,250,.2), transparent 45%),
              linear-gradient(135deg, rgba(245,158,11,.1), rgba(167,139,250,.08));
  border-color: rgba(167,139,250,.2);
}
.cta-panel p { margin: 10px 0 0; max-width: 520px; color: var(--text-muted); line-height: 1.8; font-size: 15px; }

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  width: min(1160px, calc(100% - 48px)); margin: 0 auto;
  padding: 18px 0 28px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13px; color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.footer a { color: var(--accent-soft); }
.footer a:hover { text-decoration: underline; }

/* ── Document (privacy / terms) ──────────────────────────── */
.document .doc-hero h1 { margin: 10px 0 0; font-size: clamp(26px, 4vw, 40px); }
.document .doc-hero > p { margin: 16px 0 0; max-width: 720px; color: var(--text-muted); line-height: 1.85; }
.doc-card { margin-top: 18px; padding: 22px 24px; border-radius: 18px; border: 1px solid var(--border); background: rgba(255,255,255,.04); }
.doc-card h2 { margin: 0 0 12px; font-size: 17px; }
.doc-card p, .doc-card li { margin: 0; color: var(--text-muted); line-height: 1.85; font-size: 14px; }
.doc-card ul { margin: 0; padding-left: 20px; }
.doc-card li + li { margin-top: 8px; }
.doc-card a { color: var(--accent-soft); }
.legal-updated { margin-top: 10px; font-size: 13px; color: var(--text-muted); }

/* ── Enemy cluster (battle card) ──────────────────────────── */
.enemy-cluster {
  position: absolute;
  bottom: 70px; right: 24px;
  display: flex; flex-direction: row; align-items: center; gap: 10px;
}
.enemy-back {
  display: flex; flex-direction: column; gap: 10px;
}
.enemy-unit {
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: rgba(248,113,113,.18);
  border: 1px solid rgba(248,113,113,.3);
  backdrop-filter: blur(8px);
  animation: float 3.5s ease-in-out infinite;
  box-shadow: 0 8px 24px rgba(6,8,16,.4), inset 0 1px 0 rgba(255,255,255,.08);
}
.enemy-unit img { object-fit: contain; image-rendering: pixelated; }

/* ── Corps Section ────────────────────────────────────────── */
.corps-section {
  background: linear-gradient(135deg, rgba(248,113,113,.06), rgba(6,8,16,0));
  border-color: rgba(248,113,113,.18);
}
.corps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.corps-card {
  border-radius: 18px; overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  transition: transform .25s, box-shadow .25s, border-color .25s;
  cursor: default;
}
.corps-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(8,8,16,.5);
  border-color: rgba(248,113,113,.35);
}
.corps-img-wrap {
  display: flex; align-items: center; justify-content: center;
  height: 140px; padding: 20px;
}
.corps-img-wrap.corps-red    { background: linear-gradient(135deg, rgba(248,113,113,.18), rgba(6,8,16,0)); }
.corps-img-wrap.corps-orange { background: linear-gradient(135deg, rgba(251,146,60,.18),  rgba(6,8,16,0)); }
.corps-img-wrap.corps-green  { background: linear-gradient(135deg, rgba(52,211,153,.18),  rgba(6,8,16,0)); }
.corps-img {
  width: 96px; height: 96px; object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.5));
}
.corps-body { padding: 14px 18px 18px; }
.corps-body h4 { font-size: 16px; font-weight: 800; margin-bottom: 7px; color: #fca5a5; }
.corps-body p  { font-size: 13px; line-height: 1.7; color: var(--text-muted); margin-bottom: 10px; }
.corps-tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
  color: #fca5a5;
  background: rgba(248,113,113,.14); border: 1px solid rgba(248,113,113,.28);
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .roster-grid { grid-template-columns: repeat(4, 1fr); }
  .corps-grid  { grid-template-columns: repeat(3, 1fr); }
  .items-grid  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .battle-card { min-height: 280px; }
  .stats-panel, .card-grid { grid-template-columns: 1fr; }
  .roster-grid { grid-template-columns: repeat(2, 1fr); }
  .corps-grid { grid-template-columns: 1fr; }
  .maps-grid { grid-template-columns: 1fr; }
  .props-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 580px) {
  .site-header, main, .footer { width: calc(100% - 32px); }
  .section { padding: 20px 16px; }
  .roster-grid { grid-template-columns: repeat(2, 1fr); }
  .items-grid  { grid-template-columns: 1fr; }
  .props-row   { grid-template-columns: repeat(2, 1fr); }
}
