@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --bg: #eeedf3;
  --panel: #fcfbfe;
  --line: #dedbe8;
  --ink: #181525;
  --muted: #5c566c;
  --accent: #5030a8;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --display: 'Space Grotesk', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.5 var(--display);
  position: relative;
  isolation: isolate;
}
body::before, body::after {
  content: '';
  position: absolute;
  z-index: -1;
  pointer-events: none;
  width: min(22vw, 340px);
  height: 590px;
  background: conic-gradient(from 24deg at 35% 43%, #ddd6f1 0 70deg, #cbc1e9 70deg 155deg, #e5dff2 155deg 265deg, #d3c9f0 265deg);
}
body::before { left: 0; top: 135px; clip-path: polygon(0 0, 72% 15%, 100% 39%, 60% 78%, 0 100%); }
body::after { right: 0; top: 230px; clip-path: polygon(100% 0, 100% 100%, 24% 78%, 0 48%, 37% 19%); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.shell { width: min(1032px, calc(100% - 64px)); margin-inline: auto; }
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 65px; gap: 16px; }
.wordmark, .footer > span:first-child { color: var(--ink); font-weight: 700; font-size: 24px; letter-spacing: -.07em; }
.logo-period { color: var(--accent); }
.mark {
  display: inline-block;
  background: conic-gradient(from 30deg at 55% 50%, #bda3ff 0 65deg, #5632aa 65deg 190deg, #905bea 190deg 274deg, #dfd0ff 274deg);
  clip-path: polygon(50% 1%, 97% 25%, 97% 75%, 50% 100%, 3% 75%, 3% 25%);
  width: 22px; height: 24px; margin-right: 8px; vertical-align: -.20em;
}
nav { display: flex; gap: 27px; color: var(--muted); font-size: 14px; font-weight: 600; }
.mode { color: var(--accent); border: 1px solid #d8c9fa; background: #f4efff; border-radius: 3px; padding: 6px 9px; font: 500 11px/1.6 var(--mono); white-space: nowrap; }
.mode span { display: inline-block; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.intro { padding: 45px 0 32px; }
h1 { font-size: clamp(48px, 8.1vw, 100px); line-height: .91; letter-spacing: -.08em; margin: 0 0 16px; }
h1 em { color: var(--accent); font-style: normal; }
.intro p { max-width: 440px; margin: 0; color: var(--muted); font-size: 17px; }
.round {
  scroll-margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(18px, 3vw, 34px);
  border: 1px solid #d3cde1;
  border-radius: 13px;
  padding: clamp(12px, 2vw, 22px);
  background: var(--panel);
  box-shadow: 0 14px 44px #37235b12;
}
.art { min-width: 0; margin: 0; align-self: start; }
.art img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; }
.art figcaption { display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; font: 500 11px/1.5 var(--mono); color: var(--muted); }
.art a { color: var(--accent); }
.panel { min-width: 0; padding: 7px 3px; }
.round-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.round-label, .time-left { font: 600 11px/1.5 var(--mono); }
.round-label { letter-spacing: .09em; color: var(--accent); }
.time-left { color: var(--muted); white-space: nowrap; }
.panel h2 { font-size: clamp(34px, 5vw, 63px); line-height: .92; letter-spacing: -.07em; margin: 14px 0 21px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 0; margin: 0 0 15px; border-block: 1px solid var(--line); }
.metrics dt, .note { color: var(--muted); font-size: 12px; }
.metrics dd { margin: 3px 0 0; font: 600 clamp(15px, 1.9vw, 22px)/1.1 var(--mono); white-space: nowrap; }
.metrics small { font-size: 9px; color: var(--accent); }
.progress-meta { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 6px; }
.progress-meta span { color: var(--accent); font: 600 12px var(--mono); }
progress { display: block; width: 100%; height: 7px; appearance: none; border: 0; border-radius: 5px; overflow: hidden; background: #ece7f5; }
progress::-webkit-progress-bar { background: #ece7f5; }
progress::-webkit-progress-value { background: #7446d7; }
progress::-moz-progress-bar { background: #7446d7; }
form { display: flex; gap: 9px; margin-top: 16px; }
button, select, input { font: inherit; }
button:disabled { cursor: default; opacity: .55; }
.stepper { display: flex; align-items: center; border: 1px solid #d8cfe8; border-radius: 4px; font: 600 13px var(--mono); }
.stepper button { color: var(--ink); border: 0; background: transparent; width: 30px; height: 42px; cursor: pointer; }
.stepper button:not(:disabled):hover { background: #eee7fb; }
.stepper input { appearance: textfield; width: 33px; height: 42px; border: 0; padding: 0; color: var(--ink); background: transparent; font: inherit; text-align: center; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { appearance: none; }
.cta { display: flex; flex: 1; padding: 0 12px; align-items: center; justify-content: space-between; gap: 7px; min-height: 44px; border: 0; border-radius: 4px; background: var(--accent); color: white; font-weight: 700; font-size: 14px; cursor: pointer; }
.cta:not(:disabled):hover { background: #3e2188; }
.note { min-height: 18px; margin: 9px 0; }
.demo-controls { border-top: 1px solid var(--line); padding-top: 9px; font-size: 12px; color: var(--muted); }
.demo-controls summary { width: fit-content; cursor: pointer; font-weight: 600; color: var(--accent); }
.demo-controls label { display: block; margin: 8px 0 4px; }
.demo-controls select, .demo-actions button { color: var(--ink); background: var(--panel); border: 1px solid #d8cfe8; border-radius: 4px; padding: 6px 9px; }
.demo-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.demo-actions button:not(:disabled) { cursor: pointer; }
.demo-actions button:not(:disabled):hover { background: #eee7fb; }
.how { margin: 43px 0; }
.how h2 { letter-spacing: -.055em; font-size: clamp(29px, 4vw, 43px); margin: 0 0 14px; }
.how ol { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); list-style: none; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.how li { padding: 17px 20px; }
.how li + li { border-left: 1px solid var(--line); }
.how h3 { margin: 0 0 5px; }
.how p { margin: 0; color: var(--muted); font-size: 14px; }
.footer { min-height: 64px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; align-items: center; color: var(--muted); font-size: 12px; }
@media (max-width: 650px) {
  .shell { width: calc(100% - 36px); }
  .round { grid-template-columns: 1fr; gap: 16px; }
  .intro { padding-top: 34px; }
  .how ol { grid-template-columns: 1fr; }
  .how li + li { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 440px) {
  nav { display: none; }
  .intro p { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
[hidden] { display: none !important; }
#tickets { flex-wrap: wrap; }
.wallet-field { flex: 0 0 100%; display: grid; gap: 4px; font-size: 13px; }
.wallet-field input, .history input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 4px; background: var(--panel); color: var(--ink);
}
.history { padding-block: 42px; min-height: 76vh; }
.history h1 { font-size: clamp(43px, 7vw, 74px); }
.history p { color: var(--muted); }
.history form { max-width: 460px; align-items: end; flex-wrap: wrap; }
.history form label { flex: 1 1 180px; display: grid; gap: 4px; font-size: 13px; }
.history form button { flex: 0 0 auto; min-height: 42px; }
.history .records { display: grid; gap: 12px; padding: 0; list-style: none; }
.history .records > li, .admin-panel {
  padding: clamp(15px, 3vw, 24px); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px;
}
.history h2, .history h3 { margin: 0; }
.record-header { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.record-header strong { font: 600 12px var(--mono); color: var(--accent); }
.record-details {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(185px, 100%), 1fr)); gap: 8px 16px;
  margin-bottom: 0;
}
.record-details dt { font-size: 12px; color: var(--muted); }
.record-details dd { margin: 0; overflow-wrap: anywhere; }
.record-wallet { grid-column: 1 / -1; }
.history details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.history summary { cursor: pointer; color: var(--accent); }
.history details li { overflow-wrap: anywhere; }
#chain-history { margin-block: 24px; }
#chain-records li { overflow-wrap: anywhere; }
#chain-records a { color: var(--accent); text-decoration: underline; }
.header-actions, .wallet-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.wallet-connect {
  min-height: 36px; padding: 6px 10px; border: 1px solid #d8c9fa;
  border-radius: 4px; background: var(--panel); color: var(--accent);
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.wallet-connect:not(:disabled):hover { background: #f4efff; }
.wallet-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding-block: 10px; border-top: 1px solid var(--line); }
.wallet-bar > div { min-width: 0; }
.wallet-address { font: 500 12px var(--mono); overflow-wrap: anywhere; }
#wallet-status { margin: 2px 0; color: var(--muted); font-size: 12px; }
@media (max-width: 540px) {
  .topbar { gap: 8px; padding-block: 6px; }
  .wallet-bar { align-items: start; flex-direction: column; }
  .header-actions { gap: 4px; }
}
