:root {
  --bg: #080611;
  --panel: rgba(20, 17, 33, 0.72);
  --panel-strong: rgba(24, 20, 40, 0.92);
  --line: rgba(255, 255, 255, 0.095);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f7f3ff;
  --muted: #978eb4;
  --soft: #cfc7e8;
  --violet: #7b4dff;
  --violet-2: #b66cff;
  --cyan: #21d4ff;
  --green: #22ffb7;
  --orange: #ff8a2a;
  --pink: #ff4fd8;
  --dangerless-down: #ff5ff2;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 10%, rgba(123, 77, 255, 0.22), transparent 34vw),
    radial-gradient(circle at 84% 16%, rgba(255, 138, 42, 0.16), transparent 30vw),
    radial-gradient(circle at 55% 90%, rgba(33, 212, 255, 0.12), transparent 36vw),
    var(--bg);
}

body {
  min-height: 100svh;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.11;
  mix-blend-mode: overlay;
  background-image:
    linear-gradient(transparent 50%, rgba(255, 255, 255, 0.03) 50%),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 1px);
  background-size: 100% 3px, 4px 4px;
  z-index: 4;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(10px, 1.1vw, 18px);
  width: 100vw;
  height: 100svh;
  padding: clamp(10px, 1.2vw, 18px);
}

.glass {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(22px) saturate(130%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 12px clamp(12px, 1.5vw, 22px);
  border-radius: var(--radius-xl);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 220px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background:
    conic-gradient(from 180deg, var(--orange), var(--pink), var(--violet), var(--cyan), var(--green), var(--orange));
  box-shadow:
    0 0 30px rgba(123, 77, 255, 0.42),
    0 0 40px rgba(255, 138, 42, 0.22);
  isolation: isolate;
  animation: brandFloat 3.2s ease-in-out infinite;
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 13px;
  background: rgba(8, 6, 17, 0.88);
  z-index: -1;
}

.brand-mark span {
  font-family: "Chakra Petch", Inter, sans-serif;
  font-weight: 800;
  letter-spacing: -0.08em;
  transform: skewX(-8deg);
}

@keyframes brandFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-3px) rotate(2deg); }
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: clamp(1.05rem, 1.3vw, 1.36rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-copy em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 10px;
  min-width: 0;
}

.domain-pill,
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(8, 6, 17, 0.42);
  font-family: "Chakra Petch", Inter, sans-serif;
  font-size: 0.8rem;
  white-space: nowrap;
}

.live-pill {
  color: var(--green);
  text-shadow: 0 0 14px rgba(34, 255, 183, 0.7);
}

.live-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 18px currentColor;
  animation: pulse 1.2s ease-in-out infinite;
}

.live-pill.syncing {
  color: var(--orange);
  text-shadow: 0 0 14px rgba(255, 138, 42, 0.55);
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.82); }
  50% { opacity: 1; transform: scale(1.2); }
}

.socials {
  display: flex;
  justify-content: flex-end;
  min-width: 220px;
}

.x-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035));
  color: #fff;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.x-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, rgba(123, 77, 255, 0.28), rgba(255, 138, 42, 0.12));
}

.x-button span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #09080e;
  font-weight: 900;
}

.x-button b {
  font-size: 0.86rem;
}

.chart-zone {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: clamp(26px, 2vw, 38px);
  background:
    linear-gradient(180deg, rgba(12, 9, 24, 0.74), rgba(9, 7, 16, 0.84)),
    radial-gradient(circle at 50% 20%, rgba(123, 77, 255, 0.12), transparent 40%),
    rgba(5, 4, 11, 0.78);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.48),
    inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.chart-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 138, 42, 0.16), transparent 8%, transparent 92%, rgba(33, 212, 255, 0.14)),
    radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.08), transparent 26rem);
  z-index: 2;
}

.chart-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hud {
  position: absolute;
  z-index: 5;
  border-radius: var(--radius-lg);
}

.hud-left {
  top: clamp(12px, 1.4vw, 22px);
  left: clamp(12px, 1.4vw, 22px);
  width: min(430px, calc(100vw - 32px));
  padding: 18px;
}

.hud-right {
  top: clamp(12px, 1.4vw, 22px);
  right: clamp(12px, 1.4vw, 22px);
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr);
  gap: 16px;
  width: min(410px, calc(100vw - 32px));
  padding: 16px;
}

.hud-title,
.signal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hud-title span,
.phase-copy span,
.signal-row span,
.metrics-grid span,
.mini-card span {
  color: var(--muted);
  font-family: "Chakra Petch", Inter, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hud-title b {
  color: var(--orange);
  font-family: "Chakra Petch", Inter, sans-serif;
  text-shadow: 0 0 18px rgba(255, 138, 42, 0.6);
}

.big-price {
  margin-top: 10px;
  font-family: "Chakra Petch", Inter, sans-serif;
  font-size: clamp(2.05rem, 4vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1;
  text-shadow: 0 0 28px rgba(34, 255, 183, 0.2);
}

.signal-row {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.16);
}

.signal-row strong {
  color: var(--green);
  font-family: "Chakra Petch", Inter, sans-serif;
  text-shadow: 0 0 18px rgba(34, 255, 183, 0.55);
}

.signal-row.cooldown strong {
  color: var(--dangerless-down);
  text-shadow: 0 0 18px rgba(255, 95, 242, 0.45);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.metrics-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 15px;
  background:
    linear-gradient(145deg, rgba(123, 77, 255, 0.12), rgba(255, 255, 255, 0.025));
}

.metrics-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  font-family: "Chakra Petch", Inter, sans-serif;
  font-size: clamp(1rem, 1.3vw, 1.22rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(255, 138, 42, 0.28);
  border-radius: 16px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 138, 42, 0.16), rgba(123, 77, 255, 0.11));
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.contract-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 138, 42, 0.5);
}

