/* Components: buttons, cards, grids, badges, forms, modal, player bar, comments. */

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-body);
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .72rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #14120e;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--gold-bright); border-color: var(--gold-bright); color: #14120e; transform: translateY(-1px); }
[data-theme="light"] .btn { color: #faf7f1; }
[data-theme="light"] .btn:hover { color: #faf7f1; }

.btn-ghost {
  background: transparent;
  color: var(--gold);
}
.btn-ghost:hover { background: var(--gold-soft); color: var(--gold-bright); transform: translateY(-1px); }
[data-theme="light"] .btn-ghost { color: var(--gold); }
[data-theme="light"] .btn-ghost:hover { color: var(--gold-bright); }

.btn-danger { border-color: var(--danger); background: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: var(--bg); transform: none; }

.btn-sm { padding: .42rem .95rem; font-size: .74rem; }

/* ---------- cards ---------- */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.card:hover {
  border-color: color-mix(in srgb, var(--gold) 45%, var(--hairline));
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.card .card-body { padding: 1.3rem 1.4rem 1.5rem; }
.card .card-media { aspect-ratio: 1; background: var(--gold-soft); object-fit: cover; width: 100%; }
.card .card-media-wide { aspect-ratio: 16 / 9; }
.card h3 { margin-bottom: .3rem; }
.card .muted { color: var(--ink-dim); font-size: .92rem; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); }

/* placeholder artwork when no image is set */
.art-placeholder {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 25%, var(--gold-soft), transparent 60%),
    var(--bg-raised);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--gold);
  letter-spacing: .2em;
}

