/* ============================================================
   WinUI3 / Fluent Design — Dark + Light theme
   NavigationView, Acrylic, Mica, Glide fixes
   ============================================================ */

:root {
  --mica-bg: #202020;
  --mica-bg-alt: #1c1c1c;
  --acrylic: rgba(44, 44, 44, 0.72);
  --acrylic-strong: rgba(32, 32, 32, 0.85);
  --acrylic-border: rgba(255, 255, 255, 0.08);
  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.60);
  --text-tertiary: rgba(255, 255, 255, 0.40);
  --accent: #6366f1;
  --accent-hover: #7679f5;
  --accent-pressed: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.45);
  --font: var(--font-medeo-sans), 'Segoe UI Variable', 'Segoe UI', sans-serif;
  --font-mono: 'Cascadia Code', var(--font-medeo-mono), monospace;
  --nav-width-collapsed: 48px;
  --nav-width-expanded: 280px;
  --titlebar-height: 48px;
}

/* ---------- Light theme ---------- */
@media (prefers-color-scheme: light) {
  :root {
    --mica-bg: #f3f3f3;
    --mica-bg-alt: #ffffff;
    --acrylic: rgba(252, 252, 252, 0.72);
    --acrylic-strong: rgba(243, 243, 243, 0.88);
    --acrylic-border: rgba(0, 0, 0, 0.08);
    --text-primary: rgba(0, 0, 0, 0.90);
    --text-secondary: rgba(0, 0, 0, 0.60);
    --text-tertiary: rgba(0, 0, 0, 0.40);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.14);
  }
}

/* ---------- Scrollbars (WinUI3 style) ---------- */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); background-clip: content-box; }

/* ---------- Base / Mica ---------- */
body {
  font-family: var(--font);
  color: var(--text-primary);
  background-color: var(--mica-bg);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.05), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(99, 102, 241, 0.04), transparent 45%);
  background-attachment: fixed;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
  padding: 5px 5px;
  border-radius: var(--radius-sm);
}

a:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.06);
}

.title { font-family: var(--font); color: var(--text-primary); text-align: center; font-weight: 600; }
.center { text-align: center; }

/* ---------- Focus visual (WinUI3) ---------- */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   NavigationView (WinUI3)
   ============================================================ */
.nav-backdrop {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 14;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.nav-backdrop.active { opacity: 1; visibility: visible; }

.nav-view {
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: var(--nav-width-collapsed);
  background: var(--acrylic-strong);
  backdrop-filter: blur(40px) saturate(140%);
  -webkit-backdrop-filter: blur(40px) saturate(140%);
  border-right: 1px solid var(--acrylic-border);
  z-index: 16;
  display: flex;
  flex-direction: column;
  padding-top: var(--titlebar-height);
  overflow: hidden;
  transition: width 0.2s ease, box-shadow 0.2s ease;
}

.nav-view.expanded {
  width: var(--nav-width-expanded);
  box-shadow: var(--shadow-lg);
}

.nav-view-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 12px;
  margin: 2px 6px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  white-space: nowrap;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease, gap 0.15s ease, padding 0.15s ease, justify-content 0.15s ease;
  text-decoration: none;
}

.nav-view.expanded .nav-view-item {
  justify-content: flex-start;
  gap: 16px;
  padding: 12px 14px;
}

.nav-view-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
}

.nav-view-item.active {
  background: var(--accent-soft);
  color: var(--text-primary);
  font-weight: 600;
}

.nav-view-item.active::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 3px;
}

.nav-view-item svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.nav-view-item span {
  width: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.nav-view.expanded .nav-view-item span {
  width: auto;
  opacity: 1;
}

/* ---------- Title bar ---------- */
.title-bar {
  position: fixed;
  top: 0;
  left: var(--nav-width-collapsed);
  right: 0;
  height: var(--titlebar-height);
  background: var(--acrylic-strong);
  backdrop-filter: blur(40px) saturate(140%);
  -webkit-backdrop-filter: blur(40px) saturate(140%);
  border-bottom: 1px solid var(--acrylic-border);
  z-index: 15;
  display: flex;
  align-items: center;
  padding: 0 16px 0 8px;
  transition: left 0.2s ease;
}

.title-bar.expanded { left: var(--nav-width-expanded); }

.nav-toggle {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.nav-toggle:hover { background: rgba(255, 255, 255, 0.06); }

.title-bar-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 4px;
}

/* ---------- Page content ---------- */
body > .content {
  margin-left: var(--nav-width-collapsed);
  margin-top: var(--titlebar-height);
  padding: 24px;
  min-height: calc(100vh - var(--titlebar-height));
  box-sizing: border-box;
  transition: margin-left 0.2s ease;
}

body > .content.expanded { margin-left: var(--nav-width-expanded); }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 16px;
  color: var(--text-tertiary);
  font-size: 14px;
  border-top: 1px solid var(--acrylic-border);
  margin-top: 24px;
}

/* ============================================================
   Components (Acrylic cards, etc.)
   ============================================================ */
ul.styled-list {
  font-family: var(--font);
  color: var(--text-primary);
  background-color: var(--acrylic);
  border-radius: var(--radius-md);
  border: 1px solid var(--acrylic-border);
}

/* ---------- Hero / admins list ---------- */
.heroi-huegrada {
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--acrylic);
  backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--acrylic-border);
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: 16px;
  margin: 16px 0;
}

.heroi-huegrada li {
  padding: 14px 0;
  border-bottom: 1px solid var(--acrylic-border);
  line-height: 1.6;
  color: var(--text-secondary);
}

.heroi-huegrada li:last-child { border-bottom: none; }

.heroi-huegrada li b {
  color: var(--accent);
  font-weight: 600;
}

.heroi-huegrada img {
  vertical-align: middle;
  margin: 0 2px;
  border-radius: var(--radius-sm);
}

