/* Álbum da festa — livro aberto, molduras da casa, zoom e salão. */

.ak-album {
  --ak-purple: #5C2748;
  --ak-yellow: #F2C01A;
  --ak-pumpkin: #F06B1A;
  --ak-cream: #FFF6EB;
  margin: 12px 0 24px;
}
.ak-album-meta {
  margin: 0 0 12px;
  font-weight: 800;
  color: var(--ak-purple);
}
.ak-album-meta strong {
  font-family: var(--ak-font-title, "Bagel Fat One", Fredoka, sans-serif);
  font-weight: 400;
  font-size: 1.6rem;
  color: var(--ak-pumpkin);
}
.ak-album-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  overflow: visible;
  padding: 2vh 0;
}
.ak-book-shell {
  --ak-frame: clamp(44px, 5.5vw, 64px);
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  width: min(920px, 100%);
  margin: 0 auto;
  overflow: visible;
  border: var(--ak-frame) solid #5C2748;
  border-image-source: url("../images/moldura-festa.png");
  border-image-slice: 187 248 212 264;
  border-image-width: var(--ak-frame);
  border-image-repeat: round;
  border-radius: 14px;
  box-shadow:
    0 0 0 3px #F2C01A,
    0 0 0 8px #5C2748,
    12px 18px 28px rgba(26, 12, 22, 0.45);
}
.ak-book-moldura {
  display: none;
}
.ak-album-nav {
  position: relative;
  z-index: 6;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--ak-yellow);
  color: #2A1024;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 0 #C49208;
}
.ak-album-nav:hover { transform: translateY(-2px); }
.ak-album-nav:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.ak-book {
  position: relative;
  z-index: 1;
  margin: 0;
  perspective: 1600px;
  background:
    radial-gradient(ellipse 40% 30% at 50% 100%, rgba(240,107,26,.18), transparent 70%),
    linear-gradient(180deg, #3a1832 0%, #2A1024 100%);
  border: 6px solid var(--ak-yellow);
  border-radius: 10px 18px 22px 14px;
  padding: 22px 16px 26px;
  box-shadow:
    14px 18px 0 rgba(240, 107, 26, 0.32),
    0 24px 40px rgba(42, 16, 36, 0.35);
  min-height: 340px;
  overflow: visible;
  transform-style: preserve-3d;
}
.ak-spread:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr);
  gap: 0;
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
}
.ak-spread[hidden] { display: none !important; }
.ak-spread.is-on { animation: albumOpen .6s cubic-bezier(.2, .8, .2, 1); }
.ak-spread.is-flip { animation: albumFlip .5s ease; }
.ak-spread.is-flip .ak-page-right {
  animation: leafTurn .5s ease;
  transform-origin: left center;
}

