:root {
  --bg: #171207;
  --bg-2: #21190d;
  --bg-3: #2b2112;
  --ink: #ebe5ca;
  --muted: #b8af90;
  --soft: #80765c;
  --line: rgba(219, 210, 171, 0.16);
  --line-strong: rgba(235, 229, 202, 0.36);
  --gold: #d6c58e;
  --bronze: #8e6f3f;
  --shadow: rgba(0, 0, 0, 0.45);
  --card: rgba(35, 27, 14, 0.78);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(214, 197, 142, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 197, 142, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 72% 12%, rgba(138, 109, 57, 0.22), transparent 34rem),
    radial-gradient(circle at 18% 24%, rgba(235, 229, 202, 0.07), transparent 28rem),
    var(--bg);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-shell {
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
  padding: 12px 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #161105;
  box-shadow: 0 16px 36px var(--shadow);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

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

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-line {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 18, 7, 0.72);
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgba(235, 229, 202, 0.08);
}

.nav-links a.active {
  color: #1b1609;
  background: linear-gradient(135deg, #efe8c8, #bda86a);
  font-weight: 900;
}

.page-view[hidden] {
  display: none !important;
}

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

.x-link {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(235, 229, 202, 0.06);
}

.x-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.x-link:hover {
  color: #1b1609;
  background: linear-gradient(135deg, #efe8c8, #bda86a);
}

.top-action,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.top-action,
.button.primary {
  color: #1b1609;
  background: linear-gradient(135deg, #efe8c8, #bda86a);
  box-shadow: 0 18px 48px rgba(143, 112, 59, 0.3);
}

.button.secondary {
  color: var(--ink);
  background: rgba(235, 229, 202, 0.06);
}

.wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 156px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(235, 229, 202, 0.06);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.wallet-chip:hover {
  color: #1b1609;
  background: linear-gradient(135deg, #efe8c8, #bda86a);
}

.wallet-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(214, 197, 142, 0.74);
}

#walletEntryLabel {
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.72fr);
  gap: 36px;
  align-items: center;
  width: min(1180px, calc(100% - 40px));
  min-height: 620px;
  margin: 0 auto;
  padding: 72px 0 58px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(214, 197, 142, 0.18);
  border-radius: 50%;
  box-shadow: inset 0 0 46px rgba(214, 197, 142, 0.04);
}

.orbit-one {
  right: -12%;
  top: 7%;
  width: 560px;
  height: 560px;
}

.orbit-two {
  right: 12%;
  top: 27%;
  width: 330px;
  height: 330px;
  border-style: dashed;
}

.scanline {
  position: absolute;
  left: 3%;
  right: 3%;
  top: 52%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(235, 229, 202, 0.32), transparent);
}

.hero-copy,
.hero-panel,
.section,
.footer {
  position: relative;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(74px, 13vw, 168px);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 22px 60px rgba(0, 0, 0, 0.62);
}

h2 {
  max-width: 780px;
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

.hero-lede,
.section-heading p,
.metric-card p,
.release-card p,
.hook-card p,
.forge-copy p,
.result-main p,
.paper-body p,
.swap-card p {
  color: var(--muted);
  line-height: 1.75;
}

.hero-lede {
  max-width: 670px;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-panel {
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(235, 229, 202, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(235, 229, 202, 0.04) 1px, transparent 1px),
    rgba(30, 23, 11, 0.88);
  background-size: 26px 26px;
  box-shadow: 0 30px 90px var(--shadow);
}

.hero-logo-card {
  display: grid;
  place-items: center;
  aspect-ratio: 1.25;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #171207;
}

.hero-logo-card img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  object-position: center;
}

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

.panel-grid div,
.metric-card,
.release-card,
.chart-card,
.control-panel,
.results-panel,
.hook-card,
.forge-steps,
.level-card,
.inventory-panel,
.machine-toolbar,
.chart-panel,
.swap-card,
.paper-index,
.paper-body {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.panel-grid div {
  padding: 16px;
}

.panel-grid span,
.result-main span,
.release-card span,
.metric-kicker,
.hook-card span,
.range-readout span,
.level-meta span,
.machine-status span,
.machine-toolbar span,
.level-action-info span,
.inventory-grid span,
.upgrade-requirements span,
.quote-box span,
.quote-details span,
.market-grid span,
.balance-row span,
.paper-body section > span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-grid strong {
  display: block;
  margin-top: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0;
  scroll-margin-top: 90px;
}

.section-heading {
  max-width: 800px;
  margin-bottom: 24px;
}

.section-heading.compact {
  margin-bottom: 20px;
}

.metric-grid,
.hook-grid,
.level-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.level-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.metric-card,
.release-card,
.hook-card,
.level-card,
.chart-panel,
.swap-card {
  padding: 20px;
}

.metric-card strong,
.release-card strong,
.result-main strong,
.level-power,
.level-card h3,
.inventory-panel h3,
.paper-body h3,
.chart-toolbar strong,
.quote-box strong {
  display: block;
  margin-top: 10px;
  font-family: Georgia, "Times New Roman", serif;
}

.metric-card strong,
.release-card strong {
  font-size: 30px;
}

.release-layout {
  display: grid;
  grid-template-columns: 0.95fr 0.75fr 1.35fr;
  gap: 14px;
  align-items: stretch;
}

.primary-release {
  background:
    radial-gradient(circle at 80% 16%, rgba(214, 197, 142, 0.18), transparent 16rem),
    var(--card);
}

.bar-row {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.bar-row span {
  display: block;
  width: var(--w);
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #efe8c8, #8e6f3f);
}

.chart-card {
  min-height: 280px;
  padding: 18px;
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.chart-header strong {
  display: block;
  margin-top: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.chart-note {
  color: var(--muted);
  font-size: 12px;
}

canvas {
  display: block;
  width: 100%;
  height: 220px;
}

.level-card {
  position: relative;
  overflow: hidden;
  min-height: 550px;
}

.level-card::after {
  content: "";
  position: absolute;
  right: -56px;
  top: -56px;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(214, 197, 142, 0.16);
  border-radius: 50%;
}

.level-card.flip-card {
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  perspective: 1200px;
}

.level-card.flip-card::after {
  content: none;
}

.level-card-inner {
  position: relative;
  min-height: 550px;
  transform-style: preserve-3d;
  transition: transform 0.62s cubic-bezier(0.2, 0.72, 0.2, 1);
}

.level-card.is-flipped .level-card-inner {
  transform: rotateY(180deg);
}

.level-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 550px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  backface-visibility: hidden;
}

.level-front {
  pointer-events: auto;
}

.level-face::after {
  content: "";
  position: absolute;
  right: -56px;
  top: -56px;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(214, 197, 142, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.level-back {
  pointer-events: none;
  transform: rotateY(180deg);
  background:
    radial-gradient(circle at 72% 18%, rgba(142, 111, 63, 0.22), transparent 14rem),
    var(--card);
}

.level-card.is-flipped .level-front {
  pointer-events: none;
}

.level-card.is-flipped .level-back {
  pointer-events: auto;
}

.flip-toggle {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 2;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--gold);
  background: rgba(11, 8, 3, 0.48);
  font-size: 12px;
  font-weight: 900;
}

.flip-toggle:hover {
  color: #1b1609;
  border-color: var(--line-strong);
  background: linear-gradient(135deg, #efe8c8, #bda86a);
}

.level-card h3 {
  margin-bottom: 6px;
  font-size: 28px;
}

.level-model {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.15;
}

.level-power {
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 40px;
}

.burn-refund {
  display: block;
  margin: 18px 0 12px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  line-height: 1;
}

.level-cost {
  min-height: 44px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.level-meta {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.level-meta span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(235, 229, 202, 0.05);
}

.action-level-grid {
  margin-top: 16px;
}

.level-action {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
}

.level-action-info {
  display: grid;
  gap: 8px;
}

.level-action-info div {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 8, 3, 0.34);
}

.level-action-info strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.level-card-actions {
  display: grid;
  gap: 8px;
}

.level-card-actions .button {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  font-size: 13px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.calculator-section {
  padding-top: 86px;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 0.84fr 1.16fr;
  gap: 16px;
}

.control-panel,
.results-panel {
  padding: 20px;
}

.control-panel {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

input,
select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(11, 8, 3, 0.48);
  outline: none;
}

input[type="number"],
input[type="text"],
select {
  padding: 0 12px;
}

input[readonly] {
  color: var(--gold);
  background: rgba(235, 229, 202, 0.035);
}

.chain-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chain-status-head span {
  color: var(--muted);
  font-weight: 800;
}

.mini-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(235, 229, 202, 0.055);
  font-size: 12px;
  font-weight: 900;
}

.mini-button:hover {
  border-color: var(--line-strong);
  background: rgba(235, 229, 202, 0.1);
}

.chain-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chain-stat-grid div {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 8, 3, 0.38);
}

.chain-stat-grid span,
.chain-stat-grid strong {
  display: block;
}

.chain-stat-grid strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.claim-stat {
  padding-right: 92px;
}

.claimable-line {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.claimable-line b {
  color: var(--gold);
  font-weight: 900;
}

.claim-button {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 68px;
}

input[type="range"] {
  accent-color: var(--gold);
  border: 0;
  background: transparent;
}

input:focus,
select:focus {
  border-color: rgba(239, 232, 200, 0.74);
  box-shadow: 0 0 0 3px rgba(214, 197, 142, 0.12);
}

.range-readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(235, 229, 202, 0.05);
}

.range-readout strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.results-panel {
  background:
    linear-gradient(rgba(235, 229, 202, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(235, 229, 202, 0.035) 1px, transparent 1px),
    rgba(35, 27, 14, 0.84);
  background-size: 24px 24px;
}

.result-main {
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(12, 9, 4, 0.45);
}

.result-main strong {
  margin: 10px 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.02;
}

.machine-section {
  padding-top: 32px;
}

.machine-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: stretch;
  padding: 14px;
}

.machine-toolbar div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(235, 229, 202, 0.045);
}

.machine-toolbar strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.machine-toolbar .button {
  height: 100%;
}

.machine-notice {
  margin-bottom: 0;
}

.card-head,
.balance-row,
.chart-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card-head h3,
.inventory-panel h3 {
  margin-bottom: 0;
  font-size: 28px;
}

.card-head > strong {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  white-space: nowrap;
}

.machine-status,
.upgrade-requirements,
.quote-details,
.market-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.machine-status {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.machine-status div,
.upgrade-requirements div,
.quote-details div,
.market-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 8, 3, 0.34);
}

.machine-status strong,
.upgrade-requirements strong,
.quote-details strong,
.market-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 17px;
}

.action-row {
  display: grid;
  grid-template-columns: 0.82fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.button.full {
  width: 100%;
  margin-top: 16px;
}

.fine-print {
  margin: 14px 0 0;
  color: var(--soft);
  font-size: 13px;
}

.inventory-panel {
  display: grid;
  grid-template-columns: 0.34fr 1fr;
  gap: 18px;
  align-items: center;
  margin-top: 14px;
  padding: 20px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.inventory-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(235, 229, 202, 0.045);
}

.inventory-grid strong {
  display: block;
  margin-top: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
}

.inventory-grid em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.subsection-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 26px 0 12px;
}

.subsection-heading h3 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
}

.subsection-heading p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.compact-calculator {
  margin-top: 0;
}

.swap-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: 16px;
  align-items: start;
}

.chart-panel {
  min-height: 560px;
  background:
    linear-gradient(rgba(235, 229, 202, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(235, 229, 202, 0.03) 1px, transparent 1px),
    rgba(35, 27, 14, 0.82);
  background-size: 30px 30px;
}

.chart-toolbar {
  margin-bottom: 18px;
}

.chart-toolbar strong {
  font-size: 46px;
  line-height: 1;
}

.timeframes {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 8, 3, 0.38);
}

.timeframe,
.swap-tab {
  height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.timeframe {
  min-width: 44px;
}

.timeframe.active,
.swap-tab.active {
  color: #1b1609;
  background: linear-gradient(135deg, #efe8c8, #bda86a);
}

#priceChart {
  height: 360px;
}

.market-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.swap-card {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 8px;
  padding: 14px;
  background: rgba(14, 12, 9, 0.92);
}

.swap-card-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 8px;
}

.swap-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.swap-tab {
  min-width: 64px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 800;
}

.slippage-control {
  position: relative;
}

.slippage-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(235, 229, 202, 0.055);
}

