/* ── SEAT PLAYER ──────────────────────────────────────────────────────
   Shared "table player" for the master seats. Same gramophone UI as
   table.html's #muz, scoped under .seatplayer so it collides with nothing.
   Opens on this seat's own song (audio/song-<key>.mp3), then — once the
   opener ends (or the reader hits next/shuffle) — drifts into the /music/
   library (era openers first, then the whole library). Gold-on-black. */
.seatplayer{--sp-gold:#e0b83a;--sp-gold-hi:#f0d060;--sp-gold-text:#ffe9a8;
  padding:2px 0 4px;position:relative}
.seatplayer .sp-panel{position:relative;display:flex;align-items:center;gap:18px;
  max-width:520px;margin:0 auto;padding:16px 20px 16px 16px;overflow:hidden;
  border:1px solid rgba(224,184,58,.4);border-radius:18px;background:#0b0805;
  box-shadow:0 16px 46px rgba(0,0,0,.72),inset 0 0 60px rgba(0,0,0,.55),0 0 30px rgba(240,208,96,.06);
  text-align:left}
.seatplayer .sp-panel::before{content:"";position:absolute;inset:0;z-index:0;
  background:linear-gradient(90deg,rgba(6,5,3,.93),rgba(6,5,3,.62) 46%,rgba(6,5,3,.9)),
   url('art/player-bg.png') center/cover no-repeat}
.seatplayer .sp-panel::after{content:"";position:absolute;inset:0;z-index:0;pointer-events:none;
  box-shadow:inset 0 0 70px rgba(0,0,0,.7)}
.seatplayer .sp-panel>*{position:relative;z-index:1}
/* ── THE TURNTABLE (record player) ─────────────────────────────────────
   A dark platter carrying a gold vinyl record (concentric groove rings in
   the era accent), plus a tonearm that lowers onto the outer groove while
   playing and lifts off when paused/stopped. Pure CSS; decorative
   (aria-hidden in the markup). Reskins per era via --sp-gold*. */
