* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #333;
    color: #f4f4f4;
    line-height: 1.6;
}

.default-hr {
    margin-top: 20px;
}

.short-hr {
    margin-top: 20px;
    margin-left: 50px;
    margin-right: 50px;
}

.category-hr {
    margin-top: 20px;
    margin-bottom: 20px;
}

.header {
    display: flex;
    background: #444;
    padding: 10px 20px;
    align-items: center;
    justify-content: space-between;
}

.header h1 {
    font-size: 20px;
    margin: 0;
}

.header h1 a {
    color: #f4f4f4;
    text-decoration: none;
}

.header-right {
    text-align: right;
}

.header-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    gap: 20px;
    padding-left: 10px;
}

.view-toggle-global {
    display: flex;
    gap: 8px;
}

.content {
    flex: 1;
    padding: 20px;
}

.free-runet {
    text-align: center;
}

.vpn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.vpn-left, .vpn-right {
    flex: 0 0 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.vpn-left a, .vpn-right a {
    color: inherit;
}

.vpn-side-text {
    color: #bfbfbf;
    font-size: 14px;
}

.vpn-left img,
.vpn-right img {
    max-width: 80%;
    height: auto;
    margin-bottom: 12px;
}

.vpn-left h1,
.vpn-right h1 {
    font-size: 18px;
    margin: 8px 0 0 0;
    line-height: 1.2;
}

.vpn-center {
    flex: 0 0 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vpn video {
    max-width: 90%;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.video-credit {
    color: #7e7e7e;
    margin-top: 8px;
    font-size: 13px;
}

.video-credit a {
    color: inherit;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.cards.list-view {
    display: flex;
    flex-direction: column;
    gap: 1px;
    grid-template-columns: unset;
}

.card {
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.card:hover {
    border-color: #555;
    background: #1a1a1a;
}

.cards.list-view .card {
    border-radius: 0;
    border: 1px solid #333;
    border-bottom: none;
    background: #111;
    overflow: visible;
}

.cards.list-view .card:last-child {
    border-bottom: 1px solid #333;
}

.cards.list-view .card a {
    display: flex;
    flex-direction: row;
    height: auto;
}

.cards.list-view .card img {
    width: 200px;
    height: 120px;
    object-fit: cover;
    flex-shrink: 0;
}

.cards.list-view .card h3 {
    margin: 0;
    font-size: 16px;
}

.cards.list-view .card p {
    margin: 0;
    color: #bbb;
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content {
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.view-btn {
    background: #555;
    color: #f4f4f4;
    border: 1px solid #666;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    background: #666;
    border-color: #777;
}

.view-btn:active {
    transform: scale(0.95);
}

.view-btn.active {
    background: #6db6ff;
    color: #000;
    border-color: #6db6ff;
}

.view-toggle {
    display: flex;
    gap: 8px;
}

.sort-buttons {
    display: flex;
    gap: 8px;
}

.sort-btn {
    background: #555;
    color: #f4f4f4;
    border: 1px solid #666;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.sort-btn:hover {
    background: #666;
    border-color: #777;
}

.sort-btn:active {
    transform: scale(0.95);
}

.sort-btn.active {
    background: #6db6ff;
    color: #000;
    border-color: #6db6ff;
}

.card:hover {
    border-color: #555;
}

.card a {
    color: inherit;
    text-decoration: none;
    display: block;
    height: 100%;
}

.card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.card h3 {
    margin: 10px;
}

.card p {
    margin: 0 10px 10px;
    color: #ccc;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-info {
    padding: 10px;
    display: block;
}

.card-info h3 {
    margin: 0 0 5px 0;
}

.card-date {
    margin: 0;
    color: #999;
    font-size: 12px;
    font-weight: normal;
}

.card-content {
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.cards.list-view .card-content h3 {
    margin: 0;
    font-size: 16px;
}

.cards.list-view .card-content p,
.cards.list-view .card-info p {
    margin: 0;
    color: #bbb;
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-content {
    max-width: 900px;
    margin: 0 auto;
    font-size: 16px;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 20px 0 10px;
    line-height: 1.3;
}

.article-content p {
    margin: 10px 0;
}

.article-content a {
    color: #6db6ff;
    text-decoration: underline;
}

.article-content a:hover {
    color: #9fd0ff;
}

.article-content ul,
.article-content ol {
    margin: 10px 0 10px 25px;
}

.article-content li {
    margin: 5px 0;
}

.article-content img {
    max-width: 100%;
    height: auto !important;
    width: auto !important;
    display: block;
    margin: 15px auto;
    border-radius: 6px;
}

details.spoiler {
    margin: 15px 0;
    border: 1px solid #444;
    border-radius: 6px;
    background: #111;
}

details.spoiler summary {
    cursor: pointer;
    padding: 8px 12px;
    background: #222;
    font-weight: bold;
    user-select: none;
}

details.spoiler summary:hover {
    background: #2a2a2a;
}

details.spoiler[open] summary {
    border-bottom: 1px solid #444;
}

details.spoiler div {
    padding: 12px;
}

.article-content blockquote {
    border-left: 4px solid #666;
    padding: 10px 15px;
    margin: 15px 0;
    background: #1a1a1a;
    color: #ddd;
}

.article-content pre {
    background: #0d0d0d;
    border: 1px solid #333;
    padding: 12px;
    overflow-x: auto;
    border-radius: 6px;
    margin: 15px 0;
}

.article-content code {
    background: #222;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: monospace;
}

.footer {
    display: grid;
    background: #444;
    color: #f4f4f4;
    padding: 14px 20px;
    margin-top: auto;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.site-stat {
    grid-column: 1;
    text-align: left;
    line-height: 1.4;
}

.footer-center {
    display: grid;
    grid-column: 2;
    grid-template-rows: auto auto;
    justify-items: center;
    gap: 6px;
}

.footer-icons img {
    width: 32px;
    height: 32px;
    margin: 0 5px;
}

.footer-right {
    text-align: right;
    line-height: 1.4;
}

.footer-right a {
    color: inherit;
    text-decoration: none;
}

.footer-right a:hover {
    text-decoration: underline;
}

.messages {
    background: #ff4d4d;
    color: #fff;
    padding: 10px 20px;
    margin: 10px 20px;
    border-radius: 6px;
}

.lossless-club {
    padding-top: 20px;
    text-align: center;
}

.losslessclub-image {
    max-width: 800px;
}

.lossless-club a {
    color: inherit;
    text-decoration: none;
}

.lossless-club a:hover {
    text-decoration: underline;
}

.lossless-title {
    font-size: 28px;
}

.losslessclub-color {
    color: #ffd700;
}

.lossless-footer a {
    color: #ffd700;
    font-weight: bold;
}

.lossless-article-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 1rem;
}

.lossless-article {
    color: #ffd700;
    font-weight: bold;
    text-align: right;
    display: block;
}

@media (max-width: 768px) {
    .vpn {
        flex-direction: column;
        gap: 15px;
        padding: 12px;
    }

    .vpn-left,
    .vpn-right {
        flex: 1 1 100%;
        width: 100%;
    }

    .vpn-center {
        flex: 1 1 100%;
        width: 100%;
    }

    .header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .header h1 {
        font-size: 18px;
        margin-left: 0;
        flex: 0 0 auto;
    }

    .header-controls {
        flex: 1 1 100%;
        justify-content: space-between;
        padding-left: 0;
        gap: 10px;
    }

    .view-toggle-global {
        gap: 6px;
    }

    .view-btn {
        padding: 6px 10px;
        font-size: 14px;
        min-width: 40px;
        min-height: 40px;
    }

    .header-right {
        flex: 0 0 auto;
        text-align: center;
    }

    .header-right h1 {
        font-size: 16px;
        margin: 0;
    }

    .cards {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .vpn {
        flex-direction: column;
        gap: 8px;
        padding: 8px 0;
    }

    .vpn-left,
    .vpn-right {
        flex: none;
        max-width: 100%;
        text-align: center;
    }

    .vpn-center {
        width: 100%;
    }

    .card img {
        height: 100px;
    }

    .card h3 {
        font-size: 16px;
    }

    .card p {
        font-size: 13px;
    }

    .cards.list-view .card img {
        width: 80px;
        height: 80px;
    }

    .cards.list-view .card-content {
        padding: 8px 10px;
    }

    .article-content {
        font-size: 15px;
    }

    .article-content h1,
    .article-content h2,
    .article-content h3,
    .article-content h4 {
        margin: 12px 0 8px;
    }

    .article-content blockquote {
        padding: 6px 10px;
    }

    .article-content pre {
        padding: 8px;
    }

    .footer a img {
        width: 24px;
        height: 24px;
    }

    .losslessclub-image {
        max-width: 100%;
        height: auto;
    }

    .lossless-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 8px 10px;
    }

    .sort-btn {
        padding: 5px 8px;
        font-size: 11px;
        min-width: 38px;
        min-height: 38px;
    }

    .header h1 {
        font-size: 16px;
        margin-left: 0;
    }

    .header-controls {
        flex: 1 1 100%;
        justify-content: center;
        padding-left: 0;
    }

    .view-toggle-global {
        gap: 4px;
    }

    .view-btn {
        padding: 5px 8px;
        font-size: 13px;
        min-width: 38px;
        min-height: 38px;
    }

    .header-right {
        flex: 1 1 100%;
        text-align: center;
    }

    .header-right h1 {
        font-size: 14px;
    }

    .header-right h1 a {
        display: inline-block;
        word-break: break-word;
    }

    .cards {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .card img {
        height: 90px;
    }

    .card h3 {
        font-size: 15px;
    }

    .card p {
        font-size: 12px;
    }

    .cards.list-view .card img {
        width: 60px;
        height: 60px;
    }

    .cards.list-view .card-content {
        padding: 6px 8px;
    }

    .cards.list-view .card h3 {
        font-size: 13px;
    }

    .cards.list-view .card p {
        font-size: 11px;
    }

    .article-content {
        font-size: 14px;
    }

    .article-content h1,
    .article-content h2,
    .article-content h3,
    .article-content h4 {
        margin: 10px 0 6px;
    }

    .footer {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .site-stat {
        grid-column: 1;
        text-align: center;
        order: 2;
    }

    .footer-center {
        grid-column: 1;
        order: 1;
    }

    .footer-right {
        grid-column: 1;
        text-align: center;
        order: 3;
    }

    .header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .header h1 {
        font-size: 16px;
        flex: 0 0 auto;
    }

    .header-controls {
        flex: 1 1 100%;
        justify-content: center;
        padding-left: 0;
    }

    .view-toggle-global {
        gap: 4px;
    }

    .view-btn {
        padding: 5px 8px;
        font-size: 13px;
        min-width: 38px;
        min-height: 38px;
    }

    .header-right {
        flex: 1 1 100%;
        text-align: center;
    }

    .header-right h1 {
        font-size: 14px;
    }

    .header-right h1 a {
        display: inline-block;
        word-break: break-word;
    }
}

@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 10px;
    }

    .header h1 {
        font-size: 18px;
        flex: 0 0 auto;
    }

    .header-controls {
        flex: 1 1 100%;
        justify-content: space-between;
        padding-left: 0;
        gap: 10px;
    }

    .view-toggle-global {
        gap: 6px;
    }

    .sort-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 40px;
        min-height: 40px;
    }

    .view-btn {
        padding: 6px 10px;
        font-size: 14px;
        min-width: 40px;
        min-height: 40px;
    }

    .header-right {
        flex: 0 0 auto;
        text-align: center;
    }

    .header-right h1 {
        font-size: 16px;
        margin: 0;
    }

    .cards {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .card img {
        height: 100px;
    }

    .card h3 {
        font-size: 16px;
    }

    .card p {
        font-size: 13px;
    }

    .cards.list-view .card img {
        width: 80px;
        height: 80px;
    }

    .cards.list-view .card-content {
        padding: 8px 10px;
    }

    .article-content {
        font-size: 15px;
    }

    .article-content h1,
    .article-content h2,
    .article-content h3,
    .article-content h4 {
        margin: 12px 0 8px;
    }

    .article-content blockquote {
        padding: 6px 10px;
    }

    .article-content pre {
        padding: 8px;
    }

    .footer a img {
        width: 24px;
        height: 24px;
    }
}
