/* 天道试炼 · Mobile DApp UI
   Palette: light shanhai — cream yellow cards + green borders */

:root {
  --bg: #f3f0e4;
  --bg-elev: #fff9e6;
  --bg-soft: #fbf7eb;
  --card: #fff8df;
  --line: #a9b892;
  --line-soft: rgba(143, 177, 125, 0.55);
  --text: #2e3726;
  --muted: #55634a;
  --text-soft: #4a5538;
  --purple: #6b9b5a;
  --purple-deep: #4f7d42;
  --purple-glow: rgba(107, 155, 90, 0.28);
  --danger: #c45c5c;
  --ok: #3d8b5a;
  --warn: #b8952f;
  --gold: #c4a35a;
  --radius: 18px;
  --radius-pill: 999px;
  --status-h: 56px;
  --tab-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Noto Sans SC", system-ui, sans-serif;
  --display: "Orbitron", "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #e8e4d4;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Hide scrollbars, keep scroll */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

button, input { font: inherit; color: inherit; border: none; background: none; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* Desktop phone stage */
.phone-stage {
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 24px 12px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(143, 177, 125, 0.22), transparent 55%),
    #e4e0ce;
}

.phone {
  position: relative;
  width: min(100%, 390px);
  height: min(844px, calc(100vh - 48px));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 28%),
    radial-gradient(ellipse at 70% 18%, rgba(168, 196, 140, 0.28), transparent 42%),
    var(--bg);
  border-radius: 36px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(90, 110, 70, 0.12),
    0 28px 64px rgba(70, 85, 50, 0.18);
  display: flex;
  flex-direction: column;
}

/* Logo placements */
.splash {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 22vh 28px calc(28px + var(--safe-b));
  background: #000;
  transition: opacity 0.45s ease, visibility 0.45s;
}
.splash.hide,
.splash.is-gone {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  display: none !important;
}
.splash-brand {
  display: grid;
  gap: 14px;
  justify-items: center;
  width: 100%;
}
.splash-logo {
  margin: 0 auto;
  display: block;
  animation: logoIn 0.7s ease both;
}
.brand-title {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  font-family: "Noto Sans SC", sans-serif;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.12em;
  color: #3f4a2f;
}
.brand-title-line {
  display: block;
}
.splash-logo.brand-title {
  font-size: clamp(34px, 11vw, 48px);
  gap: 6px;
  letter-spacing: 0.16em;
}
.splash-sub {
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.28em;
  color: #9a96a8;
  animation: logoIn 0.7s 0.15s ease both;
}
.brand-title-sm {
  font-size: 13px;
  gap: 1px;
  letter-spacing: 0.08em;
  line-height: 1.15;
}
.brand-logo.brand-title {
  width: auto;
  height: auto;
  object-fit: unset;
  filter: none;
}
.brand-logo.sm.brand-title {
  width: auto;
  margin: 0 auto 10px;
  font-size: 18px;
  gap: 2px;
  letter-spacing: 0.14em;
  filter: none;
}
.splash-load {
  margin-top: auto;
  width: min(78%, 260px);
  display: grid;
  gap: 10px;
  justify-items: center;
  animation: logoIn 0.55s 0.2s ease both;
}
.splash-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(90, 110, 70, 0.14);
  overflow: hidden;
  border: 1px solid rgba(143, 177, 125, 0.35);
}
.splash-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8fbb72, #5a9a4f);
  box-shadow: 0 0 10px rgba(107, 155, 90, 0.35);
  transition: width 0.18s ease;
}
.splash-load-text {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted, #55634a);
}
@keyframes logoIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.brand-hero {
  display: flex;
  justify-content: center;
  padding: 6px 0 2px;
}
.brand-logo {
  width: min(72%, 248px);
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(168, 85, 247, 0.22));
}
.brand-logo.sm {
  width: min(48%, 168px);
  margin: 0 auto 10px;
  filter: drop-shadow(0 0 16px rgba(196, 181, 253, 0.35));
}

@media (max-width: 430px) {
  .phone-stage { padding: 0; background: var(--bg); }
  .phone {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* Status bar */
.status-bar {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  background: rgba(14, 14, 20, 0.82);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  transition: opacity 0.22s ease;
}
.status-bar.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.phone.is-subpage .views,
.phone.is-subpage .view {
  padding-top: 0;
}
.phone.is-draw .views,
.phone.is-draw .view {
  padding-top: 0;
}
.phone.is-subpage .view {
  padding-bottom: calc(var(--safe-b) + 8px);
}

.wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--purple-deep), var(--purple));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  max-width: 46%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 16px var(--purple-glow);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.more-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: #e9e4ff;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.more-btn:hover,
.more-btn[aria-expanded="true"] {
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(168, 85, 247, 0.55);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}
.dot.online {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

/* More drawer */
.more-backdrop {
  position: absolute;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.55);
}
.more-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 56;
  width: min(86%, 320px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 16px calc(18px + var(--safe-b));
  background: linear-gradient(180deg, #16121f 0%, #0a0a10 100%);
  border-left: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.55);
  transform: translateX(100%);
  transition: transform 0.28s ease;
}
.more-drawer.open { transform: translateX(0); }
.more-drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.more-brand-logo {
  width: auto;
  height: auto;
  object-fit: unset;
  border-radius: 0;
  flex-shrink: 0;
  filter: none;
  color: #3f4a2f;
}
.more-drawer-head strong { font-size: 15px; }
.more-nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: none;
}
.more-nav::-webkit-scrollbar { display: none; }
.more-item {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: #e8e4f5;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.more-item:hover,
.more-item:focus-visible { background: rgba(168, 85, 247, 0.16); }
.more-item.sub {
  padding-left: 28px;
  font-size: 13px;
  font-weight: 500;
  color: #c4b5fd;
}
.more-item.lang-opt.active {
  color: #fff;
  background: rgba(168, 85, 247, 0.28);
}
.more-sub { display: flex; flex-direction: column; gap: 2px; }
.more-divider {
  height: 1px;
  margin: 8px 4px;
  background: var(--line);
}
.more-group .more-toggle { justify-content: space-between; }

/* Views */
.views {
  flex: 1;
  overflow: hidden;
  position: relative;
  padding-top: calc(var(--status-h) + 8px);
  padding-bottom: calc(var(--tab-h) + var(--safe-b));
}

.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: calc(var(--status-h) + 8px);
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  -webkit-overflow-scrolling: touch;
}
.view.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  z-index: 2;
}
.view.subpage { z-index: 5; background: var(--bg); }

#view-home {
  background-color: var(--bg);
  background-image: url("../assets/bg-home.webp");
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
  padding-top: calc(var(--status-h) + 14px);
}
#view-home .page-pad {
  position: relative;
  z-index: 1;
  padding: 12px 14px 8px;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
#view-home .ling-panel {
  margin-top: 0;
  margin-bottom: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#view-home .ling-panel-head {
  margin-bottom: 8px;
  gap: 8px;
  flex-shrink: 0;
}
#view-home .ling-panel-head h2 {
  font-size: 16px;
}
#view-home .ling-panel-head .muted {
  margin-top: 2px;
  font-size: 11px;
}
#view-home .ling-live {
  padding: 4px 8px;
  font-size: 9px;
}
#view-home .ling-hero {
  min-height: 180px;
  flex: 1 1 auto;
  max-height: 240px;
  margin: 0;
  padding: 0;
}
#view-home .ling-gem-wrap {
  width: min(78%, 280px);
}
#view-home .draw-entry-home {
  margin-top: -48px;
  margin-bottom: 8px;
  min-height: 0;
  padding: 8px 12px;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  border-radius: 14px;
  flex-shrink: 0;
}
#view-home .draw-entry-home .presale-entry-art {
  width: 48px;
  height: 48px;
}
#view-home .draw-entry-home .presale-entry-text strong {
  font-size: 14px;
}
#view-home .draw-entry-home .presale-entry-text .muted {
  font-size: 10px;
}
#view-home .ling-metric-grid {
  gap: 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
}
#view-home .ling-metric {
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
}
#view-home .ling-metric-ico {
  width: 34px;
  height: 34px;
}
#view-home .ling-metric-label {
  font-size: 10px;
}
#view-home .ling-metric-val {
  font-size: 15px;
}
#view-home .ling-metric-price .ling-metric-val {
  font-size: 14px;
}
#view-home .ling-metric-sub {
  font-size: 10px;
}
#view-home .ling-flow-card {
  padding: 10px 12px;
  border-radius: 14px;
  margin-top: 0;
  flex-shrink: 0;
}
#view-home .ling-flow-title {
  font-size: 12px;
  margin-bottom: 8px;
}
#view-home .ling-stack-bar {
  height: 8px;
  margin-bottom: 8px;
}
#view-home .ling-flow-legend {
  margin: 0;
  gap: 6px 10px;
}
#view-home .ling-flow-legend li {
  font-size: 10px;
  gap: 5px;
}

