/* «Плед и подушка» (0.67.0, n126cozy, club-cozy.js): a throw behind the face (.cozy-b, after the seat) and a cushion over
   the face's lower-right rim (.cozy-f) — laid in the same boxes as «Кресло в зале» (club-seat.css). On a phone
   (≤ 760 px) everything lies behind the face (.cozy-m on the stacked faces, .cozy-a elsewhere): nothing covers a face or
   a name. Taps go through. Nothing takes room. Motion: only while no film plays (body.lobby-on) or in the shop, never
   with reduced motion; slow opacity / transform loops on a few small shapes. */
.cozy { position: absolute; display: block; pointer-events: none; }
.cozy-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: hidden; }
.cozy-a { display: none; }

/* The participants strip (and the shop's chips built with the same hooks). */
.person[data-cozy], .club-chip[data-cozy] { isolation: isolate; }
.club-chip[data-cozy] { position: relative; }
.person > .cozy-b, .club-chip > .cozy-b { z-index: -1; }
.person > .cozy-f, .club-chip > .cozy-f { z-index: 1; }
.person > .cozy-p, .club-chip > .cozy-p { left: -1px; top: calc(50% - 15px); width: 30px; height: 30px; }
.person > .cozy-m, .club-chip > .cozy-m { display: none; }
@media (max-width: 760px) {
  .person > .cozy-p { display: none; }
  .person > .cozy-m {
    display: block; left: -2px; top: -2px; width: calc(100% + 4px); height: calc(100% + 4px);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 19px, #000 19.6px);
    mask-image: radial-gradient(circle at 50% 50%, transparent 19px, #000 19.6px);
  }
  .person:not(:last-child) > .cozy-m {
    -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 19px, #000 19.6px), radial-gradient(circle at 47px 19px, transparent 19px, #000 19.6px);
    -webkit-mask-composite: source-in;
    mask-image: radial-gradient(circle at 50% 50%, transparent 19px, #000 19.6px), radial-gradient(circle at 47px 19px, transparent 19px, #000 19.6px);
    mask-composite: intersect;
  }
  /* The profile and the shop: the all-behind drawing instead of back + front. */
  .pp-head > .cozy-b, .pp-head > .cozy-f, .cozy-box > .cozy-b, .cozy-box > .cozy-f { display: none; }
  .pp-head > .cozy-a, .cozy-box > .cozy-a { display: block; }
}

/* The mini-profile: the seat's box round its 56-px face (pp-head.css zooms the face's cell ×1.5). */
.pp-head:has(> .cozy) { position: relative; }
.pp-head > .cozy-pp { left: -12px; top: calc(50% - 40px); width: 80px; height: 80px; }
.pp-card > .pp-head:has(> .cozy) { --pph-avx: 10px; } /* the throw reaches left of the face, like a seat */
.pp-card > .pp-head > .cozy { zoom: 1.5; }
.pp-card > .pp-head > .cozy-b, .pp-card > .pp-head > .cozy-a { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45)); }

/* The shop: one's own face with the throw and the cushion (and one's seat when one is on). */
.cozy-box { position: relative; display: inline-block; flex: none; width: var(--fs); height: var(--fs); vertical-align: middle; }
.cozy-box > .club-face { position: relative; display: block; margin: 0; }
.cozy-box > .cozy-me { width: var(--fs); height: var(--fs); }
.cozy-box-o > :is(.cozy, .seat) { left: -9px; top: -9px; width: calc(100% + 18px); height: calc(100% + 18px); }
.cozy-box-c > :is(.cozy, .seat) { left: -4px; top: -4px; width: calc(100% + 8px); height: calc(100% + 8px); }
.cozy-box-t > :is(.cozy, .seat) { left: -8px; top: -8px; width: calc(100% + 16px); height: calc(100% + 16px); }
.cozy-box > .cozy-f { z-index: 1; }
.cozy-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cozy-opt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 104px; padding: 18px 4px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.cozy-opt:hover:not(:disabled) { background: var(--line); }
.cozy-opt.on { border-color: var(--accent); background: rgba(229, 160, 13, .12); }
.cozy-opt:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.cozy-opt:disabled { cursor: default; }
.cozy-opt-n { line-height: 1.2; text-align: center; }
.cozy-ini { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-style: normal; font-weight: 700; font-size: calc(var(--fs, 20px) * .36); }
.club-tile-pv .cozy-box { margin: 2px 0; }
@media (max-width: 420px) { .cozy-opts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Motion: a twinkle, a sway, a breath, a flicker, a drift, the needles. Between films and in the shop only. */
.cozy-svg :is(.cz-tw, .cz-br, .cz-fl, .cz-dr) { transform-box: fill-box; transform-origin: center; }
.cozy-svg :is(.cz-sw, .cz-kn) { transform-box: view-box; }
@media (prefers-reduced-motion: no-preference) {
  body.lobby-on .cozy-svg .cz-tw, #club-modal .cozy-svg .cz-tw { animation: cz-tw 3.4s ease-in-out infinite; }
  body.lobby-on .cozy-svg .cz-sw, #club-modal .cozy-svg .cz-sw { animation: cz-sw 4.2s ease-in-out infinite alternate; }
  body.lobby-on .cozy-svg .cz-br, #club-modal .cozy-svg .cz-br { animation: cz-br 4.8s ease-in-out infinite; }
  body.lobby-on .cozy-svg .cz-fl, #club-modal .cozy-svg .cz-fl { animation: cz-fl 2.6s ease-in-out infinite; }
  body.lobby-on .cozy-svg .cz-dr, #club-modal .cozy-svg .cz-dr { animation: cz-dr 7s ease-in-out infinite alternate; }
  body.lobby-on .cozy-svg .cz-kn, #club-modal .cozy-svg .cz-kn { animation: cz-kn 1.8s ease-in-out infinite alternate; }
}
@keyframes cz-tw { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes cz-sw { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes cz-br { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045, 1.06); } }
@keyframes cz-fl { 0%, 100% { opacity: 1; } 35% { opacity: .75; } 60% { opacity: .92; } 80% { opacity: .7; } }
@keyframes cz-dr { from { transform: translateX(-5px); } to { transform: translateX(5px); } }
@keyframes cz-kn { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
