/* m-plus-rounded-1c-300 - cyrillic_latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'M PLUS Rounded 1c';
  font-style: normal;
  font-weight: 300;
  src: url('/getfile?path=fonts/m-plus-rounded-1c-v19-cyrillic_latin-300.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* m-plus-rounded-1c-regular - cyrillic_latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'M PLUS Rounded 1c';
  font-style: normal;
  font-weight: 400;
  src: url('/getfile?path=fonts/m-plus-rounded-1c-v19-cyrillic_latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* m-plus-rounded-1c-500 - cyrillic_latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'M PLUS Rounded 1c';
  font-style: normal;
  font-weight: 500;
  src: url('/getfile?path=fonts/m-plus-rounded-1c-v19-cyrillic_latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* m-plus-rounded-1c-700 - cyrillic_latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'M PLUS Rounded 1c';
  font-style: normal;
  font-weight: 700;
  src: url('/getfile?path=fonts/m-plus-rounded-1c-v19-cyrillic_latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}


:root{
  --bg0: #0b1020;
  --bg1: #101527;
  --fg: #eaf1f5;
  --muted: #aab6c3;
  --accent: #66e1ff;
  --accent2: #8b7dff;
  --glass: rgba(17, 22, 35, 0.55);
  --border: rgba(255,255,255,0.12);
  --shadow: 0 8px 30px rgba(0,0,0,0.35);
}

*{ box-sizing:border-box; }
html, body { height:100%; }
body {
  margin:0; font-family: "M PLUS Rounded 1c", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  color: var(--fg); background: var(--bg0);
}

.scrollable-element {
  scrollbar-width: thin; /* Make the scrollbar thin */
  scrollbar-color: #888 #f1f1f1; /* Thumb color then track color */
}

/* Animated abstract gradient */
.bg-animated {
  position: fixed; inset: 0; z-index: -3;
  background:
    radial-gradient(1000px 700px at 15% 20%, rgba(102,225,255,0.20), transparent 60%),
    radial-gradient(900px 600px at 85% 30%, rgba(139,125,255,0.22), transparent 60%),
    radial-gradient(1000px 800px at 30% 85%, rgba(61, 212, 157, 0.18), transparent 60%),
    linear-gradient(160deg, var(--bg1), var(--bg0));
  filter: saturate(120%);
  animation: drift 40s ease-in-out infinite alternate;
}

.cookie-banner{
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 14px 16px;
  display: none;
  align-items: center;
  gap: 16px;
  z-index: 10000;
  background: var(--cb-bg);
  color: var(--cb-text);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

:root{
  --cb-bg: #0f172a;       /* Более плотный фон (полностью непрозрачный) */
  --cb-text: #f8fafc;     /* Светлый текст */
  --cb-link: #93c5fd;     /* Цвет ссылки */
  --cb-btn-bg: #10b981;   /* Кнопка */
  --cb-btn-bg-h: #059669; /* Ховер кнопки */
  --cb-btn-text: #ffffff;
}

/* Изначально скрыт, покажем из JS при отсутствии согласия */
.cookie-banner{
  position: fixed;
  right: 16px;     /* Правый нижний угол */
  bottom: 16px;
  left: auto;      /* Больше не тянется на всю ширину */
  width: min(420px, 92vw); /* Аккуратная карточка, адаптивная на мобильных */
  padding: 16px;
  display: none;
  align-items: center;
  gap: 14px;
  z-index: 10000;

  /* Полностью непрозрачный фон + более заметная тень */
  background: var(--cb-bg);
  color: var(--cb-text);
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.06);
  opacity: 1; /* На всякий случай фиксируем отсутствие прозрачности */

  font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.cookie-banner.is-visible{ display: flex; }

.cookie-banner__text{
  margin: 0;
  flex: 1; /* Текст занимает доступное место, кнопка прижимается вправо */
}
.cookie-banner__text a{
  color: var(--cb-link);
  text-decoration: underline;
}

.cookie-banner__btn{
  background: var(--cb-btn-bg);
  color: var(--cb-btn-text);
  border: 0;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.cookie-banner__btn:hover{ background: var(--cb-btn-bg-h); }

/* Мобильная подстройка: карточка остаётся угловой, но компактной */
@media (max-width: 480px){
  .cookie-banner{
    width: min(360px, 92vw);
  }
}

@keyframes drift {
  0% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(-1.5%, -1.5%, 0) scale(1.02); }
  100%{ transform: translate3d(1.5%, 1.5%, 0) scale(1.01); }
}

/* Geometric grid overlay */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events:none; opacity: 0.35;
  background-image:
    repeating-linear-gradient(60deg, rgba(255,255,255,0.055) 0 2px, transparent 2px 80px),
    repeating-linear-gradient(-60deg, rgba(255,255,255,0.045) 0 2px, transparent 2px 80px);
  animation: pan 60s linear infinite;
}
@keyframes pan {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 800px 0, -800px 0; }
}

