/* —— Hidden medallion hit target —— */
.medallion-hit {
  position: absolute;
  z-index: 4;
  left: 69%;
  top: 61%;
  width: max(40px, calc(58 * 100vw / var(--layout-ref)));
  height: max(40px, calc(58 * 100vw / var(--layout-ref)));
  padding: 0;
  border: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
  cursor: pointer;
  opacity: 0;
}

.medallion-hit:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 3px;
  opacity: 0.35;
  background: radial-gradient(circle, rgba(229, 57, 53, 0.35), transparent 70%);
}

body.player-open {
  overflow: hidden;
}

/* —— Modal —— */
.b3ad-player {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 2vh, 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.b3ad-player.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.player-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(40, 36, 32, 0.55), transparent 55%),
    rgba(0, 0, 0, 0.9);
}

.player-shell {
  position: relative;
  width: min(94vw, 520px);
  max-height: min(92dvh, 720px);
  overflow-x: hidden;
  overflow-y: auto;
  margin: auto;
  padding: clamp(12px, 2.5vw, 18px);
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #2b2a28 0%, #151413 45%, #0b0a09 100%);
  border: 3px solid #3f3a36;
  outline: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 50px rgba(0, 0, 0, 0.85);
}

.player-shell::before,
.player-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0.35;
}

.player-shell::before {
  top: 10px;
  bottom: 10px;
  left: 8px;
  width: 2px;
  background: linear-gradient(180deg, transparent, #6e1a1a, transparent);
}

.player-shell::after {
  content: none;
}

.player-close {
  position: absolute;
  top: clamp(10px, 2vw, 14px);
  right: clamp(10px, 2vw, 14px);
  z-index: 3;
}

.player-top {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2.5vw, 14px);
  margin-bottom: 10px;
  padding-bottom: 10px;
  padding-right: clamp(2.5rem, 12vw, 3rem);
  border-bottom: 2px solid rgba(198, 40, 40, 0.35);
}

.player-header-emblem {
  flex: 0 0 auto;
  width: clamp(72px, 22vw, 120px);
  height: auto;
  max-height: clamp(40px, 9vh, 52px);
  object-fit: contain;
  margin: 0;
  opacity: 0.92;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.55));
}

.player-brand {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: var(--bebas);
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  letter-spacing: 0.12em;
  color: #e8e2da;
  text-shadow: 2px 2px 0 #0a0a0a;
}

.player-brand span {
  color: #9f2a2a;
}

.player-close {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65));
}

.player-close img {
  width: clamp(2rem, 6vw, 2.35rem);
  height: auto;
  display: block;
}

.player-close:hover,
.player-close:focus-visible {
  filter: drop-shadow(0 0 10px rgba(229, 57, 53, 0.55));
}

.player-display {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(8px, 2vw, 14px);
  align-items: end;
  padding: clamp(8px, 2vw, 12px);
  margin-bottom: 10px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.15)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 6px
    );
  border: 2px solid #3a3531;
  box-shadow: inset 0 8px 18px rgba(0, 0, 0, 0.45);
}

.player-tombstone {
  line-height: 0;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.65));
}

.player-tombstone__art {
  width: clamp(52px, 14vw, 72px);
  height: auto;
  display: block;
}

.b3ad-player.is-playing .player-tombstone__art {
  filter: contrast(1.08) saturate(1.08);
}

.player-readout {
  min-width: 0;
}

.player-track-index {
  display: inline-block;
  margin-bottom: 0.2rem;
  font-family: var(--bebas);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: #9f2a2a;
}

.player-track-title {
  margin: 0 0 6px;
  font-family: var(--bebas);
  font-size: clamp(0.95rem, 3.2vw, 1.15rem);
  letter-spacing: 0.08em;
  color: #ddd5cc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-viz {
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
  gap: 3px;
  width: 100%;
  height: clamp(44px, 10vh, 56px);
  padding: 4px 0 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.player-viz__candle {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.player-viz__wick {
  width: 2px;
  min-height: 2px;
  height: 6%;
  background: linear-gradient(180deg, #ff6b6b, #c62828 55%, #6d1a1a);
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(229, 57, 53, 0.45);
  transition: height 0.07s linear;
}

.player-viz__wick--top {
  margin-bottom: 1px;
}

.player-viz__wick--bot {
  margin-top: 1px;
}

.player-viz__body {
  width: 78%;
  min-width: 3px;
  min-height: 4px;
  height: 12%;
  background:
    linear-gradient(180deg, #ff5252 0%, #e53935 38%, #b71c1c 72%, #5d1515 100%);
  border: 1px solid #2a0a0a;
  border-radius: 1px;
  box-shadow:
    inset 0 2px 0 rgba(255, 200, 200, 0.22),
    inset 0 -3px 6px rgba(0, 0, 0, 0.35),
    0 0 8px rgba(198, 40, 40, 0.28);
  transition: height 0.07s linear;
}

.player-progress-wrap {
  margin-bottom: 10px;
}

.player-times {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  font-family: var(--bebas);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: #8a847c;
}

.player-progress {
  position: relative;
  height: clamp(14px, 3.5vh, 18px);
  background:
    url("../assets/player/player-progress-rail.png") center / 100% 100% no-repeat,
    #0d0c0b;
  border: none;
  cursor: pointer;
}

.player-progress__fill {
  height: 72%;
  margin-top: auto;
  margin-bottom: auto;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(183, 28, 28, 0.85), rgba(229, 57, 53, 0.75));
  box-shadow: 0 0 10px rgba(198, 40, 40, 0.35);
}

.player-progress__knob {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  line-height: 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.75));
}

.player-progress__knob img {
  width: clamp(16px, 4vw, 22px);
  height: auto;
  display: block;
}

.player-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 4vw, 18px);
  margin-bottom: 12px;
}

.player-ctrl {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.7));
  transition: filter 0.15s ease, transform 0.15s ease;
}

.player-ctrl img {
  width: clamp(2.35rem, 9vw, 2.75rem);
  height: auto;
  display: block;
}

.player-ctrl:hover,
.player-ctrl:focus-visible {
  filter: drop-shadow(0 0 12px rgba(229, 57, 53, 0.55));
  transform: translateY(-1px);
}

.player-play {
  position: relative;
  width: clamp(2.75rem, 11vw, 3.25rem);
  height: clamp(2.75rem, 11vw, 3.25rem);
}

.player-play img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-play .player-play__icon--play {
  display: block;
}

.player-play .player-play__icon--pause {
  display: none;
}

.player-play.is-playing .player-play__icon--play {
  display: none;
}

.player-play.is-playing .player-play__icon--pause {
  display: block;
}

.player-playlist {
  display: grid;
  gap: 6px;
  max-height: clamp(72px, 18vh, 110px);
  overflow: auto;
}

.player-playlist__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid #3a3531;
  background: rgba(0, 0, 0, 0.35);
  color: #cfc7be;
  font-family: var(--bebas);
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  padding: 0.42rem 0.55rem;
  cursor: pointer;
}

.player-playlist__item:hover,
.player-playlist__item.is-current {
  border-color: #7a2424;
  background: linear-gradient(90deg, rgba(79, 32, 32, 0.45), transparent);
  color: #f2ebe4;
}

.player-playlist__num {
  color: #9f2a2a;
  letter-spacing: 0.14em;
}

.player-playlist__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}