:root {
  color-scheme: light dark;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  font-size: 16px;
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #22c55e;
  --danger: #ef4444;
  --border: #334155;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 1rem;
}

.container {
  width: min(100%, 960px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--card);
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.35);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.hero-image {
  margin: 0;
}

.hero-image img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: #000;
  /* Schutz vor Rechtsklick und Auswahl */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

.hero-image figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  text-align: center;
}

.public-view {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

input[type="password"],
input[type="file"] {
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
}

button,
.primary-button,
.secondary-button,
.danger-button,
a.secondary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 0 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

.primary-button {
  background: var(--accent);
  color: #052e16;
}

.secondary-button {
  border-color: var(--border);
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.gallery-item {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.5);
}

.gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

.gallery-item.is-active {
  border-color: var(--accent);
}

.gallery-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.gallery-meta .name {
  font-weight: 600;
  margin: 0;
}

.gallery-meta .meta {
  margin: 0;
  color: var(--muted);
  word-break: break-all;
  font-size: 0.85rem;
}

.gallery-actions {
  display: flex;
  gap: 0.5rem;
}

.gallery-actions form {
  flex: 1;
}

.muted {
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
}

.flash.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

@media (max-width: 640px) {
  body {
    padding: 0.5rem;
  }

  .gallery-actions {
    flex-direction: column;
  }
}
