:root {
  --bg: #070605;
  --bg-2: #12100c;
  --panel: rgba(18, 14, 10, 0.72);
  --panel-solid: #14110d;
  --line: rgba(212, 175, 55, 0.28);
  --line-strong: rgba(255, 214, 120, 0.55);
  --gold: #d4af37;
  --gold-bright: #ffe6a0;
  --gold-deep: #8b6914;
  --amber: #ffb700;
  --text: #f3ecd4;
  --muted: #9a9080;
  --dim: #6b6358;
  --ok: #5dca8a;
  --danger: #e57373;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --radius: 16px;
  --shadow-gold: 0 0 24px rgba(212, 175, 55, 0.18);
  --gild: linear-gradient(135deg, #fff4c4 0%, #ffe6a0 18%, #d4af37 45%, #8b6914 72%, #f0d78a 100%);
  --gild-soft: linear-gradient(180deg, rgba(255,230,160,0.55), rgba(212,175,55,0.15), rgba(139,105,20,0.35));
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

body {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(212, 175, 55, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 40% at 80% 80%, rgba(80, 50, 10, 0.25), transparent 60%),
    linear-gradient(180deg, #0c0a08 0%, #070605 40%, #0a0806 100%);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.08);
}

.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.fx-glow {
  position: absolute; width: 280px; height: 280px; border-radius: 50%;
  filter: blur(70px); opacity: 0.35;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.35), transparent 70%);
  animation: drift 18s ease-in-out infinite;
}
.fx-glow--1 { top: -80px; left: -60px; }
.fx-glow--2 { bottom: 80px; right: -90px; animation-delay: -8s; opacity: 0.22; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12px, -16px) scale(1.08); }
}

.fx-stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,230,160,.55), transparent),
    radial-gradient(1px 1px at 28% 42%, rgba(255,230,160,.4), transparent),
    radial-gradient(1.5px 1.5px at 66% 14%, rgba(255,230,160,.5), transparent),
    radial-gradient(1px 1px at 78% 36%, rgba(255,230,160,.35), transparent),
    radial-gradient(1px 1px at 88% 22%, rgba(255,230,160,.45), transparent),
    radial-gradient(1.5px 1.5px at 42% 8%, rgba(255,230,160,.4), transparent);
  animation: twinkle 6s ease-in-out infinite;
  opacity: 0.7;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}
.fx-columns {
  display: none;
}

.meander {
  height: 3px;
  background:
    repeating-linear-gradient(90deg,
      var(--gold) 0 8px, transparent 8px 12px,
      var(--gold) 12px 14px, transparent 14px 18px,
      var(--gold) 18px 26px, transparent 26px 30px);
  opacity: 0.45;
}

/* Top bar */
.topbar {
  position: relative; z-index: 20; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(7,6,5,0.92), rgba(7,6,5,0.55));
  border-bottom: 1px solid rgba(212,175,55,0.12);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(212,175,55,0.35), 0 0 12px rgba(212,175,55,0.25);
}
.brand-text h1 {
  font-family: var(--font);
  font-size: 16px; font-weight: 700; letter-spacing: 0.08em;
  background: var(--gild);
  background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gildShift 6s ease-in-out infinite;
}
@keyframes gildShift {
  0%, 100% { background-position: 0% 40%; }
  50% { background-position: 100% 60%; }
}
.brand-text p { font-size: 12px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.wallet-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(20,16,10,0.95), rgba(12,10,8,0.95)) padding-box,
    var(--gild) border-box;
  color: var(--gold-bright); font-size: 12px; font-weight: 600;
  box-shadow: 0 0 14px rgba(212,175,55,0.18);
}
.wallet-btn .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 6px var(--ok);
}
.wallet-btn.disconnected .dot { background: var(--dim); box-shadow: none; }

/* Views */
.views {
  position: relative; z-index: 1;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}
