/* «Питомец» 0.39 (club-pets.js): a small pet beside its owner's face — in the list of viewers, the profile and the
   shop. 0.43: drawn on a canvas (.cpet-c) by public/pets/pet-engine.js and its kind's public/pets/<kind>.js — its
   moves, sleep, z's and what it throws all live there; this file only places and sizes the boxes. The canvas reaches
   half a box to the left, 1.1 above, --cpet-w boxes wide and --cpet-h tall (room to jump and to throw things; the
   engine reads both), never takes a tap. */
.cpet { position: relative; display: inline-flex; flex: none; width: 18px; height: 18px; line-height: 0; vertical-align: middle; }
.cpet-c { --cpet-w: 2; --cpet-h: 2.35; position: absolute; left: -50%; top: -110%; width: calc(var(--cpet-w) * 100%); height: calc(var(--cpet-h) * 100%); pointer-events: none; }
.participants .cpet-c { --cpet-h: 2.1; } /* the strip scrolls sideways (and so clips): nothing below the pet's box, or it would grow */

/* The list of viewers (and the shop's preview chip): the pet after the name, the badge and the title; with a title
   (a two-row chip) a column of its own beside both rows. */
.person > .cpet, .club-chip > .cpet { margin-left: 1px; }
.person[data-club-tt] > .cpet, .club-chip[data-club-tt] > .cpet { grid-area: 1 / 5 / 3 / 6; margin-left: 5px; }
@media (min-width: 761px) { /* the strip scrolls sideways, so it clips above and below: room for a hop and what it throws, the same layout */
  .participants:has(.cpet) { padding-top: 10px; padding-bottom: 8px; margin-top: -8px; margin-bottom: -6px; }
}
@media (max-width: 760px) { /* a stack of faces: the pet sits on the face's lower right edge, inside the strip */
  .person > .cpet { position: absolute; right: -4px; bottom: -4px; z-index: 1; width: 16px; height: 16px; margin: 0; }
  .person:has(> .sync-badge) > .cpet { bottom: auto; top: -4px; } /* the dot of a viewer in trouble keeps its corner */
  .participants .cpet-c { --cpet-w: 1.5; } /* on a face's edge: nothing past its right edge either */
}

/* The profile: a bigger pet on the face's lower right edge (a box of no width after the face: the name stays put), a
   line under the badges. */
.cpet-ppbox { position: relative; flex: none; align-self: center; width: 0; height: 56px; margin-left: -13px; }
.cpet-ppbox > .cpet { position: absolute; left: -17px; bottom: -3px; width: 28px; height: 28px; }
.cpet-ppl { display: flex; align-items: center; gap: 6px; margin: 2px 0 10px; font-size: 13px; color: var(--muted); }
.cpet-ppl-ico { font-size: 16px; line-height: 1; }
.cpet-ppl-ico.cpet-ppl-art { display: inline-flex; flex: none; width: 20px; height: 20px; } /* 0.69 (n66 L4): the pet itself at rest (a still icon) */
.cpet-ppl-ico.cpet-ppl-art > .cpet { width: 20px; height: 20px; }

/* The shop's card: the six pets as live previews, 0.42 «Повадки» of the one picked on a stage of its own, the names
   as chips, one's own chip with the pet. */
