:root {
  --bg: #070912;
  --bg-deep: #03040a;
  --glass: rgba(11, 18, 34, 0.68);
  --glass-strong: rgba(14, 23, 44, 0.82);
  --cyan: #45e9ff;
  --cyan-soft: rgba(69, 233, 255, 0.42);
  --purple: #c24bff;
  --purple-soft: rgba(194, 75, 255, 0.42);
  --amber: #ffbd43;
  --text: #f4f7ff;
  --muted: #9eabc4;
  --danger: #8cc8ff;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  letter-spacing: 0;
}

body {
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  background:
    radial-gradient(circle at 18% 8%, rgba(89, 28, 34, 0.6), transparent 34%),
    radial-gradient(circle at 88% 16%, rgba(19, 67, 76, 0.45), transparent 34%),
    linear-gradient(135deg, rgba(37, 12, 12, 0.95), rgba(3, 4, 10, 0.96) 52%, rgba(5, 18, 26, 0.96));
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  opacity: 0.22;
  background-image:
    linear-gradient(90deg, rgba(255, 136, 86, 0.42) 1px, transparent 1px),
    linear-gradient(rgba(255, 136, 86, 0.36) 1px, transparent 1px),
    linear-gradient(90deg, transparent 0 48px, rgba(0, 0, 0, 0.45) 48px 52px, transparent 52px 100px);
  background-size: 104px 42px, 104px 42px, 208px 84px;
  mix-blend-mode: screen;
}

button,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  position: relative;
  width: min(100%, 560px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0, rgba(255, 255, 255, 0.035) 1px, transparent 1px, transparent 7px);
  opacity: 0.28;
}

.view {
  display: none;
  animation: viewIn 220ms ease both;
}

.view.is-active {
  display: block;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-header,
.screen-head,
.wallet-panel,
.radar-stage,
.list-card,
.market-strip,
.vault-card {
  border: 1px solid rgba(91, 233, 255, 0.22);
  background: linear-gradient(135deg, rgba(18, 27, 49, 0.76), rgba(9, 13, 27, 0.66));
  backdrop-filter: blur(18px);
  box-shadow:
    0 0 0 1px rgba(194, 75, 255, 0.08) inset,
    0 20px 60px rgba(0, 0, 0, 0.38),
    0 0 34px rgba(69, 233, 255, 0.08);
}

.hero-header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 132px;
  padding: 16px;
  border-radius: var(--radius);
}

.avatar-wrap {
  position: relative;
  display: grid;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  place-items: center;
}

.avatar,
.avatar-fallback {
  width: 72px;
  height: 72px;
  border: 1px solid rgba(255, 189, 67, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(255, 189, 67, 0.28), 0 0 36px rgba(69, 233, 255, 0.18);
}

.avatar {
  display: none;
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, rgba(255, 189, 67, 0.95), rgba(105, 54, 19, 0.86));
  color: #1b0e05;
  font-weight: 900;
  font-size: 28px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 25px;
  line-height: 1.06;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.12;
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 42px;
  gap: 8px;
  padding: 6px 11px 6px 6px;
  border: 1px solid rgba(255, 189, 67, 0.52);
  border-radius: 999px;
  background: rgba(6, 8, 15, 0.72);
  box-shadow: 0 0 22px rgba(255, 189, 67, 0.16);
}

.coin-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 9px rgba(255, 189, 67, 0.72));
}

.balance-pill span {
  font-size: 22px;
  font-weight: 900;
}

.balance-pill small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: normal;
}

.nav-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.nav-card {
  position: relative;
  min-height: 128px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(69, 233, 255, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(13, 23, 43, 0.72), rgba(13, 8, 28, 0.68));
  backdrop-filter: blur(16px);
  text-align: left;
  box-shadow: 0 0 28px rgba(69, 233, 255, 0.12), 0 0 36px rgba(194, 75, 255, 0.08) inset;
}

.nav-card::before {
  position: absolute;
  inset: -1px;
  content: "";
  background: linear-gradient(110deg, transparent 0 48%, rgba(69, 233, 255, 0.18) 49%, transparent 54%);
  transform: translateX(-120%);
  animation: sweep 5s ease-in-out infinite;
}

.nav-card strong {
  position: relative;
  display: block;
  max-width: 320px;
  margin: 8px 0;
  font-size: 24px;
  line-height: 1.08;
}

