:root {
    color-scheme: dark;
    --bg: #0f1829;
    --bg-2: #121d31;
    --surface: #1c2a3f;
    --surface-2: #22324a;
    --border: #34445f;
    --text: #f8fbff;
    --muted: #a6b7d0;
    --primary: #139ee5;
    --primary-2: #0b7fba;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --shadow: 0 18px 60px rgba(0, 0, 0, .28);
    --radius: 14px;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #f3f7fc;
    --bg-2: #ffffff;
    --surface: #ffffff;
    --surface-2: #eef4fb;
    --border: #d8e2ee;
    --text: #142033;
    --muted: #5b6d84;
    --shadow: 0 18px 50px rgba(21, 34, 54, .12);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 30% 0%, rgba(19, 158, 229, .14), transparent 34rem),
        linear-gradient(180deg, var(--bg), #0b1220 70%);
    color: var(--text);
    min-height: 100vh;
}

html[data-theme="light"] body {
    background: linear-gradient(180deg, var(--bg), #eaf1f8 70%);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }

.container {
    width: min(1060px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(25, 37, 55, .9);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

html[data-theme="light"] .topbar { background: rgba(255, 255, 255, .86); }

.nav-wrap {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 58px;
}

.brand {
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: -.03em;
    white-space: nowrap;
    text-shadow: 1px 2px 0 rgba(0,0,0,.22);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: .86rem;
    color: var(--muted);
    flex: 1;
}

.nav-links a:first-child { color: var(--primary); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 10px;
    width: 38px;
    height: 38px;
    cursor: pointer;
}

.login-link { font-weight: 700; font-size: .88rem; color: var(--muted); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 12px 17px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
    font-size: .92rem;
}

.btn:hover { transform: translateY(-1px); color: var(--text); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 22px rgba(19, 158, 229, .28); }
.btn-primary:hover { background: var(--primary-2); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-danger { background: rgba(239, 68, 68, .12); color: #fecaca; border-color: rgba(239, 68, 68, .35); }
.btn-small { padding: 8px 12px; font-size: .8rem; }

.card {
    background: linear-gradient(180deg, var(--surface), rgba(28, 42, 63, .86));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

html[data-theme="light"] .card { background: var(--surface); }

.muted { color: var(--muted); }
.tiny { font-size: .78rem; }

.flash,
.alert {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.flash-success { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .35); }
.flash-error, .alert-error { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .35); }
.alert p { margin: 0 0 6px; }
.alert p:last-child { margin-bottom: 0; }

.hero {
    padding: 72px 0 20px;
    text-align: center;
}

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 28px;
    font-weight: 800;
    color: var(--text);
    font-size: .9rem;
}

.status-dot span {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(34, 197, 94, .12), 0 0 18px rgba(34, 197, 94, .8);
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 4.25rem);
    line-height: .94;
    margin: 0 auto 22px;
    max-width: 780px;
    font-weight: 950;
    letter-spacing: -.055em;
    text-shadow: 3px 5px 0 rgba(239, 69, 69, .35), 0 8px 28px rgba(0,0,0,.22);
}

.hero-copy {
    max-width: 650px;
    margin: 0 auto 34px;
    line-height: 1.7;
}

.hero-search {
    width: min(520px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}

.search-icon { padding-left: 12px; color: var(--muted); font-size: 1.25rem; }

.hero-search input {
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
    min-width: 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-top: 44px;
    text-align: left;
}

.feature-card {
    padding: 22px;
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 16px;
    align-items: start;
}

.feature-card span {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: #32445f;
    display: grid;
    place-items: center;
    color: #d8e8ff;
    font-weight: 900;
}

.feature-card h3 { margin: 0 0 7px; font-size: 1rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }

.content-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
    padding-top: 28px;
}

.content-head h2 { margin: 0; font-size: 1.75rem; letter-spacing: -.04em; }
.content-head p { margin: 7px 0 0; }

.filters,
.toolbar-form {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

select,
input,
textarea {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: 12px 13px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(19, 158, 229, .14);
}

textarea { resize: vertical; line-height: 1.6; }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    padding: 32px 0 70px;
}

.script-card {
    overflow: hidden;
    box-shadow: none;
    transition: transform .2s ease, border-color .2s ease;
}

.script-card:hover { transform: translateY(-4px); border-color: rgba(19, 158, 229, .55); }

.script-image-wrap {
    position: relative;
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-2);
}

.script-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.04);
    transition: transform .25s ease;
}

.script-card:hover img { transform: scale(1.04); }

.views-chip,
.time-chip {
    position: absolute;
    top: 10px;
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .62);
    color: #fff;
    font-weight: 800;
    font-size: .78rem;
    backdrop-filter: blur(8px);
}