.page-pad {
  padding: 8px 18px 24px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.eyebrow.glow {
  color: #d8b4fe;
  text-shadow: 0 0 18px var(--purple-glow);
}

.muted { color: var(--muted); font-size: 13px; }
.accent-text { color: #d8b4fe; }

/* Home */
.hero-price {
  text-align: center;
  padding: 10px 0 8px;
}
.hero-price .price {
  font-family: var(--display);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff 30%, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.price-change {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
}
.price-change.up { color: var(--ok); }
.price-change.down { color: var(--danger); }

/* Presale / draw entry on Home */
.presale-entry,
.draw-entry {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin: 12px 0 4px;
  padding: 10px 12px;
  border-radius: 18px;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.28), rgba(14, 14, 20, 0.95)),
    var(--bg-elev);
  border: 1px solid rgba(168, 85, 247, 0.4);
  box-shadow: 0 8px 28px rgba(88, 28, 135, 0.25);
}
.draw-entry-home {
  position: relative;
  z-index: 5;
  margin-top: -64px;
  margin-bottom: 12px;
  min-height: 84px;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.draw-entry-home * {
  pointer-events: none;
}
.presale-entry:active,
.draw-entry:active { transform: scale(0.98); }
.presale-entry-art {
  width: 64px;
  height: 64px;
  border-radius: 0;
  object-fit: contain;
  display: block;
  box-shadow: none;
  background: transparent;
}
.presale-entry-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.presale-entry-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fbbf24;
}
.presale-entry-text strong {
  font-size: 15px;
  font-weight: 800;
}
.presale-entry-text .muted { font-size: 11px; }
.presale-entry-chev {
  font-size: 26px;
  color: var(--purple-deep);
  font-weight: 300;
}

.zodiac-draw-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0 !important;
}
.zodiac-draw-view .sub-header {
  position: relative;
  z-index: 3;
  background: transparent;
  flex-shrink: 0;
}
.zodiac-draw-page {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  --zodiac-up: 14%;
}
.zodiac-draw-page::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 52%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 12, 16, 0.45) 55%, rgba(10, 12, 16, 0.72) 100%);
}
.zodiac-circle-video {
  position: absolute;
  top: calc(var(--zodiac-up) * -1);
  left: 0;
  right: 0;
  width: 100%;
  height: calc(100% + var(--zodiac-up));
  object-fit: cover;
  object-position: center 32%;
  display: block;
  background: #0a0c10;
  pointer-events: none;
  z-index: 0;
}
.zodiac-orbit {
  position: absolute;
  top: calc(var(--zodiac-up) * -1);
  left: 0;
  right: 0;
  height: calc(100% + var(--zodiac-up));
  z-index: 1;
  display: grid;
  place-items: center;
  padding-bottom: 0;
  transform: translateY(-7%);
  pointer-events: none;
}
.zodiac-orbit-ring {
  --orbit-r: min(30vw, 125px);
  --orbit-spin: 28s;
  --orbit-node: min(22vw, 92px);
  position: relative;
  width: calc(var(--orbit-r) * 2);
  height: calc(var(--orbit-r) * 2);
  animation: zodiacOrbitSpin var(--orbit-spin) linear infinite;
}
.orbit-slot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: rotate(calc(var(--i) * 60deg)) translateY(calc(var(--orbit-r) * -1));
}
.orbit-spin-fix {
  animation: zodiacOrbitSpin var(--orbit-spin) linear infinite reverse;
}
.orbit-face {
  transform: rotate(calc(var(--i) * -60deg));
}
.orbit-node {
  position: relative;
  width: var(--orbit-node);
  height: var(--orbit-node);
  margin: calc(var(--orbit-node) / -2) 0 0 calc(var(--orbit-node) / -2);
  transform: scale(1);
  opacity: 1;
  transform-origin: center center;
  overflow: visible;
  transition: transform 0.65s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.55s ease;
  pointer-events: auto;
}
.orbit-node.is-vanishing {
  transform: scale(0);
  opacity: 0;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.7, 0.2), opacity 0.5s ease;
}
.orbit-node.is-appearing {
  animation: zodiacOrbitPop 0.7s cubic-bezier(0.34, 1.35, 0.64, 1) both;
}
.orbit-vortex {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
  filter: drop-shadow(0 0 8px rgba(255, 210, 90, 0.55));
  pointer-events: none;
  user-select: none;
}
.orbit-payload {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 8%;
  top: -18%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
.orbit-beast {
  width: 85%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: bottom center;
  display: block;
  transform-origin: bottom center;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.28));
  pointer-events: none;
  user-select: none;
  background: transparent;
}
.orbit-node.is-vanishing .orbit-beast {
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.7, 0.2), opacity 0.5s ease;
  transform: scale(0);
  opacity: 0;
  transform-origin: bottom center;
}
.orbit-node.is-appearing .orbit-beast {
  animation: zodiacBeastPop 0.7s cubic-bezier(0.34, 1.35, 0.64, 1) both;
  transform-origin: bottom center;
}
@keyframes zodiacBeastPop {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes zodiacOrbitSpin {
  to { transform: rotate(360deg); }
}
@keyframes zodiacOrbitPop {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .zodiac-orbit-ring,
  .orbit-spin-fix { animation: none; }
}
.zodiac-draw-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10%;
  z-index: 2;
  padding: 0 12px calc(12px + var(--safe-b));
  background: none;
}
.zodiac-summon-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.summon-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 156px;
  padding: 12px 8px 10px;
  border: 2px solid rgba(196, 163, 90, 0.55);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 252, 242, 0.96) 0%, rgba(245, 236, 214, 0.94) 72%, rgba(232, 220, 190, 0.92) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.65),
    0 8px 18px rgba(0, 0, 0, 0.22);
  color: #3f3428;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
