/* ==========================================================================
   Party Album
   Mobile components and compact breakpoints
   ========================================================================== */

@media (max-width: 760px) {
  .pa-page {
    width: 100%;
    margin-left: 0;
    overflow-x: hidden;
    background:
      radial-gradient(
        circle at 18% 0%,
        rgba(255, 74, 99, 0.18),
        transparent 34%
      ),
      linear-gradient(180deg, #18040c 0%, #0a0d18 58%, var(--pa-navy) 100%);
  }

  .pa-page::after {
    opacity: 0.016;
  }

  .pa-event-header {
    position: sticky;
    top: max(8px, env(safe-area-inset-top));
    left: auto;
    z-index: 220;
    width: calc(100% - 20px);
    margin: 8px auto 0;
    padding: 7px;
    border-radius: 18px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 34%),
      rgba(24, 4, 12, 0.92);
    transform: none;
  }

  .pa-event-header.is-scrolled {
    top: max(8px, env(safe-area-inset-top));
    transform: none;
  }

  .pa-brand {
    flex: 1 1 auto;
    gap: 8px;
  }

  .pa-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 17px;
  }

  .pa-brand strong {
    max-width: 44vw;
    font-size: 13px;
    letter-spacing: 0.05em;
  }

  .pa-brand small,
  .pa-header-link {
    display: none;
  }

  .pa-header-actions {
    gap: 7px;
    margin-left: auto;
  }

  .pa-header-button,
  .pa-logout-button {
    position: relative;
    min-height: 42px;
    border-radius: 15px;
    transform: translateZ(0);
    -webkit-tap-highlight-color: transparent;
  }

  .pa-header-button {
    width: auto;
    min-width: 98px;
    height: 42px;
    padding: 0 14px 0 11px;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
  }

  .pa-header-button::before {
    content: "+";
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff8ef;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
  }

  .pa-logout-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    border-color: rgba(255, 243, 223, 0.16);
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 44%),
      rgba(255, 255, 255, 0.055);
    color: rgba(255, 243, 223, 0.88);
    font-size: 0;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      0 10px 28px rgba(0, 0, 0, 0.2);
  }

  .pa-logout-button::before {
    content: "";
    width: 17px;
    height: 17px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M160 96c17.7 0 32-14.3 32-32s-14.3-32-32-32H96C43 32 0 75 0 128v256c0 53 43 96 96 96h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H96c-17.7 0-32-14.3-32-32V128c0-17.7 14.3-32 32-32h64zm342.6 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l73.4 73.4H192c-17.7 0-32 14.3-32 32s14.3 32 32 32h210.7l-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z'/%3E%3C/svg%3E")
      center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M160 96c17.7 0 32-14.3 32-32s-14.3-32-32-32H96C43 32 0 75 0 128v256c0 53 43 96 96 96h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H96c-17.7 0-32-14.3-32-32V128c0-17.7 14.3-32 32-32h64zm342.6 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l73.4 73.4H192c-17.7 0-32 14.3-32 32s14.3 32 32 32h210.7l-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z'/%3E%3C/svg%3E")
      center / contain no-repeat;
  }

  .pa-header-button:active,
  .pa-logout-button:active {
    transform: scale(0.96);
  }

  .pa-event-hero {
    min-height: auto;
    margin-top: -58px;
    padding: 118px 16px 30px;
    background:
      linear-gradient(
        180deg,
        rgba(10, 3, 9, 0.96) 0%,
        rgba(16, 4, 11, 0.84) 48%,
        #120711 100%
      ),
      var(--pa-hero-image, linear-gradient(135deg, #17030b, var(--pa-navy)));
    background-position: center;
    background-size: cover;
  }

  .pa-event-hero::before,
  .pa-event-hero::after,
  .pa-event-hero-content::before {
    display: none;
  }

  .pa-hero-inner {
    display: block;
    min-height: auto;
    opacity: 1 !important;
    transform: none !important;
  }

  .pa-event-hero-content {
    max-width: 480px;
    margin: 0 auto;
  }

  .pa-event-hero .pa-kicker,
  .pa-auth-card .pa-kicker {
    justify-content: center;
  }

  .pa-event-hero .pa-kicker::before,
  .pa-auth-card .pa-kicker::before {
    display: none;
  }

  .pa-kicker {
    gap: 8px;
    margin-bottom: 14px;
    font-size: 12px;
    letter-spacing: 0.14em;
  }

  .pa-event-hero h1,
  .pa-auth-card h1 {
    margin-right: auto;
    margin-left: auto;
    letter-spacing: 0;
    overflow-wrap: normal;
    text-wrap: balance;
  }

  .pa-event-hero h1 {
    max-width: 9.5ch;
    font-size: clamp(44px, 12.5vw, 64px);
    line-height: 0.98;
  }

  .pa-event-hero h1 span {
    display: block;
    margin-top: 0.03em;
  }

  .pa-hero-text {
    max-width: 32rem;
    margin: 18px auto 0;
    color: rgba(255, 243, 223, 0.78);
    font-size: 15px;
    line-height: 1.55;
  }

  .pa-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 22px;
  }

  .pa-main-button,
  .pa-ghost-button,
  .pa-toolbar-button,
  .pa-submit-button,
  .pa-empty-album button {
    width: 100%;
    min-height: 52px;
    padding: 14px 18px;
    border-radius: 16px;
  }

  .pa-main-button,
  .pa-ghost-button {
    justify-content: space-between;
  }

  .pa-hero-collage {
    display: grid;
    gap: 8px;
    max-width: 480px;
    min-height: 0;
    margin: 24px auto 0;
    perspective: none;
  }

  .pa-collage-card,
  .pa-collage-card-1,
  .pa-collage-card-2,
  .pa-collage-card-3,
  .pa-collage-card-4,
  .pa-collage-card-5,
  .pa-collage-card-6 {
    position: relative;
    inset: auto;
    display: block;
    width: auto;
    height: auto;
    border-radius: 14px;
    aspect-ratio: 1 / 1.08;
    opacity: 1;
    transform: none !important;
    animation: none;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.36);
  }

  .pa-collage-card:nth-of-type(n + 4) {
    display: none;
  }

  .pa-collage-empty {
    position: relative;
    inset: auto;
    min-height: 190px;
    padding: 22px;
    border-radius: 18px;
  }

  .pa-collage-empty strong {
    font-size: 36px;
  }

  .pa-album-section {
    padding: 14px 12px 88px;
    background:
      radial-gradient(
        circle at 50% 0%,
        rgba(255, 226, 155, 0.1),
        transparent 24%
      ),
      linear-gradient(180deg, #120711 0%, var(--pa-navy) 100%);
  }

  .pa-album-toolbar {
    position: static;
    display: block;
    margin: 0 0 14px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: none;
    backdrop-filter: blur(14px);
  }

  .pa-album-toolbar .pa-kicker {
    margin-bottom: 8px;
  }

  .pa-album-toolbar h2 {
    font-size: clamp(36px, 12vw, 50px);
    line-height: 1;
  }

  .pa-toolbar-meta {
    margin-top: 10px;
  }

  .pa-toolbar-meta span {
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 10px;
  }

  .pa-toolbar-button {
    margin-top: 14px;
    white-space: normal;
  }

  .pa-photo-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 0px;
  }

  .pa-photo-card,
  .pa-photo-card:nth-child(12n + 1),
  .pa-photo-card:nth-child(12n + 4),
  .pa-photo-card:nth-child(12n + 6),
  .pa-photo-card:nth-child(12n + 9),
  .pa-photo-card:nth-child(12n + 11),
  .pa-photo-card:nth-child(8n + 1),
  .pa-photo-card:nth-child(6n + 1) {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 0;
    border-radius: 14px;
    aspect-ratio: 1 / 1.18;
    transform: none;
  }

  .pa-photo-card:nth-child(5n + 1) {
    grid-column: span 2;
    aspect-ratio: 16 / 10;
  }

  .pa-photo-card:hover {
    transform: none !important;
  }

  .pa-photo-img,
  .pa-photo-card:hover .pa-photo-img {
    filter: saturate(1.02) contrast(1.02) brightness(0.96);
    transform: none !important;
  }

  .pa-photo-overlay {
    display: none;
  }

  .pa-empty-album {
    min-height: 300px;
    padding: 28px 18px;
    border-radius: 18px;
    margin-top: 0px;
  }

  .pa-empty-album h3 {
    font-size: clamp(34px, 12vw, 50px);
    line-height: 1;
  }

  .pa-floating-add {
    display: grid;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    border-radius: 18px;
  }

  .pa-toast {
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13px;
  }

  .pa-upload-modal,
  .pa-lightbox {
    padding: max(14px, env(safe-area-inset-top)) 14px
      max(14px, env(safe-area-inset-bottom));
  }

  .pa-upload-panel {
    width: min(100%, 430px);
    max-height: min(86dvh, 620px);
    padding: 22px 18px;
    border-radius: 24px;
    animation-name: pa-mobile-modal-in;
  }

  @keyframes pa-mobile-modal-in {
    from {
      opacity: 0;
      transform: translateY(14px) scale(0.97);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .pa-upload-panel .pa-kicker {
    margin-right: 46px;
    font-size: 11px;
  }

  .pa-upload-panel h2 {
    font-size: clamp(34px, 11vw, 50px);
    line-height: 1;
  }

  .pa-modal-text {
    margin: 14px 0 18px;
    font-size: 14px;
    line-height: 1.5;
  }

  .pa-close-button {
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
  }

  .pa-dropzone {
    min-height: 116px;
    padding: 20px 14px;
    border-radius: 18px;
  }

  .pa-dropzone span {
    font-size: 18px;
  }

  .pa-lightbox {
    padding: 0;
  }

  .pa-lightbox img {
    max-width: 100vw;
    max-height: 78dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .pa-lightbox-close {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    width: 42px;
    height: 42px;
  }

  .pa-lightbox-nav {
    display: none;
  }

  .pa-auth-page {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 100dvh;
    margin-left: 0;
    padding: max(14px, env(safe-area-inset-top)) 14px
      max(14px, env(safe-area-inset-bottom));
  }

  .pa-auth-card {
    width: min(100%, 440px);
    padding: 22px;
    border-radius: 24px;
  }

  .pa-auth-mark {
    width: 46px;
    height: 46px;
    margin: 0 auto 16px;
    border-radius: 15px;
    font-size: 22px;
  }

  .pa-auth-card .pa-kicker {
    display: flex;
    max-width: 100%;
    margin: 0 0 13px;
    white-space: normal;
  }

  .pa-auth-card h1 {
    font-size: clamp(38px, 11.5vw, 56px);
    line-height: 1;
  }

  .pa-auth-text {
    margin: 16px 0 18px;
    font-size: 14px;
    line-height: 1.52;
  }

  .pa-auth-alert {
    margin: -4px 0 16px;
    padding: 11px 12px;
    border-radius: 13px;
    font-size: 12px;
  }

  .pa-auth-form form {
    gap: 12px;
  }

  .pa-auth-form label {
    margin-bottom: 6px;
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .pa-auth-form input[type="text"],
  .pa-auth-form input[type="password"] {
    height: 50px;
    padding: 0 14px;
    border-radius: 15px;
    font-size: 16px;
  }

  .pa-auth-form .login-remember label {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    font-size: 13px;
    line-height: 1.25;
  }

  .pa-auth-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
  }

  .pa-auth-form input[type="submit"] {
    min-height: 52px;
    border-radius: 16px;
    font-size: 14px;
    white-space: normal;
  }
}

@media (max-width: 430px) {
  .pa-event-header {
    width: calc(100% - 16px);
  }

  .pa-brand strong {
    display: none;
  }

  .pa-header-actions {
    gap: 6px;
  }

  .pa-header-button {
    min-width: 88px;
    height: 40px;
    min-height: 40px;
    padding: 0 12px 0 9px;
    font-size: 11px;
  }

  .pa-header-button::before {
    flex-basis: 20px;
    width: 20px;
    height: 20px;
    border-radius: 8px;
    font-size: 17px;
  }

  .pa-logout-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .pa-event-hero {
    padding-right: 12px;
    padding-left: 12px;
  }

  .pa-event-hero h1 {
    max-width: 9ch;
    font-size: clamp(40px, 12vw, 56px);
  }

  .pa-collage-card:nth-of-type(3) {
    display: none;
  }

  .pa-photo-wall {
    gap: 8px;
  }

  .pa-photo-card,
  .pa-photo-card:nth-child(12n + 1),
  .pa-photo-card:nth-child(12n + 4),
  .pa-photo-card:nth-child(12n + 6),
  .pa-photo-card:nth-child(12n + 9),
  .pa-photo-card:nth-child(12n + 11),
  .pa-photo-card:nth-child(8n + 1),
  .pa-photo-card:nth-child(6n + 1) {
    border-radius: 12px;
  }

  .pa-auth-page {
    place-items: start center;
    padding: max(12px, env(safe-area-inset-top)) 10px
      max(12px, env(safe-area-inset-bottom));
  }

  .pa-auth-card {
    padding: 20px;
    border-radius: 22px;
  }

  .pa-auth-card h1 {
    max-width: 9.5ch;
    font-size: clamp(36px, 11vw, 50px);
  }

  .pa-auth-text {
    font-size: 13px;
  }
}

@media (max-width: 380px), (max-height: 680px) and (max-width: 760px) {
  .pa-upload-modal {
    padding: max(10px, env(safe-area-inset-top)) 10px
      max(10px, env(safe-area-inset-bottom));
  }

  .pa-upload-panel {
    max-height: calc(100dvh - 20px);
    padding: 18px 16px;
    border-radius: 20px;
  }

  .pa-upload-panel .pa-kicker {
    margin-bottom: 8px;
  }

  .pa-upload-panel h2 {
    font-size: clamp(30px, 10vw, 44px);
  }

  .pa-modal-text {
    margin: 10px 0 14px;
  }

  .pa-dropzone {
    min-height: 104px;
    padding: 16px 12px;
  }

  .pa-auth-page {
    place-items: start center;
  }

  .pa-auth-card {
    padding: 17px;
    border-radius: 20px;
  }

  .pa-auth-mark {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    font-size: 19px;
  }

  .pa-auth-card .pa-kicker {
    margin-bottom: 10px;
    font-size: 10px;
  }

  .pa-auth-card h1 {
    font-size: clamp(33px, 10vw, 44px);
    line-height: 1.02;
  }

  .pa-auth-text {
    margin: 12px 0 14px;
    line-height: 1.42;
  }

  .pa-auth-alert {
    margin-bottom: 12px;
  }

  .pa-auth-form form {
    gap: 10px;
  }

  .pa-auth-form input[type="text"],
  .pa-auth-form input[type="password"],
  .pa-auth-form input[type="submit"] {
    min-height: 46px;
  }
}

@media (max-width: 360px) {
  .pa-event-hero h1 {
    max-width: 9ch;
    font-size: clamp(36px, 11vw, 48px);
    line-height: 1.02;
  }

  .pa-main-button,
  .pa-ghost-button,
  .pa-toolbar-button,
  .pa-submit-button {
    font-size: 13px;
  }

  .pa-header-button {
    width: 42px;
    min-width: 42px;
    padding: 0;
    font-size: 0;
  }

  .pa-header-button::before {
    flex-basis: 22px;
    width: 22px;
    height: 22px;
    margin: 0;
  }

  .pa-photo-wall {
    grid-template-columns: 1fr;
  }

  .pa-photo-card,
  .pa-photo-card:nth-child(5n + 1) {
    grid-column: span 1;
    aspect-ratio: 4 / 5;
  }
}