.slippage-toggle:hover,
.slippage-toggle[aria-expanded="true"] {
  color: var(--ink);
  background: rgba(235, 229, 202, 0.12);
}

.slippage-toggle svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.slippage-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(17, 14, 9, 0.98);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
}

.slippage-panel[hidden] {
  display: none;
}

.slippage-panel-head,
.custom-slippage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.slippage-panel-head span {
  color: var(--gold);
  font-weight: 900;
}

.slippage-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.slippage-presets button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(235, 229, 202, 0.04);
  font-weight: 900;
}

.slippage-presets button.active,
.slippage-presets button:hover {
  color: #1b1609;
  border-color: transparent;
  background: linear-gradient(135deg, #efe8c8, #bda86a);
}

.custom-slippage {
  position: relative;
}

.protection-settings {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(235, 229, 202, 0.1);
}

.protection-switch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.protection-switch span {
  display: grid;
  gap: 3px;
}

.protection-switch strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

.protection-switch small,
.protection-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.protection-switch input {
  position: relative;
  width: 46px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(235, 229, 202, 0.08);
  appearance: none;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.protection-switch input::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(235, 229, 202, 0.76);
  content: "";
  transition: transform 0.18s ease, background 0.18s ease;
}

.protection-switch input:checked {
  border-color: rgba(220, 198, 117, 0.7);
  background: linear-gradient(135deg, #efe8c8, #bda86a);
}

.protection-switch input:checked::after {
  transform: translateX(20px);
  background: #171208;
}

.protection-threshold input {
  width: 96px;
}

.protection-note {
  margin: 0;
}

.custom-slippage span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.custom-slippage input {
  width: 116px;
  height: 40px;
  padding: 0 30px 0 12px;
  text-align: right;
}

.custom-slippage em {
  position: absolute;
  right: 11px;
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

.swap-token-box {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  min-height: 122px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(235, 229, 202, 0.035);
  overflow: hidden;
}

.receive-token-box {
  margin-top: 4px;
  border-color: rgba(235, 229, 202, 0.11);
  background: rgba(235, 229, 202, 0.075);
}

.swap-token-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}

.swap-token-copy > span,
.swap-token-copy small,
.token-side small {
  color: var(--muted);
  font-weight: 800;
}

#swapInput {
  width: 100%;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 46px;
  font-weight: 800;
  line-height: 0.95;
  appearance: textfield;
}

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

#swapInput:focus {
  box-shadow: none;
}

