/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:        #16120e;
  --bg2:       #1e1812;
  --bg3:       #261e14;
  --gold:      #d4a017;
  --gold-dim:  #a07810;
  --gold-glow: rgba(212, 160, 23, 0.15);
  --cream:     #f2e8d5;
  --cream-dim: #b8a88a;
  --text:      #e8dcc8;
  --border:    rgba(212, 160, 23, 0.18);
  --radius:    16px;
  --font-disp: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --safe-b:    env(safe-area-inset-bottom, 0px);
  --safe-t:    env(safe-area-inset-top, 0px);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Screens ───────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
}
.screen.active { display: flex; }

/* ── JOIN SCREEN ───────────────────────────────────────── */
#join-screen {
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
}

.join-bg-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
}
.orb1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #d4a017, transparent 70%);
  top: -150px; right: -100px;
  animation: float1 8s ease-in-out infinite;
}
.orb2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #8b4513, transparent 70%);
  bottom: -100px; left: -80px;
  animation: float2 10s ease-in-out infinite;
}
.orb3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, #d4a017, transparent 70%);
  bottom: 20%; right: 15%;
  opacity: 0.12;
  animation: float1 12s ease-in-out infinite reverse;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 30px); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -20px); }
}

.join-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: min(380px, 92vw);
  padding: 48px 40px;
  background: rgba(30, 24, 18, 0.85);
  border: 1px solid var(--border);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,160,23,0.08);
  animation: cardIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.join-logo {
  font-size: 52px;
  filter: drop-shadow(0 0 20px rgba(212,160,23,0.5));
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.join-title {
  font-family: var(--font-disp);
  font-size: 36px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  text-shadow: 0 0 40px rgba(212,160,23,0.3);
}

.join-sub {
  font-size: 15px;
  color: var(--cream-dim);
  font-weight: 300;
  margin-top: -8px;
}

.join-card input[type="text"] {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
}
.join-card input[type="text"]::placeholder { color: rgba(242,232,213,0.3); }
.join-card input[type="text"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,160,23,0.15);
}

/* ── Buttons ───────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--gold);
  color: #16120e;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(212,160,23,0.3);
}
.btn-primary:hover {
  background: #e0b020;
  box-shadow: 0 6px 24px rgba(212,160,23,0.45);
}
.btn-primary:active { transform: scale(0.98); }

/* ── CHAT SCREEN ───────────────────────────────────────── */
#chat-screen {
  background: var(--bg);
  display: none;
  flex-direction: column;
  height: 100dvh;
}
#chat-screen.active { display: flex; }

/* Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-t));
  background: rgba(22, 18, 14, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-icon { font-size: 24px; }

.header-title {
  font-family: var(--font-disp);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.header-online {
  font-size: 12px;
  color: var(--cream-dim);
  margin-top: 2px;
}

.header-name {
  font-size: 13px;
  color: var(--cream-dim);
  background: rgba(212,160,23,0.1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Messages */
.messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 12px 0;
  scroll-behavior: smooth;
}

.messages-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 100%;
  justify-content: flex-end;
}

/* Message bubbles */
.msg {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  animation: msgIn 0.25s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.msg.own {
  align-self: flex-end;
  align-items: flex-end;
}
.msg.other {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--gold-dim);
  margin-bottom: 3px;
  padding: 0 4px;
  letter-spacing: 0.3px;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

.msg.own .msg-bubble {
  background: linear-gradient(135deg, #3a2d10, #2a2008);
  border: 1px solid rgba(212,160,23,0.25);
  border-bottom-right-radius: 4px;
  color: var(--cream);
}

.msg.other .msg-bubble {
  background: var(--bg3);
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom-left-radius: 4px;
  color: var(--text);
}

.msg-time {
  font-size: 10px;
  color: rgba(184, 168, 138, 0.5);
  margin-top: 3px;
  padding: 0 4px;
}

/* Image messages */
.msg-img {
  max-width: 260px;
  max-height: 320px;
  border-radius: 16px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;
  border: 1px solid var(--border);
  display: block;
}
.msg-img:hover { transform: scale(1.02); }

/* System messages */
.system-msg {
  text-align: center;
  font-size: 12px;
  color: rgba(184,168,138,0.45);
  padding: 6px 0;
  font-style: italic;
}

/* Typing indicator */
.typing-indicator {
  padding: 6px 0 4px;
  font-size: 12px;
  color: var(--cream-dim);
  font-style: italic;
  min-height: 24px;
}
.typing-indicator.hidden { visibility: hidden; }

/* ── INPUT AREA ────────────────────────────────────────── */
.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: calc(10px + var(--safe-b));
  background: rgba(22, 18, 14, 0.95);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.upload-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--cream-dim);
  transition: color 0.2s, border-color 0.2s;
}
.upload-btn:hover { color: var(--gold); border-color: var(--gold); }
.upload-btn svg { width: 20px; height: 20px; }
.upload-btn input[type="file"] { display: none; }

