/* =============================================================================
   brodytech. — styles.css
   Refined / editorial. Off-white paper, near-black ink, a serif display face,
   one restrained navy accent, hairline rules. Type does the work.
   ========================================================================== */

:root {
  --paper: #f6f5f1;          /* warm off-white canvas */
  --paper-2: #fbfaf7;        /* raised surfaces */
  --ink: #18191b;            /* near-black text */
  --ink-soft: #34373c;       /* body text */
  --muted: #76787d;          /* secondary text */
  --faint: #9a9ca1;          /* tertiary */
  --line: #e2e0d8;           /* hairline borders */
  --line-strong: #cfcdc4;
  --accent: #16263f;         /* the single accent — navy, used sparingly */
  --accent-ink: #213a5e;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --dock-h: 104px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
#bg { display: none; }       /* no photo background in the editorial look */

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

::selection { background: rgba(22,38,63,.14); }

/* shared bits ------------------------------------------------------------- */
.eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-family: var(--sans);
}
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

#app { min-height: 100%; }
.view { min-height: 100vh; }

/* gentle fade-in when a page renders */
.home, .page, .help { animation: viewIn .34s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* clean keyboard-focus outlines (accessibility, on-theme) */
a:focus-visible, button:focus-visible, .pill:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* ===========================================================================
   HOME
   ======================================================================== */
.home {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 120px 24px calc(var(--dock-h) + 40px);
}
.hero { text-align: center; }
.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(52px, 12vw, 116px);
  letter-spacing: -0.015em;
  line-height: 1;
  color: var(--ink);
  user-select: none;
  cursor: default;
}
.wordmark .dot { color: var(--accent); }