#swapOutput {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 46px;
  line-height: 0.95;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-side {
  display: grid;
  align-self: end;
  justify-items: end;
  gap: 8px;
  min-width: 118px;
  max-width: 150px;
}

.token-side small {
  max-width: 150px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(11, 8, 3, 0.5);
  font-size: 16px;
  font-weight: 900;
}

.epow-pill {
  background: linear-gradient(135deg, #efe8c8, #bda86a);
  color: #1b1609;
}

.token-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 900;
}

.eth-icon {
  color: #fff;
  background: #627eea;
}

.epow-icon {
  color: #efe8c8;
  background: #12100b;
}

.swap-direction {
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: -15px auto -15px;
  border: 5px solid rgba(14, 12, 9, 0.96);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(35, 31, 25, 0.96);
}

.swap-direction svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.balance-row {
  align-items: center;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(235, 229, 202, 0.045);
}

.balance-row strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  white-space: nowrap;
}

.quote-box {
  margin: 14px 0;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(12, 9, 4, 0.48);
}

.quote-box strong {
  margin-top: 8px;
  font-size: clamp(28px, 5vw, 36px);
  line-height: 1.05;
}

.quote-details {
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 8, 3, 0.32);
}

.quote-details div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.quote-details div + div {
  border-top: 1px solid rgba(235, 229, 202, 0.08);
}