.input-wrapper {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.input-wrapper:focus-within { border-color: var(--gold); }

#message-input {
  width: 100%;
  padding: 11px 16px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
}
#message-input::placeholder { color: rgba(184,168,138,0.35); }

.send-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #16120e;
  transition: background 0.2s, transform 0.1s;
}
.send-btn:hover { background: #e0b020; }
.send-btn:active { transform: scale(0.94); }
.send-btn svg { width: 18px; height: 18px; }

/* ── PREVIEW BAR ───────────────────────────────────────── */
.preview-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  padding-bottom: calc(14px + var(--safe-b));
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideUp 0.25s ease both;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.preview-bar.hidden { display: none; }

.preview-bar img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.preview-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preview-info span {
  font-size: 13px;
  color: var(--cream-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

#preview-cancel {
  background: none;
  border: none;
  color: var(--cream-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.preview-send-btn {
  width: auto;
  padding: 10px 20px;
  flex-shrink: 0;
}

/* ── Lightbox ──────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox img {
  max-width: 96vw;
  max-height: 92dvh;
  object-fit: contain;
  border-radius: 8px;
}

/* ── Scrollbar ─────────────────────────────────────────── */
.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb {
  background: rgba(212,160,23,0.2);
  border-radius: 4px;
}

/* ── Admin Button ──────────────────────────────────────── */
.admin-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.25;
  transition: opacity 0.3s;
  padding: 4px;
  line-height: 1;
}
.admin-btn:hover { opacity: 0.8; }

/* ── Admin Modal ───────────────────────────────────────── */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-modal.hidden { display: none; }

.admin-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
}

.admin-card {
  position: relative;
  z-index: 1;
  background: #1e1812;
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 24px;
  padding: 40px 36px;
  width: min(340px, 92vw);
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  animation: cardIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

.admin-icon { font-size: 40px; margin-bottom: 12px; }
.admin-title { font-family: var(--font-disp); font-size: 26px; color: var(--gold); margin-bottom: 6px; }
.admin-sub { font-size: 13px; color: var(--cream-dim); margin-bottom: 28px; }

/* PIN Eingabe */
.pin-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.pin-digit {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  background: rgba(255,255,255,0.05);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--gold);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-text-security: disc;
}
.pin-digit:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,160,23,0.2);
}

.pin-error {
  font-size: 13px;
  color: #e05050;
  margin-bottom: 16px;
  min-height: 20px;
}
.pin-error.hidden { visibility: hidden; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(6px); }
}
.shake { animation: shake 0.4s ease; }

