:root {
  --sky-top: #d9e8f6;
  --sky-mid: #eef4fa;
  --cream: #f7f3ea;
  --paper: #fffdf8;
  --paper-soft: rgba(255, 253, 248, 0.82);
  --ink: #2a2926;
  --ink-soft: #4a463f;
  --muted: #6f685c;
  --line: rgba(74, 70, 63, 0.14);
  --line-strong: rgba(74, 70, 63, 0.22);
  --accent: #3d5a80;
  --accent-deep: #2f4666;
  --gold: #a8873d;
  --gold-soft: rgba(168, 135, 61, 0.16);
  --stone: #8d8578;
  --shadow: 0 18px 40px rgba(61, 78, 102, 0.12);
  --radius: 18px;
  --radius-sm: 10px;
  --font-display: 'Cinzel', Georgia, serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--sky-mid);
  color: var(--ink);
  font-family: var(--font-body);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, #f8fbff 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 85% 20%, rgba(168, 135, 61, 0.10), transparent 50%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 28%, var(--cream) 72%, #efe8da 100%);
  overflow-x: hidden;
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; }

.world-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.mist {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: drift 16s ease-in-out infinite alternate;
}

.mist-a {
  width: 520px;
  height: 320px;
  background: rgba(255, 255, 255, 0.75);
  top: 40px;
  left: 8%;
}

.mist-b {
  width: 420px;
  height: 280px;
  background: rgba(180, 205, 230, 0.55);
  top: 120px;
  right: 5%;
  animation-delay: -5s;
}

.parchment-noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image:
    linear-gradient(rgba(42, 41, 38, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 41, 38, 0.5) 1px, transparent 1px);
  background-size: 80px 80px;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(20px, -12px, 0); }
}

.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Ornament helpers */
.ornament {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold);
  margin: 10px 0 18px;
}

.ornament::before,
.ornament::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(168, 135, 61, 0.55), transparent);
}

.ornament span {
  font-size: 14px;
  letter-spacing: 0.28em;
}

/* Topbar — frosted light like Genshin */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(255, 253, 248, 0.72);
  border-bottom: 1px solid var(--line);
}

.nav-shell {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-crest {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 30%, #fff8e8, #f0e2c0 45%, #d9c48a);
  border: 1px solid rgba(168, 135, 61, 0.55);
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.45), 0 6px 14px rgba(168, 135, 61, 0.18);
  font-size: 18px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.brand-copy em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted);
  font-size: 15px;
}

.menu {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line);
}

.menu-link {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.menu-link:hover,
.menu-link.active {
  color: var(--accent-deep);
  background: #fff;
  box-shadow: 0 6px 16px rgba(61, 90, 128, 0.1);
}

.cabinet-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid rgba(168, 135, 61, 0.4);
  background: linear-gradient(180deg, #fff8ea, #f3e5c4);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  box-shadow: 0 8px 18px rgba(168, 135, 61, 0.14);
}

.cabinet-btn span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.cabinet-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(168, 135, 61, 0.2);
}