.quote-details strong {
  margin-top: 0;
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}

.swap-protection-banner {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(235, 229, 202, 0.14);
  border-radius: var(--radius);
  background: rgba(235, 229, 202, 0.05);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.swap-protection-banner strong {
  color: var(--ink);
  font-size: 13px;
}

.swap-protection-banner.is-safe {
  border-color: rgba(220, 198, 117, 0.28);
  background: rgba(220, 198, 117, 0.08);
}

.swap-protection-banner.is-danger {
  border-color: rgba(255, 111, 84, 0.38);
  background: rgba(255, 111, 84, 0.09);
}

.swap-protection-banner.is-off {
  border-color: rgba(235, 229, 202, 0.1);
  background: rgba(235, 229, 202, 0.03);
}

.swap-card .button.full {
  margin-top: 8px;
  min-height: 46px;
}

.swap-card .fine-print {
  margin-top: 6px;
  font-size: 12px;
  text-align: center;
}

.whitepaper-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.paper-index {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.paper-index a {
  padding: 12px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
}

.paper-index a:hover {
  color: var(--ink);
  background: rgba(235, 229, 202, 0.07);
}

.paper-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.paper-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 8, 3, 0.28);
  scroll-margin-top: 90px;
}

.paper-section summary {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.paper-section summary::-webkit-details-marker {
  display: none;
}

.paper-section summary span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.paper-section summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.paper-section[open] summary {
  border-bottom: 1px solid var(--line);
  background: rgba(235, 229, 202, 0.04);
}

.paper-section > p,
.paper-section > ul,
.paper-section > pre,
.paper-section > .paper-table,
.paper-section > .paper-chart {
  margin-left: 76px;
  margin-right: 18px;
}

.paper-section > p:first-of-type,
.paper-section > .paper-table:first-of-type {
  margin-top: 18px;
}

.paper-section > p:last-child,
.paper-section > ul:last-child,
.paper-section > pre:last-child,
.paper-section > .paper-chart:last-child {
  margin-bottom: 18px;
}

.paper-body ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.paper-body li + li {
  margin-top: 6px;
}

.paper-body code {
  color: var(--ink);
  word-break: break-word;
}

.paper-body pre {
  overflow: auto;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 8, 3, 0.5);
  white-space: pre-wrap;
}