.nav-card span {
  position: relative;
  color: var(--muted);
}

.nav-card-kicker {
  color: var(--cyan) !important;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-card-radar {
  border-color: rgba(194, 75, 255, 0.42);
  box-shadow: 0 0 34px rgba(194, 75, 255, 0.15), 0 0 46px rgba(69, 233, 255, 0.08) inset;
}

@keyframes sweep {
  0%, 45% {
    transform: translateX(-120%);
  }
  70%, 100% {
    transform: translateX(120%);
  }
}

.screen-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 14px;
  border-radius: var(--radius);
}

.ghost-button {
  min-width: 72px;
  min-height: 40px;
  border: 1px solid rgba(69, 233, 255, 0.35);
  border-radius: var(--radius);
  background: rgba(8, 14, 26, 0.72);
  box-shadow: 0 0 18px rgba(69, 233, 255, 0.12);
}

.segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}

.segment button {
  min-height: 42px;
  border: 1px solid rgba(69, 233, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(9, 14, 27, 0.78);
}

.segment button.is-selected {
  border-color: rgba(255, 189, 67, 0.56);
  box-shadow: 0 0 20px rgba(255, 189, 67, 0.16);
}

.list-grid {
  display: grid;
  gap: 10px;
}

.list-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius);
}

.list-card strong {
  font-size: 17px;
  line-height: 1.22;
}

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

.status-pill {
  justify-self: start;
  padding: 5px 9px;
  border: 1px solid rgba(69, 233, 255, 0.26);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.is-locked {
  border-color: rgba(194, 75, 255, 0.24);
  color: #cdb4ff;
}

.field-label {
  display: block;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.glass-select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(69, 233, 255, 0.38);
  border-radius: var(--radius);
  background: rgba(8, 14, 26, 0.92);
  color: var(--text);
  box-shadow: 0 0 22px rgba(69, 233, 255, 0.11);
}

.radar-stage {
  position: relative;
  display: grid;
  min-height: 300px;
  margin-top: 14px;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
}

.radar-rings {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.radar-rings span {
  position: absolute;
  width: 86%;
  aspect-ratio: 1;
  border: 1px solid rgba(69, 233, 255, 0.35);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(69, 233, 255, 0.18), 0 0 60px rgba(194, 75, 255, 0.12) inset;
  animation: radarPulse 2.8s ease-out infinite;
}

.radar-rings span:nth-child(2) {
  width: 60%;
  border-color: rgba(194, 75, 255, 0.42);
  animation-delay: 0.45s;
}

.radar-rings span:nth-child(3) {
  width: 34%;
  border-color: rgba(255, 189, 67, 0.38);
  animation-delay: 0.9s;
}

@keyframes radarPulse {
  0% {
    opacity: 0.88;
    transform: scale(0.82);
  }
  100% {
    opacity: 0.08;
    transform: scale(1.12);
  }
}

.radar-status {
  position: relative;
  display: grid;
  width: min(78%, 330px);
  min-height: 156px;
  place-items: center;
  padding: 18px;
  border: 1px solid rgba(69, 233, 255, 0.32);
  border-radius: var(--radius);
  background: rgba(4, 8, 17, 0.72);
  text-align: center;
  box-shadow: 0 0 34px rgba(69, 233, 255, 0.16), 0 0 44px rgba(194, 75, 255, 0.12) inset;
}

.radar-status p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.radar-status strong {
  display: block;
  color: var(--cyan);
  font-size: 34px;
  line-height: 1.02;
  text-shadow: 0 0 18px rgba(69, 233, 255, 0.48);
}

.radar-status span {
  margin-top: 10px;
  color: var(--text);
  font-weight: 800;
}

.radar-stage[data-tone="cold"] .radar-status strong {
  color: var(--danger);
}

.radar-stage[data-tone="warm"] .radar-status strong,
.radar-stage[data-tone="hot"] .radar-status strong {
  color: var(--amber);
  text-shadow: 0 0 18px rgba(255, 189, 67, 0.54);
}

.guide-copy {
  margin: 14px 0;
  color: #cdd8ee;
  line-height: 1.46;
}

.scan-button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 86px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(69, 233, 255, 0.58);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 50%, rgba(69, 233, 255, 0.24), transparent 58%),
    linear-gradient(135deg, rgba(22, 36, 68, 0.88), rgba(34, 12, 54, 0.78));
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 0 28px rgba(69, 233, 255, 0.26), 0 0 46px rgba(194, 75, 255, 0.22);
}

