/* ============================================================================
   АСТРОЛЯБИЯ · плеер «Дневника Мудреца»
   Палитра сайта: #1c1a17 · #c9986a · #d4a574 · #e8e0d4
============================================================================ */
:root {
  --bg: #1c1a17; --bg-2: #221f1b; --bg-3: #28241f;
  --accent: #c9986a; --accent-2: #d4a574; --accent-3: #f0d9ae;
  --text: #e8e0d4; --text-soft: rgba(232,224,212,.72); --text-mute: rgba(232,224,212,.5);
  --text-faint: rgba(232,224,212,.32); --line: rgba(232,224,212,.12); --line-soft: rgba(232,224,212,.06);
  --glass: rgba(28,26,23,.55);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  overflow: hidden; color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(1100px 720px at 50% 40%, #272019 0%, var(--bg) 58%, #131009 100%);
}
.mono { font-family: 'IBM Plex Mono', monospace; }

/* ---------- слои сцены ---------- */
.rays-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .45;
  background: repeating-conic-gradient(from 0deg at 50% 45.5%,
    rgba(201,152,106,.05) 0deg 4deg, transparent 4deg 13deg);
  -webkit-mask-image: radial-gradient(circle at 50% 45.5%, #000 0%, transparent 60%);
  mask-image: radial-gradient(circle at 50% 45.5%, #000 0%, transparent 60%);
  animation: rays 160s linear infinite; }
@keyframes rays { to { transform: rotate(360deg); } }
#scene { position: fixed; inset: 0; z-index: 1; display: block; }
body::after { /* виньетка */
  content: ''; position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(120% 120% at 50% 42%, transparent 55%, rgba(12,9,6,.55) 100%);
}
.noise { position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
  animation: noise 22s linear infinite; }
@keyframes noise { 0%,100%{transform:translate(0,0)} 25%{transform:translate(-8%,4%)} 50%{transform:translate(-4%,-8%)} 75%{transform:translate(6%,7%)} }

/* ---------- шапка ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px; }
.brand { display: flex; flex-direction: column; gap: 5px; }
.brand-name { font: 500 10px/1 'IBM Plex Mono', monospace; letter-spacing: .34em;
  text-transform: uppercase; color: var(--accent-2); }
.brand-sub { font: 500 8.5px/1 'IBM Plex Mono', monospace; letter-spacing: .3em;
  text-transform: uppercase; color: var(--text-faint); }
.top-actions { display: flex; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 7px;
  font: 500 10px/1 'IBM Plex Mono', monospace; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-soft); text-decoration: none; cursor: pointer;
  background: var(--glass); border: 1px solid var(--line); border-radius: 20px;
  padding: 9px 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: color .25s, border-color .25s, box-shadow .25s; }
.chip svg { width: 13px; height: 13px; }
.chip:hover { color: var(--accent-3); border-color: rgba(212,165,116,.55);
  box-shadow: 0 0 18px rgba(212,165,116,.14); }

/* ---------- медальон с логотипом в центре сферы ---------- */
.hub { position: fixed; z-index: 14; left: 50%; top: 45.5%;
  transform: translate(-50%,-50%); border-radius: 50%;
  pointer-events: none;                        /* клики проходят к сцене: тап по логотипу = играть/пауза */
  background: radial-gradient(circle at 38% 32%, rgba(48,42,35,.5), rgba(24,21,17,.8) 74%);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  box-shadow: inset 0 0 0 1px rgba(212,165,116,.45), inset 0 0 24px rgba(0,0,0,.38),
    0 10px 30px rgba(0,0,0,.42);
  display: flex; align-items: center; justify-content: center; }
.hub img { width: 78%; height: 78%; object-fit: contain; display: block;
  animation: hubSpin 60s linear infinite; }    /* медленное вращение — оборот за минуту */
.hub.no-logo img { display: none; }            /* логотипа нет — остаётся стеклянная линза */
@keyframes hubSpin { to { transform: rotate(360deg); } }

/* ---------- подсказка ---------- */
.hint { position: fixed; z-index: 14; left: 50%; transform: translateX(-50%);
  font: 500 10px/1.6 'IBM Plex Mono', monospace; letter-spacing: .22em;
  text-transform: uppercase; color: var(--text-faint); text-align: center;
  white-space: nowrap; transition: opacity 1.2s; animation: hintPulse 3.4s ease-in-out infinite; }
@keyframes hintPulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.hint.gone { opacity: 0 !important; animation: none; pointer-events: none; }

/* ---------- нижняя панель ---------- */
.panel { position: fixed; z-index: 20; bottom: 18px; left: 50%; transform: translateX(-50%);
  width: min(860px, calc(100vw - 24px));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px;
  padding: 14px 22px; border-radius: 22px;
  background: linear-gradient(120deg, rgba(34,31,27,.74), rgba(28,26,23,.66));
  border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0,0,0,.4), inset 0 1px 0 rgba(232,224,212,.07); }
.now { min-width: 0; }
.now-label { font: 500 8.5px/1 'IBM Plex Mono', monospace; letter-spacing: .3em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 7px; }
.now-title { font: 400 16px/1.2 'ZEN Dots', cursive; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(120deg, #efe7da, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.now-author { font: 400 11px/1.4 'Inter', sans-serif; color: var(--text-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.transport { display: flex; align-items: center; gap: 8px; }
.t-btn { width: 42px; height: 42px; border: none; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--text-soft);
  display: flex; align-items: center; justify-content: center;
  transition: color .25s, transform .25s, background .25s, box-shadow .25s; }
.t-btn svg { width: 19px; height: 19px; }
.t-btn:hover { color: var(--accent-3); transform: scale(1.1);
  background: rgba(212,165,116,.1); }
/* режимные кнопки: «перемешивать» и «повтор» — потусклее обычных,
   а когда включены — светятся бронзой */
.t-mode { width: 36px; height: 36px; color: var(--text-faint); }
.t-mode svg { width: 17px; height: 17px; }
.t-mode.on { color: var(--accent-2); background: rgba(212,165,116,.13);
  box-shadow: 0 0 14px rgba(212,165,116,.28); }
.t-mode.on:hover { color: var(--accent-3); }
/* главная кнопка Play — в центре нижней панели */
.t-play { width: 54px; height: 54px; margin: 0 5px; color: #17120d;
  background: linear-gradient(135deg, #e6b884, #c9986a);
  box-shadow: 0 6px 20px rgba(212,165,116,.32), inset 0 1px 0 rgba(255,244,224,.45); }
.t-play svg { width: 23px; height: 23px; }
.t-play:hover { color: #17120d;
  background: linear-gradient(135deg, #f0c694, #d4a574);
  transform: scale(1.07);
  box-shadow: 0 8px 26px rgba(212,165,116,.48), inset 0 1px 0 rgba(255,244,224,.45); }
.t-play .i-pause { display: none; }
body.is-playing .t-play .i-pause { display: block; }
body.is-playing .t-play .i-play { display: none; }
.side { justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: 9px; }
.time { font: 500 11px/1 'IBM Plex Mono', monospace; color: var(--text-soft); letter-spacing: .06em; }
.vol { display: flex; align-items: center; gap: 8px; color: var(--text-mute); }
.vol svg { width: 15px; height: 15px; flex: none; }
.vol input { -webkit-appearance: none; appearance: none; width: 96px; height: 3px;
  border-radius: 3px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--accent-2) var(--fill, 85%), rgba(232,224,212,.16) var(--fill, 85%)); }
.vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px;
  border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 8px rgba(212,165,116,.6); }
.vol input::-moz-range-thumb { width: 11px; height: 11px; border: none;
  border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 8px rgba(212,165,116,.6); }

/* ---------- плейлист ---------- */
.playlist { position: fixed; z-index: 30; top: 70px; right: 18px; bottom: 96px; width: 308px;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, rgba(34,31,27,.9), rgba(28,26,23,.86));
  border: 1px solid var(--line); border-radius: 18px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 22px 54px rgba(0,0,0,.5);
  transform: translateX(130%); transition: transform .5s cubic-bezier(.22,.9,.3,1); }
