:root {
    --bg: #0a0910;
    --surface: #141219;
    --surface-soft: #1a1820;
    --surface-card: #201d26;
    --surface-elevated: #26222f;
    --border: rgba(255, 255, 255, 0.08);
    --border-soft: rgba(255, 214, 102, 0.18);
    --text: #f7f3ec;
    --muted: #aca5b5;
    --gold: #d8a43b;
    --gold-strong: #f0c05b;
    --danger: #ff6f79;
    --shadow: 0 22px 55px rgba(0, 0, 0, 0.45);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --max-width: 1280px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top center, rgba(124, 66, 198, 0.18), transparent 30%),
        linear-gradient(180deg, #17131d 0%, #0b0910 46%, #08070d 100%);
    overflow-x: hidden;
}

button,
input {
    font: inherit;
}

.site-shell {
    min-height: 100vh;
    padding: 0;
}

.view {
    display: none;
    width: 100%;
    max-width: none;
    margin: 0 auto;
}

.view.active {
    display: block;
    animation: fadeUp 0.28s ease;
}

.panel {
    background: linear-gradient(180deg, rgba(26, 23, 31, 0.98) 0%, rgba(17, 15, 22, 0.98) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.eyebrow,
.brand-kicker,
.empty-kicker {
    color: var(--gold-strong);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
    font-family: 'Rajdhani', sans-serif;
}

h1 {
    font-size: clamp(2.8rem, 5vw, 4.8rem);
    line-height: 0.92;
}

h2 {
    font-size: 1.9rem;
}

h3 {
    font-size: 2rem;
}

h4 {
    font-size: 1.35rem;
}

.lede,
.modal-copy,
.empty-state p,
.auth-point p {
    color: var(--muted);
    line-height: 1.7;
}

.btn {
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

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

.btn-primary {
    padding: 0.95rem 1.5rem;
    color: #1b1306;
    background: linear-gradient(180deg, #f3c760 0%, #d69a2f 100%);
    box-shadow: 0 12px 26px rgba(214, 154, 47, 0.24);
}

.btn-soft {
    padding: 0.95rem 1.35rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.btn-soft:hover {
    border-color: var(--border-soft);
    background: rgba(255, 255, 255, 0.08);
}

.hidden {
    display: none !important;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: linear-gradient(180deg, #f0c05b 0%, #af7723 100%);
    box-shadow: 0 0 0 5px rgba(216, 164, 59, 0.12);
}

.lobby-shell {
    min-height: 100vh;
    padding: 24px 28px 28px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background:
        linear-gradient(180deg, rgba(28, 24, 35, 0.98) 0%, rgba(18, 15, 24, 0.98) 100%);
}

.lobby-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 10px 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar-actions,
.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-banner {
    position: relative;
    overflow: hidden;
    min-height: 360px;
    margin-top: 18px;
    padding: 54px 46px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 70% 35%, rgba(115, 57, 194, 0.45), transparent 26%),
        linear-gradient(90deg, rgba(23, 20, 30, 0.98) 0%, rgba(31, 25, 39, 0.86) 52%, rgba(57, 31, 88, 0.82) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(14, 12, 18, 0.4) 0%, transparent 44%);
}

.hero-copy,
.hero-visual {
    position: relative;
    z-index: 1;
}

.hero-copy {
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.hero-visual {
    position: absolute;
    inset: 0 0 0 auto;
    width: 42%;
}

.visual-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(6px);
}

.orb-a {
    width: 220px;
    height: 220px;
    right: 80px;
    top: 44px;
    background: radial-gradient(circle, rgba(255, 105, 180, 0.32), transparent 70%);
}

.orb-b {
    width: 260px;
    height: 260px;
    right: 0;
    top: 20px;
    background: radial-gradient(circle, rgba(105, 74, 255, 0.34), transparent 70%);
}

.visual-card {
    position: absolute;
    border-radius: 30px;
    transform: rotate(-12deg);
    opacity: 0.9;
}

.card-a {
    width: 180px;
    height: 240px;
    right: 90px;
    top: 82px;
    background: linear-gradient(180deg, rgba(237, 91, 144, 0.9), rgba(66, 33, 109, 0.85));
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
}

.card-b {
    width: 130px;
    height: 180px;
    right: 220px;
    top: 130px;
    background: linear-gradient(180deg, rgba(240, 192, 91, 0.95), rgba(159, 97, 18, 0.88));
    box-shadow: 0 20px 38px rgba(0, 0, 0, 0.25);
}

.category-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    margin-top: 18px;
    padding: 10px 2px 4px;
}

.category-strip::-webkit-scrollbar,
.games-rail::-webkit-scrollbar {
    height: 8px;
}

.category-strip::-webkit-scrollbar-thumb,
.games-rail::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.category-pill {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: #17141c;
    color: var(--muted);
    border-radius: 999px;
    padding: 0.95rem 1.2rem;
    cursor: pointer;
    font-weight: 800;
}

.category-pill.active,
.category-pill:hover {
    color: var(--gold-strong);
    border-color: rgba(216, 164, 59, 0.2);
    background: #1d1922;
}

.games-section {
    padding: 30px 4px 8px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 18px;
}

.meta-count {
    color: var(--muted);
    font-weight: 700;
}

.empty-state {
    margin-bottom: 20px;
    padding: 28px;
    border-radius: 20px;
    background: linear-gradient(180deg, #1c1822 0%, #141118 100%);
    border: 1px solid var(--border);
    text-align: center;
}

.games-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(200px, 200px);
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.game-card {
    position: relative;
    min-height: 300px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, #2d2421 0%, #211920 42%, #17141b 100%);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: rgba(216, 164, 59, 0.34);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.35);
}

.game-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 187, 92, 0.22) 0%, rgba(23, 20, 27, 0.2) 46%, rgba(10, 9, 14, 0.64) 100%);
    pointer-events: none;
}

.game-poster {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(255, 204, 102, 0.16), transparent 24%),
        linear-gradient(140deg, rgba(131, 71, 29, 0.85), rgba(53, 22, 18, 0.7) 45%, rgba(30, 20, 37, 0.86) 100%);
}

.game-card-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    gap: 10px;
}

