/* Coin of Fate — banknote paper, treasury-green ink, an engraved gold coin and a numbered protocol. */
:root {
  --paper: #e7ece3;
  --paper-2: #dde4d8;
  --sheet: #f6f8f2;
  --ink: #143a30;
  --ink-soft: #4a665c;
  --line: rgba(20, 58, 48, 0.24);
  --gold-hi: #f4dc9a;
  --gold: #c9a04a;
  --gold-lo: #7a5a1c;
  --seal: #a3212d;
  --coin: 240px;
  --serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --sans: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --pay-paper: #f6f8f2;
  --pay-ink: #143a30;
  --pay-muted: #4a665c;
  --pay-line: rgba(20, 58, 48, 0.16);
  --pay-accent: #143a30;
  --pay-accent-ink: #f4dc9a;
  --pay-font: var(--sans);
  --pay-display: var(--serif);
  --pay-btn-radius: 999px;
  --pay-radius: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* ── top ── */
.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(1040px, 100% - 32px);
  margin: 0 auto;
  padding: 18px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
}
.brand > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-mark {
  flex: none;
  width: 30px;
  height: 30px;
}
.brand-mark circle {
  fill: var(--gold);
}
.brand-mark .ring {
  fill: none;
  stroke: var(--gold-lo);
  stroke-width: 1.2;
  stroke-dasharray: 1.6 1.4;
}
.brand-mark path {
  fill: var(--gold-lo);
}
.top-tools {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-tools select {
  appearance: none;
  min-height: 40px;
  padding: 6px 30px 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23143a30' stroke-width='2'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  color: var(--ink);
  font: 500 15px/1 var(--sans);
  cursor: pointer;
}
.sound {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.sound svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sound svg path:first-child {
  fill: currentColor;
}
.sound .mute {
  display: none;
}
.sound[aria-pressed='false'] .wave {
  display: none;
}
.sound[aria-pressed='false'] .mute {
  display: block;
}

main {
  overflow-x: hidden;
  overflow-x: clip;
}

/* ── hero ── */
.hero {
  position: relative;
  width: min(760px, 100% - 32px);
  margin: 0 auto;
  text-align: center;
}
.rosette {
  position: absolute;
  left: 50%;
  top: 175px;
  width: 760px;
  height: 760px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  stroke: var(--ink);
  stroke-width: 0.55;
  fill: none;
  opacity: 0.14;
}
.toss-area {
  position: relative;
  height: 350px;
  display: grid;
  place-items: center;
  perspective: 1100px;
  touch-action: manipulation;
}
.shadow {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: calc(var(--coin) * 0.78);
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(20, 40, 30, 0.32), transparent);
  transform: translateX(-50%);
}
.toss {
  --tx: 0deg;
  --ty: 0deg;
  width: var(--coin);
  height: var(--coin);
  transform-style: preserve-3d;
  transform: rotateX(var(--tx)) rotateY(var(--ty));
  transition: transform 0.25s ease-out;
}
.coin {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}
.face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35));
}
.face svg {
  display: block;
  width: 100%;
  height: 100%;
}
.face.heads {
  transform: translateZ(7px);
}
.face.tails {
  transform: rotateX(180deg) translateZ(7px);
}
.slice {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, #b8913c, #6f5218 55%, #a07b2e);
}

