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

body {
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at 30% 20%, #1a1f3a, #0b0f1a 60%);
  color: #e6e9ff;
  min-height: 100vh;
  padding: 40px 20px 120px;
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  margin-bottom: 10px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.mystic-btn {
  background: rgba(124, 92, 255, 0.2);
  border: 1px solid rgba(124, 92, 255, 0.5);
  color: #c9d1ff;
  padding: 10px 18px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mystic-btn:hover {
  background: rgba(124, 92, 255, 0.4);
  box-shadow: 0 0 20px rgba(124, 92, 255, 0.4);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  max-width: 1200px;
}

.card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  padding: 16px;
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
}

.story-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 14px;
  color: white;
  transition: all 0.2s ease;
}

.story-btn:hover {
  background: rgba(124,92,255,0.8);
  transform: scale(1.1);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(124,92,255,0.3);
}

.card.active {
  border: 1px solid #7C5CFF;
  box-shadow: 0 0 25px rgba(124,92,255,0.5);
}

.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 12px;
}

.title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  margin-bottom: 10px;
}

.idle-text {
  opacity: 0.6;
  font-style: italic;
}

.play-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: #c9d1ff;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s;
}

.play-btn:hover {
  background: rgba(124,92,255,0.4);
}

#shuffleBtn.active {
  color: #7C5CFF;
  text-shadow: 0 0 8px rgba(124,92,255,0.8);
  transform: scale(1.15);
}

#shuffleBtn.active::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(124,92,255,0.6);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.8; }
  50% { opacity: 0.2; }
  100% { opacity: 0.8; }
}

.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(20,24,36,0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 30px;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-info img {
  width: 50px;
  height: 50px;
  border-radius: 12px;
}

.controls button {
  background: none;
  border: none;
  color: #c9d1ff;
  font-size: 20px;
  cursor: pointer;
  margin: 0 8px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: rgba(20,24,36,0.95);
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
}

.modal input {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.05);
  color: white;
}

.story-modal {
  position: fixed;
  inset: 0;

  background: rgba(10, 10, 15, 0.55); /* much lighter */
  backdrop-filter: blur(12px);

  display: flex;
  justify-content: center;
  align-items: center;

  z-index: 999;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.story-container {
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;

  padding: 2.5rem;

  background: rgba(25, 25, 35, 0.75);
  backdrop-filter: blur(20px);

  border-radius: 20px;

  box-shadow:
    0 20px 60px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.05);

  position: relative;

  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.story-modal.active .story-container {
  transform: scale(1);
}

.story-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.story-title {
  margin-bottom: 1rem;
}

.story-text {
  line-height: 1.8;
  white-space: pre-wrap;
}

.story-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.story-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
}

.story-divider {
  border: none;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin-bottom: 1.5rem;
}

body.story-open #gallery {
  opacity: 0.4;
  transition: opacity 0.25s ease;
}

.close-story {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #aaa;
  transition: color 0.2s ease;
}

.close-story:hover {
  color: white;
}

.yt-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 20px 0;
}

.yt-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
}