.summon-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(196, 163, 90, 0.35);
  border-radius: 12px;
  pointer-events: none;
}
.summon-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(143, 177, 125, 0.18), transparent 70%),
    linear-gradient(180deg, transparent, rgba(120, 100, 70, 0.08));
  pointer-events: none;
}
.summon-card:active { transform: scale(0.98); }
.summon-card-title {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #4a3a22;
}
.summon-card-medallion {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 88px;
  display: grid;
  place-items: center;
}
.summon-medallion-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.summon-medallion-img[src] ~ .summon-medallion-fallback,
.summon-medallion-img[src] ~ .summon-medallion-tassel {
  display: none;
}
.summon-medallion-fallback {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 900;
  color: #c4a35a;
  background:
    radial-gradient(circle at 35% 30%, #dff5d0, #7fb068 58%, #4f8f52 100%);
  border: 3px solid #d4b56a;
  box-shadow: 0 4px 12px rgba(70, 100, 50, 0.25);
}
.summon-medallion-tassel {
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 14px;
  height: 18px;
  margin-left: -7px;
  background: linear-gradient(180deg, #d4b56a, #a8843f);
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
}
.summon-card-cost {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 72px;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(196, 163, 90, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 14px;
  font-weight: 800;
  color: #4a3a22;
}
.summon-cost-ico {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: none;
}
.summon-cost-ico[src] {
  display: block;
}
.summon-cost-ico[src] ~ .summon-cost-fallback {
  display: none;
}
.summon-cost-fallback {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f6e6b4, #d4b56a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.summon-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 28px solid #e07a2f;
  border-left: 28px solid transparent;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* Presale page */
.presale-body { padding-bottom: 36px; }
.presale-title {
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  margin: 4px 0 16px;
  color: var(--text);
}
.presale-marquee {
  overflow: hidden;
  margin: 0 -18px 18px;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.presale-track {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: presaleScroll 22s linear infinite;
}
.presale-track:hover { animation-play-state: paused; }
@keyframes presaleScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.presale-card {
  flex: 0 0 148px;
  width: 148px;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  background: #0a0a10;
}
.presale-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.presale-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}
.presale-timer strong {
  font-family: var(--display);
  font-size: 20px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.presale-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.presale-stats > div {
  text-align: center;
  padding: 12px 6px;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.presale-stats span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.presale-stats strong { font-size: 14px; }
.presale-beasts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.presale-beast {
  text-align: center;
}
.presale-beast img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(212, 175, 55, 0.35);
  margin-bottom: 4px;
}
.presale-beast span {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
}
.presale-note {
  text-align: center;
  font-size: 12px;
  margin-top: 12px;
  line-height: 1.5;
}

.meters { display: grid; gap: 14px; margin: 18px 0 22px; }
.meter {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.meter.block { margin-top: 16px; }
.meter-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 10px;
  color: var(--muted);
}
.meter-val { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.meter-val.warn { color: var(--warn); }
.meter-hint { margin-top: 8px; font-size: 11px; color: var(--muted); }

.track {
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  position: relative;
}
.fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.5s ease;
}
.fill.purple {
  background: linear-gradient(90deg, var(--purple-deep), var(--purple));
  box-shadow: 0 0 12px var(--purple-glow);
}
.fill.violet {
  background: linear-gradient(90deg, #6d28d9, #c084fc);
}

.track.dual {
  overflow: visible;
  background: linear-gradient(
    90deg,
    rgba(244, 63, 94, 0.35) 0%,
    rgba(52, 211, 153, 0.35) 18%,
    rgba(52, 211, 153, 0.35) 82%,
    rgba(244, 63, 94, 0.35) 100%
  );
}
.track.dual .zone.safe {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 0;
  bottom: 0;
  border-left: 1px dashed rgba(255, 255, 255, 0.2);
  border-right: 1px dashed rgba(255, 255, 255, 0.2);
}
.needle {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 18px;
  margin-left: -2px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.trade-panel {
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, #12121a, #0a0a10);
  border: 1px solid var(--line);
}

.ling-panel {
  margin-top: 8px;
  margin-bottom: 12px;
}
.ling-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.ling-panel-head h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.ling-dollar {
  color: #86efac;
  font-weight: 800;
  margin: 0 2px;
}
.ling-panel-head .muted {
  margin-top: 4px;
  font-size: 12px;
}
.ling-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.ling-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: lingPulse 1.4s ease-in-out infinite;
}
@keyframes lingPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.ling-hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 240px;
  margin: 4px 0 0;
  padding: 4px 4px 0;
  z-index: 1;
  pointer-events: none;
}
.ling-gem-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(92%, 320px);
  pointer-events: none;
}
.ling-gem {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 16px rgba(70, 100, 50, 0.16));
  animation: lingGemFloat 4.5s ease-in-out infinite;
}
@keyframes lingGemFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.ling-scroll {
  position: absolute;
  left: 0;
  top: 22%;
  z-index: 2;
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.ling-scroll-rod {
  width: 40px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #8b6914, #5c4510);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.ling-scroll-rod.bot { margin-top: -1px; }
.ling-scroll-body {
  width: 32px;
  margin: -1px 0;
  padding: 14px 4px 16px;
  background:
    linear-gradient(90deg, rgba(139, 105, 20, 0.12), transparent 30%),
    linear-gradient(180deg, #f7f0d8, #efe4c4);
  border-left: 1px solid rgba(139, 105, 20, 0.25);
  border-right: 1px solid rgba(139, 105, 20, 0.25);
  box-shadow: 2px 4px 10px rgba(70, 85, 50, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ling-scroll-body span {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: #4a3a22;
  line-height: 1.2;
}

.ling-price-card {
  position: relative;
  z-index: 3;
  overflow: hidden;
  padding: 18px 18px 16px;
  margin-top: -64px;
  margin-bottom: 12px;
  border-radius: 22px;
  border: 1px solid rgba(168, 85, 247, 0.4);
  background:
    radial-gradient(ellipse at 80% 0%, rgba(52, 211, 153, 0.18), transparent 45%),
    radial-gradient(ellipse at 10% 100%, rgba(124, 58, 237, 0.45), transparent 50%),
    linear-gradient(160deg, #1a1030, #0a0a12 70%);
}
.ling-price-glow {
  position: absolute;
  inset: auto -20% -40% 20%;
  height: 120px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.35), transparent 70%);
  pointer-events: none;
  animation: lingGlow 4s ease-in-out infinite alternate;
}
@keyframes lingGlow {
  from { opacity: 0.55; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(12px); }
}
.ling-price-label {
  position: relative;
  font-size: 12px;
  color: #a5a0b8;
  margin-bottom: 6px;
}
.ling-price-value {
  position: relative;
  font-family: var(--display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 28px rgba(134, 239, 172, 0.25);
}
.ling-price-meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  color: #9b96ad;
}
.ling-price-meta .up {
  color: #34d399;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
}
.ling-price-meta .sep { opacity: 0.5; }
.ling-price-meta strong { color: #e9e4ff; font-weight: 700; }

.ling-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.ling-metric {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 18px;
  border: 1px solid rgba(168, 85, 247, 0.28);
  background: linear-gradient(165deg, rgba(36, 22, 58, 0.95), rgba(12, 12, 20, 0.98));
  min-height: 0;
}
.ling-metric::after { display: none; }
.ling-metric-ico {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
  border-radius: 0;
  background: transparent;
  margin: 0;
}
.ling-metric-body {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.ling-metric-label {
  font-size: 11px;
  color: #9b96ad;
  letter-spacing: 0.04em;
}
.ling-metric-val {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: #f8f5ff;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ling-metric-price .ling-metric-val {
  font-size: 17px;
  letter-spacing: 0.01em;
}
.ling-metric-sub {
  font-size: 11px;
  color: #7c7693;
}

.ling-flow-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(168, 85, 247, 0.28);
  background: linear-gradient(180deg, #14101e, #0b0b12);
}
.ling-flow-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #e8e4f5;
}
.ling-stack-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 14px;
}
.ling-stack-bar .seg { height: 100%; }
.ling-stack-bar .circ { background: linear-gradient(90deg, #a78bfa, #7c3aed); }
.ling-stack-bar .hole { background: linear-gradient(90deg, #64748b, #1e293b); }
.ling-stack-bar .burn { background: linear-gradient(90deg, #fb7185, #e11d48); }
.ling-stack-bar .rest { background: rgba(255, 255, 255, 0.08); }

.ling-flow-legend {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.ling-flow-legend li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #a5a0b8;
}
.ling-flow-legend strong {
  color: #f3e8ff;
  font-variant-numeric: tabular-nums;
}
.ling-flow-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.ling-flow-legend .dot.circ { background: #8b5cf6; }
.ling-flow-legend .dot.hole { background: #64748b; }
.ling-flow-legend .dot.burn { background: #f43f5e; }
.ling-flow-legend .dot.rest { background: rgba(255, 255, 255, 0.25); }

.ling-bars { display: flex; flex-direction: column; gap: 12px; }
.ling-bar-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
.ling-bar-head em {
  font-style: normal;
  color: var(--text);
  font-weight: 700;
}
.ling-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(143, 177, 125, 0.18);
  overflow: hidden;
}
.ling-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.ling-bar-track i.hole {
  background: linear-gradient(90deg, #94a3b8, #334155);
}
.ling-bar-track i.burn {
  background: linear-gradient(90deg, #fb7185, #be123c);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.35);
}

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 16px;
}
.seg-btn {
  padding: 10px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: 0.2s;
}
.seg-btn.active {
  background: #fff;
  color: #0a0a0c;
}

.field { display: block; margin-bottom: 12px; }
.field-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.field-row input {
  flex: 1;
  min-width: 0;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}
.field-row input::-webkit-outer-spin-button,
.field-row input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
  display: none;
}
.field-row input::placeholder { color: #8a9580; }
.field-row.readonly { font-size: 22px; font-weight: 700; color: var(--text); }
.chip {
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: rgba(107, 155, 90, 0.15);
  color: var(--purple-deep);
  font-size: 11px;
  font-weight: 700;
}

/* Buttons */
.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.38; pointer-events: none; }
.btn.lg, .btn.xl, .btn.full { width: 100%; }
.btn.xl { padding: 11px 16px; font-size: 16px; gap: 1px; }
.btn-sub { font-size: 11px; font-weight: 500; opacity: 0.85; }

.btn.primary {
  background: linear-gradient(135deg, var(--purple-deep), var(--purple));
  color: #fff;
  box-shadow: 0 8px 28px var(--purple-glow);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
}
.btn.danger {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
}
.btn.pulse {
  animation: pulseGlow 2.4s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 8px 28px var(--purple-glow); }
  50% { box-shadow: 0 8px 40px rgba(168, 85, 247, 0.75); }
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.icon-btn.sm { width: 32px; height: 32px; font-size: 13px; }

/* Draw / Storm */
#view-draw {
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: calc((var(--tab-h) + var(--safe-b) + 8px) * -1);
  height: calc(100% + var(--tab-h) + var(--safe-b) + 8px);
  overflow: hidden;
}
.draw-stage {
  position: relative;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}
.storm {
  position: absolute;
  inset: 7% 6%;
  pointer-events: none;
  background: #000;
  overflow: hidden;
}
.storm::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, #000 0%, transparent 22%, transparent 78%, #000 100%),
    linear-gradient(180deg, #000 0%, transparent 20%, transparent 80%, #000 100%);
}
.lightning-container,
.trial-lightning-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
}

.draw-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-top: calc(env(safe-area-inset-top, 0px) + 18px);
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 20px);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  color: #f2f6ee;
}
.draw-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  padding-top: 4px;
}
.draw-head .brand-logo.sm {
  margin-bottom: 4px;
}
.draw-title {
  font-size: 22px;
  font-weight: 900;
  margin: 4px 0 0;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}
.draw-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
  width: min(100%, 320px);
  margin-top: auto;
  margin-bottom: 22%;
  padding-bottom: 0;
  transform: translateY(-28px);
}

.synth-ticker {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(8, 14, 22, 0.55);
  border: 1px solid rgba(140, 200, 255, 0.28);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.synth-ticker-track {
  display: flex;
  gap: 28px;
  width: max-content;
  padding: 8px 0;
  animation: synthTickerScroll 28s linear infinite;
}
@keyframes synthTickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.synth-ticker-item {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: rgba(235, 245, 255, 0.92);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 8px rgba(60, 140, 255, 0.35);
}
.synth-ticker-item em {
  font-style: normal;
  color: #9fd4ff;
}
.synth-ticker-item strong {
  color: #ffe08a;
  font-weight: 800;
}

.timer-dial {
  position: relative;
  display: grid;
  place-items: center;
  margin: 0 auto;
  width: 236px;
  height: 236px;
}
.dial-lightning {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 0;
  pointer-events: none;
  animation: dialLightningSpin 12s linear infinite;
  filter: drop-shadow(0 0 12px rgba(80, 180, 255, 0.45));
}
@keyframes dialLightningSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.dial-ring {
  position: relative;
  z-index: 1;
  width: 164px;
  height: 164px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1px;
  padding: 12px;
  background: rgba(255, 252, 245, 0.94);
  border: 2px solid rgba(168, 196, 140, 0.75);
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.08),
    0 8px 28px rgba(0, 0, 0, 0.35),
    inset 0 0 20px rgba(168, 196, 140, 0.18);
  animation: dialPulse 3s ease-in-out infinite;
}
@keyframes dialPulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.08), 0 8px 28px rgba(0, 0, 0, 0.35), inset 0 0 20px rgba(168, 196, 140, 0.18); }
  50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.12), 0 10px 36px rgba(0, 0, 0, 0.42), inset 0 0 24px rgba(168, 196, 140, 0.24); }
}
.prize-dial .dial-sub {
  font-size: 10px;
  color: #55634a;
  margin-bottom: 1px;
}
.prize-dial .dial-time {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  color: #2e3726;
  line-height: 1.1;
  margin-bottom: 6px;
}
.prize-dial .pool-label {
  font-size: 10px;
  color: #6a785c;
}
.prize-dial .pool-val {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #3d6b32;
  text-shadow: none;
  line-height: 1.15;
}
.prize-dial .pool-val small {
  font-size: 11px;
  color: #55634a;
  font-weight: 500;
}

.draw-actions { display: grid; gap: 12px; }
.batch-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.batch-row .btn { flex-direction: row; }

/* Inventory */
.subtabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.subtab {
  position: relative;
  padding: 12px 8px 10px;
  border-radius: 0;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-soft);
  background: transparent;
}
.subtab.active {
  color: var(--text);
  background: transparent;
}
.subtab.active::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--purple);
}

.inv-panel { display: none; }
.inv-panel.active { display: block; }

/* Vortex stage — video + orbiting card backs */
.vortex-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1.15 / 1;
  max-height: 280px;
  margin: 0 0 14px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: #050508;
  box-shadow: 0 12px 36px rgba(88, 28, 135, 0.35), inset 0 0 40px rgba(124, 58, 237, 0.2);
  isolation: isolate;
  transform: translateZ(0);
}
.vortex-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  z-index: 0;
}
.vortex-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, transparent 28%, rgba(5, 5, 8, 0.35) 62%, rgba(5, 5, 8, 0.75) 100%);
  pointer-events: none;
  z-index: 1;
}
.vortex-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  z-index: 2;
  animation: vortexSpin 24s linear infinite;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