/* ---------- InfoBar ---------- */
.info-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 16px 0;
  backdrop-filter: blur(20px);
  flex-wrap: wrap;
}

.info-bar svg { flex-shrink: 0; width: 20px; height: 20px; color: var(--accent); }

.info-bar-content { flex: 1; min-width: 200px; }

.info-bar-content h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.info-bar-content .server-address {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--accent);
  word-break: break-all;
}

/* ---------- Page title ---------- */
.page-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 12px;
}

/* ---------- Acrylic cards ---------- */
.card {
  width: 300px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--acrylic);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--acrylic-border);
  box-shadow: var(--shadow-md);
  font-family: var(--font);
  max-width: 50%;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  padding: 16px;
  box-sizing: border-box;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card img { width: 80%; height: auto; border-radius: var(--radius-sm); }
.card h2 { margin-top: 0; color: var(--text-primary); }
.card h3 { margin-top: 0; color: var(--text-primary); font-size: 16px; }

.card-video {
  width: 500px;
  max-width: 100%;
  object-fit: cover;
  display: block;
  padding-bottom: 1%;
  border-radius: var(--radius-md);
}

.cards-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;       /* <-- центрирует карточки по горизонтали */
  gap: 24px;                      /* расстояние между карточками */
  padding: 0 16px;                /* небольшие отступы по краям на мобильных */
  max-width: 1200px;              /* чтобы на больших экранах не растягивались бесконечно */
  margin: 0 auto;                 /* центрирует сам контейнер */
}

/* Сами карточки — делаем их шире и добавляем отступы */
.cards-container .card {
  max-width: 360px;               /* было 300px — теперь 360px */
  width: 100%;                    /* на узких экранах займут всю доступную ширину */
  box-sizing: border-box;         /* чтобы padding не увеличивал общую ширину */
}

.cards-row {
  display: flex;
  flex-wrap: wrap; /* Разрешаем перенос, если экран узкий */
  gap: 24px;       /* Отступ между карточками */
  padding: 20px 0;
  width: 100%;
  box-sizing: border-box;
  justify-content: center; /* Центрируем ряд, если карточек мало */
}

/* Карточки внутри ряда: задаем им ширину, чтобы они встали в ряд */
.cards-row .card {
  width: calc(33.333% - 16px); /* 3 карточки в ряд (минус половина отступа) */
  box-sizing: border-box;
  margin: 0;
  flex-shrink: 0; /* Запрещаем карточкам сжиматься */
}

/* ---------- Card links (education) ---------- */
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  width: 100%;
  max-width: 400px;
  margin: 12px auto;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--acrylic);
  backdrop-filter: blur(24px);
  border: 1px solid var(--acrylic-border);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
}

.card-link:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(255,255,255,0.06);
}

.card-link h3 { margin: 8px 0 4px; color: var(--text-primary); }
.card-link p { margin: 0; color: var(--text-secondary); }
.card-link svg { color: var(--accent); }

/* ---------- Новости ---------- */
.news-list {
  list-style: none;
  padding: 8px 0;
  margin: 16px 0;
  border: 1px solid var(--acrylic-border);
  background: var(--acrylic);
  backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  font-family: var(--font);
  box-shadow: var(--shadow-sm);
}

.news-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 20px;
  justify-content: left;
  font-family: var(--font);
}

.news-item time {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  width: 90px;
  font-family: var(--font-mono);
}

.news-item span { color: var(--text-primary); font-size: 1rem; line-height: 1.4; }

.news {
  margin: 16px 0;
  border: 1px solid var(--acrylic-border);
  background: var(--acrylic);
  backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  padding: 2%;
  box-sizing: border-box;
  box-shadow: var(--shadow-sm);
}

.news h3 {
  border-bottom: 1px solid var(--acrylic-border);
  padding-bottom: 8px;
  margin-right: 3%;
  margin-left: auto;
  color: var(--text-primary);
}

.news-img {
  max-height: 500px;
  max-width: 100%;
  height: auto;
  width: auto;
  border-radius: var(--radius-md);
}

.news-comments {
  margin-top: 3px;
  border: 1px solid var(--accent-soft);
  background: var(--acrylic);
  backdrop-filter: blur(24px);
  padding: 2%;
  box-sizing: border-box;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   Glide fixes + WinUI styling
   ============================================================ */
.glide {
    max-width: 800px;
    width: 100%;
    margin: 30px auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.glide__track {
    overflow: hidden;
}

.glide__slides {
    list-style: none;
    padding: 0;
    margin: 0;
}

.glide__slide {
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.glide__slide img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    margin: 0;
}

.glide__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--acrylic-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--acrylic-border);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.glide__arrow:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.glide__arrow--left { left: 12px; }
.glide__arrow--right { right: 12px; }

.glide__bullets {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 0;
}

.glide__bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  padding: 0;
}

.glide__bullet--active {
  background: var(--accent);
  transform: scale(1.25);
}

.mellstroj {
  width: 100%;
  padding-left: 0;               /* <-- было 48px, теперь 0 */
  box-sizing: border-box;
}
.anthem { text-align: center; }
.drochka { text-align: center; }