.paper-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.paper-table div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(235, 229, 202, 0.045);
}

.paper-table strong {
  color: var(--ink);
}

.paper-table span {
  color: var(--muted);
}

.paper-table a {
  color: var(--gold);
  text-decoration: none;
}

.paper-table a:hover {
  color: var(--ink);
}

.contract-table {
  grid-template-columns: 1fr;
}

.contract-table div {
  grid-template-columns: 132px minmax(0, 1fr);
}

.contract-table span {
  overflow-wrap: anywhere;
}

.paper-chart {
  margin-top: 18px;
}

.hook-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hook-card {
  min-height: 230px;
}

.hook-card span {
  color: var(--gold);
}

.hook-card h3 {
  margin-top: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.forge-section {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
  align-items: stretch;
  padding-bottom: 96px;
}

.forge-copy {
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 74% 26%, rgba(214, 197, 142, 0.16), transparent 16rem),
    rgba(35, 27, 14, 0.72);
}

.forge-steps {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.forge-step {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(235, 229, 202, 0.045);
}

.forge-step strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.forge-step p {
  margin: 0;
  color: var(--muted);
}

.forge-step em {
  color: var(--gold);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

body.wallet-modal-open {
  overflow: hidden;
}

.wallet-modal[hidden] {
  display: none;
}

.wallet-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.wallet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 5, 1, 0.72);
  backdrop-filter: blur(12px);
}

.wallet-dialog {
  position: relative;
  width: min(100%, 480px);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(235, 229, 202, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(235, 229, 202, 0.04) 1px, transparent 1px),
    rgba(26, 20, 10, 0.98);
  background-size: 28px 28px;
  box-shadow: 0 28px 88px rgba(0, 0, 0, 0.62);
}

.wallet-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.wallet-dialog h3 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
}

.wallet-dialog p {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.wallet-close {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(235, 229, 202, 0.05);
  font-size: 13px;
  font-weight: 800;
}

.wallet-close:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.wallet-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.wallet-option {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(235, 229, 202, 0.045);
  text-align: left;
}

.wallet-option-link {
  text-decoration: none;
}

.wallet-option:hover,
.wallet-option:focus {
  border-color: var(--line-strong);
  background: rgba(235, 229, 202, 0.09);
  outline: none;
}

.wallet-option-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--gold);
  background: rgba(11, 8, 3, 0.46);
  font-size: 12px;
  font-weight: 900;
}