.scan-button:disabled {
  opacity: 0.58;
}

.scan-pulse {
  position: absolute;
  width: 160px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  animation: scanPulse 1.8s ease-out infinite;
}

@keyframes scanPulse {
  from {
    opacity: 0.85;
    transform: scale(0.35);
  }
  to {
    opacity: 0;
    transform: scale(1.45);
  }
}

.wallet-panel {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius);
}

.wallet-coin {
  width: 110px;
  max-width: 100%;
  filter: drop-shadow(0 0 20px rgba(255, 189, 67, 0.48));
}

.wallet-panel span,
.market-strip span {
  color: var(--muted);
  font-size: 13px;
}

.wallet-panel strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.wallet-panel small {
  display: block;
  margin-top: 8px;
  color: var(--cyan);
  word-break: break-word;
}

.market-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 18px;
  padding: 10px;
  border-radius: var(--radius);
}

.market-strip div {
  min-width: 0;
}

.market-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.section-title {
  margin: 0 0 10px;
  font-size: 17px;
}

.transaction-list {
  display: grid;
  gap: 8px;
}

.transaction-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(69, 233, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(8, 14, 26, 0.68);
}

.transaction-item strong {
  font-size: 14px;
}

.transaction-item span {
  color: var(--muted);
  font-size: 12px;
}

.transaction-amount {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 900;
}

.transaction-amount img {
  width: 20px;
  height: 20px;
}

.vault-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(2, 4, 10, 0.78);
  backdrop-filter: blur(18px);
}

.vault-modal.is-open {
  display: grid;
}

.vault-card {
  width: min(100%, 430px);
  padding: 18px;
  border-color: rgba(255, 189, 67, 0.44);
  border-radius: var(--radius);
  text-align: center;
  animation: vaultIn 520ms cubic-bezier(.18, .9, .24, 1.16) both;
}

.vault-chest {
  width: min(100%, 360px);
  margin: -14px auto 4px;
  filter: drop-shadow(0 0 24px rgba(69, 233, 255, 0.38));
  animation: chestFloat 2.6s ease-in-out infinite;
}

.vault-card h2 {
  color: var(--amber);
  text-shadow: 0 0 18px rgba(255, 189, 67, 0.42);
}

.vault-card p:not(.eyebrow) {
  color: #dbe5f6;
  line-height: 1.45;
}

.collect-button {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(255, 189, 67, 0.68);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 189, 67, 0.88), rgba(194, 75, 255, 0.7));
  color: #130b05;
  font-weight: 950;
  box-shadow: 0 0 26px rgba(255, 189, 67, 0.28);
}

