:root {
    --bg: #070a0f;
    --panel: #0c111a;
    --card: #0f1623;
    --card2: #0b1220;
    --line: #182335;
    --text: #e8eef7;
    --muted: #93a4b8;
    --brand: #19c37d;
    --warn: #f7b955;
    --danger: #ff4d4d;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --r: 18px;
}

* {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
}
body {
    margin: 0;
    font-family:
        ui-sans-serif,
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Arial;
    background:
        radial-gradient(
            1200px 800px at 20% -10%,
            rgba(25, 195, 125, 0.12),
            transparent 60%
        ),
        radial-gradient(
            900px 700px at 90% 10%,
            rgba(86, 132, 255, 0.1),
            transparent 55%
        ),
        var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(7, 10, 15, 0.76);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    gap: 12px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.2px;
}
.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 6px rgba(25, 195, 125, 0.12);
}
.pill {
    font-size: 12px;
    color: var(--muted);
    border: 1px solid var(--line);
    padding: 4px 10px;
    border-radius: 999px;
}

.actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn {
    border: 1px solid var(--line);
    background: rgba(15, 22, 35, 0.7);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 14px;
    cursor: pointer;
    transition:
        transform 0.05s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}
.btn:hover {
    background: rgba(20, 30, 48, 0.85);
    border-color: #243552;
}
.btn:active {
    transform: scale(0.99);
}
.btn.primary {
    background: rgba(25, 195, 125, 0.18);
    border-color: rgba(25, 195, 125, 0.35);
}
.btn.primary:hover {
    background: rgba(25, 195, 125, 0.26);
}
.btn.ghost {
    background: transparent;
}

.user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(12, 17, 26, 0.6);
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #0b1220;
}
.user .name {
    font-weight: 800;
    line-height: 1.1;
}
.user .sub {
    color: var(--muted);
    font-size: 12px;
}

.hamb {
    display: none;
}
.menu {
    display: flex;
    align-items: center;
    gap: 10px;
}
.menu a {
    color: var(--muted);
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid transparent;
}
.menu a:hover {
    color: var(--text);
    border-color: var(--line);
    background: rgba(12, 17, 26, 0.55);
}

@media (max-width: 860px) {
    .hamb {
        display: inline-flex;
    }
    .menu {
        display: none;
    }
}

/* mobile drawer */
.drawer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    z-index: 30;
}
.drawer.open {
    display: block;
}
.drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(360px, 92vw);
    background: rgba(12, 17, 26, 0.96);
    border-left: 1px solid var(--line);
    padding: 16px;
    box-shadow: var(--shadow);
}
.drawer a {
    display: block;
    padding: 12px 12px;
    margin: 6px 0;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(15, 22, 35, 0.6);
    color: var(--text);
}
.drawer a.muted {
    opacity: 0.55;
    pointer-events: none;
}

.header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin: 16px 0;
}
.h1 {
    font-size: 22px;
    margin: 0;
}
.muted {
    color: var(--muted);
    font-size: 13px;
}

.search {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: rgba(12, 17, 26, 0.55);
    border-radius: 16px;
}
.search input {
    width: 260px;
    max-width: 45vw;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}
.search input::placeholder {
    color: rgba(147, 164, 184, 0.7);
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
@media (max-width: 1050px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 720px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: linear-gradient(
        180deg,
        rgba(15, 22, 35, 0.9),
        rgba(11, 18, 32, 0.88)
    );
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 14px;
    box-shadow: var(--shadow);
}
.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.card-title {
    font-weight: 900;
}
.badge-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(25, 195, 125, 0.35);
    background: rgba(25, 195, 125, 0.12);
    color: var(--text);
    font-size: 12px;
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 6px rgba(25, 195, 125, 0.12);
}

.video {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 16px;
    background: #000;
    border: 1px solid rgba(24, 35, 53, 0.9);
    display: block;
}
.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.code {
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", monospace;
    font-size: 12px;
    color: rgba(147, 164, 184, 0.92);
    background: rgba(7, 10, 15, 0.55);
    border: 1px solid var(--line);
    padding: 8px 10px;
    border-radius: 14px;
    margin-top: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toast {
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(25, 195, 125, 0.08);
    margin: 0 0 12px 0;
}
.toast.err {
    border-left-color: var(--danger);
    background: rgba(255, 77, 77, 0.08);
}
