/* Chant player (js/play.js): the Play button beside each chant, and the player docked at the foot of the screen.
   The site's own look: cream cards, the small capitals, the brand red, the segmented choices of the Settings panel. */

/* ---- the Play button: a small round button like the date arrows' (.day-step), the play mark in the rubric red.
   Joseph, 5 Dec 2026: the labelled pill "looks really out of place and sloppy". It now reads as part of the heading. */
.pl-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; margin: 0;
  border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--rubric); cursor: pointer; flex: none; align-self: center;
  transition: background .15s, color .15s, border-color .15s; -webkit-tap-highlight-color: transparent; }
.pl-btn svg { width: 18px; height: 18px; flex: none; margin-left: 1px; }
.pl-btn.playing svg { margin-left: 0; }
.pl-btn:hover { border-color: color-mix(in srgb, var(--rubric) 50%, var(--line)); }
.pl-btn:focus-visible { outline: 2px solid var(--rubric); outline-offset: 2px; }
.pl-btn.on { border-color: var(--rubric); }
.pl-btn.playing { background: var(--rubric); border-color: var(--rubric); color: #fff; }
html[data-theme="dark"] .pl-btn.playing { color: #1c1a17; }
.pl-btn.pl-push { margin-left: auto; }
.part-head .pl-mode { margin-left: auto; display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.part-head .pl-mode .mode { margin-left: 0; }
.part-head .pl-mode .pl-btn { align-self: center; }
/* where a chant has no heading row: the button stands at the top right, clear of the first staff */
.pl-row { display: flex; justify-content: flex-end; margin: 4px 0 0; }
.lbx-sub.pl-has { display: flex; align-items: center; gap: 12px; }
.lbx-sub.pl-has .pl-btn { margin-left: auto; }
.pl-btn.pl-inline { margin-left: 10px; vertical-align: middle; position: relative; top: -2px; width: 28px; height: 28px; }
.pl-btn.pl-inline svg { width: 16px; height: 16px; }
.pst-title:has(.pl-btn) .pst-tn { margin-left: auto; }
.pst-title .pl-btn { margin-left: -6px; flex: none; align-self: center; }

/* the note that sounds, and its syllable, in red (the chant is drawn black; at night the whole score is turned light by a
   filter, which keeps the hue and turns the shade: a dark red comes out the night's soft red) */
.chant svg .pl-on, .chant svg .pl-on * { fill: #b3121f !important; }
html[data-theme="dark"] .chant svg .pl-on, html[data-theme="dark"] .chant svg .pl-on * { fill: #6e0f17 !important; }
body.pl-open .chant .pn { cursor: pointer; }

/* ---- the player */
.pl { position: fixed; z-index: 58; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); width: min(600px, calc(100vw - 28px));
  transform: translate(-50%, 18px); opacity: 0; transition: opacity .22s ease, transform .26s cubic-bezier(.2, .8, .2, 1);
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 14px 44px rgba(40, 24, 8, .18), 0 2px 6px rgba(40, 24, 8, .08); padding: 12px 16px 14px; font-family: var(--serif); }
.pl.on { opacity: 1; transform: translate(-50%, 0); }
.pl[hidden] { display: none; }
html.no-anim .pl { transition: none; }
html[data-theme="dark"] .pl { box-shadow: 0 14px 44px rgba(0, 0, 0, .55); }
@media (min-width: 1000px) { body.shell .pl { left: calc(50% + 98px); } html.rail-closed body.shell .pl { left: calc(50% + 28px); } }
@media (max-width: 999px) { body.shell .pl { bottom: calc(60px + env(safe-area-inset-bottom)); } }
@media print { .pl, .pl-btn { display: none !important; } }

.pl-head { display: flex; align-items: flex-start; gap: 10px; }
.pl-name { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; padding-top: 4px; }
.pl-kind { font-family: var(--caps); color: var(--rubric); font-size: 14.5px; letter-spacing: .1em; white-space: nowrap; }
.pl-title { font-style: italic; font-size: 17px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 100%; }
.pl-ibtn { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%;
  background: none; color: var(--muted); padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pl-ibtn svg { width: 22px; height: 22px; }
.pl-ibtn:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.pl-x { margin: -6px -8px 0 0; width: 36px; height: 36px; }
.pl-x svg { width: 20px; height: 20px; }
.pl-flash { animation: pl-flash .9s ease; }
@keyframes pl-flash { 0% { color: var(--rubric); background: color-mix(in srgb, var(--rubric) 14%, transparent); } 100% { } }

.pl-main { display: flex; align-items: center; gap: 14px; margin: 8px 0 4px; }
.pl-ctl { display: flex; align-items: center; gap: 6px; flex: none; }
.pl-play { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--rubric); color: #fff; display: inline-flex; align-items: center;
  justify-content: center; padding: 0; cursor: pointer; box-shadow: 0 3px 10px color-mix(in srgb, var(--rubric) 35%, transparent); transition: transform .12s;
  -webkit-tap-highlight-color: transparent; }
.pl-play svg { width: 26px; height: 26px; }
.pl-play:active { transform: scale(.94); }
html[data-theme="dark"] .pl-play { color: #1c1a17; }
.pl-prog { flex: 1; min-width: 0; padding-top: 14px; }
.pl-track { position: relative; height: 22px; cursor: pointer; touch-action: none; }
.pl-track::before { content: ''; position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.pl-fill { position: absolute; left: 0; top: 9px; height: 4px; border-radius: 2px; background: var(--rubric); width: 0; }
.pl-knob { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--card); border: 2px solid var(--rubric);
  box-shadow: 0 1px 3px rgba(40, 24, 8, .25); left: 0; }
.pl-track:focus-visible { outline: none; }
.pl-track:focus-visible .pl-knob { outline: 2px solid var(--rubric); outline-offset: 2px; }
.pl-times { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; margin-top: -1px; }

.pl-opts { display: grid; grid-template-columns: auto 1fr 1fr; gap: 10px 14px; padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--line); }
.pl-opt { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pl-lab { font-family: var(--caps); font-size: 12.5px; letter-spacing: .12em; color: var(--muted); }
.pl-seg { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.pl-seg button { flex: 1 1 auto; border: 0; background: none; color: var(--muted); font: 14px/1.2 var(--caps); letter-spacing: .03em; padding: 7px 8px;
  border-radius: 8px; cursor: pointer; white-space: nowrap; }
.pl-seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(60, 40, 20, .15); }
html[data-theme="dark"] .pl-seg button.on { background: color-mix(in srgb, var(--rubric) 18%, transparent); box-shadow: none; }
.pl-key { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 11px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.pl-step { width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 24px/1 var(--serif); padding: 0 0 3px; cursor: pointer; flex: none; }
.pl-step:hover:not(:disabled) { background: var(--card); box-shadow: 0 1px 3px rgba(60, 40, 20, .15); }
.pl-step:disabled { opacity: .3; cursor: default; }
.pl-keyval { min-width: 66px; text-align: center; display: flex; flex-direction: column; align-items: center; line-height: 1.05; padding: 0 2px; }
.pl-keyname { font-weight: 600; font-size: 20px; font-family: 'Crimson Text', var(--serif); font-variant-numeric: lining-nums; }
.pl-keysub { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
.pl-seg button:focus-visible, .pl-step:focus-visible, .pl-ibtn:focus-visible, .pl-play:focus-visible, .pl-btn:focus-visible { outline: 2px solid var(--rubric); outline-offset: 2px; }

/* a phone: one row for each option, its name on the left */
@media (max-width: 600px) {
  .pl { width: calc(100vw - 16px); padding: 10px 14px 10px; border-radius: 16px; }
  .pl-main { gap: 10px; margin: 6px 0 2px; }
  .pl-ctl { gap: 2px; }
  .pl-play { width: 48px; height: 48px; }
  .pl-ibtn { width: 38px; height: 38px; }
  .pl-opts { grid-template-columns: 1fr; gap: 8px; padding-top: 9px; }
  .pl-opt { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .pl-lab { font-size: 13px; }
  .pl-opt .pl-seg { width: 236px; }
  .pl-opt .pl-key { width: 236px; justify-content: space-between; }
  .pl-seg button { flex: 1 1 0; font-size: 13.5px; padding: 7px 4px; }
  .pl-step { width: 34px; height: 30px; }
  .pl-keyval { flex-direction: row; align-items: baseline; gap: 6px; }
}
