/* Shelfiles — редизайн, mobile-first, адаптив.
   Палитра из логотипа: фиолетовый #7f007f, синий #007fff, оранжевый #ffaa56. */

:root {
    --bg:        #16131f;
    --bg-2:      #1e1a2b;
    --card:      #221d33;
    --card-2:    #2a2340;
    --border:    #362d4f;
    --text:      #ece8f5;
    --muted:     #a79fc2;
    --purple:    #a020c0;
    --purple-2:  #7f007f;
    --blue:      #2f95ff;
    --orange:    #ffaa56;
    --radius:    14px;
    --maxw:      1100px;
    --shadow:    0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
.muted { color: var(--muted); }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Header / nav ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(22,19,31,.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 1.15rem;
}
.brand:hover { text-decoration: none; }

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}
.site-nav a {
    color: var(--text);
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 500;
}
.site-nav a:hover { background: var(--card-2); text-decoration: none; }
.site-nav a.active { color: var(--orange); }
.lang-switch {
    border: 1px solid var(--border);
    color: var(--muted) !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle span {
    width: 24px; height: 2px;
    background: var(--text);
    transition: .25s;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .12s ease, background .2s, box-shadow .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: #fff;
    box-shadow: 0 8px 20px rgba(47,149,255,.25);
}
.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn-ghost:hover { background: var(--card-2); }

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(900px 400px at 80% -10%, rgba(160,32,192,.25), transparent),
        radial-gradient(700px 400px at 0% 10%, rgba(47,149,255,.18), transparent);
    padding: 56px 0;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: center;
}
.hero-text h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
.hero-sub { font-size: 1.1rem; color: var(--muted); max-width: 44ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 16px; }
.hero-latest { font-size: .95rem; }
.hero-shot img {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    width: 100%;
}

/* ---------- Features ---------- */
.features { padding: 56px 0; }
.features h2 { font-size: 1.8rem; text-align: center; margin-bottom: 32px; }
.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: transform .15s, border-color .2s;
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--purple); }
.feature-icon { font-size: 1.8rem; margin-bottom: 10px; }
.feature-card h3 { font-size: 1.1rem; }
.feature-card p { color: var(--muted); margin: 0; font-size: .95rem; }

/* ---------- Generic page ---------- */
.page { padding: 48px 0; min-height: 60vh; }
.page h1 { font-size: 2rem; }

/* ---------- Download ---------- */
.release-list {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}
.release-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
}
.release-meta { display: flex; flex-direction: column; gap: 2px; }
.release-version { font-size: 1.3rem; font-weight: 700; color: var(--orange); }
.release-os { font-weight: 500; }

/* ---------- Screenshots ---------- */
.shot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 28px;
}
.shot {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card);
    transition: transform .15s, border-color .2s;
}
.shot:hover { transform: scale(1.02); border-color: var(--blue); }
.shot img { width: 100%; }

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 100;
}
.lightbox img { max-width: 95vw; max-height: 90vh; border-radius: 8px; }
.lightbox-close {
    position: absolute;
    top: 16px; right: 24px;
    font-size: 2.4rem;
    background: none; border: 0; color: #fff; cursor: pointer;
    line-height: 1;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    color: var(--muted);
    text-align: center;
    background: var(--bg-2);
}

/* ---------- Admin ---------- */
.admin-body { background: var(--bg); }
.admin-wrap { padding: 40px 20px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-section { margin-top: 32px; }
.login-card {
    max-width: 360px;
    margin: 8vh auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); }
.login-card input {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--text);
}
.form-error { color: #ff7a7a; margin: 0; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.data-table thead th { color: var(--muted); font-weight: 600; }
.data-table tfoot th { color: var(--orange); }
.data-table .ua { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .85rem; }
.table-scroll { overflow-x: auto; }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .hero-inner { grid-template-columns: 1.05fr 1fr; }
    .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .site-nav {
        position: absolute;
        top: 64px; left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--bg-2);
        border-bottom: 1px solid var(--border);
        padding: 12px 20px;
        gap: 4px;
        display: none;
    }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 12px 14px; }
    .lang-switch { text-align: center; margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto; }
}

