:root {
  --bg: #12110d;
  --bg-soft: #19170f;
  --card: #ded5bb;
  --card-deep: #d1c5a5;
  --ink: #14130e;
  --muted: #706955;
  --yellow: #ffd100;
  --yellow-dark: #d7b300;
  --cream: #f3edd9;
  --line: rgba(255, 209, 0, 0.2);
  --dark-line: rgba(20, 19, 14, 0.14);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--cream);
  background:
    radial-gradient(circle at 16% 14%, rgba(255, 209, 0, 0.11), transparent 24%),
    radial-gradient(circle at 82% 78%, rgba(255, 209, 0, 0.07), transparent 23%),
    linear-gradient(145deg, #11100c 0%, #1b1911 54%, #11100c 100%);
}

button,
input { font: inherit; }

button { cursor: pointer; }

button:focus-visible,
input:focus-visible { outline: 3px solid rgba(255, 209, 0, 0.42); outline-offset: 3px; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.header {
  width: min(1080px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 12px;
  background: rgba(18, 17, 13, 0.84);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--cream);
  text-decoration: none;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.brand-logo {
  width: 42px;
  height: 42px;
  display: block;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 209, 0, 0.22);
}

.wallet-button,
.tab,
.primary,
.ghost,
.token-picker,
.token-option,
.cta-card {
  border: 0;
  border-radius: 16px;
  font-weight: 900;
}

.wallet-button {
  min-height: 42px;
  padding: 0 18px;
  color: var(--yellow);
  background: rgba(255, 209, 0, 0.09);
  border: 1px solid rgba(255, 209, 0, 0.22);
}

.stage {
  width: min(1080px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(280px, 430px) minmax(360px, 500px);
  align-items: center;
  justify-content: center;
  gap: 72px;
  padding: 54px 0;
}

.hero-copy { display: grid; gap: 24px; }

.eyebrow,
.panel-title p {
  margin: 0;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
  font-weight: 950;
}

.hero-copy h1 {
  margin: 0;
  max-width: 430px;
  font-size: clamp(50px, 7vw, 86px);
  line-height: 0.9;
  letter-spacing: -0.075em;
  font-weight: 950;
}

.cta-card {
  width: min(380px, 100%);
  min-height: 86px;
  padding: 18px;
  display: grid;
  gap: 8px;
  text-align: left;
  color: var(--cream);
  background: rgba(255, 209, 0, 0.08);
  border: 1px solid rgba(255, 209, 0, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cta-card span {
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
}

.cta-card strong { font-size: 22px; letter-spacing: -0.04em; }

.terminal {
  width: 100%;
  border: 1px solid var(--dark-line);
  border-radius: 34px;
  padding: 18px;
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: rgba(20, 19, 14, 0.08);
}

.tab {
  min-height: 46px;
  color: rgba(20, 19, 14, 0.58);
  background: transparent;
}

.tab.active {
  color: var(--ink);
  background: var(--yellow);
}

.view { display: grid; gap: 14px; }
.hidden { display: none !important; }

.panel-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 6px 2px;
}

.panel-title.centered {
  display: grid;
  justify-items: center;
  text-align: center;
}

.panel-title h2 {
  margin: 6px 0 0;
  font-size: 34px;
  line-height: 0.95;
  letter-spacing: -0.06em;
  font-weight: 950;
}

.swap-box {
  position: relative;
  border: 1px solid var(--dark-line);
  border-radius: 26px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.18);
}

.receive-box { background: var(--card-deep); }

.box-topline,
.rate-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.amount-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

#fromAmount,
#receiveAmount {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(36px, 9vw, 58px);
  line-height: 0.95;
  letter-spacing: -0.065em;
  font-weight: 950;
}

#fromAmount::-webkit-outer-spin-button,
#fromAmount::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#fromAmount { appearance: textfield; }

.token-picker,
.token-locked {
  min-height: 54px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  border-radius: 18px;
  color: var(--ink);
  background: rgba(20, 19, 14, 0.08);
}

.token-picker::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.65;
}

.token-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(20, 19, 14, 0.08);
  display: block;
}

.token-icon[src=""],
.token-icon:not([src]) { visibility: hidden; }

.token-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% - 10px);
  right: 18px;
  width: min(260px, calc(100% - 36px));
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(20, 19, 14, 0.16);
  border-radius: 22px;
  background: #efe8d4;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.token-option {
  min-height: 54px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  text-align: left;
  color: var(--ink);
  background: transparent;
}

.token-option:hover,
.token-option.active { background: rgba(20, 19, 14, 0.08); }
.token-option small { color: var(--muted); font-weight: 850; }

.direction-dot {
  width: 42px;
  height: 42px;
  margin: -2px auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--yellow);
  font-size: 22px;
  font-weight: 950;
}

.rate-line {
  min-height: 28px;
  padding: 4px 6px;
}

.primary,
.ghost {
  min-height: 58px;
  width: 100%;
  font-size: 16px;
}

.primary {
  color: var(--cream);
  background: var(--ink);
}

.primary.yellow {
  color: var(--ink);
  background: var(--yellow);
}

.ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--dark-line);
}

.allocation-card {
  min-height: 250px;
  border: 1px solid var(--dark-line);
  border-radius: 30px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 209, 0, 0.22), transparent 42%),
    var(--card-deep);
}

.allocation-card span,
.allocation-card small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 950;
}

.allocation-card strong {
  font-size: clamp(74px, 17vw, 128px);
  line-height: 0.88;
  letter-spacing: -0.09em;
  font-weight: 950;
}

.allocation-card.revealed strong { color: var(--yellow); text-shadow: 0 1px 0 rgba(20, 19, 14, 0.45); }

@media (max-width: 860px) {
  .stage {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 38px 0;
  }

  .hero-copy { justify-items: center; text-align: center; }
  .hero-copy h1 { max-width: 680px; }
}

@media (max-width: 520px) {
  .page { padding: 12px; }
  .header { border-radius: 18px; }
  .brand span:last-child { display: none; }
  .wallet-button { padding: 0 13px; }
  .terminal { padding: 12px; border-radius: 28px; }
  .panel-title { align-items: start; }
  .amount-row { align-items: stretch; flex-direction: column; }
  .token-picker,
  .token-locked { width: 100%; justify-content: center; }
  .token-menu { right: 12px; width: calc(100% - 24px); }
}
