:root {
  --lavender: #b39ddb;
  --sky: #90caf9;
  --purple: #7c4dba;
  --purple-mid: #9c5dba;
  --purple-muted: rgba(179, 157, 219, 0.6);
  --text-dark: #e2d4f8;
  --text-light: #7c4dba;
  --bg-light: #f5f0ff;
  --bg-hero-start: #f0e8ff;
  --bg-hero-end: #e8f4ff;
  --midnight-start: #0f0c1a;
  --midnight-mid: #13111f;
  --midnight-end: #0c1220;
  --discord: #5865F2;
  --peach: #e8a78f;
  --peach-hover: #f0bda5;
  --border-light: rgba(179, 157, 219, 0.3);
  --border-dark: rgba(179, 157, 219, 0.15);
  --glow: radial-gradient(circle at 70% 20%, rgba(179, 157, 219, 0.12) 0%, transparent 60%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
}

/* Page fade transition */
body {
  opacity: 1;
  transition: opacity 0.3s ease;
}

body.fade-out {
  opacity: 0;
}

html { scroll-behavior: smooth; }
.section-about, .section-community, .section-events { scroll-margin-top: 74px; }

/* Nav — floating pill */
.nav {
  position: fixed;
  top: 12px;
  left: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px 0 16px;
  height: 50px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 8, 20, 0.82);
  border: 1px solid rgba(179, 157, 219, 0.18);
  border-radius: 999px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.nav-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(179, 157, 219, 0.1);
  border: 1px solid rgba(179, 157, 219, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--lavender);
}

.nav-brand {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  letter-spacing: -0.2px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-links a {
  color: rgba(179, 157, 219, 0.55);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.3px;
  padding: 5px 14px;
  border-radius: 20px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(179, 157, 219, 0.08);
}

.nav-links a.active {
  color: rgba(255,255,255,0.95);
  background: rgba(179, 157, 219, 0.16);
}

.nav-links a.nav-shrine {
  background: linear-gradient(135deg, var(--peach), var(--lavender));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.7;
}
.nav-links a.nav-shrine:hover {
  opacity: 1;
  background-color: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity 0.2s, transform 0.1s;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(90deg, var(--lavender), var(--sky));
  color: white;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--lavender);
  color: var(--lavender);
}

.btn-discord {
  background: var(--discord);
  color: white;
}

/* Section label */
.section-label {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--purple-mid);
  margin-bottom: 12px;
}

/* Footer */
.footer {
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-dark);
  background: rgba(15, 12, 26, 0.95);
}

.footer-copy {
  font-size: 12px;
  color: rgba(179, 157, 219, 0.3);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 16px;
  list-style: none;
}

.footer-links a {
  font-size: 12px;
  color: rgba(179, 157, 219, 0.4);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--lavender);
}

/* Old footer toggle — replaced by side player */
.music-toggle { display: none; }

/* Side music player */
.music-player {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 280px;
  background: rgba(15, 12, 26, 0.78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(179, 157, 219, 0.18);
  border-radius: 14px;
  padding: 11px 12px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  z-index: 100;
  color: var(--text-dark);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  overflow: hidden;
}

.music-player.ready {
  opacity: 1;
  transform: translateY(0);
}

.music-player-art {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--lavender), var(--sky));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(124, 77, 186, 0.3);
}

.music-player-art.playing {
  animation: music-pulse 2.4s ease-in-out infinite;
}

@keyframes music-pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(124, 77, 186, 0.3); }
  50% { box-shadow: 0 4px 20px rgba(179, 157, 219, 0.55); }
}

.music-player-info {
  flex: 1;
  min-width: 0;
}

.music-player-label {
  font-size: 9px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: rgba(179, 157, 219, 0.5);
  margin-bottom: 2px;
  line-height: 1;
}

.music-player-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.music-player-controls {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.music-player-btn {
  background: none;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  padding: 0;
}

.music-player-btn:hover {
  background: rgba(179, 157, 219, 0.15);
  color: var(--lavender);
}

.music-player-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.music-player-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(179, 157, 219, 0.08);
}