.playlist.open { transform: translateX(0); }
.pl-head { display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px 10px; font: 500 10px/1 'IBM Plex Mono', monospace;
  letter-spacing: .3em; text-transform: uppercase; color: var(--accent); }
/* ---------- вкладки коллекций ---------- */
.pl-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 18px 10px; }
.pl-tab { font: 500 9.5px/1 'IBM Plex Mono', monospace; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-faint); background: transparent; border: 1px solid var(--line-soft);
  border-radius: 14px; padding: 7px 12px; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s, box-shadow .2s; }
.pl-tab:hover { color: var(--text-soft); border-color: rgba(212,165,116,.45); }
.pl-tab.on { color: #14100c; background: linear-gradient(135deg, #e0b27d, #c9986a);
  border-color: transparent; box-shadow: 0 3px 14px rgba(212,165,116,.28); }
.pl-close { background: none; border: none; color: var(--text-mute); cursor: pointer;
  font-size: 17px; line-height: 1; padding: 2px 6px; transition: color .2s; }
.pl-close:hover { color: var(--accent-3); }
#plList { list-style: none; overflow-y: auto; flex: 1; padding: 2px 8px 8px; }
#plList::-webkit-scrollbar { width: 4px; }
#plList::-webkit-scrollbar-thumb { background: rgba(212,165,116,.3); border-radius: 4px; }
.pl-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 9px; align-items: center;
  padding: 10px 10px; border-radius: 12px; cursor: pointer; transition: background .2s; }
