/* uClipy — an arcade character-select, not a form. Three numbered steps, one loud button, chunky shadows. */
:root {
  --paper: #f3eefc;
  --ink: #1d1a3b;
  --muted: #625c80;
  --line: #d9d2ee;
  --card: #ffffff;
  --pop: #ff2e88;
  --pop-ink: #ffffff;
  --sun: #ffd400;
  --mint: #3ee6b0;
  --stage: #231f4b;
  --ok: #1f9d55;
  --bad: #c62828;
  --radius: 16px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body {
  margin: 0; color: var(--ink); font: 17px/1.5 var(--font);
  background: var(--paper) radial-gradient(circle at 1px 1px, #d9d2ee 1.2px, transparent 0) 0 0 / 22px 22px;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.top { max-width: 1040px; margin: 0 auto; padding: 18px 20px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { text-decoration: none; font-weight: 800; font-size: 1.6rem; letter-spacing: -0.03em; }
.account { display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--ink); background: var(--sun); border-radius: 999px; padding: 6px 14px 6px 10px; font-weight: 800; box-shadow: 3px 3px 0 var(--ink); }
.coin { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6a8, #e0a800 70%); border: 2px solid var(--ink); display: inline-block; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 6px 4px; }
.ghost { background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 6px 14px; font-weight: 700; box-shadow: 3px 3px 0 var(--ink); }
.ghost:active, .pill:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

main { max-width: 1040px; margin: 0 auto; padding: 8px 20px 60px; }

.hero { padding: 36px 0 20px; }
h1 { margin: 0; font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; font-size: clamp(2.3rem, 6.5vw, 4.4rem); }
.lede { max-width: 40ch; margin: 16px 0 0; color: var(--muted); font-size: 1.1rem; }

.panel { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 22px 24px; margin: 8px 0 24px; max-width: 560px; box-shadow: 6px 6px 0 var(--ink); }
.panel h2 { margin: 0 0 6px; font-size: 1.35rem; letter-spacing: -0.02em; }
.panel p { margin: 0 0 14px; color: var(--muted); }
.inline { display: flex; gap: 8px; flex-wrap: wrap; }
.inline input { flex: 1 1 220px; }
input, textarea { width: 100%; font: inherit; color: var(--ink); padding: 12px 14px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; }
textarea { resize: vertical; min-height: 60px; font-size: 1.1rem; }
.note { color: var(--muted); margin: 10px 0 0; }
.note.err { color: var(--bad); }
.note.ok { color: var(--ok); }

.primary { background: var(--pop); color: var(--pop-ink); border: 2px solid var(--ink); border-radius: 12px; padding: 12px 20px; font-weight: 800; box-shadow: 4px 4px 0 var(--ink); }
.primary:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.primary:disabled { opacity: 0.55; cursor: wait; transform: none; }
.primary.big { font-size: 1.3rem; padding: 16px 30px; border-radius: 14px; box-shadow: 6px 6px 0 var(--ink); }
.primary.big:active { box-shadow: 3px 3px 0 var(--ink); }

/* steps */
.step { margin-top: 34px; }
.stephead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stephead h2 { margin: 0; font-size: 1.35rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--sun); font-weight: 800; font-size: 1rem; }

/* roster: character select */
.roster { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.char { position: relative; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 0 0 10px; text-align: center; box-shadow: 4px 4px 0 var(--ink); transition: transform 120ms ease, box-shadow 120ms ease; overflow: hidden; }
.char img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border-bottom: 2px solid var(--ink); }
.char .nm { display: block; font-weight: 800; margin-top: 8px; }
.char .vb { display: block; font-size: 0.8rem; color: var(--muted); padding: 0 8px; line-height: 1.25; }
.char:hover { transform: translate(-2px, -4px) rotate(-1deg); box-shadow: 7px 8px 0 var(--ink); }
.char[aria-checked="true"] { transform: translate(-2px, -4px); box-shadow: 7px 8px 0 var(--pop); border-color: var(--pop); }
.char[aria-checked="true"]::after { content: "✓"; position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--pop); color: #fff; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--ink); }

.stage { margin-top: 14px; display: flex; align-items: center; gap: 14px; background: var(--stage); color: #fff; border-radius: var(--radius); padding: 12px 16px; border: 2px solid var(--ink); }
.stage img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid var(--sun); }
.stageName { font-weight: 800; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.badge { font-size: 0.7rem; font-weight: 800; background: var(--mint); color: var(--ink); border-radius: 999px; padding: 2px 8px; letter-spacing: 0.02em; }
.stageVibe { color: rgba(255,255,255,0.7); }

/* scene builder */
.builder { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 14px; box-shadow: 6px 6px 0 var(--ink); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.slot { background: var(--paper); border: 2px dashed var(--ink); border-radius: 12px; padding: 10px 12px; text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 64px; }
.slot small { color: var(--muted); font-weight: 700; font-size: 0.75rem; }
.slot span { font-weight: 700; line-height: 1.25; }
.slot.filled { border-style: solid; background: #fff; }
.slot.open { border-color: var(--pop); }
.slotMenu { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 12px; background: var(--paper); border-radius: 12px; }
.slotMenu button { background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 0.95rem; }
.slotMenu button:hover { border-color: var(--ink); }
.preview { margin: 10px 2px 0; font-weight: 700; color: var(--ink); min-height: 1.4em; }
.preview em { font-style: normal; color: var(--pop); }

.go { display: flex; align-items: center; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.cost { color: var(--muted); font-weight: 600; }

.progress { margin-top: 22px; background: var(--stage); color: #fff; border-radius: var(--radius); padding: 18px 20px; border: 2px solid var(--ink); }
.rail { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rail li { position: relative; padding-top: 12px; font-size: 0.92rem; color: rgba(255,255,255,0.55); }
.rail li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.18); }
.rail li.on { color: #fff; }
.rail li.on::before { background: var(--sun); }
.rail li.live::before { background: linear-gradient(90deg, var(--sun) 0 60%, rgba(255,255,255,0.18) 60%); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }
#progressText { margin: 14px 0 0; font-size: 1.05rem; font-weight: 700; }
.fun { margin: 4px 0 0; color: rgba(255,255,255,0.7); }

/* clips */
.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.clip { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: 4px 4px 0 var(--ink); }
.clip.new { animation: popin 420ms cubic-bezier(.2,1.4,.4,1) both; }
@keyframes popin { from { transform: scale(0.85) rotate(-2deg); opacity: 0; } to { transform: none; opacity: 1; } }
.clip video { width: 100%; aspect-ratio: 16/9; background: #000; display: block; }
.clip .placeholder { aspect-ratio: 16/9; background: var(--stage); color: #fff; display: grid; place-items: center; text-align: center; padding: 12px; }
.clip .placeholder.busy { grid-auto-flow: row; align-content: center; gap: 6px; font-weight: 700; }
.clip .placeholder small { color: rgba(255,255,255,0.6); font-weight: 400; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.25); border-top-color: var(--sun); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.clip .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.clip .who { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.clip .who img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ink); }
.clip .what { color: var(--muted); font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip .actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.clip .ttl { font-size: 0.88rem; color: var(--muted); }
.clip .ttl.soon { color: var(--bad); font-weight: 700; }
.dl { background: var(--sun); border: 2px solid var(--ink); border-radius: 10px; padding: 8px 14px; font-weight: 800; text-decoration: none; color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.dl:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.empty { color: var(--muted); grid-column: 1 / -1; }

.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 10px; }
.pack { background: var(--card); border: 2px solid var(--ink); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; box-shadow: 4px 4px 0 var(--ink); }
.pack strong { font-size: 1.15rem; }
.pack span { color: var(--muted); }
.pack em { font-style: normal; color: var(--ok); font-weight: 800; margin-left: 6px; }
.pack:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

/* confetti burst on a finished clip */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 2px; animation: fall 1400ms ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: 0.2; } }

footer { max-width: 1040px; margin: 0 auto; padding: 0 20px 40px; color: var(--muted); font-size: 0.9rem; }
footer a { margin-left: 10px; }

@media (prefers-reduced-motion: reduce) {
  .char, .char:hover, .char[aria-checked="true"] { transition: none; transform: none; }
  .rail li.live::before, .spinner, .clip.new, .confetti i { animation: none; }
}
@media (max-width: 760px) {
  .top { padding: 14px 16px 0; }
  main { padding: 8px 16px 40px; }
  .roster { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .char .vb { display: none; }
  .slots { grid-template-columns: 1fr; }
  .packs { grid-template-columns: 1fr; }
  .rail li { font-size: 0.8rem; }
  .panel { box-shadow: 4px 4px 0 var(--ink); }
}