@keyframes vortexSpin {
  from { transform: rotate(0deg) translate3d(0, 0, 0); }
  to { transform: rotate(360deg) translate3d(0, 0, 0); }
}
.vortex-slot {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform: rotate(var(--a)) translate3d(0, var(--r), 0);
}
/* 同速反向：抵消公转；再静态抵消槽位角，卡片永远正向朝上 */
.vortex-keep {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  animation: vortexSpin 24s linear infinite reverse;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
.vortex-card {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.5);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
  /* 抵消槽位自身的 rotate(a)，保证画面始终正立 */
  transform: rotate(calc(var(--a) * -1)) translate3d(0, 0, 0);
  backface-visibility: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.vortex-card.is-filled {
  border-color: rgba(168, 85, 247, 0.85);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.55), 0 6px 14px rgba(0, 0, 0, 0.5);
}
.vortex-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: opacity 0.2s ease, transform 0.28s ease;
}
.vortex-card.flash img {
  animation: vortexReveal 0.35s ease;
}
@keyframes vortexReveal {
  0% { transform: scale(0.6); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .vortex-orbit,
  .vortex-keep {
    animation: none !important;
  }
}

.mythic-picker-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  margin: 0 0 8px;
}
.mythic-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  margin: 0 -2px 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.mythic-tier {
  flex: 0 0 120px;
  scroll-snap-align: start;
  display: grid;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.mythic-tier.is-on {
  border-color: var(--purple-deep);
  background: rgba(107, 155, 90, 0.1);
  box-shadow: 0 0 0 1px rgba(79, 125, 66, 0.22);
}
.mythic-tier-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  border: none;
}
.mythic-tier-art .card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
}
.mythic-tier-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.mythic-tier-body strong {
  font-size: 11px;
  color: var(--purple-deep);
  line-height: 1.2;
}
.mythic-tier-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.mythic-tier-meta {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.25;
}
.synth-banner {
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.synth-banner-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.synth-count strong {
  color: var(--purple-deep);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.synth-track { height: 8px; }
.synth-incubate-list {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
}
.synth-incubate-list[hidden] {
  display: none !important;
}
.synth-incubate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 2px;
}
.synth-incubate-head em {
  font-style: normal;
  color: var(--purple-deep);
  font-weight: 800;
}
.synth-incubate-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(107, 155, 90, 0.1);
  color: var(--purple-deep);
  font-size: 11px;
  font-weight: 700;
}
.synth-incubate-caret {
  font-style: normal;
  font-size: 9px;
  line-height: 1;
  opacity: 0.85;
}
.synth-incubate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}
.synth-incubate-row + .synth-incubate-row {
  border-top: 1px dashed rgba(169, 184, 146, 0.45);
  padding-top: 6px;
}
.synth-incubate-row strong {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.synth-incubate-row em {
  font-style: normal;
  font-weight: 800;
  color: var(--purple-deep);
}
.synth-incubate-row.is-done strong {
  color: var(--purple-deep);
}
.synth-tip {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.beast-card {
  position: relative;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1.5px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 6px 6px 8px;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.beast-card:active { transform: scale(0.97); }
.beast-card.has-pick {
  border-color: rgba(107, 155, 90, 0.65);
  box-shadow: 0 0 0 1px rgba(107, 155, 90, 0.22);
}
.beast-card.full-pick {
  border-color: var(--purple-deep);
  box-shadow: 0 0 0 2px rgba(79, 125, 66, 0.28), 0 6px 18px rgba(79, 125, 66, 0.14);
}
.beast-card.empty {
  opacity: 0.35;
  pointer-events: none;
}
.beast-card .art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f5f0e4;
}
.beast-card .art .card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.card-img.chip {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
}
.card-img.hero {
  width: 100%;
  max-width: 200px;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 14px;
  margin: 0 auto;
  filter: drop-shadow(0 6px 18px rgba(60, 70, 50, 0.16));
}
.beast-card .name {
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
}
.beast-card.has-pick .name,
.beast-card.full-pick .name {
  color: var(--purple-deep);
}
.beast-card .qty {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: rgba(255, 251, 235, 0.94);
  border: 1px solid rgba(143, 177, 125, 0.55);
  color: var(--purple-deep);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(70, 85, 50, 0.08);
}
.beast-card .pick-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  min-width: 34px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 251, 235, 0.94);
  border: 1px solid rgba(143, 177, 125, 0.55);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-soft);
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(70, 85, 50, 0.08);
}
.beast-card.has-pick .pick-badge {
  background: linear-gradient(135deg, var(--purple-deep), var(--purple));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(79, 125, 66, 0.22);
}
.beast-card .card-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}
.beast-card .step-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(107, 155, 90, 0.12);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 700;
}
.beast-card .step-btn.plus { color: var(--purple-deep); }
.beast-card .step-btn:disabled { opacity: 0.3; }

.sel-preview {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.sel-preview-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 8px;
}
.sel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-pill);
  background: rgba(107, 155, 90, 0.12);
  border: 1px solid rgba(107, 155, 90, 0.28);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}
.sel-chip .card-img.chip {
  background: #f7f4ea;
  border: 1px solid var(--line-soft);
}

.inv-spacer { height: 130px; }

/* Inventory: scroll content + fixed dock at bottom */
#view-inventory {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#view-inventory .inv-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.inv-dock {
  position: relative;
  flex-shrink: 0;
  margin: 8px 12px 0;
  z-index: 15;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(14, 14, 20, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  display: none;
}
#view-inventory.active #invDock.visible { display: block; }
.dock-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dock-btns .btn {
  flex-direction: column;
  font-size: 13px;
  padding: 8px 8px;
  gap: 1px;
  min-height: 0;
  line-height: 1.2;
}
.dock-btns .btn .btn-sub {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.75;
  line-height: 1.1;
}
.dock-clear {
  margin-top: 8px;
  padding: 10px;
  font-size: 12px;
}

