:root {
  color-scheme: dark;
  --bg: #101310;
  --panel: #1b211c;
  --panel-2: #242c25;
  --line: #3b463c;
  --text: #f5f1df;
  --muted: #b8b19d;
  --gold: #f2bd45;
  --green: #65d47d;
  --blue: #65bbff;
  --red: #ef6d5e;
  --violet: #b68cff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(101, 212, 125, 0.2), transparent 30%),
    radial-gradient(circle at 85% 12%, rgba(101, 187, 255, 0.16), transparent 30%),
    linear-gradient(180deg, #12170f 0%, #0c100d 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, black, transparent 72%);
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.phone-shell {
  width: min(460px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 14px 86px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.eyebrow,
.panel p,
.resource span,
.status-tile span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 15px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.icon-btn.active {
  color: var(--gold);
  border-color: rgba(242, 189, 69, 0.58);
}

.resource-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.resource,
.status-tile,
.panel,
.card {
  border: 1px solid var(--line);
  background: rgba(27, 33, 28, 0.9);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.resource {
  min-width: 0;
  border-radius: 8px;
  padding: 9px 8px;
  transition: transform 160ms ease, border-color 160ms ease;
}

.resource:hover,
.status-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(242, 189, 69, 0.42);
}

.resource strong {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.scene-panel {
  position: relative;
  height: 230px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #111822;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}

.explore-scene {
  position: relative;
  height: 210px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #101827;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}

#exploreCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.explore-visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 72%, rgba(101, 212, 125, 0.16), transparent 22%),
    radial-gradient(circle at 72% 24%, rgba(101, 187, 255, 0.2), transparent 24%),
    linear-gradient(180deg, #111b32 0%, #14283a 60%, #17231e 100%);
}

.explore-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(220, 240, 255, 0.92) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(242, 189, 69, 0.7) 0 1px, transparent 1.6px);
  background-position: 24px 38px, 88px 92px;
  background-size: 76px 58px, 128px 86px;
  animation: starTwinkle 2.6s ease-in-out infinite alternate;
}

.nebula {
  position: absolute;
  width: 150px;
  height: 88px;
  border-radius: 50%;
  filter: blur(12px);
  opacity: 0.38;
  animation: nebulaDrift 7s ease-in-out infinite alternate;
}

.nebula.one {
  left: 24px;
  bottom: 28px;
  background: rgba(101, 212, 125, 0.32);
}

.nebula.two {
  right: 28px;
  top: 54px;
  background: rgba(182, 140, 255, 0.3);
  animation-delay: 1.2s;
}

.route-line {
  position: absolute;
  left: 10%;
  right: 9%;
  top: 57%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(101, 187, 255, 0.1), rgba(101, 187, 255, 0.72), rgba(242, 189, 69, 0.5));
  box-shadow: 0 0 20px rgba(101, 187, 255, 0.26);
  transform: rotate(-9deg);
}

.route-line.second {
  top: 43%;
  left: 18%;
  right: 18%;
  transform: rotate(13deg);
  opacity: 0.45;
}

.route-node {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(101, 187, 255, 0.5);
  background: rgba(17, 27, 50, 0.86);
  color: #d7f1ff;
  box-shadow: 0 0 20px rgba(101, 187, 255, 0.18);
}

.route-node::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(101, 187, 255, 0.22);
}

.route-node.active {
  border-color: rgba(242, 189, 69, 0.82);
  color: var(--gold);
  animation: nodePulse 1.35s ease-in-out infinite;
}

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

.route-node.n1 {
  left: 12%;
  top: 62%;
}

.route-node.n2 {
  left: 26%;
  top: 47%;
}

.route-node.n3 {
  left: 42%;
  top: 58%;
}

.route-node.n4 {
  left: 58%;
  top: 39%;
}

.route-node.n5 {
  left: 72%;
  top: 54%;
}

.route-node.n6 {
  left: 84%;
  top: 31%;
}

.route-ship {
  position: absolute;
  left: 11%;
  top: 39%;
  width: 34px;
  height: 18px;
  border-radius: 50% 55% 45% 50%;
  background: linear-gradient(90deg, #d7f1ff, #65bbff 58%, #2d5b7b);
  box-shadow: -12px 0 20px rgba(101, 187, 255, 0.34);
  animation: routeCruise 5.8s ease-in-out infinite;
}

.route-ship::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 6px;
  width: 18px;
  height: 6px;
  border-radius: 999px;
  background: rgba(242, 189, 69, 0.78);
  filter: blur(1px);
}

.scan-ring {
  position: absolute;
  left: 12%;
  top: 62%;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(242, 189, 69, 0.72);
  animation: scanRing 1.8s ease-out infinite;
}

@keyframes nebulaDrift {
  to {
    transform: translate(18px, -10px) scale(1.08);
  }
}

@keyframes nodePulse {
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 28px rgba(242, 189, 69, 0.34);
  }
}

@keyframes routeCruise {
  0%,
  100% {
    transform: translate(0, 0) rotate(-8deg);
  }
  45% {
    transform: translate(160px, 38px) rotate(7deg);
  }
  70% {
    transform: translate(250px, -10px) rotate(-4deg);
  }
}

@keyframes scanRing {
  to {
    transform: scale(2.8);
    opacity: 0;
  }
}

.explore-hud {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.explore-hud span,
.explore-hud strong {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(12, 17, 16, 0.56);
  backdrop-filter: blur(8px);
  font-size: 12px;
}

.explore-hud strong {
  color: var(--blue);
}

#sceneCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.mine-visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(215, 229, 191, 0.18), transparent 8%),
    radial-gradient(circle at 26% 12%, rgba(101, 187, 255, 0.16), transparent 18%),
    linear-gradient(180deg, #172238 0%, #1b2a2c 58%, #182018 100%);
}

.mine-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(245, 241, 223, 0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(101, 187, 255, 0.65) 0 1px, transparent 1.5px);
  background-position: 20px 26px, 90px 68px;
  background-size: 78px 56px, 116px 74px;
  animation: starTwinkle 2.8s ease-in-out infinite alternate;
}

.mine-moon {
  position: absolute;
  right: 58px;
  top: 36px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 35%, rgba(33, 48, 52, 0.42) 0 4px, transparent 5px),
    radial-gradient(circle at 64% 60%, rgba(33, 48, 52, 0.34) 0 3px, transparent 4px),
    #d7e5bf;
  box-shadow: 0 0 34px rgba(215, 229, 191, 0.22);
  animation: moonFloat 5.2s ease-in-out infinite;
}

.mine-mountains {
  position: absolute;
  left: -4%;
  width: 108%;
  height: 44%;
  clip-path: polygon(0 84%, 10% 60%, 22% 74%, 34% 45%, 48% 70%, 60% 50%, 74% 78%, 86% 56%, 100% 82%, 100% 100%, 0 100%);
}

.mine-mountains.back {
  bottom: 40px;
  background: #213329;
  opacity: 0.96;
  animation: mountainDrift 7s ease-in-out infinite alternate;
}

.mine-mountains.front {
  bottom: 18px;
  background: #17251f;
  opacity: 0.98;
  transform: scaleX(1.06);
  animation: mountainDrift 8s ease-in-out infinite alternate-reverse;
}

.mine-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 68px;
  background:
    linear-gradient(180deg, #25301f, #151b14),
    repeating-linear-gradient(0deg, transparent 0 14px, rgba(242, 189, 69, 0.14) 15px 16px);
}

.vein {
  position: absolute;
  left: -8%;
  width: 116%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(242, 189, 69, 0.76), transparent);
  transform: rotate(-2deg);
  animation: veinGlow 2.2s ease-in-out infinite;
}

