/* «Пиньята» (0.51, public/club-pinata.js): the piñata over the hall — its hanger, rope and body (the swing is drawn by the
   script), its tag with the counter, the whacks, the burst and the stars that fly to the winners' faces; the shop's card
   and tile. Over the stage at z 29: above the picture, the lobby, the reactions and the pills (3–9), under the track bar
   that shows on hover over a paused picture and the «Сейчас в кино» splash (30) and the panels (≥ 40). */

/* --- The hall ----------------------------------------------------------------------------------------------------- */
.pinata-layer { position: absolute; inset: 0; z-index: 29; overflow: hidden; pointer-events: none; }
.pinata-rig { position: absolute; top: 0; width: 0; height: 0; transition: opacity .25s ease; }
.pinata-hanger { position: absolute; left: -9px; top: -3px; width: 18px; height: 7px; border-radius: 0 0 5px 5px; background: linear-gradient(#5a5f6e, #3a3e49); box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.pinata-swing { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }
.pinata-rope { position: absolute; left: -1px; top: 2px; width: 2px; height: calc(var(--pr) + 2px); border-radius: 1px; background: repeating-linear-gradient(180deg, #d8c39a 0 3px, #a88d5c 3px 5px); box-shadow: 0 0 1px rgba(0, 0, 0, .6); }
.pinata-hit { position: absolute; width: var(--ps); height: var(--ps); margin: 0; padding: 0; border: 0; border-radius: 22%; background: none; cursor: pointer; pointer-events: auto; touch-action: manipulation; -webkit-tap-highlight-color: transparent; will-change: transform; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.pinata-hit svg { display: block; width: 100%; height: 100%; pointer-events: none; }
.pinata-hit:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pinata-hit .pnt-crack { opacity: 0; transition: opacity .2s ease; }
.pinata-hit[data-dmg="1"] .pnt-c1, .pinata-hit[data-dmg="2"] .pnt-c1, .pinata-hit[data-dmg="2"] .pnt-c2, .pinata-hit[data-dmg="3"] .pnt-crack { opacity: 1; }
/* Arriving: lowered from above on its rope; taken down: pulled up and away; while a film plays here: gone at once. */
.pinata-in .pinata-swing { animation: pinata-drop .65s cubic-bezier(.3, 1.35, .5, 1) both; }
@keyframes pinata-drop { from { translate: 0 calc(-1 * (var(--pr) + var(--ps) + 24px)); } to { translate: 0 0; } }
.pinata-up .pinata-swing { transition: translate .7s cubic-bezier(.55, 0, .8, .4), opacity .7s ease; translate: 0 calc(-1 * (var(--pr) + var(--ps) + 40px)); opacity: .2; }
.pinata-up .pinata-tag, .pinata-up .pinata-hanger { opacity: 0; transition: opacity .25s ease; }
.pinata-away { opacity: 0; visibility: hidden; transition: none; }
.pinata-away .pinata-hit { pointer-events: none; }
/* The tag under it (beside it on a phone): who and the stars, the time left; the whacks as a bar and a count. */
.pinata-tag { position: absolute; z-index: 3; left: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px 10px; width: max-content; min-width: 168px; max-width: 240px; padding: 7px 11px 8px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; background: rgba(14, 16, 22, .9); color: var(--text); font-size: 12px; line-height: 1.25; white-space: nowrap; transform: translateX(-50%); box-shadow: 0 6px 18px rgba(0, 0, 0, .4); pointer-events: none; }
.pinata-by { display: flex; align-items: center; gap: 5px; min-width: 0; }
.pinata-by img { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; flex: none; }
.pinata-by span { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.pinata-by i { flex: none; font-style: normal; color: #ffcf4a; }
.pinata-t { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.pinata-bar { height: 6px; overflow: hidden; border-radius: 3px; background: rgba(255, 255, 255, .1); }
.pinata-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #ff5f9e, #ffd23f 55%, #2ed3c6); transition: width .18s ease; }
.pinata-n { color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.pinata-wait { grid-column: 1 / -1; justify-self: center; color: #ffcf4a; font-size: 12px; }
.pinata-narrow .pinata-tag { left: auto; right: calc(var(--ps) / -2); min-width: 0; width: max(72px, var(--ps)); padding: 4px 7px 5px; font-size: 11px; transform: none; grid-template-columns: 1fr; justify-items: stretch; gap: 3px; border-radius: 10px; }
.pinata-narrow .pinata-by, .pinata-narrow .pinata-t { display: none; } /* a phone: just the whacks (the toast said whose it is) */
.pinata-narrow .pinata-bar { height: 5px; }
.pinata-narrow .pinata-n { justify-self: center; font-size: 12px; line-height: 1.1; }
.pinata-narrow .pinata-wait { white-space: normal; text-align: center; line-height: 1.15; font-size: 11px; }
/* A whack: a comic burst where it landed, paper bits falling, the name of whoever hit it rising. */
.pinata-pow { position: absolute; z-index: 4; width: 58px; height: 58px; margin: -29px 0 0 -29px; display: grid; place-items: center; rotate: var(--r); animation: pinata-pow .6s ease-out both; pointer-events: none; }
.pinata-pow svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: #ffd23f; stroke: #2b1d2b; stroke-width: 2.2; stroke-linejoin: round; }
.pinata-pow b { position: relative; color: #2b1d2b; font-size: 12px; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; }
@keyframes pinata-pow { 0% { opacity: 0; scale: .4; } 18% { opacity: 1; scale: 1.08; } 60% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1; translate: 0 -10px; } }
.pinata-bit { position: absolute; z-index: 1; width: 4px; height: 9px; border-radius: 1px; background: var(--c); animation: pinata-bit 1s cubic-bezier(.4, .1, .7, 1) forwards; pointer-events: none; }
@keyframes pinata-bit { from { transform: translate(0, 0) rotate(0); opacity: 1; } to { transform: translate(var(--dx), 70px) rotate(var(--r)); opacity: 0; } }
.pinata-who { position: absolute; z-index: 4; padding: 2px 7px; border-radius: 9px; background: rgba(14, 16, 22, .82); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; transform: translateX(-50%); animation: pinata-who .9s ease-out forwards; pointer-events: none; }
@keyframes pinata-who { from { opacity: 0; translate: 0 6px; } 20% { opacity: 1; } to { opacity: 0; translate: 0 -26px; } }
/* The burst. */
.pinata-boom { position: absolute; inset: 0; pointer-events: none; }
.pinata-half { position: absolute; display: block; }
.pinata-half .pinata-img { width: 100%; height: 100%; display: block; }
.pinata-half-l { clip-path: polygon(0 0, 54% 0, 44% 38%, 56% 62%, 46% 100%, 0 100%); }
.pinata-half-r { clip-path: polygon(54% 0, 100% 0, 100% 100%, 46% 100%, 56% 62%, 44% 38%); }
.pinata-spill { position: absolute; display: block; margin: -9px 0 0 -9px; }
.pinata-star .pnt-star { display: block; width: 20px; height: 20px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.pinata-candy .pnt-candy { display: block; width: 30px; height: 15px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); }
.pinata-paper { width: 7px; height: 11px; border-radius: 1.5px; background: var(--c); }
/* The result card at the bottom of the stage for a few seconds. */
.pinata-result { position: absolute; left: 50%; top: 40%; display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: min(560px, calc(100% - 24px)); padding: 10px 16px 11px; border: 1px solid rgba(255, 207, 74, .45); border-radius: 14px; background: rgba(14, 16, 22, .92); color: var(--text); text-align: center; transform: translateX(-50%); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: pinata-res-in .35s ease-out both; }
.pinata-res-t { font-size: 15px; }
.pinata-res-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; color: var(--muted); font-size: 13px; }
.pinata-res-one b { color: var(--text); font-weight: 600; }
.pinata-res-one { color: #ffcf4a; font-weight: 700; white-space: nowrap; }
.pinata-res-one.top b::after { content: ' 👑'; }
.pinata-res-out { opacity: 0; transition: opacity .35s ease; }
@keyframes pinata-res-in { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
/* The stars flying to the faces (over the whole page, nothing in the strip moves) and «+N ★» rising there. */
.pinata-fly { position: fixed; inset: 0; z-index: 120; overflow: hidden; pointer-events: none; } /* over the header (100): the stars land on the faces */
.pinata-flystar { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; }
.pinata-flystar .pnt-star { display: block; width: 100%; height: 100%; filter: drop-shadow(0 0 4px rgba(255, 207, 74, .7)); }
.pinata-plus { position: absolute; padding: 1px 6px; border-radius: 8px; background: rgba(14, 16, 22, .9); color: #ffcf4a; font-size: 12px; font-weight: 800; white-space: nowrap; transform: translateX(-50%); animation: pinata-plus 1.9s ease-out forwards; }
@keyframes pinata-plus { 0% { opacity: 0; translate: 0 4px; } 15% { opacity: 1; translate: 0 0; } 75% { opacity: 1; } 100% { opacity: 0; translate: 0 -8px; } }
.pinata-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Reduced motion: it hangs still, nothing flies; the counter, the cracks and a still spill tell the story. */
.pinata-still .pinata-swing, .pinata-still.pinata-in .pinata-swing { animation: none; transform: none; }
.pinata-still.pinata-up .pinata-swing { transition: opacity .25s ease; translate: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .pinata-pow { animation: pinata-fade .5s linear both; }
  .pinata-bit, .pinata-who { display: none; }
  .pinata-result { animation: none; }
  .pinata-plus { animation: pinata-fade 1.9s linear forwards; }
  @keyframes pinata-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
}

/* --- The shop's card ---------------------------------------------------------------------------------------------- */
.pinata-shop .pinata-k { margin: 12px 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.pinata-looks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.pinata-look { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 44px; margin: 0; padding: 5px 2px 6px; border: 2px solid transparent; border-radius: 10px; background: rgba(255, 255, 255, .04); color: var(--text); font: inherit; font-size: 11px; line-height: 1.15; cursor: pointer; }
.pinata-look .pinata-img { display: block; width: 100%; max-width: 64px; aspect-ratio: 1; }
.pinata-look span { max-width: 100%; overflow: hidden; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.pinata-look:hover, .pinata-size:hover { background: rgba(255, 255, 255, .08); }
.pinata-look[aria-pressed="true"], .pinata-size[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 255, 255, .08); }
.pinata-look:focus-visible, .pinata-size:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pinata-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pinata-size { min-height: 44px; margin: 0; padding: 6px; border: 2px solid transparent; border-radius: 10px; background: rgba(255, 255, 255, .04); color: #ffcf4a; font: inherit; font-size: 14px; cursor: pointer; }
.pinata-size b { color: var(--text); font-size: 16px; }
/* The preview: a strip of the stage's top edge, the piñata swinging gently on its rope. */
.pinata-pv { position: relative; height: 168px; margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: radial-gradient(120% 90% at 50% 0%, #232838 0%, #12141b 70%); }
.pinata-pv-bar { position: absolute; left: calc(50% - 10px); top: -2px; width: 20px; height: 8px; border-radius: 0 0 5px 5px; background: linear-gradient(#5a5f6e, #3a3e49); }
.pinata-pv-rig { position: absolute; left: 50%; top: 0; width: 0; height: 0; transform-origin: 0 0; animation: pinata-pv-sway 2.4s ease-in-out infinite alternate; }
.pinata-pv-rope { position: absolute; left: -1px; top: 4px; width: 2px; height: 18px; background: repeating-linear-gradient(180deg, #d8c39a 0 3px, #a88d5c 3px 5px); }
.pinata-pv-at { position: absolute; width: 96px; height: 96px; }
.pinata-pv-img { display: block; width: 96px; height: 96px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.pinata-pv-tag { position: absolute; left: 50%; bottom: 8px; padding: 2px 9px; border-radius: 9px; background: rgba(14, 16, 22, .85); color: #ffcf4a; font-size: 12px; white-space: nowrap; transform: translateX(-50%); }
.pinata-pv-tag b { color: #fff; font-variant-numeric: tabular-nums; }
@keyframes pinata-pv-sway { from { rotate: -7deg; } to { rotate: 7deg; } }
@media (prefers-reduced-motion: reduce) { .pinata-pv-rig { animation: none; } }
.pinata-rules { margin: 12px 0 2px; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.pinata-rules li + li { margin-top: 2px; }
.pinata-shop .pinata-go { margin-top: 12px; }
/* The tile: the piñata drawn instead of the emoji. */
.pinata-tile { display: grid; place-items: center; width: 100%; height: 100%; }
.pinata-tile .pinata-img { width: 56px; height: 56px; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .4)); }