.view {
  display: none; height: 100%; overflow-y: auto; overflow-x: hidden;
  padding: 12px 14px calc(24px + var(--safe-b));
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.view::-webkit-scrollbar { display: none; }
.view.active { display: block; animation: fadeIn .28s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Hero — Odyssey cinematic banners */
.hero {
  position: relative; border-radius: 22px; overflow: hidden;
  min-height: 200px; margin-bottom: 14px;
  border: 1px solid transparent;
  background:
    linear-gradient(#0a0806, #0a0806) padding-box,
    var(--gild) border-box;
  box-shadow:
    0 0 28px rgba(212,175,55,0.22),
    inset 0 0 0 1px rgba(255,230,160,0.08),
    0 16px 40px rgba(0,0,0,0.45);
}
.hero::before {
  content: "";
  position: absolute; inset: -1px; border-radius: 22px; pointer-events: none; z-index: 4;
  background: var(--gild-soft);
  opacity: 0.35;
  mix-blend-mode: screen;
  animation: gildBreath 5s ease-in-out infinite;
}
@keyframes gildBreath {
  0%, 100% { opacity: 0.18; }
  50% { opacity: 0.4; }
}
.hero::after {
  content: "";
  position: absolute; inset: 8px; border-radius: 16px; pointer-events: none; z-index: 2;
  border: 1px solid rgba(255,230,160,0.22);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,230,160,0.12);
}
.hero--lg { min-height: 228px; }
.hero--home { touch-action: pan-y; }
.hero--home .hero-bg { background-position: 62% center; }
.hero--mining .hero-bg { background-position: 78% 45%; }
.hero--team .hero-bg { background-position: 70% 40%; }
.hero--node .hero-bg { background-position: 72% center; }
.hero--mine .hero-bg { background-position: 65% center; }

.hero-track {
  position: absolute; inset: 0; z-index: 0;
}
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity .7s ease, transform 1.1s ease;
  pointer-events: none;
}
.hero-slide.is-active {
  opacity: 1;
  transform: scale(1.02);
  pointer-events: auto;
  z-index: 1;
}
.hero-slide .hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  animation: none;
  filter: saturate(1.05) contrast(1.05) brightness(0.92);
}
.hero-slide.is-active .hero-bg {
  animation: heroPulse 14s ease-in-out infinite;
}

.hero-dots {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
}
.hero-dots button {
  width: 7px; height: 7px; border-radius: 999px;
  background: rgba(255,230,160,0.28);
  border: 1px solid rgba(212,175,55,0.35);
  padding: 0;
  transition: width .25s ease, background .25s ease;
}
.hero-dots button.is-active {
  width: 18px;
  background: linear-gradient(90deg, #ffe6a0, #d4af37);
  border-color: transparent;
  box-shadow: 0 0 10px rgba(255,183,0,0.45);
}

.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
  transform: scale(1.04);
  animation: heroPulse 14s ease-in-out infinite;
  filter: saturate(1.05) contrast(1.05);
}
@keyframes heroPulse {
  0%, 100% { transform: scale(1.04) translate3d(0,0,0); filter: brightness(0.88) saturate(1.05); }
  50% { transform: scale(1.09) translate3d(-1%, -0.5%, 0); filter: brightness(1.05) saturate(1.12); }
}
.hero-vignette {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 80% at 78% 40%, rgba(212,175,55,0.14), transparent 55%),
    radial-gradient(ellipse 90% 70% at 20% 80%, rgba(0,0,0,0.55), transparent 60%);
  animation: vignetteBreath 10s ease-in-out infinite;
}
@keyframes vignetteBreath {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
.hero-mask {
  position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(105deg, rgba(7,6,5,0.92) 0%, rgba(7,6,5,0.62) 42%, rgba(7,6,5,0.18) 72%, rgba(7,6,5,0.35) 100%),
    linear-gradient(0deg, rgba(7,6,5,0.92) 0%, rgba(7,6,5,0.35) 38%, transparent 62%);
}
.hero-ornament {
  position: absolute; right: 0; bottom: 0; width: 72%; max-width: 280px;
  opacity: 0.55; z-index: 1; pointer-events: none;
  animation: ornamentFloat 9s ease-in-out infinite;
}
@keyframes ornamentFloat {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50% { transform: translateY(-4px); opacity: 0.65; }
}
.hero-content {
  position: relative; z-index: 3;
  padding: 22px 18px 18px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 200px; justify-content: flex-end;
}
.hero--lg .hero-content { min-height: 228px; }
.hero-kicker {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.16em; color: var(--gold-bright);
  text-transform: uppercase; font-family: var(--font); font-weight: 600;
  text-shadow: 0 0 18px rgba(212,175,55,0.35);
}
.kicker-line {
  width: 22px; height: 1px;
  background: linear-gradient(90deg, var(--gold-bright), transparent);
  box-shadow: 0 0 8px rgba(255,230,160,0.5);
}
.hero-title {
  font-family: var(--font);
  font-size: 24px; line-height: 1.25; font-weight: 700;
  background: var(--gild);
  background-size: 220% 220%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gildShift 7s ease-in-out infinite;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.55));
  max-width: 92%;
}
.hero-sub {
  font-size: 12px; color: rgba(243,236,212,0.82); line-height: 1.55;
  max-width: 88%; text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}
