:root {
  --gold: #ffd86b;
  --ink: #01010a;
  --hud: rgba(255, 248, 224, 0.92);
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: var(--ink); }
body {
  font-family: var(--body);
  color: var(--hud);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
#app { position: fixed; inset: 0; }
canvas { display: block; touch-action: none; }

/* ---------- diegetic HUD ---------- */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: auto; }

.brand {
  position: absolute; top: env(safe-area-inset-top, 18px); left: 0; right: 0;
  margin-top: 16px; text-align: center;
  opacity: 0; animation: fadein 2.4s ease 0.4s forwards;
}
.brand .name {
  font-family: var(--display);
  font-size: clamp(18px, 5vw, 26px); letter-spacing: 0.26em;
  text-transform: uppercase; font-weight: 500; padding-left: 0.26em;
  text-shadow: 0 0 30px rgba(255, 216, 107, 0.45);
}
.brand .tag {
  margin-top: 11px; font-size: clamp(12px, 3.1vw, 14px); letter-spacing: 0.12em;
  opacity: 0.5; font-weight: 300;
}

.counter {
  position: absolute; top: env(safe-area-inset-top, 18px); left: 0; right: 0; margin-top: 74px;
  text-align: center; font-family: var(--display);
  font-size: 10px; letter-spacing: 0.3em; opacity: 0; text-transform: uppercase;
  animation: fadein 2s ease 1.2s forwards;
}
.counter b { color: var(--gold); font-weight: 600; }

.cta {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 22px) + 28px);
  background: rgba(255, 216, 107, 0.10);
  border: 1px solid rgba(255, 216, 107, 0.55);
  color: var(--hud); backdrop-filter: blur(8px);
  padding: 15px 34px; border-radius: 100px; white-space: nowrap;
  font-family: var(--display); font-size: 14px; letter-spacing: 0.22em; text-transform: uppercase;
  cursor: pointer; transition: all 0.3s ease;
  box-shadow: 0 0 40px rgba(255, 216, 107, 0.18);
  opacity: 0; animation: fadein 1.6s ease 1.8s forwards;
}
.cta:hover { background: rgba(255, 216, 107, 0.22); box-shadow: 0 0 60px rgba(255, 216, 107, 0.35); }
.cta:active { transform: translateX(-50%) scale(0.97); }

.hint {
  position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 22px) + 104px);
  text-align: center; font-size: 12px; letter-spacing: 0.14em; opacity: 0;
  animation: hintcycle 10s ease 2.2s forwards;
}
@keyframes hintcycle { 0% { opacity: 0; } 12% { opacity: .4; } 80% { opacity: .4; } 100% { opacity: 0; } }

/* ---------- star info card ---------- */
.card {
  position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 22px) + 96px);
  transform: translate(-50%, 16px); width: min(86vw, 360px);
  background: rgba(8, 9, 20, 0.72); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 216, 107, 0.28); border-radius: 18px;
  padding: 18px 20px; text-align: center;
  opacity: 0; pointer-events: none; transition: all 0.4s cubic-bezier(0.2,0.8,0.2,1);
}
.card.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.card .star-name { font-size: 20px; letter-spacing: 0.04em; color: var(--gold); }
.card .star-ded { margin-top: 6px; font-size: 13px; font-style: italic; opacity: 0.8; line-height: 1.5; }
.card .star-meta { margin-top: 10px; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.4; }
.card .close { position: absolute; top: 10px; right: 14px; font-size: 18px; opacity: 0.5; cursor: pointer; font-style: normal; }

/* ---------- loading veil ---------- */
#veil {
  position: fixed; inset: 0; z-index: 50; background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1.2s ease; font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; opacity: 0.0;
}
#veil .dot { animation: pulse 1.6s ease-in-out infinite; }
#veil.hide { opacity: 0 !important; pointer-events: none; }

@keyframes fadein { to { opacity: 1; } }
@keyframes pulse { 0%,100%{opacity:0.3} 50%{opacity:0.9} }

