:root {
  color-scheme: light;
  --paper: #f9f7f1;
  --white: #fffdf9;
  --ink: #23233a;
  --soft-ink: #5a5868;
  --line: #e3dfd7;
  --mint: #e7f2ce;
  --navy: #272743;
  --cream-yellow: #ffe294;
  --blue: #a7d8fc;
  --rose: #ffc1d9;
  --font: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  --heading: "Arial Black", "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 20rem; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font: 1rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .63; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid #4856b5;
  outline-offset: 3px;
}

.page-width { width: min(100% - 3rem, 67rem); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); background: var(--white); }
.header-inner { min-height: 4.65rem; display: flex; align-items: center; gap: 2rem; }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-weight: 900;
  letter-spacing: -.025em;
  text-decoration: none;
  white-space: nowrap;
}

.clock-logo {
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
  width: 2.45rem;
  height: 2.45rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--cream-yellow);
  box-shadow: inset 0 0 0 3px #fff0ba, 0 2px 0 var(--ink);
}
.clock-logo::before {
  content: "";
  position: absolute;
  inset: 20% 47% 47% 28%;
  border-bottom: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
  border-radius: 0 0 4px 0;
}
.clock-logo::after {
  content: "";
  position: absolute;
  width: 5px;
  aspect-ratio: 1;
  border-radius: 50%;
  left: calc(50% - 1.5px);
  top: calc(50% - 2px);
  background: var(--ink);
}

.site-nav { display: flex; align-items: center; justify-content: center; gap: 1.7rem; margin-inline: auto; }
.site-nav a { color: var(--soft-ink); font-size: .94rem; font-weight: 700; text-decoration: none; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .3em; }
.profile-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .45rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: .38rem .8rem;
  font-weight: 800;
  font-size: .88rem;
}
.profile-chip::before { content: ""; inline-size: .62rem; aspect-ratio: 1; background: var(--cream-yellow); border: 1px solid var(--ink); border-radius: 50%; }
.profile-chip[data-role="lesha"]::before, .profile-chip[data-identity="lesha"]::before { background: var(--blue); }
.profile-chip[data-role="nadya"]::before, .profile-chip[data-identity="nadya"]::before { background: var(--rose); }