.views-chip { left: 10px; }
.time-chip { right: 10px; }
.badge-wrap { position: absolute; right: 10px; bottom: 10px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 900;
}

.badge-free { background: var(--primary); color: #fff; }
.badge-key { background: var(--warning); color: #1e1300; }
.badge-dark { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }

.script-card-body { padding: 14px 15px 17px; }
.category-text { display: block; color: var(--muted); font-size: .82rem; margin-bottom: 5px; }
.script-card h3 { font-size: 1rem; line-height: 1.25; margin: 0; }

.detail-layout { padding: 54px 0 80px; }
.detail-card {
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.detail-media { position: relative; min-height: 420px; background: var(--bg-2); }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-badges { position: absolute; left: 18px; bottom: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.detail-content { padding: clamp(24px, 4vw, 42px); }
.detail-content h1 { font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1; margin: 0 0 16px; letter-spacing: -.055em; }
.detail-meta { margin-bottom: 24px; }
.detail-description { color: var(--muted); line-height: 1.8; font-size: 1rem; }
.btn-download { width: 100%; margin-top: 20px; }
.visible-link {
    margin-top: 16px;
    padding: 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: grid;
    gap: 7px;
    overflow-wrap: anywhere;
}
.visible-link span { color: var(--muted); font-size: .85rem; }
.visible-link a { color: var(--primary); }

.auth-section {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 145px);
    padding: 42px 0;
}

.auth-card { width: min(440px, 100%); padding: 30px; }
.auth-card h1 { margin: 0 0 8px; font-size: 2rem; letter-spacing: -.04em; }

.admin-hero {
    padding: 44px 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.admin-hero.compact { padding-bottom: 14px; }
.admin-hero h1 { margin: 0 0 8px; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.05em; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card { padding: 24px; }
.stat-card span { color: var(--muted); display: block; margin-bottom: 12px; }
.stat-card strong { font-size: 2rem; }

.admin-grid-2 {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 22px;
    padding-bottom: 70px;
}

.single-panel { padding-bottom: 70px; }
.single-panel .panel-card { max-width: 820px; margin: 0 auto; }
.panel-card { padding: 24px; }
.panel-card h2 { margin: 0 0 18px; letter-spacing: -.03em; }

.form-grid { display: grid; gap: 16px; }
.form-wide { grid-template-columns: 1fr 1fr; }
.form-wide label:nth-of-type(4),
.form-wide label:nth-of-type(5),
.form-wide .key-field,
.form-wide button,
.form-wide .image-preview { grid-column: 1 / -1; }

label { display: grid; gap: 8px; font-weight: 800; color: var(--text); }
label small { font-weight: 500; color: var(--muted); }
.check-row { display: flex; align-items: center; gap: 10px; }
.check-row input { width: auto; }

.image-preview,
.current-image {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.current-image { max-width: 360px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: .84rem; }
.table-actions, .card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline; }

.action-list { display: grid; gap: 12px; }
.action-list a {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-2);
    font-weight: 800;
}

.toolbar { margin-top: 10px; padding: 16px; }
.toolbar-form label { min-width: 240px; }

.category-sections { padding: 26px 0 70px; }
.category-section { margin-bottom: 36px; }
.category-section h2 { font-size: 1.5rem; letter-spacing: -.03em; }
.admin-post-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.admin-post-card { overflow: hidden; display: grid; grid-template-columns: 180px 1fr; box-shadow: none; }
.admin-post-card img { width: 100%; height: 100%; min-height: 160px; object-fit: cover; }
.admin-post-body { padding: 16px; }
.admin-post-body h3 { margin: 0 0 8px; }
.meta-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .86rem; }
.card-actions { margin-top: 16px; }
.empty-state { grid-column: 1 / -1; padding: 34px; text-align: center; }
.empty-state h2 { margin: 0 0 8px; }

.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    background: rgba(0,0,0,.12);
}
.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    font-size: .86rem;
}
.footer-grid p { margin: 0; }

@media (max-width: 900px) {
    .nav-wrap { flex-wrap: wrap; padding: 12px 0; }
    .nav-links { order: 3; width: 100%; overflow-x: auto; padding-bottom: 6px; }
    .feature-grid, .cards-grid, .stats-grid, .admin-grid-2 { grid-template-columns: 1fr; }
    .content-head, .admin-hero, .footer-grid { align-items: stretch; flex-direction: column; }
    .detail-card { grid-template-columns: 1fr; }
    .detail-media { min-height: 260px; }
    .admin-post-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .container { width: min(100% - 20px, 1060px); }
    .hero { padding-top: 42px; }
    .hero-search { grid-template-columns: auto 1fr; border-radius: 18px; }
    .hero-search button { grid-column: 1 / -1; width: 100%; }
    .filters { width: 100%; }
    .filters select, .filters .btn { width: 100%; }
    .form-wide { grid-template-columns: 1fr; }
    .form-wide label, .form-wide button, .form-wide .image-preview { grid-column: auto; }
    .admin-post-card { grid-template-columns: 1fr; }
    .table-actions { min-width: 220px; }
}

.script-box {
    margin-top: 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.7);
    overflow: hidden;
}

