:root {
    --bg: #0b0b0f;
    --bg-soft: #12121a;
    --card: rgba(20, 20, 28, 0.78);
    --card-strong: rgba(17, 17, 24, 0.96);
    --line: rgba(255, 255, 255, 0.08);
    --text: #f6f3ee;
    --muted: #b7ada1;
    --orange: #ff8c1a;
    --orange-2: #ff5e00;
    --orange-soft: rgba(255, 140, 26, 0.18);
    --danger: #ff4d4f;
    --success: #38d39f;
    --shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 94, 0, 0.14), transparent 28%),
        radial-gradient(circle at top right, rgba(255, 140, 26, 0.10), transparent 24%),
        linear-gradient(180deg, #09090d 0%, #0f0f16 55%, #09090d 100%);
    color: var(--text);
    overflow-x: hidden;
}

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

img {
    max-width: 100%;
    display: block;
}

.site-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    opacity: 0.35;
    z-index: 0;
}

.ambient {
    position: fixed;
    border-radius: 999px;
    filter: blur(95px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.34;
    animation: floatGlow 11s ease-in-out infinite;
    mix-blend-mode: screen;
}

.ambient-1 {
    width: 360px;
    height: 360px;
    top: 4%;
    left: -100px;
    background: rgba(255, 88, 0, 0.34);
}

.ambient-2 {
    width: 420px;
    height: 420px;
    top: 10%;
    right: -120px;
    background: rgba(255, 140, 26, 0.20);
    animation-delay: -3s;
}

.ambient-3 {
    width: 300px;
    height: 300px;
    bottom: 8%;
    left: 18%;
    background: rgba(255, 110, 20, 0.18);
    animation-delay: -6s;
}

.ambient-4 {
    width: 260px;
    height: 260px;
    bottom: 16%;
    right: 12%;
    background: rgba(255, 100, 0, 0.14);
    animation-delay: -8s;
}

.container {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* TOPBAR */

.topbar {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
    padding: 22px 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 20;
}

.brand-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-size: 18px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(255, 94, 0, 0.20);
}

.site-views-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f3e8da;
    font-size: 13px;
    font-weight: 700;
}

/* HERO */

.hero {
    min-height: 78vh;
    display: grid;
    place-items: center;
    padding: 80px 20px 30px;
    position: relative;
    z-index: 2;
}

.hero-inner {
    max-width: 860px;
    text-align: center;
    animation: fadeUp 0.8s ease both;
}

.hero-badge,
.section-kicker,
.admin-login-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 140, 26, 0.12);
    border: 1px solid rgba(255, 140, 26, 0.26);
    color: #ffd0a1;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 18px 0 14px;
    font-size: clamp(42px, 7vw, 88px);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.hero p {
    max-width: 700px;
    margin: 0 auto 26px;
    font-size: 18px;
    line-height: 1.7;
    color: var(--muted);
}

/* SECTIONS */

.section {
    padding: 40px 0 80px;
    position: relative;
    z-index: 2;
}

.section-head,
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 24px;
}

.section-head h2,
.admin-header h1 {
    margin: 8px 0 0;
    font-size: clamp(30px, 4vw, 46px);
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 13px;
}

.mt-16 {
    margin-top: 16px;
}

/* SEARCH */

.search-wrap {
    display: grid;
    gap: 12px;
    margin-bottom: 28px;
}

.search-box {
    position: relative;
    max-width: 460px;
}

.search-box input {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.05);
    color: white;
    border-radius: 18px;
    padding: 16px 18px;
    outline: none;
    font-size: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.search-box input:focus {
    border-color: rgba(255, 140, 26, 0.42);
    box-shadow: 0 0 0 4px rgba(255, 140, 26, 0.10);
}

.search-box input::placeholder {
    color: #b8aea2;
}

.search-info {
    color: var(--muted);
    font-size: 14px;
}

.search-empty {
    margin-top: 18px;
}

/* GRID + CARDS */

.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 22px;
}

.script-card {
    position: relative;
    min-height: 480px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow);
    transform: translateY(0);
    transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease, opacity .3s ease;
}

.script-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 140, 26, 0.28);
    box-shadow: 0 25px 90px rgba(0, 0, 0, 0.52);
}

.script-card::after {
    content: "";
    position: absolute;
    inset: auto -20% -40% auto;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255, 140, 26, 0.14), transparent 70%);
    pointer-events: none;
}

.script-card-bg,
.script-card-overlay {
    position: absolute;
    inset: 0;
}

.script-card-bg {
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
}

.script-card-overlay {
    background:
        linear-gradient(180deg, rgba(9, 9, 13, 0.12) 0%, rgba(9, 9, 13, 0.72) 48%, rgba(9, 9, 13, 0.96) 100%);
}

.script-card-content {
    position: relative;
    z-index: 2;
    height: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 18px;
}

.script-card-top h3 {
    margin: 0;
    font-size: 30px;
    line-height: 1.05;
}

.embed-block {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255,255,255,0.07);
    backdrop-filter: blur(8px);
}

