:root {
  --bg-void: #04070F;
  --titanium-card: linear-gradient(155deg, rgba(22, 30, 48, 0.88) 0%, rgba(11, 16, 28, 0.94) 100%);
  --titanium-elevated: linear-gradient(165deg, rgba(26, 36, 58, 0.96) 0%, rgba(10, 15, 26, 0.98) 100%);
  --titanium-border: rgba(96, 165, 250, 0.28);
  --titanium-rim: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(59, 130, 246, 0.14);
  --cobalt: #3B82F6;
  --cobalt-deep: #1D4ED8;
  --electric-cyan: #00D4FF;
  --ultra-gold: #F6C85F;
  --txt-bright: #F8FAFC;
  --txt-muted: #94A3B8;
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --safe-top: 0px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after {
  box-sizing: border-box;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--bg-void);
  color: var(--txt-bright);
  font-family: var(--font-display);
  touch-action: none;
}

.tabular {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* Full-Bleed Canvas Shell w/ Centered Ambient Framing on Desktop */
.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 24%, #0E1C3A 0%, #050914 58%, #03050B 100%);
}

#vaultCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* Revolut Ultra Titanium Bento Header — 2 Sleek Floating Pods Side-by-Side */
.bento-header {
  position: absolute;
  top: 0;
  left: 8px;
  right: 8px;
  max-width: 500px;
  margin-inline: auto;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.08fr);
  gap: 8px;
  align-items: stretch;
  pointer-events: none;
}

.bento-pod {
  pointer-events: auto;
  border-radius: 22px;
  background: var(--titanium-card);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--titanium-border);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.62), var(--titanium-rim);
  padding: 8px 11px;
}

/* Left Bento Pod: Vault Balance + Surge Micro-Progress Bar */
.bento-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3px;
}

.pod-balance-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pod-eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--txt-muted);
  white-space: nowrap;
  line-height: 1.05;
}

.flow-reserve-chip {
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(59, 130, 246, 0.20);
  border: 1px solid rgba(0, 212, 255, 0.35);
  color: var(--electric-cyan);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.15;
}

.pod-balance-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 1px 0;
}

.vault-pts-num {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #FFFFFF;
  white-space: nowrap;
  line-height: 1.1;
  text-shadow: 0 0 18px rgba(59, 130, 246, 0.45);
}

.vault-pts-unit {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--electric-cyan);
  white-space: nowrap;
  line-height: 1;
}

.surge-micro-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.surge-micro-lbl {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #93C5FD;
  white-space: nowrap;
  line-height: 1;
}

.surge-micro-track {
  flex: 1 1 auto;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.10);
  overflow: hidden;
}

.surge-micro-fill {
  width: 28%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cobalt) 0%, var(--electric-cyan) 65%, var(--ultra-gold) 100%);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.75);
  transition: width 0.16s ease;
}

.surge-micro-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--electric-cyan);
  white-space: nowrap;
  line-height: 1;
}

/* Right Bento Pod: Tier Multiplier Pill + CARDS Holo-Deck Button + AUDIO & ? Micro-Circles */
.bento-right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px;
}

.tier-mult-pill {
  flex: 1 1 auto;
  min-width: 58px;
  height: 54px;
  padding: 4px 8px;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.42);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.22) 0%, rgba(0, 212, 255, 0.08) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: var(--txt-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease;
}

.tier-mult-pill:active,
.holo-cards-btn:active,
.micro-circle-btn:active {
  transform: scale(0.94);
}

.tier-ring-svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transform: rotate(-90deg);
}

@media (max-width: 430px) {
  .tier-ring-svg {
    display: none;
  }
  .tier-pill-copy {
    align-items: center !important;
  }
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 3.4;
}

.ring-fill {
  fill: none;
  stroke: var(--electric-cyan);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-dasharray: 91.1;
  stroke-dashoffset: 68;
  transition: stroke-dashoffset 0.28s ease, stroke 0.28s ease;
}

.tier-pill-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  overflow: visible;
}

.tier-pill-name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: #DBEAFE;
  white-space: nowrap;
  line-height: 1.1;
}

.tier-pill-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--electric-cyan);
  white-space: nowrap;
  line-height: 1.15;
}

.holo-cards-btn {
  position: relative;
  height: 54px;
  padding: 4px 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(160deg, rgba(30, 41, 68, 0.92), rgba(15, 23, 42, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.holo-deck-thumb {
  width: 24px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.65));
}

.holo-cards-txt {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.05;
}

.upgrade-pip {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--electric-cyan);
  box-shadow: 0 0 8px var(--electric-cyan);
}

.micro-circle-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  flex-shrink: 0;
}

.micro-circle-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(147, 197, 253, 0.34);
  background: rgba(30, 41, 68, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.20);
  color: var(--electric-cyan);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.micro-circle-btn.muted {
  opacity: 0.48;
  color: var(--txt-muted);
}

.micro-glyph {
  font-size: 12px;
  line-height: 1;
}

/* Bottom Titanium Launch Dock */
.titanium-dock {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 8px);
  left: 8px;
  right: 8px;
  max-width: 500px;
  margin-inline: auto;
  z-index: 10;
  border-radius: 22px;
  background: var(--titanium-card);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  border: 1px solid var(--titanium-border);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.72), var(--titanium-rim);
  padding: 8px 10px;
}

