/* =====================================================================
   Sound Money Records — player.css
   The player view, the catalogue sheet, the tip sheet.
   ===================================================================== */

.player {
  width: 100%; max-width: 520px;
  margin: 0 auto;
  padding: 18px 20px 28px;
  display: flex; flex-direction: column; align-items: center;
  flex: 1;
}

/* ---- Art (flips over to lyrics) ---------------------------------------- */
.player-art {
  width: min(100%, 72vh);
  max-width: 420px;
  aspect-ratio: 1 / 1;
  position: relative;
  perspective: 1400px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.art-inner {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.25, 1);
}
.player-art.flipped .art-inner { transform: rotateY(180deg); }
.art-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6), 0 0 0 1px var(--border-grey);
}
/* When the patron plaque is fused below, the art's bottom corners square off
   so cover + plaque read as one card. */
.player-art.has-plaque .art-face { border-radius: 8px 8px 0 0; }
.art-front { background: var(--dark-grey) url('/img/SoundMoneyRecords-logo-dark.jpg') center / 60% no-repeat; }
.art-front img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.25s;
}
.art-front img.loaded { opacity: 1; }
.art-hint {
  position: absolute; right: 10px; bottom: 10px;
  font-size: 0.56rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--off-white); background: rgba(10,10,10,0.65);
  padding: 4px 8px; border-radius: 3px;
  opacity: 0.75;
}
.art-back {
  transform: rotateY(180deg);
  background: var(--near-black);
  display: flex; flex-direction: column;
  cursor: default;
}
.lyrics-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 8px 8px 16px; flex-shrink: 0;
  border-bottom: 1px solid var(--border-grey);
}
.lyrics-head .mono { font-size: 0.64rem; letter-spacing: 2px; color: var(--accent); text-transform: uppercase; }
.lyrics-close {
  font-size: 1.4rem; line-height: 1; color: var(--text-grey);
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.lyrics-close:hover { color: var(--pure-white); background: var(--dark-grey); }
.lyrics-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  position: relative;
  padding: 16px 20px 24px; text-align: center;
  font-size: 0.98rem; line-height: 1.8; color: var(--light-grey);
  overscroll-behavior: contain;
  scrollbar-width: thin;                              /* Firefox */
  scrollbar-color: var(--border-hi) transparent;
}
.lyrics-body::-webkit-scrollbar { width: 5px; }
.lyrics-body::-webkit-scrollbar-track { background: transparent; }
.lyrics-body::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
.lyrics-body::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
.lyrics-body .sec {
  display: block; margin: 18px 0 6px;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent);
}
.lyrics-body .sec:first-child { margin-top: 0; }
.lyrics-body .quiet { color: var(--text-grey); font-style: italic; }
/* synced mode: the rest dims, the current line lights up */
.lyrics-body.synced > div[data-dl] { color: var(--text-grey); transition: color 0.3s, transform 0.3s; }
.lyrics-body.synced > div[data-dl].active {
  color: var(--accent); font-weight: 600;
  transform: scale(1.04);
}

/* ---- Meta -------------------------------------------------------------- */
.player-meta { text-align: center; margin: 18px 0 10px; width: 100%; }
.track-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 7.5vw, 2.4rem);
  line-height: 1.02; letter-spacing: 1px;
  color: var(--pure-white);
  overflow-wrap: anywhere;
}
/* The song's vote count — total sats voted lives with the title */
.track-votes { margin-top: 6px; font-size: 0.7rem; letter-spacing: 1.5px; color: var(--light-grey); }
.track-votes .unranked { font-size: 0.6rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-grey); }

/* ---- Scrubber ---------------------------------------------------------- */
.scrub { width: 100%; display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.time { font-size: 0.7rem; color: var(--text-grey); min-width: 36px; text-align: center; }
.scrub-bar {
  flex: 1; height: 28px; position: relative; cursor: pointer;
  touch-action: none;
}
.scrub-bar::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  height: 3px; transform: translateY(-50%);
  background: var(--mid-grey); border-radius: 2px;
}
.scrub-fill {
  position: absolute; left: 0; top: 50%; height: 3px; width: 0;
  transform: translateY(-50%);
  background: var(--accent); border-radius: 2px;
}
.scrub-fill::after {
  content: ''; position: absolute; right: -6px; top: 50%;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); transform: translateY(-50%);
  box-shadow: 0 0 0 3px rgba(255,155,0,0.2);
}

