/* 0.50 «Открытки» (club-cards.js): one card (its picture, its back with the words, a stamp and a postmark), the shop's
   card, the arrival that slides in at the bottom, the profile's shelf and the card large. Own `.pcard-` boxes only. */
.pcard { --pc-paper: #f7f0e1; --pc-ink: #3b2f22; --pc-sign: #7a2e3a; display: block; overflow: hidden; border-radius: 14px; background: var(--pc-paper); color: var(--pc-ink); box-shadow: 0 10px 28px rgba(0, 0, 0, .38); text-align: left; }
.pcard-front svg { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; }
.pcard-back {
  position: relative; min-height: 78px; padding: 12px 16px 12px;
  background: repeating-linear-gradient(180deg, transparent 0 25px, rgba(122, 96, 64, .2) 25px 26px) 0 12px / 100% 26px repeat-y, var(--pc-paper);
}
.pcard-words { margin: 0 0 2px; font: italic 17px/26px Georgia, "PT Serif", "Times New Roman", serif; color: var(--pc-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.pcard-words.pcard-off { min-height: 26px; font-style: normal; font-size: 13px; color: rgba(59, 47, 34, .6); }
.pcard-sign { display: block; font: italic 600 15px/26px Georgia, "PT Serif", "Times New Roman", serif; color: var(--pc-sign); text-align: right; overflow-wrap: anywhere; }
/* The stamp and its postmark float at the top right: the words wrap around them like on a real card. */
.pcard-post { position: relative; float: right; width: 76px; height: 50px; margin: -2px -6px 2px 10px; }
.pcard-stamp { position: absolute; top: 0; right: 2px; width: 46px; padding: 3px; background: #fffdf7; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12), 0 1px 3px rgba(0, 0, 0, .2); transform: rotate(4deg); }
.pcard-stamp::after { content: ''; position: absolute; inset: -2px; border: 2px dotted var(--pc-paper); pointer-events: none; }
.pcard-stamp svg { display: block; width: 100%; height: auto; }
.pcard-mark { position: absolute; top: 12px; left: 0; display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid rgba(122, 46, 58, .42); border-radius: 50%; transform: rotate(-14deg); pointer-events: none; }
.pcard-mark i { font: 700 10px/1 ui-monospace, Menlo, Consolas, monospace; font-style: normal; letter-spacing: .5px; color: rgba(122, 46, 58, .62); }
.pcard-sm .pcard-words, .pcard-md .pcard-words { font-size: 16px; }
.pcard-lg .pcard-back { padding: 14px 20px 14px; }

/* --- The shop's card ---------------------------------------------------------------------------------------------- */
.pcard-shop .pcard-k { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pcard-picks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pcard-pick { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-height: 44px; margin: 0; padding: 4px 4px 5px; border: 2px solid transparent; border-radius: 10px; background: rgba(255, 255, 255, .04); color: var(--text); font: inherit; font-size: 12px; line-height: 1.2; cursor: pointer; }
.pcard-pick svg { display: block; width: 100%; height: auto; border-radius: 5px; }
.pcard-pick span { overflow: hidden; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.pcard-pick:hover { background: rgba(255, 255, 255, .08); }
.pcard-pick[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 255, 255, .08); }
.pcard-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The receiver: the search, the people found, the one chosen (the gift's look, in boxes of its own). */
.pcard-q { box-sizing: border-box; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font-size: 15px; }
.pcard-q:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pcard-people { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.pcard-people:empty { display: none; }
.pcard-none { padding: 6px 8px; color: var(--muted); font-size: 13px; }
.pcard-to { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 6px 4px 8px; border: 1px solid var(--accent); border-radius: 10px; background: rgba(229, 160, 13, .08); }
.pcard-to b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-drop { flex: none; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.pcard-drop:hover, .pcard-drop:focus-visible { background: var(--line); color: var(--text); }
.pcard-person { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text); font-size: 14.5px; text-align: left; cursor: pointer; }
.pcard-person:hover, .pcard-person:focus-visible { background: var(--line); }
.pcard-text { display: block; box-sizing: border-box; width: 100%; min-height: 76px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, .22); color: var(--text); font: inherit; font-size: 15px; line-height: 1.4; resize: vertical; }
.pcard-text:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pcard-count { display: flex; justify-content: space-between; gap: 8px; min-height: 16px; margin-top: 4px; color: var(--muted); font-size: 12px; }
.pcard-why, .pcard-count.over .pcard-n { color: #ff8f8f; }
.pcard-prev { max-width: 340px; margin: 0 auto; }
.pcard-today { margin: 12px 0 0; color: var(--muted); font-size: 13px; }

/* The tile: two small cards. */
.pcard-tile { position: relative; display: block; width: 84px; height: 62px; }
.pcard-tile svg { position: absolute; width: 60px; height: auto; border-radius: 4px; box-shadow: 0 3px 8px rgba(0, 0, 0, .4); }
.pcard-tile svg:first-child { top: 2px; left: 0; transform: rotate(-9deg); }
.pcard-tile svg:last-child { right: 0; bottom: 2px; transform: rotate(7deg); }

/* «✉️ Открытка» beside the name on somebody else's profile (the look of «🎁 Подарить очки» beside it). */
.pp-sub .pcard-pp-send { margin-left: 10px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pp-sub .pcard-pp-send:hover, .pp-sub .pcard-pp-send:focus-visible { border-color: var(--accent); }

/* --- The profile's shelf ------------------------------------------------------------------------------------------ */
.pcard-pp { margin: 14px 0 2px; }
.pcard-pp-h { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; }
.pcard-pp-h b { color: var(--muted); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.pcard-pp-h span { color: var(--muted); font-size: 12px; }
.pcard-pp-row { display: flex; gap: 10px; padding: 4px 2px 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; }
.pcard-thumb { position: relative; flex: 0 0 auto; width: 100px; min-height: 44px; margin: 0; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; scroll-snap-align: start; }
.pcard-thumb svg { display: block; width: 100px; height: auto; border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); transition: transform .18s ease; }
.pcard-thumb:hover svg, .pcard-thumb:focus-visible svg { transform: translateY(-2px) rotate(-1.5deg); }
.pcard-thumb:focus-visible { outline: none; }
.pcard-thumb:focus-visible svg { outline: 2px solid var(--accent); outline-offset: 2px; }
.pcard-thumb-by { display: block; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.pcard-hid svg { opacity: .42; filter: grayscale(.6); }
.pcard-thumb-h { position: absolute; top: 6px; left: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 10.5px; font-style: normal; }

/* --- The arrival: bottom right on a computer, a bottom sheet on a phone; never over a playing film (club-cards.js) ---- */
.pcard-in { position: fixed; right: 20px; bottom: 20px; z-index: 2350; box-sizing: border-box; width: 344px; max-width: calc(100vw - 20px); max-height: calc(100vh - 40px); overflow-y: auto; padding: 12px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 18px; background: var(--panel-2); color: var(--text); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); transform-origin: 70% 100%; animation: pcardIn .56s cubic-bezier(.2, .9, .3, 1.12) both; }
.pcard-in-head { display: flex; align-items: center; gap: 8px; margin: 2px 4px 10px; font-size: 15px; }
.pcard-in-ico { font-size: 20px; line-height: 1; }
.pcard-in-acts, .pcard-view-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pcard-thx { flex: 1 1 auto; min-height: 46px; padding: 0 18px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent); color: #1a1205; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.pcard-sec { flex: 0 1 auto; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .06); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.pcard-sec:hover { background: rgba(255, 255, 255, .1); }
.pcard-thx:disabled, .pcard-sec:disabled { opacity: .6; cursor: default; }
.pcard-danger { border-color: rgba(255, 120, 120, .4); color: #ffa3a3; }
.pcard-in.pcard-out { pointer-events: none; animation: pcardOut .26s ease both; }
@keyframes pcardIn { from { opacity: 0; transform: translateY(48px) rotate(-4deg); } 62% { opacity: 1; transform: translateY(-5px) rotate(.8deg); } to { opacity: 1; transform: none; } }
@keyframes pcardOut { to { opacity: 0; transform: translateY(28px); } }
@media (max-width: 359px) { .pcard-picks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .pcard-in { right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); left: 10px; width: auto; max-width: none; }
  .pcard-picks { gap: 6px; }
  .pp-sub .pcard-pp-send { min-height: 44px; margin: 6px 0 0 8px; }
}
/* A phone held sideways: the picture beside its back. */
@media (max-height: 560px) {
  .pcard-in { width: min(600px, calc(100vw - 20px)); }
  .pcard-in .pcard { display: grid; grid-template-columns: 46% 1fr; align-items: stretch; }
  .pcard-in .pcard-front svg { height: 100%; object-fit: cover; }
}

/* --- The card large (from the shelf) ------------------------------------------------------------------------------ */
.pcard-view { box-sizing: border-box; width: min(540px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 14px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 18px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.pcard-view-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 10px; font-size: 16px; }
.pcard-view-x { flex: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .06); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
.pcard-view-date { margin: 8px 4px 0; color: var(--muted); font-size: 12px; text-align: right; }
@media (min-width: 700px) and (min-height: 640px) { .pcard-lg .pcard-words { font-size: 19px; line-height: 28px; } .pcard-lg .pcard-back { background-size: 100% 28px; background-position: 0 14px; } .pcard-lg .pcard-sign { line-height: 28px; } }

@media (prefers-reduced-motion: reduce) {
  .pcard-in { animation: none; }
  .pcard-in.pcard-out { animation: none; opacity: 0; }
  .pcard-thumb svg { transition: none; }
  .pcard-thumb:hover svg, .pcard-thumb:focus-visible svg { transform: none; }
}