.vein.one {
  top: 18px;
}

.vein.two {
  top: 34px;
  animation-delay: 520ms;
}

.vein.three {
  top: 50px;
  animation-delay: 1040ms;
}

.mine-base {
  position: absolute;
  left: 50%;
  bottom: 54px;
  width: 104px;
  height: 58px;
  transform: translateX(-50%);
  border-radius: 10px 10px 5px 5px;
  background:
    linear-gradient(90deg, transparent 18%, rgba(101, 212, 125, 0.28) 19% 23%, transparent 24%),
    linear-gradient(180deg, #314236, #19231c);
  border: 1px solid rgba(101, 212, 125, 0.28);
  box-shadow: 0 0 24px rgba(101, 212, 125, 0.12);
}

.mine-base::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 18px;
  height: 18px;
  border: 2px solid rgba(101, 212, 125, 0.62);
  border-radius: 5px;
  animation: screenPulse 1.6s ease-in-out infinite;
}

.rig {
  position: absolute;
  bottom: 62px;
  width: 38px;
  height: 72px;
  transform-origin: 50% 100%;
}

.rig-a {
  left: 22%;
}

.rig-b {
  left: 46%;
  bottom: 72px;
  animation-delay: 180ms;
}

.rig-c {
  right: 20%;
}

.rig::before {
  content: "";
  position: absolute;
  left: 6px;
  bottom: 0;
  width: 26px;
  height: 44px;
  border-left: 3px solid #536356;
  border-right: 3px solid #536356;
  border-bottom: 3px solid #536356;
  transform: perspective(80px) rotateX(22deg);
}

