:root {
  --bg-0: #071016;
  --bg-1: #0c1822;
  --bg-2: #132734;
  --panel: rgba(12, 21, 30, 0.54);
  --panel-soft: rgba(19, 31, 42, 0.5);
  --panel-strong: rgba(10, 17, 25, 0.72);
  --line: rgba(233, 241, 245, 0.1);
  --line-strong: rgba(233, 241, 245, 0.18);
  --text: #eef4f6;
  --muted: #8ea6b2;
  --warm: #d3aa6a;
  --warm-2: #f4c98d;
  --red: #c96d57;
  --teal: #63c19c;
  --blue: #7288db;
  --violet: #8f7fd5;
  --shadow: 0 32px 70px rgba(0, 0, 0, 0.46);
  --glow: 0 0 30px rgba(211, 170, 106, 0.22);
  --hero-shadow: 0 28px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  overflow-x: hidden;
  transition: background 0.35s ease;
}

body.theme-cinematic {
  background:
    radial-gradient(circle at 50% -8%, rgba(211, 170, 106, 0.2), transparent 22%),
    radial-gradient(circle at 10% 18%, rgba(89, 114, 168, 0.14), transparent 26%),
    radial-gradient(circle at 90% 26%, rgba(143, 127, 213, 0.12), transparent 22%),
    linear-gradient(180deg, #183140 0%, var(--bg-2) 16%, var(--bg-1) 52%, var(--bg-0) 100%);
}

body.theme-commercial {
  --panel: rgba(17, 32, 44, 0.54);
  --panel-soft: rgba(27, 46, 61, 0.46);
  --panel-strong: rgba(10, 20, 28, 0.68);
  --line: rgba(240, 246, 249, 0.12);
  --line-strong: rgba(240, 246, 249, 0.22);
  --muted: #86a8b9;
  --warm: #ffb85f;
  --warm-2: #ffe39b;
  --red: #ff7565;
  --teal: #55d4ae;
  --blue: #5c93ff;
  --violet: #9186ff;
  background:
    radial-gradient(circle at 50% -6%, rgba(255, 184, 95, 0.32), transparent 24%),
    radial-gradient(circle at 8% 22%, rgba(92, 147, 255, 0.22), transparent 22%),
    radial-gradient(circle at 92% 26%, rgba(145, 134, 255, 0.18), transparent 22%),
    linear-gradient(180deg, #20485f 0%, #153042 20%, #0c1c29 56%, #09131c 100%);
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.route-badge:hover,
.spire-node:hover {
  transform: translate(-50%, -50%);
}

.page-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.page-atmosphere::before,
.page-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
}

body.theme-cinematic .page-atmosphere::before {
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(255, 255, 255, 0.02) 48% 52%, transparent 52%),
    linear-gradient(0deg, transparent 0 48%, rgba(255, 255, 255, 0.015) 48% 52%, transparent 52%);
  background-size: 120px 120px;
  mask-image: radial-gradient(circle at center, black 18%, transparent 78%);
  opacity: 0.28;
}

body.theme-commercial .page-atmosphere::before {
  background:
    linear-gradient(90deg, transparent 0 47%, rgba(255, 255, 255, 0.026) 47% 53%, transparent 53%),
    linear-gradient(0deg, transparent 0 47%, rgba(255, 255, 255, 0.02) 47% 53%, transparent 53%);
  background-size: 92px 92px;
  mask-image: radial-gradient(circle at center, black 22%, transparent 78%);
  opacity: 0.34;
}

.page-atmosphere::after {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, transparent 0%, black 25%, black 72%, transparent 100%);
  opacity: 0.25;
}

body.theme-commercial .page-atmosphere::after {
  opacity: 0.34;
}

.fog,
.grid-glow {
  position: absolute;
  border-radius: 50%;
}

.fog-a {
  width: 460px;
  height: 460px;
  top: -100px;
  left: -50px;
  background: radial-gradient(circle, rgba(211, 170, 106, 0.18), transparent 72%);
  filter: blur(26px);
}

.fog-b {
  width: 560px;
  height: 560px;
  top: 60px;
  right: -120px;
  background: radial-gradient(circle, rgba(111, 121, 205, 0.14), transparent 72%);
  filter: blur(34px);
}

body.theme-commercial .fog-a {
  background: radial-gradient(circle, rgba(255, 184, 95, 0.26), transparent 72%);
}

body.theme-commercial .fog-b {
  background: radial-gradient(circle, rgba(92, 147, 255, 0.2), transparent 72%);
}

.grid-glow {
  width: 980px;
  height: 980px;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.015) 28%, transparent 70%);
  filter: blur(24px);
}

body.theme-commercial .grid-glow {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 32%, transparent 70%);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 26px;
  min-height: 100dvh;
}

.game-frame {
  position: relative;
  border-radius: 34px;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 12%),
    linear-gradient(135deg, rgba(211, 170, 106, 0.05), transparent 30%),
    rgba(5, 10, 14, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  min-height: calc(100dvh - 52px);
}

body.theme-commercial .game-frame {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 12%),
    linear-gradient(135deg, rgba(255, 184, 95, 0.08), rgba(92, 147, 255, 0.05) 38%, transparent 62%),
    rgba(6, 12, 18, 0.48);
}

.game-frame::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.game-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 62%, rgba(255, 255, 255, 0.035) 62% 64%, transparent 64%),
    radial-gradient(circle at 84% 8%, rgba(255, 255, 255, 0.06), transparent 16%);
  pointer-events: none;
}

.topbar,
.status-panel,
.main-layout {
  display: grid;
  gap: 16px;
}

.topbar {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 10px 8px 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: var(--warm-2);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.12em;
  border: 1px solid rgba(211, 170, 106, 0.28);
  background:
    radial-gradient(circle at 30% 30%, rgba(244, 201, 141, 0.22), transparent 46%),
    linear-gradient(145deg, rgba(211, 170, 106, 0.16), rgba(211, 170, 106, 0.04)),
    rgba(255, 255, 255, 0.03);
  box-shadow: 0 0 32px rgba(211, 170, 106, 0.16);
}

body.theme-commercial .brand-mark {
  border-color: rgba(255, 184, 95, 0.4);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 227, 155, 0.26), transparent 44%),
    linear-gradient(145deg, rgba(255, 184, 95, 0.22), rgba(92, 147, 255, 0.08)),
    rgba(255, 255, 255, 0.04);
  box-shadow:
    0 0 34px rgba(255, 184, 95, 0.2),
    0 0 60px rgba(92, 147, 255, 0.1);
}

.brand-kicker,
.scene-kicker,
.card-topline {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.brand h1,
.scene-heading h2 {
  margin: 4px 0 8px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 0.94;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow:
    0 2px 0 rgba(18, 27, 36, 0.88),
    0 4px 0 rgba(18, 27, 36, 0.72),
    0 12px 28px rgba(0, 0, 0, 0.32);
}

.brand-summary {
  margin: 0;
  color: #dde7eb;
  font-size: 14px;
  letter-spacing: 0.06em;
}

body.theme-commercial .brand-summary {
  color: #eef5ff;
}

.topbar-side {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.theme-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-chip {
  padding: 10px 14px;
  border-radius: 999px;
  color: #d8e4e8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.theme-chip.active {
  color: #151d23;
  background: linear-gradient(135deg, var(--warm), var(--warm-2));
  box-shadow: 0 8px 18px rgba(211, 170, 106, 0.22);
}

body.theme-commercial .theme-chip.active {
  background: linear-gradient(135deg, #ffb85f, #ffe39b);
}

.currency-panel {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.currency-panel span,
.ghost-button,
.primary-button,
.secondary-button,
.danger-button,
.chip,
.scene-badge {
  border-radius: 999px;
  border: 1px solid var(--line);
}

.currency-panel span {
  padding: 11px 17px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.ghost-button {
  padding: 10px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.status-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-card,
.card,
.scene-panel {
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-card {
  padding: 16px 18px;
  display: grid;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 55%),
    rgba(14, 24, 33, 0.44);
  backdrop-filter: blur(8px);
}

body.theme-commercial .status-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 55%),
    rgba(20, 35, 47, 0.42);
}

.status-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.status-label {
  color: var(--muted);
  font-size: 13px;
}

.status-text {
  color: #dfe8eb;
  font-size: 13px;
}

.status-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.status-fill {
  height: 100%;
  width: 50%;
  border-radius: inherit;
  transition: width 0.3s ease;
}

.status-fill.hp { background: linear-gradient(90deg, #2b9d68, var(--teal)); }
.status-fill.hunger { background: linear-gradient(90deg, #b7863d, var(--warm)); }
.status-fill.sanity { background: linear-gradient(90deg, #5367c9, var(--blue)); }

.main-layout {
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, 350px);
  align-items: stretch;
}

.scene-panel {
  position: relative;
  overflow: hidden;
  padding: 24px;
  min-height: 860px;
  background:
    radial-gradient(circle at top center, rgba(211, 170, 106, 0.11), transparent 22%),
    linear-gradient(180deg, rgba(24, 36, 48, 0.42), rgba(8, 14, 20, 0.58)),
    rgba(8, 14, 20, 0.4);
}

body.theme-commercial .scene-panel {
  background:
    radial-gradient(circle at top center, rgba(255, 184, 95, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(22, 44, 61, 0.38), rgba(9, 18, 26, 0.58)),
    rgba(8, 14, 20, 0.36);
}

.scene-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 16%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 24%),
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px);
  background-size: auto, auto, 18px 18px;
  pointer-events: none;
}

.hero-layer {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}

.hero-poster {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(220px, 320px);
  gap: 20px;
  min-height: 286px;
  padding: 28px;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(211, 170, 106, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(22, 34, 45, 0.96), rgba(8, 13, 20, 0.88));
  box-shadow: var(--hero-shadow);
  isolation: isolate;
}

body.theme-commercial .hero-poster {
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 227, 155, 0.22), transparent 16%),
    linear-gradient(135deg, rgba(255, 184, 95, 0.2), rgba(92, 147, 255, 0.12) 42%, transparent 76%),
    linear-gradient(180deg, rgba(26, 50, 67, 0.96), rgba(8, 14, 20, 0.88));
}

.hero-poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 28%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 8px, transparent 8px 18px);
  mix-blend-mode: screen;
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.hero-poster::after {
  content: "";
  position: absolute;
  inset: auto -40px -80px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.06), transparent 58%);
  pointer-events: none;
  z-index: 0;
}

.hero-poster-copy {
  position: relative;
  z-index: 2;
  align-self: end;
}

.hero-tagline {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #f4fbff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(114, 130, 219, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-poster h3 {
  margin: 0 0 14px;
  max-width: 620px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  text-shadow:
    0 2px 0 rgba(16, 24, 32, 0.9),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.hero-poster p {
  margin: 0;
  max-width: 520px;
  color: #dbe7ec;
  line-height: 1.72;
}

.hero-poster-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.poster-sun {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 209, 137, 0.86) 0%, rgba(211, 170, 106, 0.42) 26%, transparent 64%);
  filter: blur(1px);
  opacity: 0.85;
}

body.theme-commercial .poster-sun {
  background:
    radial-gradient(circle, rgba(255, 227, 155, 0.96) 0%, rgba(255, 184, 95, 0.5) 28%, transparent 66%);
}

.poster-train {
  position: relative;
  width: 220px;
  height: 220px;
  transform: translateY(10px);
}

.poster-train::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 34px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  opacity: 0.62;
  transform: perspective(120px) rotateX(58deg);
}