/* ---------- badges / pills ---------- */
.pill {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .28rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  color: var(--ink-dim);
}
.pill-gold { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.pill-live {
  border-color: var(--danger); color: var(--danger);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- track rows ---------- */
.track-list { list-style: none; margin: 0; padding: 0; }
.track-item { border-bottom: 1px solid var(--hairline); }
.track-row {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: .85rem .9rem;
  border-radius: var(--radius-sm);
  transition: background-color var(--dur-fast) var(--ease);
  cursor: pointer;
}
.track-caption {
  max-height: 0;
  overflow: hidden;
  transition: max-height 320ms var(--ease), opacity 320ms var(--ease);
  opacity: 0;
}
.track-caption.open { max-height: 320px; opacity: 1; }
.track-caption .tc-inner {
  padding: .1rem 1rem 1.1rem calc(52px + 2rem); /* aligns under the title, past the artwork */
  color: var(--ink-dim);
  font-size: .92rem;
  max-width: 62ch;
  border-left: 1px solid var(--gold);
  margin-left: .9rem;
  -webkit-user-select: none;
  user-select: none; /* view-only, like the lyrics */
  cursor: default;
}
.track-caption .tc-inner p:last-child { margin-bottom: 0; }
@media (max-width: 560px) {
  .track-caption .tc-inner { padding-left: 1rem; }
}

/* ---------- radio reactions + inline lyrics ---------- */
.radio-reactions {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 1.4rem 1.1rem;
}
.react-pill {
  cursor: pointer;
  background: none;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
button.react-pill:hover { border-color: var(--gold); color: var(--gold); }
#like-btn.liked { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); cursor: default; }
#heart-btn.heart-pop { animation: heart-pop 300ms var(--ease); }
@keyframes heart-pop {
  35% { transform: scale(1.25); border-color: var(--danger); color: var(--danger); }
}
/* the radio lyrics box lives inside the card, not a track row — full width, taller */
#radio-lyrics .tc-inner { padding: .1rem 1.4rem 1.2rem; margin-left: 1.4rem; }
#radio-lyrics.open { max-height: 55vh; overflow-y: auto; }

/* ---------- live shared reactions ---------- */
#heart-sky {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 60; /* above content, below modals */
}
.float-heart {
  position: absolute;
  will-change: transform, opacity;
  animation: heart-rise 2.6s ease-out forwards;
}
@keyframes heart-rise {
  0%   { transform: translate(0, 0) scale(.6); opacity: 0; }
  12%  { opacity: 1; transform: translate(calc(var(--sway, 0px) * .2), -6vh) scale(1); }
  100% { transform: translate(var(--sway, 0px), -85vh) scale(1.15); opacity: 0; }
}
.big-heart {
  position: absolute;
  left: 50%;
  top: 42%;
  font-size: 6rem;
  will-change: transform, opacity;
  animation: big-heart-pop 1.8s ease-out forwards;
}
@keyframes big-heart-pop {
  0%   { transform: translate(-50%, -50%) scale(.2); opacity: 0; }
  25%  { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  40%  { transform: translate(-50%, -50%) scale(.95); }
  60%  { transform: translate(-50%, -50%) scale(1.05); }
  100% { transform: translate(-50%, -58%) scale(1.3); opacity: 0; }
}
#like-btn.strobe { animation: like-strobe 1.2s ease-in-out; }
@keyframes like-strobe {
  0%, 33%, 66% { box-shadow: 0 0 0 0 transparent; background: transparent; }
  16%, 50%, 83% {
    box-shadow: 0 0 14px 2px var(--gold-soft);
    background: var(--gold-soft);
    border-color: var(--gold);
    color: var(--gold);
  }
}
@media (prefers-reduced-motion: reduce) {
  .float-heart { animation: reduced-blink 1s ease-out forwards; }
  .big-heart { animation: reduced-blink 1.2s ease-out forwards; transform: translate(-50%, -50%); }
  #like-btn.strobe { animation: reduced-blink 1s ease-out; }
  @keyframes reduced-blink { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
}
.track-row:hover { background: var(--gold-soft); }
.track-row.playing { background: var(--gold-soft); }
.track-row.playing .track-title { color: var(--gold-bright); }
.track-thumb {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--hairline);
  flex-shrink: 0;
}
.track-thumb-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.3rem;
}
.track-main { flex: 1; min-width: 0; }
.track-title { font-weight: 500; }
.track-sub { color: var(--ink-dim); font-size: .84rem; }
.track-actions { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }

.play-btn {
  width: 42px; height: 42px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  flex-shrink: 0;
}
.play-btn:hover { background: var(--gold); color: var(--bg); }

/* ---------- forms ---------- */
.field { margin-bottom: 1.3rem; }
.field label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: .45rem;
}
.field input[type="text"], .field input[type="password"], .field input[type="url"],
.field input[type="number"], .field input[type="date"], .field input[type="datetime-local"],
.field textarea, .field select {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .95rem;
  padding: .7rem .9rem;
  transition: border-color var(--dur-fast) var(--ease);
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--gold);
}
.field .hint { font-size: .8rem; color: var(--ink-dim); margin-top: .35rem; }
.field .counter { float: right; font-weight: 400; letter-spacing: 0; text-transform: none; }
.field-error { color: var(--danger); font-size: .85rem; margin-top: .35rem; }

/* honeypot — offscreen, not display:none (bots check that) */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  height: 1px; width: 1px;
  overflow: hidden;
}

/* ---------- modal (native <dialog>) ---------- */
dialog.savrok-modal {
  background: var(--bg-raised);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--hairline));
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
  padding: 0;
  max-width: min(440px, calc(100vw - 2.5rem));
  width: 100%;
  opacity: 0;
  transform: scale(.97) translateY(6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
dialog.savrok-modal.open { opacity: 1; transform: none; }
dialog.savrok-modal::backdrop {
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(8px);
}
.savrok-modal .modal-inner { padding: 1.8rem 1.9rem 1.6rem; }
.savrok-modal h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin: 0 0 .6rem;
}
.savrok-modal h3::after {
  content: "";
  display: block;
  width: 2.2rem; height: 1px;
  background: var(--gold);
  opacity: .6;
  margin-top: .7rem;
}
.savrok-modal .modal-body { color: var(--ink-dim); font-size: .95rem; max-height: 60vh; overflow-y: auto; }
.savrok-modal .modal-body pre {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: .9rem 1.1rem;
  overflow-x: auto;
  font-size: .84rem;
  line-height: 1.6;
  color: var(--ink);
}