/* ---------- Animated gradient text ---------- */
.animated-gradient {
  background: linear-gradient(-45deg, var(--accent), #a855f7, #23a6d5, #23d5ab);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.content-inner { max-width: 600px; margin: 0 auto; }

/* ============================================================
   Forum
   ============================================================ */
.post { padding: 12px 0; }

.post input, .post textarea {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 5px;
  border: 1px solid var(--acrylic-border);
  border-radius: var(--radius-md);
  background-color: var(--mica-bg-alt);
  color: var(--text-primary);
  font-size: 15px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.post input:focus, .post textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.post b {
  background: linear-gradient(-45deg, var(--accent), #a855f7, #23a6d5, #23d5ab);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.post small { color: var(--text-tertiary); margin-left: 8px; }
.post p { margin: 5px 0 0; white-space: pre-wrap; }
.post-number { color: var(--text-tertiary); font-weight: 600; cursor: pointer; }
.post-number:hover { text-decoration: underline; }
.post-ref { color: var(--accent); text-decoration: none; font-weight: 600; }
.post-ref:hover { text-decoration: underline; }

.post.highlight {
  background: var(--accent-soft);
  transition: background 0.4s ease;
  color: var(--text-primary);
  padding: 2%;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent);
}

.post p code {
  background: var(--mica-bg-alt);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  border: 1px solid var(--acrylic-border);
}

.post p pre {
  background: var(--mica-bg-alt);
  padding: 10px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--acrylic-border);
}

.post p blockquote {
  border-left: 3px solid var(--accent);
  margin: 5px 0;
  padding-left: 10px;
  color: var(--text-secondary);
}

.post p ul, .post p ol { margin: 5px 0; padding-left: 20px; }
.post p img { max-width: 100%; max-height: 400px; border-radius: var(--radius-md); display: block; margin: 8px 0; }

.input-wrapper { position: relative; margin-top: 10px; }
.input-wrapper textarea {
  width: 100%; box-sizing: border-box;
  padding: 10px 90px 10px 10px;
  min-height: 80px; resize: vertical; font-family: var(--font);
}
.input-wrapper button {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer;
  border: none; background: var(--accent); color: white;
  transition: background 0.15s ease;
}
.input-wrapper button:hover { background: var(--accent-hover); }

.md-content p { margin: 0; }
.md-content a { color: var(--accent); text-decoration: underline; }
.md-content code {
  background: var(--mica-bg-alt); padding: 2px 6px;
  border-radius: var(--radius-sm); font-family: var(--font-mono);
  border: 1px solid var(--acrylic-border);
}

.like-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 60px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}
.like-btn span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.like-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); color: var(--accent); }
.like-btn:active:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.like-btn:disabled { color: var(--accent); cursor: default; opacity: 0.95; }
.like-btn:disabled span { color: var(--accent); background: var(--accent-soft); }

/* ---------- Forum layout / sidebar ---------- */
.layout {
  display: flex;
  height: calc(100vh - var(--titlebar-height));
  margin-left: var(--nav-width-collapsed);
  margin-top: var(--titlebar-height);
  transition: margin-left 0.2s ease;
}
.layout.expanded { margin-left: var(--nav-width-expanded); }

.sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--acrylic-strong);
  backdrop-filter: blur(40px) saturate(140%);
  border-right: 1px solid var(--acrylic-border);
  padding: 15px; overflow-y: auto; box-sizing: border-box;
}

.sidebar h2 { font-size: 15px; font-weight: 600; margin-top: 0; color: var(--text-secondary); }

.sidebar input {
  width: 100%; box-sizing: border-box; margin-bottom: 6px;
  background: var(--mica-bg-alt); color: var(--text-primary);
  border: 1px solid var(--acrylic-border); border-radius: var(--radius-md);
  padding: 8px 10px;
}

.sidebar button {
  width: 100%; margin-bottom: 15px; cursor: pointer;
  border: 1px solid var(--acrylic-border); border-radius: var(--radius-md);
  background: var(--accent); color: white; padding: 9px 6px;
  font-weight: 600; transition: background 0.15s ease;
}
.sidebar button:hover { background: var(--accent-hover); }

.topic-item {
  display: block; text-decoration: none; color: var(--text-secondary);
  margin-bottom: 2px; padding: 9px 12px; border-radius: var(--radius-md);
  position: relative; transition: background 0.15s ease, color 0.15s ease;
}
.topic-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.topic-item.active { background: var(--accent-soft); color: var(--text-primary); font-weight: 600; }
.topic-item.active::before {
  content: ''; position: absolute; left: 1px; top: 50%;
  transform: translateY(-50%); width: 3px; height: 60%;
  background: var(--accent); border-radius: 3px;
}

.topic-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topic-header h1 { margin: 0; }

.topics-toggle-btn {
  display: none;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 16px;
  border-radius: 8px;
  background: var(--acrylic);
  backdrop-filter: blur(20px);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  max-width: 55vw;
  border: 1px solid var(--acrylic-border);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.topics-toggle-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topics-toggle-btn svg {
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.topics-toggle-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.topics-toggle-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Forum .content override */
.layout > .content {
  flex: 1; padding: 20px; overflow-y: auto; box-sizing: border-box;
  margin-left: 0; margin-top: 0;
}

/* ---------- SoundCloud / media ---------- */
.soundcloud {
  text-align: center; color: var(--text-secondary);
  line-break: anywhere; word-break: normal;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-family: var(--font); font-weight: 400;
}

/* ---------- Announcement ---------- */
.announcement {
  background-color: rgba(196, 43, 28, 0.18); color: #ffb4a8;
  border: 1px solid rgba(196, 43, 28, 0.5); border-radius: var(--radius-md);
  margin: 2%; padding: 12px 5%; backdrop-filter: blur(20px);
}

.announcement-happy {
  background-color: rgba(22, 163, 74, 0.18); color: #8ee6ab;
  border: 1px solid rgba(22, 163, 74, 0.5); border-radius: var(--radius-md);
  margin: 2%; padding: 12px 5%; text-align: center; backdrop-filter: blur(20px);
}

/* ---------- Forms ---------- */
.form-container input,
.form-container select,
.form-container textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.05); /* Полупрозрачный фон под твой темный стиль */
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 8px;
  box-sizing: border-box;
  font-family: inherit;
}

.form-container .submit-btn {
  width: 100%;
  padding: 14px;
  background: #ff5555; /* Твой акцентный цвет */
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

.form-container .submit-btn:hover {
  background: #ff3333;
}

.form-container #status {
  margin-top: 15px;
  text-align: center;
  font-weight: bold;
}