.game-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.game-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.28);
    color: #f0d58b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.game-title {
    font-size: 1.85rem;
    line-height: 0.96;
}

.game-path {
    color: #d4cfdb;
    font-size: 0.82rem;
    opacity: 0.8;
    min-height: 38px;
    word-break: break-word;
}

.game-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.launch-link {
    color: var(--gold-strong);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.btn-delete {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 111, 121, 0.35);
    border-radius: 10px;
    background: rgba(255, 111, 121, 0.12);
    color: var(--danger);
    font-weight: 800;
    cursor: pointer;
}

.auth-layout {
    min-height: calc(100vh - 56px);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.85fr);
    gap: 24px;
    align-items: center;
}

.auth-copy,
.auth-card {
    padding: 36px;
}

.auth-copy {
    display: grid;
    gap: 18px;
}

.auth-points {
    display: grid;
    gap: 16px;
}

.auth-point {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.point-index {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.4rem;
    color: var(--gold-strong);
}

.auth-form {
    display: grid;
    gap: 16px;
    margin-top: 28px;
}

.input-group {
    display: grid;
    gap: 8px;
}

.input-group label {
    color: #e4d7b8;
    font-size: 0.92rem;
    font-weight: 700;
}

.input-group input {
    width: 100%;
    padding: 15px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    outline: none;
}

.input-group input:focus {
    border-color: rgba(216, 164, 59, 0.42);
    box-shadow: 0 0 0 4px rgba(216, 164, 59, 0.1);
}

.status-message {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.status-message.error {
    background: rgba(255, 111, 121, 0.12);
    color: #ffbcc2;
    border: 1px solid rgba(255, 111, 121, 0.22);
}

.play-header {
    position: absolute;
    inset: 24px 24px auto;
    z-index: 10;
}

.play-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: rgba(18, 15, 22, 0.8);
}

#play-view {
    position: relative;
    width: 100%;
    max-width: none;
    min-height: 100vh;
}

#game-iframe {
    display: block;
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    background: #000;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 4, 8, 0.78);
    backdrop-filter: blur(12px);
    z-index: 30;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    width: min(100%, 620px);
    padding: 32px;
    position: relative;
}

.btn-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
}

.upload-zone {
    margin-top: 22px;
    padding: 34px 24px;
    border-radius: 22px;
    border: 1px dashed rgba(216, 164, 59, 0.34);
    background: linear-gradient(180deg, rgba(216, 164, 59, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.upload-zone.dragover {
    background: linear-gradient(180deg, rgba(216, 164, 59, 0.12) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.upload-graphic {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: rgba(216, 164, 59, 0.12);
    border: 1px solid rgba(216, 164, 59, 0.18);
}

.upload-graphic span {
    width: 30px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(180deg, #f0c05b 0%, #a96b1b 100%);
    clip-path: polygon(0 0, 76% 0, 100% 24%, 100% 100%, 0 100%);
}

.upload-title {
    font-size: 1.15rem;
    font-weight: 800;
}

.upload-subtitle,
.progress-text {
    color: var(--muted);
}

.progress-panel {
    margin-top: 18px;
}

.progress-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #f3c760 0%, #d69a2f 100%);
    border-radius: inherit;
    transition: width 0.25s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .site-shell {
        padding: 0;
    }

    .auth-layout {
        grid-template-columns: 1fr;
    }

    .lobby-shell {
        padding: 18px 16px 22px;
    }

    .lobby-topbar,
    .section-heading,
    .play-header-inner {
        flex-direction: column;
        align-items: start;
    }

    .hero-banner {
        min-height: 320px;
        padding: 34px 26px;
    }

    .hero-visual {
        width: 38%;
    }
}

@media (max-width: 720px) {
    h1 {
        font-size: 2.7rem;
    }

    .hero-visual {
        display: none;
    }

    .games-rail {
        grid-auto-columns: minmax(180px, 180px);
    }

    .auth-copy,
    .auth-card,
    .modal-card {
        padding: 24px;
    }

    .games-section {
        padding-top: 24px;
    }
}
