:root {
    --bg: #0a0a0b;
    --bg-2: #0f1012;
    --panel: #131417;
    --panel-2: #181a1e;
    --line: #24262b;
    --silver: #cfd3d9;
    --silver-dim: #8b9098;
    --text: #e7e9ec;
    --muted: #7d828b;
    --accent: #cfd3d9;
    --ok: #79c98a;
    --bad: #e05a5a;
    --radius: 14px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 28px;
    height: 68px;
    padding: 0 26px;
    background: rgba(10, 10, 11, 0.82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 30px; }
.brand-word { height: 20px; opacity: 0.92; }

.nav { display: flex; gap: 6px; }
.nav a {
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    color: var(--silver-dim);
    font-size: 14px;
    transition: .18s;
}
.nav a:hover, .nav a.active { color: var(--text); background: var(--panel); }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.user-chip {
    display: flex; align-items: center; gap: 9px;
    padding: 6px 14px 6px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    font-size: 14px;
}
.user-chip img { width: 26px; height: 26px; border-radius: 50%; }

/* ---------- buttons ---------- */

.btn {
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #1c1e22, #141518);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: .18s;
}
.btn:hover { border-color: #3a3d44; background: linear-gradient(180deg, #23262b, #191b1f); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.primary {
    background: linear-gradient(180deg, #e9ecef, #c3c8cf);
    color: #0a0a0b;
    border-color: transparent;
    font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- layout ---------- */

.layout {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 24px 60px;
}
.content { flex: 1; min-width: 0; max-width: 880px; }

/* ---------- promo / admin ---------- */

.promo-card { max-width: 560px; }
.promo-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.promo-row input {
    flex: 1; min-width: 160px; padding: 10px 13px;
    background: #0c0d0f; border: 1px solid var(--line); border-radius: var(--radius-sm);
    color: var(--text); font-size: 14px; outline: none;
}
.promo-row input:focus { border-color: var(--silver); }
.promo-row select {
    padding: 10px 13px; background: #0c0d0f; border: 1px solid var(--line);
    border-radius: var(--radius-sm); color: var(--text); font-size: 14px; outline: none;
}

.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--panel-2); font-size: 13px;
}
.admin-row b { min-width: 120px; }
.admin-row .ok { color: var(--ok); }
.admin-row .btn { margin-left: auto; }
.admin-row .btn + .btn { margin-left: 0; }

.muted { color: var(--muted); font-size: 13px; }

.role-owner { color: #f0d27a; }
.role-admin { color: #e08a5a; }
.role-moder { color: #79a5e0; }
.role-user { color: var(--silver); }

/* ---------- hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: radial-gradient(120% 140% at 50% -30%, #1a1c20 0%, #0c0d0f 60%, #08090a 100%);
    padding: 54px 44px 48px;
    text-align: center;
}
.hero-logo { height: 96px; margin-bottom: 18px; }
.hero-word { height: 34px; margin-bottom: 22px; }
.hero h1 { font-size: 40px; line-height: 1.1; margin: 0 0 12px; letter-spacing: .5px; }
.hero p { color: var(--muted); max-width: 620px; margin: 0 auto 26px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; }

.section { margin-top: 42px; }
.section h2 { font-size: 24px; margin: 0 0 6px; }
.section .sub { color: var(--muted); margin-bottom: 20px; }

/* ---------- grids ---------- */

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 20px;
    transition: .18s;
}
.card:hover { border-color: #33363d; background: var(--panel-2); }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ---------- screenshots ---------- */

.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.shot {
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: repeating-linear-gradient(45deg, #101114 0 12px, #0d0e10 12px 24px);
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 13px;
    overflow: hidden;
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.shot:hover img { transform: scale(1.03); }

/* ---------- pricing ---------- */

.plans { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.plan {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 20px 16px;
    text-align: center;
}
.plan.featured { border-color: var(--silver); box-shadow: 0 0 0 1px rgba(207,211,217,.25) inset; }
.plan .name { color: var(--silver-dim); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.plan .price { font-size: 28px; font-weight: 700; margin: 12px 0 4px; }
.plan .per { color: var(--muted); font-size: 13px; }
.plan .btn { margin-top: 16px; width: 100%; }

.pay-row { display: flex; gap: 12px; margin-top: 16px; }
.pay-option {
    flex: 1; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--panel); padding: 16px; cursor: pointer; transition: .18s;
}
.pay-option:hover { border-color: var(--silver); }

/* ---------- forms ---------- */

.form { max-width: 420px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 26px; }
.form h2 { margin: 0 0 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--silver-dim); margin-bottom: 6px; }
.field input {
    width: 100%; padding: 11px 13px;
    background: #0c0d0f; border: 1px solid var(--line); border-radius: var(--radius-sm);
    color: var(--text); font-size: 14px; outline: none;
}
.field input:focus { border-color: var(--silver); }
.form .btn { width: 100%; margin-top: 6px; }
.form-status { margin-top: 12px; font-size: 13px; min-height: 18px; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--bad); }
.form-switch { margin-top: 14px; color: var(--muted); font-size: 13px; text-align: center; }
.form-switch a { color: var(--silver); cursor: pointer; }

/* ---------- dashboard ---------- */

.dash-head { display: flex; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 22px; }
.dash-avatar { width: 62px; height: 62px; border-radius: 50%; border: 1px solid var(--line); }
.dash-name { font-size: 22px; font-weight: 600; }
.dash-role { color: var(--muted); font-size: 13px; }
.dash-sub { margin-left: auto; text-align: right; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.badge.on { color: var(--ok); border-color: rgba(121,201,138,.4); }
.badge.off { color: var(--bad); border-color: rgba(224,90,90,.4); }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.kv .card .k { color: var(--muted); font-size: 13px; }
.kv .card .v { font-size: 16px; margin-top: 6px; word-break: break-all; }

/* ---------- side ad ---------- */

.ad-slot {
    position: sticky; top: 88px;
    width: 240px; flex: 0 0 240px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--panel); padding: 14px;
}
.ad-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.ad-block {
    height: 220px; margin-bottom: 12px;
    border: 1px dashed var(--line); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; text-align: center;
    color: var(--muted); font-size: 13px; padding: 12px;
}

/* ---------- cookies ---------- */

.cookie-bar {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px;
    z-index: 60; display: flex; align-items: center; gap: 12px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
    padding: 10px 14px 10px 20px; font-size: 13px; color: var(--silver-dim);
    box-shadow: 0 20px 50px rgba(0,0,0,.5);
}

/* ---------- footer ---------- */

.footer {
    display: flex; align-items: center; gap: 20px;
    max-width: 1280px; margin: 0 auto; padding: 26px;
    border-top: 1px solid var(--line);
    color: var(--muted); font-size: 13px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { height: 22px; }
.footer-links { display: flex; gap: 16px; margin-left: auto; }
.footer-links a:hover { color: var(--silver); }

.toast {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 80px; z-index: 70;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 12px 18px; font-size: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.5);
}

@media (max-width: 1080px) {
    .ad-slot { display: none !important; }
    .plans { grid-template-columns: repeat(2, 1fr); }
    .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .nav { display: none; }
    .grid.cols-3, .shots { grid-template-columns: 1fr; }
    .plans { grid-template-columns: 1fr; }
    .hero h1 { font-size: 28px; }
}