/* --- Профиль в title-bar --- */
.title-bar {
  display: flex;          /* если уже flex — строка ничего не изменит */
  align-items: center;
}

.header-user {
  position: relative;     /* точка отсчёта для выпадающего меню */
  margin-left: auto;      /* прижимает профиль к правому краю */
  display: flex;
  align-items: center;
  max-height: 100%;
  flex-shrink: 0;
}

.header-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;           /* меньше высоты title-bar, чтобы не вылезало */
  padding: 0 12px 0 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: inherit;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.header-user-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.header-user-btn.guest {
  padding: 0 16px;
}

.header-user-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* круглая аватарка; размер можно менять здесь */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  color: #fff;
  font-weight: 700;
  user-select: none;
}

.header-user-btn .avatar {
  width: 28px !important;   /* перебивает размер, который задаёт JS */
  height: 28px !important;
  font-size: 13px !important;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;        /* фото заполняет круг без искажений */
}

/* выпадающее меню */
.header-user-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 100;
  min-width: 140px;
  padding: 6px;
  background: #1e1e2e;
  border: 1px solid #585887;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.header-user.open .header-user-menu {
  display: block;
}

.header-user-menu button {
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: #cdd6f4;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.header-user-menu button:hover {
  background: rgba(99, 102, 241, 0.2);
}

/* аватарка у постов */
.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-meta {
  min-width: 0;
}

/* на узких телефонах оставляем только аватарку */
@media (max-width: 420px) {
  .header-user-btn:not(.guest) .header-user-name {
    display: none;
  }
  .header-user-btn:not(.guest) {
    padding: 0 4px;
  }
}

.form-group input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.submit-btn {
  width: 100%; padding: 13px; background: var(--accent); color: white;
  border: none; border-radius: var(--radius-md); font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background 0.15s, transform 0.1s;
}
.submit-btn:hover { background: var(--accent-hover); }
.submit-btn:active { transform: scale(0.98); }

#status { text-align: center; margin-top: 14px; font-size: 14px; color: #4ade80; min-height: 18px; }

.spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 3px solid var(--acrylic-border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.spinner-wrap { display: flex; align-items: center; justify-content: center; padding: 20px; }

/* ---------- Keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .nav-view {
    width: var(--nav-width-expanded);
    transform: translateX(-100%);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .nav-view.expanded {
    transform: translateX(0);
    width: var(--nav-width-expanded);
    box-shadow: var(--shadow-lg);
  }
  .nav-view-item span { opacity: 1; }
  .title-bar { left: 0; padding-left: 8px; }
  .title-bar.expanded { left: 0; }
  body > .content { margin-left: 0; }
  body > .content.expanded { margin-left: 0; }
  .layout { margin-left: 0; }
  .layout.expanded { margin-left: 0; }

  .cards-row { grid-template-columns: repeat(2, 1fr); }

  .news-list { margin-top: 15%; border: 0; margin-left: 2%; margin-right: 2%; border-radius: var(--radius-md); }
  .news { max-width: 900px; width: 90%; margin: 30px auto; padding: 2rem; }
  .news-comments { max-width: 900px; width: 90%; margin: 30px auto; padding: 2rem; margin-top: 3px; border-radius: var(--radius-lg); }

  .topics-toggle-btn { display: flex; }
  .layout { position: relative; }
  .sidebar {
    position: absolute;
    top: 64px; right: 20px; left: auto; bottom: auto;
    width: min(300px, 80vw); height: auto; max-height: 70vh;
    border-radius: var(--radius-lg);
    border: 1px solid var(--acrylic-border);
    box-shadow: var(--shadow-lg);
    z-index: 25; background-color: var(--acrylic-strong);
    transform: translateY(-8px) scale(0.97);
    opacity: 0; pointer-events: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
  }
  .sidebar.active {
    transform: translateY(0) scale(1);
    opacity: 1; pointer-events: auto;
  }

  .auth-box {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #585887;
  }

  .auth-box button,
  .auth-box input {
    display: block;
    width: 100%;
    margin-bottom: 6px;
    box-sizing: border-box;
  }

  .auth-box input {
    padding: 8px;
    border-radius: 5px;
    border: 1.5px solid #e0e0e0;
    background: #cdd6f4;
  }

  .auth-box button {
    padding: 8px;
    border-radius: 5px;
    border: 1.5px solid #e0e0e0;
    background: #1e1e2e;
    color: #cdd6f4;
    cursor: pointer;
  }

  .auth-email-details summary {
    cursor: pointer;
    color: #a6adc8;
    margin: 8px 0;
    font-size: 13px;
  }

  .auth-buttons-row {
    display: flex;
    gap: 6px;
  }

  .auth-buttons-row button {
    flex: 1;
  }

  .auth-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #585887;
  }

  .auth-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
  }

  .auth-profile span {
    flex: 1;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .auth-profile button {
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid #585887;
    background: transparent;
    color: #cdd6f4;
    cursor: pointer;
    font-size: 12px;
  }

  .header-user {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    margin-left: auto;
  }

  .header-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: rgba(30, 30, 46, 0.8);
    border: 1px solid #585887;
    border-radius: 999px;
    color: #cdd6f4;
    font-size: 14px;
    cursor: pointer;
  }


  .mellstroj {
      padding-left: 0;
      box-sizing: border-box;
    }
}
@media (max-width: 500px) {
  .card { max-width: 100%; width: 100%; }
  .glide { max-width: 100%; }
  .cards-row .card {
      width: 100%;
  }
}

/* --- ОТСТУП ПОД МЕНЮ (Оставляем как было) --- */
@media (min-width: 901px) {
  .mellstroj {
    padding-left: 280px; /* Проверь, что это реальная ширина твоего меню */
    box-sizing: border-box;
  }
}
@media (max-width: 900px) {
  .mellstroj {
    padding-left: 0 !important;
    box-sizing: border-box;
  }
}

/* --- КОНТЕЙНЕР КАРТОЧЕК --- */
.cards-container {
  display: flex;
  flex-direction: column; /* <-- ГЛАВНОЕ ИЗМЕНЕНИЕ: теперь только вертикально */
  gap: 24px;               /* Расстояние между карточками */
  padding: 20px 0;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
}

/* --- СТИЛИ КАРТОЧЕК --- */
.cards-container .card {
  width: 100%;             /* На мобильных - во всю ширину */
  max-width: 700px;        /* <-- ГЛАВНОЕ ИЗМЕНЕНИЕ: на десктопе макс. ширина 700px */
  box-sizing: border-box;
  margin: 0 auto;          /* Центрирует карточку внутри контейнера */
}

/* Планшеты: можно сделать чуть уже, если нужно, или оставить как на десктопе */
@media (min-width: 768px) and (max-width: 1024px) {
  .cards-container .card {
    max-width: 600px;
  }
  .cards-row .card {
      width: calc(50% - 12px);
  }
}

/* Десктоп: оставляем 700px, чтобы было просторно */
@media (min-width: 1025px) {
  .cards-container .card {
    max-width: 700px;
  }
}

/* --- Карточки истории: фиксированная ширина и центрирование --- */
.cards-container.history-cards {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: 720px; /* Чуть шире, чтобы текст не был слишком узким */
  margin: 0 auto;
  padding: 20px 0;
  box-sizing: border-box;
}

/* Заголовок карточки (эпоха/событие) */
.cards-container.history-cards h2 {
  margin: 0 0 16px 0;
  font-size: 1.4rem;
  color: var(--text-main, #fff);
  border-left: 4px solid var(--accent-color, #ff5555);
  padding-left: 12px;
}

/* Текст внутри карточки */
.cards-container.history-cards p {
  margin: 0 0 16px 0;
  line-height: 1.6;
  color: var(--text-secondary, #ccc);
}

/* Ссылки внутри текста */
.cards-container.history-cards a {
  color: var(--accent-color, #ff5555);
  text-decoration: underline;
  font-weight: 600;
}

/* Стрелки слайдера (если они есть) */
.cards-container.history-cards .glide__arrows button {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.cards-container.history-cards .glide__arrows button:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* Точки-индикаторы */
.cards-container.history-cards .glide__bullets button {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  border-radius: 50%;
  margin: 0 4px;
  cursor: pointer;
}

.cards-container.history-cards .glide__bullets button[aria-selected="true"] {
  background: var(--accent-color, #ff5555);
}

/* --- Аудиоплеер (гимн) --- */
.anthem audio {
  width: 100%;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

/* --- SoundCloud плеер --- */
.soundcloud iframe {
  width: 100% !important;
  height: 300px !important;
  border-radius: 12px;
  border: none;
}

/* --- Адаптив: на мобильных карточки во всю ширину --- */
@media (max-width: 768px) {
  .cards-container.history-cards {
    max-width: 100%;
    padding: 16px;
  }
}

/* Ограничиваем слайдер шириной карточки в истории */
.cards-container.history-cards .glide {
  max-width: 700px;
  margin: 16px auto;
}


/* ============================================================
   WinUI 3 / Fluent Media Player
   ============================================================ */

.winui-player {
  width: min(900px, 100%);
  margin: 18px auto 8px;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--acrylic-border);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025)),
    var(--acrylic-strong);
  backdrop-filter: blur(32px) saturate(140%);
  -webkit-backdrop-filter: blur(32px) saturate(140%);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  text-align: left;
}

.winui-player-main {
  min-height: 116px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  box-sizing: border-box;
}

.winui-album-art {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: white;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.28), transparent 35%),
    linear-gradient(135deg, var(--accent), #7c3aed);
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
}

.winui-album-art svg {
  width: 42px;
  height: 42px;
}

.winui-track-info {
  min-width: 0;
}

.winui-track-title {
  font-size: 16px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winui-track-artist {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-secondary);
}

.winui-progress-wrap {
  margin-top: 14px;
}

.winui-progress,
.winui-volume-range {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 99px;
  outline: none;
  cursor: pointer;
  background:
    linear-gradient(to right, var(--accent) 0 var(--progress, 0%), rgba(255,255,255,.16) var(--progress, 0%) 100%);
}

.winui-progress::-webkit-slider-thumb,
.winui-volume-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border: 2px solid var(--mica-bg);
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
}

.winui-progress:hover::-webkit-slider-thumb,
.winui-volume-range:hover::-webkit-slider-thumb,
.winui-progress:focus-visible::-webkit-slider-thumb,
.winui-volume-range:focus-visible::-webkit-slider-thumb {
  opacity: 1;
}

.winui-progress::-moz-range-thumb,
.winui-volume-range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid var(--mica-bg);
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
}

.winui-progress:hover::-moz-range-thumb,
.winui-volume-range:hover::-moz-range-thumb,
.winui-progress:focus-visible::-moz-range-thumb,
.winui-volume-range:focus-visible::-moz-range-thumb {
  opacity: 1;
}

.winui-time {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

.winui-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.winui-icon-btn,
.winui-play-btn {
  border: 0;
  cursor: pointer;
  color: var(--text-primary);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, transform .1s ease;
}

.winui-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  font-size: 20px;
}

.winui-icon-btn:hover {
  background: rgba(255,255,255,.07);
}

.winui-icon-btn:active,
.winui-play-btn:active {
  transform: scale(.94);
}

.winui-icon-btn svg {
  width: 19px;
  height: 19px;
}

.winui-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
}

.winui-play-btn:hover {
  background: var(--accent-hover);
}

.winui-play-icon,
.winui-pause-icon {
  width: 22px;
  height: 22px;
}

.winui-pause-icon {
  display: none;
}

.winui-player.is-playing .winui-play-icon {
  display: none;
}

.winui-player.is-playing .winui-pause-icon {
  display: block;
}

.winui-volume {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 105px;
}

.winui-volume-range {
  width: 70px;
  background:
    linear-gradient(to right, var(--accent) 0 var(--volume, 100%), rgba(255,255,255,.16) var(--volume, 100%) 100%);
}

.winui-volume .winui-icon-btn.is-muted {
  color: var(--text-tertiary);
}

@media (max-width: 700px) {
  .winui-player-main {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px;
  }

  .winui-album-art {
    width: 56px;
    height: 56px;
  }

  .winui-album-art svg {
    width: 34px;
    height: 34px;
  }

  .winui-controls {
    grid-column: 2 / 4;
    justify-content: center;
    margin-top: 2px;
  }

  .winui-volume {
    grid-column: 1 / 4;
    width: 100%;
  }

  .winui-volume-range {
    flex: 1;
    width: auto;
  }
}

@media (max-width: 420px) {
  .winui-player-main {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
  }

  .winui-album-art {
    width: 48px;
    height: 48px;
  }

  .winui-album-art svg {
    width: 29px;
    height: 29px;
  }

  .winui-controls {
    grid-column: 1 / 3;
  }

  .winui-volume {
    grid-column: 1 / 3;
  }

  .winui-track-title {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .winui-icon-btn,
  .winui-play-btn,
  .winui-progress::-webkit-slider-thumb,
  .winui-volume-range::-webkit-slider-thumb {
    transition: none;
  }
}


/* Windows 11 Media Player inspired cover treatment */
.winui-player {
  border-radius: 16px;
  background:
    radial-gradient(circle at 10% 0%, rgba(111, 111, 255, .16), transparent 34%),
    radial-gradient(circle at 92% 100%, rgba(0, 120, 212, .14), transparent 38%),
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.025)),
    var(--acrylic-strong);
  border-color: rgba(255,255,255,.12);
}