.miner-list { display: grid; gap: 12px; }
.empty-miners {
  text-align: center;
  padding: 48px 20px;
  border-radius: 18px;
  background: var(--bg-elev);
  border: 1px dashed var(--line);
}
.empty-miners .empty-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.empty-miners p { font-weight: 700; margin-bottom: 4px; }
.empty-miners .btn { margin-top: 16px; max-width: 160px; margin-inline: auto; }
.miner-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.miner-head {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  align-items: start;
}
.miner-item .art {
  width: 84px;
  height: 84px;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  border: none;
}
.miner-item .art .card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: transparent;
  display: block;
}
.miner-meta {
  min-width: 0;
  display: grid;
  gap: 8px;
}
.miner-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.miner-item h4 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}
.miner-item .miner-meta > .miner-top p {
  font-size: 11px;
  color: var(--muted);
  margin: 2px 0 0;
}
.weight-badge {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(107, 155, 90, 0.15);
  color: var(--purple-deep);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.miner-life-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.miner-life-row strong {
  font-family: var(--display);
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
}
.miner-life-row small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}
.miner-life-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(90, 110, 70, 0.12);
  overflow: hidden;
}
.miner-life-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7fb068, #4f8f52);
}
.miner-life-tip {
  margin: 4px 0 0;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.2;
}
.miner-burn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(180, 120, 60, 0.08);
  border: 1px solid rgba(160, 110, 55, 0.22);
}
.miner-burn-info {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.miner-burn-label {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}
.miner-burn-amt {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
}
.miner-burn-tip {
  flex-basis: 100%;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
}
.miner-burn-btn {
  flex-shrink: 0;
  min-width: 64px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(160, 110, 55, 0.45);
  background: linear-gradient(135deg, #f0dfc0, #e4c896);
  color: #5a3d18;
  font-size: 12px;
  font-weight: 800;
}
.miner-burn-btn:disabled {
  opacity: 0.55;
  background: rgba(255, 255, 255, 0.65);
  border-color: var(--line);
  color: var(--muted);
  cursor: default;
}
.miner-burn-btn.is-done {
  opacity: 0.7;
}
.miner-claim {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(107, 155, 90, 0.08);
  border: 1px solid rgba(107, 155, 90, 0.18);
}
.miner-claim-label em {
  font-style: normal;
  color: var(--purple-deep);
  font-weight: 800;
}
.miner-claim-info {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.miner-claim-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.miner-claim-label {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}
.miner-claim-side {
  flex-shrink: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
}
.miner-claim-cd {
  font-family: var(--display);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.miner-claim-amt {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: 0.01em;
}
.miner-claim-amt small {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}
.miner-reinvest-status {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.miner-reinvest-status.is-on {
  color: var(--purple-deep);
}
.miner-claim-btn {
  flex-shrink: 0;
  min-width: 64px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(107, 155, 90, 0.55);
  background: linear-gradient(135deg, #dcebc8, #c5dbad);
  color: var(--purple-deep);
  font-size: 12px;
  font-weight: 800;
}
.miner-claim-btn:disabled {
  opacity: 0.55;
  background: rgba(255, 255, 255, 0.65);
  border-color: var(--line);
  color: var(--muted);
  cursor: default;
}

/* Mining */
.mine-overview {
  text-align: center;
  padding: 20px 16px 16px;
  border-radius: 22px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.mine-platform-val {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  margin: 6px 0 14px;
  line-height: 1.15;
  color: var(--text);
}
.mine-platform-val small {
  display: block;
  margin-top: 4px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.mine-earn-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mine-earn-cell {
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(107, 155, 90, 0.08);
  border: 1px solid rgba(107, 155, 90, 0.18);
  text-align: center;
}
.mine-earn-cell span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.mine-earn-cell strong {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.mine-earn-cell em {
  font-style: normal;
}
.mine-earn-cell small {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.reinvest-timer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  margin-top: 12px;
}
.rt-left { flex: 1; min-width: 0; }
.rt-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.rt-time {
  font-family: var(--display);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.reinvest-timer .btn {
  flex-shrink: 0;
  padding: 8px 16px;
  min-width: 72px;
}

.info-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.info-strip > div {
  text-align: center;
  padding: 12px 6px;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.info-strip span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.info-strip strong { font-size: 15px; }
.mine-asset-strip { margin-top: 0; }
.mine-extra-strip { margin-bottom: 12px; }
.mine-claim-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: rgba(107, 155, 90, 0.08);
  border: 1px solid rgba(107, 155, 90, 0.2);
}
.mine-claim-info {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.mine-claim-info span {
  font-size: 11px;
  color: var(--muted);
}
.mine-claim-info strong {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.mine-claim-info em { font-style: normal; }
.mine-claim-info small {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.mine-claim-bar .btn {
  flex-shrink: 0;
  padding: 8px 16px;
}
.mine-claim-bar .btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.mine-claim-trainer {
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(196, 140, 70, 0.14), rgba(180, 120, 60, 0.06));
  border-color: rgba(160, 110, 55, 0.28);
}
.trainer-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 4px 6px 4px 4px;
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.trainer-entry:active {
  background: rgba(160, 110, 55, 0.1);
  transform: scale(0.99);
}
.trainer-entry-art {
  flex-shrink: 0;
  width: 58px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 250, 235, 0.9);
  border: 1px solid rgba(160, 110, 55, 0.28);
  box-shadow: 0 4px 12px rgba(120, 80, 30, 0.16);
  display: grid;
  place-items: center;
}
.trainer-entry-art img,
.trainer-entry-art .card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #eef6ef;
}
.trainer-entry-art.is-empty {
  background: repeating-linear-gradient(
    -45deg,
    rgba(180, 140, 80, 0.08),
    rgba(180, 140, 80, 0.08) 6px,
    rgba(180, 140, 80, 0.16) 6px,
    rgba(180, 140, 80, 0.16) 12px
  );
}
.trainer-entry-placeholder {
  font-size: 22px;
  font-weight: 800;
  color: rgba(140, 95, 40, 0.55);
}
.trainer-entry-info {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.trainer-entry-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.trainer-entry-amt {
  font-style: normal;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}
.trainer-entry-amt small {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.trainer-entry-hint {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(140, 95, 40, 0.9);
}
.mine-claim-trainer .btn {
  align-self: center;
}
.trainer-sheet {
  max-height: min(78vh, 640px);
}
.trainer-sheet .trainer-pick-list {
  margin: 4px 0 12px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.trainer-action-sheet .trainer-action-card {
  margin: -4px 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(140, 95, 40, 0.95);
}
.trainer-action-sheet .field {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
}
.trainer-action-sheet .field-label em {
  font-style: normal;
  font-weight: 800;
  color: var(--text);
}
.trainer-action-amt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.trainer-action-amt input {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
}
.trainer-action-amt .chip {
  flex: 0 0 auto;
  cursor: pointer;
  border: 0;
}
.trainer-action-tip {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.trainer-action-btns {
  margin-top: 0;
}
.trainer-pick-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.trainer-pick-card {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.trainer-pick-card:active {
  transform: scale(0.98);
}
.trainer-pick-card.is-on {
  border-color: rgba(160, 110, 55, 0.6);
  background: rgba(180, 120, 60, 0.12);
  box-shadow: 0 0 0 1px rgba(160, 110, 55, 0.2);
}
.trainer-pick-card-art {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 250, 235, 0.85);
}
.trainer-pick-card-art .card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #eef6ef;
}
.trainer-pick-card strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.trainer-pick-card span {
  font-size: 11px;
  color: var(--muted);
}
.trainer-pick-card em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: rgba(140, 95, 40, 0.95);
}
#view-mining .btn.full {
  width: 100%;
  padding: 10px 16px;
}
.mine-cards-block {
  margin-top: 4px;
  padding-bottom: 8px;
}
.mine-cards-block .mythic-picker-label {
  margin-bottom: 10px;
}
#view-mining .page-pad {
  padding-bottom: 24px;
}

/* Profile */
.profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-top: 6px;
}
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(145deg, var(--purple-deep), #312e81);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.profile-name { font-size: 20px; font-weight: 900; }
.addr-line { font-size: 13px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.profile-head > div:nth-child(2) { flex: 1; }

.promo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.promo-cell {
  padding: 16px;
  border-radius: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.promo-cell.wide { grid-column: 1 / -1; }
.promo-cell span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.promo-cell strong {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.promo-cell small { font-size: 13px; color: var(--muted); font-weight: 500; }

.entry-list {
  margin-top: 18px;
  display: grid;
  gap: 2px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  text-align: left;
  width: 100%;
}
.entry:last-child { border-bottom: none; }
.chev {
  color: var(--muted);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  transform: translateY(-1px);
}

/* Subpages */
.sub-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(5, 5, 8, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.sub-header h2 { flex: 1; font-size: 17px; font-weight: 800; text-align: center; }
.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  padding: 0;
  flex-shrink: 0;
}
.back-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}
.spacer-r { width: 32px; }

.node-banner {
  padding: 18px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(15, 15, 24, 0.9)),
    var(--bg-elev);
  border: 1px solid rgba(168, 85, 247, 0.3);
  margin-bottom: 20px;
}
.node-banner h3 { font-size: 22px; margin-bottom: 14px; }
.node-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.node-stats span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.node-stats strong { font-size: 13px; }

.section-title {
  font-size: 15px;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 700;
}

.team-levels { display: grid; gap: 8px; }
.level-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.level-row .lv {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-deep);
}
.level-row .meta span { display: block; font-size: 11px; color: var(--muted); }
.level-row .meta strong { font-size: 14px; color: var(--text); }
.level-row .amt { font-weight: 700; font-size: 13px; color: var(--text); }

.rules-body { padding-bottom: 40px; }
.rule-block {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.rule-block h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
}
.rule-block p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.rule-block p strong {
  color: var(--purple-deep);
  font-weight: 700;
}
.rule-chart { margin-top: 14px; display: grid; gap: 8px; }
.bar-row {
  display: grid;
  grid-template-columns: 28px 1fr 36px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--text);
}
.bar-row em { color: var(--muted); font-style: normal; }
.rb {
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(143, 177, 125, 0.22);
  overflow: hidden;
}
.rb i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--purple-deep), var(--purple));
  border-radius: inherit;
}
.fuse-legend {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.fuse-legend span {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}
.fuse-legend .ok { background: rgba(52, 211, 153, 0.15); color: var(--ok); }
.fuse-legend .mid { background: rgba(251, 191, 36, 0.15); color: var(--warn); }
.fuse-legend .bad { background: rgba(244, 63, 94, 0.15); color: var(--danger); }

/* Tab bar */
.tabbar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(10px + var(--safe-b));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 6px;
  border-radius: 22px;
  background: rgba(255, 249, 230, 0.96);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(70, 85, 50, 0.1);
}
.tabbar.hidden { opacity: 0; pointer-events: none; transform: translateY(12px); }
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px 5px;
  border-radius: 16px;
  color: #5c4a33;
  font-size: 11px;
  font-weight: 700;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  border: 1px solid transparent;
  background: transparent;
}
.tab:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 24%;
  bottom: 24%;
  width: 1px;
  background: rgba(90, 110, 70, 0.14);
  pointer-events: none;
}
.tab-ico {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(70, 85, 50, 0.12));
}
.tab svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab.active {
  color: #3d593d;
  background: #f9f7e8;
  border-color: #b7c19a;
  border-radius: 16px;
  box-shadow: none;
}
.tab.active::after { display: none; }
.tab.active .tab-ico {
  filter: drop-shadow(0 2px 4px rgba(70, 85, 50, 0.18));
}
.tab.active svg { stroke: #3d593d; }

/* Overlay + Modals */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.overlay[hidden], .sheet[hidden], .modal[hidden], .toast[hidden] { display: none !important; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 12px 20px calc(28px + var(--safe-b));
  border-radius: 28px 28px 0 0;
  background: #12121a;
  border-top: 1px solid var(--line);
  animation: sheetUp 0.28s ease;
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  margin: 4px auto 16px;
}
.sheet h3 { font-size: 18px; margin-bottom: 4px; }
.sheet > .muted { margin-bottom: 16px; }

.wallet-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 15px;
  text-align: left;
}
.wallet-opt:active { background: rgba(168, 85, 247, 0.12); }
.w-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}
.w-icon.mm { background: linear-gradient(135deg, #f6851b, #e2761b); }
.w-icon.tw { background: linear-gradient(135deg, #3375bb, #0500ff); }
.w-icon.wc { background: linear-gradient(135deg, #3396ff, #66b1ff); }
.sheet .btn.full { margin-top: 8px; }

.modal {
  position: absolute;
  z-index: 60;
  animation: fadeIn 0.22s ease;
}
.modal.center {
  left: 24px;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  padding: 24px 20px;
  border-radius: 22px;
  background: #14141e;
  border: 1px solid var(--line);
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.modal.center h3 { font-size: 18px; margin-bottom: 12px; }
.warn-text {
  color: #fb7185;
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 20px;
}
.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.modal-actions .btn { flex-direction: row; }

.warn-modal .warn-icon {
  font-size: 36px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.5));
}
.warn-modal p {
  font-size: 14px;
  line-height: 1.65;
  color: #c5c0d4;
  margin-bottom: 18px;
}

.modal.fullscreen.gacha-cutscene {
  inset: 0;
  z-index: 70;
  padding: 0;
  margin: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gacha-cutscene-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.gacha-cutscene-skip {
  position: absolute;
  right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 2;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.gacha-cutscene-skip:active { transform: scale(0.96); }

.modal.fullscreen.gacha {
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  background: radial-gradient(ellipse at 50% 38%, rgba(255, 249, 220, 0.55), rgba(235, 228, 200, 0.92) 58%, var(--bg) 100%);
  padding: calc(12vh + env(safe-area-inset-top, 0px)) 16px 28px;
  overflow: hidden;
  isolation: isolate;
}
.gacha-fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.gacha-glow-core {
  position: absolute;
  left: 50%;
  top: 34%;
  width: min(105vw, 420px);
  height: min(105vw, 420px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 252, 230, 0.72) 0%, rgba(255, 236, 170, 0.28) 32%, rgba(200, 230, 160, 0.12) 52%, transparent 72%);
  animation: gachaGlowPulse 3.4s ease-in-out infinite;
  filter: blur(6px);
}
.gacha-rays {
  position: absolute;
  left: 50%;
  top: 34%;
  width: 160vmax;
  height: 160vmax;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 245, 200, 0) 0deg 14deg,
    rgba(255, 236, 160, 0.34) 14deg 18deg,
    rgba(220, 255, 190, 0.22) 18deg 21deg,
    rgba(255, 245, 200, 0) 21deg 36deg
  );
  animation: gachaRaysSpin 16s linear infinite;
  opacity: 0.72;
  mix-blend-mode: soft-light;
  filter: blur(4px);
}
.gacha-rays-reverse {
  top: 36%;
  width: 130vmax;
  height: 130vmax;
  opacity: 0.48;
  animation: gachaRaysSpinRev 24s linear infinite;
  background: repeating-conic-gradient(
    from 20deg,
    rgba(255, 255, 255, 0) 0deg 20deg,
    rgba(255, 248, 210, 0.26) 20deg 24deg,
    rgba(255, 255, 255, 0) 24deg 40deg
  );
  filter: blur(5px);
}
.gacha-shimmer {
  position: absolute;
  left: 50%;
  top: 34%;
  width: min(120vw, 480px);
  height: min(120vw, 480px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255, 255, 255, 0.55) 24deg,
    transparent 48deg,
    transparent 360deg
  );
  animation: gachaShimmerSpin 5.5s linear infinite;
  opacity: 0.35;
  filter: blur(4px);
}
@keyframes gachaRaysSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes gachaRaysSpinRev {
  to { transform: translate(-50%, -50%) rotate(-360deg); }
}
@keyframes gachaShimmerSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes gachaGlowPulse {
  0%, 100% { opacity: 0.88; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}
.gacha-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 14px;
  z-index: 3;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(196, 181, 253, 0.35);
  border-radius: 12px;
  background: rgba(12, 12, 20, 0.72);
  color: #e9e4ff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.gacha-close:hover {
  background: rgba(88, 28, 135, 0.45);
  border-color: rgba(168, 85, 247, 0.65);
}
.gacha-close:active { transform: scale(0.94); }
.gacha-burst {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25), transparent 60%);
  animation: burst 0.8s ease-out;
  pointer-events: none;
}
@keyframes burst {
  from { transform: scale(0.4); opacity: 1; }
  to { transform: scale(1.6); opacity: 0; }
}
.gacha-congrats {
  position: relative;
  z-index: 1;
  width: auto;
  max-width: min(94%, 380px);
  margin: 0 auto 22px;
  padding: 0 8px;
  text-align: center;
  font-family: "Noto Sans SC", sans-serif;
  font-size: clamp(28px, 9vw, 40px);
  font-weight: 900;
  letter-spacing: 0.22em;
  line-height: 1.2;
  color: #f6ebc0;
  background-image: linear-gradient(180deg, #fffdf2 0%, #fff3c0 36%, #ffe07a 68%, #f0c04a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(160, 120, 40, 0.35)) drop-shadow(0 2px 6px rgba(90, 70, 25, 0.22));
  pointer-events: none;
  user-select: none;
  animation: gachaCongratsPop 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
@keyframes gachaCongratsPop {
  from { transform: scale(0.78); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.gacha-results {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 360px;
  max-height: min(62vh, 520px);
  overflow: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 10px;
  padding: 4px 2px;
  margin-top: 0;
  scrollbar-width: none;
}
.gacha-results::-webkit-scrollbar { display: none; }
.gacha-results[data-count="1"] {
  max-height: none;
  overflow: visible;
}
.gacha-card {
  position: relative;
  width: 220px;
  padding: 28px 20px 24px;
  border-radius: 24px;
  background: linear-gradient(160deg, #1e1035, #0c0c14);
  border: 1px solid rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 48px rgba(124, 58, 237, 0.45);
  text-align: center;
  animation: cardPop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  animation-delay: calc(var(--i, 0) * 0.05s);
}
.gacha-results[data-count="5"] .gacha-card {
  width: calc(33.333% - 8px);
  min-width: 96px;
  max-width: 112px;
  padding: 10px 8px 12px;
  border-radius: 16px;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.35);
}
.gacha-results[data-count="10"] {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: min(68vh, 560px);
  align-content: start;
}
.gacha-results[data-count="10"] .gacha-card {
  width: auto;
  min-width: 0;
  max-width: none;
  padding: 10px 6px 10px;
  border-radius: 14px;
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.3);
}
.gacha-results[data-count="10"] .gacha-card:nth-child(9) {
  grid-column: 2;
}
.gacha-results[data-count="10"] .gacha-card:nth-child(10) {
  grid-column: 3;
}
@keyframes cardPop {
  from { transform: scale(0.6) rotate(-6deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}
.beast-art {
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  min-height: 180px;
}
.gacha-results[data-count="5"] .beast-art {
  min-height: 88px;
  margin-bottom: 6px;
}
.gacha-results[data-count="10"] .beast-art {
  min-height: 68px;
  margin-bottom: 5px;
}
.miner-preview {
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  min-height: 160px;
}
.miner-preview .card-img.hero,
.beast-art .card-img.hero {
  max-width: 180px;
}
.gacha-results[data-count="5"] .beast-art .card-img.hero {
  max-width: 86px;
}
.gacha-results[data-count="10"] .beast-art .card-img.hero {
  max-width: 64px;
}
.gacha-card h3 { font-size: 20px; margin-bottom: 6px; }
.gacha-card .rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #c4b5fd;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}
.gacha-card .rank-stars {
  letter-spacing: 0.06em;
  font-size: 12px;
  line-height: 1;
}
.gacha-results[data-count="5"] .gacha-card h3 {
  font-size: 11px;
  margin-bottom: 2px;
  line-height: 1.25;
}
.gacha-results[data-count="5"] .gacha-card .rank {
  font-size: 9px;
  gap: 1px;
}
.gacha-results[data-count="5"] .gacha-card .rank-stars {
  font-size: 10px;
  letter-spacing: 0.02em;
}
.gacha-results[data-count="10"] .gacha-card h3 {
  font-size: 10px;
  margin-bottom: 2px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gacha-results[data-count="10"] .gacha-card .rank {
  font-size: 8px;
  gap: 1px;
}
.gacha-results[data-count="10"] .gacha-card .rank-stars {
  font-size: 9px;
  letter-spacing: 0.02em;
}
.gacha-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(100%, 300px);
  margin-top: 18px;
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}
.gacha-actions .btn { flex-direction: row; }
.gacha-actions .gacha-btn-redraw {
  background: linear-gradient(135deg, #dcebc8, #c5dbad);
  border: 1px solid rgba(107, 155, 90, 0.55);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(79, 125, 66, 0.16);
}
.gacha-actions .gacha-btn-redraw:active {
  transform: scale(0.97);
}

.modal.fullscreen.synth {
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #050508;
  padding: 24px;
  text-align: center;
  overflow: hidden;
  perspective: 900px;
}
.synth-bg-flow {
  position: absolute;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 42%, rgba(88, 28, 135, 0.45), #050508 62%);
}
.synth-bg-flow .flow-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.7;
  mix-blend-mode: screen;
  will-change: transform;
}
.synth-bg-flow .b1 {
  width: 70%;
  height: 55%;
  left: 15%;
  top: 18%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.7) 0%, rgba(124, 58, 237, 0.2) 45%, transparent 70%);
  animation: flowDrift1 9s ease-in-out infinite;
}
.synth-bg-flow .b2 {
  width: 55%;
  height: 50%;
  left: -5%;
  top: 30%;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.55) 0%, rgba(88, 28, 135, 0.15) 50%, transparent 72%);
  animation: flowDrift2 11s ease-in-out infinite;
}
.synth-bg-flow .b3 {
  width: 60%;
  height: 48%;
  right: -8%;
  top: 22%;
  background: radial-gradient(circle, rgba(232, 121, 249, 0.4) 0%, rgba(109, 40, 217, 0.18) 48%, transparent 70%);
  animation: flowDrift3 13s ease-in-out infinite;
}
@keyframes flowDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(8%, -6%) scale(1.12); }
  66% { transform: translate(-6%, 8%) scale(0.94); }
}
@keyframes flowDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1.05); }
  40% { transform: translate(14%, 10%) scale(1.18); }
  70% { transform: translate(4%, -12%) scale(0.9); }
}
@keyframes flowDrift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-12%, 6%) scale(1.15); }
}

