/* ============================================================
   Rite Player — site-wide dock + hero console (kaldi.world)
   ============================================================ */

/* —— Floating dock (all pages) ——
   Default: bottom-LEFT so it doesn't cover Orchard cart (right).
   Draggable — position persisted in sessionStorage.
   z-index sits under cart drawers (cart is 320+).
*/
#rite-dock {
  position: fixed;
  left: 1rem;
  right: auto;
  bottom: 1rem;
  top: auto;
  z-index: 200;
  width: min(22.5rem, calc(100vw - 2rem));
  font-family: Outfit, system-ui, sans-serif;
  color: #f4efe6;
  pointer-events: none;
  /* left/top set by JS when user drags */
}
#rite-dock * { pointer-events: auto; box-sizing: border-box; }
#rite-dock.is-dragging {
  z-index: 250;
  opacity: 0.95;
  cursor: grabbing;
}
#rite-dock.is-dragging .rite-dock-card {
  transition: none;
  box-shadow:
    0 0 0 1px rgba(196, 165, 116, 0.45),
    0 28px 60px rgba(0, 0, 0, 0.65),
    0 0 48px rgba(127, 29, 29, 0.25);
}

.rite-dock-card {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  border: 1px solid rgba(196, 165, 116, 0.28);
  background:
    radial-gradient(ellipse 90% 70% at 80% 0%, rgba(127, 29, 29, 0.2), transparent 55%),
    linear-gradient(160deg, rgba(14, 10, 18, 0.97) 0%, rgba(6, 5, 8, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 18px 50px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(127, 29, 29, 0.12);
  backdrop-filter: blur(12px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.35s ease;
}
.rite-dock-card:hover {
  border-color: rgba(196, 165, 116, 0.42);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 22px 56px rgba(0, 0, 0, 0.6),
    0 0 48px rgba(127, 29, 29, 0.18);
}
.rite-dock-card.is-collapsed {
  /* mini bar only */
}
.rite-dock-card.is-killed {
  opacity: 0.72;
}

.rite-dock-glyph {
  position: absolute;
  right: 0.35rem;
  top: -0.15rem;
  font-size: 2.25rem;
  opacity: 0.18;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 0 12px rgba(155, 28, 53, 0.35));
}

.rite-dock-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem 0.55rem;
  padding-right: 2.25rem; /* room for collapse btn */
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.rite-dock-top:active,
#rite-dock.is-dragging .rite-dock-top {
  cursor: grabbing;
}
.rite-dock-top .rite-dock-label::after {
  content: " · drag";
  letter-spacing: 0.12em;
  opacity: 0.45;
  font-size: 0.48rem;
}

.rite-dock-meta { flex: 1; min-width: 0; }
.rite-dock-label {
  margin: 0;
  font-size: 0.52rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(196, 165, 116, 0.7);
}
.rite-dock-title {
  margin: 0.2rem 0 0;
  font-family: "Cinzel Decorative", Cinzel, Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e8d4a8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 18px rgba(196, 165, 116, 0.25), 0 0 28px rgba(155, 28, 53, 0.2);
}
.rite-dock-sub {
  margin: 0.15rem 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.8rem;
  font-style: italic;
  color: rgba(184, 176, 168, 0.65);
}

.rite-dock-progress {
  height: 2px;
  margin: 0 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
}
.rite-dock-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7f1d1d, #c4a574, #7f1d1d);
  transition: width 0.12s linear;
}

.rite-dock-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem 0.45rem;
}

