:root { --c: #d9a63a; --c2: #1b2c55; --ink: #ffffff; }
body.t0 { --c: #e0483a; --c2: #3a1830; }
body.t1 { --c: #4f9fe0; --c2: #16305e; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: "Nunito", "Trebuchet MS", system-ui, sans-serif; color: var(--ink); background: radial-gradient(120% 70% at 50% 0%, var(--c2), #0b1430 75%); overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.v { display: none; position: absolute; inset: 56px 0 0; padding: 16px 22px calc(20px + env(safe-area-inset-bottom)); flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.v.on { display: flex; }
#team { position: absolute; top: 0; left: 0; right: 0; height: 56px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 900; font-size: 18px; color: #fff; background: var(--c); box-shadow: 0 4px 18px rgba(0, 0, 0, .08); }
#team:empty, body:not(.t0):not(.t1) #team { background: #2a3d6e; }
#tImg { height: 36px; }
#tImg:not([src]) { display: none; }
h1 { margin: 0; font-size: 30px; line-height: 1.15; }
p { margin: 0; font-size: 17px; line-height: 1.4; max-width: 340px; }
.pick { width: 100%; max-width: 360px; display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 0; border-radius: 28px; font: inherit; font-size: 24px; font-weight: 900; color: #fff; box-shadow: 0 10px 26px rgba(0, 0, 0, .12), inset 0 2px 0 rgba(255, 255, 255, .5); }
.pick img { height: 70px; }
.pick.boy { background: linear-gradient(160deg, #f0705e, #b8281e); }
.pick.girl { background: linear-gradient(160deg, #8cc8f5, #3b82c8); }
h1 { color: #fff; } p { color: #dfe8ff; }
.big { border: 0; border-radius: 999px; padding: 22px 34px; font: inherit; font-size: 26px; font-weight: 900; color: #fff; background: var(--c); box-shadow: 0 12px 30px rgba(0, 0, 0, .15), inset 0 3px 0 rgba(255, 255, 255, .45); }
.big:active, .big.on { transform: scale(.95); filter: brightness(1.08); }
.link { border: 0; background: none; font: inherit; font-size: 15px; color: #dfe8ff; opacity: .7; text-decoration: underline; padding: 10px; }
.err { color: #ffb4a8; font-weight: 700; }
.err:empty { display: none; }
#status { font-size: 30px; font-weight: 900; max-width: 360px; }
#status.go.fly { font-size: 34px; }
#status.go { font-size: 54px; color: var(--c); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
#meter { width: 86%; max-width: 360px; height: 34px; border-radius: 99px; background: rgba(255, 255, 255, .15); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .1); overflow: hidden; }
#meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--c), #f5c451); transition: width .12s; }
#tap { display: none; width: 220px; height: 220px; border-radius: 50%; padding: 0; font-size: 30px; }
body.tapmode #tap { display: block; }
#eImg { height: 160px; }
#eImg:not([src]) { display: none; }
.spin { width: 46px; height: 46px; border-radius: 50%; border: 5px solid #2a3d6e; border-top-color: #f5c451; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(1turn); } }

/* мини-игра «Лопни шарики» в лобби */
#pop { position: absolute; inset: 56px 0 0; overflow: hidden; display: none; pointer-events: none; z-index: 2; }
#pop.on { display: block; }
#popN { white-space: pre !important; line-height: 1.35; position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; background: rgba(14,28,64,.88); padding: 7px 18px; border-radius: 99px; box-shadow: 0 4px 14px rgba(0,0,0,.08); bottom: calc(14px + env(safe-area-inset-bottom)); text-align: center; font-weight: 900; font-size: 18px; color: var(--ink); z-index: 3; pointer-events: none; }
.pb { position: absolute; pointer-events: auto; touch-action: none; filter: drop-shadow(0 0 10px rgba(255,220,140,.45)); animation-name: up, sway; animation-timing-function: linear, ease-in-out; animation-iteration-count: 1, infinite; animation-direction: normal, alternate; animation-fill-mode: forwards, none; }
@keyframes up { to { translate: 0 var(--h); } }
@keyframes sway { from { transform: translateX(calc(var(--dx) * -.5)) rotate(-6deg); } to { transform: translateX(calc(var(--dx) * .5)) rotate(6deg); } }
.pb.boom { animation: boom .25s ease-out forwards !important; }
@keyframes boom { 50% { scale: 1.35; opacity: .9; } to { scale: 1.7; opacity: 0; } }
.say { position: absolute; z-index: 4; transform: translate(-50%, -50%) rotate(var(--r)); font-weight: 900; font-size: 30px; color: #fff; -webkit-text-stroke: 1.5px var(--c); paint-order: stroke; text-shadow: 0 3px 0 var(--c); white-space: nowrap; animation: say .9s ease-out forwards; pointer-events: none; }
@keyframes say { from { scale: .4; } 20% { scale: 1.15; } to { scale: 1; translate: 0 -60px; opacity: 0; } }
.cf { position: absolute; width: 9px; height: 9px; border-radius: 3px; animation: cf .6s ease-out forwards; pointer-events: none; }
@keyframes cf { to { translate: var(--x) var(--y); opacity: 0; scale: .4; } }
body.popping #vPlay { justify-content: flex-start; padding-top: 22px; }
body.popping #sub { display: none; }
body.popping.tapmode #tap { display: none; }

/* снежинки на фоне */
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; background-image: radial-gradient(2px 2px at 20% 30%, #fff8, transparent), radial-gradient(2px 2px at 70% 20%, #fff6, transparent), radial-gradient(1.5px 1.5px at 40% 70%, #fff7, transparent), radial-gradient(2px 2px at 85% 60%, #fff5, transparent), radial-gradient(1.5px 1.5px at 10% 85%, #fff6, transparent); }
