/* ============================================================
   player by megaR0fLer — Y2K / Frutiger Aero / Windows XP
   ============================================================ */

@font-face {
  font-family: 'VT323';
  src: url('/fonts/vt323.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'PressStart';
  src: url('/fonts/pressstart2p.woff2') format('woff2');
  font-display: swap;
}

:root {
  --bg-deep: #071a4d;
  --bg-mid: #0d2f86;
  --glass: rgba(255, 255, 255, 0.10);
  --glass-line: rgba(255, 255, 255, 0.28);
  --aqua: #9ff0ff;
  --accent: #ff8a00;
  --accent2: #ffb35c;
  --pink: #ff69b4;
  --pink-soft: #ffb3da;
  --xp-blue: #245edc;
  --xp-blue-hi: #4f93ff;
  --xp-green: #3ecf3e;
  --lcd: #6cff7a;
  --danger: #ff5252;
  --fg: #eef5ff;
  --dim: #9db4d8;
  --radius: 10px;
  --player-h: 156px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
::selection { background: #316ac5; color: #fff; }

body {
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  min-height: 100vh;
  /* космос + звёзды */
  background-color: var(--bg-deep);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='20' cy='30' r='1' opacity='.9'/%3E%3Ccircle cx='120' cy='80' r='1.5' opacity='.6'/%3E%3Ccircle cx='250' cy='40' r='1' opacity='.8'/%3E%3Ccircle cx='60' cy='150' r='1.2' opacity='.5'/%3E%3Ccircle cx='180' cy='120' r='1' opacity='.9'/%3E%3Ccircle cx='280' cy='190' r='1.5' opacity='.5'/%3E%3Ccircle cx='40' cy='240' r='1' opacity='.7'/%3E%3Ccircle cx='150' cy='260' r='1.3' opacity='.8'/%3E%3Ccircle cx='230' cy='290' r='1' opacity='.6'/%3E%3Ccircle cx='90' cy='60' r='.8' opacity='.5'/%3E%3Ccircle cx='200' cy='200' r='1.1' opacity='.7'/%3E%3Ccircle cx='295' cy='120' r='1' opacity='.4'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse 120% 70% at 50% -15%, #2a68e8 0%, #123a9e 40%, var(--bg-deep) 100%);
  background-attachment: fixed;
  padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom, 0px) + 24px);
  overflow-x: hidden;
}
.hidden { display: none !important; }
.dim { color: var(--dim); }
button { font-family: inherit; cursor: pointer; }

/* ---------- фоновые пузыри ---------- */
#bubbles { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bubble {
  position: absolute; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95) 0%, rgba(180, 235, 255, 0.35) 34%, rgba(90, 170, 255, 0.16) 62%, rgba(60, 140, 255, 0.10) 100%);
  box-shadow:
    inset -8px -10px 22px rgba(255, 255, 255, 0.35),
    inset 8px 10px 26px rgba(40, 110, 220, 0.30),
    0 0 18px rgba(140, 220, 255, 0.35);
  animation: floaty 16s ease-in-out infinite alternate;
}
.bubble.b1 { width: 130px; height: 130px; left: 4%; top: 22%; animation-duration: 15s; }
.bubble.b2 { width: 70px;  height: 70px;  left: 12%; top: 65%; animation-duration: 19s; animation-delay: -4s; }
.bubble.b3 { width: 180px; height: 180px; right: 5%; top: 35%; animation-duration: 22s; animation-delay: -8s; }
.bubble.b4 { width: 46px;  height: 46px;  right: 16%; top: 12%; animation-duration: 13s; animation-delay: -2s; }
.bubble.b5 { width: 90px;  height: 90px;  right: 30%; top: 74%; animation-duration: 18s; animation-delay: -6s; }
@keyframes floaty {
  from { transform: translateY(0) translateX(0); }
  to   { transform: translateY(-34px) translateX(16px); }
}

/* ---------- липкая верхняя сборка ----------
   Шапка, поиск, бегущая строка, статусная строка и кнопка «включить музыку»
   живут в одном контейнере: он залипает сверху и не уезжает при прокрутке списка. */
/* Фон прозрачный: склейка залипает, но не закрывает обои и стикеры.
   Свои непрозрачные подложки есть у строк внутри (заголовок, шапка, тикер,
   статус), поэтому при прокрутке список проходит «насквозь» по краям. */
#topstack {
  position: sticky; top: 0; z-index: 60;
  background: transparent;
  padding-bottom: 6px;
}

