/* =========================================================
   v5: Navbar layout fix, Vote page, Discord section, moderation status
   Loaded after styles.css and pages.css so these rules win.
   ========================================================= */

/* ---------- Navbar: three columns, links never overlap the logo ---------- */
.navbar-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}
.brand { flex-shrink: 0; }
.brand-text { white-space: nowrap; }

.nav-links {
  flex: initial;
  min-width: 0;
  justify-content: center;
  gap: 0.35rem;
}
.nav-group {
  flex: 0 1 auto;
  gap: 0.15rem;
}
.nav-links a {
  font-size: 0.88rem;
  padding: 0.42rem 0.62rem;
}
.nav-links a.nav-store-pill { margin: 0 0.35rem; }
.nav-links a.nav-vote-link {
  color: var(--gold);
}
.nav-links a.nav-vote-link:hover,
.nav-links a.nav-vote-link.active {
  color: #1a1404;
  background: var(--gold);
}
.nav-actions { grid-column: 3; }

@media (max-width: 1400px) {
  .nav-actions .hide-tablet { display: none; }
}

@media (max-width: 1180px) {
  .mobile-menu-btn { display: flex; }
  .navbar-inner { grid-template-columns: auto 1fr auto; }
  .nav-links {
    display: none;
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 4%;
    gap: 0.4rem;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55);
    max-height: calc(100dvh - 74px);
    overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-group { flex-direction: column; align-items: stretch; gap: 0.3rem; }
  .nav-links a { padding: 0.65rem 0.85rem; font-size: 0.95rem; }
  .nav-links a.nav-store-pill { margin: 0.2rem 0; text-align: center; order: -1; }
  .nav-mobile-only { display: block; }
}

@media (max-width: 420px) {
  .brand-meta { display: none; }
}

/* ---------- Discord "Barangay Hall" section ---------- */
.discord-hall-section { padding-top: 1rem; }
.discord-hall {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 2.2rem;
  align-items: center;
  padding: 2.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(88, 101, 242, 0.35);
  background:
    radial-gradient(circle at 100% 0%, rgba(88, 101, 242, 0.28), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(56, 216, 100, 0.12), transparent 45%),
    linear-gradient(135deg, #111a2e 0%, #0e1524 100%);
  position: relative;
  overflow: hidden;
}
.discord-hall::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.discord-hall > * { position: relative; z-index: 1; }
.discord-hall-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  color: #c7ccff;
  background: rgba(88, 101, 242, 0.18);
  border: 1px solid rgba(88, 101, 242, 0.4);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}