/* resizable variant (lyrics): drag the bottom-right corner to widen */
dialog.savrok-modal.resizable {
  resize: both;
  overflow: hidden;
  min-width: min(320px, 90vw);
  min-height: 220px;
  max-width: min(92vw, 960px);
  max-height: 86vh;
}
dialog.savrok-modal.resizable[open] { display: flex; flex-direction: column; }
dialog.savrok-modal.resizable .modal-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
dialog.savrok-modal.resizable .modal-body {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

/* lyric section chips: [Verse 1] / [Chorus] rendered as elegant gold labels */
.savrok-modal .lyric-section,
#radio-lyrics .lyric-section {
  display: inline-block;
  font-family: var(--font-body);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  border-radius: 999px;
  padding: .22rem .75rem;
  margin: .35rem 0 .1rem;
}

/* view-only content (lyrics): selection and copying disabled */
.savrok-modal .no-copy {
  -webkit-user-select: none;
  user-select: none;
  cursor: default;
}
.savrok-modal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .7rem;
  margin-top: 1.5rem;
}

/* ---------- player bar ---------- */
.player-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  background: var(--bg-overlay);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--hairline);
  box-shadow: var(--shadow-bar);
  transform: translateY(105%);
  transition: transform 320ms var(--ease);
}
.player-bar.visible { transform: none; }
.player-bar .progress {
  position: absolute;
  top: -1px; left: 0;
  height: 2px;
  width: 100%;
  background: var(--hairline);
  cursor: pointer;
}
.player-bar .progress .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width 200ms linear;
}
.player-bar .inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem clamp(1.1rem, 4vw, 2rem);
  max-width: var(--container);
  margin: 0 auto;
}
.player-bar .p-art {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--hairline);
}
.player-bar .p-main { flex: 1; min-width: 0; }
.player-bar .p-title {
  font-weight: 500;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-bar .p-sub { color: var(--ink-dim); font-size: .78rem; }
.player-bar .p-time {
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
  font-size: .8rem;
}
.player-bar .p-vol {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.player-bar .p-mute {
  background: none;
  border: none;
  color: var(--ink-dim);
  cursor: pointer;
  padding: .3rem;
  display: inline-flex;
  transition: color var(--dur-fast) var(--ease);
}
.player-bar .p-mute:hover { color: var(--gold); }
.player-bar .p-mute.muted { color: var(--gold); opacity: .55; }
.player-bar .p-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 88px;
  height: 2px;
  background: var(--hairline);
  border-radius: 999px;
  cursor: pointer;
  outline-offset: 6px;
}
.player-bar .p-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  transition: transform var(--dur-fast) var(--ease);
}
.player-bar .p-volume::-webkit-slider-thumb:hover { transform: scale(1.25); }
.player-bar .p-volume::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
}
.player-bar .p-volume::-moz-range-progress { background: var(--gold); height: 2px; }
@media (max-width: 620px) { .player-bar .p-vol { display: none; } }

/* ---------- comments ---------- */
.comment {
  border-bottom: 1px solid var(--hairline);
  padding: 1.3rem 0;
}
.comment .c-head {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  margin-bottom: .35rem;
}
.comment .c-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
}
.comment .c-date { color: var(--ink-dim); font-size: .8rem; }
.comment .c-body { white-space: pre-line; color: var(--ink); }

/* ---------- store items ---------- */
.item-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--bg-raised);
  transition: border-color var(--dur) var(--ease);
}
.item-row:hover { border-color: color-mix(in srgb, var(--gold) 45%, var(--hairline)); }
.item-row .i-kind {
  font-size: .68rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold);
}
.item-row .i-main { flex: 1; min-width: 0; }
.item-row .i-price { font-family: var(--font-display); font-size: 1.25rem; white-space: nowrap; }
.item-row .i-note { color: var(--ink-dim); font-size: .82rem; }

/* ---------- info button (admin field help) ---------- */
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px; height: 17px;
  margin-left: .4rem;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: none;
  color: var(--gold);
  font-family: var(--font-display);
  font-style: italic;
  font-size: .72rem;
  line-height: 1;
  cursor: pointer;
  vertical-align: text-bottom;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.info-btn:hover { background: var(--gold); color: var(--bg); }

/* ---------- misc ---------- */
.muted { color: var(--ink-dim); }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.empty-state {
  border: 1px dashed var(--hairline);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--ink-dim);
}
.flash {
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  border-radius: var(--radius-sm);
  padding: .9rem 1.1rem;
  margin-bottom: 1.4rem;
  font-size: .92rem;
}