/* Лайтбокс скрыт, пока не открыт (перебивает display:flex у .lightbox) */
.lightbox[hidden] { display: none; }

/* ---------- Карусель: стрелки и счётчик ---------- */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.10);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 2;
}
.lightbox-nav:hover { background: rgba(255,255,255,.25); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-counter {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: .95rem;
    background: rgba(0,0,0,.45);
    padding: 6px 16px;
    border-radius: 999px;
    z-index: 2;
}
@media (max-width: 600px) {
    .lightbox-nav { width: 44px; height: 44px; font-size: 1.4rem; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
    .lightbox img { max-width: 100vw; }
}

/* ---------- Download: платформы и форматы ---------- */
.release-card {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}
.release-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 6px;
}
.platforms {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.platform {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.platform-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    font-weight: 600;
    font-size: 1.05rem;
}
.asset-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.asset-btn {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 16px;
}
.asset-format { font-weight: 700; }
.asset-arch { font-size: .78rem; opacity: .85; }

@media (max-width: 560px) {
    .platform { flex-direction: column; align-items: flex-start; }
    .platform-name { min-width: 0; }
    .asset-btns { width: 100%; }
}

/* ---------- OS-иконки и одинаковые кнопки ---------- */
.os-ico {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}
.asset-btn {
    min-width: 170px;
    justify-content: center;
}
@media (max-width: 560px) {
    .asset-btn { min-width: 0; width: 100%; }
}

/* ---------- Требования под кнопкой ---------- */
.asset-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.asset-req {
    font-size: .76rem;
    line-height: 1.3;
    color: var(--muted);
    text-align: center;
    max-width: 190px;
}
@media (max-width: 560px) {
    .asset-item { align-items: stretch; }
    .asset-req { text-align: left; max-width: none; }
}

/* Длинные требования: ровный ряд и перенос в ~2 строки */
.asset-btns { align-items: flex-start; }
.asset-req { max-width: 230px; }

/* ---------- Кнопки загрузки: финальная раскладка ---------- */
.asset-item {
    width: 210px;
    align-items: stretch;   /* кнопка и подпись одной ширины */
    gap: 6px;
}
.asset-btn {
    min-width: 0;
    width: 100%;
    padding: 15px 24px;     /* выше и длиннее */
}
.asset-format {
    font-weight: 700;
    font-size: 1.1rem;      /* тип (ZIP) — немного крупнее */
}
.asset-arch {
    font-size: 0.98rem;     /* вспомогательное (x64) — увеличено сильнее */
    opacity: 0.9;
}
.asset-req {
    width: 100%;
    max-width: none;
    text-align: center;
    overflow-wrap: break-word;  /* перенос вниз, не уходит вбок от кнопки */
}
@media (max-width: 560px) {
    .asset-item { width: 100%; }
}

/* ---------- Название ОС крупнее + разделитель «Предыдущие версии» ---------- */
.platform-name {
    font-size: 1.2rem;
}
.older-title {
    margin-top: 44px;
    margin-bottom: 2px;
    font-size: 1.5rem;
}

/* ---------- Кликабельный скриншот в hero ---------- */
a.hero-shot { display: block; cursor: pointer; }
a.hero-shot img { transition: transform .2s, box-shadow .2s; }
a.hero-shot:hover img {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0,0,0,.5);
}

/* ---------- Возможности: разделы ---------- */
.feature-group {
    font-size: 1.25rem;
    color: var(--orange);
    margin: 36px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.feature-group:first-of-type { margin-top: 8px; }
.feature-card h4 {
    font-size: 1.1rem;
    line-height: 1.2;
    margin: 0 0 .5em;
}

@media (min-width: 700px) {
}
