:root {
  --bg-ink: #0a0f26;
  --bg-navy: #131b42;
  --panel: #101736;
  --panel-deep: #0c122c;
  --gold: #d4af37;
  --gold-bright: #f0c75e;
  --gold-dark: #b8860b;
  --gold-soft: rgba(212, 175, 55, 0.35);
  --text: #cfd4ee;
  --muted: #8b91b5;
  --line: rgba(212, 175, 55, 0.35);
  --shadow: rgba(0, 0, 0, 0.45);
  --green: #48d28b;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 50% 18%, rgba(212, 175, 55, 0.18), transparent 24rem),
    radial-gradient(circle at 12% 78%, rgba(55, 107, 212, 0.16), transparent 24rem),
    linear-gradient(135deg, var(--bg-ink), var(--bg-navy) 58%, #090d21);
  font-family: Inter, system-ui, sans-serif;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

.site-shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 34px;
}

.network-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.58;
  background-image:
    radial-gradient(circle at 12% 25%, rgba(240, 199, 94, 0.48) 0 2px, transparent 3px),
    radial-gradient(circle at 25% 40%, rgba(240, 199, 94, 0.38) 0 1px, transparent 2px),
    radial-gradient(circle at 42% 22%, rgba(240, 199, 94, 0.34) 0 2px, transparent 3px),
    radial-gradient(circle at 77% 28%, rgba(240, 199, 94, 0.4) 0 2px, transparent 3px),
    radial-gradient(circle at 90% 52%, rgba(240, 199, 94, 0.28) 0 1px, transparent 2px),
    linear-gradient(30deg, transparent 12%, rgba(212, 175, 55, 0.11) 12.15%, transparent 12.35%),
    linear-gradient(148deg, transparent 20%, rgba(212, 175, 55, 0.1) 20.15%, transparent 20.35%),
    linear-gradient(108deg, transparent 72%, rgba(212, 175, 55, 0.1) 72.15%, transparent 72.35%);
  background-size: 620px 420px, 580px 390px, 700px 440px, 660px 460px, 620px 420px, 760px 520px, 860px 620px, 720px 540px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 23, 54, 0.88), rgba(8, 13, 31, 0.74));
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.06);
}

.site-header.compact {
  margin-bottom: 36px;
}

.wordmark,
h1,
h2,
.gold-text {
  color: var(--gold-bright);
  background: linear-gradient(180deg, #fff0b6 0%, var(--gold-bright) 35%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.12);
}

.wordmark,
h1,
h2 {
  font-family: Cinzel, Georgia, serif;
  font-weight: 700;
  letter-spacing: 0;
}

.wordmark {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1;
}

.site-header p,
.site-footer,
.muted {
  color: var(--muted);
}

.site-header p {
  margin: 0;
  text-align: right;
}

.hero {
  display: grid;
  min-height: 280px;
  align-items: center;
  padding: clamp(42px, 8vw, 74px) 8px 34px;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold-bright);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.hero h1 {
  max-width: 860px;
  margin-bottom: 16px;
  font-size: clamp(2.35rem, 7vw, 5.25rem);
  line-height: 0.98;
}

.hero-subline {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--text);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.65;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 212, 122, 0.42);
  border-radius: 8px;
  background: rgba(71, 49, 12, 0.72);
  color: #ffe9ac;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(245, 212, 122, 0.3);
  border-radius: 50%;
  background: rgba(7, 11, 28, 0.42);
  color: #ffe9ac;
  font-size: 1.35rem;
  line-height: 1;
}

.coin-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 8, 20, 0.45), rgba(22, 32, 76, 0.38), rgba(5, 8, 20, 0.45)),
    rgba(8, 12, 30, 0.8);
  box-shadow: 0 30px 90px var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.coin-card {
  position: relative;
  display: flex;
  min-height: 520px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px clamp(18px, 3vw, 38px) 42px;
  isolation: isolate;
  text-align: center;
}

.coin-card::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    radial-gradient(circle at 52% 31%, rgba(212, 175, 55, 0.1), transparent 12rem),
    radial-gradient(circle at 20% 72%, rgba(212, 175, 55, 0.08), transparent 14rem),
    linear-gradient(180deg, rgba(18, 28, 67, 0.82), rgba(7, 11, 28, 0.9));
}

.coin-card::after {
  position: absolute;
  top: 9%;
  right: -2px;
  bottom: 10%;
  width: 8px;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(255, 237, 170, 0.9) 28%, rgba(184, 134, 11, 0.98) 52%, rgba(255, 227, 132, 0.7) 74%, transparent);
  box-shadow: 0 0 22px rgba(245, 212, 122, 0.7);
}

