:root {
  --pride-red:    #E40303;
  --pride-orange: #FF8C00;
  --pride-yellow: #FFED00;
  --pride-green:  #008026;
  --pride-blue:   #004DFF;
  --pride-purple: #750787;

  --bg:           #f7f7f9;
  --card-bg:      #ffffff;
  --text:         #1a1a2e;
  --muted:        #888;
  --border:       #e8e8ee;
  --input-bg:     #f2f2f6;
  --shadow:       0 2px 16px rgba(0,0,0,0.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Roboto Condensed', sans-serif;
  background-color: var(--pride-yellow);
  background-image:
    radial-gradient(ellipse at 0% 0%,    rgba(117,  7, 135, 0.72) 0%, transparent 58%),
    radial-gradient(ellipse at 100% 0%,  rgba(228,  3,   3, 0.72) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%,rgba(  0, 77, 255, 0.68) 0%, transparent 55%),
    radial-gradient(ellipse at 0%  100%, rgba(  0, 128, 38, 0.68) 0%, transparent 55%),
    radial-gradient(ellipse at 50%  38%, rgba(255, 140,   0, 0.55) 0%, transparent 48%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  font-size: 1rem;
  line-height: 1.5;
  position: relative;
}

/* Grain-Overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* Weiß-Overlay zum Aufhellen */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.52);
  z-index: 0;
  pointer-events: none;
}

/* ── Typografie ─────────────────────────────────────────── */
h1 {
  font-family: 'Alfa Slab One', serif;
  font-weight: 400;
  font-size: 1.8rem;
  color: var(--text);
  margin-bottom: 0.3rem;
  line-height: 1.2;
}
h2 {
  font-family: 'Alfa Slab One', serif;
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}
h3 {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.5rem;
  background: #fff;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg,
    var(--pride-red), var(--pride-orange),
    var(--pride-yellow), var(--pride-green),
    var(--pride-blue), var(--pride-purple)) 1;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: 'Alfa Slab One', serif;
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-logo {
  height: 32px;
  width: auto;
  display: block;
}

