:root {
  --bg: #1d1109;
  --bar: rgba(24, 15, 10, 0.94);
  --card: rgba(35, 25, 18, 0.94);
  --card-soft: rgba(74, 52, 35, 0.66);
  --line: rgba(255, 239, 217, 0.12);
  --text: #f7efe5;
  --muted: rgba(247, 239, 229, 0.58);
  --gold: #eaa321;
  --gold-deep: #c87f12;
  --logo-green: #86b816;
  --logo-green-deep: #52790c;
  --shadow: rgba(0, 0, 0, 0.5);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
}

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

button {
  color: inherit;
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: fixed;
  inset: 68px 0 0;
  z-index: -3;
  background:
    radial-gradient(circle at 48% 46%, rgba(167, 108, 55, 0.35), transparent 22rem),
    linear-gradient(180deg, #3b2415, #130b07);
}

.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(80, 48, 27, 0.5), rgba(24, 12, 6, 0.18)),
    repeating-linear-gradient(0deg, rgba(255, 230, 190, 0.08) 0 2px, transparent 2px 12px),
    repeating-linear-gradient(90deg, rgba(255, 230, 190, 0.045) 0 1px, transparent 1px 64px);
  mix-blend-mode: overlay;
}

.hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0.72;
  filter: sepia(0.38) saturate(0.8) contrast(1.14) brightness(0.78);
}

.shade {
  position: fixed;
  inset: 68px 0 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 44%, transparent 0 24rem, rgba(13, 7, 4, 0.18) 36rem, rgba(7, 4, 3, 0.62) 100%),
    linear-gradient(180deg, rgba(17, 9, 5, 0.08), rgba(9, 5, 3, 0.6) 74%, rgba(7, 4, 3, 0.82));
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 68px;
  padding: 0 24px;
  background: var(--bar);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  font-size: 1.28rem;
  font-weight: 800;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 239, 217, 0.16);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-link,
.chart-link {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: rgba(247, 239, 229, 0.45);
  cursor: pointer;
  font-weight: 700;
  transition: color 160ms ease;
}

.icon-link:hover,
.chart-link:hover {
  color: var(--text);
}

.chart-link {
  padding: 0 2px;
  font-size: 0.88rem;
  font-style: italic;
  white-space: nowrap;
}

.buy-button {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 20px;
  border-radius: 9px;
  background: linear-gradient(180deg, var(--logo-green), var(--logo-green-deep));
  color: #fff8e8;
  font-size: 0.9rem;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(10, 16, 0, 0.65);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.buy-icon {
  position: relative;
  display: inline-block;
  width: 15px;
  height: 15px;
  color: inherit;
  font-size: 0;
  filter: drop-shadow(0 1px 1px rgba(10, 16, 0, 0.35));
}

.buy-icon::before,
.buy-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.buy-icon::before {
  left: 4px;
  bottom: 1px;
  width: 8px;
  height: 7px;
  border-radius: 55% 55% 48% 48%;
  transform: rotate(-8deg);
}

.buy-icon::after {
  left: 0;
  top: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  box-shadow:
    5px -2px 0 currentColor,
    10px 0 0 currentColor,
    2px 5px 0 currentColor;
}

.is-disabled {
  opacity: 0.72;
  cursor: default;
}

.side-dock {
  position: fixed;
  left: 12px;
  top: 50%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateY(-50%);
}

.side-dock button {
  display: grid;
  place-items: center;
  gap: 6px;
  width: 86px;
  min-height: 78px;
  padding: 10px 8px;
  border: 1px solid rgba(255, 239, 217, 0.08);
  border-radius: 12px;
  background: var(--card-soft);
  color: var(--muted);
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.side-dock button:hover {
  background: rgba(92, 66, 44, 0.86);
  color: var(--text);
  transform: translateX(4px);
}

.side-dock span {
  font-size: 1.35rem;
}

.side-dock strong {
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
}

.hero-title {
  position: fixed;
  left: 50%;
  top: 52%;
  z-index: 4;
  width: min(720px, calc(100% - 230px));
  text-align: center;
  opacity: 0.92;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-title p {
  margin: 0 0 8px;
  color: rgba(247, 239, 229, 0.72);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
}

.hero-title h1 {
  margin: 0;
  color: rgba(247, 239, 229, 0.14);
  font-size: clamp(3.8rem, 8vw, 8rem);
  line-height: 0.88;
  text-transform: uppercase;
  text-shadow: 0 12px 60px rgba(0, 0, 0, 0.55);
}

.ca-pill {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 24;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 24px);
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 239, 217, 0.12);
  border-radius: 16px;
  background: rgba(36, 27, 21, 0.92);
  color: var(--muted);
  cursor: pointer;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  transform: translateX(-50%);
}

.ca-pill span {
  font-size: 0.78rem;
  font-weight: 800;
}

.ca-pill strong {
  overflow: hidden;
  max-width: min(54vw, 400px);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: block;
  padding: 0;
}

.modal-layer[hidden],
.panel[hidden] {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  cursor: pointer;
}

.panel {
  position: fixed;
  left: var(--panel-x, 50%);
  top: var(--panel-y, 50%);
  z-index: 2;
  width: min(672px, calc(100vw - 22px));
  max-height: calc(100svh - 90px);
  overflow: auto;
  border: 1px solid rgba(255, 239, 217, 0.08);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.46);
  transform: translate(-50%, -50%);
  touch-action: none;
}