.script-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-weight: 800;
}

.script-box pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.script-box code {
    color: var(--text);
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.6;
}

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
}

.resource-hidden,
.visible-link.resource-hidden,
[hidden].resource-hidden {
    display: none !important;
}

.script-box {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.7);
    overflow: hidden;
}

.script-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-weight: 800;
}

.script-box pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.script-box code {
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.6;
}

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
}


/* ================================
   NovaCode Public Hero Redesign
================================ */

.nc-hero {
    padding-top: 72px;
    padding-bottom: 34px;
}

.nc-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 42px;
    align-items: center;
}

.nc-hero-content {
    position: relative;
    z-index: 2;
}

.nc-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    background: rgba(14, 165, 233, 0.08);
    color: var(--text);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 22px;
}

.nc-pill span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.9);
}

.nc-hero h1 {
    max-width: 760px;
    margin: 0;
    color: var(--text);
    font-size: clamp(38px, 5vw, 72px);
    line-height: 0.95;
    letter-spacing: -2px;
    font-weight: 950;
}

.nc-hero h1 strong {
    display: block;
    color: #38bdf8;
    text-shadow: 0 0 34px rgba(14, 165, 233, 0.28);
}

.nc-hero p {
    max-width: 660px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.7;
}

.nc-search-box {
    margin-top: 32px;
    max-width: 720px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 10px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.78);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
}

.nc-search-input {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.nc-search-input span {
    color: var(--muted);
    font-size: 20px;
}

.nc-search-input input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
}

.nc-search-input input::placeholder {
    color: var(--muted);
}

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

.nc-hero-tags span {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    background: rgba(15, 23, 42, 0.56);
}

.nc-hero-panel {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 20px;
    border: 1px solid rgba(56, 189, 248, 0.22);
    background:
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.22), transparent 36%),
        linear-gradient(145deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.nc-panel-glow {
    position: absolute;
    width: 190px;
    height: 190px;
    right: -70px;
    top: -70px;
    background: rgba(14, 165, 233, 0.35);
    filter: blur(60px);
    pointer-events: none;
}

.nc-panel-header {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
}

.nc-panel-header span {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.55);
}

.nc-panel-header span:first-child {
    background: #22c55e;
}

.nc-terminal-line {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.nc-terminal-line small {
    color: var(--muted);
    font-weight: 800;
}

.nc-terminal-line strong {
    color: #38bdf8;
    font-size: 22px;
}

.nc-terminal-card {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    margin-top: 12px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.nc-terminal-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.nc-terminal-card div {
    text-align: right;
}

.nc-terminal-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.nc-terminal-card strong {
    color: var(--text);
    font-size: 14px;
}

.nc-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 14px;
    margin-bottom: 34px;
}

.nc-feature-card {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 16px;
    align-items: start;
    padding: 22px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.82));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.nc-feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.26);
}