@keyframes albumOpen {
  from { transform: rotateX(10deg) scale(.94); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes albumFlip {
  0% { transform: rotateY(0); }
  40% { transform: rotateY(-12deg) scale(.985); }
  100% { transform: none; }
}
@keyframes leafTurn {
  0% { transform: perspective(900px) rotateY(0); box-shadow: none; }
  55% { transform: perspective(900px) rotateY(-70deg); box-shadow: -18px 0 24px rgba(42,16,36,.25); }
  100% { transform: perspective(900px) rotateY(-2.5deg); }
}

.ak-page {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 14px;
  padding: 16px 14px 18px;
  background:
    linear-gradient(90deg, rgba(42,16,36,.06), transparent 12%),
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(92,39,72,.04) 28px),
    #fffef8;
  min-height: 280px;
  align-content: center;
  justify-items: center;
  box-shadow: inset 0 0 0 1px rgba(92, 39, 72, 0.08);
}
.ak-page-left {
  border-radius: 4px 0 0 4px;
  transform: perspective(900px) rotateY(2.5deg);
  transform-origin: right center;
}
.ak-page-right {
  border-radius: 0 4px 4px 0;
  transform: perspective(900px) rotateY(-2.5deg);
  transform-origin: left center;
  background:
    linear-gradient(270deg, rgba(42,16,36,.06), transparent 12%),
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(92,39,72,.04) 28px),
    #fffdf6;
}
.ak-spine {
  background:
    linear-gradient(90deg, rgba(42,16,36,.45), #5C2748 40%, #7A3A68 50%, #5C2748 60%, rgba(42,16,36,.45));
  box-shadow: 0 0 18px rgba(42, 16, 36, 0.45);
  border-left: 2px solid var(--ak-yellow);
  border-right: 2px solid var(--ak-yellow);
  border-radius: 3px;
}

.ak-page .ak-frame {
  margin: 0;
  position: relative;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 3 / 2;
  height: auto;
}
.ak-frame {
  border: 0;
  padding: 0;
  background: #1A1018;
  border-radius: 4px;
  box-shadow: 4px 6px 14px rgba(42, 16, 36, 0.28);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
}
.ak-frame:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 6px 10px 0 rgba(240, 107, 26, 0.28);
  z-index: 2;
}
.ak-frame > img:first-of-type {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  background: #1A1018;
}
.ak-frame figcaption {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  margin: 0;
  padding: 4px 6px;
  font-size: .68rem;
  font-weight: 800;
  color: #FFF6EB;
  background: linear-gradient(180deg, transparent, rgba(42,16,36,.88));
}
.ak-shot-del {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  margin: 0;
}
.ak-shot-del button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #5C2748;
  color: #F2C01A;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.ak-album-pager {
  text-align: center;
  font-weight: 800;
  color: var(--ak-purple);
  margin: 10px 0 0;
}