.winui-player-main {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
}

.winui-album-art {
  position: relative;
  width: 92px;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0,0,0,.30);
}

.winui-cover-glow {
  position: absolute;
  inset: -22px;
  background: conic-gradient(from 120deg, #7f72ff, #00a2ff, #5a42c7, #7f72ff);
  filter: blur(20px);
  opacity: .7;
}

.winui-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(145deg, rgba(255,255,255,.22), rgba(255,255,255,.02)),
    linear-gradient(135deg, #5146b9 0%, #236bb8 55%, #171a36 100%);
  border: 1px solid rgba(255,255,255,.18);
}

.winui-cover-symbol {
  font-size: 39px;
  line-height: .9;
  font-weight: 800;
  letter-spacing: -3px;
  color: #fff;
  text-shadow: 0 3px 16px rgba(0,0,0,.28);
}

.winui-cover-title {
  margin-top: 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: rgba(255,255,255,.94);
}

.winui-cover-subtitle {
  margin-top: 3px;
  font-size: 7px;
  letter-spacing: 2px;
  color: rgba(255,255,255,.62);
}

.winui-track-kicker {
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--text-tertiary);
}

.winui-track-title {
  font-size: 17px;
  font-weight: 650;
}

.winui-track-artist {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 13px;
}

.winui-progress-wrap {
  margin-top: 12px;
}

@media (max-width: 700px) {
  .winui-player-main {
    grid-template-columns: 68px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px;
  }

  .winui-album-art {
    width: 68px;
    border-radius: 8px;
  }

  .winui-cover-symbol { font-size: 30px; }
  .winui-cover-title { font-size: 7px; letter-spacing: 1.2px; }
  .winui-cover-subtitle { font-size: 6px; }

  .winui-track-title { font-size: 15px; }
  .winui-volume { display: none; }

  .winui-controls {
    gap: 4px;
  }

  .winui-icon-btn {
    width: 34px;
    height: 34px;
  }

  .winui-play-btn {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 420px) {
  .winui-player-main {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .winui-album-art {
    width: 58px;
  }

  .winui-controls {
    grid-column: 1 / -1;
    justify-content: center;
    margin-top: 2px;
  }

  .winui-track-kicker {
    font-size: 9px;
  }
}


/* Reliable Glide layout */
.glide { position: relative; width: 100%; }
.glide__track { overflow: hidden; }
.glide__slides { display: flex; flex-wrap: nowrap; overflow: visible; margin: 0; padding: 0; list-style: none; }
.glide__slide { flex-shrink: 0; width: 100%; }
.glide__slide img { display: block; width: 100%; height: auto; }

/* ============================================================
   WinUI 3 / Windows 11 Media Player — playlist
   ============================================================ */

.winui-playlist {
  width: min(900px, 100%);
  margin: 10px auto 24px;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--acrylic-border);
  border-radius: 14px;
  background: var(--acrylic);
  backdrop-filter: blur(28px) saturate(135%);
  -webkit-backdrop-filter: blur(28px) saturate(135%);
  color: var(--text-primary);
}

.winui-playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 9px 14px 9px 16px;
  box-sizing: border-box;
}

.winui-playlist-title {
  font-size: 16px;
  line-height: 20px;
  font-weight: 650;
}

.winui-playlist-subtitle {
  margin-top: 2px;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-tertiary);
}

.winui-playlist-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.winui-playlist-toggle:hover {
  background: rgba(255,255,255,.07);
  color: var(--text-primary);
}

.winui-playlist-toggle:active {
  background: rgba(255,255,255,.11);
}

.winui-playlist-items {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 330px;
  overflow-y: auto;
  border-top: 1px solid rgba(255,255,255,.06);
}

.winui-playlist-item {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 7px 14px;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.045);
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .12s ease;
}