.nc-feature-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    color: #38bdf8;
    font-size: 24px;
    font-weight: 900;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.18);
}

.nc-feature-card h3 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 17px;
}

.nc-feature-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
}

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

    .nc-hero-panel {
        max-width: 620px;
    }

    .nc-features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .nc-hero {
        padding-top: 42px;
    }

    .nc-search-box {
        grid-template-columns: 1fr;
    }

    .nc-search-box .btn {
        width: 100%;
    }

    .nc-feature-card {
        grid-template-columns: 1fr;
    }

    .nc-hero h1 {
        letter-spacing: -1px;
    }
}

.nav-links a:first-child {
    color: inherit;
}

.nav-links a.is-active {
    color: var(--primary);
}

.public-nav a {
    position: relative;
    font-weight: 800;
}

.public-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: var(--primary);
    transition: width 180ms ease;
}

.public-nav a:hover::after,
.public-nav a.is-active::after {
    width: 100%;
}

@media (max-width: 720px) {
    .public-nav {
        gap: 16px;
    }

    .public-nav a {
        font-size: 13px;
        white-space: nowrap;
    }
}

/* ================================
   Footer NovaCode
================================ */

.site-footer {
    margin-top: 80px;
    padding: 54px 0 26px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.08), transparent 34%),
        rgba(15, 23, 42, 0.72);
}

.footer-shell {
    display: grid;
    gap: 34px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr 0.8fr;
    gap: 42px;
}

.footer-brand h2,
.footer-section h3 {
    margin: 0 0 16px;
    color: var(--text);
}

.footer-brand p,
.footer-small {
    max-width: 430px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.footer-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 24px;
}

.footer-stats div {
    min-width: 110px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(30, 41, 59, 0.52);
}

.footer-stats strong {
    display: block;
    color: var(--text);
    font-size: 15px;
}

.footer-stats span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.footer-discord-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 280px;
    padding: 13px 18px;
    border-radius: 14px;
    color: #fff;
    font-weight: 900;
    text-decoration: none;
    background: linear-gradient(135deg, #5865f2, #3b82f6);
    box-shadow: 0 18px 38px rgba(37, 99, 235, 0.28);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.footer-discord-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 52px rgba(37, 99, 235, 0.36);
}

.footer-section .footer-small {
    margin-top: 14px;
    font-size: 14px;
}

.footer-links {
    display: grid;
    gap: 10px;
}

.footer-links a,
.footer-bottom-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
}

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

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 26px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.footer-bottom p {
    margin: 0;
    color: var(--muted);
}

.footer-bottom-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

/* ================================
   Disclaimer Page
================================ */

.legal-layout {
    max-width: 960px;
    padding-top: 56px;
    padding-bottom: 30px;
}

.legal-card {
    padding: clamp(26px, 5vw, 54px);
}

.legal-pill {
    display: inline-flex;
    margin-bottom: 18px;
    padding: 8px 13px;
    border-radius: 999px;
    color: #38bdf8;
    font-size: 13px;
    font-weight: 900;
    border: 1px solid rgba(56, 189, 248, 0.24);
    background: rgba(14, 165, 233, 0.1);
}

.legal-card h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(34px, 5vw, 58px);
    letter-spacing: -1.4px;
}

.legal-updated {
    margin: 12px 0 34px;
    color: var(--muted);
    font-weight: 700;
}

.legal-card h2 {
    margin: 30px 0 10px;
    color: var(--text);
    font-size: 22px;
}

.legal-card p {
    color: var(--muted);
    line-height: 1.8;
}

.legal-warning {
    margin-top: 30px;
    padding: 18px 20px;
    border-radius: 18px;
    color: var(--text) !important;
    font-weight: 900;
    border: 1px solid rgba(56, 189, 248, 0.2);
    background: rgba(14, 165, 233, 0.09);
}

.legal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

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

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-discord-btn {
        max-width: 100%;
    }
}
