:root {
  --bg: #0f1115;
  --bg-soft: #171a21;
  --card: #1c2029;
  --card-hover: #232836;
  --text: #e9ecf1;
  --muted: #9aa3b2;
  --accent: #5b8cff;
  --accent-2: #7c5cff;
  --border: #2a2f3a;
  --danger: #ff5c68;
  --ok: #3ecf8e;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2030 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 40px 22px; flex: 1; }
.wrap.narrow { max-width: 460px; display: flex; align-items: center; justify-content: center; }

/* Startseite */
.hero { text-align: center; margin-bottom: 40px; }
.hero h1 { font-size: 2.4rem; margin: 0 0 6px; letter-spacing: -.02em; }
.sub { color: var(--muted); margin: 0; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 22px;
  text-align: center;
  color: var(--text);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  box-shadow: var(--shadow);
}
.tile:hover { transform: translateY(-4px); background: var(--card-hover); border-color: var(--accent); text-decoration: none; }
.tile-flag { display: block; font-size: 3rem; margin-bottom: 12px; }
.tile-title { display: block; font-size: 1.35rem; font-weight: 600; margin-bottom: 10px; }
.tile-lock { color: var(--muted); font-size: .9rem; }
.tile-badge { color: var(--ok); font-size: .9rem; }

/* Karten / Login */
.card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 30px;
  text-align: center;
  box-shadow: var(--shadow);
}
.card-flag { font-size: 3rem; margin-bottom: 6px; }
.card h1 { margin: 0 0 6px; }
.card form { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.back { margin-top: 18px; }

input[type=password], input[type=text], textarea {
  width: 100%;
  padding: 13px 15px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 120px; resize: vertical; }

button, .btn {
  padding: 13px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s ease;
}
button:hover, .btn:hover { opacity: .9; text-decoration: none; }
.btn-ghost { background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: var(--bg-soft); border: 1px solid var(--danger); color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: .85rem; }

.error { color: var(--danger); font-weight: 500; }
.ok-note { color: var(--ok); font-weight: 500; }

/* Sektion / Galerie */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.section-head h1 { margin: 0; font-size: 1.9rem; }
.flag { margin-right: 6px; }
.logout { color: var(--muted); font-size: .95rem; }
.intro { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 22px; margin-bottom: 28px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}
.media {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.media img, .media video { width: 100%; display: block; background: #000; }
.media figcaption { padding: 12px 16px; color: var(--muted); font-size: .92rem; }

/* Admin */
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; gap: 16px; }
.admin-head h1 { margin: 0; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.admin-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.admin-card h2 { margin: 0 0 4px; }
.admin-card .count { color: var(--muted); margin: 0 0 16px; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow); }
.panel h2 { margin-top: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }

.item-list { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.item .thumb { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; background: #000; }
.item .type-tag { font-size: .75rem; color: var(--muted); }
.item-actions { display: flex; gap: 6px; align-items: center; }
.item-actions form { margin: 0; }
.caption-form { display: flex; gap: 8px; margin-top: 8px; }
.caption-form input { flex: 1; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 22px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--muted); }
.site-footer span { margin: 0 8px; }

@media (max-width: 560px) {
  .item { grid-template-columns: 1fr; }
  .item .thumb { width: 100%; height: 160px; }
  .section-head h1 { font-size: 1.5rem; }
}