.seatplayer .sp-turntable{flex:0 0 auto;position:relative;width:96px;height:96px}
/* the dark platter under the record */
.seatplayer .sp-platter{position:absolute;inset:0;border-radius:50%;
  background:radial-gradient(circle at 50% 42%,#1a1207 0%,#0a0703 68%,#000 100%);
  box-shadow:0 6px 22px rgba(0,0,0,.8),0 0 0 3px #17110a,inset 0 0 16px rgba(0,0,0,.9),
    0 0 24px rgba(240,208,96,.16);transition:box-shadow .3s}
/* the gold vinyl record — concentric gold groove rings on near-black */
.seatplayer .sp-record{position:absolute;inset:7px;border-radius:50%;overflow:hidden;
  background:
    repeating-radial-gradient(circle at 50% 50%,
      #0c0801 0, #0c0801 1.5px,
      var(--sp-gold) 1.5px, var(--sp-gold) 2px,
      #110b02 2px, #110b02 3.6px),
    radial-gradient(circle at 50% 50%,#141002,#080500);
  box-shadow:inset 0 0 12px rgba(0,0,0,.85);
  animation:spspin 2.7s linear infinite;animation-play-state:paused}
.seatplayer .sp-record::after{content:"";position:absolute;inset:0;border-radius:50%;pointer-events:none;
  background:radial-gradient(circle at 32% 26%,rgba(255,240,200,.24),transparent 46%)}
/* the center label (a small gold disc with a subtle eye glyph) */
.seatplayer .sp-label{position:absolute;top:50%;left:50%;width:34%;height:34%;transform:translate(-50%,-50%);
  border-radius:50%;display:flex;align-items:center;justify-content:center;z-index:1;
  background:radial-gradient(circle at 40% 34%,var(--sp-gold-hi),var(--sp-gold) 58%,#7d5f1e 100%);
  box-shadow:0 0 0 1px rgba(0,0,0,.45),inset 0 0 6px rgba(0,0,0,.4)}
.seatplayer .sp-label-glyph{font-size:.62rem;line-height:1;color:#1a1204;opacity:.75}
/* spindle dot at the very center */
.seatplayer .sp-spindle{position:absolute;top:50%;left:50%;width:8px;height:8px;transform:translate(-50%,-50%);
  border-radius:50%;z-index:2;background:radial-gradient(circle at 40% 35%,#241a0c,#000);
  box-shadow:0 0 0 1.5px rgba(240,208,96,.6),0 0 8px rgba(0,0,0,.85)}
/* spin ONLY while playing */
.seatplayer.sp-playing .sp-record{animation-play-state:running}
.seatplayer.sp-playing .sp-platter{box-shadow:0 6px 22px rgba(0,0,0,.8),0 0 0 3px #17110a,
  inset 0 0 16px rgba(0,0,0,.9),0 0 34px rgba(240,208,96,.42)}
@keyframes spspin{to{transform:rotate(360deg)}}
/* ── THE TONEARM ───────────────────────────────────────────────────────
   Pivots from the top-right. Default/paused = lifted up & off the record;
   playing = swung down so the needle rests on the outer groove. */
.seatplayer .sp-tonearm{position:absolute;top:5px;right:7px;width:13px;height:76px;z-index:3;
  transform-origin:50% 7px;transform:rotate(-22deg);
  transition:transform .5s cubic-bezier(.34,1.12,.5,1)}
.seatplayer.sp-playing .sp-tonearm{transform:rotate(20deg)}
.seatplayer .sp-pivot{position:absolute;top:0;left:50%;width:13px;height:13px;transform:translateX(-50%);
  border-radius:50%;background:radial-gradient(circle at 40% 35%,#3a2c0e,#0e0a03);
  box-shadow:0 0 0 1.5px var(--sp-gold),0 2px 6px rgba(0,0,0,.75)}
.seatplayer .sp-arm{position:absolute;top:7px;left:50%;width:4px;height:60px;transform:translateX(-50%);
  border-radius:3px;background:linear-gradient(90deg,#6f5620,var(--sp-gold-hi),#6f5620);
  box-shadow:0 1px 3px rgba(0,0,0,.6)}
.seatplayer .sp-headshell{position:absolute;bottom:0;left:50%;width:9px;height:13px;transform:translateX(-50%);
  border-radius:2px 2px 3px 3px;background:linear-gradient(#4a3813,#20170a);
  box-shadow:0 0 0 1px var(--sp-gold),0 2px 5px rgba(0,0,0,.7)}
.seatplayer .sp-headshell::after{content:"";position:absolute;bottom:-3px;left:50%;width:2px;height:4px;
  transform:translateX(-50%);background:var(--sp-gold-hi);border-radius:0 0 2px 2px}
/* the body: tag, title, controls */
.seatplayer .sp-body{flex:1;min-width:0}
.seatplayer .sp-tag{font-family:var(--disp,"Cinzel",Georgia,serif);font-size:.5rem;letter-spacing:.26em;color:#c9a24a;
  text-transform:uppercase;opacity:.9;margin-bottom:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.seatplayer .sp-trk{display:block;font-family:var(--disp,"Cinzel",Georgia,serif);font-size:.76rem;letter-spacing:.1em;color:var(--sp-gold-text);
  max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-transform:uppercase;
  text-shadow:0 2px 12px rgba(0,0,0,.85);margin-bottom:11px;min-height:1em}
.seatplayer .sp-ctrls{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.seatplayer button{background:radial-gradient(circle at 35% 28%,#2a2109,#100b04);
  border:1px solid #6a5320;color:var(--sp-gold);cursor:pointer;border-radius:50%;
  display:flex;align-items:center;justify-content:center;line-height:1;padding:0;
  transition:box-shadow .25s,border-color .25s,color .25s,transform .08s}
.seatplayer button:hover{color:var(--sp-gold-hi);border-color:var(--sp-gold);box-shadow:0 0 16px rgba(240,208,96,.45)}
.seatplayer button:active{transform:scale(.9)}
.seatplayer .sp-sec,.seatplayer .sp-shuf{width:34px;height:34px;font-size:14px}
.seatplayer .sp-shuf.on{border-color:var(--sp-gold);color:var(--sp-gold-hi);
  background:radial-gradient(circle at 35% 28%,#3a2c0e,#140d05);box-shadow:0 0 14px rgba(240,208,96,.42)}
.seatplayer .sp-main{width:52px;height:52px;font-size:18px;color:var(--sp-gold-hi);
  border:1px solid var(--sp-gold);box-shadow:0 0 20px rgba(240,208,96,.35)}
.seatplayer .sp-main:hover{box-shadow:0 0 26px rgba(240,208,96,.6)}
.seatplayer.sp-playing .sp-main{box-shadow:0 0 28px rgba(240,208,96,.55)}
/* the library OPENER button (a pill; overrides the generic round-button) */
.seatplayer .sp-libbtn{margin-left:auto;width:auto;height:auto;border-radius:10px;
  background:rgba(10,8,4,.72);border:1px solid #5a4318;color:var(--sp-gold-text);
  font-family:var(--disp,"Cinzel",Georgia,serif);font-size:.52rem;letter-spacing:.2em;text-transform:uppercase;
  padding:8px 12px;min-height:34px;cursor:pointer;transition:border-color .25s,box-shadow .25s,color .25s}
.seatplayer .sp-libbtn:hover{border-color:var(--sp-gold);color:var(--sp-gold-hi);box-shadow:0 0 14px rgba(240,208,96,.35)}
.seatplayer.sp-lib-open .sp-libbtn{border-color:var(--sp-gold);color:var(--sp-gold-hi);box-shadow:0 0 16px rgba(240,208,96,.45)}
.seatplayer .sp-cap{text-align:center;font-size:.8em;letter-spacing:.06em;color:#c9a24a;margin-top:8px}
/* per-shelf shuffle: "play this era" / "play the MoneyWizard wing" — pills */
.seatplayer .sp-shelf{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px}
.seatplayer .sp-shelf button{width:auto;height:auto;border-radius:9px;padding:5px 11px;
  font-family:var(--disp,"Cinzel",Georgia,serif);font-size:.5rem;letter-spacing:.2em;text-transform:uppercase;
  color:#c9a24a;background:rgba(10,8,4,.72);border:1px solid #5a4318}
.seatplayer .sp-shelf button:hover{color:var(--sp-gold-hi);border-color:var(--sp-gold);
  box-shadow:0 0 14px rgba(240,208,96,.35)}
/* ── PER-ERA SKINS ────────────────────────────────────────────────────
   seatplayer.js stamps data-era="<id>" on .seatplayer (from window.MM_ERA).
   Each era swaps the player/library-panel background to its own atmospheric
   scene (behind a dark scrim so the grouped library list stays legible) and
   shifts the accent WITHIN the gold family so every era reads distinct but
   cohesive. No / unknown era (data-era="none") keeps the plain dark skin. */
.seatplayer[data-era="antiquity"]{--sp-gold:#d9bf7a;--sp-gold-hi:#f3e4b0;--sp-gold-text:#f6ecc9}
.seatplayer[data-era="antiquity"] .sp-panel{border-color:rgba(217,191,122,.42)}
.seatplayer[data-era="antiquity"] .sp-panel::before{
  background:linear-gradient(rgba(6,6,6,.82),rgba(6,6,6,.9)),url('art/era-antiquity.jpg') center/cover no-repeat}

.seatplayer[data-era="renaissance"]{--sp-gold:#d59b3a;--sp-gold-hi:#f2ce78;--sp-gold-text:#f3ddb0}
.seatplayer[data-era="renaissance"] .sp-panel{border-color:rgba(150,60,52,.5)}
.seatplayer[data-era="renaissance"] .sp-panel::before{
  background:linear-gradient(rgba(6,6,6,.82),rgba(6,6,6,.9)),url('art/era-renaissance.jpg') center/cover no-repeat}

.seatplayer[data-era="ticker"]{--sp-gold:#c9a24a;--sp-gold-hi:#e8c86a;--sp-gold-text:#ffe9a8}
.seatplayer[data-era="ticker"] .sp-panel{border-color:rgba(201,162,74,.46)}
.seatplayer[data-era="ticker"] .sp-panel::before{
  background:linear-gradient(rgba(6,6,6,.82),rgba(6,6,6,.9)),url('art/era-ticker.jpg') center/cover no-repeat}

.seatplayer[data-era="midcentury"]{--sp-gold:#d6a54a;--sp-gold-hi:#f0c878;--sp-gold-text:#f4dcae}
.seatplayer[data-era="midcentury"] .sp-panel{border-color:rgba(214,165,74,.44)}
.seatplayer[data-era="midcentury"] .sp-panel::before{
  background:linear-gradient(rgba(6,6,6,.82),rgba(6,6,6,.9)),url('art/era-midcentury.jpg') center/cover no-repeat}

.seatplayer[data-era="modern"]{--sp-gold:#e3cf6a;--sp-gold-hi:#fff0b0;--sp-gold-text:#f5eec2}
.seatplayer[data-era="modern"] .sp-panel{border-color:rgba(227,207,106,.5)}
.seatplayer[data-era="modern"] .sp-panel::before{
  background:linear-gradient(rgba(6,6,6,.82),rgba(6,6,6,.9)),url('art/era-modern.jpg') center/cover no-repeat}

/* ── THE LIBRARY PANEL ─────────────────────────────────────────────────
   An overlay launched from the library button. A dark scrim over a custom
   candlelit "hall of songs" backdrop (art/library-bg.jpg); a MoneyWizard /
   By-Era tab toggle; scrollable, touch-friendly track lists; and playlist
   controls that reuse the shared anti-repeat pick. Accent follows the era
   via --sp-gold*, but the backdrop is the same for every seat. */
.seatplayer .sp-library{position:fixed;inset:0;z-index:9998;
  display:flex;align-items:center;justify-content:center;padding:16px}
.seatplayer .sp-library[hidden]{display:none}
.seatplayer .sp-lib-scrim{position:absolute;inset:0;background:rgba(3,3,3,.62);
  opacity:0;transition:opacity .28s ease}
.seatplayer.sp-lib-open .sp-lib-scrim{opacity:1}
.seatplayer .sp-lib-sheet{position:relative;z-index:1;width:min(94vw,560px);max-height:86vh;
  display:flex;flex-direction:column;overflow:hidden;border-radius:18px;
  border:1px solid rgba(224,184,58,.5);color:var(--sp-gold-text);
  background:linear-gradient(rgba(6,6,6,.86),rgba(6,6,6,.92)),url('art/library-bg.jpg') center/cover no-repeat,#0b0805;
  box-shadow:0 26px 70px rgba(0,0,0,.8),inset 0 0 90px rgba(0,0,0,.6),0 0 40px rgba(240,208,96,.08);
  opacity:0;transform:translateY(14px) scale(.985);transition:opacity .28s ease,transform .28s ease}
.seatplayer.sp-lib-open .sp-lib-sheet{opacity:1;transform:none}
/* header */
.seatplayer .sp-lib-head{display:flex;align-items:center;gap:10px;padding:15px 16px 11px;
  border-bottom:1px solid rgba(224,184,58,.22)}
.seatplayer .sp-lib-title{flex:1;font-family:var(--disp,"Cinzel",Georgia,serif);font-size:.82rem;
  letter-spacing:.14em;text-transform:uppercase;color:var(--sp-gold-hi);text-shadow:0 2px 12px rgba(0,0,0,.8)}
.seatplayer .sp-lib-close{width:40px;height:40px;flex:0 0 auto;font-size:15px}
/* tabs */
.seatplayer .sp-lib-tabs{display:flex;gap:8px;padding:12px 16px 6px}
.seatplayer .sp-tab{width:auto;height:auto;flex:1;border-radius:10px;min-height:42px;padding:9px 10px;
  font-family:var(--disp,"Cinzel",Georgia,serif);font-size:.56rem;letter-spacing:.18em;text-transform:uppercase;
  color:#c9a24a;background:rgba(10,8,4,.7);border:1px solid #5a4318}
.seatplayer .sp-tab.on{color:var(--sp-gold-hi);border-color:var(--sp-gold);
  background:radial-gradient(circle at 40% 20%,#3a2c0e,#140d05);box-shadow:0 0 14px rgba(240,208,96,.32)}
/* transport row */
.seatplayer .sp-lib-transport{display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  padding:8px 16px 12px;border-bottom:1px solid rgba(224,184,58,.18)}
.seatplayer .sp-lt{width:auto;height:auto;min-width:42px;min-height:42px;border-radius:10px;padding:8px 12px;
  font-size:14px;color:var(--sp-gold)}
.seatplayer .sp-lt.on{border-color:var(--sp-gold);color:var(--sp-gold-hi);
  background:radial-gradient(circle at 35% 28%,#3a2c0e,#140d05);box-shadow:0 0 12px rgba(240,208,96,.4)}
.seatplayer .sp-lt-list{margin-left:auto;font-family:var(--disp,"Cinzel",Georgia,serif);
  font-size:.5rem;letter-spacing:.16em;text-transform:uppercase;color:var(--sp-gold-hi);border-color:var(--sp-gold)}
/* the scrolling body + lists */
.seatplayer .sp-lib-body{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:8px 10px 14px}
.seatplayer .sp-lib-list{display:flex;flex-direction:column;gap:3px}
.seatplayer .sp-lib-empty{padding:24px 12px;text-align:center;color:#c9a24a;
  font-family:var(--disp,"Cinzel",Georgia,serif);letter-spacing:.12em;font-size:.7rem}
/* a track row */
.seatplayer .sp-item{width:100%;height:auto;justify-content:flex-start;text-align:left;gap:10px;
  min-height:44px;border-radius:10px;padding:9px 12px;border:1px solid transparent;background:transparent;
  color:var(--sp-gold-text);font-family:var(--body,"Outfit",system-ui,sans-serif);
  font-size:.78rem;letter-spacing:.02em}
.seatplayer .sp-item:hover{border-color:rgba(224,184,58,.4);background:rgba(224,184,58,.06);box-shadow:none}
.seatplayer .sp-item-dot{flex:0 0 auto;font-size:.7rem;color:#9c7d34;transition:color .2s}
.seatplayer .sp-item-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.seatplayer .sp-item.sp-now{border-color:var(--sp-gold);background:rgba(224,184,58,.14);
  color:var(--sp-gold-hi);box-shadow:inset 0 0 18px rgba(240,208,96,.12)}
.seatplayer .sp-item.sp-now .sp-item-dot{color:var(--sp-gold-hi);
  animation:sppulse 1.7s ease-in-out infinite}
@keyframes sppulse{0%,100%{opacity:.55}50%{opacity:1}}
/* era sections (collapsible) */
.seatplayer .sp-era-sec{border-top:1px solid rgba(224,184,58,.12);padding:2px 0}
.seatplayer .sp-era-sec:first-child{border-top:0}
.seatplayer .sp-era-head{display:flex;align-items:center;gap:8px}
.seatplayer .sp-era-toggle{flex:1;width:auto;height:auto;justify-content:flex-start;gap:8px;
  min-height:44px;border-radius:10px;padding:8px 10px;border:1px solid transparent;background:transparent;
  font-family:var(--disp,"Cinzel",Georgia,serif);font-size:.6rem;letter-spacing:.16em;text-transform:uppercase;color:#c9a24a}
.seatplayer .sp-era-toggle:hover{color:var(--sp-gold-hi);box-shadow:none;border-color:rgba(224,184,58,.3)}
.seatplayer .sp-era-caret{display:inline-block;transition:transform .2s;color:var(--sp-gold)}
.seatplayer .sp-era-sec.open .sp-era-caret{transform:rotate(90deg)}
.seatplayer .sp-era-play{flex:0 0 auto;width:40px;height:40px;font-size:13px}
.seatplayer .sp-era-list{display:none;flex-direction:column;gap:3px;padding:2px 0 8px 8px}
.seatplayer .sp-era-sec.open .sp-era-list{display:flex}
/* ── MOOD COLLECTIONS (MoneyWizard tab, sorted by FEEL) ────────────────
   Same collapsible chrome as the era sections; the FEEL icon leads the row
   and a dim count sits at the far right. */
.seatplayer .sp-mood-icon{flex:0 0 auto;font-size:.92rem;line-height:1;
  filter:drop-shadow(0 0 6px rgba(240,208,96,.25))}
.seatplayer .sp-mood-sec .sp-era-label{flex:0 1 auto}
.seatplayer .sp-mood-count{margin-left:auto;flex:0 0 auto;font-family:var(--body,"Outfit",system-ui,sans-serif);
  font-size:.62rem;letter-spacing:.08em;color:#9c7d34;opacity:.85;padding-left:8px}
.seatplayer .sp-mood-sec.open .sp-mood-count{color:var(--sp-gold)}

@media(max-width:620px){
  .seatplayer .sp-library{padding:0;align-items:flex-end}
  .seatplayer .sp-lib-sheet{width:100vw;max-width:100vw;max-height:90vh;
    border-radius:18px 18px 0 0;border-bottom:0}
  .seatplayer.sp-lib-open .sp-lib-sheet{transform:none}
  .seatplayer .sp-lib-sheet{transform:translateY(24px)}
  .seatplayer .sp-lib-title{font-size:.74rem}
  .seatplayer .sp-item{font-size:.82rem}
  .seatplayer .sp-lt-list{width:100%;margin-left:0;margin-top:2px;text-align:center;justify-content:center}
}
@media(prefers-reduced-motion:reduce){
  .seatplayer .sp-lib-scrim,.seatplayer .sp-lib-sheet{transition:none}
  .seatplayer .sp-lib-sheet{transform:none}
  .seatplayer .sp-item.sp-now .sp-item-dot{animation:none}
  .seatplayer .sp-era-caret{transition:none}
  /* turntable: no spin, no arm-swing — just show the resting/down state
     (down when playing via .sp-playing, up otherwise) with no motion */
  .seatplayer .sp-record{animation:none}
  .seatplayer .sp-tonearm{transition:none}
}

@media(max-width:480px){
  .seatplayer .sp-panel{gap:12px;padding:12px}
  .seatplayer .sp-turntable{width:76px;height:76px}
  .seatplayer .sp-main{width:46px;height:46px;font-size:16px}
  .seatplayer .sp-libbtn{margin-left:0}
  .seatplayer .sp-ctrls{gap:7px}
  .seatplayer .sp-shelf button{letter-spacing:.14em}
}

/* ── CLS GUARD (Core Web Vitals) ───────────────────────────────────────
   The player is built by deferred JS: the page first shows the native
   <audio controls>, then swaps in .sp-panel. Without a reserved height
   that swap (and any transient collapse of the panel to 0) snapped the
   article below it up/down. Reserve the panel's natural rendered height
   on both the seat-song HOST (so the audio->panel swap costs no shift)
   and the panel itself (so it can never collapse to 0). Measured live:
   panel 169px / host 175px desktop; 196px / 202px at <=480px. */
.seat-song[data-seat-audio]{min-height:175px}
.seatplayer .sp-panel{min-height:169px}
@media(max-width:480px){
  .seat-song[data-seat-audio]{min-height:202px}
  .seatplayer .sp-panel{min-height:196px}
}