.hero-meander {
  margin-top: 6px; height: 10px; width: 120px;
  background:
    repeating-linear-gradient(90deg,
      transparent 0 3px,
      var(--gold) 3px 5px,
      transparent 5px 8px,
      var(--gold) 8px 14px,
      transparent 14px 17px);
  opacity: 0.55;
  mask-image: linear-gradient(90deg, #000, transparent);
}

/* Panels */
.panel {
  background:
    linear-gradient(165deg, rgba(36,28,18,0.72), rgba(12,10,8,0.78)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
}
.panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255,230,160,0.07), transparent 38%),
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(212,175,55,0.08), transparent 50%);
}
.panel::after {
  content: "";
  position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,230,160,0.45), transparent);
  pointer-events: none;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 8px;
}
.panel-title {
  font-family: var(--font);
  font-size: 14px; color: var(--gold-bright); letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 8px;
}
.panel-title .bar {
  width: 3px; height: 14px; border-radius: 2px;
  background: var(--gild);
  box-shadow: 0 0 10px rgba(255,183,0,0.55);
}
.panel-extra { font-size: 12px; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.stat {
  padding: 12px 10px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,230,160,0.04), rgba(0,0,0,0.34));
  border: 1px solid rgba(212,175,55,0.18);
  box-shadow: inset 0 1px 0 rgba(255,230,160,0.05);
}
.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-value {
  font-family: var(--font);
  font-size: 16px; color: var(--gold-bright); letter-spacing: 0.02em;
  word-break: break-all;
  text-shadow: 0 0 16px rgba(212,175,55,0.2);
}
.stat-value.sm { font-size: 13px; }
.stat-hint { font-size: 12px; color: var(--dim); margin-top: 4px; }

.pill-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px;
}
.pill {
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px; color: var(--gold);
  background: linear-gradient(180deg, rgba(212,175,55,0.12), rgba(212,175,55,0.04));
  box-shadow: inset 0 1px 0 rgba(255,230,160,0.08);
}

/* Progress */
.progress {
  height: 8px; border-radius: 999px; background: rgba(255,255,255,0.06);
  overflow: hidden; margin-top: 8px;
}
.progress > i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-deep), var(--amber), var(--gold-bright));
  box-shadow: 0 0 10px rgba(255,183,0,0.45);
  transition: width .4s ease;
}