.poster-train::after {
  content: "";
  position: absolute;
  left: 38px;
  right: 30px;
  bottom: 26px;
  height: 24px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.24), transparent);
  filter: blur(8px);
}

.poster-train span {
  position: absolute;
  display: block;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.18);
}

.poster-train span:nth-child(1) {
  left: 46px;
  right: 40px;
  bottom: 54px;
  height: 26px;
  border-radius: 10px 14px 10px 10px;
}

.poster-train span:nth-child(2) {
  left: 70px;
  right: 66px;
  bottom: 82px;
  height: 32px;
  border-radius: 12px 14px 6px 6px;
}

.poster-train span:nth-child(3) {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  left: 74px;
  bottom: 44px;
  box-shadow:
    64px 0 0 rgba(255, 255, 255, 0.94),
    0 0 18px rgba(255, 255, 255, 0.18);
}

.scene-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.scene-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.scene-ring-a {
  width: 380px;
  height: 380px;
  right: -80px;
  top: 220px;
  box-shadow: 0 0 80px rgba(211, 170, 106, 0.08);
}

.scene-ring-b {
  width: 640px;
  height: 640px;
  left: -160px;
  bottom: -220px;
}

.scene-track {
  position: absolute;
  right: 34px;
  top: 380px;
  display: grid;
  gap: 18px;
}

.scene-track span {
  display: block;
  width: 160px;
  height: 2px;
  background: linear-gradient(90deg, rgba(211, 170, 106, 0.5), transparent);
  position: relative;
}

body.theme-commercial .scene-track span {
  background: linear-gradient(90deg, rgba(255, 184, 95, 0.75), rgba(92, 147, 255, 0.14), transparent);
}

.scene-track span::after {
  content: "";
  position: absolute;
  right: 28px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.24);
}

.scene-signal {
  position: absolute;
  right: 84px;
  bottom: 90px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(211, 170, 106, 0.16), transparent 55%);
  filter: blur(8px);
}

body.theme-commercial .scene-signal {
  background: radial-gradient(circle, rgba(92, 147, 255, 0.18), transparent 58%);
}

.scene-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.scene-heading h2 {
  font-size: clamp(30px, 3.8vw, 44px);
}

.scene-badge {
  padding: 10px 16px;
  color: #d5e1e5;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
}

.scene {
  display: none;
  position: relative;
  z-index: 1;
}

.scene.active {
  display: block;
}

body.home-mode .status-panel,
body.home-mode .side-panel {
  display: none;
}

body.home-mode .main-layout {
  grid-template-columns: 1fr;
}

body.home-mode .scene-panel {
  min-height: 900px;
}

body.home-mode .scene-header {
  align-items: center;
}

.train-layout,
.side-panel {
  display: grid;
  gap: 16px;
}

.train-banner,
.event-card,
.shop-list,
.map-wrap,
.battle-status,
.minigame-card,
.summary-card {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.train-banner {
  position: relative;
  overflow: hidden;
  padding: 28px;
  background:
    radial-gradient(circle at 88% 20%, rgba(244, 201, 141, 0.22), transparent 18%),
    linear-gradient(135deg, rgba(211, 170, 106, 0.16), rgba(255, 255, 255, 0.02) 45%, transparent 72%),
    linear-gradient(180deg, rgba(26, 42, 56, 0.92), rgba(13, 21, 30, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.theme-commercial .train-banner {
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 227, 155, 0.2), transparent 16%),
    linear-gradient(135deg, rgba(255, 184, 95, 0.16), rgba(92, 147, 255, 0.08) 45%, transparent 72%),
    linear-gradient(180deg, rgba(30, 53, 70, 0.92), rgba(13, 21, 30, 0.76));
}

.train-banner,
.event-card,
.shop-item,
.summary-card,
.card,
.route-layer,
.route-node,
.status-card,
.modal,
.battle-status,
.minigame-card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 42px rgba(0, 0, 0, 0.22);
}

.train-banner::before {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 1px solid rgba(211, 170, 106, 0.12);
}

.train-banner::after {
  content: "";
  position: absolute;
  left: 28px;
  bottom: 24px;
  width: 220px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(211, 170, 106, 0.8), transparent);
  opacity: 0.45;
}

.train-banner h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  max-width: 720px;
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.12;
}

.train-banner p,
.event-card p,
.hint-text,
.shop-item p,
.battle-log p,
.action-hint,
.summary-card p {
  margin: 0;
  color: #a8bbc2;
  line-height: 1.68;
}

.home-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
  border-radius: 999px;
  color: #f5fbff;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.home-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warm-2);
  box-shadow: 0 0 14px rgba(244, 201, 141, 0.6);
}

.home-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.home-play-button,
.home-secondary-button {
  font: inherit;
  border: 0;
  cursor: pointer;
}

.home-play-button {
  min-width: 190px;
  padding: 16px 26px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 800;
  color: #141c23;
  background: linear-gradient(135deg, #ffb85f, #ffe39b);
  box-shadow:
    0 16px 28px rgba(255, 184, 95, 0.24),
    0 0 30px rgba(255, 184, 95, 0.14);
}

.home-secondary-button {
  min-width: 104px;
  padding: 14px 18px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.home-feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feature-pill {
  padding: 16px 18px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 50%),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.feature-pill span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.feature-pill strong {
  font-size: 18px;
}

.train-grid,
.train-meta,
.difficulty-row,
.action-panel,
.inventory-panel,
.shop-item-actions,
.battle-actions,
.choice-grid {
  display: grid;
  gap: 12px;
}

.train-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-panel-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.8fr;
  gap: 14px;
}

.train-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.event-card,
.shop-item,
.summary-card {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 50%),
    rgba(15, 26, 36, 0.46);
  backdrop-filter: blur(8px);
}

body.theme-commercial .event-card,
body.theme-commercial .shop-item,
body.theme-commercial .summary-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 50%),
    rgba(18, 34, 47, 0.44);
}

.event-card strong,
.shop-item h4,
.summary-card h4,
.battle-status h3,
.minigame-card h3 {
  display: block;
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.run-card,
.upgrade-card,
.info-card {
  min-height: 100%;
}

.mini-tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.mini-tag {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: #eff6f9;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.meta-box {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

body.theme-commercial .meta-box {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.04);
}

.meta-box::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 54px;
  height: 54px;
  background: radial-gradient(circle, rgba(211, 170, 106, 0.16), transparent 70%);
}

body.theme-commercial .meta-box::after {
  background: radial-gradient(circle, rgba(92, 147, 255, 0.18), transparent 70%);
}

.meta-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.meta-box strong {
  font-size: clamp(26px, 3vw, 36px);
}

.chip-row,
.difficulty-row,
.shop-list,
.battle-actions {
  display: flex;
  flex-wrap: wrap;
}

.chip,
.primary-button,
.secondary-button,
.danger-button,
.difficulty-button,
.shop-button,
.choice-button {
  padding: 12px 18px;
}

.chip {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(114, 130, 219, 0.08));
  color: #d8e4e8;
  font-size: 13px;
}

