:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  
  --bg-main: #0c0d10;
  --bg-surface: #15171e;
  --bg-card: rgba(25, 28, 36, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(212, 175, 55, 0.5);
  
  --gold: #d4af37;
  --gold-light: #f3e5ab;
  --gold-glow: rgba(212, 175, 55, 0.25);
  --rose: #e06d7e;
  --rose-glow: rgba(224, 109, 126, 0.25);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-stage: 0 25px 60px rgba(0, 0, 0, 0.75);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* -------------------------------------------------------------
   PIN Screen
------------------------------------------------------------- */
.pin-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at center, #1b1e27 0%, #08090b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.pin-screen-overlay.unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
  position: relative;
  animation: pinPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pinPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.pin-card.shake {
  animation: pinShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes pinShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

.pin-icon-wrap {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.25rem;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.pin-event-date {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.pin-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.45;
}

.pin-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pin-input {
  width: 100%;
  font-size: 1.75rem;
  letter-spacing: 0.55em;
  text-align: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.pin-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-glow);
}

.btn-unlock {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.pin-error {
  min-height: 1.25rem;
  font-size: 0.85rem;
  color: var(--rose);
  margin-top: 0.75rem;
  font-weight: 500;
}

/* -------------------------------------------------------------
   Buttons & Controls
------------------------------------------------------------- */
.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #c59b27, #dfba4e);
  color: #0c0d10;
  box-shadow: 0 4px 15px var(--gold-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #d4af37, #ebd17a);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

.btn-danger-soft {
  background: rgba(224, 109, 126, 0.1);
  color: var(--rose);
  border: 1px solid rgba(224, 109, 126, 0.25);
}

.btn-danger-soft:hover {
  background: rgba(224, 109, 126, 0.2);
}

.btn-icon-soft {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon-soft:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* -------------------------------------------------------------
   Header
------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 13, 16, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold-light);
}

.brand-text h1 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.view-switcher {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
}

.btn-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.btn-toggle.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-fav-badge {
  background: rgba(224, 109, 126, 0.12);
  border: 1px solid rgba(224, 109, 126, 0.35);
  color: var(--rose);
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
}

.btn-fav-badge:hover {
  background: rgba(224, 109, 126, 0.22);
}

.fav-count {
  background: var(--rose);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* -------------------------------------------------------------
   Presentation View (Slider)
------------------------------------------------------------- */
.gallery-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.view-presentation {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.stage-wrapper {
  max-width: 1350px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  flex-shrink: 0;
}

.nav-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold);
  color: var(--gold-light);
  transform: scale(1.08);
}

.photo-stage {
  flex: 1;
  max-width: 1100px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-stage);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.photo-info-top {
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.badge-number {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.04em;
}

.badge-counter {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 500;
}

.photo-img-container {
  width: 100%;
  height: calc(82vh - 170px);
  min-height: 380px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  user-select: none;
}

.photo-img-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease-out;
}

.photo-spinner {
  position: absolute;
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.photo-spinner.active {
  opacity: 1;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.photo-toolbar {
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid var(--border-color);
}

.toolbar-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.toolbar-btn.active-fav {
  background: rgba(224, 109, 126, 0.2);
  border-color: var(--rose);
  color: var(--rose);
}

/* -------------------------------------------------------------
   Grid View
------------------------------------------------------------- */
.view-grid {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

.grid-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 320px;
  color: var(--text-muted);
}

.search-box input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
}

.filter-tab {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.filter-tab.active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold);
  color: var(--gold-light);
}

.tab-count {
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 6px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
}

.grid-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  position: relative;
}

.grid-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5);
}

.grid-card.is-favorite {
  border-color: var(--rose);
}

.grid-thumb-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #000;
  overflow: hidden;
}

.grid-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.grid-card:hover .grid-thumb-wrap img {
  transform: scale(1.05);
}

.grid-card-footer {
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
}

.grid-photo-num {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
}

.grid-fav-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.2s;
}

.grid-fav-btn:hover {
  transform: scale(1.2);
  color: var(--rose);
}

.grid-fav-btn.active {
  color: var(--rose);
}

.grid-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  font-size: 1rem;
}

/* -------------------------------------------------------------
   Modal / Favorites Drawer
------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { transform: scale(0.93) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--gold-light);
}

.modal-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
}

.btn-close-modal:hover {
  color: #fff;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.fav-summary-box {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--gold-light);
  text-align: center;
}

.fav-numbers-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  max-height: 180px;
  overflow-y: auto;
  word-break: break-all;
  color: #fff;
}

.modal-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.modal-actions-grid .btn {
  justify-content: center;
  padding: 0.75rem;
  font-size: 0.88rem;
}

/* -------------------------------------------------------------
   Responsive
------------------------------------------------------------- */
@media (max-width: 768px) {
  .site-header {
    padding: 0.65rem 1rem;
  }
  
  .brand-text h1 {
    font-size: 1.2rem;
  }
  
  .brand-sub {
    display: none;
  }

  .nav-btn {
    width: 42px;
    height: 42px;
  }

  .stage-wrapper {
    gap: 0.5rem;
  }

  .photo-img-container {
    height: calc(75vh - 160px);
    min-height: 280px;
  }

  .modal-actions-grid {
    grid-template-columns: 1fr;
  }
}
