/* ===================================================================
   CHORD — витрина «проигрыватель» (вариант Б).
   Концепт: конверт пластинки (флакон) + винил, который выезжает и
   крутится. Переключение ароматов = смена трека.
   --acc задаётся из JS под текущий аромат.
   =================================================================== */

.tt {
  --acc: #c0392b;
  padding: 130px 0 140px;
  background:
    radial-gradient(1200px 600px at 70% 10%, rgba(255,255,255,0.04), transparent 60%),
    var(--bg);
}
.tt__sub {
  max-width: 540px; margin: 18px auto 0;
  color: var(--ink-dim); font-size: 0.98rem;
}

.tt__stage {
  max-width: var(--maxw);
  margin: 60px auto 0;
  padding: 0 28px;
}

/* ---------- Проигрыватель-карусель ---------- */
.player { display: flex; flex-direction: column; align-items: center; gap: 30px; }

/* 3D-сцена: перспектива + клип по бокам, чтобы дальние коробки уходили вглубь */
.deck3d {
  position: relative;
  width: 100%;
  height: 540px;
  perspective: 1500px;
  overflow: hidden;
}

/* Контейнер коробок (общая ось вращения). z-index выше винила —
   чтобы пластинка была ЗА обложкой и только выглядывала из-за неё. */
.covers {
  position: absolute; inset: 0; z-index: 3;
  transform-style: preserve-3d;
}

/* Коробка-обложка */
.cover {
  position: absolute;
  left: 50%; top: 50%;
  width: 300px; height: 370px;
  margin-left: -150px; margin-top: -185px;
  border: none; padding: 0; cursor: pointer; background: var(--surface);
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 30px 60px -22px rgba(0,0,0,0.75), 0 0 0 1px var(--line);
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease), filter 0.6s var(--ease);
  will-change: transform;
}
.cover img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(0.15) contrast(1.03);
  pointer-events: none;
}
.cover__tape {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 5px;
  background: var(--cover-acc, var(--acc));
}

/* Раскладка по слотам (центр / ближние / дальние) */
.cover[data-slot="0"]  { transform: translate3d(0, 0, 40px) rotateY(0) scale(1);            z-index: 10; opacity: 1;    filter: none; }
.cover[data-slot="1"]  { transform: translate3d(220px, 0, -150px) rotateY(-38deg) scale(0.86); z-index: 8;  opacity: 0.92; filter: brightness(0.78); }
.cover[data-slot="-1"] { transform: translate3d(-220px, 0, -150px) rotateY(38deg) scale(0.86); z-index: 8;  opacity: 0.92; filter: brightness(0.78); }
.cover[data-slot="2"]  { transform: translate3d(390px, 0, -360px) rotateY(-50deg) scale(0.7);  z-index: 6;  opacity: 0.6;  filter: brightness(0.55); }
.cover[data-slot="-2"] { transform: translate3d(-390px, 0, -360px) rotateY(50deg) scale(0.7);  z-index: 6;  opacity: 0.6;  filter: brightness(0.55); }
.cover[data-slot="0"]  { cursor: default; }

/* Винил — за центральной коробкой (z-index ниже .covers), крутится */
.vinyl {
  position: absolute; z-index: 1;
  top: 50%; left: 50%;
  width: 340px; height: 340px;
  margin-left: -170px; margin-top: -170px;
  transform: translate(20px, -100px);   /* выглядывает сверху из-за центральной коробки (как из конверта) */
  transition: transform 0.55s var(--ease), opacity 0.4s var(--ease);
}
.tt.is-swapping .vinyl { opacity: 0.85; }

.vinyl__disc {
  width: 100%; height: 100%; border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center,
      #0b0b0d 0 1px, #1b1b1f 1px 3px),
    radial-gradient(circle at 38% 32%, #2a2a2e 0%, #0a0a0c 60%);
  box-shadow: 0 20px 50px -16px rgba(0,0,0,0.8), inset 0 0 60px rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  animation: spin 4s linear infinite;
}
.player.is-paused .vinyl__disc { animation-play-state: paused; }

/* блик на пластинке (не крутится) */
.vinyl::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(125deg, rgba(255,255,255,0.16) 0%, transparent 28%, transparent 72%, rgba(255,255,255,0.06) 100%);
  pointer-events: none;
}