/* ---- Transport --------------------------------------------------------- */
.transport { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 2px 0 18px; }
.ctrl {
  width: 54px; height: 54px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--off-white); transition: background 0.15s, transform 0.05s;
  -webkit-tap-highlight-color: transparent;
}
.ctrl svg { width: 26px; height: 26px; }
.ctrl:hover { background: var(--dark-grey); }
.ctrl:active { transform: scale(0.94); }
.ctrl.play {
  width: 76px; height: 76px;
  background: var(--accent); color: var(--black);
  box-shadow: 0 8px 28px rgba(255,155,0,0.28);
}
.ctrl.play:hover { background: #ffb43a; }
.ctrl.play svg { width: 34px; height: 34px; }
.ctrl.play .ico-pause { display: none; }
body.is-playing .ctrl.play .ico-play { display: none; }
body.is-playing .ctrl.play .ico-pause { display: block; }
.ctrl:disabled { opacity: 0.35; }

/* ---- The two actions --------------------------------------------------- */
.song-actions {
  width: 100%; display: grid; grid-template-columns: 1fr; gap: 10px;
}
.action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 14px;
  font-family: var(--font-head); font-size: 0.84rem; font-weight: 600;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--pure-white);
  background: var(--near-black);
  border: 1px solid var(--border-hi); border-radius: 6px;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
  -webkit-tap-highlight-color: transparent;
}
.action-btn:hover { border-color: var(--accent); background: var(--dark-grey); }
.action-btn:active { transform: scale(0.985); }
.action-ico { color: var(--accent); font-size: 1rem; }
/* Vote button — the countdown ticks inside it while the Day One window is
   open: the deadline IS the call to action. */
.vote-btn {
  border: 1px solid var(--accent); background: rgba(255,155,0,0.08);
  flex-wrap: wrap;
}
.vote-btn:hover { background: rgba(255,155,0,0.18); }
/* Heart-with-bolt mark — the bolt is a cutout, all accent orange */
.vote-btn .action-ico svg { display: block; width: 19px; height: 19px; fill: var(--accent); }
.vote-count { font-size: 0.82rem; color: var(--pure-white); letter-spacing: 1px; }
.vote-count::before { content: '·'; margin-right: 8px; color: var(--accent); }

/* info icon — how the crown works (16px glyph, padded to a real touch target) */
.d1-info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-left: 5px; padding: 0;
  border: 0; background: transparent; color: var(--text-grey);
  cursor: pointer; vertical-align: middle; position: relative;
}
.d1-info svg { width: 16px; height: 16px; fill: currentColor; }
.d1-info::after { content: ''; position: absolute; inset: -11px; }   /* 44px hit area */
.d1-info:hover { color: var(--accent); }
.d1-pop {
  padding: 12px 14px; margin: 2px 0;
  border: 1px solid var(--border-hi); background: var(--near-black);
  font-size: 0.8rem; line-height: 1.55; color: var(--light-grey);
}
.d1-pop strong { color: var(--accent); font-weight: 600; }

#voteTotal.bump, #topBid.bump { animation: vote-bump 0.5s ease; display: inline-block; }
@keyframes vote-bump {
  0% { transform: scale(1); color: var(--accent); }
  35% { transform: scale(1.22); color: var(--pure-white); }
  100% { transform: scale(1); }
}
/* A vote just landed — 2s glow on the tally surfaces so nobody misses it */
.vote-glow { animation: vote-glow 2s ease; }
@keyframes vote-glow {
  0%   { box-shadow: 0 0 0 0 rgba(255,155,0,0); }
  12%  { box-shadow: 0 0 22px 4px rgba(255,155,0,0.65); background-color: rgba(255,155,0,0.16); }
  60%  { box-shadow: 0 0 14px 2px rgba(255,155,0,0.3); }
  100% { box-shadow: 0 0 0 0 rgba(255,155,0,0); }
}

