:root {
  --bg: #111;
  --fg: #f2f2f2;
  --accent: #e0b341;
  --tile: #1c1c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  text-align: center;
}

h1 { font-size: 1.6rem; margin: 0.5rem 0; }
.lead { color: #cfcfcf; }
.fineprint { font-size: 0.8rem; color: #999; }
.error { color: #ff8080; }

/* Kachel-Raster. Aufgedeckte Kacheln tragen ihren Bildausschnitt als Hintergrund;
   verdeckte bleiben eine Volltonflaeche (kein Bild geladen). */
.reveal {
  position: relative;
  margin: 1rem 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 3 / 2; /* Default bis state.json die echten Maße liefert */
}

.grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 10), 1fr);
  grid-template-rows: repeat(var(--rows, 10), 1fr);
}
.cell {
  background-color: var(--tile);
  border: 1px solid rgba(0, 0, 0, 0.35);
}
.cell.revealed {
  background-size: 100% 100%;
  background-repeat: no-repeat;
  border-color: transparent;
  animation: tile-in 0.7s ease;
}
@keyframes tile-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.progress {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
}

.amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.cta {
  display: inline-block;
  margin: 0.75rem 0;
  padding: 0.8rem 1.4rem;
  background: var(--accent);
  color: #111;
  text-decoration: none;
  font-weight: 700;
  border-radius: 8px;
}
.cta-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 360px; margin: 1rem auto; }
.form label { text-align: left; font-size: 0.9rem; }
.form input {
  width: 100%;
  padding: 0.7rem;
  margin-top: 0.25rem;
  border: 1px solid #444;
  border-radius: 6px;
  background: #1a1a1a;
  color: var(--fg);
  font-size: 1rem;
}
.form button {
  padding: 0.8rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #111;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.banner {
  background: #143d14;
  color: #d7f5d7;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* Admin */
.admin { max-width: 900px; text-align: left; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.5rem; border-bottom: 1px solid #333; text-align: left; }
.status-pending { color: #e0b341; }
.status-paid, .status-manual { color: #7fd97f; }
.btn-reveal { padding: 0.4rem 0.7rem; border: 0; border-radius: 6px; background: var(--accent); font-weight: 700; cursor: pointer; }
.link-cell { font-size: 0.75rem; word-break: break-all; color: #8ab4f8; }
.admin-nav { margin: 0.25rem 0 1rem; font-size: 0.9rem; }
.admin-nav a { color: #8ab4f8; }

/* Admin-Kachelraster: volles Foto + klickbare Kacheln */
.reveal-admin {
  position: relative;
  margin: 1rem 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 3 / 2;
}
.admin-photo { display: block; width: 100%; height: auto; }
.grid-admin {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 10), 1fr);
  grid-template-rows: repeat(var(--rows, 10), 1fr);
}
.cell-admin {
  background: rgba(0, 0, 0, 0.62);          /* verdeckt = abgedunkelt */
  outline: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background 0.2s ease;
}
.cell-admin:hover { outline: 2px solid var(--accent); }
.cell-admin.revealed { background: transparent; }  /* aufgedeckt = Foto sichtbar */
.cell-admin.busy { opacity: 0.5; }