.discord-hall-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  margin: 0.8rem 0 0.7rem;
}
.discord-hall-copy h2 span { display: block; color: #a5b0ff; }
.discord-hall-copy p { color: var(--text-muted); max-width: 560px; margin: 0 0 1.4rem; }
.discord-hall-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
.discord-hall-online { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.88rem; color: #d1fae5; }
.discord-hall-dot { width: 9px; height: 9px; border-radius: 50%; background: #23a55a; box-shadow: 0 0 0 4px rgba(35, 165, 90, 0.2); }

.discord-hall-panel {
  background: rgba(8, 12, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 1.1rem;
  backdrop-filter: blur(6px);
}
.discord-hall-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; padding: 0.2rem 0.3rem 0.8rem; border-bottom: 1px solid var(--border); margin-bottom: 0.8rem; }
.discord-hall-panel-head strong { font-family: var(--font-display); font-size: 1.05rem; }
.discord-hall-panel-head span { color: var(--text-dim); font-size: 0.78rem; }
.discord-hall-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 0.8rem; }
.discord-hall-stats > div { background: rgba(255, 255, 255, 0.04); border-radius: 10px; padding: 0.6rem 0.75rem; }
.discord-hall-stats span { display: block; font-size: 0.72rem; color: var(--text-muted); }
.discord-hall-stats strong { font-size: 1.3rem; font-weight: 700; }
.discord-hall-stats strong.is-online { color: #4ade80; }
.discord-hall-channels { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.discord-hall-channels li { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.65rem; border-radius: 10px; transition: background 0.15s ease; }
.discord-hall-channels li:hover { background: rgba(88, 101, 242, 0.12); }
.discord-hall-hash { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: rgba(88, 101, 242, 0.2); color: #c7ccff; flex-shrink: 0; }
.discord-hall-channels strong { display: block; font-size: 0.9rem; }
.discord-hall-channels li span:not(.discord-hall-hash) { display: block; font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Vote page ---------- */
.vote-hero-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.vote-name-box { margin-top: 1.3rem; max-width: 520px; }
.vote-name-box label { display: block; font-size: 0.82rem; font-weight: 700; color: #d0dcf0; margin-bottom: 0.35rem; }
.vote-name-row { display: flex; gap: 0.5rem; }
.vote-name-row input { flex: 1; min-width: 0; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: 10px; color: var(--text-main); font-family: var(--font-sans); font-size: 0.95rem; padding: 0.7rem 0.9rem; }
.vote-name-row input:focus { outline: none; border-color: var(--emerald); }
.vote-name-box small { display: block; color: var(--text-dim); font-size: 0.76rem; margin-top: 0.4rem; }

.vote-rewards-card { background: linear-gradient(160deg, rgba(250, 204, 21, 0.12), rgba(250, 204, 21, 0.03)); border: 1px solid rgba(250, 204, 21, 0.35); border-radius: var(--radius-md); padding: 1.3rem; }
.vote-rewards-list { list-style: none; margin: 0.6rem 0 0.9rem; padding: 0; display: grid; gap: 0.6rem; }
.vote-rewards-list li { display: flex; align-items: center; gap: 0.8rem; background: rgba(8, 12, 22, 0.55); border-radius: 12px; padding: 0.75rem 0.85rem; }
.vote-reward-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: rgba(250, 204, 21, 0.18); color: var(--gold); flex-shrink: 0; }
.vote-rewards-list strong { display: block; font-family: var(--font-display); font-size: 1.1rem; }
.vote-rewards-list span { font-size: 0.8rem; color: var(--text-muted); }
.vote-rewards-note { font-size: 0.78rem; color: #e6d7a0; margin: 0; line-height: 1.5; }

.vote-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.5rem; align-items: start; }
.vote-main { display: grid; gap: 1.2rem; min-width: 0; }
.vote-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.vote-section-head h2 { font-family: var(--font-display); margin: 0; font-size: 1.4rem; }
.vote-section-head p { margin: 0.2rem 0 0; color: var(--text-muted); font-size: 0.86rem; }
.vote-progress { display: flex; gap: 0.3rem; }
.vote-progress span { width: 30px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.vote-progress span.done { background: var(--emerald); }

.vote-sites { display: grid; gap: 0.6rem; }
.vote-site { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 0.9rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 0.85rem 1rem; transition: border-color 0.2s ease; }
.vote-site:hover { border-color: var(--border-strong); }
.vote-site.is-done { opacity: 0.75; }
.vote-site-num { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; background: rgba(56, 216, 100, 0.14); color: var(--emerald); }
.vote-site.is-done .vote-site-num { background: var(--emerald); color: #06140b; }
.vote-site-info strong { display: block; }
.vote-site-info span { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; color: var(--text-dim); }
.vote-site-info em { font-style: normal; color: var(--emerald); }
.vote-site-status { font-size: 0.7rem; font-weight: 800; padding: 0.18rem 0.55rem; border-radius: 999px; white-space: nowrap; border: 1px solid var(--border); color: var(--text-muted); }
.vote-site-status.live { color: #4ade80; border-color: rgba(74, 222, 128, 0.4); background: rgba(74, 222, 128, 0.1); }
.vote-site-status.unavailable { color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); }

.vote-recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.6rem; margin: 0.6rem 0; }
.vote-recent-item { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.6rem 0.4rem; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border); text-align: center; }
.vote-recent-item img { width: 40px; height: 40px; border-radius: 8px; image-rendering: pixelated; }
.vote-recent-item strong { font-size: 0.8rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.vote-recent-item span { font-size: 0.7rem; color: var(--text-dim); }

.vote-side { position: sticky; top: 92px; }
.vote-top-card { background: linear-gradient(180deg, #142035 0%, var(--bg-surface) 100%); }
.vote-refresh { background: transparent; border: 1px solid var(--border); color: var(--text-muted); width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.vote-refresh:hover { color: var(--emerald); border-color: var(--emerald); }
.vote-podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 0.4rem; margin: 1rem 0 0.8rem; }
.vote-podium-spot { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.vote-podium-spot img { height: 92px; width: auto; image-rendering: pixelated; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5)); }
.vote-podium-base { width: 100%; border-radius: 10px 10px 4px 4px; padding: 0.45rem 0.3rem; background: var(--bg-card); border: 1px solid var(--border); }
.vote-podium-spot.place-1 .vote-podium-base { min-height: 92px; border-color: rgba(250, 204, 21, 0.55); background: linear-gradient(180deg, rgba(250, 204, 21, 0.2), var(--bg-card)); }
.vote-podium-spot.place-2 .vote-podium-base { min-height: 74px; border-color: rgba(203, 213, 225, 0.4); }
.vote-podium-spot.place-3 .vote-podium-base { min-height: 62px; border-color: rgba(251, 146, 60, 0.45); }
.vote-podium-spot.place-1 img { height: 112px; }
.vote-podium-base span { display: block; font-family: var(--font-display); font-weight: 700; font-size: 0.8rem; color: var(--text-muted); }
.vote-podium-spot.place-1 .vote-podium-base span { color: var(--gold); }
.vote-podium-base strong { display: block; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-podium-base em { font-style: normal; font-size: 0.74rem; color: var(--text-muted); }
.vote-top-list { list-style: none; margin: 0 0 0.8rem; padding: 0; display: grid; gap: 0.3rem; }
.vote-top-list li { display: flex; align-items: center; gap: 0.55rem; padding: 0.4rem 0.5rem; border-radius: 8px; background: rgba(255, 255, 255, 0.03); font-size: 0.86rem; }
.vote-top-list img { width: 24px; height: 24px; border-radius: 5px; image-rendering: pixelated; }
.vote-top-list a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.vote-top-list a:hover { color: var(--emerald); }
.vote-top-rank { width: 30px; color: var(--text-dim); font-size: 0.78rem; font-weight: 700; }
.vote-top-list strong { font-variant-numeric: tabular-nums; }
.vote-top-foot { display: flex; gap: 0.4rem; align-items: flex-start; font-size: 0.74rem; color: var(--text-dim); margin: 0 0 0.8rem; line-height: 1.5; }

/* ---------- Leaderboard additions ---------- */
.lb-source { display: block; margin-top: 0.25rem; font-size: 0.76rem; color: var(--text-dim); }
.lb-empty { display: grid; justify-items: center; gap: 0.8rem; }
.lb-empty p { margin: 0; }

/* ---------- Moderation status ---------- */
.charpage-badge.banned { color: #fca5a5; border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.14); }
.charpage-badge.good-standing { color: #86efac; border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.08); }
.moderation-card.is-banned { border-color: rgba(239, 68, 68, 0.5); background: linear-gradient(180deg, rgba(239, 68, 68, 0.1), var(--bg-surface)); }
.moderation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.6rem; margin-top: 0.6rem; }
.moderation-item { padding: 0.7rem 0.85rem; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border); border-left-width: 3px; }
.moderation-item span { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.moderation-item strong { font-family: var(--font-display); font-size: 1.05rem; }
.moderation-item em { display: block; font-style: normal; font-size: 0.76rem; color: var(--text-muted); margin-top: 0.15rem; }
.moderation-item.good { border-left-color: #4ade80; }
.moderation-item.warn { border-left-color: #fbbf24; }
.moderation-item.bad { border-left-color: #f87171; }
.moderation-item.bad strong { color: #fca5a5; }
.moderation-appeal { margin: 0.7rem 0 0; font-size: 0.82rem; color: var(--text-muted); }
.moderation-appeal a { color: var(--emerald); text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .vote-layout { grid-template-columns: 1fr; }
  .vote-side { position: static; }
}
@media (max-width: 920px) {
  .discord-hall, .vote-hero-grid { grid-template-columns: 1fr; }
  .discord-hall { padding: 1.6rem; }
}
@media (max-width: 600px) {
  .vote-site { grid-template-columns: auto minmax(0, 1fr); }
  .vote-site-status { grid-column: 2; justify-self: start; }
  .vote-site .btn { grid-column: 1 / -1; width: 100%; }
}

/* Donation goal banner on the Store page */
.store-page-wrapper .donation-goal-section { padding: 2rem 0 0.25rem; }

/* =========================================================
   Community Photos: Gallery page, homepage section, upload form
   ========================================================= */
.gallery-hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.gallery-upload-cta { margin-top: 1.3rem; }
.gallery-guidelines { background: rgba(56, 216, 100, 0.06); border: 1px solid rgba(56, 216, 100, 0.3); border-radius: var(--radius-md); padding: 1.1rem 1.2rem; }
.gallery-guidelines > strong { display: flex; align-items: center; gap: 0.45rem; font-family: var(--font-display); color: var(--emerald); margin-bottom: 0.6rem; }
.gallery-guidelines ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.gallery-guidelines li { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.84rem; color: #d0dcf0; line-height: 1.45; }
.gallery-guidelines li svg { color: var(--emerald); flex-shrink: 0; margin-top: 0.2rem; }
.gallery-guidelines.compact { padding: 0.75rem 0.9rem; margin-bottom: 0.2rem; max-height: 180px; overflow-y: auto; }
.gallery-guidelines.compact > strong { font-size: 0.86rem; margin-bottom: 0.35rem; }
.gallery-guidelines.compact ul { list-style: disc; padding-left: 1.1rem; gap: 0.25rem; }
.gallery-guidelines.compact li { display: list-item; font-size: 0.78rem; }

.gallery-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.gallery-sort { display: inline-flex; background: var(--bg-deep); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.gallery-sort .range-btn { display: inline-flex; align-items: center; gap: 0.3rem; background: transparent; border: none; color: var(--text-muted); font-family: var(--font-sans); font-weight: 700; font-size: 0.8rem; padding: 0.4rem 0.7rem; border-radius: 6px; cursor: pointer; }
.gallery-sort .range-btn.active { background: var(--bg-elevated); color: var(--emerald); }
.gallery-empty { display: grid; justify-items: center; gap: 0.7rem; color: var(--text-muted); }
.gallery-empty p { margin: 0; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.photo-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.18s ease, border-color 0.2s ease; }
.photo-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.photo-card-media { position: relative; display: block; width: 100%; padding: 0; border: none; background: var(--bg-deep); cursor: zoom-in; aspect-ratio: 4 / 3; overflow: hidden; }
.photo-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.photo-card:hover .photo-card-media img { transform: scale(1.04); }
.photo-card-cat { position: absolute; left: 0.6rem; top: 0.6rem; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.18rem 0.55rem; border-radius: 999px; background: rgba(8, 12, 22, 0.78); color: #e5e7eb; }
.photo-card-cat.static { position: static; margin-left: auto; }
.photo-card-body { padding: 0.75rem 0.85rem 0.9rem; display: grid; gap: 0.45rem; }
.photo-card-body p { margin: 0; font-size: 0.84rem; color: var(--text-muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.photo-card-author { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.photo-card-author > img { width: 32px; height: 32px; border-radius: 7px; image-rendering: pixelated; flex-shrink: 0; }
.photo-card-author > div { min-width: 0; flex: 1; }
.photo-card-author strong { display: block; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-card-author span { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.72rem; color: #a5b4fc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.photo-like-btn { display: inline-flex; align-items: center; gap: 0.35rem; flex-shrink: 0; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); color: var(--text-muted); border-radius: 999px; padding: 0.32rem 0.65rem; font-family: var(--font-sans); font-weight: 700; font-size: 0.8rem; cursor: pointer; transition: all 0.15s ease; }
.photo-like-btn:hover { border-color: rgba(244, 114, 182, 0.6); color: #f9a8d4; }
.photo-like-btn.is-liked { color: #f472b6; border-color: rgba(244, 114, 182, 0.55); background: rgba(244, 114, 182, 0.12); }
.photo-like-btn.is-liked svg { animation: bcPop 0.25s ease; }
@keyframes bcPop { 50% { transform: scale(1.3); } }

.community-photos-section { padding-top: 1rem; }
.community-photos-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.community-photos-head h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0.2rem 0 0.3rem; }
.community-photos-head p { margin: 0; color: var(--text-muted); }
.community-photos-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.photo-grid.home { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.gallery-upload-modal { width: min(620px, 100%); }
.gallery-upload-title { font-family: var(--font-display); margin: 0.15rem 2rem 0.9rem 0; }
.gallery-dropzone { width: 100%; display: flex; align-items: center; justify-content: center; min-height: 170px; margin-bottom: 0.9rem; border: 2px dashed rgba(255, 255, 255, 0.16); border-radius: 12px; background: var(--bg-deep); color: var(--text-muted); cursor: pointer; padding: 0; overflow: hidden; font-family: var(--font-sans); transition: border-color 0.15s ease; }
.gallery-dropzone:hover { border-color: var(--emerald); }
.gallery-dropzone span { display: grid; justify-items: center; gap: 0.35rem; padding: 1.2rem; }
.gallery-dropzone strong { color: var(--text-main); font-size: 0.92rem; }
.gallery-dropzone em { font-style: normal; font-size: 0.76rem; }
.gallery-dropzone.has-file { border-style: solid; border-color: var(--border-strong); }
.gallery-dropzone img { width: 100%; max-height: 260px; object-fit: contain; }
.gallery-counter { float: right; font-weight: 500; color: var(--text-dim); font-size: 0.74rem; }
.gallery-upload-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1rem; }
.gallery-upload-done { text-align: center; padding: 1rem 0.5rem; }
.gallery-upload-done h3 { font-family: var(--font-display); margin: 0 0 0.4rem; }
.gallery-upload-done p { color: var(--text-muted); margin: 0 0 1.2rem; }

.gallery-lightbox { align-items: center; }
.gallery-lightbox figure { position: relative; margin: 0; width: min(1000px, 100%); max-height: 92dvh; display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.gallery-lightbox figure > img { width: 100%; max-height: 72dvh; object-fit: contain; background: #04070c; }
.gallery-lightbox figcaption { padding: 0.9rem 1.1rem 1.1rem; display: grid; gap: 0.5rem; }
.gallery-lightbox figcaption p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.gallery-lightbox .modal-close { z-index: 2; background: rgba(8, 12, 22, 0.7); }

@media (max-width: 920px) {
  .gallery-hero-grid { grid-template-columns: 1fr; }
  .photo-grid.home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .photo-grid, .photo-grid.home { grid-template-columns: 1fr; }
  .gallery-upload-actions .btn { flex: 1; justify-content: center; }
}

/* =========================================================
   Community Photos: mosaic (bento) grid
   Tiles: normal 1x1, wide 2x1, tall 1x2, big 2x2. "dense" packing fills the gaps.
   ========================================================= */
.photo-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: 190px;
  grid-auto-flow: dense;
  gap: 10px;
}
.photo-mosaic.home { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 180px; }

.photo-tile {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(110deg, #111a2b 30%, #18243a 50%, #111a2b 70%);
  background-size: 200% 100%;
  animation: tileShimmer 1.4s linear infinite;
  isolation: isolate;
}
.photo-tile.is-loaded { animation: none; background: #0b111c; }
@keyframes tileShimmer { to { background-position: -200% 0; } }

.photo-tile.tile-wide { grid-column: span 2; }
.photo-tile.tile-tall { grid-row: span 2; }
.photo-tile.tile-big { grid-column: span 2; grid-row: span 2; }

.photo-tile-open { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: none; background: none; cursor: zoom-in; display: block; }
.photo-tile-open img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.35s ease, transform 0.45s ease; }
.photo-tile.is-loaded .photo-tile-open img { opacity: 1; }
.photo-tile:hover .photo-tile-open img { transform: scale(1.05); }
.photo-tile-open:focus-visible { outline: 3px solid var(--emerald); outline-offset: -3px; }

/* Overlay: gradient + author/description, category chip, like button */
.photo-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 8, 14, 0.55) 0%, rgba(5, 8, 14, 0) 28%, rgba(5, 8, 14, 0) 52%, rgba(5, 8, 14, 0.88) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 1;
}
.photo-tile-cat,
.photo-tile-like,
.photo-tile-info { position: absolute; z-index: 2; opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease; }

.photo-tile-cat {
  top: 8px;
  left: 8px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(8, 12, 22, 0.72);
  color: #e5e7eb;
  pointer-events: none;
}
.photo-tile-like {
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 12, 22, 0.72);
  color: #f3f4f6;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}
.photo-tile-like:hover { border-color: rgba(244, 114, 182, 0.7); color: #f9a8d4; }
.photo-tile-like.is-liked { color: #f472b6; border-color: rgba(244, 114, 182, 0.65); background: rgba(40, 8, 24, 0.75); }
.photo-tile-like.is-liked svg { animation: bcPop 0.25s ease; }
/* A liked photo keeps its heart visible */
.photo-tile-like.is-liked { opacity: 1; }

.photo-tile-info {
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  transform: translateY(6px);
  pointer-events: none;
}
.photo-tile-info img { width: 30px; height: 30px; border-radius: 6px; image-rendering: pixelated; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35); }
.photo-tile-info div { min-width: 0; }
.photo-tile-info strong { display: block; font-size: 0.86rem; color: #fff; line-height: 1.2; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.photo-tile-info span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.76rem; color: #d1d5db; line-height: 1.35; }
.photo-tile:not(.tile-big):not(.tile-tall) .photo-tile-info span { -webkit-line-clamp: 1; }

.photo-tile:hover::after,
.photo-tile:focus-within::after,
.photo-tile:hover .photo-tile-cat,
.photo-tile:focus-within .photo-tile-cat,
.photo-tile:hover .photo-tile-like,
.photo-tile:focus-within .photo-tile-like,
.photo-tile:hover .photo-tile-info,
.photo-tile:focus-within .photo-tile-info { opacity: 1; transform: none; }

/* Touch screens have no hover: keep the overlay visible */
@media (hover: none) {
  .photo-tile::after,
  .photo-tile-cat,
  .photo-tile-like,
  .photo-tile-info { opacity: 1; transform: none; }
}

@media (max-width: 1100px) {
  .photo-mosaic.home { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .photo-mosaic,
  .photo-mosaic.home { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 150px; gap: 6px; }
  .photo-tile-info span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-tile, .photo-tile-open img { animation: none; transition: none; }
  .photo-tile:hover .photo-tile-open img { transform: none; }
}

/* =========================================================
   Sales & coupons (store, cart, thank-you)
   ========================================================= */
.price-was {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.82em;
  margin-right: 0.35rem;
  text-decoration-thickness: 1.5px;
}
.spc-sale-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ef4444;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}
.spc-sale-line {
  display: inline-flex;
  align-self: flex-start;
  margin: 0.2rem 0 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
}
.cart-item-sale {
  font-size: 0.72rem;
  color: #fca5a5;
  margin-top: 0.1rem;
}

.coupon-box {
  margin: 0.9rem 0 0.2rem;
  padding: 0.75rem 0.85rem;
  border: 1px dashed rgba(250, 204, 21, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(250, 204, 21, 0.04);
}
.coupon-box.has-error { border-color: rgba(239, 68, 68, 0.55); }
.coupon-box-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.45rem;
}
.coupon-box-row { display: flex; gap: 0.5rem; }
.coupon-box-row input {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-display);
}
.coupon-box-error { color: #fca5a5; font-size: 0.78rem; margin-top: 0.4rem; }
.coupon-box.is-applied {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-style: solid;
  border-color: rgba(56, 216, 100, 0.4);
  background: rgba(56, 216, 100, 0.07);
}
.coupon-box-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(56, 216, 100, 0.15);
  color: var(--emerald);
  flex-shrink: 0;
}
.coupon-box-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.coupon-box-info strong { font-family: var(--font-display); letter-spacing: 0.08em; color: var(--emerald); }
.coupon-box-info span { font-size: 0.76rem; color: var(--text-muted); }
.coupon-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
}
.coupon-remove:hover { color: #fca5a5; }

.cart-sub-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.cart-sub-row.is-discount,
.thankyou-items li.thankyou-sub.is-discount { color: var(--emerald); }
.thankyou-items li.thankyou-sub { color: var(--text-muted); }

.feature-card { color: inherit; text-decoration: none; }
a.feature-card:hover h3 { color: var(--emerald); }
/* Footer: brand + three link columns on one row on wide screens */
@media (min-width: 921px) {
  .footer-grid { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); }
}

/* Card payments: dimmed but clickable so the "coming soon" message shows */
.btn.is-coming-soon { cursor: help; }
.btn.is-coming-soon:hover { border-color: rgba(250, 204, 21, 0.35); color: var(--text-muted); }

/* =========================================================
   QR Ph payment modal
   ========================================================= */
.qrph-backdrop { z-index: 120; padding: 16px; }
.qrph-modal { width: min(420px, 100%); text-align: center; padding: 1.4rem 1.3rem 1.1rem; }
.qrph-head { display: flex; align-items: center; gap: 0.7rem; text-align: left; margin: 0 2rem 0.9rem 0; }
.qrph-head h3 { margin: 0.1rem 0 0; font-family: var(--font-display); font-size: 1.3rem; }
.qrph-head-icon {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: rgba(56, 216, 100, 0.14); color: var(--emerald);
}
.qrph-amount {
  display: flex; flex-direction: column; gap: 0.1rem; padding: 0.7rem; margin-bottom: 0.9rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.03);
}
.qrph-amount span { font-size: 0.75rem; color: var(--text-muted); }
.qrph-amount strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--emerald); }
.qrph-amount small { font-size: 0.74rem; color: var(--text-dim); }
.qrph-code {
  background: #fff; border-radius: 14px; padding: 12px; margin: 0 auto 0.8rem; width: min(280px, 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.qrph-code img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.qrph-timer { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; color: var(--text-muted); }
.qrph-timer strong { font-family: var(--font-display); font-size: 1.15rem; color: var(--text-main); font-variant-numeric: tabular-nums; }
.qrph-timer.is-low, .qrph-timer.is-low strong { color: var(--gold); }
.qrph-progress { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin: 0.45rem auto 0.9rem; width: min(280px, 100%); }
.qrph-progress span { display: block; height: 100%; background: var(--emerald); transition: width 1s linear; }
.qrph-timer.is-low + .qrph-progress span { background: var(--gold); }
.qrph-steps { text-align: left; margin: 0 0 0.8rem; padding-left: 1.2rem; font-size: 0.84rem; color: var(--text-muted); display: grid; gap: 0.25rem; }
.qrph-steps strong { color: var(--text-main); }
.qrph-save { font-size: 0.8rem; white-space: normal; line-height: 1.35; padding: 0.55rem 0.8rem; }
.qrph-waiting { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.8rem; font-size: 0.82rem; color: var(--text-muted); }
.qrph-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--emerald); animation: qrph-pulse 1.2s ease-in-out infinite; }
@keyframes qrph-pulse { 0%, 100% { opacity: 0.35; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.1); } }
.qrph-state { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; padding: 1.2rem 0.4rem; }
.qrph-state strong { font-size: 1.05rem; }
.qrph-state p { margin: 0 0 0.4rem; font-size: 0.85rem; color: var(--text-muted); }
.qrph-state-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; }
.qrph-state.is-paid .qrph-state-icon { background: rgba(56, 216, 100, 0.15); color: var(--emerald); }
.qrph-state.is-expired .qrph-state-icon { background: rgba(250, 204, 21, 0.14); color: var(--gold); }
.qrph-state.is-failed strong { color: #fca5a5; }
.qrph-confirm {
  margin-top: 0.9rem; padding: 0.75rem; border-radius: var(--radius-sm); text-align: left;
  border: 1px solid rgba(250, 204, 21, 0.35); background: rgba(250, 204, 21, 0.06); font-size: 0.82rem; color: var(--text-muted);
}
.qrph-confirm p { margin: 0 0 0.6rem; }
.qrph-confirm-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.qrph-footnote { margin: 0.9rem 0 0; font-size: 0.72rem; color: var(--text-dim); }
@media (prefers-reduced-motion: reduce) { .qrph-dot { animation: none; } .qrph-progress span { transition: none; } }
.qrph-confirm { margin: 0 0 0.9rem; }
@media (max-height: 960px) {
  .qrph-code { width: min(220px, 100%); padding: 10px; }
  .qrph-modal { padding-top: 1.1rem; }
  .qrph-head { margin-bottom: 0.6rem; }
  .qrph-amount { margin-bottom: 0.7rem; padding: 0.55rem; }
  .qrph-steps { font-size: 0.8rem; }
}

/* =========================================================
   Cart drawer: a little wider, medium buttons, thin scrollbar
   ========================================================= */
.cart-drawer { width: min(480px, 100%); }
.drawer-header { padding: 0.9rem 1.2rem; }
.drawer-body {
  padding: 0.9rem 1.2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
  overscroll-behavior: contain;
}
.drawer-body::-webkit-scrollbar { width: 6px; }
.drawer-body::-webkit-scrollbar-track { background: transparent; }
.drawer-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 999px; }
.drawer-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); }
.drawer-username-box { padding: 0.75rem; margin-bottom: 0.8rem; }
.drawer-username-label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.45rem; }
.drawer-player { display: flex; align-items: center; gap: 0.65rem; }
.drawer-player img { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; image-rendering: pixelated; background: var(--bg-deep); }
.drawer-player-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.drawer-player-meta strong { font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-player-meta span { font-size: 0.74rem; color: var(--emerald); }
.drawer-player-change {
  background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted);
  font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.55rem; cursor: pointer;
}
.drawer-player-change:hover { color: var(--text-main); border-color: rgba(255, 255, 255, 0.25); }
.cart-items-list { gap: 0.5rem; }
.cart-item { grid-template-columns: 42px minmax(0, 1fr) auto; padding: 0.5rem 0.6rem; gap: 0.6rem; }
.cart-item img { width: 42px; height: 42px; }
.cart-item-title { font-size: 0.85rem; }
.cart-drawer .coupon-box { margin-top: 0.8rem; padding: 0.65rem 0.75rem; }
.cart-drawer .inventory-reminder { margin-top: 0.7rem; padding: 0.6rem 0.75rem; }
.cart-drawer .inventory-reminder p { font-size: 0.76rem; line-height: 1.45; }
.cart-drawer .terms-accept-row { margin-top: 0.6rem; padding: 0.6rem 0.75rem; font-size: 0.8rem; }
.drawer-footer { padding: 0.8rem 1.2rem 0.9rem; }
.cart-total-row { margin-bottom: 0.55rem; }
.cart-total-row strong { font-size: 1.2rem; }
.payment-method-label { font-size: 0.7rem; margin-bottom: 0.4rem; }
.checkout-buttons { gap: 0.5rem; }
.checkout-buttons .btn {
  padding: 0.55rem 0.75rem; font-size: 0.85rem; min-height: 40px;
  white-space: nowrap; flex-wrap: nowrap; gap: 0.4rem;
}
.checkout-buttons .btn > span { overflow: hidden; text-overflow: ellipsis; }
.checkout-buttons .coming-soon-pill { flex-shrink: 0; }
.checkout-footnote { margin-top: 0.45rem; font-size: 0.7rem; }

/* =========================================================
   QR Ph modal: compact card that fits without scrolling
   ========================================================= */
.qrph-modal {
  width: min(360px, 100%); padding: 1rem 1.1rem 0.9rem; max-height: 94dvh;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
.qrph-modal::-webkit-scrollbar { width: 6px; }
.qrph-modal::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 999px; }
.qrph-modal .modal-close { top: 0.75rem; right: 0.75rem; width: 30px; height: 30px; font-size: 1.15rem; }
.qrph-head { margin: 0 2.2rem 0.7rem 0; gap: 0.6rem; }
.qrph-head-icon { width: 32px; height: 32px; border-radius: 8px; }
.qrph-head .eyebrow { margin: 0; font-size: 0.66rem; }
.qrph-head h3 { font-size: 1.1rem; margin: 0; }
.qrph-amount {
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 0.6rem; row-gap: 0.1rem;
  text-align: left; padding: 0.5rem 0.7rem; margin-bottom: 0.7rem;
}
.qrph-amount strong { font-size: 1.25rem; text-align: right; }
.qrph-amount small { grid-column: 1 / -1; }
.qrph-code { width: min(210px, 100%); padding: 8px; border-radius: 10px; margin-bottom: 0.55rem; }
.qrph-timer { font-size: 0.82rem; }
.qrph-timer strong { font-size: 1rem; }
.qrph-progress { width: min(210px, 100%); margin: 0.35rem auto 0.7rem; }
.qrph-steps { font-size: 0.78rem; gap: 0.15rem; margin-bottom: 0.65rem; line-height: 1.45; }
.qrph-save { font-size: 0.75rem; padding: 0.45rem 0.7rem; }
.qrph-waiting { margin-top: 0.6rem; font-size: 0.78rem; }
.qrph-footnote { margin-top: 0.6rem; font-size: 0.68rem; }
@media (max-height: 720px) {
  .qrph-code, .qrph-progress { width: min(170px, 100%); }
  .qrph-steps { display: none; }
}

/* =========================================================
   Username prompt (add to cart / checkout without a player)
   ========================================================= */
.player-prompt-backdrop { z-index: 130; }
.player-prompt { width: min(400px, 100%); padding: 1.3rem 1.3rem 1.1rem; }
.player-prompt h3 { font-family: var(--font-display); font-size: 1.2rem; margin: 0.15rem 2rem 0.35rem 0; }
.player-prompt-lead { font-size: 0.84rem; color: var(--text-muted); margin: 0 0 0.9rem; line-height: 1.5; }
.player-prompt .edition-toggle { margin-bottom: 0.65rem; }
.player-prompt-field {
  display: flex; align-items: center; background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 0.7rem; cursor: text;
}
.player-prompt-field:focus-within { border-color: var(--emerald); }
.player-prompt-field.has-error { border-color: #f87171; }
.player-prompt-dot { color: var(--emerald); font-weight: 800; font-size: 1rem; }
.player-prompt-field input {
  flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text-main);
  padding: 0.6rem 0; font-size: 0.92rem;
}
.player-prompt-hint { display: block; margin-top: 0.4rem; font-size: 0.74rem; color: var(--text-muted); }
.player-prompt-error { margin-top: 0.4rem; font-size: 0.78rem; color: #fca5a5; }
.player-prompt-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }
.player-prompt-actions .btn { padding: 0.55rem 1rem; font-size: 0.85rem; }

/* Item descriptions written in the admin Quill editor */
.rich-text p { margin: 0 0 0.45rem; }
.rich-text p:last-child { margin-bottom: 0; }
.rich-text ul, .rich-text ol { margin: 0.2rem 0 0.45rem; padding-left: 1.2rem; }
.rich-text li { margin: 0.1rem 0; }
.rich-text a { color: var(--emerald); text-decoration: underline; }
.rich-text strong, .rich-text b { color: var(--text-main); }

/* PayPal popup modal (PaypalPopupModal.jsx): same frame as the QR Ph modal */
.paypal-head-icon { background: rgba(255, 196, 57, 0.16); color: #ffc439; }
.paypal-wait { display: flex; align-items: center; gap: 0.8rem; text-align: left; margin: 1rem 0; padding: 0.85rem 0.95rem; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); }
.paypal-wait .thankyou-spinner { flex-shrink: 0; width: 22px; height: 22px; border-width: 3px; }
.paypal-wait p { margin: 0; color: var(--text-muted); font-size: 0.86rem; line-height: 1.5; }
.paypal-actions { display: grid; gap: 0.5rem; }
.paypal-actions .btn { width: 100%; justify-content: center; }
