:root {
  --bg: #0b0b14;
  --ink: #f5f6fb;
  --dim: #9aa0b8;
  --glow: #5ec8ff;
  --gold: #ffd23f;
  --panel: rgba(16, 17, 30, 0.82);
  --line: rgba(255, 255, 255, 0.12);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font: 500 15px/1.35 Inter, system-ui, sans-serif; }
button, input, a { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.sky { position: fixed; inset: 0; background:
  radial-gradient(60% 45% at 50% 45%, color-mix(in srgb, var(--glow) 34%, transparent), transparent 70%),
  radial-gradient(120% 80% at 50% 110%, #1a1530, transparent 60%), var(--bg);
  transition: background 0.8s; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud { position: fixed; inset: 0; pointer-events: none; display: flex; flex-direction: column; }
#hud > * { pointer-events: auto; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 6px; }
.logo { font: 400 22px/1 Bungee, sans-serif; letter-spacing: 0.5px; text-shadow: 0 2px 0 #000; }
.logo span, .biglogo span { color: var(--gold); margin-left: 6px; }
.mcbox { text-align: right; }
.lbl { font: 800 10px/1 Inter; letter-spacing: 1.5px; color: var(--dim); }
.mc { font: 800 20px/1.1 'JetBrains Mono', monospace; }

/* shape name */
.title { text-align: center; padding: 2px 12px 0; pointer-events: none !important; }
.tname { font: 400 clamp(26px, 8.5vw, 48px)/1 Bungee, sans-serif; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,0.55), 0 0 26px color-mix(in srgb, var(--glow) 70%, transparent); }
.tsub { margin-top: 4px; font-weight: 700; font-size: 13px; color: var(--dim); min-height: 18px; }
.tsub b { color: var(--gold); font-family: 'JetBrains Mono', monospace; }
.title.pop .tname { animation: pop 0.45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* live feed */
.feed { position: fixed; left: 10px; top: 128px; width: min(300px, 62vw); display: flex; flex-direction: column; gap: 4px; pointer-events: none !important; }
.fl { background: rgba(10, 11, 20, 0.72); border: 1px solid var(--line); border-radius: 10px; padding: 5px 9px; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: slide 0.3s ease-out; transition: opacity 1s; }
.fl b { font-family: 'JetBrains Mono', monospace; color: #cfe8ff; }
.fl.whale { border-color: var(--gold); color: var(--gold); }
.fl.sell { color: var(--dim); }
.fl.old { opacity: 0.45; }
@keyframes slide { from { transform: translateX(-20px); opacity: 0; } }

/* bottom panel */
.bottom { margin-top: auto; padding: 8px 10px calc(10px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 760px; align-self: center;
  background: linear-gradient(to top, rgba(8, 8, 16, 0.92) 70%, rgba(8, 8, 16, 0)); }
.shapes { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; scroll-snap-type: x proximity; }
.shapes::-webkit-scrollbar { display: none; }
.shape { flex: 0 0 auto; width: 64px; height: 58px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; scroll-snap-align: center; transition: transform 0.15s, border-color 0.2s; }
.shape .em { font-size: 22px; line-height: 1; }
.shape .nm { font: 800 10px/1 Inter; letter-spacing: 0.1px; white-space: nowrap; text-transform: uppercase; color: var(--dim); }
.shape.on { border-color: var(--glow); background: color-mix(in srgb, var(--glow) 22%, var(--panel)); }
.shape.on .nm { color: #fff; }
.shape:active { transform: scale(0.94); }
.actions { display: flex; gap: 6px; }
.pill { min-height: 46px; padding: 0 12px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line); font-weight: 900; font-size: 13px; letter-spacing: 0.3px; white-space: nowrap; }
.pill.on { border-color: var(--glow); color: #fff; }
#gold.on { border-color: var(--gold); color: var(--gold); }
.pill.sq { width: 46px; padding: 0; }
.topr { display: flex; align-items: center; gap: 10px; }
.cap { flex: 1; min-width: 0; white-space: nowrap; min-height: 46px; padding: 0 6px; border-radius: 14px; background: var(--gold); color: #1a1405; font: 400 clamp(12px, 3.4vw, 15px)/1 Bungee, sans-serif; box-shadow: 0 4px 0 #a6810f; transition: transform 0.1s; }
.cap:active { transform: translateY(3px); box-shadow: 0 1px 0 #a6810f; }
.launchcap { background: #3ddc84; color: #04170c; box-shadow: 0 4px 0 #1f8f50; }
.launchcap:active { box-shadow: 0 1px 0 #1f8f50; }
.cabar { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 5px 5px 5px 12px; }
.catext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.calbl { font: 800 10px/1.2 Inter; letter-spacing: 1.2px; color: var(--dim); }
.ca { font: 600 12px/1.3 'JetBrains Mono', monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn { min-height: 44px; padding: 0 14px; border-radius: 11px; background: rgba(255, 255, 255, 0.1); font-weight: 900; font-size: 13px; letter-spacing: 0.4px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn.buy { background: #3ddc84; color: #04170c; }
.cabar.preview .ca { color: var(--dim); }
.cabar.preview .buy { opacity: 0.4; pointer-events: none; }
.streamca { display: none; }

/* the always-visible shape row: mystery cards (emoji + name, no 3D picture until you tap) */
.pickrow { display: flex; flex-direction: column; gap: 4px; }
.picklbl { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; font: 800 12px/1 Inter; letter-spacing: 0.3px; }
.picklbl span { color: #fff; animation: nudge 1.6s ease-in-out infinite; }
.picklbl b { color: var(--gold); font-family: 'JetBrains Mono', monospace; font-size: 11px; }
@keyframes nudge { 50% { transform: translateY(2px); opacity: 0.75; } }
.shape { position: relative; }
.shape .q, .pcard .q { position: absolute; top: 3px; right: 4px; font: 900 11px/1 Inter; color: var(--gold); }
.shape.seen .q, .pcard.seen .q { color: #3ddc84; }
.shape.all { background: var(--gold); border-color: var(--gold); }
.shape.all .em { font-size: 20px; }
.shape.all .nm { color: #1a1405; }

/* desktop: every shape docked on the right */
.rail { display: none; }
@media (min-width: 1100px) {
  #hud { padding-left: 296px; }
  .pickrow { display: none; }
  .rail { position: fixed; z-index: 5; top: 12px; left: 12px; bottom: 12px; width: 272px; display: flex; flex-direction: column; gap: 10px; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; backdrop-filter: blur(6px); }
  .rh { display: flex; flex-direction: column; gap: 2px; }
  .rh b { font: 400 18px/1 Bungee, sans-serif; color: var(--gold); }
  .rh small { color: var(--dim); font-weight: 700; }
  .rail .ptabs { flex-wrap: wrap; }
  .rail .ptabs button { min-height: 34px; padding: 0 10px; font-size: 12px; }
  .rgrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 5px; }
  .rcard { min-width: 0; position: relative; display: flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 16px 0 7px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1.5px solid var(--line); text-align: left; transition: background 0.15s, border-color 0.15s; }
  .rcard:hover { background: rgba(255, 255, 255, 0.1); }
  .rcard.on { border-color: var(--gold); background: rgba(255, 210, 63, 0.12); }
  .rcard i { font-style: normal; font-size: 16px; }
  .rcard span:not(.q) { font-weight: 800; font-size: 12px; letter-spacing: -0.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rcard .q { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font: 900 12px/1 Inter; color: var(--gold); }
  .rcard.seen .q { color: #3ddc84; }
}

/* shapes window */
.picker .ppanel { max-width: 960px; height: 90vh; overflow: hidden; }
.psearch { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #0b0c16; padding: 0 12px; font: 600 15px Inter; color: #fff; }
.ptabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 0 0 auto; }
.ptabs::-webkit-scrollbar { display: none; }
.ptabs button { min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-weight: 800; font-size: 13px; white-space: nowrap; }
.ptabs button small { color: var(--dim); margin-left: 4px; font-weight: 700; }
.ptabs button.on { background: var(--gold); color: #1a1405; border-color: var(--gold); }
.ptabs button.on small { color: #5a4a10; }
.pgrid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; align-content: start; padding-bottom: 8px; }
.pcard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 6px 8px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line); min-width: 0; transition: transform 0.12s; }
.pcard:active { transform: scale(0.96); }
.pcard.on { border-color: var(--gold); }
.pcard { position: relative; }
.pimg { width: 100%; aspect-ratio: 1.25; border-radius: 10px; background: var(--bg); display: grid; place-items: center; overflow: hidden; margin-bottom: 4px; }
.pimg i { font-style: normal; font-size: 34px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
.pcard b { font-size: 12px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard small { font-size: 10px; color: var(--dim); }

/* capture sheet */
.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet[hidden] { display: none; }
.panel { width: 100%; max-width: 440px; max-height: 94vh; overflow-y: auto; background: #12131f; border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 12px 14px calc(14px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; animation: up 0.25s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.ph { display: flex; align-items: center; justify-content: space-between; font-size: 16px; }
.ph button { width: 44px; height: 44px; font-size: 18px; color: var(--dim); }
.shotimg { width: min(100%, 46vh); aspect-ratio: 1; align-self: center; border-radius: 16px; background: repeating-conic-gradient(#2a2b38 0% 25%, #1c1d28 0% 50%) 50% / 24px 24px; display: block; }
.swatches { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.sw { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); position: relative; }
.sw::after { content: ''; position: absolute; inset: -6px; }
.sw.on { border-color: #fff; box-shadow: 0 0 0 3px var(--gold); }
.sw.clear { background: repeating-conic-gradient(#bbb 0% 25%, #fff 0% 50%) 50% / 12px 12px; }
.fields { display: flex; gap: 8px; }
.fields label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font: 800 10px/1 Inter; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); }
.fields label:last-child { flex: 0.75; }
.fields input { width: 100%; min-width: 0; min-height: 44px; border-radius: 11px; border: 1px solid var(--line); background: #0b0c16; padding: 0 10px; font: 800 15px/1 Inter; color: #fff; letter-spacing: 0.3px; text-transform: none; }
.row { display: flex; gap: 8px; }
.wide { flex: 1; width: 100%; }
.launch { background: var(--gold); color: #1a1405; min-height: 50px; font-size: 15px; }
.hint { font-size: 12px; color: var(--dim); text-align: center; }
a.hint { text-decoration: underline; min-height: 44px; display: grid; place-items: center; }

/* launch form */
.lform { display: flex; flex-direction: column; gap: 10px; background: #0d0e19; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.lform[hidden] { display: none; }
.lfield { display: flex; flex-direction: column; gap: 3px; font: 800 10px/1 Inter; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); }
.lfield input, .lfield textarea, #lrecover { width: 100%; min-height: 44px; border-radius: 11px; border: 1px solid var(--line); background: #0b0c16; padding: 10px; font: 600 15px/1.3 Inter; color: #fff; text-transform: none; letter-spacing: 0; resize: vertical; }
.lmore summary { cursor: pointer; font-weight: 800; font-size: 13px; color: var(--dim); min-height: 44px; display: flex; align-items: center; }
.lmore[open] { display: flex; flex-direction: column; gap: 8px; }
.lnote { margin: 0; font-size: 11.5px; color: var(--dim); }
.lwallet .lk { font-size: 12px; color: var(--dim); margin-bottom: 6px; }
.lwl { display: flex; gap: 6px; flex-wrap: wrap; }
.lwl .btn { flex: 1; }
.lconn { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; min-height: 44px; }
.lconn i { width: 9px; height: 9px; border-radius: 50%; background: #3ddc84; }
.llink { margin-left: auto; color: var(--dim); text-decoration: underline; min-height: 44px; }
.lsteps { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.lsteps[hidden] { display: none; }
.lsteps > div:not(.msg):not(.lwin) { display: flex; align-items: center; gap: 8px; color: var(--dim); }
.lsteps > div i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; flex: 0 0 auto; }
.lsteps > div.done { color: #3ddc84; } .lsteps > div.done i { background: #3ddc84; }
.lsteps > div.now { color: #fff; } .lsteps > div.now i { border-color: var(--gold); animation: blink 0.8s infinite; }
.lsteps > div.bad { color: #ff6b6b; }
@keyframes blink { 50% { opacity: 0.3; } }
.lsteps .msg { font-weight: 600; color: var(--dim); word-break: break-all; }
.lsteps .msg.bad { color: #ff8a8a; }
.lwin { display: flex; flex-direction: column; gap: 8px; background: rgba(61, 220, 132, 0.12); border: 1px solid #3ddc84; border-radius: 12px; padding: 10px; }
.lwin b { font-size: 16px; }
.lca { font: 600 11px/1.3 'JetBrains Mono', monospace; word-break: break-all; color: var(--dim); }

/* launched wall */
.wlist { display: flex; flex-direction: column; gap: 8px; }
.wcoin { display: flex; gap: 10px; align-items: center; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 64px; }
.wcoin img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #222; }
.wn { display: flex; flex-direction: column; min-width: 0; }
.wn b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wn small { color: var(--dim); font-size: 12px; }
.wempty { color: var(--dim); text-align: center; padding: 24px 8px; }

/* start overlay */
.start { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(6, 6, 12, 0.55); backdrop-filter: blur(3px); transition: opacity 0.4s; padding: 20px; }
.start.gone { opacity: 0; pointer-events: none; }
.start .inner { text-align: center; max-width: 380px; }
.biglogo { font: 400 clamp(40px, 13vw, 72px)/0.95 Bungee, sans-serif; text-shadow: 0 4px 0 #000; }
.biglogo span { display: block; margin: 0; }
.tag1 { margin-top: 10px; font-weight: 900; font-size: 18px; }
.rules { list-style: none; padding: 0; margin: 18px 0; display: flex; flex-direction: column; gap: 8px; font-weight: 700; }
.rules li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.go { min-height: 56px; width: 100%; border-radius: 16px; background: var(--gold); color: #1a1405; font: 400 20px/1 Bungee, sans-serif; box-shadow: 0 5px 0 #a6810f; }
.start .hint { margin-top: 12px; }

.flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 15; }
.flash.go { animation: flash 0.45s ease-out; }
@keyframes flash { 0% { opacity: 0.55; } 100% { opacity: 0; } }
.toast { position: fixed; left: 50%; top: 40%; transform: translate(-50%, 10px); background: rgba(10, 10, 18, 0.92); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-weight: 800; opacity: 0; transition: 0.2s; pointer-events: none; z-index: 40; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* desktop */
@media (min-width: 900px) {
  .logo { font-size: 28px; }
  .feed { top: 150px; left: 18px; }
  .fl { font-size: 13px; }
  .picker { align-items: center; }
  .picker .ppanel { border-radius: 20px; height: 86vh; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}

/* ?stream=1: the show only, CA large */
body.stream .pickrow, body.stream .rail, body.stream .actions, body.stream .cabar { display: none; }
body.stream #hud { padding-right: 0; }
body.stream .streamca { display: block; text-align: center; font: 800 clamp(14px, 2.2vw, 26px)/1.2 'JetBrains Mono', monospace; padding: 8px; color: var(--gold); }
body.stream .tsub { font-size: 16px; }
