:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --line: #e5e7eb;
  --pri: #2563eb;
  --pri-dark: #1d4ed8;
  --text: #111827;
  --muted: #6b7280;
  --danger: #b91c1c;
  --shadow: 0 6px 20px rgba(0,0,0,0.06);
  --radius: 16px;
}

/* Grundlayout */

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow-y: auto;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-y: auto;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);

  /* Platz für Bottom Navigation */
  padding-bottom: 95px;
}

/* Seitencontainer */

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

/* Kopfbereich */

.topbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.page-title {
  margin: 0;
  font-size: 1.6rem;
}

.page-subtitle {
  margin: 4px 0 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Karten */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}

/* Texte */

h1, h2, h3 {
  line-height: 1.2;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.alert-error {
  color: var(--danger);
  margin-top: 0;
  margin-bottom: 14px;
}

/* Formulare */

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

input,
textarea,
button {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border-radius: 12px;
}

input,
textarea {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Buttons */

button {
  background: var(--pri);
  color: #fff;
  border: 0;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background: var(--pri-dark);
}

button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Bilder */

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
}

/* Links */

a {
  color: var(--pri);
  text-decoration: none;
}

/* Badges */

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--pri-dark);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- Galerie ---------- */

.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 85%;
  gap: 12px;

  overflow-x: auto;
  overflow-y: hidden;

  scroll-snap-type: x mandatory;

  margin: 14px 0;
  padding-bottom: 6px;

  -webkit-overflow-scrolling: touch;
}

.gallery::-webkit-scrollbar {
  height: 8px;
}

.gallery::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

.gallery-item {
  scroll-snap-align: start;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

/* ---------- Bottom Navigation ---------- */

.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  z-index: 1000;

  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);

  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}

.mobile-nav-inner {
  max-width: 960px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: repeat(3, 1fr);

  gap: 8px;

  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}

.mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 4px;

  min-height: 52px;

  border-radius: 14px;

  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;

  text-decoration: none;
}

.mobile-nav a.active {
  background: #eff6ff;
  color: var(--pri-dark);
}

.mobile-nav .icon {
  font-size: 1.2rem;
  line-height: 1;
}

/* ---------- Login/Register Navigation ---------- */

.auth-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.auth-nav a {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
}

.auth-nav a.active {
  background: #eff6ff;
  color: var(--pri-dark);
  border-color: #bfdbfe;
}

/* ---------- Desktop Anpassung ---------- */

@media (min-width: 768px) {

  .wrap {
    padding: 24px;
  }

  .gallery {
    grid-auto-columns: minmax(260px, 420px);
  }

  .mobile-nav {
    left: 50%;
    right: auto;
    bottom: 18px;

    transform: translateX(-50%);

    width: min(520px, calc(100% - 24px));

    border: 1px solid var(--line);
    border-radius: 22px;

    overflow: hidden;
  }

  .mobile-nav-inner {
    padding: 10px 12px;
  }

}
.download-btn {
  display: inline-block;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--pri);
  color: #fff;
  text-align: center;
  font-weight: 600;
}

.mobile-nav-4 {
  grid-template-columns: repeat(4, 1fr);
}