*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #17212b;
    --muted: #475569;
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --primary2: #1d4ed8;
    --accent: #0f172a;
    --border: #dbe4ee;
    --line: #e2e8f0;
    --success-bg: #ecfdf3;
    --success-text: #166534;
    --warning-bg: #fff7ed;
    --warning-text: #9a3412;
    --dangerBg: #fef2f2;
    --dangerBorder: #fecaca;
    --dangerText: #b91c1c;
    --soft: #eff6ff;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --radius: 16px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.05), transparent 30%),
        radial-gradient(circle at top right, rgba(29, 78, 216, 0.05), transparent 26%),
        linear-gradient(180deg, #f8fbff 0%, #eef3f8 100%);
    color: var(--text);
}

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

img {
    max-width: 100%;
    height: auto;
}

/* ---------------- LAYOUT ---------------- */

.wrap {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

.side-sticky {
    position: sticky;
    top: 16px;
}

/* ---------------- NAVIGATION ---------------- */

.topbar,
.parent,
.quick-links,
.forum-footer,
.pagination,
.meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.topbar {
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.topbar a {
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    background: #fff;
    border: 1px solid #dbeafe;
    transition: .2s ease;
}

.topbar a:hover,
.topbar a.active {
    background: #dbeafe;
    color: #1d4ed8;
}

.parent {
    justify-content: center;
    gap: 8px;
}

.parent a {
    text-align: center;
    min-width: 64px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    transition: .2s ease;
}

.parent a:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: var(--primary);
}

/* ---------------- LOGO ---------------- */

.logo {
    display: flex;
    justify-content: center;
    text-align: center;
    margin: 6px 0 20px;
}

.logo a {
    max-width: 100%;
}

.logo img {
    border-radius: 12px;
}

/* ---------------- HERO ---------------- */

.hero {
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    color: #fff;
    border-radius: 24px;
    padding: 26px 22px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

.hero h1 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.15;
}

.hero p {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 16px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.hero-actions a {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 700;
}

.btn-primary {
    background: #fff;
    color: #0f172a;
}

.btn-primary:hover {
    background: #e5edff;
}

.btn-secondary {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, .22);
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.hero-badges span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #cbd5e1;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

/* ---------------- COMMON BLOCKS ---------------- */

.notice {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid #fed7aa;
    border-radius: 14px;
    padding: 14px 16px;
    margin: 18px 0;
    font-weight: 600;
    line-height: 1.6;
}

.alert {
    width: 100%;
    margin: 0 0 16px;
    padding: 13px 15px;
    border-radius: 14px;
    background: var(--dangerBg);
    color: var(--dangerText);
    border: 1px solid var(--dangerBorder);
    box-shadow: 0 4px 15px rgba(127, 29, 29, 0.06);
}

.section {
    margin: 26px 0;
}

.section h2 {
    margin: 0 0 12px;
    font-size: 28px;
}

.section p.lead {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.8;
}

.card,
.search-card,
.form-card,
.rules-card,
.stats-card,
.forum-item,
.faq-item {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card {
    padding: 20px;
}

.search-card,
.form-card,
.rules-card,
.stats-card {
    padding: 18px;
    margin-bottom: 16px;
}

.card h2,
.card h3,
.search-card h2,
.form-card h2,
.rules-card h2,
.stats-card h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.card p,
.search-card p,
.form-card p,
.rules-card p,
.stats-card p {
    margin: 0 0 12px;
    line-height: 1.7;
    color: var(--muted);
}

.info-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
}

.highlight {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 16px;
    line-height: 1.7;
    font-weight: 600;
}

/* ---------------- GRID ---------------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.quick-links a {
    text-decoration: none;
    background: #fff;
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    font-weight: 700;
    text-align: center;
    transition: .2s ease;
}

.quick-links a:hover {
    transform: translateY(-2px);
    border-color: #bfd3ea;
    color: var(--primary);
}

/* ---------------- ADS ---------------- */

.ad-box {
    width: 100%;
    margin: 18px 0;
    padding: 10px;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.ad-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 8px;
}

.ad-inner {
    width: 100%;
    min-height: 90px;
    display: block;
    background: #f8fafc;
    border-radius: 10px;
    color: #334155;
    font-weight: 700;
    padding: 6px;
}

.ad-inner .adsbygoogle {
    display: block !important;
    width: 100% !important;
    min-height: 90px;
}

/* ---------------- FAQ ---------------- */

.faq {
    margin-top: 28px;
}

.faq-item {
    padding: 18px;
    margin-bottom: 12px;
}

.faq-item h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.faq-item p {
    margin: 0;
    line-height: 1.7;
    color: var(--muted);
}

/* ---------------- RESULT SECTION ---------------- */

.result {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 10px 5px;
}

.res {
    display: flex;
    flex-direction: column;
    padding: 20px 5px;
    background: linear-gradient(180deg, #166440, #05441f);
    border-radius: 12px;
    box-shadow: 0 7px 7px rgba(0, 0, 0, .75);
    border: 2px solid #000;
}

.full {
    background: red;
}

.res .gn {
    font-size: xx-large;
    color: yellow;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 6px;
}

.res .r {
    color: aquamarine;
    font-size: 3rem;
    font-weight: 800;
    text-shadow: 1px 1px 2px black;
}

.res .r b {
    color: #fff;
}

.res p {
    color: wheat;
}

/* ---------------- SEARCH + FORUM ---------------- */

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-wrap {
    position: relative;
    flex: 1;
}

.search-wrap i {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 15px;
}

.search-input,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.search-input {
    min-height: 48px;
    padding: 12px 14px 12px 42px;
    border-radius: 14px;
    font-size: 15px;
}

.search-input:focus,
textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.14);
}

textarea {
    min-height: 170px;
    padding: 14px;
    resize: vertical;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.6;
}

.search-btn,
.reset-btn,
.submit-btn,
.action-btn,
.delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    transition: .2s ease;
}