/* Level stairs */
.level-stairs { display: flex; flex-direction: column; gap: 8px; }
.level-row {
  display: grid; grid-template-columns: 42px 1fr 48px; gap: 8px; align-items: center;
}
.level-tag {
  font-family: var(--font); font-size: 12px; text-align: center;
  padding: 4px 0; border-radius: 8px;
  border: 1px solid var(--line-strong); color: var(--gold-bright);
  background: rgba(212,175,55,0.1);
}
.level-row.active .level-tag {
  background: linear-gradient(180deg, rgba(255,183,0,0.35), rgba(212,175,55,0.15));
  box-shadow: 0 0 12px rgba(255,183,0,0.25);
}
.level-bar-wrap {
  height: 12px; border-radius: 8px; background: rgba(255,255,255,0.05);
  overflow: hidden; border: 1px solid rgba(212,175,55,0.12);
}
.level-bar {
  height: 100%;
  background: linear-gradient(90deg, #6b4f10, var(--amber));
  border-radius: inherit;
}
.level-pct { font-family: var(--font); font-size: 12px; color: var(--gold); text-align: right; }
.level-meta { grid-column: 2 / 4; font-size: 12px; color: var(--dim); margin-top: -4px; }

/* Forms */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: rgba(0,0,0,0.4); border: 1px solid var(--line);
  outline: none; color: var(--text);
}
.field input:focus, .field select:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(212,175,55,0.12); }
.field-hint { font-size: 12px; color: var(--dim); margin-top: 6px; line-height: 1.4; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 16px; border-radius: 14px;
  font-weight: 700; font-size: 14px; letter-spacing: 0.04em;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  color: #1a1205;
  background: linear-gradient(180deg, #ffe6a0 0%, #d4af37 48%, #a8841f 100%);
}
.btn-ghost {
  color: var(--gold-bright);
  border: 1px solid var(--line-strong);
  background: rgba(212,175,55,0.08);
}
.btn-danger {
  color: #fff;
  background: linear-gradient(180deg, #c05050, #8a3030);
}
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-sm { padding: 9px 12px; font-size: 12px; border-radius: 10px; width: auto; }

/* Position cards */
.pos-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(36,28,18,0.45), rgba(0,0,0,0.38));
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: inset 0 1px 0 rgba(255,230,160,0.06);
}
.pos-card.exited { opacity: 0.65; border-color: rgba(255,255,255,0.1); }
.pos-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px; gap: 8px;
}
.pos-id {
  font-family: var(--font); font-size: 13px; color: var(--gold-bright);
}
.pos-badge {
  font-size: 12px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--gold);
}
.pos-badge.live { border-color: rgba(93,202,138,0.5); color: var(--ok); }
.pos-badge.done { color: var(--muted); }
.pos-metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.metric {
  padding: 8px; border-radius: 10px;
  background: rgba(212,175,55,0.04);
  border: 1px solid rgba(212,175,55,0.1);
}
.metric span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.metric b {
  font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--text);
  word-break: break-all;
}

/* Tabs */
.tabs {
  display: flex; gap: 6px; padding: 4px;
  background: rgba(0,0,0,0.35); border-radius: 12px;
  border: 1px solid rgba(212,175,55,0.12); margin-bottom: 12px;
}
.tab {
  flex: 1; padding: 8px 6px; border-radius: 9px;
  font-size: 12px; color: var(--muted); text-align: center;
}
.tab.active {
  color: #1a1205; font-weight: 700;
  background: linear-gradient(180deg, #ffe6a0, #d4af37);
}

/* Records */
.record {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid rgba(212,175,55,0.1);
  font-size: 12px;
}
.record:last-child { border-bottom: none; }
.record .t { color: var(--muted); font-size: 12px; margin-top: 2px; }
.record .amt { font-family: var(--font); color: var(--gold-bright); text-align: right; }

/* Bottom nav */
.bottom-nav {
  position: relative; z-index: 30; flex-shrink: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 6px 4px var(--safe-b);
  background:
    linear-gradient(180deg, rgba(20,16,10,0.96), rgba(7,6,5,0.99)),
    radial-gradient(ellipse 60% 80% at 50% 0%, rgba(212,175,55,0.12), transparent 60%);
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, #ffe6a0, #d4af37, #ffe6a0, transparent) 1;
  backdrop-filter: blur(16px);
}
.bottom-nav::before {
  content: "";
  position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,244,196,0.75), rgba(212,175,55,0.5), transparent);
  box-shadow: 0 0 12px rgba(255,230,160,0.35);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--dim); font-size: 12px;
}
.nav-item svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.nav-item.active {
  color: var(--gold-bright);
  text-shadow: 0 0 14px rgba(255,183,0,0.45);
}
.nav-item.active svg {
  filter: drop-shadow(0 0 6px rgba(255,183,0,0.65));
}

/* Modal */
.modal-mask {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(6px);
  display: none; align-items: flex-end; justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
  width: 100%; max-height: 88%; overflow: auto;
  background: linear-gradient(180deg, #1a1610, #0e0c09);
  border: 1px solid var(--line-strong);
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(20px + var(--safe-b));
  animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.modal-head h3 {
  font-family: var(--font); font-size: 16px; color: var(--gold-bright);
}
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted);
}

/* Toast */
.toast-wrap {
  position: absolute; left: 50%; top: calc(70px + var(--safe-t));
  transform: translateX(-50%); z-index: 80;
  width: calc(100% - 28px); pointer-events: none;
}
.toast {
  display: none; padding: 12px 14px; border-radius: 12px;
  background: rgba(20,16,10,0.95); border: 1px solid var(--line-strong);
  color: var(--gold-bright); font-size: 13px; text-align: center;
  box-shadow: var(--shadow-gold); animation: fadeIn .2s ease;
}
.toast.show { display: block; }