.cpet-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.cpet-kind { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; min-height: 88px; padding: 8px 4px 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; }
.cpet-kind:hover:not(:disabled) { background: var(--line); }
.cpet-kind.on { border-color: var(--accent); background: rgba(229, 160, 13, .12); }
.cpet-kind:disabled { cursor: default; }
.cpet-kind:focus-visible, .cpet-name:focus-visible, .cpet-hb:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.cpet-stage { display: flex; align-items: flex-end; justify-content: center; width: 54px; height: 54px; padding-top: 6px; }
.cpet-shop { width: 46px; height: 46px; }
.cpet-kn { max-width: 100%; text-align: center; line-height: 1.2; overflow-wrap: break-word; } /* «Попкорн-монстрик» may take two lines */
.cpet-habits { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.cpet-hstage { display: flex; flex: none; align-items: flex-end; justify-content: center; width: 112px; height: 104px; padding-top: 4px; }
.cpet-big { width: 92px; height: 92px; }
.cpet-hlist { flex: 1; min-width: 0; }
.cpet-ht { font-size: 12.5px; font-weight: 600; }
.cpet-hk { margin: 8px 0 4px; color: var(--muted); font-size: 12px; }
.cpet-hrow { display: flex; flex-wrap: wrap; gap: 6px; }
.cpet-hb { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.cpet-hb:hover { background: var(--line); }
.cpet-hb-i { font-size: 13px; line-height: 1; }
/* 0.62 «Своё имя»: one's own name above the club's names */
.cpet-namebox { margin-top: 12px; }
.cpet-own-l { display: block; margin-bottom: 5px; font-size: 12.5px; font-weight: 600; }
.cpet-own .cpet-down { margin: 0 0 6px; }
.cpet-own-row { display: flex; gap: 6px; max-width: 420px; }
.cpet-own-in { flex: 1 1 auto; min-width: 0; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, .18); color: var(--text); font: inherit; font-size: 14px; }
.cpet-own-in::placeholder { color: var(--muted); opacity: .8; }
.cpet-own-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.cpet-own.on .cpet-own-in { border-color: var(--accent); }
.cpet-own-ok { flex: 0 0 auto; min-height: 36px; padding: 0 14px; border: 1px solid var(--accent); border-radius: 10px; background: transparent; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cpet-own-ok:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.cpet-own-ok:disabled, .cpet-own-in:disabled { opacity: .6; cursor: default; }
.cpet-own-ok:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.cpet-own-hint { margin-top: 5px; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.cpet-names-k { margin-top: 10px; color: var(--muted); font-size: 12px; }
.cpet-ppl-down { margin-left: 8px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; }
.cpet-ppl-down:hover:not(:disabled) { color: var(--text); background: var(--line); }
.cpet-names { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cpet-name { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; }
.cpet-name:hover:not(:disabled) { background: var(--line); }
.cpet-name.on { border-color: var(--accent); color: var(--accent); }
.cpet-name:disabled { cursor: default; }
.cpet-pv { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.cpet-pv-k { color: var(--muted); font-size: 12px; }
.cpet-left { margin-top: 8px; color: var(--muted); font-size: 12px; }
.cpet-tile { width: 44px; height: 44px; } /* the shop's tile (club-shop-page.js): one's own pet */
@media (max-width: 760px) {
  .cpet-name { min-height: 44px; padding: 0 14px; } .cpet-kind { min-height: 96px; }
  .cpet-own-in, .cpet-own-ok { min-height: 44px; } .cpet-own-in { font-size: 16px; } /* 16 px: no zoom on focus in iOS */
  .cpet-ppl-down { min-height: 32px; }
  .cpet-hb { min-height: 44px; padding: 0 12px; }
  .cpet-habits { flex-direction: column; align-items: stretch; } .cpet-hstage { align-self: center; }
}
/* 0.56: seventeen kinds — on phones four to a row where they fit (five rows instead of six), the tiles a little more compact */
@media (max-width: 760px) {
  .cpet-kinds { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; overflow-x: clip; } /* four to a row (auto-fill made five at 390 and broke «Дракончик» mid-word); a pet's wide canvas never past the card's edge */
  .cpet-kind { min-height: 90px; padding: 6px 2px; }
  .cpet-kn { font-size: 11.5px; }
}
@media (max-width: 300px) { .cpet-kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); } } /* narrower than four 62-px tiles: three */

/* Reduced motion: the engine draws one still frame — awake, or asleep with its eyes shut. */

/* 0.67: the week or the month (club-pets.js termsHtml) */
.cpet-terms { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 0; }
.cpet-term { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 58px; padding: 8px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.cpet-term b { font-size: 14px; }
.cpet-term span { color: var(--accent); font-weight: 700; font-size: 13.5px; }
.cpet-term small { color: var(--muted); font-size: 11.5px; }
.cpet-term.on { border-color: var(--accent); background: rgba(255, 255, 255, .06); }
.cpet-term:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.cpet-term:disabled { opacity: .55; cursor: default; }
