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

:root {
  --accent: #6c63ff;
  --accent-glow: rgba(108, 99, 255, 0.4);
  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface-hover: #22222f;
  --text: #f0f0f5;
  --text-muted: #888899;
  --radius: 16px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

header {
  padding: 48px 20px 24px;
  text-align: center;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

header .subtitle {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 16px 40px;
  max-width: 600px;
  margin: 0 auto;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, background 0.15s ease;
  -webkit-user-select: none;
  border: 1.5px solid transparent;
}

.card:active {
  transform: scale(0.96);
}

.card.active {
  border-color: var(--accent);
  background: var(--surface-hover);
}

/* ── Cover area ── */
.card-cover {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1e2e, #2a2a3e);
}

.card-emoji {
  font-size: 2.8rem;
  line-height: 1;
  transition: opacity 0.2s;
}

.card.active .card-emoji {
  opacity: 0.35;
}

/* ── Pulsing ring ── */
.play-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2.5px solid var(--accent);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s, transform 0.3s;
}

.card.active .play-ring {
  opacity: 1;
  transform: scale(1);
  animation: pulse-ring 1.8s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%       { box-shadow: 0 0 0 8px transparent; }
}

/* ── Play / Pause icon overlay ── */
.play-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.card.active .play-icon {
  opacity: 1;
}

.play-icon svg {
  width: 36px;
  height: 36px;
  fill: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.icon-play  { display: block; }
.icon-pause { display: none;  }

.card.playing .icon-play  { display: none;  }
.card.playing .icon-pause { display: block; }

/* ── Card info ── */
.card-info {
  padding: 12px 12px 14px;
}

.card-info h2 {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-info p {
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Larger screens ── */
@media (min-width: 480px) {
  .card-emoji { font-size: 3.6rem; }
  .card-info h2 { font-size: 1rem; }
  .card-info p  { font-size: 0.8rem; }
}
