:root {
    --bg: #03070d;
    --bg-2: #07111d;
    --panel: rgba(10, 20, 36, 0.86);
    --panel-2: rgba(16, 29, 49, 0.82);
    --line: rgba(124, 242, 255, 0.16);
    --text: #edf9ff;
    --muted: #96aabb;
    --cyan: #7cf2ff;
    --cyan-2: #1fc3db;
    --lime: #26ff6b;
    --red: #ff6f7a;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    --radius-lg: 22px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(124, 242, 255, 0.12), transparent 34%),
        radial-gradient(circle at bottom right, rgba(38, 255, 107, 0.08), transparent 30%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 38%, var(--bg) 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.8) 0 1px, transparent 1px),
        radial-gradient(circle at 80% 32%, rgba(255,255,255,0.7) 0 1px, transparent 1px),
        radial-gradient(circle at 70% 80%, rgba(255,255,255,0.65) 0 1px, transparent 1px),
        radial-gradient(circle at 30% 65%, rgba(255,255,255,0.6) 0 1px, transparent 1px);
    opacity: 0.38;
}

img {
    max-width: 100%;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

button,
input {
    font: inherit;
}

.shell {
    width: min(1460px, calc(100% - 30px));
    margin: 18px auto;
    display: grid;
    grid-template-columns: 330px 1fr;
    gap: 22px;
    position: relative;
    z-index: 1;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.sidebar {
    padding: 20px;
    position: sticky;
    top: 18px;
    height: fit-content;
}

.eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--cyan);
    margin-bottom: 10px;
}

.sidebar h1 {
    margin: 0 0 12px;
    font-size: 1.7rem;
    line-height: 1.1;
}

.sidebar p,
.section-head p,
.preview-info p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.form-box,
.status-box,
.payload-box {
    margin-top: 18px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-md);
    padding: 14px;
}

.form-box label {
    display: block;
    font-size: 0.86rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.form-box input {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
}

.form-box input:focus {
    border-color: rgba(124, 242, 255, 0.42);
    box-shadow: 0 0 0 3px rgba(124, 242, 255, 0.12);
}


.session-user-box {
    border: 1px solid rgba(124,242,255,0.14);
    background: rgba(124,242,255,0.06);
    color: var(--text);
    border-radius: 12px;
    padding: 12px 14px;
    min-height: 48px;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-grid {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    grid-template-columns: 1fr;
}

.btn {
    border: 0;
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
    color: #041018;
    box-shadow: 0 10px 24px rgba(124, 242, 255, 0.22);
}

.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.06);
}

.btn-danger {
    background: linear-gradient(135deg, #ff8c95, var(--red));
    color: #20070a;
}

.status-box {
    color: var(--cyan);
    min-height: 78px;
}

.payload-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.payload-box pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.84rem;
    color: #bfefff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.main {
    display: grid;
    gap: 22px;
}

.hero-panel {
    padding: 20px;
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(280px, 420px);
    gap: 22px;
}

.preview-stage {
    min-height: 640px;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(124, 242, 255, 0.14);
    background:
        radial-gradient(circle at top, rgba(124, 242, 255, 0.08), transparent 35%),
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}

.preview-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(124, 242, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 242, 255, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.95), transparent 98%);
}

.preview-body {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    max-width: 86%;
    max-height: 92%;
    object-fit: contain;
    filter: drop-shadow(0 18px 30px rgba(0,0,0,0.45));
}

.preview-head-card {
    position: absolute;
    top: 16px;
    right: 16px;
    width: min(30%, 230px);
    aspect-ratio: 1 / 1.08;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    backdrop-filter: blur(8px);
}

.preview-head {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 12px 22px rgba(0,0,0,0.4));
}

.preview-info {
    display: grid;
    gap: 16px;
    align-content: start;
}

.badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(38,255,107,0.1);
    border: 1px solid rgba(38,255,107,0.18);
    color: var(--lime);
    font-size: 0.84rem;
}

.preview-info h2,
.section-head h3 {
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stat-card {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}

.stat-card span {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 7px;
}

.section-panel {
    padding: 20px;
}

.section-head {
    margin-bottom: 16px;
}

.avatar-grid,
.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.card {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.07);
    background: var(--panel-2);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(124, 242, 255, 0.3);
    box-shadow: 0 14px 26px rgba(0,0,0,0.25);
}

.card.active {
    border-color: rgba(124, 242, 255, 0.58);
    box-shadow: 0 0 0 1px rgba(124,242,255,0.2), 0 12px 24px rgba(0,0,0,0.28);
}

.card-image {
    aspect-ratio: 4 / 5;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, rgba(124, 242, 255, 0.08), transparent 45%), rgba(255,255,255,0.02);
}

.card-image img {
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.45));
}

.card-body {
    padding: 12px 14px 14px;
}

.card-title {
    font-weight: 700;
    margin-bottom: 5px;
}

.card-subtitle {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.theme-pill {
    display: inline-flex;
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    border: 1px solid rgba(255,255,255,0.08);
}

.theme-cyan {
    color: var(--cyan);
    background: rgba(124,242,255,0.08);
}

.theme-orange {
    color: #ffbc66;
    background: rgba(255,179,71,0.1);
}

.empty-box {
    padding: 18px;
    border-radius: 16px;
    border: 1px dashed rgba(255,255,255,0.12);
    color: var(--muted);
    background: rgba(255,255,255,0.02);
}

@media (max-width: 1180px) {
    .shell,
    .hero-panel {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .preview-stage {
        min-height: 460px;
    }
}

@media (max-width: 700px) {
    .shell {
        width: min(100% - 14px, 1460px);
        margin: 8px auto 16px;
        gap: 14px;
    }

    .sidebar,
    .section-panel,
    .hero-panel {
        padding: 16px;
    }

    .preview-stage {
        min-height: 360px;
    }

    .preview-head-card {
        width: 36%;
        min-width: 110px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
