/* =========================================================
   MISTERO — player da ficha (Mega Watching Me · Theuzzo)
   Pra remover: apague este arquivo, js/player.js e o bloco
   "PLAYER" no index.html.
   ========================================================= */

/* na hero a ficha fica grande na lateral; ao rolar ela encolhe e vai pro canto */
.disc {
  --size: clamp(112px, 9vw, 150px);
  position: fixed; z-index: 55;
  left: clamp(2rem, 5vw, 5rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  transition:
    top .8s var(--ease), left .8s var(--ease), transform .8s var(--ease),
    opacity 1s var(--ease) 1.2s;
}
body.is-loading .disc { opacity: 0; pointer-events: none; transition: none; }
.disc.is-away { opacity: 0; pointer-events: none; transition-delay: 0s; }

.disc.is-docked {
  --size: 58px;
  left: clamp(1rem, 2.5vw, 2rem);
  top: calc(100% - clamp(1rem, 2.5vw, 2rem));
  transform: translateY(-100%);
  flex-direction: row;
  gap: .75rem;
  transition-delay: 0s;
}

/* ---------- a ficha ---------- */
.disc__chip {
  position: relative;
  width: var(--size);
  aspect-ratio: 1;
  border-radius: 50%;
  /* listras da borda, como numa ficha de pôquer */
  background:
    repeating-conic-gradient(from 6deg, var(--gold) 0 11deg, var(--wine) 11deg 45deg);
  box-shadow:
    0 0 0 2px rgba(18, 6, 6, .9),
    0 0 0 3px rgba(233, 195, 138, .35),
    0 18px 50px rgba(0, 0, 0, .7);
  cursor: pointer;
  transition: width .8s var(--ease), box-shadow .6s var(--ease), transform .4s var(--ease);
  animation: discSpin 2.6s linear infinite paused;
}
.disc__chip:hover { transform: scale(1.05); }
.disc__chip:focus-visible { outline: 2px solid var(--copper); outline-offset: 6px; }

.disc__face {
  position: absolute; inset: 15%;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #4a0d10, #160606 75%);
  box-shadow: inset 0 0 0 1px rgba(233, 195, 138, .5), inset 0 0 18px rgba(0, 0, 0, .8);
}
/* anel tracejado interno */
.disc__face::before {
  content: '';
  position: absolute; inset: 9%;
  border-radius: 50%;
  border: 1.5px dashed rgba(233, 195, 138, .55);
}
.disc__suit {
  font-size: calc(var(--size) * .3);
  line-height: 1;
  background: var(--grad-copper);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  transition: font-size .8s var(--ease);
}

.disc.is-playing .disc__chip {
  animation-play-state: running;
  box-shadow:
    0 0 0 2px rgba(18, 6, 6, .9),
    0 0 0 3px rgba(233, 195, 138, .5),
    0 18px 50px rgba(0, 0, 0, .7),
    0 0 50px rgba(217, 138, 61, .45);
}
@keyframes discSpin { to { rotate: 360deg; } }

/* convite pulsando enquanto ninguém tocou */
.disc:not(.is-playing):not(.is-unavailable) .disc__chip::after {
  content: '';
  position: absolute; inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(217, 138, 61, .5);
  animation: discPulse 2.2s var(--ease) infinite;
  pointer-events: none;
}
@keyframes discPulse {
  from { opacity: .9; transform: scale(.95); }
  to   { opacity: 0;  transform: scale(1.25); }
}

/* ---------- etiqueta ---------- */
.disc__label {
  display: flex; align-items: center; gap: .6rem;
  text-align: left;
}
.disc:not(.is-docked) .disc__label { flex-direction: column; text-align: center; gap: .5rem; }
.disc__text { display: flex; flex-direction: column; gap: .2rem; }
.disc__text b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: .06em;
  color: var(--paper);
  white-space: nowrap;
}
.disc__text small {
  font-size: 9px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--muted);
}
.disc__hint { color: var(--copper-light); }
.disc.is-playing .disc__hint { display: none; }
.disc:not(.is-playing) .disc__artist { display: none; }

/* equalizer */
.disc__eq { display: flex; align-items: flex-end; gap: 3px; height: 14px; }
.disc__eq i {
  width: 3px; height: 30%;
  border-radius: 2px;
  background: var(--copper);
  animation: discEq .9s ease-in-out infinite alternate paused;
}
.disc__eq i:nth-child(2) { animation-delay: -.3s; }
.disc__eq i:nth-child(3) { animation-delay: -.6s; }
.disc__eq i:nth-child(4) { animation-delay: -.15s; }
.disc.is-playing .disc__eq i { animation-play-state: running; }
@keyframes discEq { to { height: 100%; } }

/* sem o arquivo de áudio */
.disc.is-unavailable .disc__chip { cursor: default; filter: saturate(.5) brightness(.8); }
.disc.is-unavailable .disc__eq { display: none; }

/* encaixado no canto: só a ficha + nome, numa pílula escura pra ler por cima do conteúdo */
.disc.is-docked {
  padding: .35rem 1.1rem .35rem .35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 6, 5, .82);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
}
.disc.is-docked .disc__text b { font-size: 1rem; }

@media (max-width: 640px) {
  .disc.is-docked { --size: 50px; }
  .disc.is-docked .disc__text b { font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .disc__chip, .disc__eq i, .disc__chip::after { animation: none !important; }
}