/* ---- Related shirt strip ----------------------------------------------- */
.related-merch {
  width: 100%; margin-top: 10px;
  display: grid; grid-template-columns: 56px 1fr auto auto; align-items: center; gap: 12px;
  padding: 8px 12px 8px 8px;
  background: var(--near-black); border: 1px solid var(--border-grey); border-radius: 6px;
  transition: border-color 0.15s;
}
.related-merch:hover { border-color: var(--accent); }
.rm-img { width: 56px; height: 56px; border-radius: 4px; object-fit: cover; background: var(--dark-grey); }
.rm-meta { display: flex; flex-direction: column; min-width: 0; }
.rm-label { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); }
.rm-title {
  font-family: var(--font-head); font-weight: 500; font-size: 0.92rem; color: var(--off-white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rm-price { font-size: 0.8rem; color: var(--light-grey); }
.rm-arrow { color: var(--text-grey); font-size: 1.1rem; }

/* ---- Utility row (quieter) -------------------------------------------- */
.utility-row {
  width: 100%; display: flex; justify-content: center; gap: 6px; row-gap: 2px;
  margin-top: 14px; flex-wrap: wrap;
}
.util-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-head); font-size: 0.66rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-grey); padding: 10px 12px; border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.util-btn svg { width: 16px; height: 16px; }
.util-btn:hover { color: var(--off-white); background: var(--near-black); }
.util-btn[aria-pressed="true"] { color: var(--accent); }
.util-btn.flash { color: var(--green); }

.player-status {
  margin-top: 14px; font-size: 0.85rem; color: var(--text-grey); text-align: center;
}
.player-status.error { color: var(--red); }
.player-status button { color: var(--accent); text-decoration: underline; font: inherit; }

@media (min-width: 640px) {
  .player { padding-top: 28px; }
  .utility-row { gap: 14px; }
}

/* ---- Catalogue sheet --------------------------------------------------- */
#catalogSheet .sheet-panel { height: 88vh; height: 88dvh; }
@media (min-width: 640px) { #catalogSheet .sheet-panel { height: 80vh; width: 560px; } }
.catalog-tools { display: flex; gap: 8px; margin: 6px 0 10px; }
.catalog-search {
  flex: 1; min-width: 0; height: 42px; padding: 0 12px;
  background: var(--black); border: 1px solid var(--border-grey); border-radius: 4px;
  font-size: 0.95rem; -webkit-appearance: none;
}
.catalog-search::placeholder { color: var(--text-dim); }
.catalog-search:focus { outline: none; border-color: var(--accent); }
.sort-toggle {
  height: 42px; padding: 0 12px; border-radius: 4px;
  font-size: 0.64rem; letter-spacing: 1.5px;
  background: var(--black); border: 1px solid var(--border-grey); color: var(--text-grey);
  white-space: nowrap;
}
.sort-toggle:hover { color: var(--accent); border-color: var(--accent); }
.catalog-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
.catalog-row {
  width: 100%; display: grid; grid-template-columns: 1fr auto;
  grid-template-areas: "title dur" "meta dur";
  gap: 0 12px; padding: 11px 8px; text-align: left;
  border-bottom: 1px solid var(--border-grey); border-radius: 4px;
  transition: background 0.12s;
}
.catalog-row:hover { background: var(--dark-grey); }
.catalog-row.current { background: rgba(255,155,0,0.08); }
.catalog-row.current .catalog-title { color: var(--accent); }
.catalog-title {
  grid-area: title;
  font-family: var(--font-head); font-weight: 500; font-size: 0.98rem;
  color: var(--off-white); overflow-wrap: anywhere;
}
.catalog-meta {
  grid-area: meta; font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 1px; text-transform: uppercase; color: var(--text-grey); margin-top: 2px;
}
.catalog-meta .tag { color: var(--accent); }
.catalog-dur { grid-area: dur; align-self: center; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-grey); }
.catalog-empty { padding: 30px 8px; color: var(--text-grey); text-align: center; }