.wallet-option-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wallet-option strong,
.wallet-option small {
  display: block;
}

.wallet-option small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.wallet-option em {
  color: var(--gold);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.wallet-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(11, 8, 3, 0.34);
  line-height: 1.65;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer div {
  display: grid;
  gap: 5px;
}

.footer strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.footer a {
  color: var(--gold);
  font-weight: 800;
}

@media (max-width: 1000px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    width: min(100% - 28px, 920px);
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .top-actions {
    margin-left: auto;
  }

  .hero,
  .section,
  .footer {
    width: min(100% - 28px, 920px);
  }

  .hero,
  .calculator-grid,
  .forge-section,
  .swap-layout,
  .whitepaper-layout,
  .inventory-panel {
    grid-template-columns: 1fr;
  }

  .machine-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .level-card,
  .level-card-inner,
  .level-face {
    min-height: 520px;
  }

  .swap-card,
  .paper-index {
    position: static;
  }

  .hero {
    min-height: auto;
    padding-top: 54px;
  }

  .subsection-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid,
  .hook-grid,
  .level-grid,
  .release-layout,
  .inventory-grid,
  .paper-table,
  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 66px;
  }

  .brand-line,
  .top-action {
    display: none;
  }

  .wallet-chip {
    max-width: 132px;
    padding: 0 10px;
  }

  .swap-card-head {
    align-items: flex-start;
  }

  .swap-tabs {
    gap: 4px;
  }

  .swap-tab {
    min-width: 58px;
    padding: 0 12px;
  }

  .swap-token-box {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 122px;
    padding: 16px;
  }

  .token-side {
    justify-items: end;
    min-width: 104px;
    max-width: 132px;
  }

  #swapInput,
  #swapOutput {
    font-size: 42px;
  }

  .slippage-panel {
    right: -4px;
  }

  .topbar {
    gap: 12px;
  }

  .hero {
    gap: 24px;
    padding: 44px 0 36px;
  }

  h1 {
    font-size: clamp(66px, 23vw, 96px);
  }

  .section {
    padding: 48px 0;
    scroll-margin-top: 76px;
  }

  .paper-section {
    scroll-margin-top: 76px;
  }

  .level-card,
  .level-card-inner,
  .level-face {
    min-height: 520px;
  }

  .metric-grid,
  .hook-grid,
  .level-grid,
  .release-layout,
  .paper-table,
  .form-row,
  .machine-status,
  .machine-toolbar,
  .upgrade-requirements,
  .inventory-grid,
  .market-grid,
  .quote-details,
  .paper-table div {
    grid-template-columns: 1fr;
  }

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

  .hero-actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .forge-step {
    grid-template-columns: 1fr;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  .chart-toolbar,
  .card-head,
  .balance-row {
    align-items: flex-start;
    flex-direction: column;
  }

  #priceChart {
    height: 310px;
  }

  .paper-body {
    padding: 10px;
  }

  .paper-section summary {
    grid-template-columns: 38px 1fr;
    padding: 14px;
  }

  .paper-section summary strong {
    font-size: 21px;
  }

  .paper-section > p,
  .paper-section > ul,
  .paper-section > pre,
  .paper-section > .paper-table,
  .paper-section > .paper-chart {
    margin-left: 14px;
    margin-right: 14px;
  }

  .wallet-dialog {
    padding: 16px;
  }

  .wallet-dialog h3 {
    font-size: 28px;
  }

  .wallet-option {
    grid-template-columns: 40px 1fr;
    min-height: 66px;
  }

  .wallet-option em {
    display: none;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .swap-token-box {
    grid-template-columns: 1fr;
    min-height: 142px;
  }

  .token-side {
    justify-items: start;
    max-width: 100%;
  }

  .token-side small {
    max-width: 100%;
    text-align: left;
  }

  #swapInput,
  #swapOutput {
    font-size: 38px;
  }
}
