/* ============================================================
   MY WORK — the reel player and its picker
   The video is never stretched: it keeps its own pixel ratio and
   is bounded by max-width / max-height, so a 16:9 reel and a 1:1
   reel both sit correctly inside the same frame.
   ============================================================ */

.stage {
  display: flex;
  justify-content: center;
}

.player {
  width: fit-content;
  max-width: 100%;
}

.player__frame {
  position: relative;
  padding: clamp(8px, 0.9vw, 14px);
  background: linear-gradient(150deg, #17171a 0%, #26262b 46%, #131315 100%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.10),
    0 1px 0 rgba(255,255,255,0.16) inset,
    0 24px 60px -22px rgba(10,10,14,0.62),
    0 4px 16px -6px rgba(10,10,14,0.4);
}

/* corner ticks — a gate, not a border */
.player__frame::before,
.player__frame::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border: 1.5px solid var(--red);
  opacity: 0.85;
  pointer-events: none;
}
.player__frame::before { top: -1px; left: -1px;  border-right: 0; border-bottom: 0; }
.player__frame::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.player__video {
  display: block;
  width: auto;
  height: auto;
  max-width: min(1060px, 100%);
  max-height: min(68svh, 620px);
  background: #08080a;
}

/* ---- click-to-play scrim ---- */
.player__scrim {
  position: absolute;
  inset: clamp(8px, 0.9vw, 14px);
  display: grid;
  place-items: center;
  background: rgba(8, 8, 10, 0.34);
  backdrop-filter: blur(2px);
  transition: opacity var(--t-mid) var(--ease), visibility var(--t-mid);
}
.player.is-rolling .player__scrim { opacity: 0; visibility: hidden; }

.playpad {
  width: clamp(62px, 7vw, 86px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
  display: grid;
  place-items: center;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.playpad__tri {
  width: 0; height: 0;
  margin-left: 5px;
  border-left: 17px solid #fff;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  transition: border-left-color var(--t-fast) var(--ease);
}
.playpad:hover, .playpad:focus-visible {
  border-color: var(--red-bright);
  background: rgba(229, 38, 28, 0.14);
  box-shadow: 0 0 34px 2px rgba(229, 38, 28, 0.55), 0 0 0 1px rgba(229,38,28,0.5) inset;
  transform: scale(1.06);
}
.playpad:hover .playpad__tri, .playpad:focus-visible .playpad__tri { border-left-color: var(--red-bright); }

/* ---- title strip over the gate ---- */
.player__hud {
  position: absolute;
  left: clamp(8px, 0.9vw, 14px);
  right: clamp(8px, 0.9vw, 14px);
  bottom: clamp(8px, 0.9vw, 14px);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem 1rem 0.75rem;
  background: linear-gradient(to top, rgba(6,6,9,0.72), rgba(6,6,9,0));
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-mid) var(--ease);
}
.player:hover .player__hud,
.player.is-rolling .player__hud { opacity: 1; }

.player__title, .player__spec {
  font-family: var(--mono);
  font-size: var(--step--2);
  letter-spacing: var(--tracking-mid);
  text-transform: uppercase;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 10px rgba(0,0,0,0.6);
}
.player__spec { color: rgba(255,255,255,0.6); }

/* ---- scrubber ---- */
.scrub {
  position: relative;
  height: 22px;
  margin-top: 0.9rem;
  cursor: pointer;
  touch-action: none;
}
.scrub::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: var(--line);
}
.scrub__buffer, .scrub__fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  transform-origin: left center;
  width: 0;
}
.scrub__buffer { background: var(--ink-faint); }
.scrub__fill   { background: var(--red); box-shadow: 0 0 12px rgba(229, 38, 28, 0.6); }

.scrub__knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--red);
  transform: translate(-50%, -50%) scale(0.7);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  box-shadow: 0 0 14px rgba(229,38,28,0.8);
}
.scrub:hover .scrub__knob,
.scrub:focus-visible .scrub__knob { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ------------------------------------------------------------
   DECK — sound toggle + reel picker
   ------------------------------------------------------------ */
.deck {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1.2rem, 2.5vw, 2.4rem);
  margin-top: clamp(1.8rem, 3vw, 2.8rem);
}
.deck__controls {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

/* ---- quality: 4K is the master, HD is the light one ---- */
.qual {
  display: inline-flex;
  border: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  overflow: hidden;
}
.qual[hidden] { display: none; }

.qual__opt {
  padding: 0.82em 1.05em;
  font-family: var(--mono);
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}
.qual__opt + .qual__opt { border-left: 1px solid var(--line); }
.qual__opt:hover { color: var(--hot); }
.qual__opt.is-on {
  color: var(--hot);
  background: rgba(255, 59, 47, 0.16);
  box-shadow: inset 0 0 20px -6px rgba(255, 59, 47, 0.9);
}


/* animated speaker bars */
.btn__ico {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  height: 14px;
}
.btn__wave {
  width: 2.5px;
  height: 4px;
  background: currentColor;
  border-radius: 1px;
  transition: height var(--t-fast) var(--ease);
}
.btn--sound[aria-pressed="true"] .btn__wave:nth-child(1) { height: 7px;  animation: wave 900ms  var(--ease-in-out) infinite alternate; }
.btn--sound[aria-pressed="true"] .btn__wave:nth-child(2) { height: 14px; animation: wave 620ms  var(--ease-in-out) infinite alternate 120ms; }
.btn--sound[aria-pressed="true"] .btn__wave:nth-child(3) { height: 9px;  animation: wave 780ms  var(--ease-in-out) infinite alternate 240ms; }
@keyframes wave { from { height: 3px; } to { height: 14px; } }
@media (prefers-reduced-motion: reduce) { .btn__wave { animation: none !important; } }

/* muted: bars flat + a strike through */
.btn--sound[aria-pressed="false"] .btn__ico { position: relative; }
.btn--sound[aria-pressed="false"] .btn__ico::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px;
  top: 50%;
  height: 1.5px;
  background: currentColor;
  transform: rotate(-32deg);
}

.reels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.reel-chip {
  --chip-line: var(--line);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem 0.5rem 0.5rem;
  border: 1px solid var(--chip-line);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}
.reel-chip__thumb {
  width: 46px; height: 34px;
  object-fit: cover;
  border-radius: 999px;
  filter: grayscale(1) contrast(1.05);
  transition: filter var(--t-mid) var(--ease);
}
.reel-chip__body { display: flex; flex-direction: column; gap: 0.12rem; text-align: left; }
.reel-chip__name {
  font-family: var(--mono);
  font-size: var(--step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.reel-chip__meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.reel-chip:hover, .reel-chip:focus-visible {
  --chip-line: rgba(255, 59, 47, 0.6);
  background: var(--glass-lit);
  box-shadow: 0 0 26px -2px rgba(255, 59, 47, 0.4);
}
.reel-chip:hover .reel-chip__thumb, .reel-chip.is-live .reel-chip__thumb { filter: none; }

.reel-chip.is-live {
  --chip-line: var(--red-bright);
  background: rgba(255, 59, 47, 0.10);
  box-shadow: 0 0 0 1px rgba(255, 59, 47, 0.35), 0 0 26px -4px rgba(255, 59, 47, 0.55);
}
.reel-chip.is-live .reel-chip__meta { color: var(--hot); }

@media (max-width: 720px) {
  .deck { flex-direction: column; align-items: center; }
  .deck__controls { justify-content: center; }
  .reels { justify-content: center; }
}
