/* «День рождения» (0.50, club-birthday.js): boxes of its own only (.bday-…). The 🎂 lies on a face, absolutely — nothing in
   the strip moves or grows. The party is a fixed layer over the page (taps go through it), under the dialogs; its pieces
   move by transform and opacity only. Reduced motion (.bday-still, set by the script, and the media query): the pieces
   stand still around the banner, which only fades. */

/* The cake (an SVG of ours): sponge, cream, a candle, its flame. */
.bday-cake { display: block; width: 100%; height: 100%; overflow: visible; }
.bday-cake .bc-plate { fill: #e3e8f2; }
.bday-cake .bc-body { fill: #ff8db4; }
.bday-cake .bc-band { fill: #ff5f93; }
.bday-cake .bc-cream { fill: #fff7ec; }
.bday-cake .bc-candle { fill: #6cc4ff; }
.bday-cake .bc-stripe { fill: #ffffff; }
.bday-cake .bc-flame { fill: #ffc93c; }
.bday-cake .bc-glint { fill: none; stroke: #ffffff; stroke-width: .9; stroke-linecap: round; opacity: .7; }

/* The strip (clubShop.nameAfter): on the face's lower right, on a dark disc that parts it from the face; on a phone the
   chip is the face (38 px; the next chip tucks under its right edge, the pet sits low right): low in the middle. */
.person > .bday-mk, .bday-pv-chip > .bday-mk {
  position: absolute; z-index: 2; left: 14px; top: calc(50% - 1px); width: 15px; height: 15px; padding: 1.5px; box-sizing: border-box;
  border-radius: 50%; background: rgb(14, 17, 23); box-shadow: 0 0 0 1px rgba(255, 255, 255, .16); pointer-events: none;
}
@media (max-width: 760px) {
  .person > .bday-mk { left: calc(50% - 9px); top: auto; bottom: -3px; width: 18px; height: 18px; padding: 2px; }
}

/* The profile: the cake after the name, the day's block at the top of the body. */
.pp-name .bday-pp-mk { display: inline-block; width: 18px; height: 18px; margin-left: 5px; vertical-align: -3px; }
.bday-pp { display: grid; gap: 8px; margin: 0 0 12px; padding: 10px 12px 12px; border-radius: 14px; background: rgba(255, 141, 180, .08); border: 1px solid rgba(255, 141, 180, .3); }
.bday-pp-top { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.25; }
.bday-pp-cake { width: 28px; height: 28px; flex: none; }
.bday-cheer { justify-self: start; min-height: 40px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.bday-cheer:disabled { opacity: .6; cursor: default; }
.bday-cheer:focus-visible, .bday-reset:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bday-done { font-size: 13px; font-weight: 700; color: #5ee0b0; }
.bday-who { font-size: 12px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.bday-reset { justify-self: start; padding: 2px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.bday-admin { margin-top: 12px; }
@media (max-width: 760px) { .bday-cheer { min-height: 44px; } .bday-reset { min-height: 32px; } }

/* --- The party over the hall ------------------------------------------------------------------------------------- */
.bday-party { position: fixed; inset: 0; z-index: 1180; pointer-events: none; overflow: hidden; }
.bday-pieces { position: absolute; inset: 0; transition: opacity .35s ease; }
.bday-out .bday-pieces { opacity: 0; }
.bday-cf {
  position: absolute; top: -24px; left: var(--x); width: 8px; height: 13px; border-radius: 2px; background: var(--c); opacity: 0;
  animation: bday-fall var(--t, 3s) cubic-bezier(.3, .15, .7, .95) var(--d, 0s) forwards;
}
.bday-cf-o { width: 8px; height: 8px; border-radius: 50%; }
.bday-cf-s { width: 4px; height: 22px; border-radius: 3px; }
@keyframes bday-fall {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg) rotateY(0deg); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--sx, 0px), calc(100vh + 48px), 0) rotate(var(--r, 360deg)) rotateY(calc(var(--r, 360deg) * 1.5)); }
}
.bday-bl { position: absolute; left: var(--x); bottom: -96px; width: 40px; height: 64px; opacity: 0; animation: bday-up var(--t, 5s) cubic-bezier(.33, .08, .5, 1) var(--d, 0s) forwards; }
.bday-bl svg { display: block; width: 100%; height: 100%; transform-origin: 50% 100%; animation: bday-sway 1.7s ease-in-out infinite alternate; }
@keyframes bday-up { 0% { opacity: 0; transform: translate3d(0, 0, 0); } 8% { opacity: 1; } 84% { opacity: 1; } 100% { opacity: 0; transform: translate3d(0, calc(-100vh - 150px), 0); } }
@keyframes bday-sway { from { transform: translateX(calc(var(--sw, 14px) * -.5)) rotate(-6deg); } to { transform: translateX(calc(var(--sw, 14px) * .5)) rotate(6deg); } }

.bday-banner {
  position: absolute; left: 12px; right: 12px; top: 14%; width: fit-content; max-width: 600px; margin: 0 auto; box-sizing: border-box;
  display: flex; align-items: center; gap: 16px; padding: 16px 26px 16px 16px; border-radius: 20px; background: rgba(16, 18, 27, .95);
  border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); animation: bday-in .55s cubic-bezier(.2, 1.25, .4, 1) both;
}
.bday-out .bday-banner { animation: bday-leave .35s ease forwards; }
@keyframes bday-in { from { opacity: 0; transform: translateY(-14px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes bday-leave { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-8px); } }
.bday-credits .bday-banner { top: auto; bottom: 18%; }
/* the bunting: little flags on a string along the banner's top edge */
.bday-flags { position: absolute; left: 22px; right: 22px; top: -9px; height: 14px; display: flex; justify-content: space-between; }
.bday-flags::before { content: ''; position: absolute; left: -8px; right: -8px; top: 0; border-top: 1.5px solid rgba(255, 255, 255, .5); }
.bday-flags i { width: 11px; height: 13px; margin-top: 1px; background: var(--c); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.bday-flags i:nth-child(odd) { transform: rotate(-4deg); }
.bday-flags i:nth-child(even) { transform: rotate(4deg); }
.bday-face { position: relative; flex: none; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--accent-2, #5865f2); box-shadow: 0 0 0 3px #f6c445, 0 0 0 7px rgba(246, 197, 69, .18); }
.bday-face > img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.bday-face > b { color: #fff; font-size: 20px; }
.bday-face-cake { position: absolute; right: -9px; bottom: -7px; width: 30px; height: 30px; padding: 3px; box-sizing: border-box; border-radius: 50%; background: rgb(16, 18, 27); }
.bday-text { display: grid; gap: 3px; min-width: 0; }
.bday-text small { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #f6c445; }
.bday-text b { font-size: 22px; line-height: 1.15; color: #fff; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .bday-banner { top: 11%; gap: 12px; padding: 12px 18px 12px 12px; border-radius: 18px; }
  .bday-face { width: 46px; height: 46px; }
  .bday-face-cake { width: 26px; height: 26px; right: -8px; bottom: -6px; }
  .bday-text b { font-size: 17px; }
}

/* «Поздравить» in the hall: hearts and balloons from the face (up, or down when the strip is at the top of the page). */
.bday-cheer-fx { position: fixed; z-index: 1170; width: 0; height: 0; pointer-events: none; --rise: -24px; }
.bday-cheer-fx.bday-down { --rise: 16px; }
.bday-cx { position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; opacity: 0; animation: bday-pop 1.8s cubic-bezier(.2, .7, .3, 1) var(--d, 0s) forwards; }
.bday-cx svg { display: block; width: 100%; height: 100%; }
.bday-cx-h svg path { fill: var(--c); }
.bday-cx-b { left: -8px; top: -13px; width: 16px; height: 26px; }
@keyframes bday-pop {
  0% { opacity: 0; transform: translate(0, 0) scale(.3); }
  18% { opacity: 1; transform: translate(calc(var(--dx) * .55), calc(var(--dy) * .55)) scale(var(--s, 1)); }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + var(--rise))) scale(var(--s, 1)); }
}
.bday-cx-who { position: absolute; left: 0; top: -40px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: rgba(16, 18, 27, .94); border: 1px solid rgba(255, 255, 255, .14); color: #fff; font-size: 12px; font-weight: 700; animation: bday-who 2.1s ease forwards; }
.bday-down .bday-cx-who { top: 22px; }
@keyframes bday-who { 0% { opacity: 0; transform: translate(-50%, 6px); } 15%, 76% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -8px); } }

/* Reduced motion: nothing falls or rises; the pieces stand around, the banner fades in and out. */
.bday-still .bday-cf { top: var(--y); transform: rotate(var(--r)); animation: bday-fade .5s ease forwards; }
.bday-still .bday-bl { bottom: auto; top: var(--y); animation: bday-fade .5s ease forwards; }
.bday-still .bday-bl svg { animation: none; }
.bday-still .bday-banner { animation: bday-fade-c .4s ease both; }
.bday-still.bday-out .bday-banner { animation: bday-fade-out .3s ease forwards; }
.bday-still .bday-cx { animation: bday-fade-x 1.5s ease forwards; transform: translate(var(--dx), var(--dy)); }
.bday-still .bday-cx-who { animation: bday-fade-x 1.5s ease forwards; transform: translateX(-50%); }
@keyframes bday-fade { from { opacity: 0; } to { opacity: .92; } }
@keyframes bday-fade-c { from { opacity: 0; } to { opacity: 1; } }
@keyframes bday-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes bday-fade-x { 0% { opacity: 0; } 20%, 75% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .bday-cf, .bday-bl, .bday-bl svg, .bday-cx { animation-duration: .01ms; animation-iteration-count: 1; }
}

/* --- The shop: the card's picker and preview, the tile --------------------------------------------------------------- */
.bday-pick { display: flex; gap: 10px; margin: 12px 0 10px; }
.bday-pick label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.bday-pick label:last-child { flex: 1; }
.bday-pick select { min-height: 40px; min-width: 76px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2, #1b1e27); color: var(--text); font: inherit; font-size: 14px; }
@media (max-width: 760px) { .bday-pick select { min-height: 44px; font-size: 16px; } }
.bday-pv { display: grid; gap: 8px; margin: 12px 0 4px; }
.bday-pv-t { font-size: 12px; color: var(--muted); }
.bday-pv-chip { position: relative; justify-self: start; }
.bday-pv-stage { display: grid; place-items: center; padding: 20px 10px 14px; border-radius: 14px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); overflow: hidden; }
.bday-banner.bday-pv-banner { position: relative; left: auto; right: auto; top: auto; max-width: 100%; margin: 0; animation: none; gap: 12px; padding: 11px 18px 11px 11px; border-radius: 16px; box-shadow: none; }
.bday-pv-banner .bday-face { width: 40px; height: 40px; box-shadow: 0 0 0 2px #f6c445, 0 0 0 5px rgba(246, 197, 69, .18); }
.bday-pv-banner .bday-face-cake { width: 22px; height: 22px; padding: 2px; right: -7px; bottom: -5px; }
.bday-pv-banner .bday-text small { font-size: 9.5px; }
.bday-pv-banner .bday-text b { font-size: 15px; }
.bday-pv-banner .bday-flags { left: 16px; right: 16px; top: -7px; }
.bday-pv-banner .bday-flags i { width: 8px; height: 10px; }
.bday-wait { margin-top: 10px; }
.club-note.bday-hint { margin: 10px 0 0; padding: 0 2px; border: 0; background: none; color: var(--muted); font-size: 12.5px; }
.bday-hint[hidden] { display: none; }
.bday-tile { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.bday-tile-cake { width: 40px; height: 40px; }
.bday-tile b { font-size: 12px; line-height: 1; color: var(--text); }
/* 0.67: «День рождения» is free — its setter in one's own profile (the last block of «Моё») */
.bday-set { margin: 12px 0 0; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.bday-set-top { display: flex; align-items: center; gap: 10px; }
.bday-set-cake { width: 28px; height: 28px; flex: none; }
.bday-set-t { display: grid; gap: 2px; min-width: 0; flex: 1; font-size: 14px; line-height: 1.25; }
.bday-set-t small { color: var(--muted); font-size: 12.5px; }
.bday-set-go, .bday-set-x { flex: none; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.bday-set-go:hover, .bday-set-x:hover { background: var(--line); }
.bday-set-go:focus-visible, .bday-set-x:focus-visible, .bday-set .bday-save:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.bday-set-note, .bday-set-how { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.bday-set-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.bday-set .bday-save { min-height: 40px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--accent); color: #1a1205; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.bday-set .bday-save:disabled { opacity: .5; cursor: default; }
@media (max-width: 760px) { .bday-set-go, .bday-set-x, .bday-set .bday-save { min-height: 44px; } }