.winui-playlist-item:last-child {
  border-bottom: 0;
}

.winui-playlist-item:hover {
  background: rgba(255,255,255,.055);
}

.winui-playlist-item:active {
  background: rgba(255,255,255,.085);
}

.winui-playlist-item:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.winui-playlist-item.is-current {
  background: var(--accent-soft);
}

.winui-item-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.winui-playlist-item.is-current .winui-item-number {
  color: var(--accent);
}

.winui-item-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.winui-item-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}

.winui-item-artist {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 15px;
  color: var(--text-tertiary);
}

.winui-item-duration {
  min-width: 42px;
  margin-left: 12px;
  color: var(--text-tertiary);
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.winui-playlist.is-collapsed .winui-playlist-items {
  display: none;
}

@media (max-width: 700px) {
  .winui-playlist {
    margin-top: 8px;
    border-radius: 12px;
  }

  .winui-playlist-header {
    min-height: 54px;
    padding: 8px 10px 8px 12px;
  }

  .winui-playlist-item {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    min-height: 50px;
    padding: 7px 10px;
  }

  .winui-item-number {
    width: 26px;
  }

  .winui-item-duration {
    margin-left: 8px;
  }
}

@media (max-width: 420px) {
  .winui-playlist-item {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    padding-left: 8px;
    padding-right: 8px;
  }

  .winui-item-number {
    width: 24px;
  }
}

/* ===== WinUI 3 ContentDialog ===== */
.wui-overlay {
  --wui-accent: #6366f1;
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.15s ease;
  font-family: 'Segoe UI Variable', 'Segoe UI', 'Inter', sans-serif;
}

.wui-overlay.open {
  opacity: 1;
}

.wui-dialog {
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: #2c2c2c;
  color: #fff;
  border: 1px solid #454545;
  border-radius: 8px;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.37), 0 2px 21px rgba(0, 0, 0, 0.37);
  overflow: hidden;
  transform: scale(0.97);
  transition: transform 0.15s ease;
}

.wui-overlay.open .wui-dialog {
  transform: scale(1);
}

.wui-body {
  padding: 24px;
  overflow-y: auto;
}

.wui-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.wui-text {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 20px;
  color: rgba(255, 255, 255, 0.79);
}

/* кнопки */
.wui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  padding: 5px 12px 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top-color: rgba(255, 255, 255, 0.09);
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.1s ease;
}

.wui-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.wui-btn:active {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.78);
}

.wui-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.wui-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.wui-btn-wide {
  width: 100%;
}

.wui-btn-accent {
  background: var(--wui-accent);
  border-color: rgba(255, 255, 255, 0.08);
  border-bottom-color: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.wui-btn-accent:hover {
  background: color-mix(in srgb, var(--wui-accent) 90%, #fff);
}

.wui-btn-accent:active {
  background: color-mix(in srgb, var(--wui-accent) 80%, #000);
  color: rgba(255, 255, 255, 0.8);
}

/* разделитель */
.wui-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.54);
}

.wui-divider::before,
.wui-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* переключатель в духе SelectorBar */
.wui-segmented {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}

.wui-segmented button {
  position: relative;
  padding: 6px 12px 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border: none;
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.wui-segmented button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.wui-segmented button.active {
  color: #fff;
}

.wui-segmented button.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 16px;
  height: 3px;
  margin-left: -8px;
  background: var(--wui-accent);
  border-radius: 2px;
}

/* поля ввода (TextBox) */
.wui-field {
  display: block;
  margin-bottom: 12px;
}

.wui-field[hidden],
.wui-error[hidden] {
  display: none;
}

.wui-field span {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.79);
}

.wui-field input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-color: rgba(255, 255, 255, 0.54);
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: background 0.1s ease;
}

.wui-field input:hover {
  background: rgba(255, 255, 255, 0.08);
}

.wui-field input:focus {
  background: #1f1f1f;
  border-bottom-color: var(--wui-accent);
  box-shadow: inset 0 -1px 0 var(--wui-accent);
}

/* сообщение об ошибке (InfoBar) */
.wui-error {
  margin-top: 4px;
  padding: 8px 12px;
  background: rgba(255, 99, 99, 0.12);
  border: 1px solid rgba(255, 99, 99, 0.3);
  border-radius: 4px;
  font-size: 13px;
  line-height: 18px;
  color: #ff9a9a;
}

/* нижняя панель с кнопками */
.wui-footer {
  display: flex;
  gap: 8px;
  padding: 24px;
  background: #202020;
  border-top: 1px solid #1d1d1d;
}

.wui-footer .wui-btn {
  flex: 1;
}

@media (prefers-reduced-motion: reduce) {
  .wui-overlay,
  .wui-dialog {
    transition: none;
  }
}

/* ===== WinUI 3: опросы ===== */
.wui-poll,
.wui-expander {
  margin: 16px 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-family: 'Segoe UI Variable', 'Segoe UI', 'Inter', sans-serif;
  color: #fff;
}

.wui-poll {
  padding: 16px;
}

.wui-poll-question {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  word-break: break-word;
}

/* варианты строго друг под другом */
.wui-poll-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* --- RadioButton --- */
.wui-radio {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.1s ease;
}

.wui-radio:hover {
  background: rgba(255, 255, 255, 0.06);
}

.wui-radio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wui-radio-dot {
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  transition: background 0.1s ease, border-color 0.1s ease;
}

.wui-radio-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: #fff;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.12s ease;
}

.wui-radio:hover .wui-radio-dot {
  background: rgba(255, 255, 255, 0.1);
}

.wui-radio input:checked + .wui-radio-dot {
  background: var(--wui-accent);
  border-color: var(--wui-accent);
}

.wui-radio input:checked + .wui-radio-dot::after {
  transform: scale(1);
}