.modal.fullscreen.synth.phase-gather {
  /* keep dark base; glow handled by flow layer */
}
.modal.fullscreen.synth.phase-burst {
  animation: synthShake 0.45s ease-out;
}
.modal.fullscreen.synth.phase-burst .synth-bg-flow {
  filter: brightness(1.6);
}
@keyframes synthShake {
  0%, 100% { transform: translate(0, 0); }
  12% { transform: translate(-7px, 4px) rotate(-0.6deg); }
  28% { transform: translate(8px, -5px) rotate(0.7deg); }
  44% { transform: translate(-6px, -3px) rotate(-0.4deg); }
  60% { transform: translate(5px, 5px) rotate(0.5deg); }
  76% { transform: translate(-3px, 2px); }
}

.synth-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}
.synth-flyers {
  position: absolute;
  inset: 0;
}
.synth-flyer {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.45);
  opacity: 0;
  will-change: transform, opacity;
}
.synth-flyer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.modal.fullscreen.synth.phase-gather .synth-flyer {
  animation: synthFlyIn 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes synthFlyIn {
  0% {
    opacity: 0;
    transform: translate(var(--sx), var(--sy)) scale(0.55) rotate(var(--rot));
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0.95;
    transform: translate(var(--ex), var(--ey)) scale(0.72) rotate(0deg);
  }
}
.modal.fullscreen.synth.phase-burst .synth-flyer {
  animation: synthFlyOut 0.5s cubic-bezier(0.15, 0.85, 0.35, 1) forwards;
}
@keyframes synthFlyOut {
  0% {
    opacity: 1;
    transform: translate(var(--ex), var(--ey)) scale(0.85);
    filter: brightness(1.8);
  }
  25% {
    opacity: 1;
    transform: translate(
        calc(var(--ex) + (var(--ox) - var(--ex)) * 0.15),
        calc(var(--ey) + (var(--oy) - var(--ey)) * 0.15)
      )
      scale(1.25) rotate(18deg);
    filter: brightness(2.4);
  }
  100% {
    opacity: 0;
    transform: translate(var(--ox), var(--oy)) scale(0.15) rotate(var(--orot));
    filter: brightness(3);
  }
}

.synth-core {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  opacity: 0;
}
.modal.fullscreen.synth.phase-gather .synth-core {
  animation: synthCoreIn 0.9s 0.35s ease forwards;
}
.synth-core-glow {
  position: absolute;
  inset: -56px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0%, rgba(232, 121, 249, 0.45) 28%, rgba(124, 58, 237, 0.15) 55%, transparent 72%);
  filter: blur(14px);
}
.synth-core-orb {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 40% 35%,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(233, 213, 255, 0.75) 28%,
    rgba(192, 132, 252, 0.45) 55%,
    rgba(124, 58, 237, 0.15) 78%,
    transparent 100%
  );
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.55),
    0 0 40px rgba(192, 132, 252, 0.75),
    0 0 70px rgba(168, 85, 247, 0.45);
  filter: blur(5px);
}
@keyframes synthCoreIn {
  from { opacity: 0; transform: scale(0.3); }
  to { opacity: 1; transform: scale(1.4); }
}
.modal.fullscreen.synth.phase-burst .synth-core {
  animation: synthCoreBoom 0.5s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}
@keyframes synthCoreBoom {
  0% { opacity: 1; transform: scale(1.4); }
  20% { opacity: 1; transform: scale(0.7); }
  45% { opacity: 1; transform: scale(4.8); filter: brightness(2.5); }
  100% { opacity: 0; transform: scale(0.1); }
}