.search-btn,
.submit-btn,
.action-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    color: #fff;
}

.reset-btn {
    background: #f8fafc;
    color: var(--text);
    border: 1px solid #cbd5e1;
}

.delete-btn {
    background: #7f1d1d;
    color: #fff;
}

.search-btn:hover,
.submit-btn:hover,
.action-btn:hover,
.reset-btn:hover,
.delete-btn:hover {
    transform: translateY(-1px);
    opacity: .98;
}

.search-live-note,
.helper-text {
    margin-top: 10px;
    font-size: 13px;
    color: #64748b;
}

.rules-card ul {
    margin: 0;
    padding-left: 20px;
}

.rules-card li {
    margin-bottom: 10px;
    color: var(--muted);
    line-height: 1.6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stat-box {
    padding: 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.stat-box small {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
}

.stat-box strong {
    font-size: 22px;
    color: var(--text);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.toolbar-left h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.toolbar-left p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.toolbar-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.toolbar-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid #bfdbfe;
}

.forum-list {
    display: grid;
    gap: 18px;
}

.forum-item {
    overflow: hidden;
}

.forum-head {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
}

.user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f766e, #1d4ed8);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.user-info h3 {
    margin: 0 0 4px;
    font-size: 20px;
    line-height: 1.2;
}

.user-info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
}

.forum-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.forum-badges span {
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.forum-body {
    padding: 18px;
    background: #fff;
}

.forum-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.8;
    color: #0f172a;
    white-space: pre-wrap;
    word-break: break-word;
}

.visitor-note {
    padding: 14px 16px;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-weight: 700;
}

.forum-footer {
    padding: 0 18px 18px;
}

.forum-footer a,
.forum-footer form {
    margin: 0;
}

.forum-footer form {
    display: inline-flex;
}

