﻿:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #0d0d0d;
  color: #f8f5f1;
  --surface: #191715;
  --inset: #100f0e;
  --line: #35302c;
  --muted: #b8ada3;
  --accent: #ffd34f;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; padding: 0 clamp(16px, 5vw, 72px) 40px; }
a { color: inherit; text-decoration: none; }
.top {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 80px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 750; }
.player-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  aspect-ratio: 1;
  border-radius: 8px;
  font: 800 22px ui-monospace, monospace;
}
.brand-mark { display: block; width: 72px; height: 48px; object-fit: contain; }
.home-link { color: var(--muted); font-size: 14px; }
.home-link span { padding-left: 4px; }
.home-link:hover { color: #fff; }
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 12px;
  max-width: 1060px;
  margin: clamp(32px, 9vh, 96px) auto 0;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
}
.world {
  display: flex;
  align-items: end;
  min-height: 480px;
  padding: 24px;
  border-radius: 12px;
  background: #3b3128;
}
.world span { font-size: 16px; font-weight: 700; }
.form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(20px, 4vw, 44px);
  border: 1px solid #2d2824;
  border-top-color: #0b0a09;
  border-radius: 12px;
  background: var(--inset);
  box-shadow: inset 0 3px 12px #0008;
}
h1, h2, p { margin: 0; }
h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.02; letter-spacing: -.045em; }
.form-heading p, .form-footer { color: var(--muted); font-size: 14px; line-height: 1.55; margin-top: 12px; }
.form-heading strong { color: #f8f5f1; overflow-wrap: anywhere; }
.steps { list-style: none; display: flex; gap: 12px; padding: 0; margin: 0 0 24px; }
.steps li { flex: 1; border-top: 2px solid var(--line); padding-top: 8px; color: var(--muted); font-size: 12px; }
.steps li[aria-current] { border-color: var(--accent); color: #f8f5f1; }
.auth-form { display: grid; gap: 16px; margin-top: 24px; }
.field { display: grid; gap: 8px; }
label { font-size: 14px; font-weight: 650; }
input, button { min-height: 48px; border-radius: 8px; font: inherit; }
input { min-width: 0; padding: 0 12px; color: inherit; border: 1px solid #49413a; background: #0b0a09; box-shadow: inset 0 2px 5px #0006; }
input::placeholder { color: #a2968d; }
button { cursor: pointer; font-size: 14px; font-weight: 750; padding: 0 16px; }
.primary { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; background: var(--accent); color: #1a1010; }
.primary:hover { background: #ffe287; }
.secondary { border: 1px solid var(--line); color: inherit; background: var(--surface); }
.secondary:hover { background: #25211e; }
.form-footer { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; }
.form-footer a { color: #f8f5f1; text-decoration: underline; text-underline-offset: 4px; }
.error { color: #ffe287; background: #302616; padding: 12px; border-radius: 8px; margin-top: 16px; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dashboard { max-width: 1060px; margin: clamp(36px, 8vh, 88px) auto 0; }
.dashboard-grid { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 20px; margin-top: 28px; align-items: start; }
.account, .wallet { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; }
.account { padding: 16px; }
.identity { display: flex; align-items: center; gap: 12px; background: var(--inset); padding: 12px; border: 1px solid #2d2824; border-radius: 8px; }
.player-mark { width: 40px; background: #392f1c; color: #ffe287; }
.identity strong { display: block; font-size: 15px; margin-top: 4px; overflow-wrap: anywhere; }
.logout { margin-top: 12px; width: 100%; text-align: left; }
.wallet { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 220px; overflow: hidden; padding: clamp(16px, 4vw, 40px); }
.wallet-content { min-width: 0; }
.wallet h2 { color: var(--muted); font-size: 16px; font-weight: 650; }
.balance { margin-top: 12px; color: #f8f5f1; font-size: clamp(36px, 8vw, 88px); font-weight: 750; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.token {
  display: grid;
  place-items: center;
  flex: none;
  width: clamp(44px, 10vw, 104px);
  aspect-ratio: 1;
  background: #392f1c;
  color: #ffe287;
  border: 3px solid #8c6b29;
  clip-path: polygon(22% 0, 78% 0, 100% 22%, 100% 78%, 78% 100%, 22% 100%, 0 78%, 0 22%);
  font: 800 clamp(22px, 5vw, 52px) ui-monospace, monospace;
}
.card { max-width: 420px; margin: 64px auto; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.card p { margin-top: 16px; }
@media (max-width: 740px) {
  .top { min-height: 64px; }
  .auth { grid-template-columns: 1fr; margin-top: 24px; }
  .world { min-height: 160px; padding: 16px; background-position: center 46%; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .identity { padding: 8px; }
  .wallet { min-height: 160px; }
}

/* Empty profile */
.profile-shell {
  display: grid;
  place-items: center;
  isolation: isolate;
  position: relative;
  overflow: hidden;
  min-height: 100svh;
  padding: 24px;
  background: #101012;
}

.profile-shell::before, .profile-shell::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.profile-shell::before {
  z-index: -1;
  background:
    radial-gradient(ellipse 25% 67% at 29% 42%, #151517 67%, #29282b 88%, transparent 100%),
    radial-gradient(ellipse 26% 24% at 49% 84%, #161618 65%, #29282a 90%, transparent 100%),
    radial-gradient(circle at 76% 26%, #29282b 0 4%, transparent 6%),
    #101012;
  filter: blur(15px);
}

.profile-shell::after {
  z-index: -1;
  background: url("images/profile-grain.png");
  opacity: .20;
}

.profile-glass {
  width: min(100%, 390px);

  transform: translateY(-1svh);
  border: 1px solid #303034;

  border-radius: 22px;
  background: #18181b;
  box-shadow: 0 12px 36px #0003;

}

@media (max-width: 600px) {
  .profile-shell::before { inset: -10% -26%; }

}

.profile-glass {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 24px;
  min-height: min(440px, calc(100svh - 48px));
  height: auto;
  padding: clamp(20px, 5vw, 36px);
  overflow: hidden;
}
.glass-heading { display: grid; justify-items: center; gap: 16px; text-align: center; }
.glass-heading h1 { font-size: clamp(26px, 5vw, 34px); font-weight: 650; }
.glass-fields { display: grid; align-content: center; gap: 14px; }
.glass-field { display: grid; gap: 7px; color: #e0d9d2; font-size: 13px; }
.glass-field input {
  width: 100%;
  border-radius: 20px;
  border: 1px solid #ffffff1a;
  background: #ffffff0c;
  box-shadow: inset 0 1px 3px #0004;
}
.glass-terms { margin: 0 auto; max-width: 245px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.5; }
.glass-form {
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 24px;
}
.glass-actions { display: grid; gap: 8px; }
.glass-submit {
  width: 100%;
  min-height: 46px;
  padding: 8px 16px;
  border: 0;
  border-radius: 24px;
  background: var(--accent);
  color: #1a1010;
  font-size: 14px;
  font-weight: 750;
}
.glass-submit:hover { background: #ffe287; }
.glass-reset {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.glass-reset:hover { color: #f8f5f1; }
.glass-error { margin: 0; color: #ffe287; text-align: center; font-size: 13px; line-height: 1.5; }
.sky-account-shell { display: block; padding: clamp(18px, 4vw, 52px); background: #141416; }
.sky-account-shell::before { background: none; filter: none; }
.sky-account-shell::after { opacity: .07; }
.sky-account { max-width: 1120px; margin: 0 auto; }
.sky-account h1 {
  margin: 0 0 clamp(24px, 4vw, 48px);
  color: #fbf8f2;
  text-align: center;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 680;
  letter-spacing: -.025em;
}
.sky-account-data { margin: 0; display: grid; gap: 9px; }
.sky-account-row {
  display: grid;
  grid-template-columns: clamp(157px, 22%, 240px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #29282b;
  border-radius: 8px;
  background: #1d1d20;
}
.sky-account-row dt, .sky-account-row dd {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  margin: 0;
  padding: 8px clamp(10px, 2vw, 16px);
}
.sky-account-row dt { color: #fff; background: #79591d; font-size: 14px; font-weight: 650; }
.sky-account-row dd { color: #e5dfd4; overflow-wrap: anywhere; }
.sky-account-row .sky-token-value { color: #ffd66f; font-weight: 750; font-variant-numeric: tabular-nums; }
.sky-account svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sky-account-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: clamp(24px, 4vw, 50px); }
.sky-signout { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; border: 0; background: #79591d; color: #fff; }
.sky-signout:hover { background: #886621; }
@keyframes sky-arrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .profile-glass, .sky-account h1, .sky-account-row, .sky-account-actions {
    animation: sky-arrive 420ms cubic-bezier(.2,.7,.25,1) both;
  }
  .sky-account-row:nth-child(1) { animation-delay: 55ms; }
  .sky-account-row:nth-child(2) { animation-delay: 110ms; }
  .sky-account-row:nth-child(3) { animation-delay: 165ms; }
  .sky-account-row:nth-child(4) { animation-delay: 220ms; }
  .sky-account-row:nth-child(5) { animation-delay: 275ms; }
  .sky-account-row:nth-child(6) { animation-delay: 330ms; }
  .sky-account-actions { animation-delay: 385ms; }
}
.glass-field input:focus-visible {
  outline: 2px solid #c5c5ca;
  outline-offset: 2px;
}
.glass-field input:autofill { box-shadow: 0 0 0 100px #1c1c1f inset; }
.glass-field input:-webkit-autofill {
  -webkit-text-fill-color: #f8f5f1;
  box-shadow: 0 0 0 100px #1c1c1f inset;
  caret-color: #f8f5f1;
}
.glass-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 4px; }
.glass-switch a { color: #f8f5f1; text-decoration: underline; text-underline-offset: 3px; }
.glass-field input:focus { border-color: #75757c; }
.glass-field input:-webkit-autofill { border-color: #75757c; }

.sky-account-actions form { margin-left: auto; }
.sky-account-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.sky-account-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #5e4827;
  border-radius: 8px;
  background: #2b2318;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
}
.sky-account-tabs a:hover { background: #4c351b; }
.sky-account-tabs a[aria-current] { border-color: #a68136; background: #79591d; }
.sky-admin-nav { margin-bottom: 16px; }
.sky-admin-panel { margin-bottom: 16px; padding: clamp(16px, 3vw, 28px); border: 1px solid #353137; border-radius: 12px; background: #1d1d20; }
.sky-admin-panel h2 { margin: 0 0 16px; font-size: 18px; }
.sky-admin-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.sky-admin-form label { display: grid; gap: 8px; min-width: 0; }
.sky-admin-form select { min-width: 0; width: 100%; min-height: 48px; padding: 0 12px; color: inherit; border: 1px solid #49413a; border-radius: 8px; background: #100f0e; font: inherit; }
.sky-admin-form .sky-signout { min-height: 48px; justify-content: center; }
.sky-admin-notice, .sky-admin-error { margin: 0 0 16px; color: #ffe28a; }
.sky-admin-error { color: #ffb4a8; }
.sky-admin-table { overflow-x: auto; }
.sky-admin table { width: 100%; text-align: left; border-collapse: collapse; }
.sky-admin th, .sky-admin td { padding: 10px 8px; border-bottom: 1px solid #ffffff14; }
.sky-admin td.sky-token-value { color: #ffd66f; font-variant-numeric: tabular-nums; }
@media (max-width: 650px) { .sky-admin-form { grid-template-columns: 1fr; } }

.purchase-back { display: inline-block; margin-top: 12px; color: #eac977; }
.sticker-checkout {
  width: min(100%, 741px);
  margin: clamp(35px, 13vh, 140px) auto 0;
  perspective: 1000px;
}
.purchase-sticker {
  --light-x: 62%;
  --light-y: 30%;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --notch: clamp(9px, 2.9vw, 21px);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 76% 24%;
  min-height: 275px;
  aspect-ratio: 741 / 425;
  overflow: hidden;
  border-radius: clamp(12px, 3.3vw, 25px);
  color: #442514;
  background:
    url("/images/profile-grain.png"),
    radial-gradient(ellipse at var(--light-x) var(--light-y), #ffc691 0, #fe9046 51%, #ef671c 100%);
  mask-image:
    radial-gradient(circle at 76% 0, transparent var(--notch), #000 calc(var(--notch) + 1px)),
    radial-gradient(circle at 76% 100%, transparent var(--notch), #000 calc(var(--notch) + 1px));
  mask-composite: intersect;
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform 120ms ease-out;
}
.purchase-sticker::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 1px #fff8, inset 0 -2px 2px #963a1244;
  content: "";
  pointer-events: none;
}
.purchase-sticker.is-writing { transform: none; transition: none; }
.ticket-face {
  display: grid;
  grid-template-rows: auto auto minmax(56px, 1fr) auto;
  min-width: 0;
  gap: clamp(8px, 1.7vw, 16px);
  padding: clamp(16px, 5vw, 54px) clamp(12px, 4.5vw, 56px) clamp(16px, 4vw, 40px);
}
.ticket-brand { display: grid; gap: 3px; color: #512d19; font-size: clamp(11px, 2.2vw, 18px); font-weight: 700; }
.ticket-brand span:first-child { letter-spacing: .05em; text-transform: uppercase; }
.ticket-player { align-self: end; overflow-wrap: anywhere; font: 850 clamp(23px, 6vw, 62px)/1 system-ui, sans-serif; letter-spacing: -.04em; text-transform: uppercase; }
.sticker-signature { position: relative; min-height: 56px; border-bottom: 1px dashed #642d1866; }
.sticker-signature span { position: absolute; inset: auto auto 8px 0; color: #5b331e; font-size: clamp(11px, 1.8vw, 14px); pointer-events: none; }
.has-ink .sticker-signature span { visibility: hidden; }
.sticker-signature canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.ticket-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 10px; font-size: clamp(11px, 2vw, 16px); font-weight: 750; }
.ticket-stub { display: grid; place-items: center; min-width: 0; position: relative; border-left: 2px dashed #76391e65; }
.ticket-stub span, .ticket-stub strong { grid-area: 1 / 1; writing-mode: vertical-rl; }
.ticket-stub span { font-size: clamp(45px, 12vw, 132px); font-weight: 900; line-height: .9; letter-spacing: -.085em; color: #ffddbc8c; }
.ticket-stub strong { font-size: clamp(19px, 4vw, 48px); transform: rotate(180deg); }
.sticker-tools { margin: 10px 0 0; text-align: right; }
.sticker-tools button { min-height: 29px; border: 0; padding: 0 4px; color: #dcc7a4; background: transparent; font-size: 13px; }
.purchase-confirm { display: flex; justify-content: flex-start; }
.sticker-error { margin: 12px 0 0; color: #ffcd95; font-size: 14px; }
@keyframes purchase-stamp {
  0% { transform: scale(1); }
  45% { transform: scale(1.035); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: no-preference) {
  .purchase-sticker.is-stamped { animation: purchase-stamp 370ms ease-out both; }
}
@media (prefers-reduced-motion: reduce) { .purchase-sticker { transition: none; } }

.sticker-page { min-height: 100svh; background: #000; padding: 20px clamp(18px, 5vw, 64px) 40px; }
.sticker-page .sticker-checkout { margin-top: clamp(35px, 13vh, 140px); }
.sticker-page .purchase-confirm { margin-top: 28px; }
.sticker-result { margin-top: 28px; color: #f8e6b6; font-weight: 700; }
.buy-slider {
  --slide-x: 0px;
  --slide-fade: 1;
  position: relative;
  width: min(100%, 360px);
  height: 56px;
  padding: 4px;
  border: 1px solid #383229;
  border-radius: 28px;
  background: #161414;
  user-select: none;
}
.buy-slider[hidden], .buy-slider-confirmed[hidden] { display: none; }
.buy-slider-fill {
  position: absolute;
  inset: 4px auto 4px 4px;
  width: calc(46px + var(--slide-x));
  border-radius: 24px;
  background: #67491e;
  transition: width 170ms ease;
}
.buy-slider-label, .buy-slider-confirmed { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; font-size: 14px; }
.buy-slider-label { padding-left: 36px; color: #d6cabc; opacity: var(--slide-fade); }
.buy-slider-handle {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffd36c;
  color: #25170e;
  cursor: grab;
  touch-action: none;
  transform: translateX(var(--slide-x));
  transition: transform 170ms ease;
}
.buy-slider-handle:active { cursor: grabbing; }
.buy-slider svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.buy-slider.is-dragging .buy-slider-fill, .buy-slider.is-dragging .buy-slider-handle { transition: none; }
.buy-slider.is-confirmed .buy-slider-handle, .buy-slider.is-confirmed .buy-slider-label { visibility: hidden; }
.buy-slider-confirmed { gap: 8px; inset: 4px; border-radius: 24px; background: #ffd36c; color: #25170e; font-weight: 750; }
@media (prefers-reduced-motion: reduce) { .buy-slider-fill, .buy-slider-handle { transition: none; } }