/* ---------- заголовок окна (XP) ---------- */
#titlebar {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  background: linear-gradient(180deg, #63a4ff 0%, var(--xp-blue-hi) 12%, var(--xp-blue) 55%, #1a3fa0 100%);
  border-bottom: 1px solid #8fc2ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 2px 8px rgba(0, 0, 0, 0.45);
  user-select: none;
}
.tb-ico { font-size: 15px; filter: drop-shadow(0 1px 1px #123a8a); }
.tb-title {
  font-family: 'PressStart', monospace;
  font-size: 11px; color: #fff; letter-spacing: 1px;
  text-shadow: 2px 2px 0 #123a8a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-kana { font-size: 12.5px; color: #cfe8ff; text-shadow: 0 1px 0 #123a8a; opacity: 0.9; }
.tb-btns { margin-left: auto; display: flex; gap: 5px; }
.tb-b {
  width: 23px; height: 19px;
  display: flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #9ec9ff, #3a76e0);
  border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.4);
  cursor: default;
}
.tb-b.close { background: linear-gradient(180deg, #ff9d8a, #e8503a); }
.tb-b:hover { filter: brightness(1.15); }

/* ---------- панель инструментов ---------- */
#header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(16, 44, 110, 0.92), rgba(9, 26, 70, 0.92));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #2a63c0;
  flex-wrap: wrap;
}
#search {
  flex: 1; min-width: 140px;
  background: #04122e;
  border: 1px solid #0a3a7a; border-radius: 6px;
  padding: 9px 13px; color: var(--aqua); font-size: 15px; outline: none;
  font-family: 'VT323', monospace; letter-spacing: 0.5px;
  caret-color: var(--accent);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
}
#search:focus { border-color: var(--accent); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), 0 0 9px rgba(255, 138, 0, 0.55); }
#search::placeholder { color: #4f7ab8; }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.icon-btn {
  background: linear-gradient(180deg, #eaf7ff 0%, #a8dcff 46%, #6cb8f5 100%);
  border: 1px solid #2c6fb5; color: #08305c;
  min-width: 38px; height: 36px; padding: 0 8px; border-radius: 8px;
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.15s, filter 0.15s;
}
.icon-btn:hover { filter: brightness(1.07); box-shadow: inset 0 1px 0 #fff, 0 0 10px var(--aqua); }
.icon-btn:active { background: linear-gradient(180deg, #ffe0a0, #ff8a00); color: #402000; }
.icon-btn.on { background: linear-gradient(180deg, #ffe0a0, #ff8a00); color: #402000; box-shadow: inset 0 1px 0 #fff8, 0 0 10px rgba(255, 138, 0, 0.6); }
#sort {
  background: #04122e; color: var(--aqua);
  border: 1px solid #0a3a7a; border-radius: 6px;
  padding: 8px 6px; font-size: 13.5px; max-width: 138px; outline: none;
  font-family: 'VT323', monospace;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ---------- бегущая строка + ссылки авторов ---------- */
#ticker {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(4, 14, 44, 0.97), rgba(8, 26, 74, 0.97));
  border-bottom: 1px solid #1d4fa8;
  font-family: 'VT323', monospace; font-size: 19px; color: var(--pink-soft);
  text-shadow: 0 0 7px rgba(255, 105, 180, 0.85);
  padding: 4px 0 4px 4px;
}
.tk-mask { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.ticker-in { display: inline-block; padding-left: 100%; animation: tick 26s linear infinite; }
@keyframes tick { to { transform: translateX(-100%); } }
.tk-handles { display: flex; gap: 7px; flex-shrink: 0; padding-right: 8px; }

/* ---------- иконки авторов (Telegram) ---------- */
.handle {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 700; font-size: 13.5px; color: #7a1049; text-decoration: none;
  background: linear-gradient(180deg, #ffe4f2, #ffb3da);
  border: 1px solid var(--pink); border-radius: 20px;
  padding: 4px 12px 4px 6px; text-shadow: 0 1px 0 #ffffffcc;
  box-shadow: inset 0 1px 0 #fff, 0 0 10px rgba(255, 105, 180, 0.45);
  transition: box-shadow 0.15s, transform 0.15s;
}
.handle:hover {
  box-shadow: inset 0 1px 0 #fff, 0 0 16px rgba(255, 105, 180, 0.95);
  transform: translateY(-1px);
}
.handle:active { transform: translateY(1px); }
.handle svg { display: block; }

/* режим редактирования (админ, двойной клик) */
#ticker.editing {
  flex-wrap: wrap; cursor: text; padding: 6px 8px;
  box-shadow: inset 0 0 0 2px var(--pink), 0 0 12px rgba(255, 105, 180, 0.6);
}
#ticker.editing .tk-mask { flex: 1 1 100%; overflow: visible; white-space: normal; }
#ticker.editing .ticker-in {
  animation: none; padding-left: 0; display: inline;
  outline: none; white-space: normal;
}

/* ---------- статусная строка (CRT) ---------- */
#statusbar {
  display: flex; gap: 16px; align-items: center;
  margin: 8px auto 0; width: calc(100% - 20px);
  padding: 7px 12px;
  max-width: 960px;
  background: #06120a;
  border: 1px solid #1d5c28; border-radius: 5px;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.85), 0 0 12px rgba(60, 255, 100, 0.10);
  color: var(--lcd); font-family: 'VT323', monospace; font-size: 17.5px;
  text-shadow: 0 0 7px rgba(80, 255, 110, 0.75);
  flex-wrap: wrap;
}
.lcd-cursor { animation: blink 1.1s steps(1) infinite; color: var(--lcd); }
@keyframes blink { 50% { opacity: 0; } }
#stOffline { color: #ffd86b; text-shadow: 0 0 7px rgba(255, 200, 80, 0.6); }
.sb-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.led {
  color: var(--pink); animation: blink 1.4s steps(1) infinite;
  text-shadow: 0 0 8px var(--pink);
  font-size: 15px; letter-spacing: 2px;
}
/* мини-эквалайзер в статусной строке */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.eq i {
  width: 4px; background: linear-gradient(180deg, #b6ffb6, var(--xp-green));
  box-shadow: 0 0 5px rgba(70, 230, 90, 0.8);
  animation: eqbar 0.9s ease-in-out infinite alternate;
  border-radius: 1px;
}
.eq i:nth-child(1) { height: 40%; animation-delay: 0s; }
.eq i:nth-child(2) { height: 90%; animation-delay: 0.15s; }
.eq i:nth-child(3) { height: 60%; animation-delay: 0.3s; }
.eq i:nth-child(4) { height: 100%; animation-delay: 0.45s; }
.eq i:nth-child(5) { height: 50%; animation-delay: 0.6s; }
@keyframes eqbar { to { height: 15%; } }

/* ---------- список треков ---------- */
#list {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 10px 4px;
  max-width: 960px; margin: 0 auto;
}
.track {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.07));
  border: 1px solid var(--glass-line);
  border-top-color: rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  display: flex; flex-direction: column; overflow: hidden;
  /* без backdrop-filter: на 766 строках размытие каждого ряда сильно грузит телефон */
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.12s;
  /* при прокрутке к комментариям строка не должна нырнуть под липкую шапку */
  scroll-margin-top: 260px;
}
.track:hover {
  border-color: var(--aqua);
  box-shadow: 0 0 14px rgba(120, 230, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}
.track.playing {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 138, 0, 0.22), rgba(255, 138, 0, 0.07));
  box-shadow: 0 0 18px rgba(255, 138, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
/* выделенные треки: цвет + левая синяя планка, а не только галочка слева */
.track.sel {
  border-color: #6aa8ff;
  background: linear-gradient(180deg, rgba(49, 106, 197, 0.45), rgba(49, 106, 197, 0.18));
  box-shadow: 0 0 15px rgba(90, 155, 255, 0.5), inset 4px 0 0 #7fb0ff, inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
/* играющий + выделенный: оранжевая рамка игры, но синяя подложка выделения */
.track.playing.sel {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(255, 160, 40, 0.5), inset 4px 0 0 #7fb0ff, inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.track.sel .t-sub { color: #d6e6ff; }
body.marqueeing { user-select: none; -webkit-user-select: none; }
.row1 { display: flex; align-items: center; gap: 11px; padding: 9px 11px; }
.cover {
  width: 52px; height: 52px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #2a4a86, #5a3a12);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background-size: cover; background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 5px rgba(0, 0, 0, 0.5);
}
.t-meta { flex: 1; min-width: 0; }
.t-title {
  font-weight: 700; color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.t-sub {
  font-family: 'VT323', monospace; font-size: 15.5px; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
.t-actions { display: flex; gap: 3px; flex-shrink: 0; align-items: center; }
.t-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.30);
  color: #dceaff; font-size: 16px; width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.t-btn:hover { border-color: var(--pink-soft); box-shadow: 0 0 9px rgba(255, 105, 180, 0.55); }
.t-btn:active, .t-btn.on {
  background: linear-gradient(180deg, #ffe0a0, var(--accent));
  color: #402000; border-color: #ffd08a;
}
.t-btn.more {
  font-size: 20px; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
}
.t-btn.more:hover { box-shadow: 0 0 9px rgba(255, 105, 180, 0.55); }
.t-sel { width: 20px; height: 20px; accent-color: var(--accent); }
.cmt-badge {
  font-family: 'VT323', monospace; font-size: 15px; color: var(--pink);
  display: flex; gap: 3px; align-items: center; cursor: pointer;
  text-shadow: 0 0 7px rgba(255, 105, 180, 0.6);
}

/* ---------- комментарии ---------- */
.comments { padding: 4px 12px 12px; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.dl-link {
  display: inline-block; margin: 7px 0 3px;
  color: var(--aqua); font-size: 13.5px; text-decoration: none;
  font-family: 'VT323', monospace; font-size: 16px;
  text-shadow: 0 0 6px rgba(80, 220, 255, 0.6);
}
.dl-link:hover { color: var(--accent2); }
.cmt { padding: 8px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.18); font-size: 14px; }
.cmt:last-of-type { border-bottom: none; }
.cmt-head { display: flex; justify-content: space-between; gap: 8px; }
.cmt-name { color: var(--accent2); font-weight: 700; font-size: 13px; text-shadow: 0 1px 2px #000; }
.cmt-date { color: var(--dim); font-size: 11.5px; font-family: 'VT323', monospace; font-size: 14px; }
.cmt-text { margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.cmt-tools { display: flex; gap: 12px; margin-top: 4px; }
.cmt-tools button { background: none; border: none; color: var(--dim); font-size: 12px; padding: 0; }
.cmt-tools button:hover { color: var(--accent); }
.cmt-form { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.cmt-form input, .cmt-form textarea {
  background: #04122e; border: 1px solid #0a3a7a; border-radius: 6px;
  padding: 9px 11px; color: var(--aqua); font-size: 14.5px; font-family: inherit;
  outline: none; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  caret-color: var(--accent);
}
.cmt-form input:focus, .cmt-form textarea:focus { border-color: var(--accent); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 8px rgba(255, 138, 0, 0.5); }
.cmt-form textarea { min-height: 64px; resize: vertical; }
.cmt-form .btn { align-self: flex-end; }
.cmt-hint { font-size: 12.5px; color: var(--dim); font-family: 'VT323', monospace; font-size: 16px; }

/* ---------- кнопки (XP-диалоги) ---------- */
.btn {
  background: linear-gradient(180deg, #f0f6ff 0%, #cfe2f9 50%, #a9cbf0 100%);
  color: #0a2a55; border: 1px solid #3a6ea5; border-radius: 5px;
  padding: 10px 16px; font-size: 14px; font-weight: 700;
  box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 0 #ffffffaa;
  transition: box-shadow 0.15s, filter 0.15s;
}
.btn:hover { filter: brightness(1.06); box-shadow: inset 0 1px 0 #fff, 0 0 9px rgba(255, 160, 40, 0.7); border-color: var(--accent); }
.btn:active { filter: brightness(0.95); }
.btn.primary {
  background: linear-gradient(180deg, #9df29d 0%, #4ada4a 50%, #1f9c1f 100%);
  color: #fff; border-color: #187a18; text-shadow: 0 1px 2px #0a4a0a;
}
.btn.primary:hover { box-shadow: inset 0 1px 0 #fff8, 0 0 10px rgba(70, 230, 90, 0.8); border-color: #0f5f0f; }
.btn.ghost { background: rgba(255, 255, 255, 0.14); color: var(--fg); border-color: rgba(255, 255, 255, 0.4); text-shadow: 0 1px 2px #0008; }
.btn.danger { background: linear-gradient(180deg, #ffb3a3, #f26a4d 50%, #c93c22); color: #fff; border-color: #a02c15; text-shadow: 0 1px 2px #5a1505; }
.btn:disabled { opacity: 0.5; }

/* ---------- пусто (CRT) ---------- */
#empty { text-align: center; padding: 70px 20px; font-family: 'VT323', monospace; }
#empty .empty-icon { font-size: 54px; filter: drop-shadow(0 0 14px rgba(120, 230, 255, 0.7)); }
#empty p { margin: 6px 0; font-size: 24px; color: var(--lcd); text-shadow: 0 0 9px rgba(80, 255, 110, 0.6); }
#empty p.dim { color: #3f7ac9; text-shadow: 0 0 7px rgba(70, 140, 255, 0.5); font-size: 19px; }

/* ---------- рамка выделения протяжкой мышкой (как в Windows) ---------- */
#selRect {
  position: fixed; z-index: 65; pointer-events: none;
  background: rgba(49, 106, 197, 0.35);
  border: 1px solid #8fbcff;
  box-shadow: 0 0 10px rgba(80, 150, 255, 0.55), inset 0 0 0 1px rgba(49, 106, 197, 0.65);
}

/* ---------- панель выбора ---------- */
#selectBar {
  position: fixed; left: 0; right: 0; z-index: 60;
  bottom: calc(var(--player-h) + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #3f7ae0 0%, var(--xp-blue) 60%, #1a3fa0 100%);
  border-top: 1px solid #8fc2ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 -3px 12px rgba(0, 0, 0, 0.4);
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-weight: 700; text-shadow: 0 1px 2px #123a8a;
}
#selectBar .sel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#selectBar button {
  border: 1px solid rgba(255, 255, 255, 0.75); border-radius: 5px;
  padding: 9px 13px; font-size: 13.5px; font-weight: 700;
  background: linear-gradient(180deg, #eaf4ff, #b9d6f7 50%, #8dbcee);
  color: #0a2a55; text-shadow: 0 1px 0 #ffffffcc;
  box-shadow: inset 0 1px 0 #fff;
}
#selectBar button:hover { filter: brightness(1.08); }
#selectBar button.primary {
  background: linear-gradient(180deg, #9df29d, #4ada4a 50%, #1f9c1f);
  color: #fff; text-shadow: 0 1px 2px #0a4a0a;
}
#selectBar button.danger {
  background: linear-gradient(180deg, #ffb3a3, #f26a4d 50%, #c93c22);
  color: #fff; border-color: #a02c15; text-shadow: 0 1px 2px #5a1505;
}

/* ---------- общая кнопка «включить музыку» ---------- */
#playAllBar {
  display: flex; align-items: center; gap: 12px;
  width: calc(100% - 20px); max-width: 960px; margin: 10px auto 0;
}
#btnPlayAll {
  flex: 1; padding: 13px 18px; border-radius: 10px;
  font-size: 17px; font-weight: 700; letter-spacing: 0.4px;
  color: #fff; text-shadow: 0 2px 3px #0a4a0a;
  background: radial-gradient(120% 130% at 30% 18%, #b6f8b6, var(--xp-green) 48%, #178a17);
  border: 1px solid #2f9e2f;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.8), 0 3px 8px rgba(0, 0, 0, 0.5), 0 0 18px rgba(70, 230, 90, 0.35);
  transition: box-shadow 0.15s, filter 0.15s;
}
#btnPlayAll:hover { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.8), 0 3px 8px rgba(0, 0, 0, 0.5), 0 0 26px rgba(70, 230, 90, 0.7); }
#btnPlayAll:active { filter: brightness(0.95); transform: translateY(1px); }
#paHint {
  font-family: 'VT323', monospace; font-size: 19px; color: var(--lcd);
  text-shadow: 0 0 7px rgba(80, 255, 110, 0.7); white-space: nowrap;
}

/* ---------- меню «три точки» текущего трека ---------- */
.more-btn {
  flex-shrink: 0; width: 34px; height: 30px; border-radius: 7px;
  font-size: 21px; line-height: 1; color: #eaf4ff; padding: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 4px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.more-btn:hover { border-color: var(--pink-soft); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 10px var(--pink); }
#moreMenu {
  position: fixed; z-index: 90; min-width: 200px;
  background: linear-gradient(180deg, #f6f9ff, #dce7f7);
  border: 1px solid #7f9dc4; border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), inset 0 1px 0 #fff;
  padding: 5px; display: flex; flex-direction: column; gap: 2px;
}
#moreMenu button {
  text-align: left; background: transparent; border: 1px solid transparent;
  color: #12303f; font-size: 14.5px; font-weight: 600;
  padding: 10px 11px; border-radius: 5px;
}
#moreMenu button:hover { background: linear-gradient(180deg, #316ac5, #245edc); color: #fff; border-color: #1d4fa8; }

/* ---------- диалог загрузки: название и автор ---------- */
#uploadPending {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 10px; max-height: 44vh; overflow-y: auto;
}
.up-meta {
  display: grid; grid-template-columns: 1fr auto; gap: 7px;
  background: rgba(4, 18, 46, 0.7); border: 1px solid #0a3a7a;
  border-radius: 7px; padding: 9px;
}
.up-file {
  grid-column: 1 / -1; color: var(--dim); font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.up-meta input {
  grid-column: 1; background: #04122e; border: 1px solid #0a3a7a;
  border-radius: 5px; color: var(--aqua); padding: 8px 10px;
  font-size: 14px; outline: none; font-family: inherit; width: 100%;
}
.up-meta input:focus { border-color: var(--accent); }
.up-del {
  grid-row: 2; grid-column: 2; width: 36px; border-radius: 5px;
  background: linear-gradient(180deg, #ff9d8a, #e8503a);
  border: 1px solid #a3372a; color: #fff; font-weight: 700; font-size: 15px;
}
.up-del:hover { filter: brightness(1.08); }

/* ---------- плеер = панель задач XP ---------- */
#player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: linear-gradient(180deg, #4a86f7 0%, var(--xp-blue) 14%, #1e49b8 85%, #163a8f 100%);
  border-top: 2px solid #8fc2ff;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  padding: 9px 16px calc(12px + env(safe-area-inset-bottom, 0px));
}
.seek-wrap { display: flex; align-items: center; gap: 12px; }
.lcd {
  font-family: 'VT323', monospace; font-size: 20px; color: #d9ffdf;
  text-shadow: 0 0 7px rgba(90, 255, 120, 0.75);
  min-width: 50px; text-align: center;
}
/* сегментированный «жидкокристаллический» ползунок как в XP */
#seek {
  flex: 1; height: 15px; border-radius: 3px;
  --f: 0%;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0 2px, rgba(0, 0, 0, 0) 2px 10px),
    linear-gradient(90deg, #5df06a var(--f), #0c2450 var(--f));
  border: 1px solid #05101f;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 19px; height: 19px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffffff, var(--aqua) 45%, #2a9fd8);
  box-shadow: 0 0 11px var(--aqua), 0 1px 3px rgba(0, 0, 0, 0.7);
  cursor: pointer;
}
#seek::-moz-range-thumb {
  width: 19px; height: 19px; border: none; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffffff, var(--aqua) 45%, #2a9fd8);
  box-shadow: 0 0 11px var(--aqua);
}
/* левая часть: обложка + название; управление строго по центру панели */
.p-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin-top: 8px; }
.p-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.p-controls { justify-self: center; display: flex; align-items: center; gap: 6px; }
.p-extra { justify-self: end; display: flex; align-items: center; gap: 9px; }
.crt {
  padding: 4px; flex-shrink: 0;
  background: linear-gradient(180deg, #f2f6fb, #b9c6d8 60%, #93a4bb);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(0, 0, 0, 0.55);
}
#pCover {
  width: 58px; height: 58px; border-radius: 9px; object-fit: cover; display: block;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4);
}
.p-meta { flex: 1; min-width: 0; }
.np-label {
  font-family: 'PressStart', monospace; font-size: 8px; color: var(--pink-soft);
  letter-spacing: 1px; margin-bottom: 4px;
  text-shadow: 0 0 8px rgba(255, 105, 180, 0.9);
}
#pTitle {
  font-weight: 700; font-size: 17px; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#pArtist {
  font-family: 'VT323', monospace; font-size: 18px; color: #cfe4ff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ctl {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.45); color: #fff;
  font-size: 20px; width: 46px; height: 46px; border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 4px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.ctl:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 12px var(--pink); border-color: var(--pink-soft); }
.ctl.on {
  background: linear-gradient(180deg, #ffe0a0, var(--accent));
  color: #402000; border-color: #ffd08a; text-shadow: none;
  box-shadow: inset 0 1px 0 #fff8, 0 0 13px rgba(255, 138, 0, 0.75);
}
.ctl.big {
  font-size: 28px; width: 62px; height: 58px; border-radius: 31px;
  background: radial-gradient(120% 130% at 30% 18%, #b6f8b6, var(--xp-green) 48%, #178a17);
  color: #fff; border-color: #2f9e2f; font-weight: 700;
  text-shadow: 0 2px 3px #0a4a0a;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.8), 0 3px 8px rgba(0, 0, 0, 0.5), 0 0 18px rgba(70, 230, 90, 0.35);
}
.ctl.big:hover { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.8), 0 3px 8px rgba(0, 0, 0, 0.5), 0 0 26px rgba(70, 230, 90, 0.7); }
#clock {
  color: #ffe9a8; text-shadow: 0 0 7px rgba(255, 210, 90, 0.7);
  min-width: 58px; font-size: 22px;
}
#vol { width: 180px; background: rgba(4, 14, 44, 0.75); }
input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.5);
  background: #04122e; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff, var(--aqua) 50%, #2a9fd8);
  box-shadow: 0 0 8px var(--aqua); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px; border: none; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff, var(--aqua) 50%, #2a9fd8);
  box-shadow: 0 0 8px var(--aqua);
}

/* ---------- модалки (диалоги XP) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 12, 40, 0.72);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal .box {
  background: linear-gradient(180deg, #eef4fd, #dce9f9);
  color: #0a2a55;
  border: 1px solid #3a6ea5; border-radius: 9px 9px 5px 5px;
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.7), inset 0 1px 0 #fff;
  padding: 0 20px 20px;
  width: 100%; max-width: 440px; max-height: 86vh; overflow-y: auto;
}
.modal h2 {
  margin: 0 -20px 14px; padding: 11px 14px;
  background: linear-gradient(180deg, #63a4ff 0%, var(--xp-blue-hi) 20%, var(--xp-blue) 75%, #1a3fa0 100%);
  color: #fff; font-size: 14px; font-weight: 700;
  font-family: 'PressStart', monospace; font-size: 11px; letter-spacing: 1px;
  text-shadow: 2px 2px 0 #123a8a;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid #8fc2ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.modal .dim { color: #4a6b93; font-size: 13.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.modal input[type="password"], .modal .box > input {
  width: 100%; background: #fff; border: 1px solid #7a9cc6; border-radius: 4px;
  padding: 11px; color: #0a2a55; font-size: 15px; outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}
.modal .box > input + input { margin-top: 9px; }
.modal input:focus { border-color: var(--accent); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 7px rgba(255, 138, 0, 0.6); }
.error { color: #c93c22; font-size: 13px; margin-top: 8px; font-weight: 700; }

#dropzone {
  border: 2px dashed #5a86c9; border-radius: 10px; padding: 34px 16px;
  text-align: center; font-size: 15.5px; color: #0a2a55; cursor: pointer;
  background: linear-gradient(180deg, #ffffff, #eaf3ff);
  box-shadow: inset 0 1px 0 #fff;
}
#dropzone .dim { color: #5a7ba6; }
#dropzone.hover { border-color: var(--accent); background: linear-gradient(180deg, #fff6e8, #ffe9c8); box-shadow: 0 0 12px rgba(255, 138, 0, 0.5); }
.up-item { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13.5px; color: #0a2a55; }
.up-item .bar { flex: 1; height: 12px; background: #c9d9ee; border: 1px solid #7a9cc6; border-radius: 3px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25); }
.up-item .fill { height: 100%; width: 0%; transition: width 0.2s; background: linear-gradient(180deg, #8ff08f, var(--xp-green)); box-shadow: inset 0 1px 0 #ffffff88; }
.up-item .st { width: 20px; text-align: center; }
.up-item .pc { font-family: 'VT323', monospace; font-size: 16px; min-width: 64px; }

#queueList { display: flex; flex-direction: column; gap: 5px; }
.q-item {
  display: flex; gap: 9px; align-items: center; padding: 9px; border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #e4eefb);
  border: 1px solid #a9c3e0; color: #0a2a55; font-size: 14px; cursor: pointer;
  box-shadow: inset 0 1px 0 #fff;
}
.q-item:hover { border-color: var(--accent); box-shadow: 0 0 8px rgba(255, 138, 0, 0.4); }
.q-item.current { border-color: var(--xp-green); background: linear-gradient(180deg, #eaffe9, #d2f7d0); box-shadow: 0 0 8px rgba(70, 230, 90, 0.5); }
.q-item .n { color: #5a7ba6; width: 22px; font-family: 'VT323', monospace; font-size: 16px; }

/* ---------- тост ---------- */
#toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--player-h) + 46px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #ffe0a0, var(--accent));
  color: #402000; font-weight: 700;
  border: 1px solid #ffd08a; border-radius: 24px;
  padding: 11px 20px; font-size: 14.5px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), inset 0 1px 0 #ffffffcc, 0 0 16px rgba(255, 138, 0, 0.45);
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.25s;
  max-width: 90vw; text-align: center;
  text-shadow: 0 1px 0 #ffffff66;
}
#toast.show { opacity: 1; }
#toast.err {
  background: linear-gradient(180deg, #ffb3a3, #f26a4d);
  color: #fff; border-color: #ffd0c4; text-shadow: 0 1px 2px #5a1505;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 90, 60, 0.5);
}

/* ---------- искры от курсора (Y2K) ---------- */
.spark {
  position: fixed; z-index: 300; pointer-events: none;
  color: var(--aqua); font-size: 14px;
  text-shadow: 0 0 8px var(--aqua), 0 0 14px var(--aqua);
  transform: translate(-50%, -50%);
  animation: sparkFade 0.7s ease-out forwards;
}
@keyframes sparkFade {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to   { opacity: 0; transform: translate(-50%, -160%) scale(0.4); }
}

/* ---------- наклейки и мусор (Y2K / underground) ---------- */
#deco { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.sticker { position: absolute; font-weight: 900; user-select: none; }
/* наклейки, персонажи и диск можно перетаскивать мышкой (см. app.js);
   клик «сквозь» наклейку пробрасывается в элемент под ней */
#deco .sticker, #deco .cast, #deco .cd-spin {
  pointer-events: auto;
  cursor: move;
}
#deco .dragging { cursor: grabbing !important; }
.starburst {
  right: 26px; top: 160px;
  width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 17px; line-height: 1.05; color: #fff;
  background: radial-gradient(circle at 35% 30%, #ff9ad5, var(--pink) 60%, #e0449a);
  clip-path: polygon(100% 50%, 84.79% 59.32%, 93.3% 75%, 75.46% 75.46%, 75% 93.3%, 59.32% 84.79%, 50% 100%, 40.68% 84.79%, 25% 93.3%, 24.54% 75.46%, 6.7% 75%, 15.21% 59.32%, 0% 50%, 15.21% 40.68%, 6.7% 25%, 24.54% 24.54%, 25% 6.7%, 40.68% 15.21%, 50% 0%, 59.32% 15.21%, 75% 6.7%, 75.46% 24.54%, 93.3% 25%, 84.79% 40.68%);
  text-shadow: 0 2px 3px #a02c68;
  filter: drop-shadow(0 0 12px rgba(255, 105, 180, 0.65));
  transform: rotate(14deg);
  animation: wobA 3.2s ease-in-out infinite alternate;
}
@keyframes wobA { from { transform: rotate(10deg) scale(1); } to { transform: rotate(19deg) scale(1.06); } }
.new-badge {
  left: 24px; top: 225px;
  background: linear-gradient(180deg, #fff176, #ffd600);
  color: #c2185b; border: 2px dashed #c2185b;
  padding: 6px 13px; border-radius: 5px;
  font-family: 'PressStart', monospace; font-size: 11px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
  transform: rotate(-9deg);
  animation: wobB 2.6s ease-in-out infinite alternate;
  text-shadow: 0 1px 0 #ffffff88;
}
@keyframes wobB { from { transform: rotate(-12deg); } to { transform: rotate(-5deg) translateY(-4px); } }
.barcode-st {
  left: 30px; top: 555px;
  background: #fff; padding: 7px 9px 4px;
  border: 1px solid #000;
  transform: rotate(-4deg);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
}
.barcode {
  width: 124px; height: 36px;
  background: repeating-linear-gradient(90deg, #000 0 2px, #fff 2px 4px, #000 4px 7px, #fff 7px 9px, #000 9px 10px, #fff 10px 14px);
}
.bc-cap {
  font-family: 'VT323', monospace; font-size: 15px; color: #000;
  text-align: center; letter-spacing: 3px; margin-top: 2px;
}
.tape {
  left: 0; top: 0; bottom: 0; width: 15px;
  background: repeating-linear-gradient(180deg, var(--pink) 0 20px, #161616 20px 40px);
  opacity: 0.9;
  border-right: 1px solid rgba(0, 0, 0, 0.6);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
}

/* ---------- скроллбар (XP) ---------- */
::-webkit-scrollbar { width: 15px; height: 15px; }
::-webkit-scrollbar-track { background: linear-gradient(90deg, #dce9f9, #eef4fd); border-left: 1px solid #a9c3e0; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ffb3da, var(--pink) 45%, #3a76e0);
  border: 1px solid #2a5ec0; border-radius: 3px;
  box-shadow: inset 0 1px 0 #ffffffaa;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #ffd1ea, #ff8ac6 45%, #4a8ff5); }

/* ---------- десктоп ---------- */
@media (min-width: 901px) {
  /* наклейки только на больших экранах */
}
@media (max-width: 900px) {
  .starburst, .barcode-st { display: none; }
}
@media (min-width: 760px) {
  .cover { width: 56px; height: 56px; }
  #vol { width: 220px; }
}
@media (max-width: 560px) {
  /* п.1 — поиск отдельной строкой, сортировка тянется на всю ширину,
     кнопки уезжают вправо и ничего не заслоняют */
  #header { gap: 7px; padding: 8px 10px; backdrop-filter: none; }
  #search { flex: 1 1 100%; min-width: 0; }
  .actions { flex: 1 1 100%; flex-wrap: nowrap; gap: 5px; }
  #sort { flex: 1 1 auto; max-width: none; min-width: 0; padding: 8px 5px; }
  .icon-btn { flex: 0 0 auto; min-width: 34px; padding: 0 6px; }

  /* п.7 — на телефоне убираем то, что грузит систему при скролле */
  body {
    background-attachment: scroll;
    background-size: 300px 300px, 100% 100vh;
    background-repeat: repeat, no-repeat;
  }

  /* п.2 и п.3 — автор и название на всю ширину, «NOW PLAYING» убран */
  .np-label { display: none; }
  .p-main { grid-template-columns: 1fr; gap: 7px; }
  .p-left { gap: 10px; }
  #pTitle {
    white-space: normal; font-size: 15.5px; line-height: 1.25; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  #pArtist {
    white-space: normal; font-size: 15px; line-height: 1.25; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  }

  #player { padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .seek-wrap { gap: 8px; }
  .lcd { min-width: 44px; font-size: 18px; }
  :root { --player-h: 174px; }

  .p-extra { display: none; }
  .ctl { width: 38px; font-size: 17px; }
  .ctl.big { width: 52px; height: 50px; font-size: 24px; }
  .tb-kana { display: none; }
  #selectBar { flex-wrap: wrap; gap: 6px; }
  .tb-title { font-size: 9px; }
  #deco { display: none; }
  #pCover { width: 46px; height: 46px; }

  /* п.6 — кнопка «включить музыку» во всю ширину */
  #playAllBar { gap: 8px; }
  #paHint { font-size: 17px; }

  /* липкая верхняя сборка на телефоне — компактнее, чтобы список оставался виден */
  #topstack { padding-bottom: 4px; }
  #statusbar { margin-top: 6px; padding: 5px 9px; font-size: 16px; }
  #playAllBar { margin-top: 6px; }
  #btnPlayAll { padding: 11px 14px; font-size: 16px; }

  /* 3 author links wrap on narrow screens */
  .tk-handles { flex-shrink: 1; flex-wrap: wrap; justify-content: flex-end; }
  .handle { font-size: 12px; }
}
/* на сенсорных экранах hover «залипает» — анимации при тапе только мешают */
@media (hover: none) {
  .track:hover { transform: none; }
  .handle:hover { transform: none; }
}