main { padding-block: 0 4rem; }
.wallet-hero { position: relative; }
.hero-heading { position: relative; width: fit-content; max-width: 100%; margin: 2.2rem auto 1.8rem; text-align: center; }
.hero-heading h1, .access-panel h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  font: 900 clamp(2.5rem, 6.05vw, 4.55rem)/1.07 var(--heading);
  letter-spacing: -.075em;
}
.hero-heading h1 span { white-space: nowrap; }
.hero-heading p, .access-panel > p { margin: .65rem 0 0; color: var(--soft-ink); font-size: clamp(.94rem, 2.2vw, 1.08rem); }
.heading-spark { position: absolute; z-index: 0; color: #d78a11; font-size: 1.9rem; line-height: 1; }
.heading-spark-left { top: .22rem; left: -2.72rem; transform: rotate(12deg) scale(.8); color: #7379bd; }
.heading-spark-right { top: 1.72rem; right: -2.9rem; transform: rotate(13deg); }

.wallet-board {
  position: relative;
  display: grid;
  gap: 1.12rem;
  padding: 1.05rem 1.05rem 1.2rem;
  background: var(--white);
  border: 1px solid #cfc8ba;
  border-radius: 1.65rem;
  box-shadow: 0 4px 0 #e7e0d1;
}
.player-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .82rem; }
.player {
  position: relative;
  display: flex;
  align-items: center;
  isolation: isolate;
  min-width: 0;
  min-height: 13.1rem;
  padding: 1.55rem clamp(1.05rem, 4vw, 2.25rem);
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 1.12rem;
  background:
    radial-gradient(circle, var(--pattern) 1.2px, transparent 1.6px) 2px 1px / 17px 17px,
    linear-gradient(115deg, var(--card-deep), var(--card-light));
  color: var(--card-ink);
}
.player-lesha {
  --card-deep: #b6dffb;
  --card-light: #d9efff;
  --card-ink: #173a68;
  --card-border: #8abcea;
  --pattern: #7bacd744;
  --orbit: #dff3ff;
  --player-pin: #4a93db;
}
.player-nadya {
  --card-deep: #ffe4ef;
  --card-light: #ffd1e1;
  --card-ink: #652f4d;
  --card-border: #eeb1cb;
  --pattern: #dc8cb14d;
  --orbit: #fff0f8;
  --player-pin: #c65490;
  justify-content: flex-end;
  text-align: right;
}
.player-info { min-width: 0; position: relative; z-index: 3; }
.player-info h2 {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 .45rem;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  font-weight: 900;
}
.player-nadya h2 { justify-content: flex-end; }
.player-pin { display: inline-block; flex: 0 0 auto; width: .62rem; aspect-ratio: 1; border-radius: 50%; background: var(--player-pin); }
.balance {
  font: 900 clamp(1.52rem, 4.8vw, 3.35rem)/1.05 var(--heading);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.06em;
  white-space: nowrap;
}
.player-art {
  position: absolute;
  inset: auto -1.5% -12% auto;
  width: 58%;
  height: 123%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  z-index: 2;
}
.player-nadya .player-art { left: -1.5%; right: auto; }
.player-orbit {
  position: absolute;
  z-index: 0;
  right: -1.6rem;
  bottom: -7rem;
  width: clamp(13rem, 30vw, 18.5rem);
  aspect-ratio: 1;
  border-radius: 49%;
  border: 1px solid var(--card-border);
  background: var(--orbit);
  box-shadow: 0 0 0 .72rem color-mix(in srgb, var(--orbit) 63%, transparent);
  transform: rotate(-17deg);
}
.player-nadya .player-orbit { left: -1.6rem; right: auto; transform: rotate(17deg); }
.player-glint { position: absolute; z-index: 1; color: var(--player-pin); line-height: 1; }
.glint-large { right: 7%; top: 12%; font-size: 1.65rem; transform: rotate(12deg); }
.glint-small { right: 39%; top: 28%; font-size: .95rem; }
.player-nadya .glint-large { left: 7%; right: auto; }
.player-nadya .glint-small { left: 39%; right: auto; }

.meter { margin: 0 .18rem; }
#minute-meter {
  --lesha: 50%;
  position: relative;
  display: flex;
  height: 1.23rem;
  border-radius: 100px;
  border: 1.5px solid var(--navy);
  overflow: hidden;
  background: var(--rose);
}
.minute-track-left { width: var(--lesha); flex: 0 0 auto; background-color: var(--blue); transition: width 650ms cubic-bezier(.16, 1, .3, 1); }
.minute-track-right { flex: 1; background-color: var(--rose); }
.minute-track-left, .minute-track-right { background-image: repeating-linear-gradient(130deg, transparent 0 7px, #fff5 7px 10px); }
#minute-meter::after {
  content: "";
  position: absolute;
  left: clamp(0px, var(--lesha), 100%);
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--navy);
  transform: translateX(-1px);
  transition: left 650ms cubic-bezier(.16, 1, .3, 1);
}
.meter-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: .24rem;
  color: var(--soft-ink);
  font-size: .81rem;
  font-variant-numeric: tabular-nums;
}
.meter-ticks span { flex: 1; text-align: center; }
.meter-ticks span:first-child { text-align: left; }
.meter-ticks span:last-child { text-align: right; }
.wallet-actions { display: flex; justify-content: center; gap: .7rem; }
.connection-status { margin: .75rem 0 0; text-align: center; color: var(--soft-ink); }
.wallet-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .46rem; margin-top: .75rem; }
.wallet-tools .button { border-color: transparent; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .47rem;
  min-height: 2.75rem;
  padding: .55rem 1rem;
  border: 1px solid transparent;
  border-radius: .72rem;
  color: var(--ink);
  font-size: .94rem;
  font-weight: 800;
  text-decoration: none;
  transition: background-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.button:not(:disabled):active { transform: translateY(2px); }
.button-primary { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 2px 0 #0f0f27; }
.button-primary:not(:disabled):hover { background: #454569; }
.button-secondary { background: #fffaf0; border-color: #c8c0ae; box-shadow: 0 2px 0 #e1d8c6; }
.button-secondary:not(:disabled):hover { background: #fff0c8; }
.button-quiet { background: transparent; color: #464473; border-color: #dcd7e7; }
.button-quiet:not(:disabled):hover { background: #edebf6; }
.button-danger { color: #922b4f; background: #fff0f5; border-color: #e8adc1; }
.button-danger:not(:disabled):hover { background: #ffe0ec; }
.button-small { min-height: 2.2rem; padding: .36rem .7rem; font-size: .87rem; }
.button-symbol { position: relative; display: inline-block; flex: 0 0 auto; width: 1rem; height: 1rem; }
.transfer-symbol::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: #ffe294;
  clip-path: polygon(0 43%, 98% 0, 68% 97%, 47% 62%, 27% 84%, 29% 56%);
}
.request-symbol::before, .request-symbol::after {
  content: "";
  position: absolute;
  background: #594350;
  border-radius: 100px;
}
.request-symbol::before { width: .72rem; height: 2px; left: .14rem; top: .45rem; }
.request-symbol::after { height: .72rem; width: 2px; left: .44rem; top: .14rem; }

.pending-panel { margin-top: 1.35rem; }
.lower-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin-top: 1rem; align-items: start; }
.wallet-panel { min-width: 0; padding: 1rem 1.12rem 1.06rem; background: var(--white); border: 1px solid var(--line); border-radius: 1.18rem; scroll-margin-top: 1rem; }
.panel-heading { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; min-height: 2.35rem; }
.panel-heading h2 { margin: 0; font-size: clamp(1rem, 2.1vw, 1.23rem); line-height: 1.2; letter-spacing: -.025em; }
.panel-action { margin-inline-start: auto; }
.panel-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.18rem;
  aspect-ratio: 1;
  border-radius: .7rem;
}
.panel-icon span, .panel-icon span::before, .panel-icon span::after { display: block; position: absolute; }
.panel-icon-time { color: #704d14; background: #ffebaf; }
.panel-icon-time span { width: 1rem; height: 1rem; border: 1.7px solid currentColor; border-radius: 50%; }
.panel-icon-time span::after { content: ""; width: .26rem; height: .33rem; left: .32rem; top: .11rem; border-left: 1.7px solid; border-bottom: 1.7px solid; }
.panel-icon-shop { color: #435b2a; background: #eaf3d9; }
.panel-icon-shop span { width: .91rem; height: .71rem; top: .89rem; border: 1.7px solid currentColor; border-radius: 0 0 .16rem .16rem; }
.panel-icon-shop span::before { content: ""; width: 1.1rem; height: .36rem; top: -.35rem; left: -.2rem; border: 1.7px solid; border-radius: .16rem .16rem .07rem .07rem; }
.panel-icon-receipt { color: #5b4978; background: #eee5fa; }
.panel-icon-receipt span { width: .79rem; height: .98rem; border: 1.7px solid; border-radius: .12rem; }
.panel-icon-receipt span::after { content: ""; width: .34rem; height: .34rem; top: .15rem; left: .12rem; border-block: 1.5px solid; }
.panel-count { padding: .05rem .42rem; border-radius: 99px; background: #f0ecf4; font-weight: 800; font-size: .82rem; }
.panel-list { display: grid; gap: .55rem; margin-top: .75rem; }
.list-item {
  display: flex;
  align-items: center;
  gap: .72rem;
  min-width: 0;
  padding: .65rem .72rem;
  border: 1px solid #e7e0d3;
  border-radius: .69rem;
  background: #fffcf5;
  overflow-wrap: anywhere;
}
.item-icon { display: inline-grid; flex: 0 0 auto; width: 2rem; min-height: 2rem; place-items: center; border-radius: 50%; background: #f0e5c4; }
.item-copy { min-width: 0; flex: 1; }
.item-copy strong { display: block; line-height: 1.25; }
.item-copy p, .item-copy small { display: block; margin: .22rem 0 0; color: var(--soft-ink); font-size: .88rem; line-height: 1.4; }
.item-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: .38rem; margin-inline-start: auto; }
.empty-state {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .42rem;
  padding: .8rem .85rem;
  border: 1px dashed #ded9cc;
  border-radius: .66rem;
  color: var(--soft-ink);
  background: #fcfaf4;
  font-size: .94rem;
}
.empty-state strong { color: var(--ink); }
.empty-state p { margin: 0; }
.empty-icon { color: #8c7565; }

.access-stage { display: grid; place-items: start center; padding-top: clamp(2.5rem, 10vh, 7rem); }
.access-panel {
  position: relative;
  width: min(100%, 35rem);
  padding: clamp(1.4rem, 5vw, 2.6rem);
  border: 1px solid #cfc8ba;
  border-radius: 1.65rem;
  background: var(--white);
  text-align: center;
  box-shadow: 0 4px 0 #e7e0d1;
}
.access-panel h1 { font-size: clamp(2rem, 5.4vw, 3rem); margin-top: .74rem; }
.access-clock { width: 3.8rem; height: 3.8rem; }
.access-clock::before { border-width: 3px; }
.access-stage:has(#access-meme:not([hidden])) { padding-top: clamp(1.3rem, 5vh, 3.7rem); }
.access-panel:has(#access-meme:not([hidden]), #used-invite-art:not([hidden])) > .access-clock { display: none; }
.access-panel:has(#access-meme:not([hidden])) h1 { font-size: clamp(1.35rem, 4vw, 1.65rem); letter-spacing: -.045em; }
.access-meme { margin: 0; border: 1.5px solid var(--ink); border-radius: .9rem; overflow: hidden; background: var(--navy); color: #fff; box-shadow: 0 3px 0 #e7e0d1; }
.access-meme-frame { aspect-ratio: 16 / 9; overflow: hidden; background: #987c66; }
.access-meme-frame img { display: block; width: 170%; height: auto; margin: -27% 0 0 -31%; }
.access-meme figcaption { padding: .5rem .65rem .6rem; font-size: clamp(1.06rem, 3.8vw, 1.37rem); font-weight: 900; }
.used-invite-art { position: relative; display: inline-grid; place-items: center; width: 7rem; height: 5.35rem; margin-inline: auto; border: 2px dashed #bb889a; border-radius: .9rem; background: #ffe3ed; transform: rotate(-6deg); }
.used-invite-art .access-clock { opacity: .8; }
.used-invite-art::after { content: ""; position: absolute; width: 75%; height: 3px; background: #a44c6d; border-radius: 100px; transform: rotate(-22deg); }
.identity-options { display: grid; grid-template-columns: 1fr 1fr; gap: .72rem; margin-top: 1.36rem; }
.identity-options:has(.identity-option[hidden]) { grid-template-columns: minmax(0, 12rem); justify-content: center; }
.identity-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: .4rem .8rem .6rem;
  overflow: hidden;
  border: 1px solid #8abcea;
  border-radius: .9rem;
  color: #173a68;
  background: #d9efff;
  box-shadow: 0 2px 0 #a9d8fa;
  font-weight: 900;
}
.identity-nadya { color: #652f4d; background: #ffe0ed; border-color: #eeb1cb; box-shadow: 0 2px 0 #f7c7dc; }
.identity-option:hover { filter: saturate(1.2); }
.identity-picture { width: 100%; height: 6rem; position: relative; display: block; }
.identity-picture img { width: 100%; height: 100%; object-fit: contain; }
.invite-form { display: grid; gap: .45rem; max-width: 24rem; margin: .85rem auto 0; text-align: left; }
.invite-form .button { justify-self: center; }
.noscript-message { text-align: center; }

dialog { padding: 0; width: min(100% - 2rem, 30rem); max-height: calc(100% - 2rem); color: var(--ink); background: var(--white); border: 1.5px solid var(--ink); border-radius: 1.2rem; box-shadow: 0 5px 0 #272743b3; }
dialog::backdrop { background: #23233a67; backdrop-filter: blur(2px); }
.dialog-body { position: relative; padding: 1.45rem; }
.dialog-body > h2 { margin: 0 1.8rem .82rem 0; font-size: 1.5rem; line-height: 1.15; letter-spacing: -.035em; }
.dialog-description { margin: -.25rem 0 .85rem; color: var(--soft-ink); }
.dialog-close {
  position: absolute;
  right: .72rem;
  top: .72rem;
  width: 2.17rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #dcd5c7;
  border-radius: .61rem;
  background: #faf6ea;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
}
.dialog-close:hover { background: #fff0c8; }
.form-field { display: grid; gap: .29rem; margin: .72rem 0; }
.form-field > span { font-size: .95rem; font-weight: 800; }
.form-field input, .form-field textarea {
  width: 100%;
  padding: .54rem .63rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #bfb9c6;
  border-radius: .56rem;
}
.form-field textarea { resize: vertical; }
.field-error { color: #8c2148; margin: .55rem 0; font-size: .95rem; }
.dialog-submit { width: 100%; margin-top: .45rem; }
.minted-invite-group { display: grid; gap: .12rem; margin-top: .5rem; }
.minted-invite-group .button { justify-self: start; }
.minted-invite-group input { font-size: .93rem; }
.invite-status { margin: .68rem 0 0; color: var(--soft-ink); font-size: .94rem; }
.receipt-card { margin-top: 1rem; padding: 1rem; border: 1px dashed #cbbca4; border-radius: .46rem; background: #fff7e2; overflow-wrap: anywhere; }
.receipt-amount { display: block; margin-bottom: .65rem; font: 900 2rem/1.05 var(--heading); letter-spacing: -.06em; text-align: center; }
.receipt-card dl { margin: 0; }
.receipt-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem .6rem; padding: .38rem 0; border-bottom: 1px dashed #dfceb3; }
.receipt-row:last-child { border-bottom: 0; }
.receipt-row > span { color: var(--soft-ink); }
.receipt-row > strong { max-width: 100%; margin-left: auto; font-weight: 800; text-align: right; }

#toast-region { position: fixed; z-index: 8; display: grid; gap: .5rem; right: clamp(.7rem, 3vw, 2rem); top: 5.3rem; width: min(calc(100vw - 1.4rem), 24rem); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: .72rem; padding: .86rem .93rem; color: var(--ink); background: #fff1c5; border: 1.5px solid var(--ink); border-radius: .86rem; box-shadow: 0 4px 0 #272743, 0 10px 24px #443b5533; overflow-wrap: anywhere; }
.toast-title { display: block; font-size: 1.05rem; font-weight: 900; }
.toast-copy { display: block; margin: .15rem 0 0; }
.toast-body { min-width: 0; }
.toast-icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: 2rem; aspect-ratio: 1; border-radius: 50%; background: #fed772; }
#coin-overlay { position: fixed; inset: 0; z-index: 9; pointer-events: none; overflow: hidden; }
.coin {
  position: absolute;
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1.5px solid #935618;
  border-radius: 50%;
  background: #ffcd53;
  box-shadow: inset 0 0 0 2px #ffe796, 1px 2px 0 #9e661d;
  color: #6b400e;
  font-size: .66rem;
  font-weight: 900;
}

@media (max-width: 48rem) {
  .page-width { width: calc(100% - 2rem); }
  .header-inner { gap: .75rem; min-height: 4.12rem; }
  .site-nav { gap: .78rem; }
  .site-nav a { font-size: .88rem; }
  .hero-heading { margin-top: 1.85rem; }
  .player { min-height: 11.5rem; }
  .player-art { width: 64%; }
  .lower-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 35rem) {
  .site-nav { display: none; }
  .profile-chip { margin-inline-start: auto; }
  .hero-heading h1 { font-size: clamp(1.9rem, 8.5vw, 3rem); }
  .hero-heading p { max-width: 24rem; margin-inline: auto; }
  .heading-spark { display: none; }
  .wallet-board { gap: .8rem; padding: .56rem .56rem .78rem; border-radius: 1.06rem; }
  .player-grid { gap: .43rem; }
  .player {
    display: block;
    min-height: 10.25rem;
    padding: .56rem .58rem;
    text-align: left;
    border-radius: .75rem;
  }
  .player-nadya { text-align: right; }
  .player-info h2 { margin: 0 0 .26rem; font-size: .97rem; }
  .player-pin { width: .5rem; }
  .player-art, .player-nadya .player-art { left: auto; right: -15%; bottom: -31%; width: 115%; height: 116%; }
  .player-nadya .player-art { right: auto; left: -15%; }
  .player-orbit { right: -4rem; bottom: -9.5rem; }
  .player-nadya .player-orbit { left: -4rem; }
  .glint-large { top: 57%; right: 9%; font-size: 1rem; }
  .player-nadya .glint-large { left: 9%; }
  .glint-small { display: none; }
  #minute-meter { height: 1rem; }
  .wallet-actions { gap: .43rem; }
  .wallet-actions .button { flex: 1; gap: .3rem; padding: .45rem .22rem; font-size: clamp(.77rem, 3.2vw, .93rem); white-space: nowrap; }
  .wallet-actions .button-symbol { display: none; }
  .wallet-tools { justify-content: center; }
  .wallet-panel { padding: .73rem; }
  .list-item { flex-wrap: wrap; gap: .45rem; }
  .item-copy { min-width: 6rem; }
  .item-actions { max-width: 100%; }
  #toast-region { top: 4.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