.pills {
  margin-top: 34px;
  display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap;
}
.pill {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px; font-weight: 600; letter-spacing: .02em;
  padding: 11px 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.pill:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill.dots { padding: 11px 18px; color: var(--muted); }

/* ---- news module (top-left of home) -------------------------------------- */
.newsbubble {
  position: fixed; top: 26px; left: 26px;
  width: min(300px, 78vw);
  z-index: 30;
  cursor: pointer;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
}
.newsbubble .nb-kicker { margin-bottom: 7px; }
.newsbubble .nb-row { display: flex; gap: 12px; align-items: flex-start; }
.newsbubble .nb-thumb {
  width: 46px; height: 46px; border-radius: 4px; flex: 0 0 auto;
  background: var(--line); background-size: cover; background-position: center;
}
.newsbubble .nb-thumb.none { display: none; }
.newsbubble .nb-title {
  font-family: var(--serif); font-weight: 600; font-size: 17px; line-height: 1.25; color: var(--ink);
}
.newsbubble:hover .nb-title { text-decoration: underline; text-underline-offset: 3px; }
.newsdots { display: flex; gap: 14px; margin-top: 12px; }
.newsdots button {
  border: none; background: none; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: .05em;
}
.newsdots button.on { color: var(--accent); }
.newsbubble.empty { display: none; }

/* ===========================================================================
   INNER PAGES
   ======================================================================== */
.page { max-width: var(--maxw); margin: 0 auto; padding: 40px 28px calc(var(--dock-h) + 48px); }

.pagehead { margin-bottom: 30px; }
.pagehead .topline {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 26px;
}
.homelink {
  font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.homelink:hover { text-decoration: none; color: var(--accent); }
.homelink .dot { color: var(--accent); }
.crumb { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.pagehead h1 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em;
  font-size: clamp(30px, 5vw, 48px); margin: 0 0 22px; color: var(--ink);
}

/* empty state */
.empty-state { padding: 12vh 0; text-align: left; max-width: 620px; }
.empty-state .big {
  font-family: var(--serif); font-size: clamp(28px, 5vw, 44px); font-weight: 600;
  color: var(--ink); letter-spacing: -0.01em; margin: 0;
}
.empty-state .sub { color: var(--muted); font-size: 15.5px; margin-top: 12px; line-height: 1.6; }

/* ===========================================================================
   TECH — editorial article index
   ======================================================================== */
.cards { border-top: 1px solid var(--line); }
.acard {
  width: 100%;
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 24px;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 22px 4px; cursor: pointer; text-align: left; font-family: inherit;
}
.acard:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.acard h3 {
  font-family: var(--serif); font-weight: 600; font-size: 23px; margin: 0 0 5px;
  letter-spacing: -0.01em; color: var(--ink);
}
.acard .ac-kicker { color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.acard .ac-date { color: var(--faint); font-size: 12.5px; letter-spacing: .03em; white-space: nowrap; }

@media (max-width: 560px) {
  .acard { grid-template-columns: 1fr; }
  .acard .ac-date { margin-top: 8px; }
}

/* ===========================================================================
   GAMES — restrained Metro grid
   ======================================================================== */
.metro {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 156px; gap: 12px;
}
.tile {
  position: relative; overflow: hidden; cursor: pointer; color: #fff; border: 0;
  text-align: left; padding: 20px; display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--tile-accent, #1a1c1e); border-radius: 4px;
  transition: transform .16s ease;
}
.tile::after { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.42)); }
.tile > * { position: relative; z-index: 2; }
.tile:hover { transform: translateY(-2px); }
.tile:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.tile .t-sub { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; opacity: .82; margin-bottom: 8px; }
.tile h3 { font-family: var(--serif); font-weight: 600; font-size: 24px; margin: 0; letter-spacing: -0.01em; }
.tile.small { grid-column: span 1; grid-row: span 1; }
.tile.wide  { grid-column: span 2; grid-row: span 1; }
.tile.tall  { grid-column: span 1; grid-row: span 2; }
.tile.large { grid-column: span 2; grid-row: span 2; }
.tile.large h3 { font-size: 32px; }

@media (max-width: 760px) {
  .metro { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; }
  .tile.large, .tile.wide { grid-column: span 2; }
  .tile.large { grid-row: span 2; }
}
@media (max-width: 430px) {
  .metro { grid-template-columns: 1fr; }
  .tile.wide, .tile.large, .tile.tall { grid-column: span 1; grid-row: span 1; }
}

/* ===========================================================================
   READER / ARTICLE
   ======================================================================== */
.reader { max-width: 660px; margin: 0 auto; }
.reader .r-kicker { margin-bottom: 14px; }
.reader h1 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; line-height: 1.08;
  font-size: clamp(32px, 6vw, 52px); margin: 0 0 12px; color: var(--ink);
}
.reader .r-date { color: var(--muted); font-size: 13.5px; letter-spacing: .03em; }
.reader .r-hero {
  width: 100%; aspect-ratio: 16/9; margin: 26px 0; border-radius: 4px;
  background: var(--line); background-size: cover; background-position: center;
}
.reader .r-hero.none { display: none; }
.reader .r-body {
  font-size: 18px; line-height: 1.75; color: var(--ink-soft); white-space: pre-wrap; margin-top: 26px;
}
.reader .r-body::first-letter {
  font-family: var(--serif); font-size: 3.1em; line-height: .82; float: left;
  padding: 6px 10px 0 0; color: var(--ink); font-weight: 600;
}

/* ===========================================================================
   HELP
   ======================================================================== */
.help { min-height: 100vh; display: grid; place-items: center; padding: 100px 24px calc(var(--dock-h) + 40px); }
.help .inner { text-align: center; max-width: 440px; }
.help h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 5vw, 38px);
  letter-spacing: -0.01em; margin: 0 0 24px; color: var(--ink); }
.help .row { margin: 12px 0; font-size: 16px; color: var(--ink-soft); }
.help a { color: var(--accent); font-weight: 500; }

/* ===========================================================================
   SEARCH DOCK (universal, fixed bottom)
   ======================================================================== */
.searchdock {
  position: fixed; left: 0; right: 0; bottom: 24px; z-index: 40;
  display: flex; justify-content: center; padding: 0 18px; pointer-events: none;
}
.searchwrap { width: min(680px, 94vw); position: relative; pointer-events: auto; }

.searchbox {
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(20,25,30,.04), 0 14px 36px rgba(20,25,30,.10);
  padding: 14px 18px;
  display: flex; flex-direction: column;
  font-family: var(--mono);
  transition: border-color .16s ease;
}
.searchwrap:hover .searchbox,
.searchwrap.menu-open .searchbox,
.searchwrap.searching .searchbox { border-color: var(--accent); }