/* ── Layout ─────────────────────────────────────────────── */
.container {
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.8rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  border-left: 4px solid transparent;
}
.alert-error   { background: #fff0f0; border-color: var(--pride-red);    color: #b00; }
.alert-warning { background: #fff8ee; border-color: var(--pride-orange);  color: #a05000; }
.alert-success { background: #f0faf2; border-color: var(--pride-green);   color: #005a1a; }
.alert a { color: inherit; font-weight: 700; }

/* ── Formulare ──────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="email"],
.chat-form input {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-group input:focus,
.chat-form input:focus {
  border-color: var(--pride-blue);
  box-shadow: 0 0 0 3px rgba(0,77,255,0.08);
  background: #fff;
}

.optional {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.82rem;
}

.consent-box {
  background: var(--input-bg);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
  font-size: 0.88rem;
  line-height: 1.6;
  border: 1px solid var(--border);
}
.consent-box h3 { font-size: 0.9rem; margin-bottom: 0.4rem; }
.consent-box a { color: var(--pride-blue); }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.8rem;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.5;
}
.checkbox-label input { margin-top: 0.2rem; accent-color: var(--pride-blue); flex-shrink: 0; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: 50px;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  margin: 0.3rem 0.2rem 0.3rem 0;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.btn-primary:hover {
  background: #fff;
  color: var(--text);
  border-color: var(--text);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--pride-blue);
  color: var(--pride-blue);
}

.btn-small {
  padding: 0.3rem 0.9rem;
  font-size: 0.82rem;
}

/* ── Code-Anzeige ────────────────────────────────────────── */
.code-display {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 3rem;
  letter-spacing: 0.35em;
  font-weight: 700;
  padding: 1.2rem;
  background: var(--input-bg);
  border-radius: 14px;
  margin: 1.5rem 0;
  color: var(--text);
  border: 2px dashed var(--border);
  text-align: center;
}

code {
  background: var(--input-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.9em;
  letter-spacing: 0.08em;
  border: 1px solid var(--border);
  color: var(--pride-blue);
}

/* ── Links ───────────────────────────────────────────────── */
.login-link {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}
.login-link a { color: var(--pride-blue); font-weight: 700; text-decoration: none; }
.login-link a:hover { text-decoration: underline; }

.hint { color: var(--muted); font-size: 0.88rem; margin-bottom: 1.2rem; line-height: 1.5; }
.muted { color: var(--muted); }
.text-center { text-align: center; }

/* ── Radio / Onboarding ──────────────────────────────────── */
.radio-group { display: flex; flex-direction: column; gap: 0.7rem; margin: 1.2rem 0; }

.radio-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  background: var(--input-bg);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.95rem;
}
.radio-card:hover { border-color: var(--pride-blue); background: #f0f4ff; }
.radio-card input { accent-color: var(--pride-blue); width: 1.1rem; height: 1.1rem; flex-shrink: 0; }

.radio-inline { display: flex; gap: 1.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.radio-inline label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.95rem; }

/* ── Dashboard Grid ──────────────────────────────────────── */
.section-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  margin-top: 1rem;
}

.section-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.4rem 1rem;
  background: var(--card-bg);
  border-radius: 14px;
  border: 2px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  gap: 0.4rem;
  box-shadow: var(--shadow);
}
.section-card:hover {
  border-color: var(--pride-blue);
  box-shadow: 0 4px 20px rgba(0,77,255,0.1);
}
.section-card.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.section-card .section-icon { font-size: 1.8rem; }
.section-card small { font-weight: 400; color: var(--muted); font-size: 0.78rem; }

/* ── Companion Liste ─────────────────────────────────────── */
.companion-list { list-style: none; padding: 0; }
.companion-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  font-size: 0.95rem;
}
.companion-list li:last-child { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  padding: 0.2rem 0.7rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-green  { background: #e8f9ee; color: #006620; border: 1px solid #b3e8c2; }
.badge-orange { background: #fff4e5; color: #a05000; border: 1px solid #ffd8a0; }

/* ── Admin Tabelle ───────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 0.8rem;
}
.admin-table th {
  text-align: left;
  padding: 0.5rem 0.8rem;
  background: var(--input-bg);
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}
.admin-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--input-bg); }

/* ── Info-Seite ──────────────────────────────────────────── */
.info-block {
  margin-bottom: 1.4rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--border);
}
.info-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.info-block ul { padding-left: 1.2rem; line-height: 1.9; }
.info-block a { color: var(--pride-blue); }

/* ── Mitglieder ──────────────────────────────────────────── */
.members-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.member-chip {
  padding: 0.35rem 1rem;
  border-radius: 50px;
  background: var(--input-bg);
  border: 2px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.15s;
}
.member-chip:hover { border-color: var(--pride-blue); }
.companion-chip { border-color: #d0e8ff; background: #f0f6ff; color: var(--pride-blue); }

/* ── Chat ────────────────────────────────────────────────── */
.chat-box {
  height: 380px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--input-bg);
  border-radius: 12px;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border: 1px solid var(--border);
}

.chat-message { max-width: 80%; align-self: flex-start; }
.chat-message.own { align-self: flex-end; }

.chat-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
}
.chat-author { font-weight: 700; color: var(--pride-blue); }
.chat-time   { color: var(--muted); }

.chat-delete {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  padding: 0;
  transition: color 0.15s;
}
.chat-delete:hover { color: var(--pride-red); }

.chat-content {
  background: #fff;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  border-radius: 4px 12px 12px 12px;
  line-height: 1.5;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.chat-message.own .chat-content {
  background: #eef1ff;
  border-color: #c8d0ff;
  border-radius: 12px 4px 12px 12px;
}

.chat-form {
  display: flex;
  gap: 0.5rem;
}
.chat-form input { flex: 1; }

/* ── Abfragen ────────────────────────────────────────────── */
.survey-block {
  margin-bottom: 1.8rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--border);
}
.survey-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

/* ── Avatar Creator ──────────────────────────────────────── */
.avatar-creator {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.avatar-preview-wrap { text-align: center; flex-shrink: 0; }

#avatarCanvas {
  border-radius: 12px;
  border: 2px solid var(--border);
  image-rendering: pixelated;
  box-shadow: var(--shadow);
}

.avatar-options { flex: 1; min-width: 260px; }

.option-group { margin-bottom: 1.1rem; }
.option-group > label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.color-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.color-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.color-dot.selected { border-color: var(--text); transform: scale(1.15); }
.rainbow-dot {
  background: linear-gradient(135deg,
    #E40303 0%, #FF8C00 20%, #FFED00 40%,
    #008026 60%, #004DFF 80%, #750787 100%);
}

.style-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.style-btn {
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-size: 0.83rem;
  font-family: 'Roboto Condensed', sans-serif;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.style-btn:hover { border-color: var(--pride-blue); background: #f0f4ff; }
.style-btn.selected {
  border-color: var(--pride-blue);
  background: #eef1ff;
  color: var(--pride-blue);
  font-weight: 700;
}

/* ── Dashboard Header (Avatar + Name) ───────────────────── */
.dashboard-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.mini-avatar {
  border-radius: 10px;
  border: 2px solid var(--border);
  image-rendering: pixelated;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}
.mini-avatar:hover {
  border-color: var(--pride-blue);
  box-shadow: 0 2px 12px rgba(0,77,255,0.12);
}

.avatar-placeholder {
  width: 64px; height: 64px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  transition: border-color 0.15s;
  flex-shrink: 0;
}
.avatar-placeholder:hover { border-color: var(--pride-blue); }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .container { margin: 1rem auto; padding: 0 0.75rem; }

  .card { padding: 1.2rem; border-radius: 12px; }

  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.05rem; }

  .navbar { padding: 0.75rem 1rem; }
  .nav-links a { margin-left: 0; padding: 0.3rem 0.5rem; font-size: 0.85rem; }

  .section-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .section-card { padding: 1rem 0.6rem; font-size: 0.88rem; }
  .section-card .section-icon { font-size: 1.5rem; }

  .btn { padding: 0.65rem 1.2rem; font-size: 0.9rem; }

  .code-display { font-size: 2rem; letter-spacing: 0.25em; }

  .chat-box { height: 300px; }
  .chat-message { max-width: 90%; }

  .avatar-creator { flex-direction: column; gap: 1.2rem; }
  .avatar-preview-wrap { width: 100%; }
  #avatarCanvas { width: 160px; height: 160px; }

  .admin-table { font-size: 0.78rem; }
  .admin-table th, .admin-table td { padding: 0.4rem 0.5rem; }

  .companion-list li { font-size: 0.88rem; }

  .radio-card { padding: 0.75rem 0.9rem; }

  .dashboard-header { gap: 0.8rem; }
}