:root {
  --ink: #fffaf0;
  --ink-soft: rgba(255, 250, 240, .82);
  --night: #1b1433;
  --sun: #ffd84d;
  --sun-deep: #f2a900;
  --berry: #e8455a;
  --lav: #b9a6ff;
  --mint: #7ee8b5;
  --ep-bg: #1b1433;
  --ep-accent: #ffd84d;
  --radius: 26px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--ink); }
body {
  font-family: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 999px; }

/* ---------- Device: phone = the whole viewport; desktop = a phone mockup ---------- */
.device { position: fixed; inset: 0; }
.device-notch, .desk-side { display: none; }
.screen { position: absolute; inset: 0; overflow: hidden; background: var(--night); isolation: isolate; }

@media (min-width: 760px) and (hover: hover) {
  body {
    background:
      radial-gradient(1200px 800px at 15% 10%, #3b2a6b 0%, transparent 60%),
      radial-gradient(900px 700px at 90% 90%, #6b2a4a 0%, transparent 60%),
      #140f27;
  }
  /* The phone is laid out at a real phone size (390 x 844) and scaled as a whole to fit the window (--k set in app.js). */
  .device {
    inset: auto; left: 50%; top: 50%;
    width: 414px; height: 868px; padding: 12px;
    transform: translate(-50%, -50%) scale(var(--k, 1));
    border-radius: 64px;
    background: linear-gradient(145deg, #3a3550, #121020 45%, #2a2640);
    box-shadow: 0 0 0 2px #4b4566, 0 40px 90px rgba(0,0,0,.55), inset 0 0 0 2px rgba(255,255,255,.06);
  }
  .screen { inset: 12px; border-radius: 52px; --safe-t: 44px; --safe-b: 16px; }
  .device-notch {
    display: block; position: absolute; z-index: 50; left: 50%; top: 24px;
    width: 124px; height: 34px; transform: translateX(-50%);
    background: #000; border-radius: 999px;
  }
}
@media (min-width: 1180px) and (hover: hover) {
  .desk-side {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    position: fixed; left: calc(50% - var(--pw, 400px) / 2 - 330px); top: 50%; transform: translateY(-50%);
    width: 260px; text-align: center;
  }
  .desk-logo { width: 220px; filter: drop-shadow(0 8px 18px rgba(0,0,0,.4)); }
  .desk-copy { margin: 0; font-size: 20px; line-height: 1.35; color: var(--ink-soft); }
  .desk-qr { background: #fff; padding: 12px; border-radius: 18px; line-height: 0; }
  .desk-qr:empty { display: none; }
  .desk-qr img { width: 168px; height: 168px; image-rendering: pixelated; }
  .desk-url { margin: 0; font-size: 13px; color: rgba(255,255,255,.5); word-break: break-all; }
}

/* ---------- Splash ---------- */
.splash {
  position: absolute; inset: 0; z-index: 3;
  background: linear-gradient(180deg, #6f86d6 0%, #9c9be0 14%, #e7a9b8 24%, #f6b98f 32%, #f6b98f 100%);
}
.splash-bg {
  position: absolute; left: 0; right: 0; bottom: 0; top: 17%; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 12%); mask-image: linear-gradient(180deg, transparent 0%, #000 12%);
}
.splash-bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: 42% 20%;
  transform-origin: 45% 30%;
  animation: kenburns 24s ease-in-out infinite alternate;
}
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.08) translateY(-1%); } }
.splash-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.splash-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(40, 30, 90, .45) 0%, rgba(40, 30, 90, 0) 26%),
    linear-gradient(0deg, rgba(27, 20, 51, .96) 0%, rgba(27, 20, 51, .78) 22%, rgba(27, 20, 51, 0) 46%);
}
.splash-top { position: absolute; left: 0; right: 0; top: calc(var(--safe-t) + 6px); display: flex; justify-content: center; }
.splash-logo {
  width: min(64%, 270px);
  filter: drop-shadow(0 6px 0 rgba(90, 30, 60, .35)) drop-shadow(0 14px 24px rgba(20, 10, 40, .45));
  animation: logoDrop 1.1s var(--ease-bounce) .15s both, logoFloat 5s ease-in-out 1.4s infinite;
}
@keyframes logoDrop {
  0% { transform: translateY(-120%) scale(.6) rotate(-6deg); opacity: 0; }
  60% { transform: translateY(4%) scale(1.04, .94) rotate(1deg); opacity: 1; }
  80% { transform: translateY(-2%) scale(.98, 1.03); }
  100% { transform: none; }
}
@keyframes logoFloat { 50% { transform: translateY(-5px) rotate(-.6deg); } }