/* the text / input line */
.sb-line { position: relative; display: flex; align-items: center; min-height: 26px; cursor: text; }
.sb-line .sline { flex: 1; min-width: 0; display: flex; align-items: center; overflow: hidden; }
.sb-line .typed { color: var(--ink); font-size: 16px; letter-spacing: .01em; white-space: pre;
  overflow: hidden; text-overflow: ellipsis; }
.sb-line .caret {
  display: inline-block; width: 2px; height: 18px; margin-left: 2px;
  background: var(--accent); vertical-align: -3px; animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.sb-line .realinput {
  position: absolute; inset: 0; opacity: 0; border: none; background: transparent;
  font-family: var(--mono); font-size: 16px; padding: 0; color: transparent;
  pointer-events: none; cursor: text;
}
.searchwrap.searching .sb-line .realinput { pointer-events: auto; }

/* autofill: the grey completion after the caret, plus a "tab" hint */
.sb-line .ghost { color: var(--faint); font-size: 16px; letter-spacing: .01em; white-space: pre; }
.sb-tab {
  display: none; flex: 0 0 auto; margin-left: 10px; padding: 2px 6px;
  font: 600 10px var(--sans); letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px;
}
.searchwrap.searching.has-ghost .sb-tab { display: inline-block; }

/* the in-panel menu row (revealed on hover / while searching) */
.sb-menu {
  display: none; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.searchwrap.menu-open .sb-menu,
.searchwrap.searching .sb-menu { display: flex; }
.sb-menu a, .sb-search {
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--ink); cursor: pointer; background: none; border: none; padding: 2px 0;
  border-bottom: 1px solid transparent;
}
.sb-menu a:hover, .sb-search:hover {
  text-decoration: none; color: var(--accent); border-bottom-color: var(--accent);
}
.sb-search { color: var(--accent); }
.sb-spacer { flex: 1 1 auto; min-width: 8px; }
.sb-exit {
  font-family: var(--sans); font-size: 20px; line-height: 1; color: var(--muted);
  background: none; border: none; cursor: pointer; padding: 0 2px; margin-left: auto;
}
.sb-exit:hover { color: var(--ink); }

/* ===========================================================================
   EASTER EGGS  (the flying paddle / golf emoji are intentional egg content)
   ======================================================================== */
.bt-toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + 20px); transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 500; z-index: 90; box-shadow: 0 12px 30px rgba(20,25,30,.18);
  animation: toastin .25s ease;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }

#bt-soul { position: fixed; width: 26px; height: 26px; z-index: 95; left: 50%; top: 60%;
  pointer-events: none; will-change: transform; filter: drop-shadow(0 0 8px rgba(255,40,60,.85)); }
.bt-soul-banner {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 96;
  background: var(--ink); color: #ff6b6b; border-radius: 8px; font-family: var(--mono);
  padding: 8px 16px; font-size: 12.5px; font-weight: 600;
}
.bt-shatter { animation: shatter .5s forwards; pointer-events: none !important; }
@keyframes shatter { to { opacity: 0; transform: scale(.6) rotate(8deg); filter: blur(2px); } }
.bt-shard { position: fixed; z-index: 94; pointer-events: none; background: var(--accent);
  border-radius: 1px; will-change: transform, opacity; }

.bt-massive { position: fixed; inset: 0; z-index: 99; display: grid; place-items: center;
  background: rgba(10,12,14,.6); animation: toastin .2s ease; }
.bt-massive span {
  color: #fff; font-family: var(--serif); font-weight: 700; letter-spacing: -.02em; text-align: center;
  font-size: clamp(40px, 13vw, 150px); line-height: .95;
  animation: massivepop .45s cubic-bezier(.2,1.2,.4,1) both;
}
@keyframes massivepop { from { transform: scale(.4); opacity: 0; } }

.bt-flyer { position: fixed; z-index: 92; font-size: 54px; pointer-events: none; will-change: transform; top: 40%; }