.primary-button,
.difficulty-button {
  background: linear-gradient(135deg, #d4935a, #f3cf95);
  color: #141b21;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(212, 147, 90, 0.2);
}

body.theme-commercial .primary-button,
body.theme-commercial .difficulty-button {
  background: linear-gradient(135deg, #ffb75f, #ffe39b);
  box-shadow:
    0 14px 28px rgba(255, 184, 95, 0.22),
    0 0 24px rgba(92, 147, 255, 0.08);
}

.secondary-button,
.shop-button,
.choice-button {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(81, 103, 126, 0.12);
  border: 1px solid rgba(123, 146, 170, 0.2);
}

body.theme-commercial .secondary-button,
body.theme-commercial .shop-button,
body.theme-commercial .choice-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
    rgba(83, 120, 170, 0.14);
}

.danger-button {
  color: #f7dfda;
  background:
    linear-gradient(180deg, rgba(201, 109, 87, 0.18), rgba(201, 109, 87, 0.08)),
    rgba(159, 65, 52, 0.16);
  border: 1px solid rgba(213, 110, 92, 0.24);
}

.difficulty-button.locked {
  opacity: 0.52;
  cursor: not-allowed;
}

.side-panel {
  align-content: start;
  padding-top: 338px;
}

.card {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 18%),
    rgba(7, 13, 19, 0.3);
  backdrop-filter: blur(4px);
}

.command-card {
  background:
    linear-gradient(180deg, rgba(211, 170, 106, 0.04), transparent 24%),
    rgba(7, 13, 19, 0.28);
}

.inventory-card {
  background:
    linear-gradient(180deg, rgba(114, 130, 219, 0.05), transparent 22%),
    rgba(7, 13, 19, 0.28);
}

.log-card {
  background:
    linear-gradient(180deg, rgba(99, 193, 156, 0.04), transparent 22%),
    rgba(7, 13, 19, 0.28);
}

body.theme-commercial .card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    rgba(11, 20, 29, 0.26);
}

.card-title {
  margin-bottom: 14px;
  font-size: 20px;
  font-weight: 700;
}

.action-panel button,
.inventory-item,
.log-entry {
  width: 100%;
}

.inventory-item,
.log-entry {
  padding: 13px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.inventory-item strong,
.log-entry strong {
  display: block;
  margin-bottom: 6px;
}

.log-panel {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.route-map {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.route-layer {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px 14px 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 40%),
    rgba(255, 255, 255, 0.02);
}

body.theme-commercial .route-layer {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 40%),
    rgba(255, 255, 255, 0.025);
}

.route-layer::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 45px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
}

.route-layer-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.route-node-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.route-node {
  position: relative;
  min-width: 108px;
  min-height: 102px;
  padding: 14px 12px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 38%),
    rgba(49, 64, 78, 0.2);
  color: var(--text);
  display: grid;
  place-items: center;
  gap: 6px;
  overflow: hidden;
}

.route-node::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 52%);
  pointer-events: none;
}

.route-node span {
  position: relative;
  z-index: 1;
  font-size: 30px;
  font-weight: 800;
}

.route-node small {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: #d1dde1;
}

.route-node.selectable {
  border-color: rgba(211, 170, 106, 0.52);
  box-shadow: 0 0 0 1px rgba(211, 170, 106, 0.15) inset;
  cursor: pointer;
}

body.theme-commercial .route-node.selectable {
  border-color: rgba(255, 184, 95, 0.62);
  box-shadow:
    0 0 0 1px rgba(255, 184, 95, 0.16) inset,
    0 0 22px rgba(92, 147, 255, 0.07);
}

.route-node.selectable:hover {
  transform: translateY(-4px) scale(1.01);
}

.route-node.current {
  box-shadow:
    0 0 0 1px rgba(211, 170, 106, 0.18) inset,
    0 18px 34px rgba(211, 170, 106, 0.14);
}

body.theme-commercial .route-node.current {
  box-shadow:
    0 0 0 1px rgba(255, 184, 95, 0.18) inset,
    0 20px 36px rgba(92, 147, 255, 0.14);
}

.route-node small {
  text-shadow: 0 1px 0 rgba(8, 12, 18, 0.8);
}

.route-node.visited {
  opacity: 0.72;
}

.route-node.battle {
  background:
    radial-gradient(circle at top, rgba(215, 128, 84, 0.16), transparent 38%),
    rgba(205, 118, 73, 0.12);
}

.route-node.elite {
  background:
    radial-gradient(circle at top, rgba(201, 109, 87, 0.18), transparent 38%),
    rgba(172, 73, 63, 0.18);
}

.route-node.event {
  background:
    radial-gradient(circle at top, rgba(114, 130, 219, 0.18), transparent 38%),
    rgba(93, 107, 183, 0.16);
}

.route-node.camp {
  background:
    radial-gradient(circle at top, rgba(99, 193, 156, 0.16), transparent 38%),
    rgba(92, 145, 112, 0.14);
}

.route-node.shop {
  background:
    radial-gradient(circle at top, rgba(211, 170, 106, 0.18), transparent 38%),
    rgba(185, 157, 84, 0.14);
}

.route-node.chest {
  background:
    radial-gradient(circle at top, rgba(165, 183, 210, 0.16), transparent 38%),
    rgba(112, 130, 155, 0.14);
}

.route-node.boss {
  background:
    radial-gradient(circle at top, rgba(201, 109, 87, 0.22), transparent 42%),
    rgba(119, 51, 47, 0.26);
}

.map-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.legend-item {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.legend-item.battle { border-color: rgba(205, 118, 73, 0.3); }
.legend-item.elite { border-color: rgba(172, 73, 63, 0.38); }
.legend-item.event { border-color: rgba(93, 107, 183, 0.34); }
.legend-item.camp { border-color: rgba(92, 145, 112, 0.32); }
.legend-item.shop { border-color: rgba(185, 157, 84, 0.34); }
.legend-item.chest { border-color: rgba(112, 130, 155, 0.3); }
.legend-item.boss { border-color: rgba(119, 51, 47, 0.42); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 11, 0.82);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}

.modal {
  width: min(640px, 100%);
  max-height: min(88dvh, 960px);
  background:
    radial-gradient(circle at top, rgba(211, 170, 106, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(29, 42, 56, 0.98), rgba(8, 13, 20, 0.98));
  border: 1px solid var(--line-strong);
  border-radius: 30px;
  box-shadow: 0 36px 64px rgba(0, 0, 0, 0.54);
  padding: 24px;
  overflow: auto;
}

body.theme-commercial .modal {
  background:
    radial-gradient(circle at top, rgba(255, 184, 95, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(31, 50, 66, 0.98), rgba(8, 13, 20, 0.98));
}

.modal-header h3,
.card-title,
.train-banner h3,
.hero-poster h3 {
  font-weight: 800;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0;
  font-size: 30px;
}

.battle-status,
.minigame-card {
  padding: 18px;
  margin-bottom: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 48%),
    rgba(255, 255, 255, 0.02);
}

.battle-meters {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.meter-line {
  display: grid;
  gap: 8px;
}

.meter-line strong {
  font-size: 14px;
}

.battle-log {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.choice-grid {
  grid-template-columns: 1fr;
}

.summary-card {
  min-height: 110px;
}

.mobile-home {
  min-height: 700px;
  display: grid;
  align-content: space-between;
  gap: 28px;
  padding-top: 10px;
}

.mobile-home-visual {
  position: relative;
  min-height: 480px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  padding: 34px 32px;
  border-radius: 32px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 18%),
    linear-gradient(135deg, rgba(255, 184, 95, 0.16), rgba(92, 147, 255, 0.08) 42%, transparent 72%),
    rgba(10, 18, 26, 0.46);
  box-shadow: 0 34px 70px rgba(0, 0, 0, 0.34);
}

body.theme-cinematic .mobile-home-visual {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    linear-gradient(135deg, rgba(211, 170, 106, 0.14), rgba(114, 130, 219, 0.06) 42%, transparent 72%),
    rgba(10, 18, 26, 0.46);
}

.mobile-home-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.08), transparent 20%),
    linear-gradient(125deg, transparent 0 58%, rgba(255, 255, 255, 0.04) 58% 61%, transparent 61%);
  pointer-events: none;
}

.mobile-home-copy {
  position: relative;
  z-index: 2;
  align-self: end;
}

.mobile-home-series {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
  color: #f5fbff;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.mobile-home-copy h3 {
  margin: 0 0 14px;
  font-size: clamp(54px, 8vw, 92px);
  line-height: 0.92;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow:
    0 3px 0 rgba(18, 27, 36, 0.9),
    0 10px 28px rgba(0, 0, 0, 0.36);
}

.mobile-home-copy p {
  max-width: 520px;
  margin: 0;
  color: #e0e9ed;
  font-size: 16px;
  line-height: 1.75;
}

.mobile-home-art {
  position: relative;
  min-height: 360px;
  z-index: 1;
}

.mobile-home-glow {
  position: absolute;
  left: -70px;
  bottom: -90px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 184, 95, 0.22), transparent 62%);
  filter: blur(20px);
}

body.theme-cinematic .mobile-home-glow {
  background: radial-gradient(circle, rgba(211, 170, 106, 0.18), transparent 62%);
}

.mobile-home-foreground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 180px;
  z-index: 3;
  pointer-events: none;
}

.mobile-home-foreground span {
  position: absolute;
  bottom: -16px;
  display: block;
  border-radius: 40px 40px 0 0;
  background: linear-gradient(180deg, rgba(19, 36, 50, 0.1), rgba(7, 13, 20, 0.78));
  filter: blur(0.2px);
}

.mobile-home-foreground span:nth-child(1) {
  left: -20px;
  width: 180px;
  height: 110px;
  transform: rotate(-5deg);
}

.mobile-home-foreground span:nth-child(2) {
  left: 120px;
  width: 240px;
  height: 84px;
  transform: rotate(3deg);
}