.admin-cancel {
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--cream-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.admin-cancel:hover { color: var(--cream); }

/* Export Buttons */
.export-btn {
  display: block;
  padding: 14px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  margin: 10px 0;
  transition: opacity 0.2s, transform 0.1s;
}
.export-btn:hover { opacity: 0.85; transform: scale(1.01); }
.export-btn:active { transform: scale(0.98); }

.export-pdf {
  background: var(--gold);
  color: #16120e;
}
.export-zip {
  background: rgba(212,160,23,0.1);
  color: var(--gold);
  border: 1px solid rgba(212,160,23,0.3);
}

/* ── Delete Button ─────────────────────────────────────── */
.delete-btn {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  padding: 2px 4px;
  transition: opacity 0.2s;
  align-self: center;
}
.msg:hover .delete-btn:not(.hidden) { opacity: 0.6; }
.delete-btn:not(.hidden):hover { opacity: 1 !important; }
.delete-btn.hidden { display: none; }

/* ── Name Lock Note ────────────────────────────────────── */
.join-lock-note {
  font-size: 12px;
  color: var(--gold-dim);
  text-align: center;
  background: rgba(212,160,23,0.08);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: -8px;
}

/* ── Hidden utility für Modal-Views ───────────────────── */
#pin-view.hidden,
#export-view.hidden { display: none !important; }

/* ── Chat Toggle ───────────────────────────────────────── */
.admin-divider {
  border: none;
  border-top: 1px solid rgba(212,160,23,0.15);
  margin: 16px 0;
}

.chat-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(212,160,23,0.06);
  border: 1px solid rgba(212,160,23,0.2);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 4px;
}

.chat-toggle-label {
  font-size: 14px;
  color: var(--cream);
}

.chat-toggle-btn {
  background: rgba(212,160,23,0.15);
  border: 1px solid rgba(212,160,23,0.3);
  border-radius: 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.chat-toggle-btn:hover { background: rgba(212,160,23,0.25); }
.chat-toggle-btn.closed {
  background: rgba(224,80,80,0.15);
  border-color: rgba(224,80,80,0.3);
  color: #e05050;
}

/* ── Chat geschlossen Banner ───────────────────────────── */
.chat-closed-banner {
  background: rgba(224,80,80,0.12);
  border-top: 1px solid rgba(224,80,80,0.25);
  color: #e08080;
  text-align: center;
  font-size: 13px;
  padding: 10px;
  flex-shrink: 0;
}

/* ── Reaktionen ────────────────────────────────────────── */
.reactions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.reaction-pick {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.msg:hover .reaction-pick {
  opacity: 1;
  pointer-events: all;
}

.reaction-add-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  font-size: 15px;
  padding: 2px 7px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  line-height: 1.4;
}
.reaction-add-btn:hover {
  background: rgba(212,160,23,0.2);
  transform: scale(1.15);
}

.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(212,160,23,0.1);
  border: 1px solid rgba(212,160,23,0.22);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  color: var(--cream);
  line-height: 1.4;
}
.reaction-chip:hover {
  background: rgba(212,160,23,0.25);
  transform: scale(1.05);
}
.reaction-chip.mine {
  background: rgba(212,160,23,0.22);
  border-color: var(--gold);
}
.reaction-chip .r-count {
  font-size: 12px;
  color: var(--cream-dim);
}

/* ── Galerie ───────────────────────────────────────────── */
.gallery-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 4px;
}
.gallery-btn:hover { opacity: 1; }

.gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.2s ease;
}
.gallery-overlay.hidden { display: none; }

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  padding-top: calc(14px + var(--safe-t));
  background: rgba(22,18,14,0.95);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-disp);
  font-size: 20px;
  color: var(--gold);
  flex-shrink: 0;
}

