:root {
  --pink-50: #fff5f9;
  --pink-100: #ffe3ee;
  --pink-200: #ffd1e3;
  --pink-300: #f9a8c9;
  --pink-500: #f472a6;
  --pink-700: #c2457a;
  --ink: #141014;
  --ink-2: #4a3d45;
  --muted: #8a7480;
  --card: #ffffff;
  --line: #f6d3e1;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(194, 69, 122, 0.12);
  --mini-h: 72px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--pink-50);
  color: var(--ink);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--mini-h) + env(safe-area-inset-bottom));
}

a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; }

.container { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }

/* Header */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 245, 249, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  max-width: 760px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 700; font-size: 1.15rem;
}
.brand img { border-radius: 10px; }

#view { outline: none; padding-top: 20px; min-height: 60vh; }

/* Hero */
.hero {
  background: var(--pink-300);
  border-radius: var(--radius);
  padding: 28px 22px;
  display: flex; align-items: center; gap: 18px;
}
.hero img { width: 88px; height: 88px; border-radius: 22px; flex: none; }
.hero h1 { margin: 0 0 4px; font-size: 1.6rem; line-height: 1.2; }
.hero p { margin: 0; color: var(--ink-2); }

h2.section { font-size: 1.1rem; margin: 28px 0 12px; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.story-card {
  display: flex; gap: 14px; padding: 14px;
  text-decoration: none; margin-bottom: 12px;
}
.story-card img { width: 96px; height: 96px; border-radius: 14px; flex: none; }
.story-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.story-card p { margin: 0; color: var(--ink-2); font-size: 0.92rem; }

.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  background: var(--pink-100); color: var(--pink-700);
  border-radius: 999px; padding: 2px 10px; margin-bottom: 6px;
}

.continue {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  text-decoration: none;
}
.continue img { width: 56px; height: 56px; border-radius: 12px; flex: none; }
.continue .grow { flex: 1; min-width: 0; }
.continue strong { display: block; }

/* Progress bars */
.bar { display: block; height: 4px; background: var(--pink-100); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar > div { height: 100%; background: var(--pink-500); }

/* Story page */
.story-head { display: flex; gap: 18px; align-items: flex-end; }
.story-head img { width: 150px; height: 150px; border-radius: 20px; box-shadow: var(--shadow); flex: none; }
.story-head h1 { margin: 0 0 4px; font-size: 1.6rem; line-height: 1.2; }
.story-head p { margin: 0; color: var(--ink-2); }
.story-desc { color: var(--ink-2); margin: 18px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 22px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: #2b2229; }
.btn.ghost { background: var(--pink-100); color: var(--pink-700); }
.btn.ghost:hover { background: var(--pink-200); }

.chapters { list-style: none; padding: 0; margin: 0; }
.chapter {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; text-decoration: none; border-bottom: 1px solid var(--line);
}
.chapters li:last-child .chapter { border-bottom: 0; }
.chapter .num {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700;
  background: var(--pink-100); color: var(--pink-700);
}
.chapter.playing .num { background: var(--pink-500); color: #fff; }
.chapter .grow { flex: 1; min-width: 0; }
.chapter strong { display: block; }
.chapter small { color: var(--muted); }

/* Chapter / full player */
.player { padding: 22px; text-align: center; }
.player .cover { width: min(260px, 70vw); height: auto; aspect-ratio: 1; border-radius: 22px; margin: 0 auto 18px; box-shadow: var(--shadow); }
.player h1 { font-size: 1.35rem; margin: 0; }
.player .sub { color: var(--muted); margin: 2px 0 16px; }

.seek { width: 100%; accent-color: var(--pink-500); }
.times { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0 6px; }
.icon-btn {
  background: transparent; border: 0; cursor: pointer;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--pink-100); }
.icon-btn svg { width: 26px; height: 26px; }
.icon-btn.round { background: var(--ink); color: #fff; }
.icon-btn.round:hover { background: #2b2229; }
.icon-btn.big { width: 68px; height: 68px; }
.icon-btn.big svg { width: 32px; height: 32px; }
.icon-btn:disabled { opacity: 0.3; cursor: default; background: transparent; }

.speeds {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--pink-100); border-radius: 999px;
}
.speeds button {
  border: 0; background: transparent; border-radius: 999px; cursor: pointer;
  min-width: 56px; padding: 7px 14px; font-weight: 600; color: var(--pink-700);
}
.speeds button.on { background: var(--ink); color: #fff; }

.chapter-summary { text-align: left; color: var(--ink-2); margin-top: 18px; }

.mentions { padding: 16px; margin-top: 16px; }
.mentions h3 { margin: 0 0 8px; font-size: 1rem; }
.mentions ul { margin: 0; padding-left: 18px; }

/* Mini player */
.miniplayer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--ink); color: #fff;
  padding-bottom: env(safe-area-inset-bottom);
}
.mini-progress { height: 3px; background: rgba(255,255,255,0.15); }
.mini-progress > div { height: 100%; width: 0; background: var(--pink-500); }
.mini-row { max-width: 760px; margin: 0 auto; padding: 0 16px; height: calc(var(--mini-h) - 3px); display: flex; align-items: center; gap: 12px; }
.mini-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.mini-info img { border-radius: 10px; flex: none; }
.mini-info span { min-width: 0; }
.mini-info strong, .mini-info small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-info small { color: var(--pink-200); }
.miniplayer .icon-btn.round { background: var(--pink-500); }

/* Between-chapter card */
.overlay {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(20, 16, 20, 0.55);
  display: grid; place-items: center; padding: 16px;
}
.overlay[hidden] { display: none; }
.between-card { position: relative; max-width: 380px; width: 100%; padding: 24px; text-align: center; }
.between-card h3 { margin: 4px 0 6px; }
.between-card .btn { width: 100%; margin-top: 10px; }
.eyebrow { margin: 0; color: var(--pink-700); font-weight: 600; font-size: 0.85rem; }
.close {
  position: absolute; top: 8px; right: 10px; border: 0; background: transparent;
  font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted);
}

.footer { padding-top: 32px; padding-bottom: 24px; font-size: 0.85rem; color: var(--ink-2); }
.footer p { margin: 2px 0; }

.empty { padding: 40px 0; text-align: center; color: var(--muted); }

@media (max-width: 480px) {
  .story-head { flex-direction: column; align-items: flex-start; }
  .story-head img { width: 120px; height: 120px; }
  .hero { padding: 22px 18px; }
  .hero img { width: 64px; height: 64px; border-radius: 16px; }
  .hero h1 { font-size: 1.3rem; }
}
