/* «Фотобудка» 0.51 (club-photo.js): the countdown and the flash, «📸 Фото зала!», the album large, the profile's «Фото»,
   the shop's card and tile. Only its own boxes (.photo-…); nothing moves with reduced motion. */

/* The studio: the pets drawn for a photo, off the page. */
.photo-studio { position: fixed; left: -12000px; top: 0; width: 1200px; height: 400px; overflow: hidden; visibility: hidden; pointer-events: none; contain: strict; }
.photo-studio .photo-pet { display: block; position: relative; }

/* --- The countdown (every page of the hall) and the flash ------------------------------------------------------------ */
.photo-count { position: fixed; inset: 0; z-index: 2600; display: flex; align-items: center; justify-content: center; pointer-events: none;
  background: radial-gradient(circle at 50% 46%, rgba(0, 0, 0, .42), rgba(0, 0, 0, .12) 42%, rgba(0, 0, 0, 0) 70%); }
.photo-count-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 26px 16px; border-radius: 26px;
  background: rgba(14, 16, 22, .78); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 20px 60px rgba(0, 0, 0, .55); color: #fff; text-align: center; max-width: calc(100vw - 32px); }
.photo-count-cam { font-size: 26px; line-height: 1; }
.photo-count-n { display: block; min-width: 1.2em; font: 800 96px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #fff; text-shadow: 0 4px 24px rgba(255, 210, 120, .45); font-variant-numeric: tabular-nums; }
.photo-count-n.tick { animation: photoTick .5s cubic-bezier(.2, .9, .3, 1.2) both; }
.photo-count-t { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 700; }
.photo-count-s { color: #f5c542; font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.photo-count.flash { background: #fff; animation: photoFlash .52s ease-out both; }
.photo-count.flash .photo-count-box { visibility: hidden; }
@keyframes photoTick { from { transform: scale(1.45); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes photoFlash { 0% { opacity: 0; } 12% { opacity: .95; } 100% { opacity: 0; } }
@keyframes photoFlashSoft { 0% { opacity: 0; } 30% { opacity: .3; } 100% { opacity: 0; } }
.photo-count.still .photo-count-n.tick { animation: none; }
.photo-count.still.flash { animation: photoFlashSoft .7s linear both; }
@media (max-width: 560px), (max-height: 420px) {
  .photo-count-box { padding: 12px 18px 12px; border-radius: 20px; }
  .photo-count-n { font-size: 68px; }
  .photo-count-t { max-width: 240px; font-size: 14px; }
}

/* --- «📸 Фото зала!» ----------------------------------------------------------------------------------------------------- */
.photo-pop { position: fixed; left: 20px; bottom: 20px; z-index: 2340; box-sizing: border-box; display: flex; gap: 12px; align-items: center; width: 380px; max-width: calc(100vw - 20px);
  padding: 10px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px; background: var(--panel-2, #1b1e26); color: var(--text, #fff); box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  transform-origin: 20% 100%; animation: photoPopIn .5s cubic-bezier(.2, .9, .3, 1.12) both; }
.photo-pop.still { animation: none; }
@keyframes photoPopIn { from { transform: translateY(18px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.photo-pop-pic { flex: none; width: 128px; height: 80px; padding: 0; border: 3px solid #f4f1ea; border-radius: 6px; background: #111; overflow: hidden; cursor: pointer; transform: rotate(-2deg); box-shadow: 0 6px 16px rgba(0, 0, 0, .45); }
.photo-pop.still .photo-pop-pic { transform: none; }
.photo-pop-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-pop-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.photo-pop-txt b { font-size: 16px; }
.photo-pop-txt > span { overflow: hidden; color: var(--muted, #aab); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.photo-pop-acts { display: flex; gap: 6px; margin-top: 4px; }
.photo-pop-go { flex: 1; min-height: 44px; border: 1px solid var(--accent, #e5a00d); border-radius: 11px; background: var(--accent, #e5a00d); color: #1a1205; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.photo-pop-x { flex: none; width: 44px; min-height: 44px; border: 0; border-radius: 11px; background: rgba(255, 255, 255, .07); color: var(--text, #fff); font-size: 22px; line-height: 1; cursor: pointer; }
@media (max-width: 560px) {
  .photo-pop { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; }
  .photo-pop-pic { width: 112px; height: 70px; }
}

/* --- The album large -------------------------------------------------------------------------------------------------- */
.photo-view { box-sizing: border-box; width: min(920px, 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, #1b1e26), var(--panel, #15171d)); color: var(--text, #fff); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.photo-view-top { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; font-size: 16px; }
.photo-view-top b { flex: 1; min-width: 0; }
.photo-view-n { color: var(--muted, #aab); font-size: 13px; font-variant-numeric: tabular-nums; }
.photo-view-x { flex: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .06); color: var(--text, #fff); font-size: 24px; line-height: 1; cursor: pointer; }
.photo-big { position: relative; width: min(100%, calc((100vh - 290px) * var(--photo-r, 1.6))); margin: 0 auto; border-radius: 10px; overflow: hidden; background: #0b0c10; }
.photo-big img { display: block; width: 100%; height: 100%; object-fit: contain; }
.photo-view-cap { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; margin: 10px 4px 0; font-size: 14px; }
.photo-view-cap span { color: var(--muted, #aab); font-size: 12.5px; }
.photo-view-row, .photo-pp-row, .photo-alb-row { display: flex; gap: 8px; padding: 4px 2px 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; }
.photo-view-row { margin-top: 12px; }
.photo-view-row[hidden] { display: none; }
.photo-thumb { flex: 0 0 auto; width: 96px; height: 60px; min-height: 44px; margin: 0; padding: 0; border: 2px solid transparent; border-radius: 8px; background: #0b0c10; overflow: hidden; cursor: pointer; scroll-snap-align: start; }
.photo-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-thumb[aria-current="true"] { border-color: var(--accent, #e5a00d); }
.photo-thumb:focus-visible { outline: 2px solid var(--accent-2, #7aa2ff); outline-offset: 2px; }
.photo-view-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.photo-dl { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--accent, #e5a00d); border-radius: 12px; background: var(--accent, #e5a00d); color: #1a1205; font-size: 15px; font-weight: 700; text-decoration: none; }
.photo-sec { min-height: 44px; padding: 0 14px; border: 1px solid var(--line, #333); border-radius: 12px; background: rgba(255, 255, 255, .06); color: var(--text, #fff); font: inherit; font-size: 14px; cursor: pointer; }
.photo-sec:hover { background: rgba(255, 255, 255, .1); }
.photo-sec:disabled { opacity: .6; cursor: default; }
.photo-danger { color: #ff8a8a; border-color: rgba(255, 110, 110, .4); }
.photo-empty { margin: 30px 0; color: var(--muted, #aab); text-align: center; }
@media (max-width: 560px) {
  .photo-view { padding: 10px; border-radius: 16px; }
  .photo-big { width: min(100%, calc((100vh - 300px) * var(--photo-r, 1.6))); }
  .photo-view-acts > * { flex: 1 1 auto; justify-content: center; }
}
@media (max-height: 520px) { /* a phone held sideways: the photo nearly the screen's height, the rest below it */
  .photo-view { max-height: calc(100vh - 16px); }
  .photo-big { width: min(100%, calc((100vh - 84px) * var(--photo-r, 1.6))); }
}

/* --- The profile's «Фото» ---------------------------------------------------------------------------------------------- */
.photo-pp { margin: 14px 0 2px; }
.photo-pp-h { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; }
.photo-pp-h b { color: var(--muted, #aab); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.photo-pp-h span { color: var(--muted, #aab); font-size: 12px; }

/* --- The shop's card and tile ----------------------------------------------------------------------------------------- */
.photo-bds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.photo-bd { display: flex; flex-direction: column; align-items: stretch; gap: 5px; min-height: 44px; padding: 5px; border: 2px solid var(--line, #333); border-radius: 12px; background: rgba(255, 255, 255, .04); color: var(--text, #fff); font: inherit; font-size: 12px; line-height: 1.2; text-align: center; cursor: pointer; }
.photo-bd img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; border-radius: 7px; object-fit: cover; }
.photo-bd span { display: -webkit-box; min-height: 2.4em; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.photo-bd.on { border-color: var(--accent, #e5a00d); background: rgba(229, 160, 13, .1); }
.photo-bd:focus-visible { outline: 2px solid var(--accent-2, #7aa2ff); outline-offset: 2px; }
.photo-pv { position: relative; margin: 4px 0 10px; }
.photo-pv img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; border-radius: 10px; background: #0b0c10; box-shadow: 0 8px 22px rgba(0, 0, 0, .4); }
.photo-pv.loading img { background: linear-gradient(110deg, #15171d 30%, #20232c 50%, #15171d 70%) 0 0 / 300% 100%; animation: photoSkel 1.4s linear infinite; }
@keyframes photoSkel { from { background-position: 100% 0; } to { background-position: 0 0; } }
.photo-pv figcaption { margin: 6px 2px 0; color: var(--muted, #aab); font-size: 12px; }
.photo-note.small { font-size: 12px; }
.photo-alb-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 16px 0 6px; }
.photo-alb-h b { color: var(--muted, #aab); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.photo-alb-all { min-height: 36px; padding: 0 12px; border: 1px solid var(--line, #333); border-radius: 10px; background: rgba(255, 255, 255, .05); color: var(--text, #fff); font: inherit; font-size: 12.5px; cursor: pointer; }
.photo-tile { display: inline-block; width: 62px; height: 40px; border: 3px solid #f4f1ea; border-radius: 4px; background: #111; overflow: hidden; transform: rotate(-4deg); box-shadow: 0 4px 10px rgba(0, 0, 0, .45); }
.photo-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-tile-cam { width: 48px; height: 36px; border: 0; background: none; box-shadow: none; transform: none; }
.photo-tile-cam svg { display: block; width: 100%; height: 100%; }
@media (max-width: 760px), (pointer: coarse) {
  .photo-alb-all { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-count-n.tick, .photo-pop, .photo-pv.loading img { animation: none; }
  .photo-count.flash { animation: photoFlashSoft .7s linear both; }
  .photo-pop-pic, .photo-tile { transform: none; }
}