.rig::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 12px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c98d35;
  box-shadow: 0 0 18px rgba(242, 189, 69, 0.4);
  animation: rigPulse 1.2s ease-in-out infinite;
}

.rig i {
  position: absolute;
  left: 18px;
  top: 28px;
  width: 3px;
  height: 58px;
  transform-origin: 50% 0;
  background: rgba(242, 189, 69, 0.7);
  box-shadow: 0 0 16px rgba(242, 189, 69, 0.55);
  animation: drillSweep 1.7s ease-in-out infinite;
}

.mine-drone {
  position: absolute;
  left: -48px;
  top: 88px;
  width: 34px;
  height: 14px;
  border-radius: 999px;
  background: #9bd7ff;
  box-shadow: -16px 0 22px rgba(101, 187, 255, 0.28);
  animation: droneFly 7s linear infinite;
}

.mine-drone::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 5px;
  width: 7px;
  height: 4px;
  background: var(--gold);
  border-radius: 999px;
}

.mine-drone.second {
  top: 124px;
  animation-duration: 9s;
  animation-delay: -3.5s;
  transform: scale(0.82);
}

.mine-dust {
  position: absolute;
  bottom: 38px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(242, 189, 69, 0.74);
  box-shadow: 0 0 12px rgba(242, 189, 69, 0.45);
  animation: dustRise 2.4s ease-in-out infinite;
}

.mine-dust.one {
  left: 31%;
}

.mine-dust.two {
  left: 54%;
  animation-delay: 580ms;
}

.mine-dust.three {
  left: 71%;
  animation-delay: 1180ms;
}

@keyframes starTwinkle {
  to {
    opacity: 0.58;
    transform: translateY(2px);
  }
}

@keyframes moonFloat {
  50% {
    transform: translate(3px, -4px);
  }
}

@keyframes mountainDrift {
  to {
    transform: translateX(-10px);
  }
}

@keyframes veinGlow {
  50% {
    opacity: 0.42;
    transform: translateX(16px) rotate(-2deg);
  }
}

@keyframes screenPulse {
  50% {
    opacity: 0.55;
    box-shadow: 0 0 16px rgba(101, 212, 125, 0.34);
  }
}

@keyframes rigPulse {
  50% {
    transform: scale(1.14);
    filter: brightness(1.2);
  }
}

@keyframes drillSweep {
  50% {
    transform: rotate(9deg);
    opacity: 0.5;
  }
}

@keyframes droneFly {
  to {
    transform: translateX(540px);
  }
}

@keyframes dustRise {
  0% {
    transform: translateY(0) scale(0.7);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    transform: translateY(-92px) scale(0.25);
    opacity: 0;
  }
}

.scene-hud {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.scene-hud span,
.scene-hud strong {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(12, 17, 16, 0.56);
  backdrop-filter: blur(8px);
  font-size: 12px;
}

.scene-hud strong {
  color: var(--gold);
}

.scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(101, 212, 125, 0.09), transparent);
  transform: translateY(-100%);
  animation: scan 4.8s linear infinite;
}

