~
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #111111;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#logo-container {
  position: fixed;
  top: 30px;
  left: 30px;
  z-index: 1000;
  pointer-events: auto;
}

#logo-container img {
  width: 308px;
  height: 68px;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

#footer-nav {
  position: fixed;
  bottom: 15px;
  right: 15px;
  z-index: 1000;
  display: flex;
  gap: 12px;
  background: rgba(18, 18, 18, 0.75);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#footer-nav a {
  color: #e0e0e0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
}

#footer-nav a:hover {
  color: #ffffff;
  text-decoration: underline;
}

#viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  overflow: hidden;
  touch-action: none;
}

#viewport.dragging {
  cursor: grabbing;
}

/* Rand-Vignette für Fokus auf Bildmitte */
#viewport::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 500;
  box-shadow: inset 0 0 120px 40px rgba(17, 17, 17, 0.85);
}

#grid-canvas {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  transform-style: preserve-3d;
}

.grid-cell {
  position: absolute;
  width: 200px;
  height: 200px;
  overflow: hidden;
  background-color: #1e1e1e;
  border: 1px solid #cccccc;
  box-sizing: border-box;
}

.grid-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.grid-cell img.loaded {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .grid-cell {
    perspective: 600px;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.2s ease, z-index 0s 0.2s;
  }
  .grid-cell:hover {
    transform: scale(1.05);
    z-index: 100;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.75);
    transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.2s ease, z-index 0s 0s;
  }
  .grid-cell img {
    transition: opacity 0.3s ease-out, transform 0.15s ease-out;
    transform-origin: center center;
  }
}

#image-modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
  pointer-events: none;
  visibility: hidden;
  touch-action: none;
  transition: background 0.35s ease, visibility 0.35s ease;
  overflow: hidden;
}

#image-modal.active {
  background: rgba(0, 0, 0, 0.94);
  pointer-events: auto;
  visibility: visible;
}

/* Ambient Backdrop Glow */
#modal-backdrop-blur {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background-size: cover;
  background-position: center;
  filter: blur(60px) brightness(0.4);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 2001;
  pointer-events: none;
}

#image-modal.active #modal-backdrop-blur {
  opacity: 0.55;
}

#modal-image {
  position: relative;
  z-index: 2005;
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
  border-radius: 4px;
  user-select: none;
  opacity: 0;
  transform: scale(0.65);
  transition: transform 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.25), opacity 0.25s ease;
  will-change: transform, opacity;
}

#image-modal.active #modal-image {
  opacity: 1;
  transform: scale(1);
}

#info-badge {
  display: none;
  position: absolute;
  bottom: 25px;
  left: 25px;
  z-index: 2100; /* Muss höher sein als modal-image (2005) und backdrop (2001) */
  background: rgba(22, 22, 22, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e5e5e5;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: auto;
  flex-direction: column;
  gap: 4px;
}

#info-badge.visible {
  display: flex !important;
  opacity: 1 !important;
}

#badge-date {
  color: #cccccc;
  font-size: 12px;
  letter-spacing: 0.3px;
}

#badge-camera {
  color: #90caf9;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.5px;
}

#badge-geo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #64b5f6;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  width: fit-content;
}

#badge-geo:hover {
  color: #90caf9;
  text-decoration: underline;
}