.mobile-home-foreground span:nth-child(3) {
  right: -30px;
  width: 220px;
  height: 130px;
  transform: rotate(-7deg);
}

.art-character {
  position: absolute;
  left: 12px;
  bottom: 18px;
  width: 250px;
  height: 320px;
  z-index: 2;
  animation: floatCharacter 5.5s ease-in-out infinite;
}

.character-aura {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(92, 147, 255, 0.2), transparent 68%);
  filter: blur(12px);
}

body.theme-cinematic .character-aura {
  background: radial-gradient(circle, rgba(211, 170, 106, 0.18), transparent 68%);
}

.character-silhouette {
  position: absolute;
  left: 34px;
  bottom: 18px;
  width: 170px;
  height: 270px;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.22));
}

.character-head,
.character-hair,
.character-body,
.character-coat,
.character-scarf {
  position: absolute;
  display: block;
}

.character-head {
  width: 58px;
  height: 58px;
  left: 54px;
  top: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 245, 238, 0.92), rgba(244, 223, 208, 0.86));
  box-shadow: 0 0 18px rgba(255, 245, 238, 0.08);
}

.character-hair {
  width: 82px;
  height: 78px;
  left: 42px;
  top: 4px;
  border-radius: 46px 46px 32px 34px;
  background: linear-gradient(180deg, #304a74, #1e2f4a);
  clip-path: polygon(12% 18%, 82% 2%, 100% 42%, 90% 94%, 12% 88%, 0% 44%);
}

.character-body {
  width: 76px;
  height: 112px;
  left: 44px;
  top: 70px;
  border-radius: 24px 24px 16px 16px;
  background: linear-gradient(180deg, #1c2a39, #111a24);
}

.character-coat {
  width: 150px;
  height: 170px;
  left: 8px;
  top: 96px;
  border-radius: 38px 24px 26px 34px;
  background: linear-gradient(180deg, rgba(55, 86, 130, 0.96), rgba(24, 37, 56, 0.98));
  clip-path: polygon(34% 0%, 70% 0%, 88% 12%, 100% 48%, 88% 100%, 18% 100%, 0% 56%, 10% 18%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
}

.character-scarf {
  width: 124px;
  height: 74px;
  left: 46px;
  top: 86px;
  background: linear-gradient(135deg, #ffb36c, #ffd78b);
  clip-path: polygon(0% 24%, 36% 0%, 62% 12%, 100% 0%, 74% 42%, 100% 72%, 58% 60%, 40% 100%, 24% 56%, 0% 48%);
  transform-origin: left center;
  animation: scarfWave 4.8s ease-in-out infinite;
  filter: drop-shadow(0 8px 12px rgba(255, 179, 108, 0.18));
}

body.theme-cinematic .character-scarf {
  background: linear-gradient(135deg, #d4935a, #f3cf95);
}

.art-moon {
  position: absolute;
  right: 40px;
  top: 18px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 231, 162, 0.92) 0%, rgba(255, 184, 95, 0.52) 30%, transparent 70%);
}

body.theme-cinematic .art-moon {
  background:
    radial-gradient(circle, rgba(244, 201, 141, 0.82) 0%, rgba(211, 170, 106, 0.42) 32%, transparent 72%);
}

.art-tracks {
  position: absolute;
  left: 24px;
  right: 16px;
  bottom: 52px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.88), transparent);
  transform: perspective(220px) rotateX(68deg);
  opacity: 0.8;
}

.art-tracks::before,
.art-tracks::after {
  content: "";
  position: absolute;
  top: -16px;
  width: 2px;
  height: 40px;
  background: rgba(255, 255, 255, 0.34);
}

.art-tracks::before {
  left: 22%;
}

.art-tracks::after {
  left: 68%;
}

.art-train {
  position: absolute;
  right: 48px;
  bottom: 68px;
  width: 230px;
  height: 170px;
  animation: trainBreath 4.8s ease-in-out infinite;
}

.art-train span {
  position: absolute;
  display: block;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.16);
}

.art-train span:nth-child(1) {
  left: 24px;
  right: 18px;
  bottom: 24px;
  height: 34px;
  border-radius: 12px 18px 12px 12px;
}

.art-train span:nth-child(2) {
  left: 50px;
  right: 54px;
  bottom: 58px;
  height: 38px;
  border-radius: 12px 14px 6px 6px;
}

.art-train span:nth-child(3) {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  left: 56px;
  bottom: 10px;
  box-shadow:
    86px 0 0 rgba(255, 255, 255, 0.96),
    0 0 16px rgba(255, 255, 255, 0.16);
}

.art-sparks {
  position: absolute;
  right: 10px;
  top: 42px;
  animation: pulseSpark 4s ease-in-out infinite;
}

.art-sparks i {
  position: absolute;
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.22);
}

.art-sparks i:nth-child(1) {
  right: 48px;
  top: 4px;
}

.art-sparks i:nth-child(2) {
  right: 18px;
  top: 44px;
}

.art-sparks i:nth-child(3) {
  right: 76px;
  top: 72px;
}

.art-petals {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.art-petals i {
  position: absolute;
  display: block;
  width: 14px;
  height: 10px;
  border-radius: 14px 14px 14px 2px;
  background: linear-gradient(135deg, rgba(255, 214, 168, 0.92), rgba(255, 170, 128, 0.74));
  opacity: 0.78;
  animation: petalDrift 9s linear infinite;
}

.art-petals i:nth-child(1) { left: 30%; top: 14%; animation-delay: -1s; }
.art-petals i:nth-child(2) { left: 56%; top: 10%; animation-delay: -4s; }
.art-petals i:nth-child(3) { left: 68%; top: 32%; animation-delay: -7s; }
.art-petals i:nth-child(4) { left: 48%; top: 44%; animation-delay: -2s; }
.art-petals i:nth-child(5) { left: 78%; top: 24%; animation-delay: -5s; }
.art-petals i:nth-child(6) { left: 22%; top: 40%; animation-delay: -8s; }

body.theme-cinematic .art-petals i {
  background: linear-gradient(135deg, rgba(244, 201, 141, 0.84), rgba(211, 147, 90, 0.72));
}

.art-stars {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.art-stars i {
  position: absolute;
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.24);
  animation: blinkStar 3.2s ease-in-out infinite;
}

.art-stars i:nth-child(1) { left: 42%; top: 20%; animation-delay: 0s; }
.art-stars i:nth-child(2) { left: 88%; top: 18%; animation-delay: 0.8s; }
.art-stars i:nth-child(3) { left: 82%; top: 46%; animation-delay: 1.6s; }
.art-stars i:nth-child(4) { left: 58%; top: 8%; animation-delay: 2.3s; }

.mobile-home-menu {
  display: grid;
  gap: 16px;
}

.mobile-start-button,
.mobile-ghost-button,
.mobile-menu-button {
  font: inherit;
  border: 0;
  cursor: pointer;
}

.mobile-start-button {
  min-height: 72px;
  border-radius: 999px;
  font-size: 22px;
  font-weight: 900;
  color: #141c23;
  background: linear-gradient(135deg, #ffb85f, #ffe39b);
  box-shadow:
    0 18px 30px rgba(255, 184, 95, 0.24),
    0 0 34px rgba(255, 184, 95, 0.12);
}

body.theme-cinematic .mobile-start-button {
  background: linear-gradient(135deg, #d4935a, #f3cf95);
  box-shadow:
    0 18px 30px rgba(212, 147, 90, 0.22),
    0 0 30px rgba(211, 170, 106, 0.1);
}

.mobile-ghost-button {
  min-height: 58px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-quick-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mobile-quick-pill {
  padding: 14px 16px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 48%),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-quick-pill span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mobile-quick-pill strong {
  font-size: 16px;
}

.mobile-bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 42%),
    rgba(7, 13, 19, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav-button {
  min-height: 88px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  border-radius: 20px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(83, 120, 170, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 14px;
  font-weight: 700;
}

.run-tree-card {
  overflow: hidden;
}

.run-tree-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.run-tree-header strong,
.run-build-card strong {
  font-size: 20px;
}

.run-tree-floor {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 999px;
  color: #17212a;
  background: linear-gradient(135deg, var(--warm), var(--warm-2));
  font-size: 12px;
  font-weight: 800;
}

.run-tree-map {
  position: relative;
  height: 470px;
  margin-top: 16px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 184, 95, 0.13), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02)),
    rgba(9, 16, 28, 0.72);
  border: 1px solid rgba(255,255,255,0.06);
}

.deep-tree-map {
  height: 560px;
}

.run-tree-map::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 100% 52px, 52px 100%;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.92), rgba(0,0,0,0.42));
}

.tree-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.tree-lines path {
  fill: none;
  stroke: rgba(177, 205, 255, 0.42);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(126, 150, 255, 0.24));
}

.tree-node-row {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 28px;
  z-index: 1;
}

.route-badge {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    radial-gradient(circle at 30% 26%, rgba(255,255,255,0.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03)),
    rgba(19, 29, 44, 0.96);
  box-shadow:
    0 10px 20px rgba(0,0,0,0.26),
    inset 0 0 0 1px rgba(255,255,255,0.04);
}

.deep-tree-map .route-badge {
  position: absolute;
}

.route-badge::before,
.route-badge::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.route-badge.selectable {
  border-color: rgba(255, 184, 95, 0.64);
  box-shadow:
    0 0 0 3px rgba(255, 184, 95, 0.18),
    0 0 26px rgba(255, 184, 95, 0.18),
    inset 0 0 0 1px rgba(255,255,255,0.04);
}

