:root {
  --bg: #eaf3fc;
  --ocean: #12395e;
  --card: #ffffff;
  --text: #0d2b4d;
  --muted: #5a7390;
  --accent: #1f64b4;
  --accent-dark: #164c8c;
  --flag: #ffcc33;
  --border: #cfe0f2;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.ocean { background: var(--ocean); }

.center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: 0 10px 40px rgba(13, 43, 77, 0.12);
}

.emoji { font-size: 48px; text-align: center; margin-bottom: 8px; }

h1 { margin: 0 0 8px; font-size: 26px; text-align: center; }

p.lead { margin: 0 0 24px; color: var(--muted); text-align: center; line-height: 1.5; }

label { display: block; font-weight: 600; margin: 16px 0 6px; }

input {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}

input:focus { outline: none; border-color: var(--accent); }

button, .button {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 15px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

button:hover, .button:hover { background: var(--accent-dark); }
button:disabled { opacity: 0.6; cursor: wait; }

.link { display: block; text-align: center; margin-top: 16px; color: var(--muted); }

.error { color: #b3261e; margin-top: 12px; min-height: 1.2em; text-align: center; }

.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---------- Sprachauswahl ---------- */

.lang-corner { position: fixed; top: 12px; right: 12px; z-index: 1100; }

.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(13, 43, 77, 0.15);
  cursor: pointer;
  white-space: nowrap;
}

.lang-switch select {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}

/* ---------- Startseite mit Karte im Hintergrund ---------- */

#bg-map {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--ocean);
}

.overlay { position: relative; z-index: 10; }

.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
}

/* Auf dem Handy: kompakteres Fenster, damit mehr Karte zu sehen ist */
@media (max-width: 500px) {
  .overlay { align-items: flex-end; padding-top: 64px; }
  .glass { padding: 20px 18px; }
  .glass .emoji { display: none; }
  .glass h1 { font-size: 22px; }
  .glass p.lead { margin-bottom: 8px; font-size: 15px; }
  .glass label { margin-top: 10px; }
  .glass input { padding: 12px 14px; }
  .glass button { margin-top: 16px; }
  .glass .link { margin-top: 10px; }
}

/* ---------- Karte ---------- */

.leaflet-container { background: var(--ocean); font-family: inherit; }

.map-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }

.map-header {
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 1000;
}

.map-header h1 { font-size: 20px; text-align: left; margin: 0; }
.map-header .count { color: var(--muted); font-size: 14px; }
.map-header a { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 12px; }

#map { flex: 1; }

.flag-icon { background: none; border: none; }
.flag-icon svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45)); }
.flag-new svg { animation: wave 1.2s ease-in-out 3; transform-origin: 15% 100%; }

@keyframes wave {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(-8deg) scale(1.1); }
}

.welcome {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--flag);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  font-weight: 600;
  max-width: calc(100% - 32px);
  text-align: center;
}

/* ---------- QR ---------- */

#qrcode { display: flex; justify-content: center; margin: 24px 0 12px; }
#qrcode img, #qrcode canvas { max-width: 100%; }
.url { text-align: center; word-break: break-all; color: var(--muted); font-size: 14px; }

@media print {
  .no-print { display: none !important; }
  .card { box-shadow: none; }
  body { background: #fff; }
}

/* ---------- Admin ---------- */

table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 15px; }
td { padding: 10px 4px; border-bottom: 1px solid var(--border); }
td button { margin: 0; padding: 6px 10px; font-size: 13px; width: auto; }