.synth-burst {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  pointer-events: none;
}
.synth-burst .shockwave {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 24px #c084fc, inset 0 0 20px rgba(232, 121, 249, 0.6);
  opacity: 0;
}
.synth-burst .shockwave.s2 {
  border-color: rgba(192, 132, 252, 0.8);
  border-width: 2px;
}
.modal.fullscreen.synth.phase-burst .synth-burst .shockwave {
  animation: synthShock 0.65s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
}
.modal.fullscreen.synth.phase-burst .synth-burst .shockwave.s2 {
  animation-delay: 0.08s;
}
@keyframes synthShock {
  0% { opacity: 1; transform: scale(0.3); }
  100% { opacity: 0; transform: scale(14); }
}
.synth-burst .ray {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--rw, 3px);
  height: var(--rl, 56px);
  margin: calc(var(--rl, 56px) * -1) 0 0 calc(var(--rw, 3px) / -2);
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(233, 213, 255, 0.45) 35%,
    rgba(192, 132, 252, 0.08) 100%
  );
  transform-origin: 50% 100%;
  transform: rotate(var(--rr)) scaleY(0.15);
  opacity: 0;
  filter: blur(2.5px);
}
.modal.fullscreen.synth.phase-burst .synth-burst .ray {
  animation: synthRay 0.5s ease-out forwards;
}
@keyframes synthRay {
  0% {
    opacity: 0;
    transform: rotate(var(--rr)) scaleY(0.1);
    filter: blur(4px);
  }
  25% {
    opacity: 0.75;
    transform: rotate(var(--rr)) scaleY(0.85);
    filter: blur(2.5px);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--rr)) scaleY(1.35);
    filter: blur(5px);
  }
}
.synth-burst .p {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--ps, 6px);
  height: var(--ps, 6px);
  margin: calc(var(--ps, 6px) / -2) 0 0 calc(var(--ps, 6px) / -2);
  border-radius: 50%;
  box-shadow: 0 0 14px currentColor, 0 0 22px rgba(192, 132, 252, 0.7);
  opacity: 0;
  filter: blur(1.8px);
}
.modal.fullscreen.synth.phase-burst .synth-burst .p {
  animation: synthParticle 0.75s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
}
@keyframes synthParticle {
  0% {
    opacity: 0.95;
    transform: translate(0, 0) scale(1.6);
    filter: blur(1.2px);
  }
  100% {
    opacity: 0;
    transform: translate(var(--px), var(--py)) scale(0.2);
    filter: blur(4px);
  }
}

.synth-flash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.95) 0%, rgba(233, 213, 255, 0.7) 18%, rgba(168, 85, 247, 0.35) 40%, transparent 65%);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 4;
}
.modal.fullscreen.synth.phase-burst .synth-flash {
  animation: synthFlash 0.55s ease-out forwards;
}
@keyframes synthFlash {
  0% { opacity: 0; }
  12% { opacity: 1; }
  40% { opacity: 0.45; }
  100% { opacity: 0; }
}

.synth-reveal {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  opacity: 0;
  transform: scale(0.85) translateY(16px);
  pointer-events: none;
}
.modal.fullscreen.synth.phase-reveal .synth-reveal {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
  transition: opacity 0.28s ease, transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
.modal.fullscreen.synth.phase-reveal .synth-stage {
  opacity: 0.25;
  transition: opacity 0.55s ease;
}
.modal.fullscreen.synth.phase-gather .synth-reveal,
.modal.fullscreen.synth.phase-burst:not(.phase-reveal) .synth-reveal {
  opacity: 0;
}

.synth-result {
  position: relative;
  z-index: 1;
  width: min(100%, 260px);
  padding: 24px 20px;
  border-radius: 24px;
  background: linear-gradient(160deg, #1e1035, #0c0c14);
  border: 1px solid rgba(168, 85, 247, 0.5);
  box-shadow:
    0 0 48px rgba(124, 58, 237, 0.45),
    0 24px 40px rgba(0, 0, 0, 0.45);
  transform-style: preserve-3d;
}
.modal.fullscreen.synth.phase-reveal .synth-result {
  transform: perspective(900px) rotateY(-14deg) rotateX(6deg);
  animation:
    synthResultSlam 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.1) both,
    synthCardFloat 4.5s ease-in-out 0.55s infinite;
}
@keyframes synthResultSlam {
  0% {
    transform: perspective(900px) rotateY(-28deg) rotateX(12deg) scale(0.72) translateY(18px);
    opacity: 0;
    filter: brightness(1.8);
  }
  100% {
    transform: perspective(900px) rotateY(-14deg) rotateX(6deg) scale(1) translateY(0);
    opacity: 1;
    filter: brightness(1);
  }
}
@keyframes synthCardFloat {
  0%, 100% {
    transform: perspective(900px) rotateY(-14deg) rotateX(6deg) translateY(0);
  }
  50% {
    transform: perspective(900px) rotateY(-8deg) rotateX(3deg) translateY(-6px);
  }
}
.modal.fullscreen.synth .miner-preview {
  transform-style: preserve-3d;
}
.modal.fullscreen.synth .miner-preview .card-img.hero {
  max-width: 180px;
  border-radius: 14px;
  transform: translateZ(28px);
  box-shadow:
    -12px 18px 28px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(168, 85, 247, 0.35);
}
.weight-reveal {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(168, 85, 247, 0.2);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: #e9d5ff;
}
.modal.fullscreen.synth.phase-reveal .weight-reveal {
  animation: weightPop 0.4s 0.35s both;
}
@keyframes weightPop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.synth-desc { max-width: 280px; font-size: 13px; position: relative; z-index: 1; }

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--tab-h) + 28px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 80;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.92);
  color: #0a0a0c;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: toastIn 0.25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Inventory page padding */
#view-inventory .page-pad { padding-bottom: 16px; }

/* More module pages */
.mod-card {
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(30, 16, 53, 0.9), rgba(12, 12, 20, 0.95));
  border: 1px solid rgba(168, 85, 247, 0.28);
}
.mod-card.compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px;
}
.mod-card.compact span,
.mod-card.row-stat span { color: var(--muted); font-size: 12px; }
.mod-card.compact strong,
.mod-card.row-stat strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.mod-card.row-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  min-height: 52px;
  box-sizing: border-box;
}
.mod-card > .row-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}
.mod-card > .row-stat + .row-stat {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.mod-card.center-text { text-align: center; padding: 20px 16px; }
.mod-card.center-text .muted { margin-bottom: 6px; }
.mod-card .muted { margin: 8px 0 12px; line-height: 1.5; }
.mod-card .modal-actions { margin-top: 14px; }
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.stat-grid.cols-1 { grid-template-columns: 1fr; }
.stat-grid.cols-1 .mod-card { margin-bottom: 0; }
.dash-big {
  display: block;
  font-family: var(--display);
  font-size: 28px;
  margin: 6px 0 10px;
}
.dash-hero { position: relative; overflow: hidden; }
.dash-chart {
  height: 72px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, transparent 40%, rgba(124, 58, 237, 0.25)),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 18px,
      rgba(168, 85, 247, 0.12) 18px,
      rgba(168, 85, 247, 0.12) 19px
    ),
    radial-gradient(ellipse at 20% 80%, rgba(56, 189, 248, 0.35), transparent 50%),
    radial-gradient(ellipse at 70% 40%, rgba(168, 85, 247, 0.45), transparent 55%);
}
.dash-chart.tall { height: 140px; margin-top: 8px; }
.mod-tabs { margin: 8px 0 14px; }
.mod-panel { display: none; }
.mod-panel.active { display: block; }
.bond-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}
.bond-row p { margin: 4px 0 0; font-size: 12px; }
.btn.sm { padding: 8px 12px; font-size: 12px; }
.empty-hint {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  font-size: 13px;
}
.mod-table {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mod-table li {
  display: grid;
  grid-template-columns: 0.9fr 1fr 0.7fr;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fffdf5;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.mono-sm { font-size: 12px; word-break: break-all; line-height: 1.5; }
.page-pad > .muted {
  display: block;
  margin: 0 0 14px;
  line-height: 1.55;
}
.page-pad > .field + .muted {
  margin-top: 4px;
  margin-bottom: 18px;
}
.page-pad > .muted + .btn {
  margin-top: 0;
}
.page-pad > .mod-card + .btn,
.page-pad > .mod-panel + .modal-actions,
.page-pad > .modal-actions {
  margin-top: 8px;
}
.page-pad > .mod-card + .btn.full {
  margin-top: 12px;
}
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.chip-link {
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(107, 155, 90, 0.1);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.fee-row {
  display: flex;
  gap: 10px;
  margin: 8px 0 14px;
}
.fee-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  cursor: pointer;
}
.swap-card { position: relative; }
.swap-flip {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: -4px auto 8px;
  border-radius: 50%;
  border: 1px solid rgba(168, 85, 247, 0.45);
  background: #1a1228;
  color: #c4b5fd;
  font-size: 16px;
  cursor: pointer;
}
.token-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.swap-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0 14px;
  font-size: 12px;
  color: var(--muted);
}
.ai-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100% - 12px);
  gap: 8px;
}
.ai-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 140px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 2px;
}
.ai-bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
}
.ai-bubble.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  border-bottom-left-radius: 4px;
}
.ai-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--purple-deep), var(--purple));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-dock {
  flex-shrink: 0;
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.ai-chips button {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(107, 155, 90, 0.1);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}
.ai-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 0;
}
.ai-compose input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 14px;
}

