:root {
  --bg: #140a1f;
  --bg-2: #1e1030;
  --card: #241539;
  --primary: #ff3d9a;
  --primary-dark: #c81f78;
  --accent: #22d3ee;
  --text: #f4ecff;
  --muted: #b9a9d6;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at 50% -10%, var(--bg-2), var(--bg));
  color: var(--text);
  min-height: 100vh;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 90px;
  position: relative;
}

h1 { text-align: center; font-size: 1.9rem; margin-bottom: 4px; }
.subtitle { text-align: center; color: var(--muted); margin: 4px 0 20px; }

.nav-tile {
  display: block;
  width: 100%;
  padding: 20px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(255, 61, 154, 0.35);
}
.nav-tile:active { transform: scale(0.98); }
.nav-tile.subtle { background: #2c1b45; box-shadow: none; color: var(--muted); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
}
.card-name { text-align: center; font-weight: bold; margin: 8px 0 2px; }

.btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:disabled { opacity: 0.5; }
.btn-block { width: 100%; margin-bottom: 16px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid img, .grid video {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #000;
}

.like-row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.crown { position: absolute; top: 4px; left: 8px; font-size: 1.6rem; filter: drop-shadow(0 1px 2px #000); }

.sort-row { display: flex; gap: 8px; margin-bottom: 14px; }
.sort-row .btn { flex: 1; background: #2c1b45; color: var(--muted); }
.sort-row .btn.active { background: var(--primary); color: white; }

/* drehendes Emoji + Deko */
.spin { font-size: 5rem; text-align: center; display: block; margin: 20px 0; animation: spin 4s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.confetti-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.confetti-layer span { position: absolute; font-size: 1.6rem; opacity: 0.5; }
.polaroid-placeholder {
  position: absolute; width: 66px; height: 80px; background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15); border-radius: 4px;
}
.page > *:not(.confetti-layer) { position: relative; z-index: 1; }

#qrcode { display: flex; justify-content: center; margin-top: 20px; }
#qrcode img, #qrcode canvas { padding: 10px; background: #fff; border-radius: 10px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.9);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.lightbox.open { display: flex; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* Mitternachts-Overlay */
.bday-overlay {
  position: fixed; inset: 0; background: rgba(20,10,31,0.85);
  display: flex; align-items: center; justify-content: center; z-index: 60; text-align: center;
}
.bday-msg { font-size: 2rem; font-weight: bold; color: var(--primary); padding: 20px; }

/* Chat */
.chat-feed {
  display: flex; flex-direction: column; gap: 8px;
  height: 60vh; overflow-y: auto; padding: 8px;
  background: rgba(0,0,0,0.2); border-radius: 12px; margin-bottom: 12px;
}
.chat-message { background: var(--card); border-radius: 10px; padding: 8px 12px; }
.chat-message .nickname { font-weight: bold; color: var(--accent); }
.chat-input-row { display: flex; gap: 8px; position: sticky; bottom: 12px; }
.chat-input-row input {
  flex: 1; padding: 12px; border-radius: 10px; border: 1px solid #3a2a55;
  background: var(--card); color: var(--text);
}

/* Diashow */
.diashow-stage {
  position: fixed; inset: 0; background: #000;
  display: flex; align-items: center; justify-content: center;
}
.diashow-stage img, .diashow-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
