:root {
    color-scheme: light;
    font-family: Arial, Helvetica, sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html {
    background: #f3f3f3;
}

body {
    margin: 0;
    color: #111;
    background: #f3f3f3;
}

a {
    color: inherit;
}

.wrapper {
    width: min(1280px, calc(100% - 20px));
    margin: 0 auto;
}

.site-header {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(320px, 1fr);
    align-items: center;
    min-height: 112px;
    padding: 8px 0;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 96px;
}

.brand img {
    display: block;
    width: 300px;
    height: 60px;
    max-width: 100%;
    object-fit: contain;
}

.site-heading {
    padding: 8px 24px;
    text-align: center;
}

.site-heading h1 {
    margin: 0 0 7px;
    font-size: 24px;
    line-height: 1.15;
    letter-spacing: 0;
}

.site-heading p {
    max-width: 540px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.45;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    margin-bottom: 10px;
    padding: 10px 8px;
    color: #fff;
    background: #020304;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.main-nav > a,
.live-nav-item {
    padding: 2px 10px;
}

.main-nav a {
    text-decoration: none;
}

.main-nav > * + * {
    border-left: 1px solid #666;
}

.live-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.online-dot {
    display: inline-block;
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    background: #26d65c;
    border: 1px solid #0d9134;
    border-radius: 50%;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    color: #ffdf1c;
    text-decoration: underline;
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.site-card {
    position: relative;
    min-width: 0;
    height: 60px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #000;
    border-radius: 6px;
}

.site-card.featured {
    background: #00ff90;
}

.site-card:hover,
.site-card:focus-within {
    background: #eee;
}

.site-link {
    display: flex;
    align-items: center;
    width: calc(100% - 98px);
    height: 100%;
    min-width: 0;
    padding: 7px 4px;
    color: #000;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none;
}

.site-link:hover .site-name,
.site-link:focus-visible .site-name {
    text-decoration: underline;
}

.site-icon,
.site-favicon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

.site-favicon {
    display: block;
    object-fit: contain;
}

.site-icon {
    background-image: url('/assets/sprite.webp');
    background-repeat: no-repeat;
}

.site-name {
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.category-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 50px;
    padding: 4px;
    color: #000;
    background: linear-gradient(to left top, #ffdf1c 0%, #fff 100%);
    border: 1px solid #d00000;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-decoration: none;
}

.category-badge:hover,
.category-badge:focus-visible {
    color: #003cba;
    text-decoration: underline;
}

.content-page {
    max-width: 820px;
    margin: 24px auto 36px;
    font-size: 17px;
    line-height: 1.65;
}

.content-page h2 {
    margin: 28px 0 6px;
    font-size: 21px;
    letter-spacing: 0;
}

.content-page a,
.contact-link {
    color: #9b0000;
    font-weight: 700;
    text-decoration: underline;
}

.site-footer {
    padding: 28px 10px 24px;
    color: #111;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}

.site-footer p {
    margin: 5px auto;
}

.site-footer a {
    font-weight: 700;
}

@media (max-width: 1023px) {
    .directory-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .site-header {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .brand {
        min-height: 82px;
    }

    .site-heading {
        padding: 0 12px 16px;
    }

    .site-heading h1 {
        font-size: 21px;
    }

    .directory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 479px) {
    .wrapper {
        width: min(100% - 16px, 1280px);
    }

    .main-nav {
        font-size: 14px;
    }

    .main-nav > a,
    .live-nav-item {
        padding: 5px 7px;
        border: 0 !important;
    }

    .directory-grid {
        grid-template-columns: 1fr;
    }

    .site-link {
        font-size: 16px;
    }
}