/* Misc */
.section-gap { height: 4px; }
.empty {
  text-align: center; padding: 28px 12px; color: var(--muted); font-size: 13px;
}
.tag-node {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 12px;
  background: linear-gradient(90deg, rgba(255,183,0,0.25), rgba(212,175,55,0.1));
  border: 1px solid var(--line-strong); color: var(--gold-bright);
}
.formula {
  padding: 12px 12px; border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(255,183,0,0.12), rgba(212,175,55,0.06)),
    rgba(0,0,0,0.25);
  border: 1px solid rgba(255,183,0,0.28);
  font-family: var(--font); font-size: 12px; color: var(--gold-bright);
  text-align: center; line-height: 1.5;
  box-shadow: inset 0 0 20px rgba(212,175,55,0.06);
}
.notice {
  font-size: 12px; color: var(--muted); line-height: 1.55;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(212,175,55,0.22);
}

.rule-list {
  display: flex; flex-direction: column; gap: 10px;
}
.rule-list li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  align-items: baseline;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(212,175,55,0.1);
}
.rule-list li:last-child { border-bottom: none; padding-bottom: 0; }
.rule-list b {
  color: var(--gold-bright);
  font-weight: 600;
}

.flow-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 4px; flex-wrap: wrap;
  font-size: 12px; color: var(--gold-bright);
}
.flow-row span {
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid rgba(212,175,55,0.22);
  background: rgba(0,0,0,0.28);
}
.flow-row i { color: var(--dim); font-style: normal; }

/* ── Home Odyssey layout ── */
#view-home {
  position: relative;
  padding-bottom: 36px;
  background: transparent;
}
.home-bg {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100vw, 430px);
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.home-bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 18% 22%, rgba(255,230,160,.55), transparent),
    radial-gradient(1px 1px at 42% 38%, rgba(255,244,196,.4), transparent),
    radial-gradient(1.5px 1.5px at 68% 16%, rgba(255,230,160,.5), transparent),
    radial-gradient(1px 1px at 82% 48%, rgba(212,175,55,.45), transparent),
    radial-gradient(1.2px 1.2px at 28% 62%, rgba(255,230,160,.35), transparent),
    radial-gradient(1px 1px at 55% 72%, rgba(255,244,196,.3), transparent);
  animation: gildDust 8s ease-in-out infinite;
  opacity: 0.55;
  mix-blend-mode: screen;
}
@keyframes gildDust {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 0.7; transform: translateY(-6px); }
}
.home-bg-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 1;
  filter: saturate(1.12) contrast(1.08) brightness(0.98);
}
.home-bg-mist {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 85% 45% at 70% 18%, rgba(212,175,55,0.22), transparent 55%),
    linear-gradient(180deg,
      rgba(7,6,5,0.28) 0%,
      rgba(7,6,5,0.4) 28%,
      rgba(7,6,5,0.58) 62%,
      rgba(7,6,5,0.86) 100%);
}
#view-home > *:not(.home-bg) {
  position: relative;
  z-index: 1;
}
.home-prologue {
  position: relative;
  margin: 4px 0 18px;
  padding: 18px 16px 16px;
  padding-right: 112px;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, rgba(212,175,55,0.14), transparent 55%),
    linear-gradient(160deg, rgba(28,22,14,0.82), rgba(10,8,6,0.78));
  border: 1px solid rgba(212,175,55,0.22);
  backdrop-filter: blur(10px);
}
.home-compass {
  position: absolute; right: -6px; top: -6px;
  width: 108px; height: 108px;
  opacity: 0.9; pointer-events: none;
  filter: drop-shadow(0 0 18px rgba(255,214,120,0.5));
}
.home-compass-logo {
  width: 100%; height: 100%;
  object-fit: contain;
  animation: compassSpin 22s linear infinite;
}
.home-compass::after {
  content: "";
  position: absolute; inset: 6%;
  border-radius: 50%;
  box-shadow: inset 0 0 16px rgba(255,230,160,0.25), 0 0 22px rgba(212,175,55,0.4);
  pointer-events: none;
  animation: gildBreath 4s ease-in-out infinite;
}
@keyframes compassSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.home-quote {
  position: relative; z-index: 1;
  font-size: 16px; line-height: 1.55; font-weight: 600;
  background: var(--gild);
  background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gildShift 8s ease-in-out infinite;
  margin-bottom: 10px;
  max-width: 86%;
}
.home-lead {
  position: relative; z-index: 1;
  font-size: 12px; line-height: 1.7; color: var(--muted);
  max-width: 92%;
}