.route-badge.current {
  box-shadow:
    0 0 0 3px rgba(255,191,102,0.24),
    0 0 28px rgba(255,191,102,0.24),
    inset 0 0 0 1px rgba(255,255,255,0.04);
}

.route-badge.visited {
  opacity: 0.58;
  filter: grayscale(0.25);
}

.route-badge.locked-branch {
  opacity: 0.26;
  filter: grayscale(0.75);
  border-color: rgba(255,255,255,0.06);
  box-shadow: none;
}

.route-badge.elite {
  background:
    radial-gradient(circle at 30% 26%, rgba(255,255,255,0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 117, 101, 0.22), rgba(255,255,255,0.03)),
    rgba(42, 18, 26, 0.96);
}

.route-badge.camp {
  background:
    radial-gradient(circle at 30% 26%, rgba(255,255,255,0.14), transparent 34%),
    linear-gradient(180deg, rgba(104, 215, 204, 0.22), rgba(255,255,255,0.03)),
    rgba(13, 39, 41, 0.96);
}

.route-badge.boss {
  width: 70px;
  height: 70px;
  background:
    radial-gradient(circle at 30% 26%, rgba(255,255,255,0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 142, 173, 0.3), rgba(255,255,255,0.04)),
    rgba(40, 15, 31, 0.98);
}

.icon-sword::before {
  width: 10px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f5f7fb, #9cb8d8);
}

.icon-sword::after {
  width: 24px;
  height: 10px;
  top: 64%;
  border-radius: 8px;
  background: linear-gradient(90deg, #ffbf66, #ffe2a5);
}

.icon-event::before {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(180deg, #79d3ff, #6982ff);
  box-shadow: 0 0 0 5px rgba(126, 150, 255, 0.12);
}

.icon-event::after {
  width: 8px;
  height: 20px;
  top: 52%;
  border-radius: 10px;
  background: rgba(255,255,255,0.92);
}

.icon-shop::before {
  width: 28px;
  height: 18px;
  top: 56%;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, #ffbf66, #f08f4a);
}

.icon-shop::after {
  width: 34px;
  height: 10px;
  top: 38%;
  border-radius: 10px 10px 4px 4px;
  background: repeating-linear-gradient(90deg, #fff5ea 0 6px, #ff8ead 6px 12px);
}

.icon-elite::before {
  width: 30px;
  height: 30px;
  background: linear-gradient(180deg, #ff9f7e, #ff6666);
  clip-path: polygon(50% 0%, 62% 36%, 100% 40%, 72% 62%, 82% 100%, 50% 78%, 18% 100%, 28% 62%, 0% 40%, 38% 36%);
}

.icon-elite::after {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff6ef;
  box-shadow: -10px -4px 0 #fff6ef, 10px -4px 0 #fff6ef;
}

.icon-camp::before {
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 26px solid #78d7cc;
  top: 48%;
}

.icon-camp::after {
  width: 8px;
  height: 18px;
  top: 62%;
  border-radius: 6px;
  background: #ffd896;
}

.icon-chest::before {
  width: 30px;
  height: 20px;
  top: 58%;
  border-radius: 8px;
  background: linear-gradient(180deg, #cf8c4a, #8c5226);
}

.icon-chest::after {
  width: 32px;
  height: 10px;
  top: 40%;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #ffd68d, #ffb44a);
}

.icon-boss::before {
  width: 36px;
  height: 36px;
  background: linear-gradient(180deg, #ff7e8a, #b93d65);
  clip-path: polygon(50% 0%, 62% 14%, 78% 4%, 76% 26%, 100% 36%, 82% 52%, 88% 78%, 64% 76%, 50% 100%, 36% 76%, 12% 78%, 18% 52%, 0% 36%, 24% 26%, 22% 4%, 38% 14%);
}

.icon-boss::after {
  width: 18px;
  height: 8px;
  top: 56%;
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  box-shadow: -10px -10px 0 -1px rgba(255,255,255,0.92), 10px -10px 0 -1px rgba(255,255,255,0.92);
}

.route-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.route-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 10px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)),
    rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: #deeaef;
}

.legend-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
}

.legend-icon::before,
.legend-icon::after {
  transform: translate(-50%, -50%) scale(0.72);
}

.battle-shell {
  display: grid;
  gap: 14px;
}

.battle-head-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 142, 173, 0.14), transparent 20%),
    rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.battle-head-card h4 {
  margin: 2px 0 0;
  font-size: 22px;
}

.boss-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.boss-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7565, #ff9caf);
}

.battle-stage {
  position: relative;
  min-height: 260px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(255,117,101,0.16), transparent 28%),
    linear-gradient(180deg, rgba(43, 28, 48, 0.92), rgba(14, 19, 28, 0.92));
  border: 1px solid rgba(255,255,255,0.08);
}

.battle-streak {
  position: absolute;
  left: -40px;
  top: 86px;
  width: 220px;
  height: 8px;
  transform: rotate(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 142, 173, 0.7), transparent);
}

.battle-streak-b {
  left: auto;
  right: -40px;
  top: 148px;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(126, 150, 255, 0.7), transparent);
}

.battle-unit {
  position: relative;
  z-index: 1;
  width: 170px;
  height: 220px;
  display: grid;
  place-items: center;
}

.battle-fx {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 2;
  font-size: 42px;
  font-weight: 900;
  color: #ff8ead;
  text-shadow: 0 0 18px rgba(255, 142, 173, 0.34);
}

.enemy-figure,
.player-figure {
  position: relative;
  width: 150px;
  height: 210px;
}

