/* Placeholder art. Thessa's card designs drop into .card-back and .card-face,
   the layout and the flip do not change when they land. */

:root {
  --ink: #0b1020;
  --paper: #eef1f7;
  --line: #2b3350;
  --glow: #cbd4ee;
  --card-w: min(28vw, 132px);
  --radius: 10px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 700px at 50% -10%, #1a2445 0%, transparent 60%),
    var(--ink);
  color: var(--paper);
  font: 400 16px/1.5 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  /* starfield */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 78% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 34% 62%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 88% 71%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 56% 86%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 22% 82%, #fff 50%, transparent 51%);
  opacity: .5;
}

#stage {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  text-align: center;
}

.intro { margin: 0; }

.kicker {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--glow);
  opacity: .8;
}

h1 {
  margin: 0;
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 500;
  letter-spacing: -.01em;
}

/* ---- the three cards ---- */

.spread {
  display: flex;
  gap: clamp(10px, 3vw, 18px);
  perspective: 1200px;
}

.card {
  width: var(--card-w);
  aspect-ratio: 2 / 3;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
  animation: rise .7s cubic-bezier(.2, .8, .2, 1) backwards;
}

.card:nth-child(2) { animation-delay: .08s; }
.card:nth-child(3) { animation-delay: .16s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) rotateX(12deg); }
  to   { opacity: 1; transform: none; }
}

.card::before,
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  backface-visibility: hidden;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
}

/* back */
.card::before {
  background:
    radial-gradient(60% 40% at 50% 22%, rgba(203, 212, 238, .30), transparent 70%),
    linear-gradient(170deg, #2b3663 0%, #1b2440 100%);
  background-color: #1b2440;
  border: 1px solid rgba(203, 212, 238, .35);
}

/* face, revealed */
.card::after {
  background: var(--paper);
  transform: rotateY(180deg);
}

.card:not(.revealed):not(.busy):hover { transform: translateY(-6px); }
.card:not(.revealed):active { transform: translateY(-2px) scale(.985); }

.card.busy { pointer-events: none; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.card.revealed { transform: rotateY(180deg); cursor: default; }

.card .text {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  backface-visibility: hidden;
  display: grid;
  place-items: center;
  padding: 8% 9%;
  border-radius: var(--radius);
  color: #16203c;
  font-size: clamp(6px, 1.9vw, 9px);
  line-height: 1.32;
  letter-spacing: .02em;
  text-transform: uppercase;
  overflow: hidden;
}

/* A revealed card grows so the message is actually readable on a phone. */
.card.open {
  position: fixed;
  z-index: 40;
  inset: auto;
  top: 50%;
  left: 50%;
  width: min(78vw, 330px);
  transform: translate(-50%, -50%) rotateY(180deg);
}
.card.open .text { font-size: clamp(11px, 3.3vw, 15px); line-height: 1.45; }

/* ---- copy ---- */

.price {
  margin: 0;
  font-size: 17px;
  color: var(--glow);
}

.fineprint {
  margin: -12px 0 0;
  font-size: 13px;
  opacity: .55;
  max-width: 30ch;
}

/* ---- payment sheet ---- */

.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet[hidden] { display: none; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 18, .72);
  backdrop-filter: blur(3px);
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }

.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fbfcff;
  color: #16203c;
  border-radius: 18px 18px 0 0;
  padding: 20px 20px max(20px, env(safe-area-inset-bottom));
  max-height: 88dvh;
  overflow-y: auto;
  animation: up .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes up { from { transform: translateY(100%); } }

@media (min-width: 620px) {
  .sheet-panel {
    left: 50%;
    bottom: auto;
    top: 50%;
    right: auto;
    width: 420px;
    transform: translate(-50%, -50%);
    border-radius: 18px;
    animation: none;
  }
}

.sheet-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: #8b93ab;
  cursor: pointer;
}

.sheet-title { margin: 2px 0 0; font-size: 15px; color: #6b7391; }
.sheet-amount { margin: 2px 0 16px; font-size: 30px; font-weight: 600; }

#express:empty { display: none; }

.or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: #98a0b8;
  font-size: 12px;
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: #e2e6f0; }
.or[hidden] { display: none; }

.pay {
  width: 100%;
  margin-top: 16px;
  padding: 15px;
  border: 0;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}
.pay:disabled { opacity: .5; cursor: default; }

.sheet-error {
  margin: 12px 0 0;
  color: #b4304a;
  font-size: 14px;
}
.sheet-error[hidden] { display: none; }

.sheet-legal { margin: 14px 0 0; font-size: 11px; color: #98a0b8; text-align: center; }

/* ---- toast ---- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 70;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(10, 14, 30, .94);
  border: 1px solid rgba(203, 212, 238, .25);
  font-size: 14px;
}
.toast[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