.home-relics {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}
.relic-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.relic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.relic {
  position: relative;
  padding: 14px 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(212,175,55,0.2);
  background:
    linear-gradient(155deg, rgba(40,30,16,0.55), rgba(8,7,5,0.75));
  overflow: hidden;
  min-height: 86px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: relicIn .55s ease both;
}
.relic-hero .relic:nth-child(1) { animation-delay: .04s; }
.relic-hero .relic:nth-child(2) { animation-delay: .1s; }
.relic-grid .relic:nth-child(1) { animation-delay: .14s; }
.relic-grid .relic:nth-child(2) { animation-delay: .18s; }
.relic-grid .relic:nth-child(3) { animation-delay: .22s; }
.relic-grid .relic:nth-child(4) { animation-delay: .26s; }
@keyframes relicIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.relic--prime {
  min-height: 118px;
  padding: 16px 14px 14px;
  background:
    radial-gradient(ellipse 70% 90% at 100% 0%, rgba(255,183,0,0.14), transparent 55%),
    linear-gradient(145deg, rgba(42,32,16,0.88), rgba(8,7,5,0.92));
  border-color: rgba(212,175,55,0.32);
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
}
.relic--prime-alt {
  background:
    radial-gradient(ellipse 70% 90% at 0% 100%, rgba(212,175,55,0.12), transparent 55%),
    linear-gradient(215deg, rgba(36,28,14,0.88), rgba(8,7,5,0.92));
}
.relic::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255,230,160,0.06) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: relicSheen 5.5s ease-in-out infinite;
}
@keyframes relicSheen {
  0%, 70% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}
.relic-label {
  display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px;
  position: relative; z-index: 1;
}
.relic-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  position: relative; z-index: 1;
}
.relic-num {
  display: block;
  font-size: 18px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--gold-bright);
  text-shadow: 0 0 18px rgba(212,175,55,0.25);
  word-break: break-all;
  position: relative; z-index: 1;
  line-height: 1.15;
}
.relic--prime .relic-num {
  font-size: 20px;
}
.relic-unit {
  font-size: 12px; color: var(--dim);
  position: relative; z-index: 1;
}
.relic-tag {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(212,175,55,0.55);
  position: relative; z-index: 1;
}

.home-voyage {
  position: relative;
  margin-bottom: 18px;
}
.voyage-head {
  margin-bottom: 16px;
}
.voyage-eyebrow {
  display: inline-block;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 6px;
}
.voyage-head h3 {
  font-size: 20px; margin-bottom: 6px; font-weight: 700;
  background: var(--gild);
  background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gildShift 7s ease-in-out infinite;
}
.voyage-head p {
  font-size: 12px; color: var(--muted); line-height: 1.55;
}

.voyage-path { display: none; }