.title {
  position: relative;
  margin: 4px 0 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(44px, 7vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.lead {
  position: relative;
  max-width: 33em;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 18px;
}

/* ── form ── */
.ask {
  width: min(600px, 100% - 32px);
  margin: 40px auto 0;
}
.field {
  display: grid;
  gap: 2px;
  margin-bottom: 22px;
  text-align: left;
}
.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}
.field input {
  width: 100%;
  min-height: 52px;
  padding: 6px 2px 8px;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: italic 500 28px/1.2 var(--serif);
}
.field input::placeholder {
  color: rgba(20, 58, 48, 0.36);
}
.field input:focus {
  outline: none;
  border-bottom-color: var(--gold);
  box-shadow: 0 2px 0 var(--gold);
}
.sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
}
.note {
  margin: -6px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  text-align: left;
}
.guard {
  margin: 18px 0 0;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--sheet);
  box-shadow: inset 0 0 0 1.5px var(--line);
  text-align: left;
}
.guard p {
  margin: 0;
}
.guard a {
  color: var(--ink);
  font-weight: 600;
}
.cta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 14px;
  width: 100%;
  min-height: 64px;
  margin-top: 28px;
  padding: 14px 28px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--gold-hi);
  font: 600 19px/1.2 var(--sans);
  cursor: pointer;
  box-shadow:
    inset 0 0 0 2px var(--ink),
    inset 0 0 0 3.5px var(--gold),
    0 12px 28px rgba(20, 58, 48, 0.25);
  transition: transform 0.1s ease;
}
.cta:hover {
  filter: brightness(1.12);
}
.cta:active {
  transform: scale(0.99);
}
.cta-price {
  font-weight: 400;
  font-size: 15px;
  opacity: 0.8;
}

/* ── result ── */
.result {
  width: min(720px, 100% - 32px);
  margin: 36px auto 0;
}
.shared-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
  padding: 14px 14px 14px 20px;
  border-radius: 16px;
  background: var(--paper-2);
}
.shared-banner p {
  margin: 0;
  font-weight: 500;
}
.shared-invalid {
  text-align: center;
  font-size: 19px;
}
.edge-box {
  margin-bottom: 20px;
  padding: 24px;
  border-radius: 18px;
  background: var(--sheet);
  box-shadow: inset 0 0 0 1.5px var(--gold);
  text-align: center;
}
.edge-box h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.1;
}
.edge-box p {
  margin: 0;
}

.protocol {
  position: relative;
  padding: 34px;
  border-radius: 6px;
  background: var(--sheet);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 22px 50px rgba(20, 58, 48, 0.18);
}
.frame {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  pointer-events: none;
  fill: none;
  stroke: var(--ink);
}
.protocol-body {
  position: relative;
  padding: 22px 26px 18px;
}
.mint {
  margin: 0;
  text-align: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  color: var(--ink-soft);
}
.p-title {
  margin: 4px 0 22px;
  text-align: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 42px;
  line-height: 1.1;
}
.p-no {
  white-space: nowrap;
  color: var(--seal);
}
.p-list {
  display: grid;
  margin: 0;
}
.p-list > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) 1.6fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.p-list dt {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}
.p-list dd {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.p-list .p-main dd {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
}
.p-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}
.seal {
  flex: none;
  width: 132px;
  height: 132px;
  transform: rotate(-9deg);
}
.seal svg {
  display: block;
  width: 100%;
  height: 100%;
}
.sign {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
}
.p-verified {
  margin: 16px 0 0;
  color: #1d6b4a;
  font-weight: 600;
  font-size: 15px;
}
.p-fine {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 10px 24px;
  border: 0;
  border-radius: 999px;
  font: 600 16px/1.1 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.btn-ink {
  background: var(--ink);
  color: var(--gold-hi);
}
.btn-line {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn-line:hover {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

/* ── footer ── */
.foot {
  width: min(1040px, 100% - 32px);
  margin: 72px auto 0;
  padding: 22px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
  text-align: center;
}
.foot p {
  margin: 0 0 8px;
}
.more {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
}
.more a {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 640px) {
  :root {
    --coin: 190px;
  }
  body {
    font-size: 16px;
  }
  .brand {
    font-size: 21px;
  }
  .rosette {
    top: 140px;
    width: 560px;
    height: 560px;
  }
  .toss-area {
    height: 280px;
  }
  .lead {
    font-size: 17px;
  }
  .sides {
    grid-template-columns: 1fr;
  }
  .field input {
    font-size: 24px;
  }
  .protocol {
    padding: 14px;
  }
  .frame {
    inset: 6px;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
  }
  .protocol-body {
    padding: 22px 14px 14px;
  }
  .p-title {
    font-size: 32px;
  }
  .p-list > div {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .p-list .p-main dd {
    font-size: 30px;
  }
  .seal {
    width: 104px;
    height: 104px;
  }
  .sign {
    font-size: 20px;
  }
  .actions .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toss {
    transition: none;
  }
}
