/* === PUSKAI — общий стиль для всего сайта === */
:root {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --border: #e5e7eb;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --accent: #6366f1;
    --accent-soft: rgba(99, 102, 241, 0.1);
    --success: #10b981;
    --shadow: rgba(0, 0, 0, 0.05);
    --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 80px;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }

/* === ШАПКА === */
.header {
    padding: 16px 20px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
    position: sticky; top: 0; z-index: 10;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px var(--shadow);
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.logo-wrap {
    display: inline-flex; align-items: center;
    padding: 8px 16px; border-radius: 12px;
    background: linear-gradient(135deg, #eef2ff 0%, #fdf4ff 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
    font-size: 1.25rem; font-weight: 800; letter-spacing: -0.3px;
    line-height: 1; text-decoration: none;
}
.logo-text {
    background-image: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: #6366f1;
}
.tagline { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

/* === ЗАГОЛОВОК СТРАНИЦЫ === */
.page-header { padding: 20px 20px 12px; }
.page-header h1 {
    font-size: 1.5rem; font-weight: 700;
    color: var(--text); line-height: 1.25; margin: 0;
}

/* === КАРТОЧКИ ПАПОК И ФАЙЛОВ === */
.menu1 {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 14px 16px !important;
    margin: 0 20px 8px !important;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s;
    box-shadow: 0 1px 2px var(--shadow);
    font-size: 0.9rem;
}
.menu1:active { transform: scale(0.99); background: var(--surface-2); }
.menu1 img { border-radius: 8px; flex-shrink: 0; }
.menu1 a { color: var(--accent); }
.menu1 table { width: 100%; border-collapse: collapse; }
.menu1 table td {
    vertical-align: middle; padding: 0 4px;
    font-size: 0.9rem; color: var(--text);
}
.menu1 table td:first-child { width: 76px; }

.item-name {
    flex: 1; min-width: 0;
    font-weight: 500; color: var(--text);
    overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap;
}
.item-count {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    background: var(--surface-2);
    padding: 3px 8px;
    border-radius: 8px;
}
.item-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 4px;
}
.item-info .item-name { white-space: normal; font-size: 0.9rem; }
.item-meta { font-size: 0.75rem; color: var(--text-muted); }

.imgPicture {
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); border-radius: 8px;
    overflow: hidden;
}
.imgPicture img { width: 100%; height: 100%; object-fit: cover; }

.wrapper, .wrapper2 { display: contents; }

/* === ЗАГОЛОВКИ-РАЗДЕЛИТЕЛИ === */
.razdel {
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 1.2px; padding: 12px 20px 8px;
    background: none; border: none;
}
.title {
    background: none; border: none;
    color: var(--text); padding: 12px 20px;
    font-weight: 600; font-size: 1rem;
}
.title h1 { font-size: 1.25rem; font-weight: 700; margin: 0; }
.title b { color: var(--text); }
.title a { color: var(--accent); }

/* === НАВИГАЦИЯ / СОРТИРОВКА / ХЛЕБНЫЕ КРОШКИ === */
.navi {
    background: transparent; border: none;
    padding: 12px 20px; font-weight: normal;
    display: flex; flex-wrap: wrap; gap: 6px;
    justify-content: center; align-items: center;
}
.navi a, .navi .button_blue {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 14px; border-radius: 10px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border);
    font-size: 0.85rem; font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}
.navi a:active, .navi .button_blue:active {
    transform: scale(0.97); background: var(--surface-2);
}
.navi .active, .navi .button_blue.active {
    background: var(--accent); color: #fff;
    border-color: var(--accent); font-weight: 600;
}

/* === ПАГИНАЦИЯ === */
.pagination {
    display: flex; flex-wrap: wrap; gap: 6px;
    justify-content: center; align-items: center;
    padding: 20px; margin-bottom: 20px;
}
.pagination a, .pagination-current {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 10px;
    border-radius: 10px; font-size: 0.85rem; font-weight: 500;
    text-decoration: none; transition: all 0.15s;
}
.pagination a {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border);
}
.pagination a:active { transform: scale(0.95); background: var(--surface-2); }
.pagination-current {
    background: var(--accent); color: #fff;
    border: 1px solid var(--accent); font-weight: 600;
}

/* === СТРАНИЦА ПРОСМОТРА ФАЙЛА (view.php) === */
.file-view {
    margin: 0 20px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 1px 2px var(--shadow);
}
.file-view-media {
    display: block;
    text-align: center;
    margin-bottom: 16px;
    overflow: hidden;
    border-radius: 10px;
}
.file-view-media img {
    display: block;
    max-width: 100%;
    height: auto !important;
    margin: 0 auto;
    border-radius: 10px;
}
.file-view-media .player,
.file-view-media #playv {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
}
.file-view-media iframe,
.file-view-media video,
.file-view-media object,
.file-view-media embed {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 10px;
}
.file-view-media .audio-player,
.file-view-media #aplayer {
    width: 100% !important;
    max-width: 320px;
    height: 35px;
    margin: 12px auto 0;
    display: block;
}
.file-view-info {
    display: flex; flex-direction: column; gap: 8px;
}
.file-view-title {
    font-size: 1rem; font-weight: 600;
    color: var(--text); line-height: 1.4;
}
.file-view-desc {
    font-size: 0.9rem; color: var(--text-muted);
    line-height: 1.5;
}
.file-view-meta {
    font-size: 0.85rem; color: var(--text-muted);
}
.meta-label { font-weight: 600; color: var(--text); }