/* ========== Light Shanhai Theme Overrides ========== */
.splash {
  background: linear-gradient(180deg, #f7f4e8, #ebe6d4);
}
.splash-logo.brand-title {
  color: #3f4a2f;
  text-shadow: 0 4px 14px rgba(70, 90, 50, 0.16);
}
.splash-sub { color: var(--muted); }

.status-bar {
  background: rgba(255, 249, 230, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(90, 110, 70, 0.08);
}
.wallet-pill {
  background: linear-gradient(135deg, #dcebc8, #c5dbad);
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--line);
}
.wallet-pill .dot { background: rgba(63, 74, 47, 0.35); }
.wallet-pill .dot.online { background: var(--ok); box-shadow: 0 0 6px rgba(61, 139, 90, 0.45); }
.more-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
}
.more-btn:hover,
.more-btn[aria-expanded="true"] {
  background: #e8f0d8;
  border-color: var(--purple);
}

.more-backdrop { background: rgba(70, 85, 50, 0.28); }
.more-drawer {
  background: linear-gradient(180deg, #fff9e8 0%, #f5f0de 100%);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 36px rgba(70, 85, 50, 0.12);
}
.more-drawer-head { border-bottom-color: var(--line); }
.more-item { color: var(--text); }
.more-item:hover,
.more-item:focus-visible { background: rgba(107, 155, 90, 0.12); }
.more-item.sub { color: var(--muted); }
.more-item.lang-opt.active {
  color: var(--text);
  background: rgba(107, 155, 90, 0.2);
}
.more-divider { background: var(--line); }

.eyebrow { color: var(--muted); }
.eyebrow.glow {
  color: var(--purple-deep);
  text-shadow: none;
}
.accent-text { color: var(--purple-deep); }
.price {
  background: none;
  color: var(--text);
  -webkit-background-clip: unset;
  background-clip: unset;
}

.presale-entry,
.draw-entry {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(90, 110, 70, 0.08);
}
.presale-entry-tag { color: var(--gold); background: rgba(196, 163, 90, 0.15); }
.presale-entry-chev { color: var(--purple); }

.meter,
.trade-panel,
.mod-card,
.ling-price-card,
.ling-metric,
.ling-flow-card,
.node-card,
.rule-block,
.invite-card,
.miner-card,
.card-tile,
.pool-card,
.draw-panel,
.earn-card,
.profile-card,
.level-row,
.wallet-opt {
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
  color: var(--text);
}

.btn.primary {
  background: linear-gradient(135deg, var(--purple-deep), var(--purple));
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 125, 66, 0.28);
  border: 1px solid transparent;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn.danger {
  background: rgba(196, 92, 92, 0.12);
  border: 1px solid rgba(196, 92, 92, 0.45);
  color: #a33d3d;
}

.seg {
  background: rgba(143, 177, 125, 0.12);
}
.seg-btn { color: var(--muted); }
.seg-btn.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(90, 110, 70, 0.1);
}

.field-row {
  background: #fffdf5;
  border: 1px solid var(--line);
}
.field-row input,
.field-row.readonly,
.ai-compose input {
  color: var(--text) !important;
  background: transparent !important;
}
.field-label { color: var(--muted); }
.chip {
  background: rgba(107, 155, 90, 0.15);
  color: var(--purple-deep);
}

.tabbar {
  background: rgba(255, 249, 230, 0.96);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(70, 85, 50, 0.1);
}
.tab { color: #5c4a33; border-radius: 16px; }
.tab.active {
  color: #3d593d;
  background: #f9f7e8;
  border-color: #b7c19a;
  border-radius: 16px;
}
.tab.active svg { stroke: #3d593d; fill: none; }
.tab svg { stroke: currentColor; }

.overlay { background: rgba(70, 85, 50, 0.35); }
.sheet {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text);
}
.wallet-opt {
  color: var(--text) !important;
}

.sub-header {
  background: rgba(255, 249, 230, 0.92);
  border-bottom: 1px solid var(--line);
}
.back-btn {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
}

.draw-stage {
  background: #000;
}
#view-draw .draw-content .brand-logo.sm {
  margin-bottom: 6px;
}

.modal.fullscreen.gacha,
.modal.fullscreen.synth {
  background:
    radial-gradient(ellipse at 50% 32%, rgba(255, 252, 230, 0.65), rgba(168, 196, 140, 0.28) 45%, var(--bg) 78%) !important;
}
.gacha-card,
.synth-result {
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 12px 32px rgba(90, 110, 70, 0.12) !important;
  color: var(--text);
}
.gacha-card .rank,
.gacha-card h3 { color: var(--text); }
.gacha-card .rank { color: var(--muted); }
.gacha-close {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
}

.ling-panel-head h2 { color: var(--text); }
.ling-dollar { color: var(--ok); }
.ling-live {
  border-color: rgba(61, 139, 90, 0.4);
  background: rgba(61, 139, 90, 0.1);
  color: var(--ok);
}
.ling-price-card {
  background:
    radial-gradient(ellipse at 85% 0%, rgba(143, 177, 125, 0.28), transparent 45%),
    var(--card) !important;
  margin-top: -64px;
  z-index: 3;
}
.ling-price-glow { background: radial-gradient(circle, rgba(143, 177, 125, 0.35), transparent 70%); }
.ling-price-label { color: var(--muted); }
.ling-price-value {
  color: var(--text);
  text-shadow: none;
}
.ling-price-meta { color: var(--muted); }
.ling-price-meta .up {
  color: var(--ok);
  background: rgba(61, 139, 90, 0.12);
}
.ling-price-meta strong { color: var(--text); }
.ling-metric::after { display: none; }
.ling-metric-ico {
  width: 44px;
  height: 44px;
  background: transparent !important;
  border-radius: 0;
  color: inherit;
}
.ling-metric-label,
.ling-metric-sub { color: var(--muted); }
.ling-metric-val { color: var(--text); }
.ling-flow-title { color: var(--text); }
.ling-stack-bar { background: rgba(143, 177, 125, 0.15); }
.ling-stack-bar .circ { background: linear-gradient(90deg, #8fb17d, #6b9b5a); }
.ling-stack-bar .hole { background: linear-gradient(90deg, #9aa890, #6d7564); }
.ling-stack-bar .burn { background: linear-gradient(90deg, #e08a8a, #c45c5c); }
.ling-stack-bar .rest { background: rgba(90, 110, 70, 0.12); }
.ling-flow-legend li { color: var(--muted); }
.ling-flow-legend strong { color: var(--text); }
.ling-flow-legend .dot.circ { background: #6b9b5a; }
.ling-flow-legend .dot.hole { background: #7a8566; }
.ling-flow-legend .dot.burn { background: #c45c5c; }
.ling-flow-legend .dot.rest { background: rgba(90, 110, 70, 0.3); }
.ling-bar-head { color: var(--muted); }
.ling-bar-head em { color: var(--text); }
.ling-bar-track { background: rgba(143, 177, 125, 0.18); }
.ling-bar-track i.hole { background: linear-gradient(90deg, #9aa890, #5f6754); }
.ling-bar-track i.burn {
  background: linear-gradient(90deg, #e08a8a, #c45c5c);
  box-shadow: none;
}

.mod-card.compact span,
.mod-card.row-stat span { color: var(--muted); }
.mod-card.compact strong,
.mod-card.row-stat strong { color: var(--text); }
.empty-hint { color: var(--muted); }
.mod-table li {
  background: #fffdf5;
  border: 1px solid var(--line);
  color: var(--muted);
}
.chip-link {
  border: 1px solid var(--line);
  background: rgba(107, 155, 90, 0.1);
  color: var(--purple-deep);
}
.fee-opt {
  border: 1px solid var(--line);
  background: #fffdf5;
}
.swap-flip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--purple-deep);
}
.token-chip {
  border: 1px solid var(--line);
  background: rgba(107, 155, 90, 0.12);
  color: var(--text);
}
.swap-meta { color: var(--muted); }
.ai-chips button {
  border: 1px solid var(--line);
  background: rgba(107, 155, 90, 0.1);
  color: var(--text);
}
.ai-bubble.user {
  background: linear-gradient(135deg, var(--purple-deep), var(--purple));
  color: #fff;
}
.ai-compose input {
  border: 1px solid var(--line) !important;
  background: #fffdf5 !important;
  color: var(--text) !important;
}

.toast {
  background: rgba(63, 74, 47, 0.92);
  color: #fff9e6;
}

.inv-dock,
.synth-dock,
.action-dock {
  background: rgba(255, 249, 230, 0.95) !important;
  border: 1px solid var(--line) !important;
}

.vortex-stage,
.orbit-ring {
  filter: none;
}
.vortex-stage {
  border: 1px solid var(--line) !important;
  background: #eef3e4 !important;
}
.subtab.active {
  background: transparent !important;
  color: var(--text) !important;
}
.subtab.active::after {
  background: var(--purple-deep);
}
.track {
  background: rgba(143, 177, 125, 0.18) !important;
}
.fill.violet {
  background: linear-gradient(90deg, var(--purple-deep), #9bc48a) !important;
}
.needle {
  background: var(--text) !important;
  box-shadow: none !important;
}
.btn.pulse {
  animation: none;
  box-shadow: 0 6px 16px rgba(79, 125, 66, 0.28);
}
.modal.center,
.warn-modal {
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
}
.warn-modal .warn-icon { filter: none; }
.icon-btn {
  background: var(--card);
  color: var(--muted);
}
.dock-clear {
  color: var(--muted);
}
.brand-logo.brand-title {
  color: #3f4a2f;
  filter: none;
  text-shadow: 0 2px 8px rgba(90, 110, 70, 0.12);
}
#view-draw .brand-logo.brand-title {
  color: #fff;
  filter: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.weight-reveal {
  background: rgba(107, 155, 90, 0.15) !important;
  color: var(--purple-deep) !important;
}
.synth-bg-flow,
.flow-blob {
  opacity: 0.35;
  filter: hue-rotate(80deg) saturate(0.7);
}
.pool-card .pool-val small,
.earn-val small {
  color: var(--muted);
}
.card-tile.empty,
.miner-card {
  color: var(--text);
}
.step-btn {
  background: rgba(107, 155, 90, 0.12);
  border: 1px solid var(--line);
  color: var(--text);
}

/* ========== Readability: light-surface text ========== */
.more-item.sub { color: var(--text-soft); }
.presale-entry-text span { color: var(--muted); }
.presale-entry-text strong { color: var(--text); }
.presale-timer { color: var(--text-soft); }
.presale-timer strong { color: var(--purple-deep); }
.presale-stats { color: var(--muted); }
.presale-stats strong { color: var(--text); }
.promo-cell strong { color: var(--text); }
.info-strip strong { color: var(--text); }
.node-stats strong { color: var(--text); }
.mod-card.compact strong,
.mod-card.row-stat strong { color: var(--text); }
.mod-card.compact span,
.mod-card.row-stat span { color: var(--muted); }
.seg-btn { color: var(--text-soft); }
.seg-btn.active { color: var(--text); }
.field-label { color: var(--text-soft); }
.synth-tip { color: var(--text-soft); }
.sel-preview-label { color: var(--text-soft); }
.miner-item h4 { color: var(--text); }
.empty-miners .muted { color: var(--muted); }
.warn-modal p { color: var(--muted); }
.sub-header h2 { color: var(--text); }
.page-pad > .muted { color: var(--muted); }
