:root {
  --ffp-black: #252525;
  --ffp-ink: #2B2B2B;
  --ffp-white: #FFFFFF;
  --ffp-muted: #7A7A7A;
  --ffp-accent: #702C90;
  --ffp-accent-bright: #BE35FF;
  --ffp-wash: #F6F6F6;
  --ffp-line: #E6E6E6;
  --ffp-cream: #FFFBF1;
  --radius: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ffp-black);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(190, 53, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(112, 44, 144, 0.22), transparent 50%),
    linear-gradient(180deg, #1a1a1a 0%, #252525 42%, #111 100%);
}

a { color: var(--ffp-accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ffp-white);
  text-decoration: none;
}

.brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-text span {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}

.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  min-height: 44px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--ffp-accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(112, 44, 144, 0.35);
}

.btn-primary:hover { background: #5c2278; }

.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
}

.btn-ghost:hover { background: rgba(255,255,255,0.14); }

.btn-light {
  background: #fff;
  color: var(--ffp-accent);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.hero {
  color: #fff;
  margin-bottom: 28px;
  max-width: 720px;
}

.hero .eyebrow {
  color: var(--ffp-accent-bright);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 10px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  text-transform: capitalize;
  line-height: 1.1;
}

.hero p {
  margin: 0;
  color: rgba(255,255,255,0.78);
  font-size: 1.05rem;
  line-height: 1.55;
}

.panel {
  background: var(--ffp-white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.toolbar input,
.toolbar select,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--ffp-line);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  min-height: 44px;
  color: var(--ffp-black);
  background: #fff;
}

.toolbar input,
.toolbar select {
  width: auto;
  min-width: 180px;
  flex: 1;
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ffp-ink);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.album-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ffp-line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.album-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(37, 37, 37, 0.12);
}

.album-cover {
  aspect-ratio: 16 / 11;
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

.album-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.album-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.album-title-row h2 {
  margin: 0;
  font-size: 1.2rem;
  text-transform: capitalize;
  line-height: 1.2;
}

.album-cta {
  margin-top: 4px;
  color: var(--ffp-accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.card {
  border: 1px solid var(--ffp-line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.frame {
  position: relative;
  background: #111;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.35), transparent 40%);
  pointer-events: none;
}

.card-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-body h3 {
  margin: 0;
  font-size: 1.05rem;
  text-transform: capitalize;
}

.meta {
  color: var(--ffp-muted);
  font-size: 0.9rem;
}

.price {
  font-weight: 700;
  color: var(--ffp-accent);
  font-size: 1.1rem;
}

.price.not-for-sale {
  color: var(--ffp-muted);
  font-weight: 600;
}

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--ffp-muted);
}

.status {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
}

.status.error { background: #fde8e8; color: #8a1f1f; }
.status.ok { background: #e8f8ef; color: #176b3a; }
.status.info { background: #f3eaff; color: #4b1f6b; }

.footer-note {
  margin-top: 28px;
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
  text-align: center;
}

.buy-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
}

@media (max-width: 860px) {
  .buy-layout { grid-template-columns: 1fr; }
  .brand-text strong { font-size: 0.92rem; }
}

@media (max-width: 720px) {
  html, body { overflow-x: clip; }
  .site-shell { padding: 16px 14px 48px; }
  .panel { padding: 16px; }
  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
  }
  .brand { min-width: 0; flex: 1 1 auto; }
  .brand img { width: 48px; height: 48px; }
  .brand-text strong {
    overflow-wrap: anywhere;
    font-size: 0.82rem;
  }
  .nav-links { width: 100%; }
  .nav-links .btn { flex: 1 1 calc(50% - 10px); }
  .hero h1 { font-size: clamp(1.7rem, 8vw, 2.4rem); }
  .hero p { font-size: 0.98rem; }
  .album-grid,
  .grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .toolbar input,
  .toolbar select {
    width: 100%;
    min-width: 0;
    flex: 1 1 100%;
  }
  .album-title-row h2,
  .card-body h3 { overflow-wrap: anywhere; }
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.admin-tabs button {
  border: 1px solid var(--ffp-line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}

.admin-tabs button.active {
  background: var(--ffp-accent);
  border-color: var(--ffp-accent);
  color: #fff;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--ffp-line);
  vertical-align: top;
}

th { color: var(--ffp-muted); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.paid { background: #e8f8ef; color: #176b3a; }
.badge.failed { background: #fde8e8; color: #8a1f1f; }
.badge.pending { background: #fff6df; color: #8a6a00; }
.badge.yes { background: #f3eaff; color: #4b1f6b; }

.thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #111;
  pointer-events: none;
  -webkit-user-drag: none;
}

.login-card {
  max-width: 420px;
  margin: 8vh auto 0;
}

#card-container {
  min-height: 90px;
  margin: 8px 0 16px;
  padding: 8px;
  border: 1px solid var(--ffp-line);
  border-radius: 8px;
}

.frame-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
}

.frame-button:focus-visible {
  outline: 2px solid var(--ffp-accent-bright);
  outline-offset: 2px;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 12, 0.88);
  backdrop-filter: blur(4px);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #171717;
  border: 1px solid rgba(190, 53, 255, 0.28);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  padding: 18px 18px 14px;
  color: #fff;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(112, 44, 144, 0.85);
}

.lightbox-nav {
  position: absolute;
  top: 42%;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav:hover {
  background: var(--ffp-accent);
}

.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  background: #0b0b0b;
  border-radius: 12px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: min(68vh, 820px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

.lightbox-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.lightbox-meta h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  text-transform: capitalize;
}

.lightbox-meta .meta {
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 6px;
}

.lightbox-meta .price {
  margin: 0;
  color: #BE35FF;
}

.lightbox-note {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
}

.lightbox-credit {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.01em;
}

@media (max-width: 640px) {
  .lightbox {
    padding: 0;
    align-items: stretch;
  }

  .lightbox-dialog {
    width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    padding: 8px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    overflow: auto;
  }

  .lightbox-stage {
    flex: 1 1 auto;
    min-height: 180px;
  }

  .lightbox-stage img {
    max-height: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .lightbox-nav {
    top: 38%;
    bottom: auto;
  }

  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }

  .lightbox-meta {
    align-items: stretch;
    flex: 0 0 auto;
  }

  .lightbox-meta .btn {
    width: 100%;
  }
}