/* ===========================================================================
   DASHBOARD
   ======================================================================== */
body.dash { background: var(--paper); color: var(--ink); }
.dwrap { max-width: 860px; margin: 0 auto; padding: 40px 28px 90px; }
.dhead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 6px; }
.dhead h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: -0.01em; }
.dhead h1 .dot { color: var(--accent); }
.dsub { color: var(--muted); margin: 0 0 26px; font-size: 14px; }
.dbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.btn {
  border: 1px solid var(--line-strong); background: var(--paper-2); color: var(--ink);
  border-radius: 7px; padding: 9px 15px; font-weight: 600; cursor: pointer;
  font-family: var(--sans); font-size: 13.5px; transition: background .14s, border-color .14s;
  text-decoration: none; display: inline-block;
}
.btn:hover { background: #efeee9; text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-ink); }
.btn.green { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: #a23b3b; border-color: rgba(162,59,59,.3); }
.dtabs { display: flex; gap: 4px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.dtab { border: none; background: none; padding: 12px 14px; font-weight: 600; cursor: pointer;
  color: var(--muted); border-bottom: 2px solid transparent; font-size: 14.5px; }
.dtab.on { color: var(--ink); border-bottom-color: var(--accent); }
.dlist { display: grid; gap: 0; border-top: 1px solid var(--line); }
.ditem { background: none; border-bottom: 1px solid var(--line); padding: 16px 4px;
  display: flex; gap: 16px; align-items: center; }
.ditem .di-thumb { width: 46px; height: 46px; border-radius: 4px; flex: 0 0 auto;
  background: var(--line); background-size: cover; background-position: center; }
.ditem .di-main { flex: 1; min-width: 0; }
.ditem .di-main b { display: block; font-family: var(--serif); font-size: 17px; font-weight: 600; }
.ditem .di-main span { color: var(--muted); font-size: 13px; }
.ditem .di-actions { display: flex; gap: 6px; }
.iconbtn { border: 1px solid var(--line-strong); background: var(--paper-2); border-radius: 6px;
  width: 34px; height: 34px; cursor: pointer; font-size: 14px; color: var(--ink); }
.iconbtn:hover { background: #efeee9; }
.dempty { color: var(--muted); padding: 30px 4px; font-size: 14px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink); }
.field input[type=text], .field textarea, .field select {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; padding: 10px 12px;
  font-family: var(--sans); font-size: 15px; background: #fff; color: var(--ink);
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.frow { display: flex; gap: 12px; flex-wrap: wrap; }
.frow .field { flex: 1; min-width: 150px; }
.thumbprev { width: 100%; max-height: 170px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); margin-top: 8px; }
.modal-back { position: fixed; inset: 0; background: rgba(10,12,14,.4); z-index: 100;
  display: grid; place-items: start center; padding: 44px 16px; overflow: auto; }
.modal { background: var(--paper-2); border-radius: 12px; width: min(600px, 96vw); padding: 26px;
  box-shadow: 0 24px 60px rgba(20,25,30,.25); border: 1px solid var(--line); }
.modal h2 { margin: 0 0 18px; font-family: var(--serif); font-weight: 600; }
.modal .mactions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

.gate { display: grid; place-items: center; min-height: 78vh; }
.gate .card { background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 34px 30px; width: min(360px, 92vw); text-align: center; }
.gate .card h2 { font-family: var(--serif); }
.gate input { width: 100%; margin: 14px 0; }

.toast-ok { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 8px;
  font-weight: 500; z-index: 120; box-shadow: 0 12px 30px rgba(20,25,30,.2); }

/* ===========================================================================
   MUSIC PLAYER (music.js) — prompt, corner button / mini player, panel
   ======================================================================== */
:root { --ease-apple: cubic-bezier(.32, .72, 0, 1); --spring: cubic-bezier(.34, 1.5, .64, 1); }

.ic { width: 18px; height: 18px; display: block; flex: 0 0 auto; }
.ic.f { fill: currentColor; }
.ic.s { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* icon pairs that swap with state */
.mp-pp .i-pause, .mp-volbtn .i-mute, [data-a="repeat"] .i-repeat1 { display: none; }
.playing .mp-pp .i-play { display: none; }
.playing .mp-pp .i-pause { display: block; }
.mp-volbtn.muted .i-vol { display: none; }
.mp-volbtn.muted .i-mute { display: block; }
[data-a="repeat"].one .i-repeat { display: none; }
[data-a="repeat"].one .i-repeat1 { display: block; }

/* little equalizer bars (animate while playing) */
.mp-eq { display: flex; align-items: flex-end; gap: 2px; height: 13px; }
.mp-eq i {
  width: 3px; height: 100%; border-radius: 2px; background: currentColor;
  transform-origin: 50% 100%; transform: scaleY(.35);
  animation: mpEq .9s ease-in-out infinite; animation-play-state: paused;
}
.mp-eq i:nth-child(2) { animation-duration: .8s; animation-delay: -.45s; }
.mp-eq i:nth-child(3) { animation-duration: 1.05s; animation-delay: -.2s; }
.playing .mp-eq i { animation-play-state: running; }
@keyframes mpEq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* ---- "Would you like to play music?" ----------------------------------- */
.mp-prompt {
  position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 20px;
  background: rgba(12, 14, 18, 0); transition: background .3s ease;
}
.mp-prompt.show { background: rgba(12, 14, 18, .32); }
.mp-prompt-card {
  width: min(400px, 100%); padding: 28px 26px 22px; text-align: center;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(20, 25, 30, .25);
  opacity: 0; transform: translateY(10px) scale(.96);
  transition: opacity .3s ease, transform .45s var(--ease-apple);
}
.mp-prompt.show .mp-prompt-card { opacity: 1; transform: none; }
.mp-prompt-orb {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
}
.mp-prompt-orb .ic { width: 20px; height: 20px; }
.mp-prompt h2 { font-family: var(--serif); font-weight: 600; font-size: 24px; letter-spacing: -.01em; margin: 0 0 22px; line-height: 1.2; }
.mp-prompt-btns { display: flex; gap: 10px; justify-content: center; }
.mp-prompt-btns .btn { min-width: 112px; }

/* ---- corner button → mini player ---------------------------------------- */
.mp-mini {
  position: fixed; top: 20px; right: 20px; z-index: 70;
  display: flex; align-items: center; padding: 4px; border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--line-strong);
  box-shadow: 0 1px 2px rgba(20, 25, 30, .05), 0 12px 32px rgba(20, 25, 30, .13);
  transform-origin: calc(100% - 25px) 50%;
  opacity: 0; transform: scale(.3); visibility: hidden; pointer-events: none;
  transition: opacity .3s ease, transform .55s var(--spring), visibility 0s linear .55s;
}
.mp-mini.show {
  opacity: 1; transform: none; visibility: visible; pointer-events: auto;
  transition: opacity .3s ease, transform .55s var(--spring), visibility 0s;
}
.mp-mini.show.tucked {                     /* hidden while the panel is open */
  opacity: 0; transform: scale(.7); pointer-events: none;
  transition: opacity .2s ease, transform .4s var(--ease-apple);
}

.mp-orb {
  position: relative; width: 40px; height: 40px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer;
  transition: transform .25s var(--ease-apple), background .2s;
}
.mp-orb:hover { transform: scale(1.06); background: var(--accent-ink); }
.mp-orb:active { transform: scale(.94); }
.mp-orb > * { grid-area: 1 / 1; transition: opacity .25s ease, transform .4s var(--ease-apple); }
.mp-orb .mp-eq { opacity: 0; transform: scale(.5); }
.mp-mini.playing .mp-orb-note { opacity: 0; transform: scale(.5); }
.mp-mini.playing .mp-orb .mp-eq { opacity: 1; transform: none; }
.mp-mini.pop .mp-orb::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; pointer-events: none;
  border: 2px solid var(--accent); animation: mpRing 1.3s var(--ease-apple) .45s 2 both;
}
@keyframes mpRing { from { transform: scale(1); opacity: .55; } to { transform: scale(1.9); opacity: 0; } }

.mp-mini-body {
  max-width: 0; opacity: 0; overflow: hidden;
  transition: max-width .5s var(--ease-apple), opacity .2s ease;
}
.mp-mini.has-track .mp-mini-body {
  max-width: 290px; opacity: 1;
  transition: max-width .6s var(--ease-apple), opacity .35s ease .12s;
}
.mp-mini-inner { width: 270px; display: flex; align-items: center; gap: 2px; padding: 0 4px 0 12px; }
.mp-mini-title {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 0 8px 0 0;
  background: none; border: 0; color: var(--ink); cursor: pointer; text-align: left; font-family: var(--sans);
}
.mp-mt-title { display: block; overflow: hidden; white-space: nowrap; font-size: 13px; font-weight: 600; line-height: 1.2; }
.mp-mt-title span { display: inline-block; }
.mp-mt-title.scroll {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 14px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 14px), transparent);
}
.mp-mt-title.scroll span { padding-right: 32px; animation: mpMarquee var(--mqd, 10s) linear infinite; }
@keyframes mpMarquee { 0%, 12% { transform: translateX(0); } 100% { transform: translateX(calc(-1 * var(--mq))); } }
.mp-mt-bar { display: block; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.mp-mt-bar i { display: block; width: 0; height: 100%; border-radius: 2px; background: var(--accent); transition: width .25s linear; }
.mp-mini-ctrls { display: flex; align-items: center; }
.mp-cb {
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink);
  display: grid; place-items: center; cursor: pointer; transition: background .15s, transform .15s var(--ease-apple);
}
.mp-cb:hover { background: rgba(22, 38, 63, .07); }
.mp-cb:active { transform: scale(.9); }
.mp-cb .ic { width: 16px; height: 16px; }

