:root {
    --bg: #070b12;
    --surface: #101722;
    --surface-light: #172130;
    --line: rgba(255, 255, 255, 0.09);
    --text: #f3f7fb;
    --muted: #91a0b3;
    --green: #17d566;
    --green-dark: #0ba94d;
    --danger: #ff6b6b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input {
    font: inherit;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.brand-mark {
    display: inline-grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border-radius: 22px;
    background: linear-gradient(145deg, var(--green), var(--green-dark));
    color: #04150b;
    font-size: 1.45rem;
    font-weight: 900;
    box-shadow: 0 20px 45px rgba(23, 213, 102, 0.2);
}

.brand-mark.small {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 0.82rem;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        radial-gradient(circle at 10% 20%, rgba(23, 213, 102, 0.16), transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(39, 88, 255, 0.12), transparent 28%),
        var(--bg);
}

.login-shell {
    display: grid;
    width: min(1040px, 100%);
    grid-template-columns: 1.05fr 0.95fr;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: rgba(16, 23, 34, 0.96);
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.45);
}

.login-brand,
.login-card {
    padding: clamp(34px, 6vw, 72px);
}

.login-brand {
    display: flex;
    min-height: 620px;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--line);
    background:
        linear-gradient(150deg, rgba(23, 213, 102, 0.12), transparent 55%),
        var(--surface);
}

.login-brand .brand-mark {
    margin-bottom: 48px;
}

.login-brand h1,
.login-card h2,
.page-heading h1 {
    margin: 0;
    line-height: 1.05;
}

.login-brand h1 {
    max-width: 420px;
    font-size: clamp(2.8rem, 7vw, 5.3rem);
    letter-spacing: -0.07em;
}

.login-brand .login-description,
.page-heading > p:last-child {
    max-width: 440px;
    color: var(--muted);
    line-height: 1.7;
}

.login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
}

.login-card h2 {
    font-size: 2rem;
}

.login-card form {
    display: grid;
    gap: 12px;
}

.login-card label {
    margin-top: 8px;
    color: #cbd5e1;
    font-size: 0.88rem;
    font-weight: 700;
}

.login-card input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 13px;
    outline: none;
    background: #0b111a;
    color: var(--text);
    padding: 15px 16px;
}

.login-card input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(23, 213, 102, 0.12);
}

.login-card button,
.button-secondary {
    border: 0;
    border-radius: 13px;
    cursor: pointer;
    font-weight: 800;
}

.login-card button {
    margin-top: 16px;
    background: var(--green);
    color: #04150b;
    padding: 15px;
}

.login-card button:hover {
    background: #36e77d;
}

.alert-error {
    margin: 0;
    border: 1px solid rgba(255, 107, 107, 0.25);
    border-radius: 12px;
    background: rgba(255, 107, 107, 0.08);
    color: #ff9c9c;
    padding: 12px 14px;
}

.test-users {
    display: grid;
    gap: 7px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
    padding-top: 22px;
}

.test-users strong {
    color: #d6dee8;
}

.test-users code {
    color: var(--green);
}

.build-version {
    margin-top: 8px;
    color: #7f8b99;
    font-size: 0.76rem;
}

.topbar {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 11, 18, 0.88);
    padding: 12px clamp(20px, 5vw, 72px);
}

.brand-inline,
.user-box {
    display: flex;
    align-items: center;
}

.brand-inline {
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}

.user-box {
    gap: 20px;
}

.dashboard-page.game-active .topbar .user-box {
    display: none;
}

.user-box > div {
    display: grid;
    gap: 3px;
    text-align: right;
}

.user-box span {
    color: var(--muted);
    font-size: 0.82rem;
}

.user-box strong {
    color: var(--green);
}

.button-secondary {
    border: 1px solid var(--line);
    background: var(--surface-light);
    color: var(--text);
    padding: 10px 16px;
}

.dashboard-content {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: clamp(48px, 8vw, 92px) 0;
}

.dashboard-content--game {
    width: calc(100% - 32px);
    padding: 16px 0;
}

.page-heading h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    letter-spacing: -0.06em;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
    margin-top: 48px;
}

.game-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-align: left;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease;
}

.game-card:hover {
    border-color: rgba(23, 213, 102, 0.55);
    transform: translateY(-5px);
}

.game-logo {
    display: grid;
    min-height: 190px;
    place-items: center;
    background:
        radial-gradient(circle, rgba(23, 213, 102, 0.2), transparent 62%),
        #090f17;
    padding: 36px;
}

.game-logo img {
    display: block;
    width: min(100%, 300px);
    height: auto;
}

.game-card-body {
    padding: 24px;
}

.game-card-body h2 {
    margin: 16px 0 8px;
    font-size: 1.7rem;
}

.game-card-body p {
    min-height: 45px;
    color: var(--muted);
    line-height: 1.5;
}

.game-card-body > strong,
.status-dot {
    color: var(--green);
}

.status-dot {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.iframe-page {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.game-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: white;
}

.game-embed {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(100dvh - 108px);
    min-height: 620px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.game-embed[hidden] {
    display: none;
}

.game-toolbar {
    display: grid;
    min-height: 44px;
    flex: 0 0 44px;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border-bottom: 1px solid var(--green-dark);
    background: var(--green);
    color: #04150b;
    padding: 0 6px;
}

.game-toolbar-title {
    justify-self: center;
    font-size: 0.95rem;
}

.game-toolbar-actions {
    display: flex;
    justify-self: end;
}

.game-toolbar-button {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 8px;
    text-decoration: none;
    transition: background 140ms ease, color 140ms ease;
}

.game-toolbar-button:hover,
.game-toolbar-button:focus-visible {
    background: rgba(4, 21, 11, 0.14);
    color: #04150b;
    outline: none;
}

.game-toolbar-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.game-embed .game-frame {
    min-height: 0;
    flex: 1;
    height: auto;
}

.game-embed:fullscreen,
.game-embed--maximized {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
}

.game-embed--maximized {
    position: fixed;
    z-index: 100;
    inset: 0;
}

.game-maximized {
    overflow: hidden;
}

@media (max-width: 760px) {
    .login-page {
        padding: 16px;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand {
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .login-brand .brand-mark {
        margin-bottom: 28px;
    }

    .login-brand h1 {
        font-size: 3.2rem;
    }

    .topbar {
        align-items: flex-start;
    }

    .brand-inline strong {
        display: none;
    }

    .user-box {
        gap: 10px;
    }

    .dashboard-content--game {
        width: 100%;
        padding: 0;
    }

    .game-embed {
        height: calc(100dvh - 76px);
        min-height: 0;
        border: 0;
        border-radius: 0;
    }

}
