/* ============================================================
   Design-Tokens – abgestimmt auf schurz-marketing.de
   ============================================================ */
:root {
  --papier: #f5f5f4;
  --tinte: #1c1917;
  --tinte-70: rgba(28, 25, 23, 0.7);
  --tinte-50: rgba(28, 25, 23, 0.5);
  --tinte-15: rgba(28, 25, 23, 0.15);
  --tinte-10: rgba(28, 25, 23, 0.1);
  --akzent: #8a6a1e;
  --gold: #c79a34;
  --weiss: #ffffff;
  /* Bewusst nur Systemschriften – es wird keinerlei Webfont geladen (DSGVO).
     "Archivo" greift nur, falls sie auf dem Gerät installiert ist. */
  --schrift: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.6;
  color: var(--tinte);
  background: var(--papier);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.umschlag {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.umschlag-schmal { max-width: 560px; }

/* ------------------------------------------------------------
   Typografie
   ------------------------------------------------------------ */
h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0.35em 0 0.5em;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 0.6em;
}

.dachzeile {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--akzent);
}

.einleitung {
  max-width: 640px;
  color: var(--tinte-70);
  margin-bottom: 0.5rem;
}

.leerhinweis {
  color: var(--tinte-50);
  padding: 3rem 0;
  text-align: center;
  font-size: 1.05rem;
}

/* ------------------------------------------------------------
   Kopf & Fuß
   ------------------------------------------------------------ */
.seitenkopf {
  background: var(--papier);
  border-bottom: 1px solid var(--tinte-10);
}

.seitenkopf-innen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.logo {
  display: inline-block;
  text-decoration: none;
  padding: 8px 0;
}

.logo-text {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.95rem;
  font-weight: 700;
}

.logo-zusatz {
  display: block;
  color: var(--akzent);
  font-weight: 600;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
}

.seitenfuss {
  border-top: 1px solid var(--tinte-10);
  margin-top: 96px;
}

.seitenfuss-innen {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 0.85rem;
  color: var(--tinte-50);
}

.seitenfuss a {
  color: var(--tinte-50);
  text-decoration: none;
}

.seitenfuss a:hover { color: var(--akzent); }

/* ------------------------------------------------------------
   Held (Hero)
   ------------------------------------------------------------ */
.held { padding: 72px 0 40px; }

.held-galerie { padding: 48px 0 24px; }

.ruecklink {
  display: inline-block;
  text-decoration: none;
  color: var(--tinte-70);
  font-size: 0.9rem;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--tinte-15);
  padding-bottom: 2px;
}

.ruecklink:hover { color: var(--akzent); border-color: var(--akzent); }

/* ------------------------------------------------------------
   Knöpfe
   ------------------------------------------------------------ */