.coin-card:last-child::after {
  display: none;
}

.corner-badge {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 54px;
  height: 42px;
  place-items: start;
  padding: 7px 0 0 12px;
  color: #2c260f;
  font-weight: 800;
  background: linear-gradient(135deg, #fff0b6 0 45%, #c99a31 46% 100%);
  clip-path: polygon(0 0, 100% 0, 64% 100%, 0 100%);
  text-shadow: 0 1px rgba(255, 255, 255, 0.3);
}

.coin-visual {
  position: relative;
  display: grid;
  width: min(190px, 58vw);
  aspect-ratio: 1;
  place-items: center;
  margin-bottom: 26px;
}

.coin-visual.large {
  width: min(230px, 70vw);
  margin-inline: auto;
}

.coin-visual img {
  position: relative;
  z-index: 1;
  width: 82%;
  height: 82%;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.45));
  animation: coin-float 6s ease-in-out infinite;
}

.coin-halo {
  position: absolute;
  inset: 3%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 239, 174, 0.82) 0 7%, rgba(240, 199, 94, 0.36) 22%, rgba(212, 175, 55, 0.1) 48%, transparent 70%);
  filter: blur(4px);
  animation: halo-pulse 6s ease-in-out infinite;
}

.gold-rule {
  width: min(220px, 72%);
  height: 1px;
  margin: 0 auto 18px;
  background: linear-gradient(90deg, transparent, rgba(240, 199, 94, 0.75), transparent);
}

.coin-card h2,
.checkout-coin-panel h1,
.status-card h1 {
  margin-bottom: 12px;
  font-size: clamp(1.85rem, 4vw, 2.8rem);
  line-height: 1.05;
}

.coin-card p {
  min-height: 3.2em;
  margin-bottom: 28px;
  color: #d8c08d;
  font-size: 1.02rem;
  line-height: 1.6;
}

.gold-button,
.ghost-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 7px;
  padding: 13px 22px;
  font-weight: 800;
  line-height: 1;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.gold-button {
  border: 1px solid rgba(255, 240, 182, 0.42);
  color: #1a1a1a;
  background: linear-gradient(180deg, #f5d47a, #c9992e);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.42), 0 11px 24px rgba(0, 0, 0, 0.26);
  text-shadow: 0 1px rgba(255, 255, 255, 0.28);
}

.gold-button:hover,
.gold-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.55), 0 0 28px rgba(212, 175, 55, 0.42), 0 16px 28px rgba(0, 0, 0, 0.32);
}

.gold-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.gold-button.wide {
  width: 100%;
}

.ghost-button {
  border: 1px solid rgba(212, 175, 55, 0.36);
  color: var(--gold-bright);
  background: rgba(8, 12, 30, 0.48);
}

.ghost-button:hover,
.ghost-button:focus-visible {
  border-color: rgba(245, 212, 122, 0.72);
  transform: translateY(-2px);
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding-top: 24px;
  font-size: 0.92rem;
}

.site-footer span + span::before {
  margin-right: 18px;
  color: var(--gold-soft);
  content: "·";
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(320px, 1.18fr);
  gap: 22px;
  align-items: stretch;
}

.checkout-coin-panel,
.checkout-form-panel,
.status-card {
  border: 1px solid rgba(212, 175, 55, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(16, 23, 54, 0.92), rgba(8, 12, 30, 0.9)),
    var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34), inset 0 1px rgba(255, 255, 255, 0.05);
}

.checkout-coin-panel {
  display: flex;
  min-height: 560px;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 5vw, 48px);
  text-align: center;
}

.coin-name {
  margin-bottom: 8px;
  color: #d8c08d;
  font-weight: 700;
}

.checkout-form-panel {
  padding: clamp(22px, 4vw, 38px);
}

.form-grid {
  display: grid;
  gap: 18px;
}

