:root {
    --bg: #dae0e6;
    --surface: #ffffff;
    --surface-soft: #f6f7f8;
    --line: #ccd0d5;
    --text: #1c1c1c;
    --muted: #57606a;
    --brand: #ff4500;
    --brand-dark: #cc3700;
    --link: #006cbf;
    --green: #177245;
    --shadow: 0 8px 24px rgba(28, 28, 28, 0.08);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
}

.brand small {
    display: block;
    color: var(--muted);
    margin-top: 1px;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar nav a {
    padding: 8px 10px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
}

.topbar nav a:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 312px;
    gap: 20px;
    width: min(1180px, calc(100% - 32px));
    margin: 20px auto 48px;
}

.content {
    min-width: 0;
}

.banner {
    display: block;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow);
}

.banner-top {
    min-height: 92px;
    padding: 20px 24px;
    margin-bottom: 14px;
}

.banner span,
.eyebrow {
    display: block;
    color: var(--brand);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0;
}

.banner strong {
    display: block;
    margin-top: 8px;
    font-size: 20px;
}

.banner img {
    display: block;
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    background: #fff;
}

.community-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
    margin-bottom: 14px;
    background: linear-gradient(90deg, #1f2937, #394150);
    color: #fff;
    border-radius: 4px;
}

.community-header h1 {
    margin: 4px 0 8px;
    font-size: clamp(28px, 5vw, 48px);
    line-height: 1;
}

.community-header p {
    max-width: 620px;
    margin: 0;
    color: #e6edf5;
}

.community-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.community-links a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff;
    color: #1f2937;
    font-weight: 800;
    font-size: 14px;
}

.community-links a:hover {
    background: var(--brand);
    color: #fff;
}

.stats {
    display: grid;
    grid-template-columns: auto auto;
    align-content: center;
    gap: 4px 10px;
    min-width: 160px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

.stats strong {
    font-size: 24px;
}

.stats span {
    align-self: center;
    color: #e6edf5;
    font-size: 13px;
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0 10px;
}

.section-title h2 {
    margin: 0;
    font-size: 20px;
}

.section-title span {
    color: var(--muted);
    font-size: 13px;
}

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

.mobile-submit,
.mobile-links,
.mobile-banners {
    display: none;
}

.post-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    margin-bottom: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}

.highlight-grid .post-card {
    display: block;
    min-height: 0;
    aspect-ratio: 1 / 1;
    height: auto;
}

.highlight-card {
    position: relative;
    aspect-ratio: 1 / 1;
    min-width: 0;
    overflow: hidden;
    background: #111827;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.highlight-link {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    color: #fff;
    cursor: pointer;
}

.highlight-card * {
    pointer-events: none;
}

.highlight-card .highlight-link {
    pointer-events: auto;
}

.highlight-image,
.highlight-fallback {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #111827;
}

.highlight-overlay {
    position: absolute;
    inset: auto 0 0;
    display: grid;
    gap: 5px;
    padding: 42px 12px 12px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
}

.highlight-overlay span {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #ffb199;
}

.highlight-overlay strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.15;
}

.highlight-overlay em {
    font-style: normal;
    font-size: 12px;
    font-weight: 800;
}

.highlight-grid .vote-box {
    display: none;
}

.highlight-grid .post-main {
    padding: 14px;
}

.highlight-grid .post-main h3 {
    font-size: 16px;
    line-height: 1.25;
}

.highlight-grid .post-body {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vote-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-top: 10px;
    background: var(--surface-soft);
}

.vote-box button {
    width: 30px;
    height: 28px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.vote-box button:hover,
.vote-box button.active {
    color: var(--brand);
}

.vote-box .vote-down:hover,
.vote-box .vote-down.active {
    color: var(--link);
}

.score {
    font-size: 13px;
}

.post-main {
    min-width: 0;
    padding: 12px 14px 14px;
}

.post-meta {
    color: var(--muted);
    font-size: 12px;
}

.post-category {
    display: inline-flex;
    width: fit-content;
    margin-top: 6px;
    padding: 4px 7px;
    border-radius: 999px;
    background: #fff4ed;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
}

.post-main h3 {
    margin: 6px 0 8px;
    font-size: 19px;
    line-height: 1.25;
}

.post-body {
    margin: 0 0 10px;
    color: #333;
    line-height: 1.45;
}

.post-image {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    margin: 10px 0;
    border-radius: 4px;
    background: var(--surface-soft);
}

.post-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.post-actions a,
.post-actions button {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 800;
    font-size: 13px;
    padding: 6px 0;
}

.post-actions a:hover,
.post-actions button:hover {
    color: var(--brand);
}

.affiliate-link {
    color: var(--green) !important;
}

.comments {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.comment-form {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    gap: 8px;
}

.submit-form {
    display: grid;
    gap: 8px;
}

.comment-form input {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.submit-form input,
.submit-form textarea {
    width: 100%;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.submit-form textarea {
    min-height: 90px;
    resize: vertical;
}

.form-status {
    margin: 0;
    min-height: 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.upload-note {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.comment-form button,
.primary {
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    padding: 9px 16px;
    cursor: pointer;
    font-weight: 800;
}

.comment-form button:hover,
.primary:hover {
    background: var(--brand-dark);
}

.comment-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.comment {
    padding: 10px;
    background: var(--surface-soft);
    border-radius: 4px;
}

.comment strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.comment p {
    margin: 0;
    line-height: 1.4;
}

.loader {
    padding: 18px;
    color: var(--muted);
    text-align: center;
}

.sidebar {
    position: sticky;
    top: 76px;
    align-self: start;
    display: grid;
    gap: 12px;
}

.panel {
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.panel h2 {
    margin: 0 0 10px;
    font-size: 16px;
}

.link-list,
.side-banners {
    display: grid;
    gap: 8px;
}

.link-list a,
.side-banners a {
    display: block;
    padding: 11px;
    background: var(--surface-soft);
    border-radius: 4px;
    color: var(--link);
    font-weight: 800;
}

.side-banners a {
    min-height: 0;
    aspect-ratio: 1 / 1;
    color: var(--text);
    border: 1px dashed var(--line);
}

.side-banners img {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: contain;
}

.rules p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.age-gate {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.72);
}

.age-card {
    width: min(440px, 100%);
    padding: 28px;
    background: var(--surface);
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.age-card h1 {
    margin: 6px 0 10px;
}

.age-card p {
    line-height: 1.5;
}

.age-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.secondary {
    padding: 9px 14px;
    color: var(--muted);
    font-weight: 800;
}

@media (max-width: 980px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .mobile-submit,
    .mobile-links,
    .mobile-banners {
        display: block;
        margin-bottom: 14px;
    }

    .sidebar .submit-panel,
    .sidebar .affiliate-panel,
    .sidebar .banner-panel {
        display: none;
    }

    .highlight-grid {
        display: flex;
        grid-template-columns: none;
        gap: 10px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .highlight-grid .post-card,
    .highlight-grid .highlight-card {
        flex: 0 0 min(82vw, 340px);
        width: min(82vw, 340px);
        aspect-ratio: 1 / 1;
        scroll-snap-align: start;
    }
}

@media (max-width: 640px) {
    .topbar {
        padding: 0 12px;
    }

    .topbar nav a {
        padding: 8px 6px;
        font-size: 12px;
    }

    .layout {
        width: min(100% - 16px, 1180px);
        margin-top: 10px;
    }

    .community-header,
    .comment-form {
        display: block;
    }

    .stats {
        margin-top: 18px;
    }

    .post-card {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .comment-form input,
    .comment-form button {
        width: 100%;
        margin-top: 8px;
    }
}