.knopf {
  display: inline-block;
  background: var(--tinte);
  color: var(--papier);
  border: 1px solid var(--tinte);
  padding: 13px 26px;
  font-family: var(--schrift);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.knopf:hover { background: #000; transform: translateY(-1px); }

.knopf-klein { padding: 8px 16px; font-size: 0.85rem; }

.knopf-gefahr { background: #8a1e1e; border-color: #8a1e1e; }

.knopf-gefahr:hover { background: #6d1717; }

.textlink {
  color: var(--tinte-70);
  font-size: 0.9rem;
}

.textlink:hover { color: var(--akzent); }

/* ------------------------------------------------------------
   Spielkarten (Startseite)
   ------------------------------------------------------------ */
.spielkarte {
  display: block;
  background: var(--weiss);
  border: 1px solid var(--tinte-10);
  text-decoration: none;
  overflow: hidden;
}

.spielkarte-bild {
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--tinte-10);
}

.spielkarte-bild img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.spielkarte:hover .spielkarte-bild img { transform: scale(1.03); }

.platzhalter {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e7e5e4 0%, #d6d3d1 55%, #c7b98a 100%);
}

.spielkarte-text {
  display: block;
  padding: 20px 22px 22px;
}

.spielkarte-titel {
  display: block;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 6px 0 10px;
}

.spielkarte-meta {
  display: block;
  color: var(--tinte-50);
  font-size: 0.88rem;
}

.spielkarte:hover .spielkarte-meta { color: var(--akzent); }

/* Großes Feature: neuestes Spiel */
.spielkarte-gross {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  margin-bottom: 48px;
}

.spielkarte-gross .spielkarte-bild {
  aspect-ratio: auto;
  min-height: 380px;
  height: 100%;
}

.spielkarte-gross .spielkarte-text {
  align-self: center;
  padding: 40px;
}

.spielkarte-gross .spielkarte-titel {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  margin: 12px 0 16px;
}

.spielraster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

@media (max-width: 800px) {
  .spielkarte-gross { grid-template-columns: 1fr; }
  .spielkarte-gross .spielkarte-bild { min-height: 240px; aspect-ratio: 3 / 2; height: auto; }
  .spielkarte-gross .spielkarte-text { padding: 24px; }
}

/* ------------------------------------------------------------
   Fotoraster (Galerie)
   ------------------------------------------------------------ */
.fotoraster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.fotokachel {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--tinte-10);
}

.fotokachel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.fotokachel:hover img { transform: scale(1.04); }

/* ------------------------------------------------------------
   Lightbox
   ------------------------------------------------------------ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(11, 11, 13, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-leiste {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  color: rgba(245, 245, 244, 0.7);
  font-size: 0.85rem;
}

.lightbox-leiste a {
  color: var(--gold);
  text-decoration: none;
  border: 1px solid rgba(199, 154, 52, 0.5);
  padding: 6px 14px;
}

.lightbox-leiste a:hover { background: rgba(199, 154, 52, 0.15); }

.lightbox button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(245, 245, 244, 0.08);
  border: 1px solid rgba(245, 245, 244, 0.25);
  color: var(--papier);
  font-size: 1.4rem;
  line-height: 1;
  width: 48px;
  height: 48px;
  cursor: pointer;
}

.lightbox button:hover { background: rgba(245, 245, 244, 0.2); }

.lightbox .lb-zurueck { left: 16px; }
.lightbox .lb-weiter { right: 16px; }

.lightbox .lb-schliessen {
  top: 60px;
  right: 16px;
  transform: none;
  font-size: 1.1rem;
}

@media (max-width: 640px) {
  .lightbox .lb-zurueck, .lightbox .lb-weiter { width: 40px; height: 40px; }
}

/* ------------------------------------------------------------
   Verwaltung
   ------------------------------------------------------------ */
.admin-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.admin-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--tinte-70);
}

.admin-nav a:hover { color: var(--akzent); }

.admin-nav .knopf { color: var(--papier); }

.admin main, main { min-height: 55vh; }

.admin section:first-of-type { padding-top: 56px; }

.admin-kasten {
  background: var(--weiss);
  border: 1px solid var(--tinte-10);
  padding: 28px;
  margin: 28px 0;
}

.admin-kasten .hinweis {
  color: var(--tinte-70);
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.gefahrzone { border-color: rgba(138, 30, 30, 0.35); }

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tinte-70);
  margin: 16px 0 6px;
}

label .optional { text-transform: none; letter-spacing: 0; font-weight: 400; }

input[type="text"],
input[type="password"],
input[type="date"],
textarea {
  width: 100%;
  font-family: var(--schrift);
  font-size: 1rem;
  color: var(--tinte);
  background: var(--papier);
  border: 1px solid var(--tinte-15);
  padding: 12px 14px;
}

input:focus, textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: -1px;
}

form .knopf { margin-top: 20px; }

.formular-zeile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
  align-items: end;
}

.formular-zeile .feld-breit { grid-column: 1 / -1; }

.formular-zeile .knopf { justify-self: start; }

@media (max-width: 640px) {
  .formular-zeile { grid-template-columns: 1fr; }
}

.meldung {
  padding: 12px 16px;
  margin: 18px 0;
  font-size: 0.95rem;
  border: 1px solid;
}

