/* Лопни шарики — экран во весь размер: видео с камеры зеркально, поверх 3D и руки. */
:root { --ink: #1b1033; --pink: #ff4d8d; --gold: #ffc93c; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1b1033; color: #fff;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-user-select: none; user-select: none; touch-action: manipulation; }

#cam { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); opacity: 0; transition: opacity .6s; }
#cam.on { opacity: 1; }
#scene, #hands { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#pops { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#flash { position: fixed; inset: 0; pointer-events: none; background: #ff2a2a; opacity: 0; transition: opacity .35s; }
#flash.on { opacity: .45; transition: none; }

.pop { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: clamp(28px, 6vmin, 56px);
  color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 18px rgba(0,0,0,.4); animation: rise .9s ease-out forwards; }
.pop.gold { color: var(--gold); font-size: clamp(36px, 8vmin, 72px); }
.pop.bad { color: #ff5252; }
@keyframes rise { from { opacity: 1; transform: translate(-50%, -50%) scale(.6); } 25% { transform: translate(-50%, -80%) scale(1.15); }
  to { opacity: 0; transform: translate(-50%, -190%) scale(1); } }

#hud { position: fixed; left: 0; right: 0; top: 0; padding: calc(10px + env(safe-area-inset-top)) 14px 0; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
#hud[hidden] { display: none; }
#timer { min-width: 86px; text-align: center; padding: 4px 16px; border-radius: 999px; background: rgba(0,0,0,.45);
  font-weight: 900; font-size: clamp(26px, 5vmin, 40px); }
#timer.hurry { background: #ff3b5c; }
#scores { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.score { padding: 4px 14px; border-radius: 999px; font-weight: 900; font-size: clamp(18px, 3.6vmin, 28px); color: #fff; background: var(--c); box-shadow: 0 3px 0 rgba(0,0,0,.3); }

.screen { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px 16px; text-align: center;
  background: radial-gradient(circle at 50% 35%, rgba(70, 30, 120, .55), rgba(20, 8, 40, .82)); }
.screen[hidden] { display: none; }
#message { background: none; pointer-events: none; }
h1 { margin: 0; font-size: clamp(48px, 12vmin, 110px); line-height: .95; font-weight: 900; letter-spacing: -.02em; }
h1 span:first-child { color: var(--pink); } h1 span:last-child { color: var(--gold); display: block; }
h2 { margin: 0; font-size: clamp(40px, 11vmin, 100px); font-weight: 900; text-shadow: 0 4px 0 rgba(0,0,0,.35), 0 0 30px rgba(0,0,0,.5); }
.screen p { margin: 0; font-size: clamp(17px, 3vmin, 24px); line-height: 1.35; max-width: 640px; }
#msgSmall { font-weight: 800; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.small { opacity: .75; font-size: 15px !important; }
.play { margin-top: 6px; padding: 18px 56px; border: 0; border-radius: 999px; background: var(--pink); color: #fff; cursor: pointer;
  font-family: inherit; font-weight: 900; font-size: clamp(26px, 5vmin, 40px); line-height: 1; box-shadow: 0 7px 0 #a8124d; }
.play:active { transform: translateY(5px); box-shadow: 0 2px 0 #a8124d; }
.back { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 14px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.14); color: #fff; text-decoration: none; font-weight: 800; }
.back.inline { position: static; }
#overTable { display: grid; gap: 8px; }
#overTable .score { font-size: clamp(22px, 4.5vmin, 34px); padding: 6px 22px; }

/* командная шкала: сердечки и уровень (27.10) */
.hearts { padding: 4px 14px; border-radius: 999px; background: rgba(0,0,0,.45); color: #ff3b5c; font-size: clamp(22px, 4.2vmin, 34px); letter-spacing: 2px; }
.level { padding: 6px 14px; border-radius: 999px; background: rgba(91, 59, 214, .85); font-weight: 900; font-size: clamp(15px, 2.8vmin, 22px); align-self: center; }
#hud.hurt .hearts { animation: hurt .45s ease; }
@keyframes hurt { 0%, 100% { transform: none; } 20% { transform: translateX(-8px) scale(1.12); background: #ff3b5c; color: #fff; } 60% { transform: translateX(8px); } }
