
:root {
  --bg: #0a0a0b;
  --bg-2: #121214;
  --bg-3: #1a1a1d;
  --ink: #f3ede3;
  --muted: rgba(243, 237, 227, 0.62);
  --faint: rgba(243, 237, 227, 0.38);
  --line: rgba(243, 237, 227, 0.12);
  --orange: #f68f15;
  --orange-2: #e06a0c;
  --gold-1: #fbe7b5;
  --gold-2: #e2b15a;
  --gold-3: #9b6a22;
  --ok: #5fd39a;
  --danger: #ff6b5b;
  --sans: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* One family (Poppins). The accent is Poppins italic, numbers use Poppins tabular figures. */
  --serif: var(--sans);
  --mono: var(--sans);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
body { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
a { color: var(--orange); }

.serif { font-family: var(--sans); font-style: italic; font-weight: 500; color: var(--orange); letter-spacing: -0.02em; }
.kicker { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--orange); font-weight: 500; }
h1, h2, .kicker, .fine, .hint, .status { text-wrap: balance; }
.lead, .crowd p { text-wrap: pretty; }
.muted { color: var(--muted); }
.mono { font-family: var(--sans); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* ---------- buttons & inputs ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; width: 100%;
  padding: 16px 20px; border-radius: 14px; font-weight: 600; font-size: 16px; letter-spacing: 0.01em;
  background: linear-gradient(180deg, var(--orange), var(--orange-2)); color: #160b00;
  box-shadow: 0 10px 30px -10px rgba(246, 143, 21, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.15s, filter 0.15s, opacity 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); box-shadow: none; font-weight: 500; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px 2px; }
.field input {
  width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); outline: none; font-size: 16px; transition: border-color 0.2s;
}
.field input:focus { border-color: var(--orange); }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 8px 2px 0; }