.gallery-header button {
  background: none;
  border: none;
  color: var(--cream-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  overflow-y: auto;
  padding: 3px;
  flex: 1;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s;
  display: block;
}
.gallery-grid img:hover { opacity: 0.85; }

.gallery-empty {
  grid-column: 1/-1;
  text-align: center;
  color: var(--cream-dim);
  padding: 60px 20px;
  font-size: 15px;
}

/* ── Galerie Button Override ───────────────────────────── */
.gallery-btn {
  background: rgba(212,160,23,0.1);
  border: 1px solid rgba(212,160,23,0.3);
  border-radius: 20px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  opacity: 1 !important;
  letter-spacing: 0.3px;
}
.gallery-btn:hover {
  background: rgba(212,160,23,0.22);
}

/* ── Header Zähler ─────────────────────────────────────── */
.header-online {
  font-size: 11px !important;
}

/* ── Scroll-to-Bottom Button ───────────────────────────── */
.scroll-btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #16120e;
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 20;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}
.scroll-btn.hidden { display: none; }
.scroll-btn:hover { background: #e0b020; }

.messages { position: relative; }

/* ── Umfrage Card ──────────────────────────────────────── */
.poll-card {
  background: linear-gradient(135deg, #1e1812, #261e14);
  border-top: 2px solid var(--gold);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  flex-shrink: 0;
  animation: slideUp 0.3s ease both;
}
.poll-card.hidden { display: none; }

.poll-question {
  font-family: var(--font-disp);
  font-size: 17px;
  color: var(--gold);
  margin-bottom: 10px;
  font-weight: 600;
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.poll-option {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  transition: border-color 0.2s;
}
.poll-option:hover { border-color: rgba(212,160,23,0.4); }
.poll-option.voted { border-color: var(--gold); }

.poll-option-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(212,160,23,0.15);
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  border-radius: 10px;
}
.poll-option.voted .poll-option-bar { background: rgba(212,160,23,0.25); }

.poll-option-content {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  z-index: 1;
}

.poll-option-label { font-size: 14px; color: var(--text); }
.poll-option.voted .poll-option-label { color: var(--gold); font-weight: 500; }

.poll-option-pct {
  font-size: 13px;
  color: var(--cream-dim);
  font-weight: 600;
  min-width: 36px;
  text-align: right;
}

.poll-footer {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(184,168,138,0.5);
}

/* ── Admin Poll Form ───────────────────────────────────── */
.poll-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.poll-form-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 2px;
}
.poll-form input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
}
.poll-form input[type="text"]:focus {
  border-color: var(--gold);
}
.poll-form input::placeholder { color: rgba(242,232,213,0.25); }

/* ── Poll Result Overlay ───────────────────────────────── */
.poll-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}
.poll-result-overlay.hidden { display: none; }

#confetti-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

.poll-result-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(160deg, #1e1812, #2a2010);
  border: 1px solid var(--gold);
  border-radius: 28px;
  padding: 40px 36px 32px;
  width: min(380px, 92vw);
  text-align: center;
  box-shadow: 0 0 60px rgba(212,160,23,0.25), 0 32px 80px rgba(0,0,0,0.7);
  animation: cardIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

.poll-result-icon {
  font-size: 44px;
  margin-bottom: 12px;
  animation: pulse 2s ease-in-out infinite;
}

.poll-result-question {
  font-family: var(--font-disp);
  font-size: 15px;
  color: var(--cream-dim);
  margin-bottom: 20px;
  font-style: italic;
}

.poll-result-winner-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 6px;
}

.poll-result-winner {
  font-family: var(--font-disp);
  font-size: 30px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(212,160,23,0.4);
  margin-bottom: 24px;
  line-height: 1.2;
}

.poll-result-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  text-align: left;
}

.pr-bar-row { display: flex; flex-direction: column; gap: 3px; }
.pr-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--cream-dim);
}
.pr-bar-label .pr-opt { color: var(--cream); font-weight: 500; }
.pr-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  overflow: hidden;
}
.pr-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.pr-bar-fill.winner {
  background: linear-gradient(90deg, #e0a010, #ffd050);
  box-shadow: 0 0 8px rgba(212,160,23,0.5);
}

.poll-result-total {
  font-size: 12px;
  color: rgba(184,168,138,0.45);
  margin-bottom: 16px;
}

.poll-result-progress {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.poll-result-progress-bar {
  height: 100%;
  background: var(--gold);
  width: 100%;
  transform-origin: left;
  animation: countdown 8s linear forwards;
}
@keyframes countdown {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ── Poll Result Chat Card ─────────────────────────────── */
.poll-result-msg {
  align-self: stretch !important;
  max-width: 100% !important;
}

.poll-result-chat-card {
  background: linear-gradient(135deg, #1e1812, #261e14);
  border: 1px solid rgba(212,160,23,0.35);
  border-left: 3px solid var(--gold);
  border-radius: 14px;
  padding: 14px 16px;
  width: 100%;
}

.prc-title {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 4px;
}

.prc-question {
  font-family: var(--font-disp);
  font-size: 16px;
  color: var(--cream);
  margin-bottom: 12px;
  font-style: italic;
}

.prc-bars { display: flex; flex-direction: column; gap: 6px; }

.prc-bar-row { display: flex; flex-direction: column; gap: 2px; }
.prc-bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--cream-dim);
}
.prc-bar-meta .prc-opt { color: var(--cream); }
.prc-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  overflow: hidden;
}
.prc-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: rgba(212,160,23,0.3);
  transition: width 0.8s ease;
}
.prc-bar-fill.winner { background: var(--gold); }