/* ---- Patron plaque + tip sheet (bitcointipjar embed) -------------------- */
/* Fused to the artwork's bottom edge — the patron's name is ON the cover,
   not in a box under it. Width matches the art exactly; the art's 1px ring
   (box-shadow) draws the seam line. */
.day-one {
  display: flex; flex-direction: column; gap: 6px;
  width: min(100%, 72vh); max-width: 420px;   /* matches the art above it */
  margin: 0 auto; padding: 9px 14px 10px;
  border: 1px solid var(--border-grey); border-top: 0;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(rgba(255,155,0,0.06), rgba(255,155,0,0.02)), var(--near-black);
}

/* Sheets: lock the page underneath; short screens get a compact settle hero */
body.sheet-lock { overflow: hidden; }
@media (max-height: 560px) {
  .settle-hero { min-height: 200px; gap: 8px; }
  .settle-fire { font-size: 2rem; }
  .settle-title { font-size: 1.8rem; }
  .tip-frame { height: 420px; }
}
.d1-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.d1-row.inline { justify-content: flex-start; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.d1-row.inline .d1-label { white-space: nowrap; flex-shrink: 0; }
.d1-row.inline .d1-crown { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 460px) { .d1-row.inline .d1-note { display: none; } }
.d1-label { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); }
/* On the plaque, the patron's name is the headline */
.d1-leader { font-size: 0.82rem; font-weight: 600; color: var(--accent); letter-spacing: 1px; overflow-wrap: anywhere; min-width: 0; }
.d1-crown { font-size: 0.78rem; color: var(--pure-white); letter-spacing: 1px; }
.d1-rank { font-size: 0.6rem; color: var(--text-grey); letter-spacing: 1.5px; text-transform: uppercase; }
.d1-rank.unranked { color: var(--text-grey); }
.d1-note { font-size: 0.56rem; color: var(--text-grey); letter-spacing: 0.5px; text-transform: none; }

.sheet-sub {
  margin: -4px 0 12px; font-size: 0.82rem; line-height: 1.55; color: var(--text-grey);
}
.sheet-sub strong { color: var(--pure-white); font-weight: 600; }
.sheet-sub strong.mono { color: var(--accent); }

.catalog-rank { color: var(--accent); font-size: 0.72rem; letter-spacing: 1px; }

.tip-embed { line-height: 0; }
.tip-frame { width: 100%; height: 480px; border: 0; border-radius: 8px; background: transparent; }
/* Phones: iOS traps a swipe inside an iframe whose document overflows, so the
   sheet behind it never scrolls and the QR/pay button stay out of reach. Make
   the iframe TALLER than the embed's content (generous slack below the pay
   button) — its document then has nothing to scroll, iOS chains the touch up
   to the sheet panel, and the panel scrolls the whole embed into view. */
@media (max-width: 639px) {
  #tipSheet .sheet-panel { height: 94vh; height: 94dvh; }
  #tipSheet .tip-frame { height: 820px; }
}

/* Settle moment — takes over the sheet, then it auto-closes */
.settle-hero {
  min-height: 340px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  text-align: center; line-height: 1.3; animation: settle-pop 0.35s ease;
}
@keyframes settle-pop { 0% { transform: scale(0.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.settle-fire { font-size: 3.2rem; line-height: 1; }
.settle-title {
  font-family: var(--font-display); font-size: 2.6rem; letter-spacing: 4px;
  color: var(--accent); text-transform: uppercase; line-height: 1.05;
}
.settle-sub { font-family: var(--font-mono); font-size: 0.9rem; color: var(--pure-white); letter-spacing: 1px; }
.settle-note { font-size: 0.8rem; color: var(--text-grey); max-width: 320px; }
.lead-share { display: flex; gap: 8px; margin-top: 10px; }
.lead-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--accent); background: rgba(255,155,0,0.08);
  color: var(--accent); font-family: var(--font-head); font-size: 0.68rem;
  letter-spacing: 1.5px; text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.lead-btn:hover { background: rgba(255,155,0,0.16); }