.music-player-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--lavender), var(--sky));
  width: 0%;
  transition: width 0.25s linear;
}

/* Track list popup */
.music-tracklist {
  position: fixed;
  bottom: calc(24px + 74px + 8px);
  left: 24px;
  width: 280px;
  background: rgba(12, 9, 22, 0.92);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(179, 157, 219, 0.18);
  border-radius: 12px;
  z-index: 99;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.music-tracklist.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.music-tracklist-header {
  font-size: 9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(179, 157, 219, 0.45);
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(179, 157, 219, 0.08);
}
.mp-track-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(179, 157, 219, 0.05);
}
.mp-track-item:last-child { border-bottom: none; }
.mp-track-item:hover { background: rgba(179, 157, 219, 0.08); }
.mp-track-item.active { background: rgba(232, 167, 143, 0.07); }
.mp-track-num {
  font-size: 10px;
  color: rgba(179, 157, 219, 0.35);
  width: 16px;
  flex-shrink: 0;
  text-align: center;
}
.mp-track-item.active .mp-track-num {
  color: var(--peach);
}
.mp-track-name {
  font-size: 13px;
  color: rgba(226, 212, 248, 0.75);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-track-item.active .mp-track-name {
  color: white;
  font-weight: 500;
}
.music-player-btn.list-active {
  background: rgba(232, 167, 143, 0.15);
  color: var(--peach);
}

@media (max-width: 600px) {
  .music-player {
    bottom: 12px;
    left: 12px;
    right: 12px;
    width: auto;
  }
  .music-tracklist {
    bottom: calc(12px + 74px + 8px);
    left: 12px;
    right: 12px;
    width: auto;
    max-height: 50vh;
    overflow-y: auto;
  }
}

/* ===== MOBILE / TABLET ===== */
@media (max-width: 768px) {
  /* Nav: trim padding & link spacing so 4 links + Discord fit on a phone */
  .nav { left: 8px; right: 8px; padding: 0 8px 0 12px; height: 46px; border-radius: 999px; }
  .nav-logo { width: 28px; height: 28px; }
  .nav-brand { font-size: 13px; }
  .nav-links { gap: 0; }
  .nav-links a { font-size: 12px; padding: 4px 8px; }
  .btn-discord { padding: 6px 12px; font-size: 12px; }

  /* Footer stacks */
  .footer { flex-direction: column; gap: 12px; padding: 18px 24px; text-align: center; }
  .footer-right { flex-direction: column; gap: 10px; }

  /* Lightbox tighter padding */
  .lightbox { padding: 24px 12px; }
  .lightbox-close { top: 14px; right: 14px; width: 36px; height: 36px; font-size: 16px; }
  .lightbox img { max-width: 96vw; max-height: 80vh; }

  /* Modal */
  .modal { padding: 16px; }
  .modal-panel { padding: 28px 22px 24px; }

  /* Community header stacks */
  .community-header { flex-direction: column; align-items: flex-start; gap: 12px; padding: 0 20px 20px; }
}

@media (max-width: 480px) {
  /* Hide brand text — logo alone is enough, frees space for Discord button */
  .nav-brand { display: none; }
  .nav { padding: 0 6px 0 8px; }
  .nav-links a { font-size: 11px; padding: 4px 7px; letter-spacing: 0; }
  .btn-discord { padding: 5px 10px; font-size: 11px; }

  /* Section paddings */
  .load-more-wrap { padding: 8px 16px 48px; }
}

/* Community gallery section */
.section-community {
  padding: 60px 0 0;
}

.community-header {
  padding: 0 56px 24px;
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 900px) { .community-header { padding: 0 32px 20px; } }

/* Marquee */
.marquee-stack {
  padding: 0 0 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.marquee {
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}

.marquee-track {
  display: flex;
  gap: 22px;
  width: max-content;
  will-change: transform;
  animation-name: marquee-left;
  animation-duration: 80s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.marquee-track.reverse { animation-name: marquee-right; }

.marquee:hover .marquee-track,
.marquee-track:has(.gallery-tile:hover) { animation-play-state: paused; }

@keyframes marquee-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes marquee-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

.marquee-track .gallery-tile {
  flex-shrink: 0;
  cursor: zoom-in;
  overflow: hidden;
  position: relative;
  height: 280px;
  display: block;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  border-radius: 0;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease, filter 0.4s ease;
  break-inside: unset;
  margin-bottom: 0;
  opacity: 1;
  transform: none;
}

.marquee-track .gallery-tile img {
  width: auto;
  height: 100%;
  display: block;
  transition: none;
  filter: none;
}

.marquee-track .gallery-tile:hover {
  transform: scale(1.10);
  z-index: 10;
  box-shadow: 0 24px 48px rgba(124,77,186,0.5);
  filter: brightness(1.12);
}

@media (max-width: 900px) {
  .marquee-track .gallery-tile { height: 220px; }
  .marquee-stack { gap: 16px; }
}
@media (max-width: 540px) { .marquee-track .gallery-tile { height: 170px; } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

.load-more-wrap { text-align: center; padding: 8px 32px 64px; }

.btn-load-more {
  background: transparent;
  border: 1px solid var(--lavender);
  color: var(--lavender);
  padding: 10px 28px;
  border-radius: 24px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-load-more:hover { background: var(--lavender); color: white; }
.btn-load-more:disabled { opacity: 0.3; cursor: default; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8,5,16,0.96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.open { opacity: 1; pointer-events: auto; }

.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  transform: scale(0.98);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox.open img { transform: scale(1); }

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.08);
  color: white;
  border-color: rgba(255,255,255,0.4);
}

/* Submit modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal.open { opacity: 1; pointer-events: auto; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8,5,16,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  background: linear-gradient(160deg, #15101f, #1a1429);
  border: 1px solid rgba(179,157,219,0.18);
  border-radius: 14px;
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 32px 64px rgba(0,0,0,0.6);
  transform: translateY(8px);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal.open .modal-panel { transform: translateY(0); }

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: rgba(179,157,219,0.5);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: rgba(179,157,219,0.1); color: var(--lavender); }

.auth-gate { text-align: center; }
.auth-gate h2 { font-family: serif; font-size: 22px; color: var(--text-dark); margin-bottom: 10px; }
.auth-gate p { color: var(--purple-muted); font-size: 13px; line-height: 1.7; margin-bottom: 24px; }
.auth-gate small { display: block; color: rgba(179,157,219,0.3); font-size: 11px; margin-top: 14px; }

.upload-form { display: none; }
.upload-form h2 { font-family: serif; font-size: 22px; color: var(--text-dark); margin-bottom: 18px; }

.user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(179,157,219,0.08);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 18px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(179,157,219,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.user-status { font-size: 10px; color: rgba(179,157,219,0.5); }

.user-signout {
  background: none;
  border: none;
  color: rgba(179,157,219,0.4);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.user-signout:hover { color: var(--lavender); }

.dropzone {
  border: 2px dashed rgba(179,157,219,0.3);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 14px;
  background: rgba(179,157,219,0.03);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--lavender); background: rgba(179,157,219,0.07); }
.dropzone-icon { font-size: 28px; margin-bottom: 8px; }
.dropzone h3 { font-size: 14px; color: var(--text-dark); font-weight: 600; margin-bottom: 4px; }
.dropzone p { font-size: 11px; color: var(--purple-muted); margin-bottom: 12px; }

input[type="file"] { display: none; }

.btn-browse {
  border: 1px solid rgba(179,157,219,0.4);
  color: var(--lavender);
  background: none;
  padding: 6px 18px;
  border-radius: 18px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-browse:hover { background: var(--lavender); color: white; }

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.preview-item { position: relative; border-radius: 6px; overflow: hidden; aspect-ratio: 1; }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  border: none;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.status-msg { font-size: 12px; padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; display: none; }
.status-msg.success { background: rgba(144,202,249,0.1); border: 1px solid rgba(144,202,249,0.3); color: var(--sky); display: block; }
.status-msg.error { background: rgba(244,114,114,0.1); border: 1px solid rgba(244,114,114,0.3); color: #f47272; display: block; }