.prc-total {
  margin-top: 10px;
  font-size: 11px;
  color: rgba(184,168,138,0.4);
  text-align: right;
}

/* ── Pinnwand Banner ───────────────────────────────────── */
.pin-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #2a2008, #1e1812);
  border-bottom: 1px solid rgba(212,160,23,0.4);
  border-left: 3px solid var(--gold);
  flex-shrink: 0;
  animation: slideUp 0.3s ease both;
}
.pin-banner.hidden { display: none; }

.pin-icon { font-size: 16px; flex-shrink: 0; }

#pin-text {
  flex: 1;
  font-size: 14px;
  color: var(--cream);
  font-weight: 500;
}

.pin-close-banner {
  background: none;
  border: none;
  color: var(--cream-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.pin-close-banner:hover { opacity: 1; }

/* ── Pin Form ──────────────────────────────────────────── */
.pin-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pin-form input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
}
.pin-form input:focus { border-color: var(--gold); }
.pin-form input::placeholder { color: rgba(242,232,213,0.25); }

/* ── QR-Code ───────────────────────────────────────────── */
.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#qr-code {
  background: white;
  padding: 12px;
  border-radius: 12px;
  display: inline-block;
}
#qr-code canvas, #qr-code img { display: block; }

.qr-hint {
  font-size: 12px;
  color: var(--cream-dim);
  text-align: center;
}

/* ── Slideshow ─────────────────────────────────────────── */
.slideshow-start-btn {
  background: rgba(212,160,23,0.12);
  border: 1px solid rgba(212,160,23,0.3);
  border-radius: 16px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.slideshow-start-btn:hover { background: rgba(212,160,23,0.25); }

.slideshow-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.slideshow-overlay.hidden { display: none; }

.slideshow-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}
.slideshow-close:hover { background: rgba(255,255,255,0.2); }

.slideshow-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  font-size: 48px;
  width: 56px;
  height: 80px;
  border-radius: 12px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
  line-height: 1;
}
.slideshow-nav:hover { background: rgba(255,255,255,0.18); }
.slideshow-prev { left: 12px; }
.slideshow-next { right: 12px; }

.slideshow-img-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 80px;
}

#slideshow-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  animation: fadeIn 0.4s ease;
}

.slideshow-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.slideshow-counter {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

.slideshow-progress-track {
  width: min(300px, 60vw);
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  overflow: hidden;
}

.slideshow-progress-fill {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width linear;
}

/* ── QR Header Button ──────────────────────────────────── */
.qr-header-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.5;
  padding: 4px;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.qr-header-btn:hover { opacity: 1; }

/* ── QR Overlay ────────────────────────────────────────── */
.qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-overlay.hidden { display: none; }

.qr-overlay-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
}

.qr-overlay-card {
  position: relative;
  z-index: 1;
  background: #1e1812;
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 24px;
  padding: 36px 32px;
  width: min(300px, 88vw);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  animation: cardIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

.qr-overlay-title {
  font-family: var(--font-disp);
  font-size: 22px;
  color: var(--gold);
}

.qr-url {
  font-size: 12px;
  color: var(--cream-dim);
  word-break: break-all;
}

/* ── QR Header Button Override ─────────────────────────── */
.qr-header-btn {
  background: rgba(212,160,23,0.1);
  border: 1px solid rgba(212,160,23,0.3);
  border-radius: 20px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  opacity: 1 !important;
  letter-spacing: 0.3px;
}
.qr-header-btn:hover { background: rgba(212,160,23,0.22); }

/* ── Rate Limit Feedback ───────────────────────────────── */
#message-input[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Header Menu ───────────────────────────────────────── */
.header-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.header-menu-btn {
  background: rgba(212,160,23,0.1);
  border: 1px solid rgba(212,160,23,0.3);
  border-radius: 20px;
  color: var(--gold);
  font-size: 18px;
  font-weight: 700;
  padding: 4px 14px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s;
  letter-spacing: 2px;
}
.header-menu-btn:hover { background: rgba(212,160,23,0.22); }

.header-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1e1812;
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  min-width: 180px;
  z-index: 100;
  animation: cardIn 0.2s cubic-bezier(0.34,1.56,0.64,1) both;
}
.header-menu-dropdown.hidden { display: none; }

