* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #1b2430;
    --muted: #6b7280;
    --line: #dde5ef;
    --dark: #0f172a;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --green: #16a34a;
    --red: #dc2626;
    --yellow: #f59e0b;
    --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(180deg, #f8fbff 0%, #eef3f8 100%);
    color: var(--text);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

.hidden {
    display: none !important;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    backdrop-filter: blur(8px);
}

.brand {
    font-weight: 700;
    font-size: 22px;
}

.main-nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    color: #fff;
    opacity: 0.95;
}

.main-nav a:hover {
    opacity: 1;
}

.mod-link {
    position: relative;
    font-size: 22px;
    line-height: 1;
}

.task-badge {
    position: absolute;
    top: -7px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.inline-badge {
    position: static;
    margin-left: 6px;
}

.page-wrap {
    max-width: 1380px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

.narrow-wrap {
    max-width: 800px;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(221, 229, 239, 0.9);
    padding: 24px;
    margin-bottom: 24px;
}

.public-layout {
    display: grid;
    grid-template-columns: 260px 1fr 260px;
    gap: 24px;
    align-items: start;
}

.sidebar-ads {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 88px;
}

.ad-card {
    background: #fff;
    border: 1px solid #e7eef7;
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.ad-card img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 10px;
    max-height: 180px;
    object-fit: cover;
}

.ad-label,
.hero-topline,
.section-badge,
.admin-login-badge {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: #e8f0ff;
    color: #1849b5;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero,
.live-rating-card {
    text-align: center;
}

.hero-copy,
.muted,
.small-note {
    color: var(--muted);
}

.cat-app {
    max-width: 760px;
    margin: 0 auto;
}

.loading-state {
    padding: 40px 20px;
    text-align: center;
    font-size: 18px;
    color: var(--muted);
}

.main-cat-image {
    width: 100%;
    max-width: 520px;
    height: 420px;
    object-fit: cover;
    margin: 18px auto;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

.meta-row,
.action-row,
.button-row,
.admin-actions,
.comments-head {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.meta-row,
.center-actions,
.comments-head {
    justify-content: center;
}

.rating-control {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.rating-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
}

.rate-button,
.btn,
.comment-report-btn,
.admin-tab-button {
    border: 0;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
    font: inherit;
}

.rate-button {
    background: #edf3ff;
    color: #10398a;
}

.rate-button:hover,
.btn:hover,
.comment-report-btn:hover,
.admin-tab-button:hover {
    transform: translateY(-1px);
}

.comment-entry,
.stack-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 520px;
    margin: 0 auto;
    text-align: left;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 14px;
    font: inherit;
    background: #fff;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.comments-card {
    margin-top: 22px;
    text-align: left;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    background: #f9fbff;
    border: 1px solid #dde7f7;
    border-radius: 18px;
    padding: 18px;
}

.comments-scroll {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 6px;
}

.comment-item {
    background: #fff;
    border: 1px solid #e6edf8;
    border-radius: 14px;
    padding: 12px 14px;
}

.comment-item p {
    margin: 8px 0;
}

.comment-item small {
    color: var(--muted);
}

.comment-head-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.comment-report-btn {
    padding: 7px 10px;
    background: #fff1f2;
    color: #991b1b;
    font-size: 13px;
}

.report-box {
    max-width: 520px;
    margin: 14px auto 0;
    text-align: left;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 16px;
    padding: 16px;
}

.message-box {
    border-radius: 14px;
    padding: 14px 16px;
    margin-top: 14px;
    border: 1px solid transparent;
}

.success-box {
    background: #eefcf3;
    border-color: #b7ebc6;
    color: #14532d;
}

.error-box {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #991b1b;
}

.warning-box {
    background: #fff9eb;
    border-color: #fde68a;
    color: #92400e;
}

.token-box {
    background: #0f172a;
    color: #fff;
    border-radius: 12px;
    padding: 14px;
    font-family: monospace;
    font-size: 16px;
    word-break: break-all;
    margin: 12px 0;
}

.btn {
    background: #e8eef8;
    color: #111827;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
}

.btn-primary:hover {
    background: var(--blue-dark);
}

.btn-danger {
    background: var(--red);
    color: #fff;
}

.stats-section,
.reports-list {
    display: grid;
    gap: 24px;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.cat-grid,
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.cat-card,
.admin-card,
.report-card {
    background: #fff;
    border: 1px solid #e7eef7;
    border-radius: 18px;
    overflow: hidden;
}

.cat-card img,
.admin-card img {
    width: 100%;
    height: 230px;
    object-fit: cover;
}

.cat-card-body,
.admin-card-body {
    padding: 16px;
}

.upload-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.rules-block ul {
    padding-left: 20px;
}

.rules-block li {
    margin-bottom: 8px;
}

.admin-login-body {
    min-height: 100vh;
    background: radial-gradient(circle at top, #172554 0%, #0f172a 45%, #07101f 100%);
}

.admin-login-wrap {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.admin-login-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
    padding: 28px;
}

.honeypot-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

.admin-header {
    background: #111827;
}

.admin-summary-card {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-summary-grid {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.summary-box {
    min-width: 140px;
    border-radius: 16px;
    background: #f8fbff;
    border: 1px solid #e1eaf7;
    padding: 16px;
    text-align: center;
}

.summary-box strong {
    display: block;
    font-size: 28px;
    margin-bottom: 6px;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.admin-tab-button {
    background: #e8eef8;
    color: #111827;
}

.admin-tab-button.active {
    background: #0f172a;
    color: #fff;
}

.admin-tab-panel {
    display: none;
}

.admin-tab-panel.active {
    display: block;
}

.admin-card-head,
.report-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.status-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}

.status-badge.active {
    background: #eafaf0;
    color: #166534;
}

.status-badge.deleted {
    background: #fef2f2;
    color: #991b1b;
}

.admin-comments-block {
    margin-top: 16px;
    border-top: 1px solid #e7eef7;
    padding-top: 14px;
}

.admin-comments-scroll {
    max-height: 170px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-comment-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid #e7eef7;
    border-radius: 14px;
    padding: 12px;
    background: #fbfdff;
}

.admin-comment-row.is-deleted {
    opacity: 0.72;
    background: #f8fafc;
}

.small-actions .btn {
    padding: 8px 10px;
    font-size: 13px;
}

.edit-preview {
    width: 100%;
    max-width: 360px;
    border-radius: 18px;
    margin: 0 auto 18px;
}

.report-card {
    padding: 18px;
}

.report-content-preview {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 14px;
    margin: 14px 0;
}

.report-content-preview.text-only {
    grid-template-columns: 1fr;
}

.report-content-preview img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 14px;
}

@media (max-width: 1250px) {
    .public-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-ads {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 1100px) {
    .upload-layout {
        grid-template-columns: 1fr;
    }

    .rating-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 780px) {
    .site-header {
        flex-direction: column;
        gap: 12px;
    }

    .main-nav {
        justify-content: center;
    }

    .main-cat-image {
        height: 300px;
    }

    .rating-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .admin-comment-row,
    .report-content-preview {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .report-content-preview img {
        width: 100%;
        height: 220px;
    }
}