/* Header + glass */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display:flex; flex-wrap: wrap; align-items:center; justify-content:space-between; gap: 16px;
  padding: 14px 18px; background: var(--glass); backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
}
.brand { display:flex; align-items:center; gap:12px; min-width: 210px; }
.logo { font-size: 22px; }
.title .site-name { font-weight: 600; letter-spacing:.2px; }
.title .site-tag { font-size: 12px; color: var(--muted); }

.player { display:flex; align-items:center; gap:10px; flex: 1 1 auto; min-width: 260px; }
.icon-btn {
  background: rgba(255,255,255,0.06); color: var(--fg);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); }
.track-info { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex: 1; padding: 0 10px; color: var(--muted); }
.volume { display:flex; align-items:center; gap:6px; }
.volume input[type="range"] { width: 120px; accent-color: var(--accent); }

/* Playlist panel */
.playlist-panel {
  position: fixed; right: 18px; top: 70px; width: 320px; max-height: 60vh; overflow:auto;
  background: var(--glass); backdrop-filter: blur(10px) saturate(140%);
  border:1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
  transform-origin: top right; transform: scale(.98) translateY(-6px); opacity:0; pointer-events:none;
  transition: transform .2s ease, opacity .2s ease;
  z-index: 100;
}
.playlist-panel.open { transform: scale(1) translateY(0); opacity:1; pointer-events:auto; }
.panel-header { display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border-bottom:1px solid var(--border); }
.playlist { list-style:none; margin:0; padding:8px; }
.playlist li {
  display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius: 10px; cursor:pointer;
}
.playlist li:hover { background: rgba(255,255,255,0.06); }
.playlist li.active { background: rgba(102,225,255,0.12); color: #dff8ff; border: 1px solid rgba(102,225,255,0.3); }
.scrollable-element {
  scrollbar-width: thin; /* Make the scrollbar thin */
  scrollbar-color: #888 #f1f1f1; /* Thumb color then track color */
}
/* Main content container */
.container {
  width: min(1000px, 92%); margin: 30px auto 30px;
  background: var(--glass); border:1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 22px 22px 20px; backdrop-filter: blur(10px) saturate(140%);
}
.toolbar { display:flex; justify-content:flex-start; margin-bottom: 10px; }
.path-loader { display:flex; gap:8px; width:100%; }
#md-path-input { flex:1; padding:10px 12px; border-radius:10px; border:1px solid var(--border); background: rgba(255,255,255,0.06); color: var(--fg); }
.btn {
  padding:10px 14px; border-radius:10px; border:1px solid var(--border); cursor:pointer;
  background: rgba(255,255,255,0.09); color: var(--fg);
}
.btn.ghost { background: transparent; }
.btn:hover { background: rgba(255,255,255,0.14); }

/* Markdown content */
.markdown-body {
  line-height: 1.7; color: var(--fg);
}
.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: #f4fbff; margin-top: 1.2em; }
.markdown-body a { color: var(--accent); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body code, .markdown-body pre { background: rgba(255,255,255,0.06); }
.markdown-body pre { padding: 12px; border-radius: 12px; overflow:auto; border:1px solid var(--border); }
.markdown-body img { max-width:100%; border-radius: 10px; border:1px solid var(--border); }

/* Footer */
.site-footer {
  width: min(1000px, 62%); margin: 0 auto 0px; color: var(--muted);
  display:flex; justify-content:space-between; align-items:center; gap: 0px;
  padding-bottom: 20px; padding-top: 0px; padding-left:60px;
}

/* Accessibility: reduce animations */
@media (prefers-reduced-motion: reduce) {
  .bg-animated, .bg-grid { animation: none !important; }
}