.rite-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(196, 165, 116, 0.28);
  background: rgba(0, 0, 0, 0.4);
  color: #f4efe6;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.rite-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(196, 165, 116, 0.55);
  color: #e8d4a8;
  box-shadow: 0 0 18px rgba(196, 165, 116, 0.12);
}
.rite-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.rite-btn-sm {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
}
.rite-btn-play {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border-color: rgba(196, 165, 116, 0.45);
  color: #e8d4a8;
  background: linear-gradient(180deg, #1a1520, #050308);
  box-shadow: 0 0 24px rgba(127, 29, 29, 0.3);
}
.rite-btn-play:hover:not(:disabled) {
  box-shadow: 0 0 36px rgba(155, 28, 53, 0.45);
}

.rite-dock-vol {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.15rem 0.9rem 0.55rem;
}
.rite-dock-vol input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(127, 29, 29, 0.75), rgba(196, 165, 116, 0.5));
  outline: none;
}
.rite-dock-vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e8d4a8;
  border: 1px solid rgba(127, 29, 29, 0.5);
  box-shadow: 0 0 10px rgba(196, 165, 116, 0.4);
  cursor: pointer;
}
.rite-dock-vol input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e8d4a8;
  border: 1px solid rgba(127, 29, 29, 0.5);
  cursor: pointer;
}

.rite-dock-kill {
  display: block;
  width: calc(100% - 1.7rem);
  margin: 0.15rem 0.85rem 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(127, 29, 29, 0.75);
  border-radius: 2px;
  background: linear-gradient(90deg, #450a0a, #7f1d1d, #450a0a);
  color: rgba(254, 226, 226, 0.95);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.25s ease, filter 0.25s ease;
}
.rite-dock-kill:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(185, 28, 28, 0.45);
  filter: brightness(1.08);
}
.rite-dock-kill:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.rite-dock-toggle {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid rgba(196, 165, 116, 0.2);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
  color: rgba(184, 176, 168, 0.8);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.rite-dock-toggle:hover { color: #e8d4a8; }

.rite-dock-card.is-collapsed .rite-dock-expand { display: none; }
.rite-dock-card.is-collapsed .rite-dock-top { padding-bottom: 0.75rem; padding-right: 2rem; }

/* Unlock chip when autoplay blocked */
.rite-unlock-chip {
  display: none;
  margin: 0 0.85rem 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(196, 165, 116, 0.35);
  background: rgba(0, 0, 0, 0.5);
  color: #e8d4a8;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  width: calc(100% - 1.7rem);
}
.rite-unlock-chip.is-visible { display: block; }
.rite-unlock-chip:hover {
  border-color: rgba(232, 212, 168, 0.55);
  box-shadow: 0 0 20px rgba(196, 165, 116, 0.15);
}

/* —— Hero console (homepage) —— */
.rite-hero-console {
  position: relative;
  z-index: 3;
  margin-top: 1.75rem;
  max-width: 28rem;
  padding: 1rem 1.15rem 1.1rem;
  border: 1px solid rgba(196, 165, 116, 0.28);
  border-radius: 2px;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(127, 29, 29, 0.18), transparent 55%),
    rgba(6, 5, 8, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 32px rgba(127, 29, 29, 0.1);
}
.rite-hero-console .rite-dock-label { margin-bottom: 0.15rem; }
.rite-hero-console .rite-dock-title {
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  white-space: normal;
}
.rite-hero-console .rite-dock-controls { justify-content: flex-start; padding-left: 0; }
.rite-hero-console .rite-dock-vol { padding-left: 0; padding-right: 0; }
.rite-hero-console .rite-dock-kill {
  width: 100%;
  margin: 0.5rem 0 0;
}
.rite-hero-console .rite-dock-progress { margin: 0.75rem 0 0.35rem; }
.rite-hero-console .rite-unlock-chip {
  width: 100%;
  margin: 0.65rem 0 0;
}

@media (max-width: 640px) {
  #rite-dock {
    left: 0.65rem;
    right: auto;
    bottom: 0.65rem;
    width: calc(100vw - 1.3rem);
    max-width: 22rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rite-btn,
  .rite-dock-card,
  .rite-dock-progress > span {
    transition: none;
  }
}

/* Soft-nav fade */
html.rite-soft-nav body {
  /* keep layout stable */
}
.rite-nav-fade {
  animation: rite-fade-in 0.35s ease;
}
@keyframes rite-fade-in {
  from { opacity: 0.55; }
  to { opacity: 1; }
}