@keyframes scan {
  to {
    transform: translateY(100%);
  }
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.status-tile {
  border-radius: 8px;
  padding: 10px;
}

.status-tile strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.panel {
  margin-top: 12px;
  border-radius: 8px;
  padding: 12px;
}

.compact {
  padding-bottom: 8px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.pill {
  min-width: 72px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--green);
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.planet-orbit {
  width: 86px;
  height: 86px;
  border: 1px solid #455446;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.planet {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #fff7b8 0 10%, transparent 11%),
    linear-gradient(135deg, #e8a43b, #74552a 48%, #3d7357);
  box-shadow: 0 0 30px rgba(242, 189, 69, 0.26);
}

.machine-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid #3d493d;
  background: linear-gradient(145deg, #222a23, #151a16);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease;
}

.slot:hover {
  transform: translateY(-2px);
  border-color: rgba(242, 189, 69, 0.52);
}

.slot.empty::after {
  content: "+";
  color: #586657;
  font-size: 28px;
}

.slot.selected {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.machine {
  width: 80%;
  height: 80%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 30%, #fff7b8 0 8%, transparent 9%),
    radial-gradient(circle, #f2bd45 0 35%, #b57726 36% 64%, #563a22 65%);
  color: #241605;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 0 24px rgba(242, 189, 69, 0.22);
  animation: machinePulse 2.4s ease-in-out infinite;
}

@keyframes machinePulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.04);
    filter: brightness(1.12);
  }
}

.slot-level {
  position: absolute;
  right: 5px;
  bottom: 4px;
  color: var(--text);
  font-size: 11px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 6px;
  padding: 2px 5px;
}

.chapter-panel {
  background:
    linear-gradient(145deg, rgba(27, 33, 28, 0.94), rgba(20, 26, 22, 0.94)),
    radial-gradient(circle at 86% 20%, rgba(242, 189, 69, 0.22), transparent 32%);
}

.goal-list,
.event-feed,
.relic-grid,
.research-list,
.order-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.goal {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.045);
  padding: 9px 10px;
}

.goal span {
  color: var(--muted);
  font-size: 13px;
}

.goal strong {
  color: var(--gold);
  font-size: 12px;
}

.goal.done {
  border-color: rgba(101, 212, 125, 0.36);
  background: rgba(101, 212, 125, 0.08);
}

.goal.done span {
  color: var(--text);
}

.chapter-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.chapter-footer small {
  color: var(--muted);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.wide-btn {
  grid-column: 1 / -1;
}

.primary-btn,
.secondary-btn {
  min-height: 54px;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  transition: transform 140ms ease, filter 140ms ease;
}

.primary-btn:not(:disabled):active,
.secondary-btn:not(:disabled):active,
.mini-btn:not(:disabled):active,
.claim-btn:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
}

.primary-btn {
  background: linear-gradient(180deg, #f6c957, #b97725);
  color: #241605;
}

.secondary-btn {
  background: linear-gradient(180deg, #2f3a31, #202720);
  border: 1px solid var(--line);
}

.slim {
  min-height: 48px;
  min-width: 116px;
}

.primary-btn span,
.secondary-btn span,
.primary-btn strong,
.secondary-btn strong {
  display: block;
}

.primary-btn strong,
.secondary-btn strong {
  margin-top: 4px;
  font-size: 13px;
}

.task-list,
.stage-list,
.shop-list,
.rank-list,
.bag-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ops-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.ops-card {
  position: relative;
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 12px;
  background:
    radial-gradient(circle at 24% 20%, rgba(242, 189, 69, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(27, 33, 28, 0.96), rgba(22, 27, 24, 0.92));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.ops-card::before {
  content: "";
  position: absolute;
  inset: -45% -20% auto auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  animation: opsSweep 4.6s ease-in-out infinite;
}

.ops-card.boost {
  background:
    radial-gradient(circle at 74% 18%, rgba(101, 187, 255, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(26, 34, 42, 0.95), rgba(20, 25, 28, 0.92));
}

.ops-card span {
  position: relative;
  color: var(--muted);
  font-size: 12px;
}

.ops-card strong {
  position: relative;
  line-height: 1.25;
}

.ops-card .mini-btn {
  position: relative;
  width: 100%;
}

@keyframes opsSweep {
  50% {
    transform: translate(-22px, 18px) scale(1.16);
  }
}

.task,
.stage-card,
.shop-card,
.rank-row,
.bag-card,
.event-card,
.relic-card,
.research-card,
.order-card {
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.task {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
}

.task strong,
.stage-card strong,
.shop-card strong,
.bag-card strong,
.event-card strong,
.relic-card strong,
.research-card strong,
.order-card strong {
  font-size: 13px;
}

.task small,
.stage-card small,
.shop-card small,
.bag-card small,
.event-card small,
.relic-card small,
.research-card small,
.order-card small,
.rank-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.claim-btn,
.mini-btn {
  min-width: 66px;
  height: 34px;
  border-radius: 7px;
  background: var(--green);
  color: #071108;
  font-size: 13px;
  font-weight: 700;
}

.stage-card,
.shop-card,
.bag-card,
.research-card,
.order-card {
  padding: 11px;
}

.stage-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  transform-origin: center;
  transition: transform 180ms ease, border-color 180ms ease, filter 180ms ease;
}

.stage-card.launching {
  transform: scale(0.98);
  border-color: rgba(101, 187, 255, 0.72);
  filter: brightness(1.18);
}

.stage-card.revealed {
  animation: cardReveal 520ms ease both;
}

@keyframes cardReveal {
  0% {
    transform: rotateX(80deg) scale(0.96);
    opacity: 0.55;
  }
  100% {
    transform: rotateX(0) scale(1);
    opacity: 1;
  }
}

.stage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 11px;
}

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

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

.bag-card,
.relic-card {
  min-height: 104px;
}

.relic-card {
  padding: 11px;
  position: relative;
  overflow: hidden;
}

.relic-card.unlocked {
  border-color: rgba(242, 189, 69, 0.3);
  background:
    radial-gradient(circle at 82% 20%, rgba(242, 189, 69, 0.18), transparent 32%),
    var(--panel-2);
}

.relic-card.locked {
  filter: grayscale(0.55);
  opacity: 0.78;
}

.item-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  background: rgba(101, 187, 255, 0.14);
  color: var(--blue);
  font-weight: 800;
}

.shop-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.research-card,
.order-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
}

.research-card {
  background:
    linear-gradient(145deg, rgba(36, 44, 37, 0.98), rgba(24, 31, 27, 0.96)),
    radial-gradient(circle at 88% 22%, rgba(101, 187, 255, 0.2), transparent 34%);
}

.research-card.maxed {
  border-color: rgba(101, 212, 125, 0.42);
}

.order-card {
  background:
    linear-gradient(145deg, rgba(36, 44, 37, 0.98), rgba(24, 31, 27, 0.96)),
    radial-gradient(circle at 12% 20%, rgba(242, 189, 69, 0.18), transparent 32%);
}

.order-card.empty {
  display: block;
}

.event-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  animation: eventSlide 360ms ease both;
}

.event-card span {
  max-width: 92px;
  color: var(--gold);
  font-size: 12px;
  text-align: right;
}

.event-card.rare {
  border-color: rgba(182, 140, 255, 0.54);
  box-shadow: 0 0 20px rgba(182, 140, 255, 0.14);
}

.event-card.empty {
  display: block;
}

@keyframes eventSlide {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

.rank-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.rank-no {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(242, 189, 69, 0.16);
  color: var(--gold);
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 3;
  width: min(460px, 100%);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px 10px 12px;
  background: rgba(13, 16, 14, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.nav-btn {
  min-height: 44px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.nav-btn.active {
  background: var(--panel-2);
  color: var(--gold);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.58);
}

.modal-card {
  width: min(390px, 100%);
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #1d241e;
  padding: 18px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.reward-card {
  min-height: 74px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  padding: 10px;
  animation: rewardPop 420ms ease both;
}

.reward-card.bonus {
  border-color: rgba(242, 189, 69, 0.5);
  box-shadow: 0 0 18px rgba(242, 189, 69, 0.16);
}

.reward-card .reward-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  color: #241605;
  font-weight: 900;
}

.reward-card.gold .reward-icon {
  background: var(--gold);
}

.reward-card.parts .reward-icon {
  background: var(--green);
}

.reward-card.diamonds .reward-icon {
  background: var(--blue);
}

.reward-card.boxes .reward-icon {
  background: var(--violet);
}

.reward-card.potions .reward-icon,
.reward-card.energy .reward-icon {
  background: #ff8f70;
}

.reward-card.shards .reward-icon {
  background: #d8f5f0;
}

.reward-card strong,
.reward-card small {
  display: block;
}

.reward-card small {
  color: var(--muted);
  margin-top: 2px;
}

@keyframes rewardPop {
  0% {
    transform: translateY(8px) scale(0.94);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 78px;
  z-index: 8;
  transform: translateX(-50%);
  max-width: min(360px, calc(100vw - 28px));
  border-radius: 999px;
  background: rgba(244, 240, 223, 0.95);
  color: #161914;
  padding: 10px 14px;
  font-size: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.guide-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.guide-spotlight {
  position: fixed;
  border: 2px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.52), 0 0 28px rgba(242, 189, 69, 0.55);
  transition: left 220ms ease, top 220ms ease, width 220ms ease, height 220ms ease;
}

.guide-bubble {
  position: fixed;
  width: min(280px, calc(100vw - 28px));
  border: 1px solid rgba(242, 189, 69, 0.55);
  border-radius: 10px;
  background: rgba(29, 36, 30, 0.97);
  padding: 12px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.36);
  pointer-events: auto;
  transition: left 220ms ease, top 220ms ease;
}

.guide-bubble p {
  margin: 5px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.guide-bubble button {
  height: 30px;
  border-radius: 7px;
  padding: 0 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 12px;
}

.guide-hand {
  position: absolute;
  right: 12px;
  top: -30px;
  font-size: 28px;
  animation: handTap 900ms ease-in-out infinite;
}

@keyframes handTap {
  0%,
  100% {
    transform: translateY(0) rotate(-12deg);
  }
  50% {
    transform: translateY(7px) rotate(-12deg);
  }
}

.fly-reward {
  position: fixed;
  z-index: 12;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #241605;
  font-size: 11px;
  font-weight: 900;
  pointer-events: none;
  animation: flyReward 760ms cubic-bezier(0.16, 0.82, 0.28, 1) forwards;
}

.fly-reward.gold {
  background: var(--gold);
}

.fly-reward.parts {
  background: var(--green);
}

.fly-reward.diamonds {
  background: var(--blue);
}

.fly-reward.boxes {
  background: var(--violet);
}

.fly-reward.potions,
.fly-reward.energy {
  background: #ff8f70;
}

.fly-reward.shards {
  background: #d8f5f0;
}

@keyframes flyReward {
  to {
    left: var(--tx);
    top: var(--ty);
    opacity: 0;
    transform: scale(0.45) rotate(240deg);
  }
}

.merge-burst {
  position: fixed;
  z-index: 12;
  width: 96px;
  height: 96px;
  margin-left: -48px;
  margin-top: -48px;
  display: grid;
  place-items: center;
  pointer-events: none;
  animation: burstFade 680ms ease-out forwards;
}

.merge-burst::before,
.merge-burst::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 2px solid rgba(242, 189, 69, 0.86);
  box-shadow: 0 0 28px rgba(242, 189, 69, 0.42);
  animation: burstRing 680ms ease-out forwards;
}

.merge-burst::after {
  inset: 28px;
  border-color: rgba(101, 187, 255, 0.72);
  animation-delay: 70ms;
}

.merge-burst strong {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: #241605;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
  animation: burstCore 680ms ease-out forwards;
}

.merge-burst span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d8f5f0;
  box-shadow: 0 0 12px rgba(216, 245, 240, 0.7);
  animation: burstSpark 560ms ease-out forwards;
}

.upgrade-flash {
  position: fixed;
  z-index: 12;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 1px solid rgba(242, 189, 69, 0.7);
  background: rgba(29, 36, 30, 0.94);
  color: var(--gold);
  padding: 8px 12px;
  font-weight: 800;
  box-shadow: 0 0 22px rgba(242, 189, 69, 0.22);
  pointer-events: none;
  animation: upgradeFlash 780ms ease-out forwards;
}

@keyframes burstFade {
  to {
    opacity: 0;
  }
}

@keyframes burstRing {
  to {
    transform: scale(1.55);
    opacity: 0;
  }
}

@keyframes burstCore {
  0% {
    transform: scale(0.72) rotate(-14deg);
  }
  45% {
    transform: scale(1.12) rotate(5deg);
  }
  100% {
    transform: scale(0.92) rotate(0);
  }
}

@keyframes burstSpark {
  to {
    transform: translate(var(--dx), var(--dy)) scale(0.4);
    opacity: 0;
  }
}

@keyframes upgradeFlash {
  0% {
    transform: translate(-50%, -42%) scale(0.92);
    opacity: 0;
  }
  28% {
    transform: translate(-50%, -58%) scale(1.03);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -96%) scale(0.98);
    opacity: 0;
  }
}

.ship {
  position: fixed;
  z-index: 11;
  width: 34px;
  height: 18px;
  border-radius: 50% 55% 45% 50%;
  background: linear-gradient(90deg, #d7f1ff, #65bbff 58%, #2d5b7b);
  box-shadow: -12px 0 20px rgba(101, 187, 255, 0.34);
  pointer-events: none;
  animation: shipLaunch 820ms ease-in forwards;
}

.ship::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 6px;
  width: 18px;
  height: 6px;
  border-radius: 999px;
  background: rgba(242, 189, 69, 0.75);
  filter: blur(1px);
}

@keyframes shipLaunch {
  to {
    transform: translate(210px, -105px) scale(0.72);
    opacity: 0;
  }
}

.hidden {
  display: none;
}

@media (max-width: 380px) {
  .phone-shell {
    padding-inline: 10px;
  }

  h1 {
    font-size: 24px;
  }

  .resource-band {
    gap: 6px;
  }

  .machine-grid {
    gap: 6px;
  }

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