:root {
  --bg: #0b0b14;
  --bg-card: #14142255;
  --ink: #e8e4da;
  --ink-dim: #9a96a8;
  --gold: #d4af6a;
  --indigo: #4b4b78;
}

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

body {
  background: radial-gradient(ellipse at 50% -10%, #1a1a2e 0%, var(--bg) 60%);
  color: var(--ink);
  font: 17px/1.6 Georgia, 'Times New Roman', serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header { text-align: center; padding: 2.2rem 1rem 1rem; }
h1 { font-weight: normal; letter-spacing: 0.18em; font-size: 1.6rem; text-transform: uppercase; color: var(--gold); }
.tag { color: var(--ink-dim); font-style: italic; margin-top: 0.3rem; }

#series-nav { margin-top: 1.4rem; display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
#series-nav button {
  background: transparent; color: var(--ink-dim);
  border: 1px solid var(--indigo); border-radius: 999px;
  padding: 0.35rem 1rem; font: inherit; font-size: 0.85rem; cursor: pointer;
}
#series-nav button.active { color: var(--bg); background: var(--gold); border-color: var(--gold); }

main { flex: 1; width: min(640px, 100%); margin: 0 auto; padding: 1.5rem 1rem 3rem; }

.loop-card {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  width: 100%; text-align: left;
  background: var(--bg-card); color: var(--ink);
  border: 1px solid #ffffff14; border-radius: 12px;
  padding: 1rem 1.2rem; margin-bottom: 0.7rem;
  font: inherit; cursor: pointer;
}
.loop-card:hover { border-color: var(--gold); }
.loop-card .series { display: block; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.loop-card .dur { color: var(--ink-dim); font-size: 0.9rem; white-space: nowrap; }
.empty { text-align: center; color: var(--ink-dim); font-style: italic; padding: 3rem 0; }

/* ── Player ── */
#player { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; z-index: 10; }
#player-close { position: absolute; top: 1rem; left: 1rem; background: none; border: none; color: var(--ink-dim); font-size: 1.6rem; cursor: pointer; }
#stage { width: min(420px, 90vw); aspect-ratio: 9/16; max-height: 55vh; display: flex; align-items: center; justify-content: center; }
#video { width: 100%; height: 100%; object-fit: contain; border-radius: 16px; }

#breath { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.orb {
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0d9a8, var(--gold) 55%, #6b5320);
  box-shadow: 0 0 80px #d4af6a55;
  animation: breathe 10s ease-in-out infinite;
  animation-play-state: paused;
}
#player.playing .orb { animation-play-state: running; }
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  40%      { transform: scale(1.65); }  /* inhale ~4s */
  55%      { transform: scale(1.65); }  /* hold */
  95%      { transform: scale(1); }     /* exhale */
}

#now-title { font-weight: normal; margin-top: 1.4rem; font-size: 1.3rem; text-align: center; }
#now-meta { color: var(--ink-dim); font-size: 0.9rem; margin-top: 0.2rem; }
.controls { margin-top: 1.6rem; display: flex; align-items: center; gap: 1.2rem; }
#toggle {
  background: var(--gold); color: var(--bg); border: none; border-radius: 999px;
  padding: 0.7rem 2.4rem; font: inherit; font-size: 1rem; letter-spacing: 0.08em; cursor: pointer;
}
#loop-count { color: var(--ink-dim); font-size: 0.9rem; }

footer { text-align: center; padding: 1.2rem; color: var(--ink-dim); font-size: 0.8rem; }
footer a { color: var(--ink-dim); }