.pl-row:hover { background: rgba(232,224,212,.05); }
.pl-row.active { background: linear-gradient(120deg, rgba(201,152,106,.16), rgba(201,152,106,.04)); }
.pl-dot { width: 7px; height: 7px; transform: rotate(45deg); justify-self: center;
  background: transparent; border: 1px solid var(--text-faint); transition: .3s; }
.pl-row.active .pl-dot { background: var(--accent-2); border-color: var(--accent-2);
  box-shadow: 0 0 10px rgba(212,165,116,.75); animation: dotPulse 1.6s ease-in-out infinite; }
@keyframes dotPulse { 0%,100% { transform: rotate(45deg) scale(1); } 50% { transform: rotate(45deg) scale(.72); } }
.pl-main { min-width: 0; }
.pl-title { display: block; font: 500 13px/1.3 'Inter', sans-serif; color: var(--text-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-row.active .pl-title { color: #eed9b4; }
.pl-sub { display: block; font: 400 10.5px/1.4 'Inter', sans-serif; color: var(--text-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-meta { font: 500 10px/1 'IBM Plex Mono', monospace; color: var(--text-faint); }
.pl-row.bad { opacity: .38; }
.pl-row.bad .pl-meta { color: #c98a6a; }
.pl-drop { padding: 12px 18px 15px; border-top: 1px solid var(--line-soft);
  font: 500 9px/1.7 'IBM Plex Mono', monospace; letter-spacing: .05em; color: var(--text-faint); }

/* ---------- оверлей перетаскивания ---------- */
.dropzone { position: fixed; inset: 14px; z-index: 40; display: none;
  align-items: center; justify-content: center; text-align: center;
  border: 1.5px dashed rgba(212,165,116,.6); border-radius: 26px;
  background: rgba(28,26,23,.74); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.dropzone.on { display: flex; }
.dz-title { font: 400 17px/1.3 'ZEN Dots', cursive;
  background: linear-gradient(120deg, #efe7da, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.dz-sub { margin-top: 8px; font: 500 10px/1 'IBM Plex Mono', monospace;
  letter-spacing: .2em; text-transform: uppercase; color: var(--text-mute); }

/* ---------- тосты и прочее ---------- */
.toast { position: fixed; z-index: 45; top: 66px; left: 50%;
  transform: translateX(-50%) translateY(-10px);
  max-width: min(520px, calc(100vw - 40px));
  font: 500 11px/1.5 'IBM Plex Mono', monospace; color: var(--text-soft); text-align: center;
  background: rgba(28,26,23,.86); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 16px; opacity: 0; pointer-events: none;
  transition: opacity .35s, transform .35s; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.noscript { position: fixed; inset: 0; z-index: 99; display: flex; align-items: center;
  justify-content: center; background: var(--bg); color: var(--text-soft);
  font: 500 13px/1.6 'Inter', sans-serif; padding: 30px; text-align: center; }

/* ---------- адаптив ---------- */
@media (max-width: 720px) {
  .top { padding: 14px 14px; }
  .brand-sub { display: none; }
  .chip { padding: 8px 11px; }
  .panel { width: calc(100vw - 16px); padding: 12px 14px; gap: 10px; border-radius: 18px; }
  .now-label { display: none; }
  .now-title { font-size: 13px; }
  .now-author { font-size: 10px; }
  .t-btn { width: 38px; height: 38px; }
  .transport { gap: 5px; }
  .transport .t-mode { width: 30px; height: 30px; }
  .transport .t-mode svg { width: 15px; height: 15px; }
  .t-play { width: 48px; height: 48px; }
  .t-play svg { width: 21px; height: 21px; }
  .vol input { width: 60px; }
  .playlist { width: calc(100vw - 16px); right: 8px; top: 60px; bottom: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  .rays-bg, .noise, .hint { animation: none; }
  .hub img { animation: none; }                /* логотип не вращается */
  .playlist { transition: none; }
}