.compact-panel {
  width: min(560px, calc(100vw - 22px));
}

.chart-panel {
  width: min(920px, calc(100vw - 22px));
}

.panel header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 239, 217, 0.06);
  background: rgba(35, 25, 18, 0.96);
  cursor: grab;
  user-select: none;
}

.panel.is-dragging header {
  cursor: grabbing;
}

.drag-dot {
  color: rgba(247, 239, 229, 0.3);
  font-weight: 900;
}

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

.panel h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.panel header button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: rgba(247, 239, 229, 0.58);
  cursor: pointer;
  font-size: 1.7rem;
}

.panel-body {
  padding: 28px 24px 34px;
}

.token-orbit {
  display: grid;
  place-items: center;
  width: 158px;
  height: 158px;
  margin: 0 auto 24px;
  border: 1px solid rgba(255, 239, 217, 0.07);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234, 163, 33, 0.16), transparent 70%);
}

.token-orbit img {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  object-fit: cover;
}

.story-body h3 {
  max-width: 430px;
  margin-bottom: 18px;
  font-size: 1.08rem;
  font-style: italic;
  line-height: 1.45;
}

.panel p {
  color: var(--muted);
  line-height: 1.7;
}

.panel strong {
  color: var(--text);
}

.steps {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.steps li {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid rgba(255, 239, 217, 0.08);
  border-radius: 12px;
  background: rgba(255, 239, 217, 0.035);
}

.steps span {
  color: var(--muted);
  line-height: 1.55;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.panel-actions a,
.panel-actions button {
  border: 0;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 9px;
  background: var(--gold);
  color: #1b0f08;
  font-weight: 800;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.stat-grid div {
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid rgba(255, 239, 217, 0.08);
  border-radius: 14px;
  background: rgba(255, 239, 217, 0.04);
}

.stat-grid span {
  color: var(--muted);
  font-size: 0.76rem;
}

.stat-grid strong {
  align-self: end;
  font-size: 1.05rem;
}

.chart-frame {
  position: relative;
  height: min(68svh, 680px);
  min-height: 460px;
  background:
    radial-gradient(circle at 50% 40%, rgba(234, 163, 33, 0.14), transparent 22rem),
    rgba(255, 239, 217, 0.035);
}

.chart-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 720px) {
  .topbar {
    height: 68px;
    padding-inline: 16px;
  }

  .brand {
    font-size: 1.02rem;
  }

  .top-actions {
    gap: 8px;
  }

  .icon-link,
  .chart-link {
    display: none;
  }

  .buy-button {
    min-height: 36px;
    padding-inline: 13px;
    font-size: 0.82rem;
  }

  .hero-bg img {
    object-position: 56% center;
  }

  .side-dock {
    left: 8px;
    gap: 7px;
  }

  .side-dock button {
    width: 76px;
    min-height: 70px;
    padding: 8px 6px;
  }

  .side-dock strong {
    font-size: 0.62rem;
  }

  .hero-title {
    top: 21%;
    width: calc(100% - 28px);
  }

  .hero-title h1 {
    font-size: clamp(2.9rem, 15vw, 4.8rem);
  }

  .ca-pill {
    bottom: 18px;
    min-height: 42px;
  }

  .ca-pill strong {
    max-width: 58vw;
  }

  .modal-layer {
    padding: 0;
  }

  .panel,
  .compact-panel,
  .chart-panel {
    width: min(100% - 18px, 672px);
    max-height: calc(100svh - 92px);
  }

  .panel header {
    padding-inline: 16px;
  }

  .panel-body {
    padding-inline: 16px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .brand img {
    width: 28px;
    height: 28px;
  }

  .buy-button {
    padding-inline: 10px;
  }

  .side-dock {
    top: 53%;
  }

  .side-dock button {
    width: 72px;
  }

  .hero-title {
    top: 18%;
  }
}