/* ---------- claim sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; display: none; }
.sheet.show { display: block; }
.sheet-bg { position: absolute; inset: 0; background: rgba(2,3,10,0.6); backdrop-filter: blur(3px); }
.sheet-card {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(440px, 100%); max-height: 92vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(12,14,28,0.96), rgba(6,7,16,0.98));
  border: 1px solid rgba(255,216,107,0.22); border-bottom: none;
  border-radius: 26px 26px 0 0; padding: 26px 22px calc(env(safe-area-inset-bottom,16px) + 26px);
  box-shadow: 0 -20px 80px rgba(0,0,0,0.6); animation: sheetup 0.4s cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes sheetup { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%,0); opacity: 1; } }
.sheet-close { position: absolute; top: 14px; right: 18px; font-size: 24px; opacity: 0.5; cursor: pointer; }
.sheet-title { text-align: center; font-size: 24px; letter-spacing: 0.04em; color: var(--gold); font-weight: 500; }
.sheet-sub { text-align: center; font-size: 13px; font-style: italic; opacity: 0.6; margin: 4px 0 18px; }

.tiers { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 16px; }
.tier { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px;
  padding: 12px 6px; cursor: pointer; color: var(--hud); font-family: inherit; display: flex; flex-direction: column; gap: 3px; transition: all 0.2s; }
.tier.sel { border-color: var(--gold); background: rgba(255,216,107,0.10); box-shadow: 0 0 22px rgba(255,216,107,0.18); }
.tier .t-name { font-size: 14px; letter-spacing: 0.04em; }
.tier .t-price { font-size: 13px; color: var(--gold); }
.tier .t-desc { font-size: 10px; opacity: 0.5; }

.fld { display: block; margin-bottom: 13px; }
.fld > span { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; margin-bottom: 6px; }
.fld > span i { text-transform: none; letter-spacing: 0; opacity: 0.7; }
.fld input { width: 100%; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px; padding: 12px 14px; color: #fff; font-family: inherit; font-size: 16px; outline: none; transition: border 0.2s; }
.fld input:focus { border-color: rgba(255,216,107,0.6); }
.slugrow, .amtrow { display: flex; align-items: center; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; padding: 0 12px; }
.slugrow em, .amtrow em { font-style: normal; opacity: 0.5; font-size: 14px; }
.slugrow input, .amtrow input { border: none; background: none; padding: 12px 8px; }
.slugrow b { font-size: 13px; padding-left: 6px; }
.slugrow b.ok { color: #7be0a0; } .slugrow b.bad { color: #e08a8a; }
.amt small { display: block; font-size: 11px; opacity: 0.45; margin-top: 5px; }
.err { color: #ffb0b0; font-size: 13px; min-height: 18px; text-align: center; margin: 4px 0 10px; }
.status { text-align: center; color: var(--gold); font-size: 14px; min-height: 20px; margin-top: 8px; }
#paypal-box { margin-top: 6px; min-height: 46px; }

.success { text-align: center; padding: 14px 4px; }
.success .big { font-size: 46px; color: var(--gold); text-shadow: 0 0 30px rgba(255,216,107,0.6); }
.success h2 { font-size: 24px; color: var(--gold); margin: 10px 0 4px; font-weight: 500; }
.success p { opacity: 0.7; font-style: italic; margin-bottom: 18px; }
.sharebox { display: flex; gap: 8px; margin-bottom: 14px; }
.sharebox input { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14); border-radius: 10px; padding: 11px; color: #fff; font-size: 13px; }
.sharebox button { background: rgba(255,216,107,0.15); border: 1px solid rgba(255,216,107,0.5); color: var(--hud); border-radius: 10px; padding: 0 16px; font-family: inherit; cursor: pointer; }
.seebtn { background: var(--gold); color: #1a1300; border: none; border-radius: 100px; padding: 13px 28px; font-family: inherit; font-size: 15px; letter-spacing: 0.06em; cursor: pointer; font-weight: 600; }

/* ---------- placement mode ---------- */
.place-ui { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.place-hint { position: absolute; top: calc(env(safe-area-inset-top,16px) + 92px); left: 0; right: 0; text-align: center; color: var(--hud); font-size: 17px; letter-spacing: 0.02em; animation: fadein 0.6s ease; }
.place-hint span { display: block; margin-top: 7px; font-size: 12px; opacity: 0.5; }
.place-actions { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom,22px) + 26px); display: flex; gap: 12px; pointer-events: auto; }
.place-cancel { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.18); color: var(--hud); border-radius: 100px; padding: 13px 22px; font-family: var(--body); font-size: 14px; cursor: pointer; }
.place-confirm { background: rgba(255,216,107,0.16); border: 1px solid rgba(255,216,107,0.6); color: var(--hud); border-radius: 100px; padding: 13px 26px; font-family: var(--display); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; cursor: pointer; transition: all .2s; }
.place-confirm:disabled { opacity: 0.35; cursor: default; }
.place-confirm:not(:disabled) { box-shadow: 0 0 30px rgba(255,216,107,0.28); }
body.placing .cta, body.placing .hint, body.placing .counter { opacity: 0 !important; pointer-events: none; transition: opacity .3s; }