/* ---------- rarity ---------- */
.r-legendary { --r: var(--gold-2); }
.r-epic { --r: var(--orange); }
.r-rare { --r: #5fd97a; }
.r-common { --r: #cfd3d6; }
.tag {
  display: inline-block; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600;
  color: var(--r); border: 1px solid; border-color: color-mix(in srgb, var(--r) 45%, transparent); padding: 3px 8px; border-radius: 99px;
}

/* ---------- prize card (front) ---------- */
.pcard {
  position: relative; aspect-ratio: 5 / 7; border-radius: 18px; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; padding: 9% 9% 8%;
  background: var(--bg-3); border: 1px solid var(--line); text-align: left;
}
.pcard::before {
  content: ''; position: absolute; inset: -20%; z-index: -1; opacity: 0.18;
  background: url(/brand/medallion-plain.svg) center / 120% no-repeat;
}
.pcard .p-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* The Bitbase mark always sits on its own dark badge, so its official colours survive every card colour. */
.pcard .p-logo { position: relative; z-index: 1; flex: none; width: 19%; aspect-ratio: 1; border-radius: 26%; background: #0a0a0b; display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(243, 237, 227, 0.16), 0 6px 14px -6px rgba(0, 0, 0, 0.55); }
.pcard .p-logo img { width: 50%; height: auto; display: block; }
.pcard .p-name { font-family: var(--sans); font-style: normal; font-weight: 600; font-size: var(--pn, 34px); line-height: 1.04; letter-spacing: -0.02em; margin: 0; }
@supports (width: 1cqw) { .pcard { container-type: inline-size; } .pcard .p-name { font-size: min(var(--pn, 34px), 12.5cqw); } }
.pcard .p-sub { font-size: var(--ps, 12px); color: var(--muted); margin-top: 8px; }
.pcard .p-img { position: absolute; inset: 22% 8% 34%; z-index: -1; background: center / contain no-repeat; filter: drop-shadow(0 18px 24px rgba(0,0,0,.5)); }
.pcard.has-img .p-top + div { margin-top: auto; }
.pcard .p-foot { display: flex; justify-content: space-between; align-items: flex-end; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); }

.pcard.r-legendary {
  background:
    linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 45%, transparent 60%) 0 0 / 250% 100% no-repeat,
    linear-gradient(145deg, var(--gold-1), var(--gold-2) 42%, var(--gold-3) 80%, #6e4a17);
  color: #1d1307; border-color: rgba(255, 231, 170, 0.6);
  animation: sheen 3.2s ease-in-out infinite;
}
.pcard.r-legendary::before { opacity: 0.22; filter: brightness(0); }
.pcard.r-legendary .p-sub, .pcard.r-legendary .p-foot { color: rgba(29, 19, 7, 0.7); }
.pcard.r-legendary .tag { color: #1d1307; border-color: rgba(29, 19, 7, 0.4); }
.pcard.r-epic { background: linear-gradient(150deg, #ffad4a, var(--orange) 45%, #b44c06); color: #1b0c00; border-color: rgba(255, 190, 110, 0.6); }
.pcard.r-epic::before { opacity: 0.2; filter: brightness(0); }
.pcard.r-epic .p-sub, .pcard.r-epic .p-foot { color: rgba(27, 12, 0, 0.7); }
.pcard.r-epic .tag { color: #1b0c00; border-color: rgba(27, 12, 0, 0.4); }
.pcard.r-rare { background: linear-gradient(150deg, #f4f1ea, #cdc7bc 45%, #9a958b 80%, #77726a); color: #17150f; border-color: rgba(255,255,255,.6); }
.pcard.r-rare::before { opacity: .22; filter: brightness(0); }
.pcard.r-rare .p-name { color: #17150f; }
.pcard.r-rare .p-sub, .pcard.r-rare .p-foot { color: rgba(23,21,15,.65); }
.pcard.r-rare .tag { color: #17150f; border-color: rgba(23,21,15,.35); }
.pcard.r-common .p-name { color: var(--orange); }
.pcard.r-common { background: radial-gradient(120% 90% at 50% 0%, #24211d, #0e0d0e 70%); border-color: rgba(246,143,21,.4); }
.pcard.r-common::before { opacity: .3; }

.pcard .p-foot { padding-top: 9px; border-top: 1px solid color-mix(in srgb, currentColor 35%, transparent); }
@keyframes sheen { 0%, 100% { background-position: 120% 0, 0 0; } 50% { background-position: -20% 0, 0 0; } }

/* ---------- card back ---------- */
.pback {
  position: absolute; inset: 0; border-radius: 18px; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #1f1a14, #0d0c0d 70%);
  border: 1px solid rgba(246, 143, 21, 0.45);
  box-shadow: inset 0 0 0 6px var(--bg), inset 0 0 0 7px rgba(246, 143, 21, 0.25);
  display: grid; place-items: center;
}
.pback::before { content: ''; position: absolute; inset: 0; background: url(/brand/medallion-plain.svg) center / 88% auto no-repeat; opacity: .8; }
.pback .brk { position: absolute; left: 50%; top: 50%; width: 34%; padding: 7%; transform: translate(-50%, -50%); --bk-c: rgba(243,237,227,.6); --bk-l: 12px; --bk-o: 0px; }
.pback .brk img { display: block; width: 100%; }
.pback > img { position: relative; width: 22%; } /* safety net for pre-I10 markup (bare img, no .brk); no-op once .brk wraps it */
.pback::after { content: 'ONWARD'; position: absolute; bottom: 7%; font-size: 10px; letter-spacing: .42em; color: var(--orange); font-weight: 600; }

/* ---------- toast / modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: none; place-items: start center; z-index: 50; padding: max(10vh, calc(16px + env(safe-area-inset-top))) 16px 16px; overflow-y: auto; }
.modal.show { display: grid; }
.sheet { width: min(380px, 100%); background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px; padding: 22px; }

/* corner-bracket frame from the roll-up QR; add class="brk" to a box */
.brk { position: relative; --bk-c: rgba(243,237,227,.55); --bk-l: 14px; --bk-w: 1.5px; --bk-o: -8px; }
.brk::before { content: ''; position: absolute; inset: var(--bk-o); pointer-events: none;
  background:
    linear-gradient(var(--bk-c) 0 0) left top / var(--bk-l) var(--bk-w), linear-gradient(var(--bk-c) 0 0) left top / var(--bk-w) var(--bk-l),
    linear-gradient(var(--bk-c) 0 0) right top / var(--bk-l) var(--bk-w), linear-gradient(var(--bk-c) 0 0) right top / var(--bk-w) var(--bk-l),
    linear-gradient(var(--bk-c) 0 0) left bottom / var(--bk-l) var(--bk-w), linear-gradient(var(--bk-c) 0 0) left bottom / var(--bk-w) var(--bk-l),
    linear-gradient(var(--bk-c) 0 0) right bottom / var(--bk-l) var(--bk-w), linear-gradient(var(--bk-c) 0 0) right bottom / var(--bk-w) var(--bk-l);
  background-repeat: no-repeat; }

@media (prefers-reduced-motion: reduce) { .screen.on, .ticket::after, .pcard.r-legendary, .flip.ready .flip-inner, .flip.charging .flip-inner, .live::before, .btn.nudge { animation: none !important; } }

/* Final card artwork (one image per rarity): the image carries frame, name and rarity. */
.pcard.art { aspect-ratio: 3 / 4; padding: 0; border: 0; border-radius: 0; background: none; overflow: visible; display: block; animation: none; container-type: normal; }
.pcard.art::before { display: none; }
.pcard.art img { display: block; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; user-select: none; }