.vinyl__label {
  width: 38%; height: 38%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--acc) 80%, #000) 0%, var(--acc) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
  transition: background 0.5s var(--ease);
}
.vinyl__label-term {
  font-family: var(--font-display); font-style: italic;
  font-size: 1rem; color: #fff; line-height: 1; padding: 0 6px;
}
.vinyl__label-dot { width: 9px; height: 9px; border-radius: 50%; background: #0a0a0c; box-shadow: 0 0 0 3px rgba(255,255,255,0.25); }
.vinyl__label-brand { font-size: 0.5rem; letter-spacing: 0.3em; color: rgba(255,255,255,0.8); }

/* Тонарм — над центральной коробкой */
.tonearm {
  position: absolute; z-index: 11;
  top: 36px; left: 50%; margin-left: 30px;
  width: 150px; height: 14px;
  transform-origin: right center;
  transform: rotate(2deg);   /* игла на пластинке, пока трек «играет» */
  transition: transform 0.5s var(--ease);
  pointer-events: none;
}
/* игла поднимается на время смены пластинки и на паузе */
.tt.is-swapping .tonearm,
.player.is-paused .tonearm { transform: rotate(24deg); }
.tonearm::before {
  content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: #3a3a40; box-shadow: 0 0 0 3px #222;
}
.tonearm::after {
  content: ''; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 140px; height: 4px; border-radius: 3px;
  background: linear-gradient(90deg, #4a4a52, #2a2a30);
}
.tonearm__head {
  position: absolute; left: -4px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 12px; border-radius: 2px; background: var(--acc);
  z-index: 1; transition: background 0.5s var(--ease);
}

/* Кнопки управления */
.player__controls { display: flex; align-items: center; gap: 18px; }
.ctrl {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  font-size: 1.1rem; cursor: pointer; display: grid; place-items: center;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}
.ctrl:hover { border-color: var(--acc); color: var(--acc); }
.ctrl--play { width: 58px; height: 58px; background: var(--acc); border-color: var(--acc); color: #fff; font-size: 0.9rem; }
.ctrl--play:hover { background: var(--accent-2); color: #fff; }
.ctrl--play .ctrl__play { display: none; }
.ctrl--play[data-playing="false"] .ctrl__pause { display: none; }
.ctrl--play[data-playing="false"] .ctrl__play { display: inline; }

/* ---------- Инфо + треклист ---------- */
.now { transition: opacity 0.35s var(--ease); }
.tt.is-swapping .now { opacity: 0.25; }
.now__index { font-size: 0.78rem; letter-spacing: 0.3em; color: var(--ink-dim); margin-bottom: 14px; }
.now__index span { color: var(--acc); }
.now__term { font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 10px; }
.now__name {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1;
  text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px;
}
.now__meaning { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--ink-dim); margin-bottom: 20px; }
.now__tagline { color: var(--ink-dim); max-width: 440px; margin-bottom: 24px; min-height: 3em; }
.now__wip[hidden] { display: none; }
.now__wip {
  display: inline-block; margin: 0 0 18px;
  font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-2); border: 1px dashed rgba(216,80,63,0.5); padding: 4px 10px; border-radius: 3px;
}
.now__btn {
  display: flex; align-items: center; gap: 12px;
  background: none; border: none; cursor: pointer; color: var(--ink);
  font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; padding: 0;
}
.now__btn .line { width: 38px; height: 1px; background: var(--acc); transition: width 0.3s var(--ease); }
.now__btn:hover .line { width: 58px; }

.tracklist { list-style: none; margin-top: 40px; border-top: 1px solid var(--line); }
.track {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 16px;
  padding: 15px 8px; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background 0.25s, padding 0.25s;
}
.track:hover { background: rgba(255,255,255,0.03); padding-left: 14px; }
.track.is-active { background: rgba(255,255,255,0.04); }
.track__num { font-size: 0.8rem; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.track.is-active .track__num { color: transparent; }
.track.is-active .track__num::before {
  content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--track-acc); box-shadow: 0 0 10px var(--track-acc);
}
.track__title { font-size: 1rem; }
.track__title b { font-weight: 500; }
.track__title span { color: var(--ink-dim); font-style: italic; font-family: var(--font-display); margin-left: 8px; }
.track__tempo { font-size: 0.74rem; letter-spacing: 0.08em; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.track.is-active .track__tempo { color: var(--track-acc); }

/* ---------- Адаптив ---------- */
.tt__side { max-width: 760px; margin: 70px auto 0; }

@media (max-width: 920px) {
  .deck3d { height: 480px; }
  .cover { width: 250px; height: 308px; margin-left: -125px; margin-top: -154px; }
  .cover[data-slot="1"]  { transform: translate3d(150px, 0, -150px) rotateY(-36deg) scale(0.84); }
  .cover[data-slot="-1"] { transform: translate3d(-150px, 0, -150px) rotateY(36deg) scale(0.84); }
  .cover[data-slot="2"]  { transform: translate3d(255px, 0, -340px) rotateY(-48deg) scale(0.66); }
  .cover[data-slot="-2"] { transform: translate3d(-255px, 0, -340px) rotateY(48deg) scale(0.66); }
  .vinyl { width: 280px; height: 280px; margin-left: -140px; margin-top: -140px; transform: translate(16px, -100px); }
  .tonearm { margin-left: 20px; top: 28px; }
}
@media (max-width: 480px) {
  .deck3d { height: 420px; }
  .cover { width: 200px; height: 250px; margin-left: -100px; margin-top: -125px; }
  .cover[data-slot="1"]  { transform: translate3d(96px, 0, -130px) rotateY(-34deg) scale(0.8); }
  .cover[data-slot="-1"] { transform: translate3d(-96px, 0, -130px) rotateY(34deg) scale(0.8); }
  .cover[data-slot="2"]  { transform: translate3d(150px, 0, -300px) rotateY(-46deg) scale(0.62); opacity: 0.45; }
  .cover[data-slot="-2"] { transform: translate3d(-150px, 0, -300px) rotateY(46deg) scale(0.62); opacity: 0.45; }
  .vinyl { width: 220px; height: 220px; margin-left: -110px; margin-top: -110px; transform: translate(12px, -80px); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .vinyl__disc { animation: none; }
}