.contract-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border-radius: 9px;
  color: #09080e;
  background: var(--orange);
  font-family: "Chakra Petch", Inter, sans-serif;
  font-weight: 900;
}

.contract-button b {
  overflow: hidden;
  font-family: "Chakra Petch", Inter, sans-serif;
  font-size: 0.86rem;
  text-overflow: ellipsis;
}

.phase-orb {
  --p: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: 106px;
  height: 106px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(8, 6, 17, 0.98) 0 54%, transparent 55%),
    conic-gradient(var(--green) calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0);
  box-shadow: 0 0 32px rgba(34, 255, 183, 0.18), inset 0 0 20px rgba(123, 77, 255, 0.2);
  animation: orbGlow 2.4s ease-in-out infinite;
}

.phase-orb::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255, 138, 42, 0.2), transparent 42%, rgba(33, 212, 255, 0.16));
  filter: blur(8px);
  z-index: -1;
}

@keyframes orbGlow {
  0%, 100% { filter: saturate(1); transform: rotate(-1deg); }
  50% { filter: saturate(1.25); transform: rotate(1deg); }
}

.phase-orb span {
  font-family: "Chakra Petch", Inter, sans-serif;
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.phase-orb em {
  position: absolute;
  bottom: 24px;
  color: var(--muted);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.15em;
}

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

.phase-copy strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(1.1rem, 1.4vw, 1.44rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.phase-copy p {
  margin: 7px 0 0;
  color: var(--soft);
  font-size: 0.86rem;
  line-height: 1.4;
}

.phase-progress,
.next-phase {
  grid-column: 1 / -1;
}

.phase-progress {
  overflow: hidden;
  height: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

.phase-progress div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--pink), var(--orange), var(--green));
  box-shadow: 0 0 20px rgba(255, 138, 42, 0.65);
  transition: width 0.65s cubic-bezier(.2,.95,.25,1);
}

.next-phase {
  color: var(--muted);
  font-family: "Chakra Petch", Inter, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bottom-deck {
  display: grid;
  grid-template-columns: repeat(8, minmax(130px, 1fr));
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-xl);
  overflow-x: auto;
  scrollbar-width: thin;
}

.mini-card {
  position: relative;
  min-width: 130px;
  overflow: hidden;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 18px;
  background: rgba(8, 6, 17, 0.38);
}

.mini-card::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.mini-card.active {
  border-color: rgba(34, 255, 183, 0.36);
  background: linear-gradient(145deg, rgba(34, 255, 183, 0.12), rgba(123, 77, 255, 0.08));
}

.mini-card.active::before {
  background: linear-gradient(90deg, var(--green), var(--cyan));
  box-shadow: 0 0 18px rgba(34, 255, 183, 0.62);
}

.mini-card strong {
  display: block;
  margin-top: 6px;
  font-size: 0.88rem;
  letter-spacing: -0.02em;
}

.mini-card em {
  display: block;
  margin-top: 8px;
  color: var(--orange);
  font-family: "Chakra Petch", Inter, sans-serif;
  font-style: normal;
  font-weight: 900;
}

.crosshair-readout {
  position: absolute;
  z-index: 8;
  right: clamp(12px, 1.4vw, 22px);
  bottom: clamp(12px, 1.4vw, 22px);
  display: grid;
  gap: 2px;
  min-width: 160px;
  padding: 10px 12px;
  border-radius: 16px;
  pointer-events: none;
}

.crosshair-readout b {
  font-family: "Chakra Petch", Inter, sans-serif;
}

.crosshair-readout span {
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 1080px) {
  html,
  body {
    overflow: auto;
  }

  .stage {
    min-height: 100svh;
    height: auto;
  }

  .chart-zone {
    min-height: 72svh;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .brand,
  .socials {
    min-width: auto;
  }

  .topbar-center {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .hud-left,
  .hud-right {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    width: auto;
    margin: 12px;
  }

  .chart-canvas {
    opacity: 0.95;
  }

  .bottom-deck {
    grid-template-columns: repeat(8, 142px);
  }
}

@media (max-width: 650px) {
  .stage {
    padding: 8px;
    gap: 8px;
  }

  .topbar,
  .hud-left,
  .hud-right,
  .bottom-deck {
    border-radius: 20px;
  }

  .topbar {
    min-height: 62px;
    padding: 10px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .brand-copy em,
  .domain-pill,
  .x-button b {
    font-size: 0.68rem;
  }

  .x-button {
    height: 38px;
    padding-right: 10px;
  }

  .x-button span {
    width: 26px;
    height: 26px;
  }

  .chart-zone {
    min-height: 82svh;
    border-radius: 22px;
  }

  .hud-left,
  .hud-right {
    margin: 9px;
    padding: 13px;
  }

  .hud-right {
    grid-template-columns: 86px 1fr;
    gap: 12px;
  }

  .phase-orb {
    width: 86px;
    height: 86px;
  }

  .phase-orb span {
    font-size: 1.35rem;
  }

  .phase-orb em {
    bottom: 18px;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .metrics-grid article {
    padding: 10px;
  }

  .bottom-deck {
    padding: 8px;
  }
}