.wui-radio input:focus-visible + .wui-radio-dot {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.wui-radio-label {
  word-break: break-word;
}

/* --- нижняя строка --- */
.wui-poll-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.wui-poll-total {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.54);
}

/* --- результаты --- */
.wui-poll-result {
  padding: 6px 10px 8px;
}

.wui-poll-result-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 14px;
}

.wui-poll-result-name {
  word-break: break-word;
}

.wui-poll-result-value {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
}

.wui-poll-result.chosen .wui-poll-result-name {
  font-weight: 600;
}

/* --- ProgressBar --- */
.wui-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.wui-progress-bar {
  height: 100%;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.wui-poll-result.chosen .wui-progress-bar {
  background: var(--wui-accent);
}

/* --- Expander (создание опроса) --- */
.wui-expander summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 14px;
  list-style: none;
  cursor: pointer;
  border-radius: 8px;
}

.wui-expander summary::-webkit-details-marker {
  display: none;
}

.wui-expander summary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.wui-chevron {
  transition: transform 0.15s ease;
}

.wui-expander[open] .wui-chevron {
  transform: rotate(180deg);
}

.wui-expander-body {
  padding: 4px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.wui-poll-actions {
  display: flex;
  gap: 8px;
}

.wui-poll-actions .wui-btn-accent {
  flex: 1;
}

/* ===== Упоминания ===== */
.mention {
  padding: 0 4px;
  background: rgba(138, 180, 255, 0.14);
  color: #8ab4ff;
  border-radius: 4px;
  font-weight: 600;
}

.mention-me {
  background: rgba(255, 196, 0, 0.18);
  color: #ffd666;
}

.mention-popup {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 60;
  padding: 4px;
  background: #2c2c2c;
  border: 1px solid #454545;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-family: 'Segoe UI Variable', 'Segoe UI', 'Inter', sans-serif;
}

.mention-popup[hidden] {
  display: none;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
}

.mention-item:hover,
.mention-item.active {
  background: rgba(255, 255, 255, 0.08);
}

/* ===== Колокольчик и уведомления ===== */
.header-user {
  gap: 8px;
}

.header-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  cursor: pointer;
}

.header-bell:hover {
  background: rgba(255, 255, 255, 0.12);
}

.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  box-sizing: border-box;
  background: #c42b1c;
  color: #fff;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.notif-badge[hidden] {
  display: none;
}

.notif-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 100;
  width: 340px;
  max-width: calc(100vw - 24px);
  max-height: 420px;
  overflow-y: auto;
  background: #2c2c2c;
  color: #fff;
  border: 1px solid #454545;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  font-family: 'Segoe UI Variable', 'Segoe UI', 'Inter', sans-serif;
}

.header-user.open-notif .notif-menu {
  display: block;
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.notif-head button {
  padding: 4px 8px;
  background: transparent;
  color: #8ab4ff;
  border: none;
  border-radius: 4px;
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}

.notif-head button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.notif-empty {
  padding: 24px 14px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.54);
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  color: inherit;
  border: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.notif-item.unread {
  background: rgba(99, 102, 241, 0.14);
}

.notif-item.unread:hover {
  background: rgba(99, 102, 241, 0.22);
}

.notif-body {
  min-width: 0;
}

.notif-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.notif-excerpt {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.notif-time {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

/* ===== Тост (InfoBar) ===== */
.wui-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1100;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  background: #2c2c2c;
  color: #fff;
  border: 1px solid #454545;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-family: 'Segoe UI Variable', 'Segoe UI', 'Inter', sans-serif;
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.wui-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ===== Профили ===== */
.clickable {
  cursor: pointer;
}

.avatar.clickable:hover {
  opacity: 0.85;
}

.post-meta b.clickable:hover {
  text-decoration: underline;
}

.prof-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.prof-names {
  min-width: 0;
}

.prof-names .wui-title {
  margin: 0;
  word-break: break-word;
}

.prof-since {
  margin-top: 2px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.54);
}

.prof-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.prof-stats > div {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.prof-stats b {
  display: block;
  font-size: 22px;
  font-weight: 600;
  line-height: 28px;
}

.prof-stats span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.prof-bio {
  font-size: 14px;
  line-height: 20px;
  white-space: pre-wrap;
  word-break: break-word;
}

.prof-bio-empty {
  color: rgba(255, 255, 255, 0.45);
}

.prof-hint {
  margin: -4px 0 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* textarea в стиле WinUI TextBox (рядом с .wui-field input) */
.wui-field textarea {
  width: 100%;
  min-height: 72px;
  padding: 8px 10px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-color: rgba(255, 255, 255, 0.54);
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
  resize: vertical;
  outline: none;
}

.wui-field textarea:focus {
  background: #1f1f1f;
  border-bottom-color: var(--wui-accent);
  box-shadow: inset 0 -1px 0 var(--wui-accent);
}

/* ===== Вложения ===== */
.input-wrapper textarea {
  padding-right: 108px; /* место под две кнопки */
}

.input-wrapper #attachBtn {
  right: 58px;
  background: transparent;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.input-wrapper #attachBtn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.attach-preview:empty {
  display: none;
}

.att-tile {
  position: relative;
  width: 84px;
  height: 84px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.att-tile img,
.att-tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.att-tile.error {
  border-color: #c42b1c;
}

.att-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
}

.att-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.5);
}

.att-bar {
  height: 100%;
  background: #6366f1;
  transition: width 0.15s ease;
}

.att-error {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 0;
  background: rgba(196, 43, 28, 0.9);
  color: #fff;
  font-size: 11px;
  text-align: center;
}

.att-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.att-remove:hover {
  background: rgba(0, 0, 0, 0.85);
}

/* вложения в посте */
.post-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.post-attachments img,
.post-attachments video {
  display: block;
  max-width: 100%;
  max-height: 360px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.post-attachments img {
  cursor: zoom-in;
}

/* полноэкранный просмотр */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}
