* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.pv-viewer {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #f2f1ed;
}

.pv-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
}

.pv-back {
  font-size: 0.9rem;
  color: #d8d8d5;
  white-space: nowrap;
}

.pv-back:hover {
  color: #e8b34c;
}

.pv-photo-title {
  flex: 1;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pv-topbar-actions {
  display: flex;
  gap: 8px;
}

.pv-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #f2f1ed;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.pv-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.pv-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.pv-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pv-canvas.pv-dragging {
  cursor: grabbing;
}

.pv-image {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  will-change: transform;
}

.pv-viewer:not(.pv-loading) .pv-image {
  opacity: 1;
}

.pv-viewer.pv-loading .pv-stage::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #e8b34c;
  border-radius: 50%;
  animation: pv-spin 0.8s linear infinite;
}

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

.pv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: #f2f1ed;
  font-size: 1.6rem;
  cursor: pointer;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.pv-nav:hover {
  background: rgba(0, 0, 0, 0.6);
}

.pv-nav[hidden] {
  display: none;
}

.pv-nav-prev {
  left: 16px;
}

.pv-nav-next {
  right: 16px;
}

.pv-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 14px;
  border-radius: 999px;
  transition: opacity 0.6s ease;
  z-index: 5;
  pointer-events: none;
}

.pv-hint-hidden {
  opacity: 0;
}

@media (max-width: 560px) {
  .pv-topbar {
    padding: 10px 12px;
  }

  .pv-photo-title {
    font-size: 0.82rem;
  }

  .pv-nav {
    width: 38px;
    height: 38px;
    font-size: 1.3rem;
  }
}