.embed-label {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ffb366;
    margin-bottom: 8px;
}

.embed-value {
    word-break: break-word;
    line-height: 1.6;
    font-size: 15px;
}

.embed-value a {
    color: #fff0df;
}

.code-box {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.26);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff0df;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.7;
    word-break: break-word;
    white-space: pre-wrap;
}

.script-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* REVEAL */

.reveal-card {
    opacity: 0;
    transform: translateY(26px) scale(0.985);
}

.reveal-card.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity .65s ease, transform .65s ease;
}

/* BUTTONS */

.btn {
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 18px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 14px;
    transition: .25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 10px 14px;
    font-size: 12px;
    border-radius: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: white;
    box-shadow: 0 8px 30px rgba(255, 94, 0, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.btn-outline {
    background: rgba(255,255,255,0.05);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.09);
}

.btn-discord {
    background: linear-gradient(135deg, #5865f2, #4752c4);
    color: white;
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.35);
}

.btn-discord:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.btn-danger {
    background: rgba(255, 77, 79, 0.14);
    color: #ffb3b4;
    border: 1px solid rgba(255, 77, 79, 0.22);
}

.btn-danger:hover {
    background: rgba(255, 77, 79, 0.2);
}

.copy-btn.copied {
    filter: brightness(1.08);
}

/* EMPTY / CARDS */

.empty-public,
.empty-state,
.table-card,
.admin-login-card {
    background: rgba(18, 18, 26, 0.84);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 28px;
}

.empty-public,
.empty-state {
    padding: 34px;
    text-align: center;
}

.table-card {
    padding: 20px;
}

.form-card {
    max-width: 860px;
}

/* ADMIN */

.admin-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 94, 0, 0.09), transparent 20%),
        linear-gradient(180deg, #0b0b10 0%, #101018 100%);
}

.admin-login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.admin-login-card {
    width: min(100%, 480px);
    padding: 34px;
}

.admin-login-card h1 {
    margin: 18px 0 8px;
    font-size: 42px;
}

.admin-shell {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    border-right: 1px solid rgba(255,255,255,0.06);
    background: rgba(8, 8, 12, 0.75);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
}

.admin-logo {
    font-size: 28px;
    font-weight: 800;
}

.admin-subtitle {
    color: var(--muted);
    margin-top: 6px;
}

.admin-nav {
    display: grid;
    gap: 10px;
}

.admin-nav a {
    padding: 14px 16px;
    border-radius: 14px;
    color: #e9e0d5;
    background: transparent;
    border: 1px solid transparent;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
}

.admin-footer-box {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}

.admin-main {
    padding: 28px;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: #ffc48a;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-thumb {
    width: 84px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.08);
}

.status {
    display: inline-flex;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-active {
    background: rgba(56, 211, 159, 0.12);
    color: #aff0d8;
}

.status-hidden {
    background: rgba(255,255,255,0.08);
    color: #d0c5b8;
}

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

/* FORMS */

label {
    display: block;
    margin: 16px 0 8px;
    font-size: 14px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: white;
    border-radius: 14px;
    padding: 14px 16px;
    outline: none;
    font-size: 15px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(255, 140, 26, 0.42);
    box-shadow: 0 0 0 4px rgba(255, 140, 26, 0.12);
}

textarea {
    min-height: 130px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

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

.checkbox-row input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.image-preview-box {
    margin-top: 8px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    max-width: 420px;
}

.image-preview-box img {
    width: 100%;
    height: auto;
    display: block;
}

/* ALERTS */

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin: 18px 0;
    font-size: 14px;
}

.alert-error {
    background: rgba(255, 77, 79, 0.12);
    color: #ffb6b7;
    border: 1px solid rgba(255, 77, 79, 0.18);
}

.alert-success {
    background: rgba(56, 211, 159, 0.12);
    color: #aff0d8;
    border: 1px solid rgba(56, 211, 159, 0.18);
}

/* ANIMATIONS */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatGlow {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.24;
    }
    25% {
        transform: translate3d(30px, -18px, 0) scale(1.08);
        opacity: 0.34;
    }
    50% {
        transform: translate3d(12px, 12px, 0) scale(1.16);
        opacity: 0.28;
    }
    75% {
        transform: translate3d(-18px, -12px, 0) scale(1.06);
        opacity: 0.36;
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.24;
    }
}

/* RESPONSIVE */

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

    .admin-sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .section-head,
    .admin-header {
        display: grid;
        grid-template-columns: 1fr;
    }

    .script-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .hero {
        min-height: auto;
        padding-top: 60px;
    }

    .script-card {
        min-height: 420px;
    }

    .script-actions {
        grid-template-columns: 1fr;
    }

    .admin-main {
        padding: 18px;
    }

    .admin-login-card {
        padding: 24px;
    }

    .topbar {
        padding-top: 16px;
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions {
        width: 100%;
    }

    .topbar-actions .btn {
        flex: 1 1 auto;
    }

    .ambient {
        opacity: 0.20;
    }

    .search-box {
        max-width: 100%;
    }
}