/* direct child only — must not match the $ prefix inside .amount-input */
label > span:first-child {
  display: block;
  margin-bottom: 8px;
  color: #e2dcbf;
  font-size: 0.88rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(212, 175, 55, 0.26);
  border-radius: 7px;
  padding: 12px 14px;
  color: #f7f0d6;
  background: rgba(5, 8, 20, 0.58);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

input:focus {
  border-color: rgba(245, 212, 122, 0.74);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}

.amount-input {
  display: flex;
  min-height: 48px;
  align-items: center;
  border: 1px solid rgba(212, 175, 55, 0.26);
  border-radius: 7px;
  background: rgba(5, 8, 20, 0.58);
}

.amount-input > span {
  /* beats `label span:first-child`, which otherwise shrinks the $ to
     0.88rem and adds margin-bottom: 8px, misaligning it from the value */
  display: inline-flex;
  align-items: center;
  margin-bottom: 0;
  padding-left: 14px;
  color: var(--gold-bright);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
}

.amount-input input {
  font-size: 1.05rem;
}

.amount-input input {
  flex: 1;
  min-height: 46px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 12px 0 8px; /* global input rule's 12px vertical padding misaligns the value against the $ prefix */
  line-height: 1;
}

/* native number spinners read as a white box on the dark theme */
.amount-input input::-webkit-outer-spin-button,
.amount-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.amount-input input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.chip-row button {
  min-width: 64px;
  min-height: 38px;
  border: 1px solid rgba(212, 175, 55, 0.34);
  border-radius: 999px;
  color: var(--gold-bright);
  background: rgba(5, 8, 20, 0.42);
  font-weight: 800;
}

.chip-row button:hover,
.chip-row button:focus-visible {
  border-color: rgba(245, 212, 122, 0.72);
  background: rgba(212, 175, 55, 0.12);
}

.summary-panel,
.receipt-rows {
  display: grid;
  gap: 0;
  margin: 20px 0;
  border: 1px solid rgba(212, 175, 55, 0.26);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(5, 8, 20, 0.36);
}

.summary-panel > div,
.receipt-rows > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.14);
}

.summary-panel > div:last-child,
.receipt-rows > div:last-child {
  border-bottom: 0;
}

.summary-panel span,
.receipt-rows span {
  color: var(--muted);
}

.summary-panel strong,
.receipt-rows strong {
  text-align: right;
}

.total-row,
.receipt-total {
  background: rgba(212, 175, 55, 0.08);
}

.total-row strong,
.receipt-total strong {
  color: var(--gold-bright);
  font-size: 1.28rem;
}

.form-error {
  margin: 0 0 16px;
  color: #ffb6a9;
  font-weight: 700;
}

.trust-row {
  margin: 18px 0 0;
  color: #d8c08d;
  text-align: center;
}

.status-layout {
  display: grid;
  min-height: 560px;
  place-items: center;
}

.status-card {
  width: min(720px, 100%);
  padding: clamp(26px, 5vw, 48px);
  text-align: center;
}

.status-card h1 {
  margin-bottom: 14px;
}

.spinner {
  display: inline-block;
  width: 44px;
  height: 44px;
  margin-bottom: 22px;
  border: 3px solid rgba(212, 175, 55, 0.18);
  border-top-color: var(--gold-bright);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.spinner.tiny {
  width: 18px;
  height: 18px;
  margin: 0;
  border-width: 2px;
  border-top-color: #1a1a1a;
}

.attempt {
  margin: 20px 0 0;
  color: #d8c08d;
  font-size: 0.9rem;
}

.success-check {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  margin: 0 auto 18px;
  border: 1px solid rgba(72, 210, 139, 0.65);
  border-radius: 50%;
  color: #06160e;
  background: radial-gradient(circle at 35% 30%, #bff5d6, var(--green));
  font-size: 2.4rem;
  font-weight: 900;
  box-shadow: 0 0 28px rgba(72, 210, 139, 0.34);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  word-break: break-word;
}

.receipt-note {
  color: #d8c08d;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

@keyframes coin-float {
  0%,
  100% {
    transform: translateY(-4px);
  }

  50% {
    transform: translateY(6px);
  }
}

@keyframes halo-pulse {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.98);
  }

  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .checkout-coin-panel {
    min-height: auto;
  }
}

@media (max-width: 800px) {
  .site-shell {
    width: min(100% - 24px, 680px);
    padding-top: 16px;
  }

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

  .site-header p {
    text-align: left;
  }

  .hero {
    min-height: 240px;
    padding-top: 34px;
  }

  .coin-board {
    grid-template-columns: 1fr;
  }

  .coin-card {
    min-height: 460px;
  }

  .coin-card::after {
    top: auto;
    right: 10%;
    bottom: -2px;
    left: 10%;
    width: auto;
    height: 6px;
    background: linear-gradient(90deg, transparent, rgba(255, 237, 170, 0.86), rgba(184, 134, 11, 0.96), rgba(255, 227, 132, 0.68), transparent);
  }

  .site-footer span + span::before {
    content: "";
    margin: 0;
  }
}

@media (max-width: 520px) {
  .summary-panel > div,
  .receipt-rows > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .summary-panel strong,
  .receipt-rows strong {
    text-align: left;
  }

  .gold-button,
  .ghost-button {
    width: 100%;
  }

  .button-row {
    flex-direction: column;
  }
}