/* ===================== claim ritual (flow) ===================== */
.flow { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 50% 0%, rgba(10,12,28,0.82), rgba(2,3,10,0.95)); backdrop-filter: blur(6px);
  overflow-y: auto; animation: fadein .35s ease; }
.flow[hidden] { display: none; }
.flow-top { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top,14px) + 12px) 18px 10px; }
.flow-back, .flow-x { background: none; border: none; color: var(--hud); font-family: var(--body); cursor: pointer; opacity: .65; font-size: 15px; }
.flow-x { font-size: 26px; line-height: 1; opacity: .5; }
.flow-min { font-family: var(--display); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); opacity: .85; }
.flow-body { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: stretch;
  width: min(460px, 100%); margin: 0 auto; padding: 10px 24px calc(env(safe-area-inset-bottom,20px) + 30px); }
.step { text-align: center; animation: stepin .4s cubic-bezier(.2,.8,.2,1); }
@keyframes stepin { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.q { font-family: var(--display); font-weight: 500; font-size: clamp(24px, 7vw, 32px); letter-spacing: .01em; margin-bottom: 8px; }
.explain { font-size: 14.5px; line-height: 1.55; opacity: .62; margin: 6px auto 18px; max-width: 30ch; }
.explain b { color: var(--gold); opacity: 1; font-weight: 600; }

.choices { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.choice { background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.12); border-radius: 18px;
  padding: 18px 20px; text-align: left; color: var(--hud); font-family: var(--body); cursor: pointer; transition: all .2s; }
.choice:hover, .choice:active { border-color: var(--gold); background: rgba(255,216,107,.08); }
.choice b { display: block; font-size: 18px; font-weight: 600; }
.choice span { display: block; font-size: 13px; opacity: .5; margin-top: 3px; }

.bigin { width: 100%; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); border-radius: 14px;
  padding: 15px 16px; color: #fff; font-family: var(--body); font-size: 18px; text-align: center; outline: none; transition: border .2s; }
.bigin:focus { border-color: rgba(255,216,107,.6); }
.bigin.ta { resize: none; height: 78px; text-align: left; font-size: 16px; }
.slugrow2 { display: flex; align-items: center; justify-content: center; gap: 2px; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 4px 12px; }
.slugrow2 input { background: none; border: none; color: var(--gold); font-family: var(--body); font-size: 17px; text-align: right; outline: none; width: 50%; padding: 11px 2px; }
.slugrow2 em { font-style: normal; opacity: .45; font-size: 14px; }
.slugmsg { font-size: 12px; min-height: 16px; margin-top: 8px; opacity: .8; }
.slugmsg.ok { color: #7be0a0; } .slugmsg.bad { color: #e08a8a; }

.upload { display: inline-block; margin-top: 12px; font-size: 13px; opacity: .65; cursor: pointer; border: 1px dashed rgba(255,255,255,.25); padding: 9px 16px; border-radius: 100px; }
.orbwrap { display: flex; flex-direction: column; align-items: center; min-height: 0; }
.orb { width: 120px; height: 120px; border-radius: 50%; margin: 26px 0 10px;
  background: radial-gradient(circle at 38% 34%, #fff7e0, #ffd86b 38%, #c98a2e 70%, #3a230a 100%);
  box-shadow: 0 0 60px rgba(255,216,107,.6), inset 0 0 30px rgba(255,255,255,.4); animation: orbpulse 1.4s ease-in-out infinite; }
@keyframes orbpulse { 0%,100% { transform: scale(.92); filter: brightness(.9); } 50% { transform: scale(1.05); filter: brightness(1.2); } }
.orblabel { font-size: 13px; opacity: .6; letter-spacing: .04em; }
.opts { margin-top: 6px; }
.optgrid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 16px; }
.opt { padding: 0; border: 2px solid transparent; border-radius: 14px; background: #000; cursor: pointer; overflow: hidden; transition: all .2s; }
.opt img { width: 100%; display: block; }
.opt.sel { border-color: var(--gold); box-shadow: 0 0 24px rgba(255,216,107,.4); }

.toggle { width: 100%; text-align: left; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px; padding: 16px 18px; color: var(--hud); font-family: var(--body); cursor: pointer; transition: all .2s; }
.toggle.on { border-color: var(--gold); background: rgba(255,216,107,.1); box-shadow: 0 0 22px rgba(255,216,107,.18); }
.toggle b { display: block; font-size: 16px; } .toggle span { display: block; font-size: 12.5px; opacity: .55; margin-top: 3px; }

.amtbig { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 14px 0; }
.amtbig em { font-style: normal; font-size: 30px; opacity: .6; }
.amtbig input { width: 130px; background: none; border: none; border-bottom: 1px solid rgba(255,255,255,.2);
  color: #fff; font-family: var(--display); font-size: 44px; text-align: center; outline: none; }
.amtpresets { display: flex; gap: 8px; justify-content: center; }
.amtpresets button { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); color: var(--hud);
  border-radius: 100px; padding: 9px 16px; font-family: var(--body); font-size: 14px; cursor: pointer; }

.flow-foot { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.flow-next { width: 100%; background: var(--gold); color: #241800; border: none; border-radius: 100px;
  padding: 16px; font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: .04em; cursor: pointer; transition: all .2s; box-shadow: 0 0 34px rgba(255,216,107,.3); }
.flow-next:disabled { opacity: .3; box-shadow: none; cursor: default; }
.flow-ghost { background: none; border: none; color: var(--hud); opacity: .55; font-family: var(--body); font-size: 14px; cursor: pointer; }

.cardbox { margin: 18px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.cf-row { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.16); border-radius: 13px; padding: 4px 14px; height: 52px; }
.cf-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.orsep { text-align: center; opacity: .35; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; margin: 14px 0; }
#pp-buttons { min-height: 46px; }

.done { text-align: center; animation: stepin .5s ease; }
.done-orb { width: 90px; height: 90px; border-radius: 50%; margin: 0 auto 18px;
  background: radial-gradient(circle at 38% 34%, #fff7e0, #ffd86b 40%, #c98a2e 72%, #2a1806 100%);
  box-shadow: 0 0 70px rgba(255,216,107,.7); animation: orbpulse 2.4s ease-in-out infinite; }
.done-no { font-family: var(--display); font-size: 11px; letter-spacing: .3em; color: var(--gold); opacity: .8; }
.done h2 { font-family: var(--display); font-size: 26px; font-weight: 500; margin: 8px 0 4px; }
.done p { opacity: .6; margin-bottom: 20px; }
.invite { margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.invite p { font-size: 13px; opacity: .55; margin-bottom: 10px; }

/* v6 checkout */
.cf-row { display: flex; align-items: center; padding: 0 8px; }
.cf-row iframe, .cf-row > * { width: 100%; height: 100%; border: none; }
.zip { width: 100%; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.16); border-radius: 13px; padding: 14px 16px; color: #fff; font-family: var(--body); font-size: 16px; outline: none; }
.zip:focus { border-color: rgba(255,216,107,.55); }
#apple-pay-button-container { margin-bottom: 14px; }
#apple-pay-button-container apple-pay-button { display: block; --apple-pay-button-width: 100%; --apple-pay-button-height: 50px; --apple-pay-button-border-radius: 100px; }
#paypal-button-container { min-height: 46px; }

.promo { display: flex; gap: 8px; margin: 6px 0 4px; }
.promo input { flex: 1; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 11px 14px; color: #fff; font-family: var(--body); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; outline: none; }
.promo button { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); color: var(--hud); border-radius: 12px; padding: 0 18px; font-family: var(--body); font-size: 13px; cursor: pointer; }
.promomsg { font-size: 12.5px; min-height: 15px; margin-bottom: 8px; }
.promomsg.ok { color: #7be0a0; } .promomsg.bad { color: #e08a8a; }

.breakdown { max-width: 290px; margin: 2px auto 18px; font-size: 13px; }
.breakdown div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.07); opacity: .75; }
.breakdown div span:last-child { color: var(--gold); }
