:root {
  --bg: #0b0b0d;
  --bg-elevated: #15151a;
  --ink: #e9e4da;
  --accent: #c9a24b;
  --accent-soft: rgba(201, 162, 75, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow-x: hidden;
}

/* ---------- Login ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.login-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 40px;
}

.login-form.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.paw {
  width: 56px;
  height: 56px;
  fill: var(--accent);
  opacity: 0.85;
}

.login-input {
  width: 220px;
  text-align: center;
  font-size: 28px;
  letter-spacing: 6px;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--accent-soft);
  color: var(--ink);
  padding: 8px 0;
  outline: none;
  transition: border-color 0.2s ease;
}

.login-input:focus {
  border-color: var(--accent);
}

.login-submit {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--accent-soft);
  background: var(--bg-elevated);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.login-submit svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Galerie ----------
   Grid, das sich so dehnt, dass es IMMER den Bildschirm füllt:
   grid-auto-rows: minmax(X, 1fr) + min-height am Container heißt:
   - wenig Bilder  -> die vorhandenen Zeilen wachsen, bis der ganze
     Bildschirm ausgefüllt ist (kein leerer Hintergrund mehr).
   - viele Bilder  -> sobald der natürliche Inhalt den Bildschirm sprengt,
     bleiben die Zeilen bei ihrer Mindesthöhe und die Seite scrollt normal.
*/
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: minmax(240px, 1fr);
  gap: 4px;
  padding: 4px;
  padding-bottom: 110px;
  min-height: 100vh;
  min-height: 100dvh;
}

.gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  background: var(--bg-elevated);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.gallery img.loaded {
  opacity: 1;
}

@media (max-width: 500px) {
  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    grid-auto-rows: minmax(160px, 1fr);
  }
}

/* ---------- Lightbox (Vollbild-Ansicht beim Antippen eines Bildes) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.lightbox.hidden {
  display: none;
}

.lb-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  user-select: none;
}

.lb-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--ink);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lb-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
  .lb-prev, .lb-next { width: 40px; height: 40px; }
}

/* ---------- Schwebende Buttons ---------- */
.fab {
  position: fixed;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 40;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, opacity 0.3s ease;
}

.fab:active {
  transform: scale(0.92);
}

.fab svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fab-music { left: 20px; }
.fab-upload { right: 20px; }

.fab-music.playing {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--accent);
}

.fab-music.playing .icon-note {
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ---------- Upload-Fortschritt ---------- */
.upload-progress {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.upload-progress.hidden {
  display: none;
}

.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

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