.ak-cover-left,
.ak-cover-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 280px;
  background:
    radial-gradient(circle at 20% 15%, rgba(242,192,26,.18), transparent 42%),
    #fffef8;
}
.ak-cover-left .ak-logo,
.ak-cover-logo {
  display: inline-flex;
  align-items: center;
  gap: .32em;
  font-size: clamp(0.88rem, 2vw, 1.2rem);
  margin: 0 auto 14px;
  padding: .28em .7em .28em .28em;
  background: linear-gradient(165deg, #7A3A68 0%, #5C2748 48%, #2A1024 100%);
  border-radius: 999px;
  box-shadow: 0 0 0 2px #F2C01A, 0 4px 0 #C49208;
}
.ak-cover-left .ak-logo-balloons { width: 1.7em; height: auto; flex: 0 0 auto; }
.ak-cover-left .ak-logo-word { display: flex; flex-wrap: nowrap; white-space: nowrap; }
.ak-cover-left .ak-logo .bal-l { display: inline-block; text-shadow: 0 2px 0 rgba(42,16,36,.4); }
.ak-cover-left .ak-logo .bal-l:nth-child(3n+1) { color: #F2C01A; }
.ak-cover-left .ak-logo .bal-l:nth-child(3n+2) { color: #F06B1A; }
.ak-cover-left .ak-logo .bal-l:nth-child(3n) { color: #FFF6EB; }
.ak-cover-left .ak-logo .bal-sp { display: inline-block; width: .32em; }
.ak-cover-lead {
  font-family: var(--ak-font-title, "Bagel Fat One", Fredoka, sans-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--ak-purple);
  margin: 8px 0 4px;
  word-spacing: 0.45em;
  letter-spacing: 0.02em;
}
.ak-cover-hint { color: #7A3A68; font-weight: 800; }
.ak-blob {
  width: min(220px, 70%);
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  background: #7A3A68;
  border-radius: 58% 42% 55% 45% / 48% 58% 42% 52%;
  color: #fff;
  box-shadow: 8px 10px 0 rgba(242, 192, 26, 0.55);
  animation: blobIdle 5s ease-in-out infinite;
  padding: 18px;
}
.ak-blob strong {
  font-family: var(--ak-font-title, "Bagel Fat One", Fredoka, sans-serif);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 400;
  line-height: 1;
  word-spacing: 0.4em;
}
.ak-blob small { display: block; margin-top: 8px; opacity: .9; font-weight: 800; }
.ak-blob-heart { color: #F2C01A; font-size: 1.1rem; }
@keyframes blobIdle {
  0%, 100% { border-radius: 58% 42% 55% 45% / 48% 58% 42% 52%; }
  50% { border-radius: 45% 55% 42% 58% / 55% 45% 55% 45%; }
}
.ak-turn-hint {
  margin-top: 18px;
  border: 0;
  background: var(--ak-yellow);
  color: #2A1024;
  font-weight: 800;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: 0 3px 0 #C49208;
}
.ak-turn-hint:disabled { opacity: .4; cursor: default; }
.ak-corner {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  background: linear-gradient(135deg, transparent 48%, #F2C01A 48%, #F06B1A 100%);
  box-shadow: -3px -3px 0 rgba(92,39,72,.12);
  z-index: 3;
  animation: cornerPulse 1.8s ease-in-out infinite;
  transform-origin: 100% 100%;
}
.ak-corner:hover {
  transform: scale(1.18);
  animation: none;
}
@keyframes cornerPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.12); filter: brightness(1.15); }
}
.ak-page-right { position: relative; }

.ak-lite {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 24px 16px 32px;
}
.ak-lite.is-on { display: grid; }
.ak-lite-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(242,192,26,.45), transparent 32%),
    radial-gradient(circle at 88% 16%, rgba(240,107,26,.4), transparent 36%),
    radial-gradient(circle at 50% 110%, rgba(122,58,104,.7), transparent 42%),
    #2A1024;
  animation: litePulse 8s ease-in-out infinite alternate;
}
.ak-lite-sky::before,
.ak-lite-sky::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 28px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: #F2C01A;
  opacity: .55;
  animation: balloon 7s ease-in-out infinite;
}
.ak-lite-sky::before { left: 12%; top: 18%; background: #F06B1A; animation-delay: -.8s; }
.ak-lite-sky::after { right: 14%; top: 28%; }
@keyframes litePulse {
  from { filter: saturate(1); }
  to { filter: saturate(1.25) brightness(1.06); }
}
@keyframes balloon {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-18px) rotate(8deg); }
}