.chapter {
  position: relative;
  display: block;
  margin-bottom: 12px;
  padding: 0;
  border-radius: 18px;
  border: 1px solid rgba(212,175,55,0.22);
  background:
    linear-gradient(155deg, rgba(34,26,14,0.88), rgba(10,8,6,0.92));
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
}
.chapter.is-in {
  opacity: 1;
  transform: none;
}
.chapter::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, #ffe6a0, #8b6914);
  opacity: 0.85;
}
.chapter::after {
  display: none;
}
.chapter-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 0 16px;
}
.chapter-no {
  flex: 0 0 auto;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1a1205;
  background: linear-gradient(160deg, #ffe6a0, #d4af37 55%, #a8841f);
}
.chapter-titles {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chapter-stage {
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.08em;
}
.chapter-titles h4 {
  font-size: 15px;
  color: var(--gold-bright);
  font-weight: 700;
  line-height: 1.3;
}
.chapter-body {
  padding: 10px 14px 14px 16px;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.chapter-body > p {
  font-size: 12px; color: rgba(243,236,212,0.78); line-height: 1.65; margin-bottom: 10px;
}
.chapter-body ul {
  display: flex; flex-direction: column; gap: 6px;
}
.chapter-body li {
  position: relative;
  padding-left: 12px;
  font-size: 12px; color: var(--muted); line-height: 1.55;
}
.chapter-body li::before {
  content: "";
  position: absolute; left: 0; top: 7px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(255,183,0,0.5);
}
.chapter-body li b { color: var(--gold-bright); font-weight: 600; }

.chapter-example {
  margin-top: 12px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(255,183,0,0.08);
  border: 1px solid rgba(255,183,0,0.22);
}
.chapter-example span { font-size: 12px; color: var(--muted); }
.chapter-example b { font-size: 14px; color: var(--gold-bright); }
.chapter-example em { font-style: normal; font-size: 12px; color: var(--dim); }

.chapter-ladder { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.mini-level {
  display: grid; grid-template-columns: 36px 1fr 40px; gap: 8px; align-items: center;
}
.mini-level span {
  font-size: 12px; color: var(--gold-bright); text-align: center;
  padding: 3px 0; border-radius: 6px; border: 1px solid rgba(212,175,55,0.3);
}
.mini-level .bar {
  height: 8px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden;
}
.mini-level .bar i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #6b4f10, var(--amber));
  transform-origin: left center;
  animation: barGrow 1.1s ease both;
}
@keyframes barGrow {
  from { transform: scaleX(0.15); }
  to { transform: scaleX(1); }
}
.mini-level b { font-size: 12px; color: var(--gold); text-align: right; font-weight: 600; }

.burn-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.burn-bar {
  display: grid; grid-template-columns: 64px 1fr 40px; gap: 8px; align-items: center;
  font-size: 12px; color: var(--muted);
}
.burn-bar i {
  display: block; height: 8px; border-radius: 999px;
  width: var(--w);
  background: linear-gradient(90deg, #8b6914, #ffb700);
  box-shadow: 0 0 10px rgba(255,183,0,0.3);
  animation: barGrow 1.2s ease both;
}
.burn-bar b { color: var(--gold-bright); text-align: right; }
.burn-bar--sell i { background: linear-gradient(90deg, #5a4030, #c9a962); }

.home-cycle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px;
}
.cycle-step {
  padding: 12px 10px; border-radius: 12px;
  border: 1px solid rgba(212,175,55,0.18);
  background: rgba(0,0,0,0.28);
  font-size: 12px; color: var(--gold-bright);
  display: flex; align-items: center; gap: 8px;
}
.cycle-step span {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; color: #1a1205; font-weight: 700;
  background: linear-gradient(180deg, #ffe6a0, #d4af37);
}

.home-cta {
  position: relative;
  margin-top: 8px;
  padding: 22px 16px 18px;
  border-radius: 20px;
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(212,175,55,0.28);
  background:
    radial-gradient(ellipse 80% 60% at 50% 120%, rgba(212,175,55,0.18), transparent 55%),
    linear-gradient(180deg, rgba(24,18,10,0.95), rgba(8,6,4,0.98));
}
.home-cta-wave {
  position: absolute; left: -10%; right: -10%; bottom: -20px; height: 70px;
  background:
    radial-gradient(ellipse 40% 100% at 20% 100%, rgba(212,175,55,0.2), transparent),
    radial-gradient(ellipse 40% 100% at 70% 100%, rgba(212,175,55,0.12), transparent);
  animation: wavePulse 4s ease-in-out infinite;
}
@keyframes wavePulse {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(-6px); opacity: 1; }
}
.home-cta-kicker {
  position: relative; z-index: 1;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 8px;
}
.home-cta h3 {
  position: relative; z-index: 1;
  font-size: 20px; color: var(--gold-bright); margin-bottom: 8px;
}
.home-cta > p {
  position: relative; z-index: 1;
  font-size: 12px; color: var(--muted); line-height: 1.55;
  margin-bottom: 14px;
}
.home-cta .btn { position: relative; z-index: 1; }
.divider {
  height: 1px; margin: 12px 0;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.35), transparent);
}
.addr {
  font-family: var(--font); font-size: 12px; color: var(--muted);
  word-break: break-all;
}
@media (min-width: 431px) {
  body {
    background:
      radial-gradient(ellipse at 50% 0%, rgba(212,175,55,0.08), transparent 40%),
      #030201;
  }
  .app-shell { border-left: 1px solid rgba(212,175,55,0.12); border-right: 1px solid rgba(212,175,55,0.12); }
}