/* ---- the full player ---------------------------------------------------- */
.mp-panel {
  position: fixed; top: 20px; right: 20px; z-index: 72; outline: none;
  width: min(420px, calc(100vw - 32px)); height: min(620px, calc(100vh - 150px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: 22px;
  box-shadow: 0 2px 6px rgba(20, 25, 30, .06), 0 30px 80px rgba(20, 25, 30, .22);
  transform-origin: calc(100% - 25px) 25px;          /* grows out of the corner button */
  opacity: 0; transform: scale(.1); visibility: hidden; pointer-events: none;
  transition: transform .46s var(--ease-apple), opacity .28s ease .14s, visibility 0s linear .5s;
}
.mp-panel.open {
  opacity: 1; transform: none; visibility: visible; pointer-events: auto;
  transition: transform .58s var(--ease-apple), opacity .2s ease, visibility 0s;
}
.mp-panel > * { opacity: 0; transform: translateY(8px); transition: opacity .18s ease, transform .3s var(--ease-apple); }
.mp-panel.open > * { opacity: 1; transform: none; transition: opacity .35s ease, transform .5s var(--ease-apple); }
.mp-panel.open > :nth-child(1) { transition-delay: .1s; }
.mp-panel.open > :nth-child(2) { transition-delay: .15s; }
.mp-panel.open > :nth-child(3) { transition-delay: .2s; }
.mp-panel.open > :nth-child(4) { transition-delay: .25s; }

.mp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 14px 10px 20px; }
.mp-head h2 { font-family: var(--serif); font-weight: 600; font-size: 23px; letter-spacing: -.01em; margin: 3px 0 0; }
.mp-head-b { display: flex; gap: 2px; }
.mp-ib {
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s, color .15s, transform .15s var(--ease-apple);
}
.mp-ib:hover { background: rgba(22, 38, 63, .07); color: var(--ink); }
.mp-ib:active { transform: scale(.9); }
.mp-tog.on { color: var(--accent); background: rgba(22, 38, 63, .09); }

.mp-tools { padding: 0 20px 12px; }
.mp-find {
  display: flex; align-items: center; gap: 8px; padding: 7px 11px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--muted);
}
.mp-find:focus-within { border-color: var(--accent); }
.mp-find .ic { width: 15px; height: 15px; }
.mp-find input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: 14px var(--sans); color: var(--ink); }