.splash-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 24px calc(var(--safe-b) + 26px);
  display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center;
}
.splash-tag {
  margin: 0; font-size: 26px; font-weight: 600; line-height: 1.15; letter-spacing: .2px;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
  animation: rise .8s var(--ease-out) .7s both;
}
.splash-tag em { font-style: normal; color: var(--sun); }
.btn-go {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 250px; height: 72px; padding: 0 34px; border-radius: 999px;
  background: linear-gradient(180deg, #ffe680 0%, var(--sun) 45%, #ffc21a 100%);
  color: #3a1d00; font-size: 28px; font-weight: 700; letter-spacing: .3px;
  box-shadow: 0 7px 0 #c98500, 0 16px 30px rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.7);
  animation: rise .8s var(--ease-out) .9s both;
  transition: transform .12s, box-shadow .12s;
}
.btn-go svg { width: 28px; height: 28px; }
.btn-go::after {
  content: ""; position: absolute; inset: -6px; border-radius: inherit;
  border: 2px solid rgba(255, 216, 77, .7); animation: ring 2.2s ease-out 2s infinite; pointer-events: none;
}
.btn-go:active { transform: translateY(5px); box-shadow: 0 2px 0 #c98500, 0 8px 18px rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.7); }
@keyframes ring { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.25, 1.5); opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.splash-hint {
  margin: 0; display: inline-flex; align-items: center; gap: 8px;
  font-size: 16px; color: var(--ink-soft); animation: rise .8s var(--ease-out) 1.1s both;
}
.splash-hint svg { width: 20px; height: 20px; }

/* ---------- Circle reveal ---------- */
.app { position: absolute; inset: 0; z-index: 2; visibility: hidden; }
.app.is-in { visibility: visible; }
.app.is-revealing { z-index: 4; animation: circleIn 1s cubic-bezier(.7, 0, .2, 1) both; }
@keyframes circleIn {
  from { clip-path: circle(0% at var(--cx, 50%) var(--cy, 50%)); }
  to { clip-path: circle(150% at var(--cx, 50%) var(--cy, 50%)); }
}
.reveal { display: none; }

/* ---------- Pages (swipe track) ---------- */
.pages { position: absolute; inset: 0; width: 200%; display: flex; touch-action: pan-y; will-change: transform; }
.pages.anim { transition: transform .5s var(--ease-out); }
.page { position: relative; width: 50%; height: 100%; overflow: hidden; container: page / size; }

/* ---------- Library ---------- */
.library {
  background:
    radial-gradient(120% 60% at 50% 0%, #3d2b78 0%, rgba(61,43,120,0) 70%),
    linear-gradient(180deg, #2a1f55 0%, #1b1433 55%, #150f29 100%);
}
.lib-scroll {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-t) + 14px) 18px 0; scrollbar-width: none;
}
.lib-scroll::-webkit-scrollbar { display: none; }
.lib-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.lib-logo { width: 132px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
.lib-greet { margin: 0; font-size: 20px; font-weight: 600; text-align: right; line-height: 1.15; color: var(--ink-soft); }
.lib-greet b { display: block; color: var(--ink); font-size: 24px; }
.lib-label { margin: 6px 2px 10px; font-size: 15px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--sun); }

.feat {
  position: relative; display: block; width: 100%; height: 400px; border-radius: 30px; overflow: hidden; text-align: left;
  box-shadow: 0 18px 40px rgba(0,0,0,.45); border: 1.5px solid var(--s, rgba(255,255,255,.12));
  transition: transform .15s;
}
.feat:active { transform: scale(.985); }
.feat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.feat::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--c, #1b1433) 0%, rgba(0,0,0,0) 55%); }
.feat-body { position: absolute; z-index: 1; left: 18px; right: 18px; bottom: 18px; display: flex; align-items: flex-end; gap: 14px; }
.feat-text { flex: 1; min-width: 0; }
.feat-title { margin: 6px 0 4px; font-size: 30px; font-weight: 700; line-height: 1.02; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.feat-meta { margin: 0; font-size: 16px; color: var(--ink-soft); }
.feat-play {
  flex: none; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sun); color: #3a1d00; box-shadow: 0 5px 0 #c98500, 0 10px 20px rgba(0,0,0,.35);
}
.feat-play svg { width: 34px; height: 34px; margin-left: 4px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 8px; border-radius: 999px;
  font-size: 15px; font-weight: 600; white-space: nowrap; background: rgba(15, 10, 35, .62); color: var(--ink);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1.5px solid rgba(255,255,255,.28);
}
.badge svg { width: 18px; height: 18px; flex: none; }
.feat-text .badge { position: relative; z-index: 2; }

/* Three series chips in one row that never scrolls (a scrolling row fought the swipe to the player) */
.chips { display: flex; gap: 6px; margin: 22px 0 16px; }
.chip {
  flex: 1 1 auto; min-width: 0; white-space: nowrap; height: 46px; padding: 0 10px; border-radius: 999px; font-size: 16px; font-weight: 600;
  background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.22); color: var(--ink);
  transition: background .2s, color .2s, transform .12s;
}
.chip:active { transform: scale(.95); }
.chip.is-on { background: var(--ink); color: var(--night); border-color: var(--ink); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-head {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 14px 2px -2px;
  font-size: 22px; font-weight: 700; letter-spacing: .2px;
}
.grid-head:first-child { margin-top: 0; }
.grid-head svg { width: 26px; height: 26px; }
.card {
  position: relative; display: block; width: 100%; aspect-ratio: 3 / 4.3; border-radius: 22px; overflow: hidden; text-align: left;
  box-shadow: 0 10px 24px rgba(0,0,0,.4); border: 1.5px solid var(--s, rgba(255,255,255,.12));
  animation: rise .5s var(--ease-out) both; transition: transform .15s;
}
.card:active { transform: scale(.97); }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--c, #1b1433) 5%, rgba(0,0,0,0) 60%); }
.card .badge { position: absolute; z-index: 1; top: 10px; left: 10px; height: 28px; font-size: 13px; }
.card-body { position: absolute; z-index: 1; left: 12px; right: 12px; bottom: 12px; }
.card-title { margin: 0 0 2px; font-size: 19px; font-weight: 700; line-height: 1.05; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.card-meta { margin: 0; font-size: 14px; color: var(--ink-soft); }
.card.is-current { box-shadow: 0 0 0 3px var(--sun), 0 10px 24px rgba(0,0,0,.4); }
.lib-spacer { height: calc(var(--safe-b) + 110px); }

.mini {
  position: absolute; z-index: 5; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px);
  display: flex; align-items: center; gap: 12px; height: 76px; padding: 8px 10px 8px 8px; border-radius: 24px; text-align: left;
  background: rgba(30, 22, 60, .78); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1.5px solid rgba(255,255,255,.2); box-shadow: 0 12px 30px rgba(0,0,0,.45);
  animation: rise .4s var(--ease-out) both;
}
.mini-art { width: 60px; height: 60px; border-radius: 16px; object-fit: cover; }
.mini-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-text b { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-text small { font-size: 14px; color: var(--ink-soft); }
.mini-play { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); color: #3a1d00; }
.mini-play svg { width: 28px; height: 28px; }

/* play / pause icon swap */
.i-pause { display: none; }
.is-playing .i-play { display: none; }
.is-playing .i-pause { display: block; }

.swipe-tip {
  position: absolute; z-index: 6; left: 50%; top: calc(var(--safe-t) + 74px); transform: translateX(-50%);
  margin: 0; padding: 10px 16px; border-radius: 999px; font-size: 15px; font-weight: 600; white-space: nowrap;
  background: rgba(0,0,0,.6); color: #fff; opacity: 0; pointer-events: none; transition: opacity .4s;
}
.swipe-tip.show { opacity: 1; }

/* ---------- Player ---------- */
.player { background: var(--ep-bg); }
.stage { position: absolute; inset: 0; overflow: hidden; }
.stage-img {
  position: absolute; inset: -2%; width: 104%; height: 104%; object-fit: cover; object-position: var(--focus, 50% 30%);
  transform-origin: 50% 35%;
  animation: breathe 20s ease-in-out infinite alternate;
}
.calm .stage-img { animation-duration: 36s; }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.06); } }
.fx, .flash { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.flash { opacity: 0; mix-blend-mode: screen; }
.player-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.42) 0%, rgba(0,0,0,0) 14%),
    linear-gradient(0deg, var(--ep-bg) 0%, var(--ep-bg) 24%, color-mix(in srgb, var(--ep-bg) 80%, transparent) 38%, color-mix(in srgb, var(--ep-bg) 0%, transparent) 60%);
}
.player-top { position: absolute; z-index: 3; left: 14px; right: 14px; top: calc(var(--safe-t) + 10px); display: flex; justify-content: space-between; }
.btn-back {
  display: inline-flex; align-items: center; gap: 4px; height: 50px; padding: 0 18px 0 10px; border-radius: 999px;
  font-size: 18px; font-weight: 600;
  background: rgba(10, 8, 25, .55); border: 2px solid rgba(255,255,255,.55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.btn-back svg { width: 26px; height: 26px; }

.player-bottom {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; container-type: inline-size;
  padding: 0 22px calc(var(--safe-b) + 18px);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
/* Series and part as a small line above the title, on the gradient (not a pill over the art) */
.slot { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 15px; font-weight: 600; letter-spacing: .2px; color: var(--ink-soft); text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.slot svg { width: 16px; height: 16px; flex: none; }
.p-title {
  margin: 0; font-size: 36px; font-weight: 700; line-height: 1.02; letter-spacing: -.2px;
  text-shadow: 0 3px 16px rgba(0,0,0,.55);
  text-wrap: balance;
}
.p-title .accent { color: var(--ep-accent); }
.p-hook { margin: 8px 0 0; font-size: 17px; line-height: 1.3; color: var(--ink-soft); text-wrap: balance; max-width: 330px; }
.wave { width: 100%; height: 64px; margin: 8px 0 2px; }
.scrub { width: 100%; }
#seek {
  -webkit-appearance: none; appearance: none; width: 100%; height: 36px; margin: 0; background: transparent; cursor: pointer;
  --p: 0%;
}
#seek::-webkit-slider-runnable-track {
  height: 8px; border-radius: 99px;
  background: linear-gradient(90deg, var(--ep-accent) var(--p), rgba(255,255,255,.28) var(--p));
}
#seek::-moz-range-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,.28); }
#seek::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--ep-accent); }
#seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%;
  background: #fff; border: 4px solid var(--ep-accent); box-shadow: 0 2px 8px rgba(0,0,0,.45);
}
#seek::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 4px solid var(--ep-accent); }
.times { display: flex; justify-content: space-between; margin-top: -2px; font-size: 15px; font-weight: 500; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.controls { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.controls > * { flex: none; aspect-ratio: 1; height: auto !important; }
.c-btn {
  width: min(60px, 17.5cqw); border-radius: 50%; display: grid; place-items: center;
  background: rgba(10, 8, 25, .5); border: 2.5px solid rgba(255,255,255,.75); color: #fff;
  transition: transform .12s, background .2s;
}
.c-btn svg { width: 56%; height: 56%; }
.c-btn.c-sm { width: min(52px, 15cqw); border-color: rgba(255,255,255,.5); }
.c-sm svg { width: 46%; height: 46%; }
.c-btn:active, .c-play:active { transform: scale(.92); }
.c-btn:disabled { opacity: .35; }
.c-play {
  position: relative; width: min(92px, 26.5cqw); border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #fff3b8, var(--ep-accent) 60%);
  color: #21123a; box-shadow: 0 0 0 5px rgba(255,255,255,.25), 0 12px 28px rgba(0,0,0,.45);
  transition: transform .12s;
}
.c-play svg { width: 48%; height: 48%; }
.c-play .i-play { margin-left: 5px; }
.c-spin { position: absolute; inset: -5px; border-radius: 50%; border: 4px solid transparent; border-top-color: #fff; opacity: 0; }
.c-play.is-loading .c-spin { opacity: 1; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* shorter phones (measured on the page, so the desktop mockup is unaffected) */
@container page (max-height: 700px) {
  .p-hook { display: none; }
  .p-title { font-size: 30px; }
  .feat { height: 330px; }
  .c-play { width: min(80px, 23cqw); }
}

@media (prefers-reduced-motion: reduce) {
  .splash-bg img, .stage-img, .splash-logo, .btn-go::after { animation: none !important; }
  .app.is-revealing { animation-duration: .01s; }
}

/* ---------- Reviewer mode (review.js) ---------- */
.rv-on .p-hook { display: none; }
.rv-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 16px; border-radius: 999px;
  font-size: 17px; font-weight: 600; background: rgba(10, 8, 25, .55); border: 2px solid rgba(255,255,255,.55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.rv-pill i { width: 12px; height: 12px; border-radius: 50%; }
.rv-row { width: 100%; display: flex; gap: 10px; margin: 2px 0 4px; }
.rv-btn {
  height: 44px; padding: 0 14px; border-radius: 999px; font-size: 16px; font-weight: 600;
  background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.3);
}
.rv-add { flex: 1; background: var(--ep-accent); color: #1b1433; border-color: transparent; }
.rv-add b { font-size: 20px; margin-right: 2px; }
.rv-now { font-variant-numeric: tabular-nums; opacity: .75; margin-left: 4px; }
.rv-lane { position: relative; height: 30px; margin-bottom: -4px; touch-action: none; }
.rv-mark {
  position: absolute; top: 2px; width: 26px; height: 26px; margin-left: -13px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: var(--c); color: #1b1433; font-size: 13px; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.5);
  display: grid; place-items: center;
}
.rv-mark::before { content: ""; position: absolute; inset: -9px; } /* bigger touch target */
.rv-mark span { transform: rotate(45deg); line-height: 1; pointer-events: none; }
.rv-mark.old { background: transparent; border: 2.5px dashed var(--c); color: var(--c); box-shadow: none; opacity: .85; }
.rv-mark.mine { cursor: grab; }
.rv-mark.dragging { z-index: 2; transform: rotate(-45deg) scale(1.25); }
.rv-mark.dragging::after {
  content: attr(data-time); position: absolute; bottom: 34px; left: 50%; transform: rotate(45deg) translateX(-50%);
  padding: 3px 8px; border-radius: 8px; background: #fff; color: #1b1433; font-size: 14px; white-space: nowrap;
}
.rv-sheet { position: absolute; inset: 0; z-index: 30; }
.rv-backdrop { position: absolute; inset: 0; background: rgba(5, 3, 15, .55); opacity: 0; transition: opacity .2s; }
.rv-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 86%; overflow-y: auto;
  padding: 22px 20px calc(var(--safe-b) + 20px); border-radius: 26px 26px 0 0;
  background: #231a44; box-shadow: 0 -10px 40px rgba(0,0,0,.5); transform: translateY(100%); transition: transform .22s ease-out;
  -webkit-user-select: text; user-select: text;
}
.rv-sheet.open .rv-backdrop { opacity: 1; }
.rv-sheet.open .rv-panel { transform: none; }
.rv-panel h2 { margin: 0 0 6px; font-size: 22px; }
.rv-sub, .rv-meta { margin: 6px 0 10px; font-size: 16px; color: var(--ink-soft); line-height: 1.4; }
.rv-body { margin: 6px 0 14px; font-size: 19px; line-height: 1.45; }
.rv-old { color: #ffd84d; }
.rv-names { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0; }
.rv-name { height: 56px; border-radius: 16px; font-size: 19px; font-weight: 700; border: 3px solid var(--c); color: #fff; background: rgba(255,255,255,.06); }
.rv-name.on { background: var(--c); color: #1b1433; }
.rv-input {
  width: 100%; margin: 6px 0; padding: 14px; border-radius: 14px; border: 2px solid rgba(255,255,255,.3);
  background: rgba(0,0,0,.25); color: #fff; font: inherit; font-size: 18px; -webkit-user-select: text; user-select: text;
}
.rv-text { resize: vertical; min-height: 110px; }
.rv-err { min-height: 1.2em; margin: 4px 0; color: #ff9a9a; font-size: 15px; }
.rv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.rv-actions > * { flex: 1 1 auto; }
.rv-primary, .rv-ghost, .rv-danger { min-height: 52px; padding: 0 18px; border-radius: 999px; font-size: 17px; font-weight: 700; }
.rv-primary { background: var(--sun); color: #3a1d00; }
.rv-primary:disabled { opacity: .5; }
.rv-ghost { background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.35); }
.rv-danger { background: rgba(232, 69, 90, .2); border: 2px solid #e8455a; color: #ffb3bd; }
.rv-time { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 6px 0 10px; }
.rv-time button { flex: 1; height: 46px; border-radius: 12px; background: rgba(255,255,255,.1); font-size: 16px; font-weight: 600; }
.rv-tval { flex: 1.4; text-align: center; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rv-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.rv-tag { height: 40px; padding: 0 14px; border-radius: 999px; font-size: 15px; font-weight: 600; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.25); }
.rv-tag.on { background: #fff; color: #1b1433; border-color: #fff; }
.rv-head { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.rv-head i, .rv-it i { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.rv-tagpill { margin-left: auto; padding: 4px 12px; border-radius: 999px; font-size: 14px; background: rgba(255,255,255,.12); }
.rv-filter { display: flex; gap: 8px; margin: 8px 0 12px; }
.rv-filter button { flex: 1; height: 42px; border-radius: 999px; font-size: 15px; font-weight: 600; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.25); }
.rv-filter button.on { background: #fff; color: #1b1433; }
.rv-items { display: flex; flex-direction: column; gap: 8px; }
.rv-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 16px; text-align: left; background: rgba(255,255,255,.07); }
.rv-item.old { opacity: .75; }
.rv-it { display: flex; align-items: center; gap: 6px; min-width: 64px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 17px; }
.rv-ix { font-size: 16px; line-height: 1.35; color: var(--ink-soft); }
.rv-ix b { color: #fff; }
.rv-ix em { font-style: normal; color: #ffd84d; font-size: 13px; }
.rv-toast {
  position: absolute; z-index: 40; left: 50%; top: calc(var(--safe-t) + 70px); transform: translateX(-50%);
  max-width: 90%; padding: 12px 18px; border-radius: 16px; background: #fff; color: #1b1433; font-size: 16px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .3s; text-align: center;
}
.rv-toast.show { opacity: 1; }
.rv-auth .rv-primary { width: 100%; }

/* Voice pick (review.js, reviewers only) */
.rv-panel.rv-tall { max-height: 94%; }
.rv-vp-entry {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; margin: 12px 0 4px; padding: 12px 18px;
  border-radius: 18px; text-align: left; font-size: 18px; font-weight: 700; color: #1b1433; background: var(--sun);
}
.rv-vp-entry span { font-size: 14px; font-weight: 600; opacity: .75; }
.vp-opts { display: flex; flex-direction: column; gap: 12px; }
.vp-opt { padding: 14px; border-radius: 18px; background: rgba(255,255,255,.07); border: 2px solid transparent; }
.vp-opt.mine { border-color: var(--sun); background: rgba(255, 216, 77, .1); }
.vp-oh { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.vp-oh b { font-size: 17px; }
.vp-oh small { display: block; margin-top: 2px; font-size: 14px; line-height: 1.35; color: var(--ink-soft); }
.vp-letter { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 19px; font-weight: 800; background: #fff; color: #1b1433; }
.vp-clips { display: flex; flex-direction: column; gap: 6px; }
.vp-clip { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: 14px; text-align: left; font-size: 15px; line-height: 1.3; background: rgba(255,255,255,.08); }
.vp-clip i { flex: none; width: 0; height: 0; border-left: 12px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin: 0 2px 0 4px; }
.vp-clip.on { background: rgba(255,255,255,.22); }
.vp-clip.on i { width: 12px; height: 14px; border: 0; border-left: 4px solid #fff; border-right: 4px solid #fff; }
.vp-clip.loading { opacity: .6; }
.vp-clip span { flex: 1; }
.vp-clip em { flex: none; font-style: normal; font-size: 12px; opacity: .6; }
.vp-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.vp-who { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--ink-soft); }
.vp-who i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: -4px; }
.vp-pick { min-height: 46px; padding: 0 20px; border-radius: 999px; font-size: 16px; font-weight: 700; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.4); }
.vp-opt.mine .vp-pick { background: var(--sun); color: #3a1d00; border-color: transparent; }
.lib-head:has(.rv-vp-entry) { flex-wrap: wrap; }
.lib-head .rv-vp-entry { flex: 1 0 100%; margin: 4px 0 0; flex-direction: row; align-items: baseline; gap: 8px; }

/* Narrowest phones (≈320-345 px): the three chips and the "Sweets & Sours" card badge must still fit on one line */
@media (max-width: 345px) {
  .chips { gap: 5px; }
  .chip { padding: 0 8px; font-size: 14px; }
  .card .badge { left: 8px; gap: 4px; padding: 0 8px 0 6px; font-size: 12px; }
  .card .badge svg { width: 15px; height: 15px; }
}

/* Player v2 (app.js "Player v2"): wave = seek bar, controls locked at the bottom, description opens under the title */
.seek-box { position: relative; width: 100%; }
.pv2 .wave { position: absolute; left: 0; right: 0; top: 0; height: 56px; margin: 0; pointer-events: none; }
.pv2 #seek { position: relative; height: 56px; }
.pv2 #seek::-webkit-slider-runnable-track { background: transparent; }
.pv2 #seek::-moz-range-track, .pv2 #seek::-moz-range-progress { background: transparent; }
.pv2 .times { margin-top: -8px; }
.pv2 .player-bottom { padding-top: 10px; }
.pv2 .p-title { cursor: pointer; }
.p-desc { display: grid; grid-template-rows: 0fr; width: 100%; transition: grid-template-rows .32s var(--ease-out), opacity .32s; opacity: 0; }
.p-desc > div { overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.desc-open .p-desc { grid-template-rows: 1fr; opacity: 1; }
.pv2 .p-hook { display: block; margin: 10px 0 0; font-size: 18px; max-width: 340px; }
.p-details { margin: 0 0 6px; font-size: 15px; color: var(--ink-soft); }
.pv2 .player-shade {
  background:
    linear-gradient(180deg, rgba(0,0,0,.42) 0%, rgba(0,0,0,0) 14%),
    linear-gradient(0deg, var(--ep-bg) 0%, var(--ep-bg) 18%, color-mix(in srgb, var(--ep-bg) 75%, transparent) 30%, color-mix(in srgb, var(--ep-bg) 0%, transparent) 46%);
  transition: opacity .32s;
}
/* the taller shade for the open description is its own layer, so it can fade in with the text (gradients don't animate) */
.pv2 .player-shade::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .32s var(--ease-out);
  background: linear-gradient(0deg, var(--ep-bg) 0%, var(--ep-bg) 30%, color-mix(in srgb, var(--ep-bg) 80%, transparent) 44%, color-mix(in srgb, var(--ep-bg) 0%, transparent) 62%);
}
.pv2.desc-open .player-shade::after { opacity: 1; }
.p-details[hidden] { display: none; }
.btn-back.rattle { animation: rattle .7s ease-in-out; }
@keyframes rattle {
  0%, 100% { transform: none; }
  15% { transform: rotate(-6deg) scale(1.06); } 30% { transform: rotate(5deg) scale(1.06); }
  45% { transform: rotate(-4deg) scale(1.04); } 60% { transform: rotate(3deg); } 75% { transform: rotate(-1.5deg); }
}
.pv2 .times { align-items: center; }
.p-auto { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 4px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.p-auto i { position: relative; width: 34px; height: 20px; border-radius: 99px; background: rgba(255,255,255,.22); transition: background .2s; }
.p-auto i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.p-auto.on i { background: var(--ep-accent); }
.p-auto.on i::after { transform: translateX(14px); }