/* Side marks */
.side-marks {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-mark {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  opacity: 0.4;
  transition: opacity 0.25s var(--ease);
}

.side-mark i {
  width: 8px;
  height: 8px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.side-mark:hover,
.side-mark.active { opacity: 1; }

.side-mark.active i {
  background: var(--gold);
  transform: rotate(45deg) scale(1.15);
}

/* Views */
.view-page { display: none; opacity: 0; }
.view-page.active {
  display: block;
  animation: pageIn 0.55s var(--ease) forwards;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.7s var(--ease) forwards;
}
.reveal.delay-1 { animation-delay: 0.1s; }
.reveal.delay-2 { animation-delay: 0.2s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* Hero — Genshin left/right */
.hero {
  padding: 64px 0 72px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(920px, 90%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(168, 135, 61, 0.45), transparent);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 42px;
  align-items: center;
}

.eyebrow {
  color: var(--gold);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  margin-bottom: 12px;
}

.hero h1 {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 18px;
}

.hero h1 .line { display: block; }

.hero h1 .soft {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(34px, 4.8vw, 52px);
  line-height: 1;
  color: var(--ink-soft);
}

.hero h1 .strong {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.hero h1 .gold {
  color: var(--accent-deep);
  font-size: clamp(26px, 3.4vw, 38px);
}

.lead {
  max-width: 540px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  margin-bottom: 26px;
}

.lead strong {
  color: var(--accent-deep);
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.btn-primary,
.btn-ghost,
.btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.btn-primary {
  padding: 14px 26px;
  border-radius: 999px;
  background: linear-gradient(180deg, #4d6f99, var(--accent));
  border: 1px solid #6f8cb0;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(61, 90, 128, 0.22);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(61, 90, 128, 0.28);
}

.btn-ghost {
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font-weight: 600;
}

.btn-ghost:hover {
  border-color: rgba(168, 135, 61, 0.55);
  background: #fff;
  transform: translateY(-1px);
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-weight: 700;
}

.btn-text:hover { color: var(--accent-deep); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.hero-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
}

.hero-stats b {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink);
}

.hero-stats span {
  color: var(--muted);
  font-size: 13px;
}

/* Right visual stage — light medieval frame */
.hero-stage .stage-frame {
  position: relative;
  background: var(--paper-soft);
  border: 1px solid rgba(168, 135, 61, 0.28);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.hero-stage .stage-frame::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(168, 135, 61, 0.18);
  border-radius: 18px;
  pointer-events: none;
}

.stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.stage-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  font-weight: 600;
  font-size: 13px;
}

.stage-tab:hover,
.stage-tab.active {
  color: var(--accent-deep);
  border-color: rgba(61, 90, 128, 0.35);
  background: #fff;
  box-shadow: 0 6px 14px rgba(61, 90, 128, 0.1);
}

.stage-art {
  position: relative;
  z-index: 1;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, #e8f0f8, #f6f1e6 55%, #ebe4d5);
  min-height: 280px;
}

.stage-art img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: opacity 0.35s var(--ease), transform 0.55s var(--ease);
}

.stage-art:hover img { transform: scale(1.03); }

.placeholder-art {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: var(--muted);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.8), transparent 40%),
    linear-gradient(160deg, #e7eff7, #f4efe4);
}

.placeholder-art strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.stage-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 4px 10px;
  position: relative;
  z-index: 1;
}

.stage-caption span {
  color: var(--muted);
  font-size: 13px;
}

.stage-caption strong {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
}

.stage-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.stage-links a {
  text-align: center;
  padding: 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  transition: all 0.25s var(--ease);
}

.stage-links a:hover {
  border-color: rgba(168, 135, 61, 0.5);
  background: #fff;
}

/* Sections */
.section { padding: 78px 0; }

.section.soft-panel {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.55), rgba(236, 243, 250, 0.45));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  margin-bottom: 34px;
  max-width: 700px;
}

.section-head h1,
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.8vw, 44px);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.section-head p:last-child {
  color: var(--muted);
  font-size: 17px;
}

/* Cards shared */
.news-feature,
.news-feed,
.kingdom-card,
.model-card,
.map-panel,
.sys-card,
.kd-panel,
.kd-class-card,
.loop-banner,
.asset-card {
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(61, 78, 102, 0.08);
}

/* News — Genshin-like */
.news-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
}

.news-feature {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.news-feature:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(61, 78, 102, 0.12);
}

.news-feature-art {
  position: relative;
  height: 250px;
  overflow: hidden;
  background: linear-gradient(160deg, #e5eef7, #efe8d8);
}

.news-feature-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ease);
}

.news-feature:hover .news-feature-art img { transform: scale(1.04); }

.news-feature-art .placeholder-art {
  height: 100%;
  min-height: 250px;
}

.seal {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(61, 90, 128, 0.92);
  border: 1px solid #6f8cb0;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.news-feature-art .seal {
  position: absolute;
  top: 14px;
  left: 14px;
}

.news-feature-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.news-feature-body h3 {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--ink);
}

.news-feature-body p {
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.news-feed { padding: 18px; }

.news-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  font-weight: 600;
  font-size: 13px;
}

.chip:hover,
.chip.active {
  color: var(--accent-deep);
  border-color: rgba(61, 90, 128, 0.35);
  background: #fff;
}

.news-list { display: flex; flex-direction: column; }

.news-row-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.25s var(--ease);
}

.news-row-item:hover,
.news-row-item.active {
  background: rgba(61, 90, 128, 0.06);
}