.dock-inner {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.flow-seg-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 4px 3px 10px;
  border-radius: 14px;
  background: rgba(6, 10, 20, 0.68);
  border: 1px solid rgba(96, 165, 250, 0.20);
}

.seg-caption {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--txt-muted);
  white-space: nowrap;
}

.seg-buttons {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.load-pill {
  height: 28px;
  padding: 0 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--txt-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.14s ease;
}

.load-pill.active {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.36), rgba(0, 212, 255, 0.20));
  border-color: var(--electric-cyan);
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.32);
}

.launch-capsules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.launch-btn {
  height: 44px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease;
}

.launch-btn:active {
  transform: scale(0.95);
  filter: brightness(1.12);
}

.launch-btn.capsule-drop {
  background: linear-gradient(145deg, #3B82F6 0%, #1D4ED8 100%);
  border-color: rgba(147, 197, 253, 0.65);
}

.launch-btn.capsule-stream {
  background: linear-gradient(145deg, #2563EB 0%, #00D4FF 100%);
  border-color: rgba(103, 232, 249, 0.72);
}

.launch-btn.capsule-burst {
  background: linear-gradient(135deg, #00D4FF 0%, #60A5FA 48%, #F6C85F 100%);
  color: #040915;
  border-color: rgba(254, 240, 138, 0.85);
}

.btn-main {
  white-space: nowrap;
}

/* Narrow 320px Viewport Refinements — Guarantees Zero Clipped Badges */
@media (max-width: 370px) {
  .bento-header {
    gap: 5px;
    left: 6px;
    right: 6px;
  }
  .bento-pod {
    padding: 6px 7px;
    border-radius: 18px;
  }
  .pod-eyebrow {
    font-size: 12px;
  }
  .flow-reserve-chip {
    display: none;
  }
  .vault-pts-num {
    font-size: 16px;
  }
  .surge-micro-lbl {
    display: none;
  }
  .tier-ring-svg {
    display: none;
  }
  .tier-mult-pill {
    height: 48px;
    padding: 3px 5px;
    justify-content: center;
  }
  .tier-pill-copy {
    align-items: center;
  }
  .holo-cards-btn {
    height: 48px;
    padding: 3px 6px;
  }
  .holo-deck-thumb {
    width: 20px;
    height: 15px;
  }
  .micro-circle-btn {
    width: 23px;
    height: 23px;
  }
  .titanium-dock {
    left: 6px;
    right: 6px;
    padding: 7px 8px;
    border-radius: 18px;
  }
  .launch-capsules {
    gap: 5px;
  }
  .launch-btn {
    height: 40px;
    padding: 0 4px;
    font-size: 12px;
  }
}

/* Modals (Hidden on Boot!) */
.glass-modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 14, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-sheet {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  max-height: 85%;
  overflow-y: auto;
  padding: 18px 16px calc(var(--safe-bottom) + 20px);
  border-radius: 26px 26px 0 0;
  background: var(--titanium-elevated);
  border-top: 1px solid rgba(59, 130, 246, 0.45);
  box-shadow: 0 -18px 52px rgba(0, 0, 0, 0.85), var(--titanium-rim);
}

.sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.sheet-head-txt {
  flex: 1 1 auto;
}

.sheet-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--electric-cyan);
}

.sheet-heading {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 700;
  white-space: nowrap;
}

.sheet-subhead {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #93C5FD;
  margin: 12px 0 6px;
}

.sheet-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.featured-slab-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(0, 212, 255, 0.12));
  border: 1px solid rgba(96, 165, 250, 0.36);
  box-shadow: var(--titanium-rim);
}

.slab-art {
  width: 82px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6));
}

.slab-overlay-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.slab-tier-chip {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
}

.slab-progress-txt {
  font-size: 12px;
  font-weight: 700;
  color: var(--electric-cyan);
}

.slab-token-txt {
  font-size: 12px;
  font-weight: 700;
  color: var(--ultra-gold);
}

.tier-list, .upgrade-list, .guide-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tier-row, .upgrade-row, .guide-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.tier-row.unlocked {
  border-color: rgba(0, 212, 255, 0.48);
  background: rgba(0, 212, 255, 0.08);
}

.guide-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.guide-copy, .row-info {
  flex: 1 1 auto;
}

.row-title {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
}

.row-sub {
  font-size: 12px;
  color: var(--txt-muted);
  margin-top: 2px;
  line-height: 1.35;
}

.tier-status-badge {
  padding: 5px 9px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(59, 130, 246, 0.22);
  color: #93C5FD;
  flex-shrink: 0;
}

.tier-row.unlocked .tier-status-badge {
  background: rgba(0, 212, 255, 0.22);
  color: var(--electric-cyan);
}

.buy-perk-btn {
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid rgba(246, 200, 95, 0.58);
  background: rgba(246, 200, 95, 0.18);
  color: var(--ultra-gold);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.buy-perk-btn:disabled {
  opacity: 0.40;
  cursor: default;
}