.mp-list {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 10px;
  border-top: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.mp-group {
  position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 10px 6px; background: var(--paper-2);
  font: 700 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.mp-group small { font: 500 11.5px var(--sans); letter-spacing: 0; text-transform: none; color: var(--faint); }
.mp-row {
  width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink);
  font-family: var(--sans); text-align: left; cursor: pointer; transition: background .15s;
}
.mp-row:hover { background: rgba(22, 38, 63, .05); }
.mp-lead { display: flex; align-items: center; }
.mp-num { font: 12px var(--mono); color: var(--faint); }
.mp-row .mp-eq { display: none; height: 12px; color: var(--accent); }
.mp-row.on { background: rgba(22, 38, 63, .07); }
.mp-row.on .mp-num { display: none; }
.mp-row.on .mp-eq { display: flex; }
.mp-rt { min-width: 0; font-size: 14px; line-height: 1.3; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mp-rt small { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.mp-row.on .mp-rt { color: var(--accent); font-weight: 600; }
.mp-rd { font: 12px var(--mono); color: var(--muted); }
.mp-empty { padding: 30px 10px; text-align: center; color: var(--muted); font-size: 14px; }

.mp-now { padding: 14px 20px; border-top: 1px solid var(--line); }
.mp-now-row { display: flex; align-items: center; gap: 12px; }
.mp-cover {
  width: 52px; height: 52px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent) center / cover no-repeat; color: #fff; font: 600 17px var(--serif);
  box-shadow: 0 6px 16px rgba(20, 25, 30, .18);
}
.mp-cover .ic { width: 20px; height: 20px; }
.mp-cover.bump { animation: mpBump .5s var(--spring); }
@keyframes mpBump { from { transform: scale(.86); } to { transform: none; } }
.mp-now-meta { flex: 1; min-width: 0; }
.mp-now-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-now-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-seek { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.mp-t { min-width: 34px; font: 11.5px var(--mono); color: var(--muted); }
.mp-t.mp-dur { text-align: right; }
.mp-ctrls { display: flex; align-items: center; justify-content: space-between; margin: 6px 6px 0; }
.mp-skip { width: 42px; height: 42px; color: var(--ink); }
.mp-skip .ic { width: 22px; height: 22px; }
.mp-play {
  width: 54px; height: 54px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; cursor: pointer; box-shadow: 0 8px 20px rgba(22, 38, 63, .28);
  transition: transform .2s var(--ease-apple), background .2s;
}
.mp-play:hover { background: var(--accent-ink); transform: scale(1.04); }
.mp-play:active { transform: scale(.93); }
.mp-play .ic { width: 22px; height: 22px; }
.mp-play .i-play { transform: translateX(1px); }
.mp-vol { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.mp-vol .mp-ib { width: 30px; height: 30px; }
.mp-vol .ic { width: 16px; height: 16px; }

/* sliders: thin track, thumb appears on hover (like Apple Music) */
.mp-range {
  --p: 0%; flex: 1; min-width: 0; height: 20px; margin: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.mp-range:focus-visible { outline: none; }
.mp-range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p), var(--line) var(--p));
}
.mp-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; margin-top: -4.5px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--paper-2); box-shadow: 0 1px 4px rgba(20, 25, 30, .3);
  transform: scale(0); transition: transform .18s var(--ease-apple);
}
.mp-range:hover::-webkit-slider-thumb, .mp-range:active::-webkit-slider-thumb,
.mp-range:focus-visible::-webkit-slider-thumb { transform: scale(1); }
.mp-range::-moz-range-track { height: 4px; border-radius: 99px; background: var(--line); }
.mp-range::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--accent); }
.mp-range::-moz-range-thumb { width: 11px; height: 11px; border: 2px solid var(--paper-2); border-radius: 50%; background: var(--accent); }
@media (hover: none) { .mp-range::-webkit-slider-thumb { transform: scale(1); } }

@media (max-width: 560px) {
  .mp-mini { top: 14px; right: 14px; }
  .mp-mini-inner { width: min(250px, calc(100vw - 100px)); }
  .mp-panel {
    top: 12px; right: 12px; width: calc(100vw - 24px); height: min(640px, calc(100dvh - 140px));
    transform-origin: calc(100% - 27px) 27px;
  }
  .newsbubble { width: calc(100vw - 110px); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
