﻿:root {
    --bg: #0f1117;
    --ink: #e5e7eb;
    --muted: #9aa4b2;
    --panel: #151a21;
    --panel-2: #11161d;
    --ring: #ffffff22;
    --ok: #7bd88f;
    --err: #ff7a7a;
    --accent: #7aa2ff;
}

body {
    -webkit-user-select: none;
    user-select: none;
}

input, select, textarea, button, a {
    -webkit-user-select: text;
    user-select: text;
}

* {
    box-sizing: border-box;
    font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

html, body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
}

/* site header */
.site-header {
    background: #11161d;
    border-bottom: 1px solid var(--ring);
    padding: 10px 16px;
}

    .site-header .brand {
        color: var(--ink);
        text-decoration: none;
        font-weight: 600;
    }

        .site-header .brand:hover {
            text-decoration: underline;
        }

.banner {
    background: #2a3140;
    border-bottom: 1px solid var(--ring);
    color: #ffd27e;
    padding: .6rem 1rem;
    font-size: .9rem;
    text-align: center;
}

.layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.wrap {
    display: grid;
    place-items: center;
}

.card {
    width: min(860px,92vw);
    background: var(--panel);
    border: 1px solid var(--ring);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.card-head h1 {
    margin: 0 0 .25rem;
    font-size: 1.25rem;
}

.sub {
    margin: .25rem 0 0;
    color: var(--muted);
}

.controls {
    display: grid;
    gap: .75rem;
    margin-top: .75rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: center;
}

.bar {
    display: flex;
    gap: .6rem;
    align-items: center;
}

.hint {
    color: var(--muted);
    font-size: .9rem;
}

.btn {
    padding: .65rem .9rem;
    background: #2a3140;
    color: var(--ink);
    border: 1px solid var(--ring);
    border-radius: 10px;
    cursor: pointer;
}

    .btn.sm {
        padding: .45rem .7rem;
        font-size: .9rem;
    }

    .btn:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

    .btn.primary {
        background: #30405d;
        border-color: #40537a;
    }

    .btn.ghost {
        background: transparent;
    }

    .btn.disabled, [aria-disabled="true"].btn {
        opacity: .5;
        pointer-events: none;
    }

select {
    padding: .55rem .7rem;
    background: #0b0f14;
    color: var(--ink);
    border: 1px solid var(--ring);
    border-radius: 10px;
}

.logs {
    background: var(--panel-2);
    border: 1px solid var(--ring);
    border-radius: 10px;
    margin-top: .5rem;
    padding: .5rem .75rem;
}

    .logs summary {
        cursor: pointer;
    }

pre {
    margin: .5rem 0 0;
    padding: .6rem;
    background: #0c1118;
    border-radius: 8px;
    max-height: 28vh;
    overflow: auto;
}

.sep {
    border: 0;
    border-top: 1px solid var(--ring);
    margin: 1rem 0;
}

.help {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

    .help h3 {
        margin: .1rem 0 .3rem;
        font-size: 1rem;
    }

    .help ul {
        padding-left: 1.1rem;
        margin: .2rem 0 .4rem;
    }

    .help li {
        margin: .1rem 0;
    }

.help-col {
    background: var(--panel-2);
    border: 1px solid var(--ring);
    border-radius: 10px;
    padding: .75rem;
}

.version-line {
    display: flex;
    gap: .6rem;
    align-items: center;
    margin: .2rem 0 .4rem;
}

.badge {
    display: inline-block;
    padding: .25rem .5rem;
    border-radius: 999px;
    border: 1px solid var(--ring);
    background: #0c1118;
    color: #cbd5e1;
    font-size: .85rem;
}

.ok {
    color: var(--ok);
}

.err {
    color: var(--err);
}

/* Right ad rail */
.ad-rail {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.ad-box {
    background: var(--panel);
    border: 1px solid var(--ring);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 16px;
}

/* Processing overlay */
#overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: #0008;
    z-index: 9998;
}

    #overlay .box {
        background: #11161d;
        border: 1px solid var(--ring);
        padding: 16px 20px;
        border-radius: 10px;
    }

/* Interstitial / modal overlays */
.ad-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #000c;
    place-items: center;
    z-index: 9999;
}

    .ad-overlay.open {
        display: grid;
    }

.ad-modal {
    width: min(860px,96vw);
    background: var(--panel);
    border: 1px solid var(--ring);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0,0,0,.45);
}

.ad-header, .ad-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--panel-2);
    border-bottom: 1px solid var(--ring);
}

.ad-footer {
    border-top: 1px solid var(--ring);
    border-bottom: none;
}

.muted {
    color: var(--muted);
}

.ad-body {
    padding: 14px;
}

.interstitial-video {
    width: 100%;
    height: 360px;
    object-fit: cover;
    border-radius: 10px;
}

/* Video tiles (300×250 / 300×600) */
.ad-video {
    position: relative;
    width: 100%;
    height: 250px;
    background: #0c1118;
    border: 1px solid var(--ring);
    border-radius: 8px;
    overflow: hidden;
}

    .ad-video.tall {
        height: 600px;
    }

    .ad-video video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .ad-video .ad-click {
        position: absolute;
        inset: 0;
    }

    .ad-video .ad-cta {
        position: absolute;
        right: 8px;
        bottom: 8px;
        padding: 4px 8px;
        font-size: .85rem;
        color: var(--ink);
        background: rgba(0,0,0,.55);
        border: 1px solid var(--ring);
        border-radius: 6px;
        pointer-events: none;
    }

/* Responsive */
@media (max-width:980px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .ad-rail {
        display: none;
    }
}