.empty-state {
    padding: 34px 20px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.empty-state i {
    font-size: 34px;
    color: #94a3b8;
    margin-bottom: 10px;
}

.empty-state h2 {
    margin: 0 0 8px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

/* ---------------- PAGINATION ---------------- */

.pagination-wrap {
    margin-top: 22px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.pagination-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.pagination-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.pagination {
    gap: 8px;
}

.pagination a,
.pagination span {
    min-width: 44px;
    min-height: 44px;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    border: 1px solid #dbeafe;
    background: #fff;
    color: var(--text);
}

.pagination a:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.pagination .current {
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    color: #fff;
    border-color: transparent;
}

.pagination .dots {
    background: #f8fafc;
    color: #64748b;
}

/* ---------------- FOOTER ---------------- */

.site-footer,
footer {
    margin-top: 30px;
    padding: 24px 18px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.footer-top {
    text-align: center;
    margin-bottom: 20px;
}

.footer-title {
    margin: 0 0 10px;
    font-size: 28px;
    line-height: 1.3;
    color: var(--accent);
}

.footer-subtitle {
    max-width: 760px;
    margin: 0 auto 14px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--muted);
}

.footer-main-link a,
.refresh a {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0f766e, #1d4ed8);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transition: opacity .2s ease, transform .2s ease;
}

.footer-main-link a:hover,
.refresh a:hover {
    opacity: .96;
    transform: translateY(-1px);
}

.footer-year-block {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.footer-year-heading {
    margin: 0 0 12px;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
}

.footer-year-heading span {
    color: #0f766e;
}

.footer-bottom {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-bottom p,
.footer-text,
footer p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.footer-bottom a,
.footer-links a,
footer a {
    color: #0f766e;
    font-weight: 700;
    text-decoration: none;
}

.footer-bottom a:hover,
.footer-links a:hover,
footer a:hover {
    color: var(--primary);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 18px;
}

.footer-links a {
    background: #fff;
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 10px;
}

/* ---------------- RESPONSIVE ---------------- */

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

    .side-sticky {
        position: static;
    }
}

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

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

    .hero h1,
    .footer-title {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .wrap {
        padding: 12px;
    }

    .hero {
        padding: 20px 16px;
        border-radius: 18px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

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

    .forum-head {
        padding: 14px;
    }

    .forum-body {
        padding: 16px 14px;
    }

    .forum-footer {
        padding: 0 14px 14px;
    }

    .forum-badges {
        justify-content: flex-start;
    }

    .quick-links a {
        flex: 1 1 100%;
    }
}

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

@media (max-width: 600px) {
    .quick-links {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 24px;
    }

    .topbar a {
        flex: 1 1 48%;
    }

    .footer-title {
        font-size: 22px;
    }

    .footer-subtitle {
        font-size: 14px;
    }

    .parent a {
        min-width: 58px;
        font-size: 12px;
        padding: 9px 10px;
    }
}

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

    .toolbar {
        padding: 14px;
    }

    .hero-badges span,
    .toolbar-pill {
        width: 100%;
        justify-content: center;
    }
}

.search-box {
    max-width: 780px;
    margin: 18px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.search-box input[type="text"] {
    flex: 1 1 320px;
    min-width: 220px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    background: #fff;
    color: #0f172a;
}

.search-box input[type="text"]:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.14);
}

.search-box button {
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    background: #0f766e;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.search-box button:hover {
    opacity: 0.95;
}

.chart {
    width: 100%;
    max-width: 1180px;
    margin: 18px auto;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.chart th,
.chart td {
    padding: 12px 10px;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.chart th {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 700;
}

.chart tr:hover td {
    background: #f8fbff;
}

.chart td:first-child {
    font-weight: 700;
    color: #0f172a;
}

.chart td:nth-child(3) {
    min-width: 120px;
}

.chart td:nth-child(4) {
    min-width: 150px;
}

.chart td:nth-child(5) {
    min-width: 140px;
}

.pagination {
    max-width: 1180px;
    margin: 20px auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.pagination a,
.pagination strong {
    min-width: 42px;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}

.pagination a {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.pagination a:hover {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.pagination strong {
    background: #0f766e;
    color: #fff;
    border: 1px solid #0f766e;
}

hr {
    max-width: 1180px;
    margin: 16px auto;
    border: 0;
    border-top: 1px solid #e2e8f0;
}

p {
    text-align: center;
}

@media (max-width: 768px) {
    .search-box {
        padding: 12px;
    }

    .search-box input[type="text"],
    .search-box button {
        width: 100%;
    }

    .chart {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .chart th,
    .chart td {
        font-size: 13px;
        padding: 10px 8px;
    }

    .pagination {
        padding: 12px;
    }

    .pagination a,
    .pagination strong {
        min-width: 38px;
        padding: 9px 12px;
        font-size: 13px;
    }
}