.enemy-figure.boss .monster-core {
  position: absolute;
  left: 50%;
  top: 26px;
  width: 120px;
  height: 148px;
  transform: translateX(-50%);
  border-radius: 50% 50% 42% 42%;
  background:
    radial-gradient(circle at 50% 34%, rgba(255,255,255,0.1), transparent 28%),
    linear-gradient(180deg, #5c1432 0%, #240914 100%);
  box-shadow: 0 16px 34px rgba(0,0,0,0.28), inset 0 0 28px rgba(255, 118, 146, 0.12);
}

.enemy-figure.boss .monster-core::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 84px;
  height: 42px;
  transform: translateX(-50%);
  border-radius: 0 0 40px 40px;
  background: linear-gradient(180deg, #340e1f, #16050b);
}

.monster-crown {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 74px;
  height: 32px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ffd58c, #c86a4d);
  clip-path: polygon(0 100%, 12% 44%, 28% 62%, 38% 6%, 50% 56%, 62% 6%, 72% 62%, 88% 44%, 100% 100%);
}

.monster-horn {
  position: absolute;
  top: 10px;
  width: 42px;
  height: 66px;
  background: linear-gradient(180deg, #ff8e9f, #7b284c);
  clip-path: polygon(50% 0%, 100% 100%, 48% 76%, 0% 100%);
}

.monster-horn.left { left: 22px; transform: rotate(-16deg); }
.monster-horn.right { right: 22px; transform: rotate(16deg); }

.monster-mask {
  position: absolute;
  left: 50%;
  top: 76px;
  width: 84px;
  height: 50px;
  transform: translateX(-50%);
  border-radius: 24px 24px 20px 20px;
  background: rgba(19, 8, 16, 0.56);
}

.monster-eye {
  position: absolute;
  top: 92px;
  width: 20px;
  height: 12px;
  border-radius: 999px;
  background: #ffd4df;
  box-shadow: 0 0 14px rgba(255, 212, 223, 0.46);
}

.monster-eye.eye-left { left: 46px; }
.monster-eye.eye-right { right: 46px; }

.monster-claw {
  position: absolute;
  top: 146px;
  width: 32px;
  height: 54px;
  background: linear-gradient(180deg, #8a284e, #2d0c19);
  clip-path: polygon(50% 0%, 78% 24%, 100% 100%, 68% 72%, 52% 100%, 42% 70%, 18% 100%, 0% 26%);
}

.monster-claw.left { left: 8px; transform: rotate(-18deg); }
.monster-claw.right { right: 8px; transform: rotate(18deg); }

.monster-jaw {
  position: absolute;
  left: 50%;
  top: 132px;
  width: 52px;
  height: 24px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ffd9c8, #ff9070);
  clip-path: polygon(0 0, 100% 0, 92% 56%, 80% 100%, 64% 56%, 50% 100%, 36% 56%, 20% 100%, 8% 56%);
}

.enemy-figure.wolf .wolf-head,
.enemy-figure.wolf::before {
  position: absolute;
  left: 50%;
  top: 62px;
  width: 88px;
  height: 72px;
  transform: translateX(-50%);
  border-radius: 30px 30px 22px 22px;
  background: linear-gradient(180deg, #334761, #192433);
  content: "";
}

.wolf-ear {
  position: absolute;
  top: 38px;
  width: 34px;
  height: 42px;
  background: linear-gradient(180deg, #5d7aa4, #203248);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.wolf-ear.left { left: 28px; }
.wolf-ear.right { right: 28px; }

.wolf-eye {
  position: absolute;
  left: 50%;
  top: 94px;
  width: 34px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  box-shadow: -16px 0 0 rgba(255,255,255,0.92), 16px 0 0 rgba(255,255,255,0.92);
}

.wolf-snout {
  position: absolute;
  left: 50%;
  top: 112px;
  width: 30px;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 8px 8px 16px 16px;
  background: linear-gradient(180deg, #c8d4e8, #768aa6);
}

.wolf-fang {
  position: absolute;
  top: 130px;
  width: 7px;
  height: 15px;
  background: #fff5ea;
}

.wolf-fang.left { left: 68px; }
.wolf-fang.right { right: 68px; }

.enemy-figure.idol .idol-head {
  position: absolute;
  left: 50%;
  top: 42px;
  width: 92px;
  height: 112px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #837f88, #3f4551);
  clip-path: polygon(16% 0%, 84% 0%, 100% 18%, 100% 82%, 84% 100%, 16% 100%, 0% 82%, 0% 18%);
}

.idol-brow {
  position: absolute;
  left: 50%;
  top: 74px;
  width: 52px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(40, 44, 51, 0.7);
}

.idol-eye {
  position: absolute;
  top: 96px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffd896;
  box-shadow: 0 0 10px rgba(255, 216, 150, 0.4);
}

.idol-eye.left { left: 56px; }
.idol-eye.right { right: 56px; }

.idol-mark {
  position: absolute;
  left: 50%;
  top: 120px;
  width: 22px;
  height: 22px;
  transform: translateX(-50%) rotate(45deg);
  border: 2px solid rgba(255, 216, 150, 0.88);
}

.idol-base {
  position: absolute;
  left: 50%;
  bottom: 38px;
  width: 70px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 8px;
  background: linear-gradient(180deg, #5e6674, #333843);
}

.enemy-figure.wisp .wisp-body {
  position: absolute;
  left: 50%;
  top: 58px;
  width: 80px;
  height: 80px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #d6f7ff, #68d7cc 54%, #2f6d87 100%);
  box-shadow: 0 0 26px rgba(104, 215, 204, 0.38);
}

.wisp-ring {
  position: absolute;
  left: 50%;
  top: 48px;
  width: 102px;
  height: 102px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 2px solid rgba(214, 247, 255, 0.42);
}

.wisp-core {
  position: absolute;
  left: 50%;
  top: 94px;
  width: 28px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255,255,255,0.94);
  box-shadow: -12px 0 0 rgba(255,255,255,0.94), 12px 0 0 rgba(255,255,255,0.94);
}

.wisp-tail {
  position: absolute;
  left: 50%;
  top: 126px;
  width: 48px;
  height: 52px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(104, 215, 204, 0.9), rgba(104, 215, 204, 0));
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.enemy-figure.elite .elite-hood {
  position: absolute;
  left: 50%;
  top: 34px;
  width: 98px;
  height: 128px;
  transform: translateX(-50%);
  border-radius: 46px 46px 28px 28px;
  background: linear-gradient(180deg, #5c314a, #1c1324);
  clip-path: polygon(50% 0%, 84% 20%, 100% 68%, 78% 100%, 20% 100%, 0% 68%, 16% 20%);
}

.elite-face {
  position: absolute;
  left: 50%;
  top: 82px;
  width: 62px;
  height: 44px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: rgba(10, 12, 18, 0.78);
}

.elite-eye {
  position: absolute;
  top: 98px;
  width: 14px;
  height: 8px;
  border-radius: 999px;
  background: #ffd4df;
}

.elite-eye.left { left: 58px; }
.elite-eye.right { right: 58px; }

.elite-blade {
  position: absolute;
  top: 114px;
  width: 16px;
  height: 82px;
  background: linear-gradient(180deg, #f2f7ff, #8ba4d6);
  clip-path: polygon(50% 0%, 100% 84%, 50% 100%, 0% 84%);
}

.elite-blade.left { left: 14px; transform: rotate(-20deg); }
.elite-blade.right { right: 14px; transform: rotate(20deg); }

.player-figure span {
  position: absolute;
  display: block;
}

.player-head {
  width: 44px;
  height: 44px;
  left: 54px;
  top: 34px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff6f0, #f5d8c5);
}

.player-hair {
  width: 64px;
  height: 58px;
  left: 44px;
  top: 24px;
  border-radius: 36px;
  background: linear-gradient(180deg, #2c4671, #18263d);
  clip-path: polygon(10% 18%, 84% 2%, 100% 42%, 88% 94%, 12% 88%, 0% 42%);
}

.player-body {
  width: 60px;
  height: 88px;
  left: 46px;
  top: 78px;
  border-radius: 20px;
  background: linear-gradient(180deg, #1b2a3b, #121b25);
}

.player-coat {
  width: 118px;
  height: 124px;
  left: 16px;
  top: 92px;
  background: linear-gradient(180deg, #416ab0, #243754);
  clip-path: polygon(34% 0%, 70% 0%, 88% 12%, 100% 48%, 88% 100%, 18% 100%, 0% 56%, 10% 18%);
}

.player-scarf {
  width: 98px;
  height: 54px;
  left: 62px;
  top: 86px;
  background: linear-gradient(135deg, #ffb46e, #ffd98f);
  clip-path: polygon(0% 24%, 34% 0%, 64% 12%, 100% 0%, 76% 42%, 100% 74%, 58% 60%, 40% 100%, 20% 56%, 0% 46%);
}

.enemy-roster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.enemy-roster-card {
  min-height: 116px;
  padding: 8px 8px 10px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)),
    rgba(255,255,255,0.03);
  text-align: center;
  overflow: hidden;
}

.enemy-roster-card.active {
  border-color: rgba(255, 184, 95, 0.48);
}

.enemy-roster-card .enemy-figure {
  width: 64px;
  height: 70px;
  margin: 0 auto;
  transform: scale(0.38);
  transform-origin: top center;
}

.enemy-roster-card strong {
  display: block;
  margin-top: -30px;
  font-size: 12px;
}

.battle-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.train-mobile-shell {
  display: grid;
  gap: 18px;
}

.train-lounge-hero {
  position: relative;
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  padding: 28px;
  border-radius: 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 223, 160, 0.18), transparent 18%),
    linear-gradient(180deg, rgba(73, 49, 28, 0.92), rgba(18, 14, 18, 0.94));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 22px 50px rgba(0,0,0,0.28);
}

.train-lounge-glow {
  position: absolute;
  left: -30px;
  bottom: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 184, 95, 0.18), transparent 66%);
  filter: blur(18px);
}

.train-lounge-copy {
  position: relative;
  z-index: 2;
  align-self: end;
}

.train-lounge-copy h3 {
  margin: 8px 0 12px;
  font-size: 46px;
  line-height: 0.98;
}

.train-lounge-copy p {
  max-width: 520px;
  margin: 0;
  color: #dde7eb;
  line-height: 1.72;
}

.train-lounge-art {
  position: relative;
  min-height: 220px;
}

.lounge-window,
.lounge-seat,
.lounge-console,
.lounge-lamp {
  position: absolute;
}

.lounge-window {
  top: 38px;
  width: 104px;
  height: 96px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 60% 30%, rgba(255, 223, 160, 0.5), transparent 18%),
    linear-gradient(180deg, #28445d 0%, #102133 100%);
  border: 7px solid rgba(88, 59, 30, 0.86);
}

.lounge-window.left { left: 8px; }
.lounge-window.right { right: 8px; }

.lounge-console {
  left: 46px;
  right: 46px;
  bottom: 42px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(108, 118, 136, 0.92), rgba(44, 48, 58, 0.94));
}

.lounge-seat {
  left: 94px;
  bottom: 18px;
  width: 98px;
  height: 44px;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(180deg, #6d4a33, #31231d);
}

.lounge-lamp {
  top: 2px;
  left: 50%;
  width: 120px;
  height: 120px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 216, 140, 0.56), transparent 66%);
  filter: blur(10px);
}

.train-mobile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.train-mobile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.train-mobile-card {
  min-height: 132px;
  padding: 18px;
  text-align: left;
  border-radius: 24px;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)),
    rgba(255,255,255,0.03);
}

.train-card-start {
  background:
    linear-gradient(135deg, rgba(255, 184, 95, 0.18), rgba(92, 147, 255, 0.08)),
    rgba(255,255,255,0.03);
}

.train-card-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.12);
  position: relative;
}

.train-card-icon::before,
.train-card-icon::after {
  content: "";
  position: absolute;
}

.icon-start::before {
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 16px solid #ffe39b;
  left: 16px;
  top: 12px;
}

.icon-shop-mini::before {
  width: 22px;
  height: 14px;
  left: 10px;
  top: 18px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(180deg, #ffbf66, #f08f4a);
}

.icon-shop-mini::after {
  width: 26px;
  height: 8px;
  left: 8px;
  top: 10px;
  border-radius: 8px 8px 4px 4px;
  background: repeating-linear-gradient(90deg, #fff5ea 0 5px, #ff8ead 5px 10px);
}

.icon-food-mini::before {
  width: 20px;
  height: 20px;
  left: 11px;
  top: 11px;
  border-radius: 50% 50% 46% 46%;
  background: linear-gradient(180deg, #ffd68d, #cf8c4a);
}

.icon-mind-mini::before {
  width: 18px;
  height: 18px;
  left: 12px;
  top: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, #79d3ff, #6982ff);
}

.icon-mind-mini::after {
  width: 8px;
  height: 16px;
  left: 17px;
  top: 20px;
  border-radius: 8px;
  background: rgba(255,255,255,0.9);
}

.train-mobile-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.train-mobile-card small {
  color: #c9d8de;
}

.train-module-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.train-module-card {
  min-height: 180px;
}

.showcase-modal-card {
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
    rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
}

.showcase-modal-list {
  display: grid;
  gap: 12px;
}

.showcase-modal-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.07);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
    rgba(255,255,255,0.03);
}

.showcase-modal-item h4 {
  margin: 0 0 6px;
  font-size: 18px;
}

.showcase-modal-item p {
  margin: 0;
  color: #c6d5db;
  line-height: 1.62;
}

.showcase-modal-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.showcase-modal-item > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.showcase-choice-grid {
  display: grid;
  gap: 12px;
}

.summary-showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.spire-map-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.04), transparent 18%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)),
    linear-gradient(180deg, rgba(18, 24, 33, 0.92), rgba(14, 20, 29, 0.96));
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 26px 40px rgba(0,0,0,0.24);
}

