:root {
    color-scheme: dark;
    --bg: #0d1117;
    --surface: #151b23;
    --surface-2: #1f2933;
    --border: #303a46;
    --text: #e6edf3;
    --muted: #9aa7b4;
    --accent: #2f81f7;
    --accent-2: #3fb950;
    --danger: #f85149;
    --shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

:root[data-theme="green"] {
    color-scheme: dark;
    --bg: #020403;
    --surface: #06120b;
    --surface-2: #0b1d11;
    --border: #1f6f3a;
    --text: #d8ffe4;
    --muted: #81c995;
    --accent: #00ff66;
    --accent-2: #39ff14;
    --danger: #ff3864;
    --shadow: 0 20px 60px rgba(0, 255, 102, .12);
}

:root[data-theme="dark-blue"] {
    color-scheme: dark;
    --bg: #020611;
    --surface: #071121;
    --surface-2: #0b1c34;
    --border: #1f5f9f;
    --text: #d8ecff;
    --muted: #88bce8;
    --accent: #1ea7ff;
    --accent-2: #00d4ff;
    --danger: #ff3864;
    --shadow: 0 20px 60px rgba(30, 167, 255, .12);
}

:root[data-theme="dark-gray"] {
    color-scheme: dark;
    --bg: #050607;
    --surface: #111315;
    --surface-2: #1b1f23;
    --border: #5d6772;
    --text: #edf2f7;
    --muted: #a7b0ba;
    --accent: #cbd5e1;
    --accent-2: #94a3b8;
    --danger: #ff3864;
    --shadow: 0 20px 60px rgba(203, 213, 225, .1);
}

:root[data-theme="dark-red"] {
    color-scheme: dark;
    --bg: #0b0204;
    --surface: #18070b;
    --surface-2: #260c12;
    --border: #842838;
    --text: #ffe1e7;
    --muted: #e08a9a;
    --accent: #ff335f;
    --accent-2: #ff6b35;
    --danger: #ff3864;
    --shadow: 0 20px 60px rgba(255, 51, 95, .12);
}

* {
    box-sizing: border-box;
}

body {
    position: relative;
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at 20% 0%, rgba(47, 129, 247, .14), transparent 32rem), var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    display: none;
}

:root[data-theme="green"] body {
    background:
        linear-gradient(rgba(0, 255, 102, .035) 1px, transparent 1px),
        radial-gradient(circle at 20% 0%, rgba(0, 255, 102, .18), transparent 32rem),
        var(--bg);
    background-size: 100% 4px, auto, auto;
    font-family: "Cascadia Code", Consolas, ui-monospace, monospace;
}

:root[data-theme="dark-blue"] body {
    background:
        linear-gradient(rgba(30, 167, 255, .035) 1px, transparent 1px),
        radial-gradient(circle at 20% 0%, rgba(30, 167, 255, .18), transparent 32rem),
        var(--bg);
    background-size: 100% 4px, auto, auto;
    font-family: "Cascadia Code", Consolas, ui-monospace, monospace;
}

:root[data-theme="dark-gray"] body {
    background:
        linear-gradient(rgba(203, 213, 225, .035) 1px, transparent 1px),
        radial-gradient(circle at 20% 0%, rgba(203, 213, 225, .14), transparent 32rem),
        var(--bg);
    background-size: 100% 4px, auto, auto;
    font-family: "Cascadia Code", Consolas, ui-monospace, monospace;
}

:root[data-theme="dark-red"] body {
    background:
        linear-gradient(rgba(255, 51, 95, .035) 1px, transparent 1px),
        radial-gradient(circle at 20% 0%, rgba(255, 51, 95, .18), transparent 32rem),
        var(--bg);
    background-size: 100% 4px, auto, auto;
    font-family: "Cascadia Code", Consolas, ui-monospace, monospace;
}

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

input,
textarea,
button {
    font: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 3rem);
    background: rgba(13, 17, 23, .82);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

:root[data-theme="green"] .topbar {
    background: rgba(2, 4, 3, .88);
}

:root[data-theme="dark-blue"] .topbar {
    background: rgba(2, 6, 17, .88);
}

:root[data-theme="dark-gray"] .topbar {
    background: rgba(5, 6, 7, .88);
}

:root[data-theme="dark-red"] .topbar {
    background: rgba(11, 2, 4, .88);
}

.topbar-left {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
}