.meldung-ok { background: #f0f3ea; border-color: #b5c49a; color: #3d4a26; }

.meldung-fehler { background: #f8ecec; border-color: #d3a3a3; color: #6d1717; }

.login-kasten {
  background: var(--weiss);
  border: 1px solid var(--tinte-10);
  padding: 40px;
  margin-top: 72px;
}

.login-kasten h1 { font-size: 2rem; }

.login-kasten .hinweis { color: var(--tinte-70); font-size: 0.95rem; }

/* Setup: Datenbank-Auswahl */
.db-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--tinte-15);
  background: var(--papier);
  margin: 16px 0 0;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: 0.92rem;
  color: var(--tinte-70);
  line-height: 1.5;
}

.db-option:has(input:checked) {
  border-color: var(--gold);
  background: #faf6ec;
}

.db-option input {
  accent-color: var(--akzent);
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
}

.db-option strong {
  display: block;
  color: var(--tinte);
  font-size: 0.98rem;
}

#mysql-felder { margin-top: 8px; }

/* Tabelle der Spiele */
.spieltabelle-huelle {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.spieltabelle {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: var(--weiss);
  border: 1px solid var(--tinte-10);
}

.spieltabelle th, .spieltabelle td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--tinte-10);
  font-size: 0.95rem;
}

.spieltabelle th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--tinte-70);
}

.spieltabelle tr:last-child td { border-bottom: none; }

.spieltabelle .nowrap { white-space: nowrap; }

.spieltabelle .textlink { margin-left: 10px; text-decoration: none; }

/* Upload-Ablage */
.ablage {
  border: 2px dashed var(--tinte-15);
  background: var(--papier);
  padding: 44px 24px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ablage.aktiv {
  border-color: var(--gold);
  background: #faf6ec;
}

.ablage-text { margin-bottom: 14px; color: var(--tinte-70); }

.upload-status { margin-top: 20px; }

.upload-balken {
  height: 10px;
  background: var(--tinte-10);
  overflow: hidden;
}

.upload-fortschritt {
  height: 100%;
  width: 0;
  background: var(--gold);
  transition: width 0.2s ease;
}

.upload-text {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--tinte-70);
}

.upload-fehlerliste {
  margin: 10px 0 0 18px;
  color: #6d1717;
  font-size: 0.9rem;
}

.upload-fehlerliste:empty { display: none; }

#upload-neuladen { margin-top: 16px; }

/* Foto-Verwaltung */
.fotoraster-admin { margin-bottom: 36px; }

.fotokachel-admin {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--tinte-10);
  border: 2px solid transparent;
}

.fotokachel-admin.ist-cover { border-color: var(--gold); }

.fotokachel-admin img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-abzeichen {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--gold);
  color: var(--tinte);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
}

.fotokachel-aktionen {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px;
  background: linear-gradient(transparent, rgba(11, 11, 13, 0.65));
  opacity: 0;
  transition: opacity 0.15s ease;
}

.fotokachel-admin:hover .fotokachel-aktionen,
.fotokachel-admin:focus-within .fotokachel-aktionen { opacity: 1; }

.fotokachel-aktionen button {
  font-family: var(--schrift);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border: 1px solid rgba(245, 245, 244, 0.4);
  background: rgba(28, 25, 23, 0.6);
  color: var(--papier);
  cursor: pointer;
}

.fotokachel-aktionen button:hover { background: var(--tinte); }

.fotokachel-aktionen button.gefahr:hover { background: #8a1e1e; border-color: #8a1e1e; }

@media (max-width: 640px) {
  .fotokachel-aktionen { opacity: 1; }
  .seitenkopf-innen { flex-direction: column; align-items: flex-start; gap: 8px; }
  .held { padding: 44px 0 24px; }
  .held-galerie { padding: 32px 0 16px; }
  .umschlag { padding: 0 18px; }
  .admin-kasten { padding: 20px 16px; }
  .login-kasten { padding: 28px 20px; margin-top: 40px; }
  .seitenfuss { margin-top: 56px; }
  .fotoraster { gap: 10px; }
}