.news-row-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(168, 135, 61, 0.35);
  color: var(--gold);
  background: var(--gold-soft);
  white-space: nowrap;
  font-weight: 700;
}

.news-row-title {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 600;
}

.news-row-date {
  color: var(--muted);
  font-size: 12px;
}

/* Kingdoms — unified palette */
.kingdoms-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.kingdom-card {
  position: relative;
  min-height: 410px;
  overflow: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

.kingdom-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,253,248,0.15) 0%, rgba(247,243,234,0.55) 48%, rgba(247,243,234,0.96) 100%);
  z-index: 1;
}

.kingdom-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  transition: transform 0.7s var(--ease), opacity 0.35s var(--ease);
}

.kingdom-card-bg.placeholder-art {
  opacity: 1;
  min-height: 100%;
  border-radius: 0;
}

.kingdom-card:hover {
  transform: translateY(-6px);
  border-color: rgba(168, 135, 61, 0.45);
  box-shadow: 0 20px 40px rgba(61, 78, 102, 0.14);
}

.kingdom-card:hover .kingdom-card-bg {
  transform: scale(1.04);
  opacity: 0.85;
}

.kc-top,
.kc-bottom { position: relative; z-index: 2; }

.kc-num {
  font-family: var(--font-display);
  font-size: 34px;
  color: rgba(61, 90, 128, 0.22);
}

.kc-code {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(61, 90, 128, 0.22);
  background: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  color: var(--accent-deep);
  font-weight: 700;
}

.kc-race {
  display: block;
  color: var(--gold);
  font-size: 13px;
  margin-bottom: 4px;
  font-family: var(--font-serif);
  font-style: italic;
}

.kc-name {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 6px;
  color: var(--ink);
}

.kc-lore {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.kc-summary {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.kc-dist-bar {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  font-size: 12px;
  margin-bottom: 12px;
  color: var(--ink-soft);
}

.kc-enter-btn {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

/* Models / showcase */
.model-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.model-card {
  overflow: hidden;
  transition: transform 0.35s var(--ease);
}

.model-card:hover { transform: translateY(-4px); }

.model-label {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
}

.model-label strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--ink);
}

.model-label span {
  color: var(--muted);
  font-size: 13px;
}

/* Map */
.map-panel { padding: 24px; }

.world-svg {
  width: 100%;
  height: auto;
  display: block;
  background: linear-gradient(180deg, rgba(232, 240, 248, 0.7), rgba(247, 243, 234, 0.9));
  border-radius: 16px;
  border: 1px solid var(--line);
}

.map-node { cursor: pointer; transition: opacity 0.25s var(--ease); }
.map-node:hover { opacity: 0.85; }

.zone-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.zone-legend div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
}

.zone-legend b {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--ink);
}

.zone-legend span {
  color: var(--muted);
  font-size: 13px;
}

/* About */
.loop-banner {
  padding: 28px;
  margin-bottom: 24px;
  background:
    linear-gradient(135deg, rgba(61, 90, 128, 0.12), rgba(168, 135, 61, 0.12)),
    rgba(255, 253, 248, 0.9);
}

.loop-banner h2 {
  font-family: var(--font-display);
  font-size: 28px;
  margin-bottom: 18px;
  color: var(--ink);
}

.loop-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.loop-steps div {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
}

.loop-steps span {
  display: block;
  color: var(--gold);
  font-family: var(--font-display);
  margin-bottom: 6px;
}