/* === БЛОК СКАЧИВАНИЯ === */
.download-block {
    margin: 0 20px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 1px 2px var(--shadow);
}
.download-title {
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 1px; margin-bottom: 12px;
}
.download-links { display: flex; flex-wrap: wrap; gap: 8px; }
.button_dwl {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 18px;
    background: var(--accent); color: #fff !important;
    border-radius: 10px; font-weight: 600;
    font-size: 0.9rem; text-decoration: none;
    transition: all 0.15s;
    box-shadow: 0 1px 2px var(--shadow);
}
.button_dwl:active { transform: scale(0.97); background: #4f52d8; }
.download-block hr,
.navi hr { display: none; }

/* === КАРТОЧКИ АНЕКДОТОВ / ЦИТАТ === */
.joke-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin: 0 20px 12px;
    box-shadow: 0 1px 2px var(--shadow);
}
.joke-date {
    font-size: 0.75rem; color: var(--text-muted);
    margin-bottom: 8px; font-weight: 500;
}
.joke-text {
    font-size: 0.95rem; color: var(--text);
    line-height: 1.6; word-wrap: break-word;
}

/* === ФУТЕР === */
.footer {
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 24px 20px; margin-bottom: 80px;
}
.footer-links {
    display: flex; flex-wrap: wrap; gap: 10px 18px;
    justify-content: center; margin-bottom: 16px;
}
.footer-links a {
    color: var(--text-muted); font-size: 0.85rem;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy {
    text-align: center; font-size: 0.75rem;
    color: var(--text-muted); margin-bottom: 16px;
}
.footer-counters {
    display: flex; justify-content: center; gap: 12px;
    flex-wrap: wrap; align-items: center;
}

/* === НИЖНЯЯ НАВИГАЦИЯ === */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-around;
    padding: 8px 0 12px; z-index: 100;
    box-shadow: 0 -2px 8px var(--shadow);
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    text-decoration: none; color: var(--text-muted);
    font-size: 0.65rem; font-weight: 500; padding: 6px 16px;
    transition: color 0.2s;
}
.nav-item.active { color: var(--accent); }
.nav-item svg {
    width: 22px; height: 22px; fill: none;
    stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}

/* === ПРОЧЕЕ === */
.fon {
    padding: 20px; text-align: center;
    font-size: 0.9rem; color: var(--text-muted);
}
.rekl {
    margin: 12px 20px; padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
p { padding: 0 20px 12px; margin: 0; color: var(--text); }

/* === АДАПТИВ === */
@media (min-width: 768px) {
    body {
        max-width: 480px; margin: 0 auto;
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
    .bottom-nav {
        max-width: 480px; left: 50%;
        transform: translateX(-50%);
    }
}
.bottom-nav .nav-item {
    min-width: 0;
    flex: 1;
    text-align: center;
}
.bottom-nav .nav-item svg {
    flex-shrink: 0;
}
.bottom-nav .nav-item {
    font-size: 0.6rem;
    padding: 6px 6px;
}
@media (min-width: 400px) {
    .bottom-nav .nav-item {
        font-size: 0.65rem;
        padding: 6px 10px;
    }
}
/* === ФОРМА ПОИСКА МУЗЫКИ === */
.search-music-form {
    display: flex;
    gap: 8px;
    padding: 0 20px 16px;
    align-items: stretch;
}
.search-music-form input[type="text"] {
    flex: 1;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
    box-shadow: 0 1px 2px var(--shadow);
    min-width: 0;
}
.search-music-form input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.search-music-form button[type="submit"] {
    padding: 0 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 1px 2px var(--shadow);
    white-space: nowrap;
}
.search-music-form button[type="submit"]:active {
    transform: scale(0.97);
    background: #4f52d8;
}

/* === ЗАГОЛОВОК РАЗДЕЛА (аналог .razdel без картинки) === */
.razdel {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 12px 20px 8px;
    background: none;
    border: none;
}

/* === СЧЁТЧИКИ / МЕТКИ === */
.hit {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    background: var(--surface-2);
    padding: 3px 8px;
    border-radius: 8px;
}

/* === СТАРЫЕ КЛАССЫ (совместимость) === */
.link {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 14px 16px !important;
    margin: 0 20px 8px !important;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s;
    box-shadow: 0 1px 2px var(--shadow);
    font-size: 0.9rem;
}
.link:active { transform: scale(0.99); background: var(--surface-2); }
.link img { border-radius: 8px; flex-shrink: 0; }
.link table { width: 100%; border-collapse: collapse; }
.link table td { vertical-align: middle; padding: 0 4px; font-size: 0.9rem; color: var(--text); }
.c_date { font-size: 0.75rem; color: var(--text-muted); margin-left: 6px; }
/* === ТЕКСТОВЫЕ СТРАНИЦЫ (info, agreement, users) === */
.text-page {
    margin: 0 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 1px 2px var(--shadow);
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.7;
}
.text-page p { margin: 0 0 14px; padding: 0; }
.text-page p:last-child { margin-bottom: 0; }
.text-page a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.text-page a:hover { border-bottom-color: var(--accent); }
.text-page strong { color: var(--text); font-weight: 600; }

.text-page h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 20px 0 12px;
    padding: 0;
    line-height: 1.3;
}
.text-page h2:first-child { margin-top: 0; }

.text-warning {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid #ef4444;
    padding: 12px 14px !important;
    border-radius: 8px;
    color: #991b1b;
}
.text-warning strong { color: #991b1b; }

/* FAQ */
.faq {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}
.faq-item {
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.faq-q {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    font-size: 0.95rem;
}
.faq-a {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}
.faq-a a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }

/* Список ссылок */
.text-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.text-links li { padding: 0; }
.text-links a {
    display: inline-block;
    padding: 8px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
}
.text-links a:active {
    transform: scale(0.97);
    background: var(--surface-2);
}
