/* Party-Bingo — Mobile-first, kontrastreich, reizarm.
   Tap-Targets min. 44px, kein Hover-abhaengiges Design. */

:root {
  --bg: #101418;
  --surface: #1a2027;
  --surface-2: #232b34;
  --border: #323c47;
  --text: #eef2f6;
  --text-dim: #9aa7b4;
  --accent: #4c9aff;
  --accent-strong: #1f6fe5;
  --danger: #ff6b6b;
  --ok: #3ecf8e;
  --warn: #ffb454;
  --tap-min: 44px;
  --radius: 12px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
}

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px 24px;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.app__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
}

.app__title {
  font-size: 1.4rem;
  margin: 0;
  letter-spacing: 0.02em;
}

.view {
  flex: 1;
}

.loading {
  color: var(--text-dim);
}

/* Verbindungs-Indikator (dezent) */
.conn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--text-dim);
}
.conn--online { background: var(--ok); }
.conn--offline { background: var(--warn); }
.conn--unknown { background: var(--border); }

/* Basis-Buttons: grosse Tap-Targets */
button, .btn {
  min-height: var(--tap-min);
  font-size: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 16px;
  cursor: pointer;
}
button:active, .btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  font-weight: 600;
}

/* Panels / Textstile */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.muted { color: var(--text-dim); }
code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}

/* Layout-Helfer */
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; }
.row .input { flex: 1; }

/* Eingabefelder: grosse Tap-Targets, 16px (kein iOS-Zoom) */
.input {
  min-height: var(--tap-min);
  font-size: 16px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  width: 100%;
}
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Buttons in verschiedenen Groessen */
.btn--sm { min-height: 40px; min-width: 40px; padding: 0 10px; }
.btn--big { min-height: 52px; font-size: 1.1rem; }

/* Lobby-Kopf + Zaehler */
.lobby-head { display: flex; align-items: center; justify-content: space-between; }
.badge {
  min-width: 40px; text-align: center;
  padding: 4px 10px; border-radius: 999px; font-weight: 700;
}
.badge--ok { background: rgba(62, 207, 142, 0.18); color: var(--ok); }
.badge--warn { background: rgba(255, 180, 84, 0.18); color: var(--warn); }

/* Ereignisliste */
.events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.event {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.event__text { flex: 1; word-break: break-word; }
.event__edit { flex: 1; }

/* --- Bingo-Karte ---------------------------------------------------------
   5 gleich breite Spalten in 1fr: passt immer in die Breite, nie
   horizontales Scrollen. min-width:0 verhindert, dass langer Text die
   Spalte aufblaeht. */
.card-title { margin: 0; font-size: 1.1rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: 100%;
}

.cell {
  /* Keine feste aspect-ratio: echte Ereignistexte ("A verschuettet sein
     Bier") brauchen mehr Hoehe als ein Quadrat hergibt und wuerden sonst
     abgeschnitten. Die Zeile waechst mit dem laengsten Text mit. */
  min-width: 0;
  min-height: 68px; /* deutlich ueber dem 44px-Tap-Target */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 4px 3px;
  overflow: hidden;
  hyphens: auto;
  word-break: break-word;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  /* Mobile-Verhalten: kein Doppeltipp-Zoom, keine Textauswahl beim Halten,
     kein grauer Tap-Blitz. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.cell.is-marked {
  background: var(--accent-strong);
  border-color: var(--accent);
  font-weight: 600;
}

.cell--free { font-style: italic; }

/* --- Fortschrittsleiste --------------------------------------------------- */
.progress { display: flex; flex-direction: column; gap: 12px; }

.prog__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.prog__name { font-weight: 600; }
.prog__you { color: var(--text-dim); font-weight: 400; }
.prog__meta { color: var(--text-dim); font-size: 0.85rem; text-align: right; }

.prog__bar {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.prog__fill {
  height: 100%;
  background: var(--ok);
  border-radius: 999px;
}

/* --- Bingo-Overlay -------------------------------------------------------- */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6, 9, 12, 0.88);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.overlay.is-open { display: flex; }

.overlay__box {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  max-width: 340px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.overlay__title {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ok);
}
.overlay__name { margin: 0; font-size: 1.3rem; font-weight: 600; }

