:root {
  --bg: #32000f;
  --bg-top: #3f0013;
  --bg-card: #3e2318;
  --accent: #ea785b;
  --accent-2: #f3d0c3;
  --text: #faf6f1;
  --text-dim: #b3aa9b;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top, var(--bg-top), var(--bg) 60%);
  color: var(--text);
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.app-header {
  text-align: center;
  margin-bottom: 24px;
}

.couple-name {
  margin: 0 0 4px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.app-header h1 {
  font-size: 2rem;
  margin: 0 0 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  color: var(--text-dim);
  margin: 0;
  font-size: 1rem;
}

.upload-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  margin-bottom: 20px;
  transition: border-color 0.2s, background-color 0.2s;
}

.upload-section.drag-over {
  border-color: var(--accent);
  background-color: rgba(234, 120, 91, 0.08);
}

.upload-btn {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 16px 32px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: var(--bg);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(234, 120, 91, 0.35);
  transition: transform 0.15s ease;
}

.upload-btn:active {
  transform: scale(0.97);
}

.upload-icon {
  margin-right: 6px;
}

.drop-hint {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0;
}

.progress-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.progress-item {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 10px 14px;
}

.progress-item .progress-name {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-track {
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.15s ease;
}

.progress-item.error .progress-fill {
  background: #ff4d4d;
}

.progress-item.error .progress-name {
  color: #ff8f8f;
}

.progress-item.done .progress-fill {
  background: #34d399;
}

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

.photo-card {
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
}

.photo-media {
  position: relative;
  aspect-ratio: 1 / 1;
  cursor: pointer;
}

.photo-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.photo-media:hover img {
  transform: scale(1.05);
}

.photo-media .photo-date {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 6px;
  font-size: 0.55rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  color: white;
}

.photo-media .photo-date .photo-date-value {
  flex-shrink: 0;
}

.photo-media .photo-date .photo-name {
  font-weight: 600;
  color: var(--accent-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-media .photo-date .photo-name::before {
  content: "• ";
}

.like-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.1s ease;
}

.like-btn:active {
  transform: scale(0.95);
}

.like-btn.liked {
  color: var(--accent);
}

.like-btn .like-icon {
  font-size: 1rem;
}

.name-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.name-modal.hidden {
  display: none;
}

.name-modal-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.name-modal-box h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  color: var(--text);
}

.name-modal-box p {
  margin: 0 0 18px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.name-modal-box form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.name-modal-box input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(250, 246, 241, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-size: 1rem;
}

.name-modal-box input::placeholder {
  color: var(--text-dim);
}

.name-modal-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.empty-state {
  display: none;
  text-align: center;
  color: var(--text-dim);
  margin-top: 40px;
}

.empty-state.visible {
  display: block;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lightbox.hidden {
  display: none;
}

.lightbox-image-wrap {
  max-width: 92vw;
  max-height: 82vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image-wrap img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.2s ease;
  transform-origin: center center;
}

.lightbox-image-wrap img.zoomed {
  cursor: zoom-out;
  transform: scale(2);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: white;
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close {
  top: 16px;
  right: 16px;
}

.lightbox-nav.prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav.next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-caption {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

@media (min-width: 640px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}
