/* v12 Sticker Album: tokens, type, buttons, bubbles, Pip, stickers, badges, confetti. */
:root {
  --ink: #1a2150; --ink2: #4a5384; --paper: #fff8e6; --paper2: #fdeec4;
  --sun: #ffd23f; --gold: #ffb703; --blue: #2f6bff; --green: #17b35a; --pink: #ff4f8b; --purple: #8b5cf6; --sky: #3ea0ff;
  --lc: var(--blue);
  --f-round: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", "Varela Round", "Trebuchet MS", system-ui, sans-serif;
  --f-body: ui-rounded, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow-x: clip; }
body {
  background: var(--blue) radial-gradient(rgba(255,255,255,.13) 2px, transparent 2.6px) 0 0 / 24px 24px;
  color: var(--ink); font: 500 16px/1.4 var(--f-body); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
.lv-dec, .page--dec, .hud--dec, .stk--dec, .apage--dec { --lc: var(--blue); }
.lv-scan, .page--scan, .hud--scan, .stk--scan, .apage--scan { --lc: var(--green); }
.lv-press, .page--press, .hud--press, .stk--press, .apage--press { --lc: var(--pink); }
.ico { width: 1.1em; height: 1.1em; flex: none; }
h1, h2, h3, b, .btn { font-family: var(--f-round); font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 58px; padding: 0 24px; border: 3px solid var(--ink); border-radius: 999px;
  font-size: 19px; line-height: 1.1; letter-spacing: .01em; cursor: pointer;
  box-shadow: 0 6px 0 var(--ink); transition: transform .12s, box-shadow .12s, background-color .2s;
  touch-action: manipulation; user-select: none;
}
.btn:active:not([disabled]) { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.btn--go { background: var(--green); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn--soft { background: #fff; color: var(--ink); }
.btn--big { min-height: 64px; font-size: 21px; }
.btn[disabled] { background: #dfe3ee; color: #6a7396; border-color: #a7aec6; box-shadow: 0 6px 0 #a7aec6; text-shadow: none; cursor: default; }
.btn--go.is-arming[disabled] { background: var(--green); color: #fff; border-color: var(--ink); box-shadow: 0 6px 0 var(--ink); opacity: .55; }
.btn.is-ready:not([disabled]) { animation: btn-wake .45s cubic-bezier(.2,1.6,.4,1); }
.btn.is-pulse:not([disabled]) { animation: btn-pulse 1.3s ease-in-out infinite; }
.btn .ico { width: 24px; height: 24px; }
@keyframes btn-wake { 0% { transform: scale(.94); } 60% { transform: scale(1.04); } 100% { transform: none; } }
@keyframes btn-pulse { 0%, 100% { transform: none; } 50% { transform: scale(1.04); } }
.spin { width: 18px; height: 18px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- speech bubbles ---------- */
.bubble {
  position: relative; margin: 0; background: #fff; border: 3px solid var(--ink); border-radius: 20px;
  padding: 11px 15px; box-shadow: 0 4px 0 var(--ink); font: 700 17px/1.25 var(--f-round); color: var(--ink);
}
.bubble::before {
  content: ''; position: absolute; left: -11px; bottom: 16px; width: 16px; height: 16px; background: #fff;
  border-left: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(45deg);
}
.bubble__peek { display: inline-block; margin-top: 4px; font-size: 15px; color: var(--ink2); }

/* ---------- Pip the ball ---------- */
.pip { display: inline-block; width: var(--pip, 72px); aspect-ratio: 100 / 112; flex: none; animation: pip-bob 1.8s ease-in-out infinite; will-change: transform; }
.pip__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pip.is-hop .pip__svg { animation: pip-hop .5s cubic-bezier(.2,1.5,.4,1); }
.pip__ball { fill: #fff; stroke: var(--ink); stroke-width: 4; }
.pip__rim { fill: none; stroke: var(--ink); stroke-width: 4; }
.pip__patch path { fill: var(--ink); }
.pip__patch .pip__seam { fill: none; stroke: var(--ink); stroke-width: 2.2; opacity: .45; }
.pip__shadow { fill: rgba(26,33,80,.2); }
.pip__boot { fill: var(--pink); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.pip__cheek { fill: #ff8fb1; opacity: .75; }
.pip__white { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.pip__pupil { fill: var(--ink); transition: transform .25s; }
.pip__shine { fill: #fff; }
.pip__eye { transform-box: fill-box; transform-origin: center; animation: pip-blink 4.2s infinite; }
.pip__stars path { fill: var(--sun); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.pip__mouth { fill: var(--ink); }
.pip__line { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.pip__brow { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.pip__sweat { fill: #9bdcff; stroke: var(--ink); stroke-width: 2; }
.pip .m-o, .pip .m-oops, .pip .m-flat, .pip .m-zig, .pip__stars, .pip__brow, .pip__sweat { display: none; }
.pip[data-mood="wow"] .m-smile, .pip[data-mood="oops"] .m-smile, .pip[data-mood="think"] .m-smile, .pip[data-mood="nervous"] .m-smile { display: none; }
.pip[data-mood="wow"] .m-o, .pip[data-mood="wow"] .pip__stars, .pip[data-mood="wow"] .pip__brow--up { display: inline; }
.pip[data-mood="wow"] .pip__eye { display: none; }
.pip[data-mood="oops"] .m-oops, .pip[data-mood="oops"] .pip__brow--worry { display: inline; }
.pip[data-mood="think"] .m-flat, .pip[data-mood="think"] .pip__brow--up { display: inline; }
.pip[data-mood="think"] .pip__pupil { transform: translate(2px, -3px); }
.pip[data-mood="nervous"] .m-zig, .pip[data-mood="nervous"] .pip__sweat, .pip[data-mood="nervous"] .pip__brow--worry { display: inline; }
.pip[data-mood="nervous"] { animation: pip-shiver .18s linear infinite; }
@keyframes pip-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes pip-hop { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-14px) scale(1.06, .94); } 70% { transform: translateY(0) scale(1.05, .95); } 100% { transform: none; } }
@keyframes pip-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes pip-shiver { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(1.5px); } }

/* ---------- stickers ---------- */
.stk { position: relative; width: var(--sw, 150px); aspect-ratio: 3 / 4; flex: none; }
.stk__card {
  position: absolute; inset: 0; display: flex; flex-direction: column; padding: 7px; border-radius: 16px; overflow: hidden;
  background: #fff; transform: rotate(var(--rot, -1.5deg));
  box-shadow: 0 0 0 2.5px var(--ink), 0 3px 0 2.5px var(--ink), 0 10px 18px rgba(26,33,80,.25);
}
.slotbox:nth-child(2n) .stk { --rot: 2deg; }
.stk__photo { position: relative; flex: 1; min-height: 0; border-radius: 11px; overflow: hidden; background: var(--lc); }
.stk__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; display: block; transform: scale(1.45); }
.stk__band { margin-top: 6px; padding: 6px 6px 5px; border-radius: 10px; background: var(--lc); color: #fff; text-align: center; min-width: 0; }
.stk__band b { display: block; font-size: calc(var(--sw, 150px) * .12); line-height: 1; text-transform: uppercase; letter-spacing: .02em; }
.stk__band small { display: block; margin-top: 3px; font: 600 calc(var(--sw, 150px) * .068)/1.1 var(--f-body); opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stk__num {
  position: absolute; top: 3px; left: 3px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--sun); border: 3px solid var(--ink); color: var(--ink);
  font: 700 15px/1 var(--f-round);
}
.stk--shiny .stk__card { background: linear-gradient(135deg, #ffe066, #ff9ad5 30%, #8fd3ff 55%, #b8ffb0 78%, #ffe066); }
.stk__foil {
  position: absolute; inset: 0; border-radius: 16px; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.8) 45%, rgba(255,240,150,.5) 50%, rgba(140,220,255,.5) 55%, transparent 68%) 0 0 / 260% 100%;
  animation: foil 3.2s ease-in-out infinite;
}
@keyframes foil { 0% { background-position: 110% 0; } 55%, 100% { background-position: -30% 0; } }
.stk__tag {
  position: absolute; z-index: 3; right: -8px; bottom: -10px; display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 999px; border: 2.5px solid var(--ink); font: 700 13px/1 var(--f-round);
  transform: rotate(7deg); box-shadow: 0 3px 0 var(--ink);
}
.stk__tag .ico { width: 13px; height: 13px; }
.stk__tag--shiny { background: var(--sun); color: var(--ink); }
.stk__tag--miss { background: #fff; color: var(--ink2); }
.stk--missing .stk__card { filter: grayscale(1); background: #eceef4; }
.stk--missing .stk__photo::after { content: ''; position: absolute; inset: 0; background: rgba(236,238,244,.5); }
.stk--missing .stk__band { background: #a9afc2; }
.stk--empty {
  display: grid; place-items: center; align-content: center; gap: 6px; border-radius: 16px;
  border: 3px dashed rgba(26,33,80,.35); background: rgba(26,33,80,.05);
}
.stk--empty .stk__num { background: #fff; border-style: dashed; border-color: rgba(26,33,80,.45); color: var(--ink2); }
.slot__man { width: 42%; fill: rgba(26,33,80,.16); }
.stk__who { font: 700 15px/1.1 var(--f-round); color: var(--ink2); text-align: center; padding: 0 6px; }
/* mini stickers (progress rows) */
.stk--mini { width: var(--mw, 34px); border-radius: 7px; overflow: hidden; }
.stk--mini img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.4); }
.stk--mini:not(.stk--empty) { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.stk--mini.stk--missing img { filter: grayscale(1); opacity: .5; }
.stk--mini .stk__num { width: auto; height: auto; inset: 0; border: 0; background: none; font-size: 14px; display: grid; place-items: center; }
.stk--mini:not(.stk--empty) .stk__num { display: none; }
.stk--mini.stk--empty { border-width: 2.5px; border-radius: 7px; }
/* peel and stick */
.stk.is-peel { animation: peel .8s cubic-bezier(.2,1.3,.4,1) both; animation-delay: var(--d, 0ms); }
@keyframes peel {
  0% { opacity: 0; transform: translate(50px, -70px) rotate(22deg) scale(1.3); }
  45% { opacity: 1; transform: translate(0, -12px) rotate(-7deg) scale(1.1); }
  70% { transform: translate(0, 0) rotate(1deg) scale(.95, 1.03); }
  100% { opacity: 1; transform: none; }
}

/* ---------- scalloped badges ---------- */
.badge { position: relative; width: var(--bw, 150px); aspect-ratio: 1; flex: none; --bc: var(--sky); }
.badge__bg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 5px 0 var(--ink)); }
.badge__bg polygon { fill: var(--bc); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.badge__ring { fill: none; stroke: rgba(255,255,255,.7); stroke-width: 2; stroke-dasharray: 3 4; }
.badge__in { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; color: #fff; }
.badge--amateur { --bc: var(--sky); } .badge--academy { --bc: var(--green); }
.badge--semipro { --bc: var(--purple); } .badge--pro { --bc: var(--gold); }

/* ---------- confetti ---------- */
.confetti { position: absolute; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; z-index: 30; }
.confetti i { position: absolute; left: -5px; top: -7px; width: 10px; height: 14px; border: 2px solid var(--ink); border-radius: 3px; animation: conf 1.15s cubic-bezier(.15,.7,.4,1) forwards; }
@keyframes conf {
  0% { transform: translate(0, 0) rotate(0) scale(.3); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--x), calc(var(--y) + 70px)) rotate(var(--r)) scale(1); opacity: 0; }
}

/* ---------- the screen root + mute ---------- */
.screen { position: fixed; inset: 0; z-index: 10; overflow-y: auto; overflow-x: clip; -webkit-overflow-scrolling: touch; }
.screen[hidden] { display: none; }
.mute {
  position: fixed; z-index: 40; top: calc(var(--safe-t) + 12px); right: 12px; width: 48px; height: 48px; padding: 0;
  display: grid; place-items: center; border-radius: 50%; background: #fff; border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink); color: var(--ink); cursor: pointer;
}
.mute .ico { width: 24px; height: 24px; }
.mute:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
body[data-phase="results"] .mute, body[data-phase="gate"] .mute, body[data-phase="intro"] .mute, body[data-phase="between"] .mute { display: none; }
.oops { margin: 30vh auto 0; max-width: 340px; padding: 22px; background: var(--paper); border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 8px 0 var(--ink); text-align: center; font: 700 18px/1.3 var(--f-round); display: grid; gap: 14px; }
.oops p { margin: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