@keyframes vaultIn {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.toast {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 16px;
  z-index: 30;
  display: none;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(69, 233, 255, 0.32);
  border-radius: var(--radius);
  background: rgba(5, 9, 18, 0.92);
  box-shadow: 0 0 24px rgba(69, 233, 255, 0.16);
}

.toast.is-visible {
  display: block;
}

.flying-coin {
  position: fixed;
  z-index: 40;
  width: 42px;
  height: 42px;
  pointer-events: none;
  transition: transform 720ms cubic-bezier(.18, .84, .22, 1), opacity 720ms ease;
  filter: drop-shadow(0 0 14px rgba(255, 189, 67, 0.72));
}

.route-card-button {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.route-card-button em {
  justify-self: start;
  color: var(--cyan);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-stack {
  display: grid;
  gap: 10px;
}

.inline-back {
  width: max-content;
  padding: 0 14px;
}

.detail-panel {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(91, 233, 255, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(18, 27, 49, 0.78), rgba(9, 13, 27, 0.68));
  backdrop-filter: blur(18px);
  box-shadow:
    0 0 0 1px rgba(194, 75, 255, 0.08) inset,
    0 18px 48px rgba(0, 0, 0, 0.34),
    0 0 28px rgba(69, 233, 255, 0.08);
}

.detail-panel h3,
.detail-panel h4,
.detail-panel p {
  margin: 0;
}

.detail-panel h3 {
  font-size: 22px;
  line-height: 1.12;
}

.detail-panel h4 {
  font-size: 16px;
  line-height: 1.25;
}

.detail-panel p {
  color: #d4def2;
  line-height: 1.48;
}

.locked-panel {
  border-color: rgba(194, 75, 255, 0.36);
}

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

.price-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(69, 233, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(4, 8, 17, 0.62);
}

.price-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.price-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.neon-action,
.ghost-wide {
  width: 100%;
  min-height: 50px;
  border-radius: var(--radius);
  font-weight: 900;
}

.neon-action {
  border: 1px solid rgba(69, 233, 255, 0.58);
  background: linear-gradient(135deg, rgba(69, 233, 255, 0.84), rgba(194, 75, 255, 0.7));
  color: #041018;
  box-shadow: 0 0 24px rgba(69, 233, 255, 0.26), 0 0 30px rgba(194, 75, 255, 0.18);
}

.neon-action:disabled {
  color: rgba(244, 247, 255, 0.62);
  border-color: rgba(158, 171, 196, 0.2);
  background: rgba(8, 14, 26, 0.72);
  box-shadow: none;
}

.ghost-wide {
  border: 1px solid rgba(255, 189, 67, 0.28);
  background: rgba(8, 14, 26, 0.72);
  color: var(--text);
}

.location-list {
  display: grid;
  gap: 8px;
}

.location-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px 10px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(69, 233, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(8, 14, 26, 0.7);
  text-align: left;
}

.location-row span {
  grid-row: span 2;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 189, 67, 0.36);
  border-radius: 50%;
  color: var(--amber);
  font-weight: 900;
}

.location-row strong {
  font-size: 15px;
  line-height: 1.22;
}

.location-row small,
.coords,
.rules-copy {
  color: var(--muted) !important;
  font-size: 13px;
}

.map-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.map-links a {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid rgba(69, 233, 255, 0.28);
  border-radius: var(--radius);
  background: rgba(4, 8, 17, 0.66);
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.section-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: thin;
}

.section-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(69, 233, 255, 0.2);
  border-radius: 999px;
  background: rgba(4, 8, 17, 0.72);
  color: #dce6f7;
  font-size: 13px;
  font-weight: 800;
}

.section-tabs button.is-selected {
  border-color: rgba(255, 189, 67, 0.62);
  color: var(--amber);
  box-shadow: 0 0 18px rgba(255, 189, 67, 0.16);
}

.section-body,
.riddle-card,
.story-callout,
.feedback-card {
  padding: 12px;
  border: 1px solid rgba(69, 233, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(4, 8, 17, 0.62);
}

.section-body h4,
.riddle-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--cyan);
}

.story-callout {
  border-color: rgba(255, 189, 67, 0.22);
  color: #f3e5c4;
  line-height: 1.45;
}

.feedback-card {
  border-color: rgba(255, 189, 67, 0.34);
  color: #ffe4a8;
  font-weight: 800;
  line-height: 1.42;
}

.answer-grid {
  display: grid;
  gap: 8px;
}

.answer-button {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(194, 75, 255, 0.3);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(13, 23, 43, 0.82), rgba(34, 12, 54, 0.7));
  text-align: left;
}

.answer-button span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(69, 233, 255, 0.4);
  border-radius: 50%;
  color: var(--cyan);
  font-weight: 950;
}

.answer-button strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.24;
}

.manual-answer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.manual-answer input {
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(69, 233, 255, 0.28);
  border-radius: var(--radius);
  background: rgba(4, 8, 17, 0.72);
  color: var(--text);
}

.manual-answer button {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 189, 67, 0.5);
  border-radius: var(--radius);
  background: rgba(255, 189, 67, 0.16);
  color: var(--amber);
  font-weight: 900;
}

@media (min-width: 520px) {
  .nav-grid {
    grid-template-columns: 1fr 1fr;
  }

  .nav-card-wallet {
    grid-column: span 2;
  }
}

@media (max-width: 390px) {
  .hero-header {
    align-items: flex-start;
  }

  .avatar-wrap,
  .avatar,
  .avatar-fallback {
    width: 60px;
    height: 60px;
    flex-basis: 60px;
  }

  h1 {
    font-size: 22px;
  }

  .radar-status strong {
    font-size: 30px;
  }
}