.loop-steps strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.loop-steps p {
  color: var(--muted);
  font-size: 14px;
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.sys-card {
  padding: 24px;
  transition: transform 0.3s var(--ease);
}

.sys-card:hover { transform: translateY(-3px); }

.sys-card h3 {
  font-family: var(--font-serif);
  font-size: 26px;
  margin-bottom: 10px;
  color: var(--ink);
}

.sys-card p {
  color: var(--muted);
  line-height: 1.55;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery figure {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
  transition: transform 0.35s var(--ease);
}

.gallery figure:hover { transform: translateY(-4px); }

.gallery img,
.gallery .placeholder-art {
  width: 100%;
  height: 210px;
  object-fit: cover;
  min-height: 210px;
}

.gallery figcaption {
  padding: 12px 14px;
  color: var(--muted);
}

/* Kingdom detail */
.kingdom-detail { padding: 48px 0 90px; }

.kd-back-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.kd-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kd-switch-pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  font-weight: 600;
}

.kd-switch-pill:hover,
.kd-switch-pill.active {
  color: var(--accent-deep);
  border-color: rgba(61, 90, 128, 0.35);
  background: #fff;
}

.kd-hero-banner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(168, 135, 61, 0.28);
  background: rgba(255, 253, 248, 0.9);
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.kd-hero-text { padding: 36px; }

.kd-motto {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 28px;
  color: var(--accent-deep);
  margin: 12px 0 16px;
}

.kd-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.kd-badge {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  color: var(--ink-soft);
}

.kd-hero-art {
  min-height: 340px;
  border-left: 1px solid var(--line);
  background: linear-gradient(160deg, #e7eff7, #f4efe4);
  display: grid;
}

.kd-hero-art img,
.kd-hero-art .placeholder-art {
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
}

.kd-summary {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.6;
}

.kd-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.kd-panel { padding: 24px; }

.kd-panel h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 8px 0 10px;
  color: var(--ink);
}

.kd-panel p,
.kd-class-card p {
  color: var(--muted);
  line-height: 1.55;
}

.kd-classes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kd-class-card { padding: 22px; }

.kd-class-role {
  display: block;
  color: var(--gold);
  font-size: 12px;
  margin-bottom: 6px;
  font-weight: 700;
}

.kd-class-card h4 {
  font-family: var(--font-serif);
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--ink);
}

.kd-class-weapon {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid rgba(168, 135, 61, 0.28);
  color: #7d652c;
  font-size: 12px;
  font-weight: 600;
}

.kd-res-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.kd-res-item {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.kd-res-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  color: var(--ink);
}

.kd-res-rate {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.kd-res-rate.abundant {
  background: rgba(46, 110, 74, 0.12);
  color: #2e6e4a;
}

.kd-res-rate.scarce {
  background: rgba(139, 58, 58, 0.12);
  color: #8b3a3a;
}

.kd-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.stamped-header { margin: 10px 0 18px; }

.stamped-index {
  display: block;
  color: var(--gold);
  font-family: var(--font-serif);
  font-style: italic;
  margin-bottom: 4px;
}

.stamped-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 34px);
  color: var(--ink);
}

.mono-tag {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

.asset-card { overflow: hidden; }

.asset-card img,
.asset-card .placeholder-art {
  width: 100%;
  height: 200px;
  min-height: 200px;
  object-fit: cover;
}

.asset-card figcaption { padding: 12px 14px; color: var(--muted); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(42, 48, 58, 0.45);
  backdrop-filter: blur(8px);
}

.modal-backdrop.open { display: grid; }

.modal-card {
  width: min(700px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 28px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
  animation: pageIn 0.35s var(--ease);
}

.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  color: var(--muted);
}

.modal-close {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.modal-img,
.modal-placeholder {
  width: 100%;
  height: 250px;
  min-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 14px;
  background: linear-gradient(160deg, #e7eff7, #f4efe4);
}

.modal-card h2 {
  font-family: var(--font-serif);
  font-size: 30px;
  margin: 10px 0;
  color: var(--ink);
}

.modal-card p {
  color: var(--muted);
  line-height: 1.65;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.7);
  padding: 28px 0 36px;
  position: relative;
  z-index: 2;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-brand strong {
  font-family: var(--font-display);
  color: var(--ink);
}

.footer-brand span,
.footer-note {
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 16px;
  color: var(--muted);
}

.footer-links a:hover { color: var(--accent); }

@media (max-width: 1100px) {
  .hero-layout,
  .news-layout,
  .kd-hero-banner,
  .kd-two-col,
  .systems-grid {
    grid-template-columns: 1fr;
  }

  .kingdoms-grid,
  .model-grid,
  .loop-steps,
  .kd-classes-grid,
  .gallery,
  .zone-legend {
    grid-template-columns: 1fr 1fr;
  }

  .side-marks { display: none; }
}

@media (max-width: 720px) {
  .menu { display: none; }

  .hero-stats,
  .kingdoms-grid,
  .model-grid,
  .loop-steps,
  .kd-classes-grid,
  .gallery,
  .zone-legend,
  .stage-links {
    grid-template-columns: 1fr;
  }
}