.header-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(212,160,23,0.08);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.header-menu-item:last-child { border-bottom: none; }
.header-menu-item:hover { background: rgba(212,160,23,0.1); color: var(--gold); }

/* ── Slideshow Button Override ─────────────────────────── */
.slideshow-start-btn {
  background: rgba(212,160,23,0.1) !important;
  border: 1px solid rgba(212,160,23,0.3) !important;
  border-radius: 20px !important;
  color: var(--gold) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 5px 14px !important;
  opacity: 1 !important;
  letter-spacing: 0.3px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s;
}
.slideshow-start-btn:hover {
  background: rgba(212,160,23,0.22) !important;
}

/* ── Gästeliste ────────────────────────────────────────── */
.guests-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.guests-overlay.hidden { display: none; }

.guests-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
}

.guests-card {
  position: relative;
  z-index: 1;
  background: #1e1812;
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 24px;
  padding: 32px 28px;
  width: min(320px, 88vw);
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  animation: cardIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 80vh;
}

.guests-title {
  font-family: var(--font-disp);
  font-size: 22px;
  color: var(--gold);
  text-align: center;
}

.guests-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 50vh;
}

.guest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(212,160,23,0.06);
  border: 1px solid rgba(212,160,23,0.12);
  border-radius: 12px;
  font-size: 14px;
  color: var(--cream);
  animation: msgIn 0.2s ease both;
}

.guest-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(212,160,23,0.2);
  border: 1px solid rgba(212,160,23,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--gold);
  font-weight: 600;
  flex-shrink: 0;
}

.guest-name { flex: 1; }
.guest-you {
  font-size: 11px;
  color: var(--gold-dim);
  background: rgba(212,160,23,0.1);
  border-radius: 10px;
  padding: 2px 8px;
}

/* ── Download Button ───────────────────────────────────── */
.lightbox {
  flex-direction: column;
  gap: 16px;
}

.lightbox-actions {
  display: flex;
  gap: 12px;
  z-index: 1;
}

.lightbox-download {
  background: rgba(212,160,23,0.15);
  border: 1px solid rgba(212,160,23,0.4);
  border-radius: 20px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 20px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lightbox-download:hover { background: rgba(212,160,23,0.28); }

.gallery-grid img { position: relative; }

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}
.gallery-item:hover img { opacity: 0.8; }

.gallery-item-download {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  text-decoration: none;
  color: white;
}
.gallery-item:hover .gallery-item-download { opacity: 1; }

/* ── Admin Tabs ────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
}

.admin-tab {
  flex: 1;
  background: none;
  border: none;
  border-radius: 9px;
  color: var(--cream-dim);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  padding: 7px 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.admin-tab:hover { color: var(--cream); }
.admin-tab.active {
  background: rgba(212,160,23,0.15);
  color: var(--gold);
  border: 1px solid rgba(212,160,23,0.25);
}

.admin-tab-content { display: flex; flex-direction: column; gap: 8px; }
.admin-tab-content.hidden { display: none; }

/* ── Reconnect Banner ──────────────────────────────────── */
.reconnect-banner {
  background: rgba(224,80,80,0.12);
  border-top: 1px solid rgba(224,80,80,0.25);
  border-bottom: 1px solid rgba(224,80,80,0.25);
  color: #e08080;
  text-align: center;
  font-size: 13px;
  padding: 10px 16px;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}
