:root { --ink: #16121f; --y: #ffd23f; --p: #ff5d8f; --b: #3bceac; --v: #7b5cff; --o: #ff8a3d; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; font-family: Rubik, system-ui, sans-serif; color: var(--ink);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; background: #9be7ff; }
canvas { display: block; }
.big { font-family: Bungee, system-ui; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); }

.hud { position: fixed; top: 14px; left: 16px; font-size: 34px; line-height: 1; z-index: 5; pointer-events: none; }
.hud small { display: block; font-size: 14px; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--ink); margin-top: 6px; letter-spacing: .03em; }
.hud.bump { animation: hudbump .22s ease-out; }
@keyframes hudbump { 40% { transform: scale(1.18); } }

.lives { position: fixed; top: 14px; right: 112px; font-size: 26px; letter-spacing: 4px; z-index: 5; pointer-events: none; }
.lives i { font-style: normal; color: var(--p); display: inline-block; transition: transform .25s, opacity .25s; }
.lives i.off { color: rgba(22,18,31,.25); text-shadow: none; -webkit-text-stroke: 0; transform: scale(.75); }

.topbar { position: fixed; top: 12px; right: 12px; display: flex; gap: 8px; z-index: 30; }
.tb-btn { width: 42px; height: 42px; border-radius: 12px; border: 3px solid var(--ink); background: #fff; color: var(--ink);
  display: grid; place-items: center; font-size: 18px; font-weight: 800; text-decoration: none; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .1s, box-shadow .1s, background .15s; padding: 0; }
.tb-btn:hover { transform: translate(-1px, -2px); box-shadow: 4px 5px 0 var(--ink); background: var(--y); }
.tb-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.tb-btn.muted { background: #e8e5ef; opacity: .8; }

#pop { position: fixed; top: 18%; left: 0; right: 0; text-align: center; font-size: clamp(32px, 7.5vw, 78px); color: var(--y);
  opacity: 0; pointer-events: none; white-space: pre-line; line-height: 1.04; z-index: 15; }
#pop.go { animation: pop 1.2s cubic-bezier(.2, 1.5, .4, 1) forwards; }
#pop.bad { color: var(--p); }
#pop.good { color: var(--b); }
@keyframes pop { 0% { opacity: 0; transform: scale(.3) rotate(-8deg); } 16% { opacity: 1; transform: scale(1.12) rotate(2deg); }
  72% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: translateY(-28px) scale(.96); } }

.ftxt { position: fixed; font-size: 26px; pointer-events: none; z-index: 14; transform: translate(-50%, -50%);
  animation: ftxt .85s ease-out forwards; white-space: nowrap; }
@keyframes ftxt { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.5); } 20% { opacity: 1; transform: translate(-50%, -65%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -170%) scale(.95); } }

.overlay { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; z-index: 20;
  background: rgba(255, 210, 63, .92); backdrop-filter: blur(4px);
  background-image: radial-gradient(circle at 1px 1px, rgba(22,18,31,.16) 1.6px, transparent 0); background-size: 22px 22px; }
.overlay.hidden { display: none; }
.overlay > div { max-width: 760px; width: 100%; display: flex; flex-direction: column; align-items: center; }
.overlay h1 { margin: 0 0 10px; font-size: clamp(36px, 8.2vw, 84px); line-height: .94; text-align: center; text-shadow: 5px 5px 0 var(--ink); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.overlay .sub { font-weight: 700; margin: 0 auto 34px; max-width: 560px; line-height: 1.45; font-size: 16px; color: rgba(22,18,31,.82); text-wrap: balance; }
.overlay .sub b { background: var(--ink); color: var(--y); padding: 2px 8px; border-radius: 7px; font-weight: 800; white-space: nowrap; }
.pick-lbl { font: 800 11px/1 Rubik, sans-serif; text-transform: uppercase; letter-spacing: .14em; color: rgba(22,18,31,.62); margin: 0 0 10px; }
.ctrl-card { display: inline-flex; flex-direction: column; gap: 8px; background: rgba(255,255,255,.72); border: 2px solid rgba(22,18,31,.28); border-radius: 14px;
  padding: 10px 18px; margin: 28px auto 0; text-align: left; max-width: 92vw; }
.ctrl-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 16px; font: 700 12.5px/1.2 Rubik, sans-serif; color: rgba(22,18,31,.78); transition: opacity .18s; }
.ctrl-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.kcap { display: inline-block; min-width: 22px; padding: 3px 7px; text-align: center; font: 800 11px/1 Rubik, sans-serif;
  background: var(--ink); color: #fff; border-radius: 5px; }
.badge-best { display: inline-block; background: var(--v); color: #fff; border: 2.5px solid var(--ink); border-radius: 999px;
  padding: 4px 14px; font-family: Bungee, system-ui; font-size: 13px; box-shadow: 3px 3px 0 var(--ink); margin-bottom: 10px; }

#pick { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin: 0; }
body:not(.ready) #pick { opacity: .45; pointer-events: none; }
.btn { font-family: Bungee, system-ui; font-size: 22px; padding: 13px 28px; border: 3px solid var(--ink); border-radius: 999px; cursor: pointer;
  background: var(--p); color: #fff; box-shadow: 4px 4px 0 var(--ink); margin: 0; transition: transform .1s, box-shadow .1s; }
.btn[data-who] { display: inline-flex; align-items: center; gap: 12px; padding: 10px 26px 10px 12px; vertical-align: middle; }
.btn-av { width: 44px; height: 44px; border-radius: 50%; border: 2.5px solid var(--ink); background: #fff7e6; object-fit: cover; flex-shrink: 0; }
.btn + .btn { background: var(--b); color: var(--ink); }
.btn:hover { transform: translate(-2px, -3px) rotate(-2deg); box-shadow: 6px 7px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.home { display: inline-block; margin-top: 20px; color: rgba(22,18,31,.68); font-size: 14px; font-weight: 800; text-decoration: none; padding: 6px 14px;
  border-radius: 999px; border: 2px solid transparent; transition: border-color .15s, background .15s; }
.home:hover { border-color: var(--ink); background: rgba(255,255,255,.65); }

.pads { position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 18px; pointer-events: none; z-index: 10; }
.pads > div { display: flex; gap: 12px; }
.pads button { pointer-events: auto; width: 74px; height: 74px; border-radius: 50%; border: 3px solid var(--ink); background: rgba(255,255,255,.94); color: var(--ink);
  font-family: Bungee, system-ui; font-size: 20px; box-shadow: 4px 4px 0 var(--ink); touch-action: none; transition: transform .06s, background .06s; }
.pads button.wide { width: 112px; border-radius: 40px; background: var(--p); color: #fff; }
.pads button.down { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); background: var(--y); color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .pads { opacity: .6; } .pads:hover { opacity: .95; } }
@media (max-width: 480px) {
  .hud { font-size: 26px; top: 10px; left: 12px; }
  .lives { top: 12px; right: 104px; font-size: 20px; }
  .tb-btn { width: 38px; height: 38px; font-size: 16px; }
  .pads { padding: 0 10px; bottom: max(14px, env(safe-area-inset-bottom)); }
  .pads > div { gap: 7px; } .pads button { width: 58px; height: 58px; font-size: 15px; } .pads button.wide { width: 92px; }
}
.card { position: fixed; font-family: Bungee; font-size: 26px; background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 5px 12px;
  box-shadow: 3px 3px 0 var(--ink); transform: translate(-50%, -100%) rotate(-6deg); pointer-events: none; transition: opacity .25s, transform .25s; z-index: 12; }