nav,
.actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.theme-switcher,
.language-switcher {
    display: inline-flex;
    grid-template-columns: none;
    align-items: center;
    gap: .55rem;
    min-height: 2.5rem;
    padding: .25rem .35rem .25rem .7rem;
    color: var(--text);
    background: color-mix(in srgb, var(--surface-2) 82%, transparent);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.theme-switcher span,
.language-switcher span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.theme-switcher select,
.language-switcher select {
    min-height: 2.5rem;
    padding: .5rem 2rem .5rem .85rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
    border-radius: 999px;
    cursor: pointer;
    outline: none;
}

.theme-switcher select:focus,
.language-switcher select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.container {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    min-height: 16rem;
    padding: 2rem 0;
}

.hero h1,
.section-heading h1 {
    max-width: 760px;
    margin: .25rem 0 0;
    font-size: clamp(2rem, 6vw, 4.4rem);
    line-height: 1;
}

.eyebrow {
    margin: 0;
    color: var(--accent-2);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.panel,
.auth-card {
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.panel {
    padding: 1.25rem;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 1rem;
}

.auth-card {
    width: min(100%, 420px);
    padding: 1.5rem;
}

.auth-controls {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.auth-card h1,
.panel h2 {
    margin: 0 0 .5rem;
}

.auth-card p,
.muted {
    color: var(--muted);
}

.stack {
    display: grid;
    gap: 1rem;
}

label {
    display: grid;
    gap: .45rem;
    color: var(--muted);
    font-size: .92rem;
}

input,
textarea {
    width: 100%;
    min-height: 2.75rem;
    padding: .75rem .85rem;
    color: var(--text);
    background: color-mix(in srgb, var(--bg) 82%, black);
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
}

input:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, .2);
}

textarea {
    min-height: 28rem;
    resize: vertical;
    font-family: "Cascadia Code", Consolas, monospace;
    line-height: 1.5;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: .62rem .9rem;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.button:hover {
    border-color: var(--accent);
}

.button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 700;
}

.button.ghost {
    background: transparent;
}

.button.danger {
    color: #fff;
    background: rgba(248, 81, 73, .18);
    border-color: rgba(248, 81, 73, .55);
}

.alert {
    margin: 1rem 0;
    padding: .85rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.alert-success {
    background: rgba(63, 185, 80, .12);
    border-color: rgba(63, 185, 80, .45);
}

.alert-error {
    background: rgba(248, 81, 73, .12);
    border-color: rgba(248, 81, 73, .45);
}

.admin-grid {
    display: grid;
    gap: 1rem;
}

.upload-page {
    max-width: 780px;
}

.upload-panel {
    padding: clamp(1rem, 4vw, 2rem);
}

.upload-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.upload-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    color: var(--bg);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: 1px solid color-mix(in srgb, var(--accent) 60%, var(--border));
    border-radius: 8px;
    box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 26%, transparent);
}

.upload-mark svg {
    width: 2.25rem;
    height: 2.25rem;
    fill: currentColor;
}

.upload-brand h1 {
    margin: .25rem 0 0;
    font-size: clamp(1.7rem, 5vw, 3rem);
    line-height: 1;
}

.admin-title {
    font-size: 1.75rem;
    line-height: 1.2;
}

.upload-panel .button,
.share-panel .button {
    width: fit-content;
}

.share-panel {
    margin-top: 1rem;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-heading form {
    flex: 0 0 auto;
}

.upload-form {
    margin-bottom: 1rem;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
}

.file-list {
    display: grid;
    gap: .75rem;
}

.file-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.file-row strong {
    display: block;
    overflow-wrap: anywhere;
}

.file-row span {
    display: block;
    margin-top: .2rem;
    color: var(--muted);
    font-size: .88rem;
}

.visitor-row {
    align-items: start;
}

.ban-form {
    display: flex;
    gap: .5rem;
}

.ban-form input {
    min-width: min(18rem, 44vw);
}

.ban-reason {
    color: var(--danger);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-top: 1rem;
}

.button.disabled {
    pointer-events: none;
    opacity: .45;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: .25rem .6rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
}

.editor-panel {
    position: relative;
}

.site-footer {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.25rem 0 2rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    font-size: .9rem;
    text-align: center;
}

.blocked-page {
    overflow: hidden;
}

.blocked-shell {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.blocked-shell::before,
.blocked-shell::after {
    content: "";
    position: absolute;
    width: 32rem;
    height: 32rem;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 28%, transparent), transparent 68%);
    filter: blur(4px);
    animation: blocked-float 10s ease-in-out infinite;
}

.blocked-shell::before {
    top: -12rem;
    left: -8rem;
}

.blocked-shell::after {
    right: -10rem;
    bottom: -14rem;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 68%);
    animation-delay: -5s;
}

.blocked-grid {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(color-mix(in srgb, var(--accent) 10%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent) 1px, transparent 1px);
    background-size: 3rem 3rem;
    mask-image: radial-gradient(circle at center, black, transparent 72%);
    animation: blocked-grid 14s linear infinite;
}

.blocked-card {
    position: relative;
    z-index: 1;
    width: min(100%, 560px);
    padding: clamp(1.5rem, 5vw, 3rem);
    text-align: center;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
    border-radius: 8px;
    box-shadow: var(--shadow), 0 0 70px color-mix(in srgb, var(--accent) 16%, transparent);
    animation: blocked-card 700ms ease both;
}

.blocked-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5.25rem;
    height: 5.25rem;
    margin-bottom: 1.25rem;
    color: var(--bg);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 8px;
    box-shadow: 0 0 36px color-mix(in srgb, var(--accent) 36%, transparent);
    animation: blocked-pulse 2.4s ease-in-out infinite;
}

.blocked-lock svg {
    width: 3rem;
    height: 3rem;
    fill: currentColor;
}

.blocked-card h1 {
    margin: .35rem 0 .75rem;
    font-size: clamp(2.3rem, 8vw, 4.8rem);
    line-height: 1;
}

.blocked-actions {
    display: flex;
    justify-content: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

@keyframes blocked-float {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(2rem, 1.5rem, 0) scale(1.08);
    }
}

@keyframes blocked-grid {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(3rem);
    }
}

@keyframes blocked-card {
    from {
        opacity: 0;
        transform: translateY(1rem) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes blocked-pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

@media (max-width: 760px) {
.topbar,
    .file-row,
    .section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-left {
        flex-direction: column;
        align-items: stretch;
    }

    .file-row,
    .inline-form {
        grid-template-columns: 1fr;
    }

    .actions,
    nav {
        width: 100%;
    }

    .actions .button,
    .actions form,
    nav .button {
        width: 100%;
    }
}