.ak-lite-frame {
  position: relative;
  z-index: 2;
  max-width: min(92vw, 1100px);
  max-height: 86vh;
  padding: 14px;
  background: #fff;
  border: 10px solid #F2C01A;
  box-shadow:
    0 0 0 6px #5C2748,
    16px 16px 0 rgba(240, 107, 26, 0.45);
  animation: litePop .45s cubic-bezier(.2, 1.2, .3, 1);
}
@keyframes litePop {
  from { transform: scale(.82) rotate(-2deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.ak-lite-frame img {
  display: block;
  max-width: min(86vw, 1040px);
  max-height: 72vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #1A1018;
  animation: ken 18s ease-in-out infinite alternate;
  transform-origin: center;
}
@keyframes ken {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}
.ak-lite-cap {
  position: relative;
  z-index: 2;
  margin: 12px 0 0;
  font-family: var(--ak-font-title, "Bagel Fat One", Fredoka, sans-serif);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: #F2C01A;
  text-align: center;
}
.ak-lite-close,
.ak-lite-prev,
.ak-lite-next {
  position: relative;
  z-index: 3;
  border: 0;
  cursor: pointer;
  font-weight: 800;
}
.ak-lite-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #F2C01A;
  color: #2A1024;
  font-size: 1.5rem;
}
.ak-lite-prev,
.ak-lite-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #5C2748;
  color: #F2C01A;
  font-size: 1.8rem;
  border: 3px solid #F2C01A;
}
.ak-lite-prev { left: 12px; }
.ak-lite-next { right: 12px; }

.ak-album .party-zoom,
body.admin .party-zoom {
  border-radius: 8px;
}

@media (max-width: 820px) {
  .ak-album-stage { grid-template-columns: 1fr; }
  .ak-album-nav { justify-self: center; }
  .ak-spread:not([hidden]) {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ak-spine { display: none; }
  .ak-page-left,
  .ak-page-right {
    transform: none;
    border-radius: 8px;
  }
  .ak-page .ak-frame { aspect-ratio: 4 / 3; }
  .ak-book-shell { --ak-frame: 36px; }
  .ak-album-veil .ak-album { max-width: 96vw; }
}

.ak-album-dock {
  display: grid;
  gap: 12px;
  margin: 8px 0 16px;
}
.ak-album-thumbs {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.ak-thumb-frame {
  width: 88px;
  cursor: default;
}
.ak-thumb-frame > img:first-of-type {
  width: 100%;
  height: 62px;
  object-fit: cover;
  display: block;
}
.ak-album-veil {
  position: fixed;
  inset: 0;
  z-index: 120;
  background:
    radial-gradient(circle at 18% 16%, rgba(242,192,26,.35), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(240,107,26,.28), transparent 34%),
    #1a0c16;
  padding: 8px 6px 14px;
  overflow: auto;
}
.ak-album-veil[hidden] { display: none !important; }
.ak-album-veil .ak-album {
  max-width: min(980px, 96vw);
  margin: 0 auto;
  min-height: calc(100dvh - 24px);
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ak-album-veil .ak-book {
  min-height: 0;
}
.ak-album-veil .ak-page {
  min-height: min(46dvh, 480px);
}
.ak-album-veil .ak-page .ak-frame > img:first-of-type {
  height: 100%;
}

.ak-album-view {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 40% 30% at 50% 100%, rgba(240,107,26,.18), transparent 70%),
    linear-gradient(180deg, #3a1832 0%, #2A1024 100%);
  border-radius: 4px;
  padding: 18px 56px 42px;
}
.ak-album-view[hidden] { display: none !important; }
.ak-album-view > img[data-album-view-img] {
  max-width: 100%;
  max-height: min(58dvh, 680px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #1A1018;
  cursor: zoom-out;
}
.ak-view-cap {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 10px;
  margin: 0;
  text-align: center;
  color: #FFF6EB;
  font-weight: 800;
  font-size: .85rem;
  text-shadow: 0 2px 8px #2A1024;
}
.ak-view-close,
.ak-view-prev,
.ak-view-next {
  position: absolute;
  z-index: 4;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  border-radius: 50%;
}
.ak-view-close {
  top: 8px;
  right: 8px;
  width: 42px;
  height: 42px;
  background: #F2C01A;
  color: #2A1024;
  font-size: 1.6rem;
  box-shadow: 0 3px 0 #C49208;
}
.ak-view-prev,
.ak-view-next {
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  background: #5C2748;
  color: #F2C01A;
  font-size: 1.6rem;
  border: 3px solid #F2C01A;
}
.ak-view-prev { left: 6px; }
.ak-view-next { right: 6px; }
.ak-book.is-viewing .ak-spread { visibility: hidden; }
.ak-album-close {
  position: sticky;
  top: 8px;
  float: right;
  z-index: 3;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #F2C01A;
  color: #2A1024;
  font-size: 1.8rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #C49208;
}
body.ak-album-on { overflow: hidden; }

.ak-album-dock {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 18px 16px 16px;
  border-radius: 24px;
  border: 3px solid #2A1024;
  background:
    radial-gradient(ellipse 70% 55% at 12% 8%, rgba(242, 192, 26, .42), transparent 58%),
    radial-gradient(ellipse 65% 50% at 92% 92%, rgba(240, 107, 26, .38), transparent 55%),
    linear-gradient(165deg, #7A3A68 0%, #5C2748 46%, #2A1024 100%);
  background-size: 140% 140%, 150% 150%, 100% 100%;
  animation: ak-wash 12s ease-in-out infinite alternate;
  box-shadow: 0 8px 0 #C44E0E, 0 16px 32px rgba(42, 16, 36, .22);
}
.ak-album-dock .ak-album-open,
.ak-album-dock .hint,
.ak-album-dock .ak-album-thumbs { position: relative; z-index: 2; }
.ak-album-dock .hint { color: #FFF6EB; }
.ak-party-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ak-party-bg-veil { position: fixed; }
.ak-blob-y, .ak-blob-o, .ak-blob-p {
  position: absolute;
  border-radius: 50%;
  filter: blur(18px);
  opacity: .5;
  animation: ak-drift 7s ease-in-out infinite alternate;
}
.ak-blob-y { width: 180px; height: 180px; background: #F2C01A; top: -50px; right: -30px; }
.ak-blob-o { width: 160px; height: 160px; background: #F06B1A; bottom: -40px; left: -36px; animation-delay: -2.5s; }
.ak-blob-p { width: 120px; height: 120px; background: #B56A98; top: 42%; left: 38%; animation-delay: -4s; }
.ak-bal {
  position: absolute;
  width: 22px;
  height: 28px;
  border-radius: 50% 50% 50% 50% / 46% 46% 54% 54%;
  box-shadow: inset -4px -5px 0 rgba(42, 16, 36, .18);
  animation: ak-float 8s linear infinite;
}
.ak-bal::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 1.5px;
  height: 16px;
  background: rgba(255, 246, 235, .45);
}
.ak-bal-1 { background: #F2C01A; left: 12%; bottom: 4%; }
.ak-bal-2 { background: #F06B1A; right: 10%; left: auto; bottom: 14%; width: 18px; height: 24px; animation-delay: 1.8s; animation-duration: 9.5s; }
.ak-bal-3 { background: #9A5A86; left: 78%; bottom: 2%; width: 16px; height: 21px; animation-delay: 3.2s; animation-duration: 7.4s; }
.ak-bal-4 { background: #F2C01A; left: 6%; bottom: 32%; width: 14px; height: 18px; animation-delay: 5s; animation-duration: 10s; }
.ak-bal-5 { background: #F06B1A; left: 40%; bottom: 0; width: 20px; height: 26px; animation-delay: 2.2s; animation-duration: 11s; }
.ak-bal-6 { background: #F2C01A; left: 62%; bottom: 8%; width: 15px; height: 20px; animation-delay: 6s; animation-duration: 8.2s; }
.ak-spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #F2C01A;
  animation: ak-sparkle 1.6s ease-in-out infinite;
}
.ak-spark-1 { top: 18%; right: 16%; }
.ak-spark-2 { top: 58%; left: 10%; background: #F06B1A; animation-delay: .45s; }
.ak-spark-3 { bottom: 22%; right: 22%; background: #fff; animation-delay: .9s; }
@keyframes ak-wash {
  from { background-position: 0% 0%, 100% 100%, 0 0; }
  to { background-position: 28% 18%, 60% 72%, 0 0; }
}
@keyframes ak-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(16px, -12px) scale(1.12); }
}
@keyframes ak-float {
  0% { transform: translateY(28px) rotate(-8deg); opacity: 0; }
  14% { opacity: .95; }
  100% { transform: translateY(-240px) rotate(10deg); opacity: 0; }
}
@keyframes ak-sparkle {
  50% { transform: scale(1.6) rotate(20deg); opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
  .ak-album-dock, .ak-blob-y, .ak-blob-o, .ak-blob-p, .ak-bal, .ak-spark { animation: none; }
}

@media print {
  .ak-album, .ak-lite, .ak-album-veil, .ak-album-dock { display: none !important; }
}
