/* Fixed tape-deck player — passenger seat chrome */

.deck {
  position: fixed;
  left: 50%;
  bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  z-index: 6;
  width: min(540px, calc(100% - 1.25rem));
  transform: translateX(-50%);
  padding: 0.85rem 1rem 0.8rem;
  border: 1px solid rgba(243, 235, 224, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(56, 38, 28, 0.92), rgba(22, 14, 10, 0.94));
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 240, 210, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition:
    transform 0.35s var(--ease),
    opacity 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

body.is-reading .deck {
  box-shadow:
    0 16px 44px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 240, 210, 0.1),
    0 0 0 1px rgba(212, 184, 150, 0.08);
}

.deck-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.deck-meta {
  min-width: 0;
  flex: 1;
}

.deck-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--wheat);
}

.deck-title {
  margin: 0.2rem 0 0;
  font-family: var(--display);
  font-size: 1.08rem;
  letter-spacing: 0.03em;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-sub {
  margin: 0.15rem 0 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(243, 235, 224, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.deck-btn {
  display: grid;
  place-items: center;
}

.deck-btn .icon-play,
.deck-btn .icon-pause {
  width: 0;
  height: 0;
  border-style: solid;
}

.deck-btn .icon-play {
  margin-left: 2px;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #2a221c;
}

.deck-btn.is-playing .icon-play {
  display: none;
}

.deck-btn .icon-pause {
  display: none;
  width: 10px;
  height: 12px;
  border: 0;
  background:
    linear-gradient(#2a221c, #2a221c) 0 0 / 3px 100% no-repeat,
    linear-gradient(#2a221c, #2a221c) 100% 0 / 3px 100% no-repeat;
}

.deck-btn.is-playing .icon-pause {
  display: block;
}

.deck-meter {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 1.1rem;
  opacity: 0.45;
}

.deck-meter span {
  width: 3px;
  height: 30%;
  background: var(--wheat);
  border-radius: 1px;
  transition: height 0.12s linear;
}

.deck.is-live .deck-meter {
  opacity: 1;
}

.deck-progress {
  position: relative;
  height: 3px;
  margin-top: 0.65rem;
  border-radius: 999px;
  background: rgba(243, 235, 224, 0.1);
  overflow: hidden;
}

.deck-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--clay), var(--wheat));
  transition: width 0.15s linear;
}

.viz-wrap {
  position: relative;
  height: 40px;
  margin-top: 0.45rem;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 1px rgba(243, 235, 224, 0.08);
}

#grass-viz {
  display: block;
  width: 100%;
  height: 100%;
}

.deck-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.deck-hint {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(243, 235, 224, 0.55);
  line-height: 1.35;
}

.deck-hint code {
  font-family: inherit;
  color: inherit;
}

.deck-time {
  margin: 0;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: rgba(243, 235, 224, 0.5);
  font-variant-numeric: tabular-nums;
}

.deck.is-live .deck-time {
  color: rgba(243, 235, 224, 0.75);
}

.deck-missing {
  color: var(--dusk-rose);
}

.deck.is-unavailable {
  opacity: 0.92;
}

@media (max-width: 560px) {
  .deck {
    bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
    padding: 0.7rem 0.8rem 0.65rem;
    border-radius: 10px;
  }

  .deck-title {
    font-size: 0.98rem;
  }

  .viz-wrap {
    height: 34px;
  }

  .deck-hint {
    font-size: 0.56rem;
    letter-spacing: 0.08em;
  }
}