.spire-map-header {
  margin-bottom: 18px;
}

.spire-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 16px;
  align-items: start;
}

.spire-map-board {
  width: 100%;
  min-height: 560px;
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 8%, rgba(255,255,255,0.04), transparent 18%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.005)),
    linear-gradient(180deg, #232934 0%, #1a212c 42%, #141b25 100%);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 0 0 1px rgba(255,255,255,0.02);
}

.spire-map-board::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.014) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.02), transparent 54%);
  background-size: 100% 54px, 54px 100%;
  opacity: 0.48;
  pointer-events: none;
}

.spire-map-board::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 193, 122, 0.05), transparent 18%),
    linear-gradient(180deg, transparent 0%, rgba(5, 10, 18, 0.18) 72%, rgba(5, 10, 18, 0.28) 100%);
  pointer-events: none;
}

.spire-lines path {
  stroke: rgba(181, 198, 239, 0.62);
  stroke-width: 2.5;
  stroke-dasharray: 4 8;
  vector-effect: non-scaling-stroke;
  filter: none;
  opacity: 0.82;
}

.spire-node {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,0.1), transparent 30%),
    rgba(49, 56, 70, 0.68);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 8px 18px rgba(0,0,0,0.2);
  transform: translate(-50%, -50%);
}

.spire-node::before,
.spire-node::after {
  transform: translate(-50%, -50%) scale(0.8);
}

.spire-node.current {
  box-shadow:
    0 0 0 3px rgba(255, 184, 95, 0.42),
    0 0 20px rgba(255, 184, 95, 0.18);
}

.spire-node.selectable {
  border-color: rgba(255,255,255,0.26);
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.08),
    0 0 0 4px rgba(255, 184, 95, 0.14);
}

.spire-node.locked-branch {
  opacity: 0.18;
  filter: grayscale(0.95);
}

.spire-legend-card {
  padding: 18px 16px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(194, 230, 255, 0.98), rgba(221, 239, 255, 0.92));
  color: #102336;
  box-shadow: 0 18px 30px rgba(0,0,0,0.18);
  position: sticky;
  top: 0;
}

.spire-legend-card h4 {
  margin: 0 0 14px;
  font-size: 28px;
}

.spire-legend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.spire-legend-row strong {
  font-size: 16px;
}

.spire-legend-row .legend-icon {
  width: 34px;
  height: 34px;
  border-color: rgba(16, 35, 54, 0.12);
  background: rgba(16, 35, 54, 0.08);
}

.spire-legend-row .legend-icon::before,
.spire-legend-row .legend-icon::after {
  transform: translate(-50%, -50%) scale(0.62);
}

.battle-finished-shell {
  gap: 16px;
}

.spire-battle-board {
  position: relative;
  min-height: 360px;
  display: grid;
  grid-template-columns: 160px 1fr 1.3fr;
  align-items: end;
  gap: 10px;
  padding: 18px 18px 22px;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(61, 33, 21, 0.26), transparent 26%),
    linear-gradient(180deg, #4a261d 0%, #2b1712 40%, #151015 100%);
  border: 1px solid rgba(255,255,255,0.08);
}

.spire-battle-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 88%, rgba(255,255,255,0.05), transparent 30%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.02) 0 1px, transparent 1px 112px);
  opacity: 0.55;
}

.battle-side,
.battle-center-fx {
  position: relative;
  z-index: 1;
}

.player-side {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.enemy-side {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 8px;
}

.battle-player-large {
  width: 132px;
  height: 200px;
  transform: scale(0.95);
  transform-origin: left bottom;
}

.spire-enemy-slot {
  width: 33%;
  min-width: 110px;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.spire-enemy-slot.single-enemy {
  width: min(240px, 100%);
}

.spire-enemy-slot.preview {
  opacity: 0.8;
  filter: saturate(0.86);
}

.spire-enemy-slot .enemy-figure {
  width: 120px;
  height: 168px;
  transform: scale(0.82);
  transform-origin: bottom center;
}

.spire-enemy-slot.slot-2 .enemy-figure {
  transform: scale(0.92);
}

.spire-enemy-slot.active .enemy-figure {
  transform: scale(1);
}

.spire-enemy-slot.single-enemy .enemy-figure {
  width: 168px;
  height: 220px;
  transform: scale(1);
}

.spire-unit-bar {
  width: 100%;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(12, 18, 24, 0.72);
  border: 1px solid rgba(255,255,255,0.08);
}

.spire-unit-bar strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.spire-hp-line {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}

.spire-hp-line span {
  display: block;
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #ff5d5d, #ff7d7d);
}

.spire-hp-line.enemy span {
  background: linear-gradient(90deg, #ff3f32, #ff6658);
}

.spire-bar-text {
  margin-top: 6px;
  color: #f0f5f8;
  font-size: 12px;
}

.player-bar-card .spire-hp-line span {
  background: linear-gradient(90deg, #ff5454, #ff7f7f);
}

.battle-center-fx {
  display: grid;
  place-items: center;
  align-self: center;
}

.battle-center-fx .battle-fx {
  position: static;
  transform: none;
  font-size: 38px;
}

.battle-metric-card {
  display: grid;
  gap: 10px;
}

.battle-metric-card .meter-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.battle-metric-card .meter-line span {
  color: #d6e1e6;
  font-size: 13px;
  text-align: right;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 10px;
    min-height: 100dvh;
  }

  .game-frame {
    min-height: calc(100dvh - 20px);
    padding: 14px;
  }

  .spire-map-layout {
    grid-template-columns: 1fr;
  }

  .spire-legend-card {
    order: -1;
    position: static;
  }

  .spire-node {
    width: 42px;
    height: 42px;
  }

  .spire-battle-board {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .battle-side.player-side {
    justify-items: center;
  }

  .enemy-side {
    justify-content: center;
    flex-wrap: wrap;
  }

  .spire-enemy-slot {
    min-width: 92px;
    width: calc(33.33% - 6px);
  }

  .spire-enemy-slot.single-enemy {
    width: min(200px, 100%);
    min-width: 0;
  }

  .modal {
    width: 100%;
    max-height: 92dvh;
    padding: 16px;
    border-radius: 22px;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: start;
    overflow: auto;
  }

  .modal-header {
    align-items: start;
  }

  .modal-header h3 {
    font-size: 24px;
  }

  .scene-panel {
    padding: 16px;
  }

  .spire-map-board {
    min-height: 520px;
  }

  .deep-tree-map {
    height: 520px;
  }

  .run-tree-header {
    grid-template-columns: 1fr;
    display: grid;
    gap: 10px;
  }

  .train-mobile-stats,
  .train-mobile-grid,
  .train-module-board,
  .summary-showcase-grid,
  .route-legend {
    grid-template-columns: 1fr;
  }

  .train-mobile-card {
    min-height: 116px;
  }

  .train-module-card {
    min-height: auto;
  }

  .showcase-modal-item {
    flex-direction: column;
    align-items: stretch;
  }

  .showcase-modal-actions {
    justify-items: stretch;
  }

  .showcase-modal-actions .chip,
  .showcase-modal-actions .shop-button {
    width: 100%;
    text-align: center;
  }

  .battle-metric-card .meter-line {
    flex-direction: column;
    align-items: flex-start;
  }

  .battle-metric-card .meter-line span {
    text-align: left;
  }

  .battle-actions-grid {
    grid-template-columns: 1fr;
  }

  .battle-center-fx .battle-fx {
    font-size: 30px;
  }

  .spire-unit-bar {
    padding: 8px;
  }

  .spire-bar-text {
    font-size: 11px;
  }
}

@keyframes floatCharacter {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes scarfWave {
  0%, 100% {
    transform: rotate(-3deg) translateX(0);
  }
  50% {
    transform: rotate(6deg) translateX(5px);
  }
}

@keyframes pulseSpark {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes trainBreath {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes petalDrift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.78;
  }
  100% {
    transform: translate3d(-40px, 220px, 0) rotate(220deg);
    opacity: 0;
  }
}

@keyframes blinkStar {
  0%, 100% {
    opacity: 0.4;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@media (max-width: 1180px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 0;
  }

  .home-panel-grid,
  .home-feature-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 14px;
  }

  .game-frame {
    padding: 16px;
    border-radius: 24px;
  }

  .topbar,
  .status-panel,
  .train-grid,
  .train-meta,
  .side-panel,
  .home-panel-grid,
  .home-feature-strip {
    grid-template-columns: 1fr;
  }

  .topbar,
  .scene-header {
    display: grid;
  }

  .topbar-side {
    justify-items: start;
  }

  .brand-block {
    align-items: flex-start;
  }

  .hero-poster {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-poster-mark {
    min-height: 180px;
  }

  .scene-panel {
    min-height: auto;
  }

  .scene-badge {
    width: fit-content;
  }

  .route-node {
    min-width: 92px;
    min-height: 92px;
  }

  .home-cta-row {
    flex-direction: column;
  }

  .home-play-button,
  .home-secondary-button {
    width: 100%;
  }

  .mobile-home {
    min-height: auto;
  }

  .mobile-home-visual {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 24px 20px;
  }

  .mobile-home-copy h3 {
    font-size: clamp(42px, 14vw, 68px);
  }

  .mobile-home-art {
    min-height: 260px;
  }

  .art-character {
    left: 0;
    width: 210px;
    height: 270px;
  }

  .character-silhouette {
    transform: scale(0.88);
    transform-origin: left bottom;
  }

  .mobile-quick-row,
  .mobile-bottom-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .brand-mark {
    width: 56px;
    height: 56px;
    font-size: 18px;
    border-radius: 16px;
  }

  .brand h1 {
    font-size: clamp(30px, 10vw, 40px);
  }

  .brand-summary {
    font-size: 12px;
  }

  .theme-switch,
  .currency-panel {
    width: 100%;
  }

  .theme-chip,
  .currency-panel span,
  .ghost-button {
    width: 100%;
    text-align: center;
  }

  .status-card {
    padding: 14px;
  }

  .mobile-bottom-nav {
    grid-template-columns: 1fr 1fr;
  }

  .spire-map-board,
  .deep-tree-map {
    min-height: 460px;
    height: 460px;
  }

  .spire-node {
    width: 38px;
    height: 38px;
  }

  .spire-enemy-slot {
    width: 100%;
    min-width: 0;
  }
}

/* Reference-art overrides for the competition demo build */
.mobile-home-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
  filter: saturate(0.94) contrast(1.03);
}

.hero-cutout {
  position: absolute;
  left: 12px;
  bottom: -2px;
  width: 214px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.3));
}

.inventory-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.inventory-icon {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}

.inventory-copy {
  min-width: 0;
}

.inventory-copy strong {
  display: block;
  margin-bottom: 6px;
}

.train-lounge-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
  filter: saturate(0.92) contrast(1.02);
}

.train-hero-cutout {
  position: absolute;
  right: -4px;
  bottom: -8px;
  width: 214px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.32));
}

