/* ============================================================
   style.css  —  Aussehen ("Strand & Sonne"), mobile-first
   ============================================================
   "mobile-first" heißt: Wir gestalten zuerst fürs Handy.
   Ganz unten gibt es eine kleine Anpassung für breitere Bildschirme.
   ------------------------------------------------------------ */

/* :root sind globale Variablen (Farben), die wir überall wiederverwenden.
   Willst du das Farbschema ändern, reicht es, hier die Werte zu tauschen. */
:root {
  --turkis:      #00b4d8;   /* Meer-Türkis */
  --turkis-dunkel:#0077b6;
  --sand:        #ffe8c2;   /* heller Sandton */
  --sand-karte:  #fff6e9;   /* Feld-Hintergrund */
  --orange:      #ff8c42;   /* Sonnen-Orange */
  --pink:        #ff5d8f;
  --text:        #073b4c;   /* dunkles Petrol für Text */
  --schatten:    0 4px 14px rgba(0, 60, 90, 0.18);
}

/* "box-sizing: border-box" = Padding zählt zur Breite dazu -> einfacheres Layout */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  /* Strand-Verlauf von Himmel-Türkis nach Sand */
  background: linear-gradient(180deg, var(--turkis) 0%, #90e0ef 35%, var(--sand) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  padding: 12px;
  user-select: none;
}

/* ---- Kopfzeile ---- */
.header { text-align: center; margin: 8px 0 14px; }

.title {
  margin: 0;
  font-size: 1.6rem;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,70,100,0.35);
}

.subline {
  margin-top: 6px;
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.progress {
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: var(--schatten);
}

.who { color: var(--turkis-dunkel); font-size: 0.9rem; font-weight: 600; }

/* ---- Das 4x4-Raster ----
   CSS Grid: repeat(4, 1fr) = 4 gleich breite Spalten. */
.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
}

/* Ein einzelnes Bingo-Feld */
.cell {
  position: relative;
  aspect-ratio: 1 / 1;            /* immer quadratisch */
  background: var(--sand-karte);
  border-radius: 14px;
  box-shadow: var(--schatten);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  cursor: pointer;
  transition: transform 0.08s ease;
  border: 2px solid rgba(255,255,255,0.6);
}
.cell:active { transform: scale(0.96); }

/* Aufgaben-Text in leeren Feldern */
.cell .task {
  font-size: 0.72rem;
  line-height: 1.15;
  font-weight: 600;
  color: var(--text);
}

/* kleines Kamera-Symbol unten in leeren Feldern */
.cell .cam {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Gefülltes Feld: Foto füllt die ganze Kachel */
.cell.filled { padding: 0; cursor: zoom-in; }
.cell.filled img {
  width: 100%;
  height: 100%;
  object-fit: cover;     /* Foto füllt das Quadrat, ohne verzerrt zu werden */
  display: block;
}

/* grüner Haken oben links in gefüllten Feldern */
.cell.filled::before {
  content: "✓";
  position: absolute;
  top: 4px; left: 6px;
  z-index: 2;
  color: #fff;
  background: #2bb673;
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Name des Beitragenden unten über dem Foto */
.cell .by {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
  font-size: 0.62rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  padding: 10px 4px 3px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Moderations-Button (nur im Orga-Modus, auf jedem Foto) */
.cell .mod-btn {
  position: absolute;
  top: 4px; right: 6px;
  z-index: 3;
  width: 26px; height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(214, 40, 57, 0.92);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
}

/* Feld, das gerade hochlädt */
.cell.uploading { opacity: 0.6; }
.cell .spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(0,119,182,0.25);
  border-top-color: var(--turkis-dunkel);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Buttons ---- */
.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--schatten);
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-outline { background: rgba(255,255,255,0.85); color: var(--turkis-dunkel); font-size: 0.9rem; }
.btn-danger  { background: #d62839; color: #fff; padding: 8px 14px; font-size: 0.85rem; }

/* Bereich unter dem Board */
.board-actions { text-align: center; margin: 16px auto 4px; }

/* Breiteres Modal für die Foto-Liste */
.modal-card-wide { max-width: 420px; }

/* Liste der eigenen Fotos */
.my-photos-list {
  max-height: 50vh;
  overflow-y: auto;
  margin: 8px 0 14px;
}
.my-photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.my-photo-row img {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}
.my-photo-row .info { flex: 1; text-align: left; font-size: 0.85rem; color: var(--text); }

/* ---- Name-Modal ---- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 60, 90, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  max-width: 340px;
  width: 100%;
  box-shadow: var(--schatten);
}
.modal-card h2 { margin: 0 0 8px; }
.modal-card p { margin: 6px 0 12px; }
.modal-card input[type="text"] {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 2px solid var(--turkis);
  border-radius: 12px;
  margin-bottom: 14px;
  text-align: center;
}
.modal-card .hint { font-size: 0.78rem; color: #6b7b83; }

/* Datenschutz-Hinweis-Box im Begrüßungsfenster */
.privacy {
  background: #eef9fc;
  border: 1px solid #cdeef5;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 14px 0 12px;
  text-align: left;
}
.privacy strong { display: block; margin-bottom: 4px; font-size: 0.85rem; }
.privacy p { margin: 0; font-size: 0.76rem; line-height: 1.35; color: #436; }

/* Einwilligungs-Checkbox */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  font-size: 0.82rem;
  margin-bottom: 14px;
  cursor: pointer;
}
.consent input { margin-top: 2px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--turkis-dunkel); }

/* gesperrter Button (bis die Checkbox angehakt ist) */
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== Cooles Orga-Login-Feld ===== */
.admin-card {
  background: linear-gradient(160deg, #073b4c, #0a1929);
  color: #fff;
  border: 2px solid #ffd23f;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 24px rgba(255,210,63,0.25);
}
.admin-card h2 { color: #ffd23f; }
.admin-card .hint { color: #b8d6e0; }
.admin-emoji {
  font-size: 3rem; line-height: 1; margin-bottom: 4px;
  animation: shieldpulse 1.3s ease-in-out infinite alternate;
}
@keyframes shieldpulse {
  from { transform: scale(1);    filter: drop-shadow(0 0 2px rgba(255,210,63,0.4)); }
  to   { transform: scale(1.14); filter: drop-shadow(0 0 12px rgba(255,210,63,0.9)); }
}
.admin-pass-input {
  width: 100%; padding: 13px 14px; font-size: 1.05rem; text-align: center;
  border: 2px solid #ffd23f; border-radius: 12px; margin-bottom: 10px;
  background: rgba(255,255,255,0.96); color: #0a1929; letter-spacing: 2px;
}
.admin-pass-input::placeholder { letter-spacing: normal; color: #6b7b83; }
.admin-msg { min-height: 1.3em; margin-bottom: 8px; font-weight: 800; }
.admin-card .btn { width: 100%; margin-top: 8px; }
.admin-ok-btn {
  background: linear-gradient(90deg, #ffd23f, #ff8c42); color: #0a1929; font-weight: 900;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.admin-ok-btn:active { transform: scale(0.97); }

/* ---- Lightbox (Foto groß) ---- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 60;
  padding: 20px;
}
.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  object-fit: contain;
}
.lightbox-caption { color: #fff; margin-top: 10px; font-weight: 600; }
.lightbox-close {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,0.2);
  color: #fff; border: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 1.2rem; cursor: pointer;
}

/* ---- Großes Bingo-/Voll-Overlay ---- */
.bingo-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 55;
  pointer-events: none;   /* Klicks gehen "durch" das Overlay */
}
.bingo-text {
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 18px var(--pink), 0 4px 10px rgba(0,0,0,0.4);
  animation: pop 0.5s ease;
  text-align: center;
  padding: 0 20px;
}
@keyframes pop {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---- Status-Zeile unten ---- */
.status {
  text-align: center;
  font-size: 0.8rem;
  color: var(--turkis-dunkel);
  margin: 14px auto 4px;
  min-height: 1.2em;
}

/* Hilfsklasse zum Aus-/Einblenden */
.hidden { display: none !important; }

/* ---- Größere Bildschirme (Tablet/Desktop) ---- */
@media (min-width: 600px) {
  .title { font-size: 2rem; }
  .cell .task { font-size: 0.85rem; }
}