.shop-item-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  flex: 0 0 auto;
}

.enemy-figure.image-figure,
.player-figure.image-figure {
  display: grid;
  place-items: end center;
}

.enemy-figure.image-figure img,
.player-figure.image-figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.34));
}

@media (max-width: 860px) {
  .shop-item-icon {
    width: 64px;
    height: 64px;
  }

  .hero-cutout {
    width: 190px;
  }
}

@media (max-width: 560px) {
  .train-hero-cutout {
    width: 180px;
  }
}

/* Home screen remake based on the provided reference */
.home-screen {
  position: relative;
  min-height: 820px;
  border-radius: 34px;
  overflow: hidden;
  padding: 18px 18px 26px;
  display: grid;
  align-content: start;
}

.home-screen-bg,
.home-screen-overlay {
  position: absolute;
  inset: 0;
}

.home-screen-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-screen-overlay {
  background:
    linear-gradient(180deg, rgba(6, 10, 14, 0.28), rgba(5, 9, 13, 0.18) 22%, rgba(7, 12, 18, 0.54) 64%, rgba(7, 12, 18, 0.82) 100%),
    radial-gradient(circle at 50% 42%, rgba(255, 191, 102, 0.12), transparent 22%);
}

.home-top-status,
.home-title-block,
.home-door-trigger,
.home-menu-grid,
.home-enter-button {
  position: relative;
  z-index: 2;
}

.home-top-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.home-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.68);
  border: 1px solid rgba(255,255,255,0.12);
  color: #f4efe6;
  font-size: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.home-status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
}

.home-status-pill .dot.hp { background: #ff9a54; }
.home-status-pill .dot.hunger { background: #5fd4a2; }
.home-status-pill .dot.sanity { background: #f5c66f; }

.home-title-block {
  margin-top: 92px;
  text-align: center;
}

.home-title-block h3 {
  margin: 0;
  font-size: clamp(54px, 9vw, 76px);
  line-height: 0.94;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #fff7e8;
  text-shadow:
    0 3px 0 rgba(22, 16, 10, 0.82),
    0 10px 28px rgba(0, 0, 0, 0.38);
}

.home-title-block p {
  margin: 10px 0 0;
  font-size: 15px;
  color: rgba(245, 238, 225, 0.9);
  letter-spacing: 0.08em;
}

.home-door-trigger {
  justify-self: center;
  margin-top: 138px;
  padding: 10px 16px;
  border-radius: 14px;
  color: #f4e9d8;
  background: rgba(15, 16, 18, 0.58);
  border: 1px solid rgba(255, 185, 97, 0.38);
  box-shadow:
    0 0 0 1px rgba(255, 211, 142, 0.08),
    0 12px 24px rgba(0,0,0,0.28);
}

.home-menu-grid {
  margin-top: 254px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-menu-card {
  min-height: 92px;
  padding: 10px 8px 12px;
  border-radius: 18px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  color: #f5ead8;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)),
    rgba(10, 11, 14, 0.56);
  border: 1px solid rgba(255, 197, 110, 0.28);
  box-shadow: 0 16px 26px rgba(0,0,0,0.24);
}

.home-menu-icon {
  font-size: 20px;
  line-height: 1;
  color: #ffbe67;
}

.home-menu-card strong {
  font-size: 16px;
  font-weight: 700;
}

.home-enter-button {
  margin-top: 18px;
  width: min(360px, 100%);
  justify-self: center;
  padding: 16px 24px;
  border-radius: 22px;
  color: #2a1808;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #ffcb78, #ef8b2f);
  border: 1px solid rgba(255, 213, 149, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.42),
    0 18px 34px rgba(0,0,0,0.28);
}

@media (max-width: 860px) {
  .home-screen {
    min-height: 760px;
    padding: 16px 16px 24px;
  }

  .home-title-block {
    margin-top: 78px;
  }

  .home-door-trigger {
    margin-top: 124px;
  }

  .home-menu-grid {
    margin-top: 220px;
  }
}

@media (max-width: 560px) {
  .home-screen {
    min-height: 690px;
    border-radius: 26px;
    padding: 14px 14px 20px;
  }

  .home-top-status {
    gap: 6px;
  }

  .home-status-pill {
    font-size: 11px;
    padding: 5px 8px;
  }

  .home-title-block {
    margin-top: 66px;
  }

  .home-title-block h3 {
    font-size: clamp(44px, 12vw, 58px);
  }

  .home-title-block p {
    font-size: 13px;
  }

  .home-door-trigger {
    margin-top: 110px;
    font-size: 13px;
  }

  .home-menu-grid {
    margin-top: 196px;
    gap: 8px;
  }

  .home-menu-card {
    min-height: 84px;
    border-radius: 16px;
  }

  .home-menu-card strong {
    font-size: 14px;
  }

  .home-enter-button {
    font-size: 22px;
    padding: 14px 20px;
  }
}

/* ---------- demo mode: mobile presentation shell ---------- */
@media (max-width: 860px) {
  body.demo-mode .app-shell { padding: 0; }
  body.demo-mode .game-frame { padding: 0; border: 0; border-radius: 0; min-height: 100dvh; }
  body.demo-mode .page-atmosphere { display: none; }
  body.demo-mode .topbar { padding: 10px 12px 6px; gap: 6px; align-items: center; }
  body.demo-mode .brand-mark { width: 34px; height: 34px; font-size: 12px; border-radius: 9px; }
  body.demo-mode .brand h1 { font-size: 17px; letter-spacing: 1px; }
  body.demo-mode .brand-kicker,
  body.demo-mode .brand-summary,
  body.demo-mode .theme-switch,
  body.demo-mode .top-reset,
  body.demo-mode .scene-badge { display: none; }
  body.demo-mode .topbar-side { display: flex; align-items: center; gap: 8px; justify-items: stretch; }
  body.demo-mode .currency-panel { width: auto; display: flex; gap: 6px; }
  body.demo-mode .currency-panel span { width: auto; font-size: 12px; padding: 4px 9px; }
  body.demo-mode .status-panel { grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px 12px 0; }
  body.demo-mode .status-card { padding: 7px 8px; }
  body.demo-mode .status-label { font-size: 10px; }
  body.demo-mode .status-text { font-size: 11px; }
  body.demo-mode .main-layout { padding: 8px 12px 0; gap: 10px; }
  body.demo-mode .scene-panel { padding: 10px; border-radius: 16px; }
  body.demo-mode .scene-decor { display: none; }
  body.demo-mode:not(.home-mode) .hero-layer { display: none; }
  body.demo-mode .scene-header { padding: 0 0 8px; }
  body.demo-mode .scene-kicker { font-size: 10px; }
  body.demo-mode .scene-header h2 { font-size: 18px; }
  body.demo-mode .side-panel {
    display: flex; gap: 10px; overflow-x: auto; padding: 10px 12px 16px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  }
  body.demo-mode .side-panel > .card { min-width: 84vw; flex: 0 0 auto; scroll-snap-align: start; }
}

/* ------------------------------------------------------------------
   移动端性能降级（代码审查 3.3）
   backdrop-filter 会在每帧重新做一次 GPU 模糊，叠加 .fog 的 filter: blur
   后低端机明显掉帧。手机宽度下改为等效半透明底 + 描边，视觉差异极小。
   ------------------------------------------------------------------ */
@media (max-width: 860px) {
  .game-frame,
  .card,
  .summary-card,
  .battle-status,
  .spire-battle-board {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .fog-a,
  .fog-b,
  .grid-glow {
    will-change: transform;
    animation: none;
  }
}
