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

body {
    margin: 0;
    color: #edf4ff;
    font-family: "Avenir Next", "Trebuchet MS", sans-serif;
    background:
        radial-gradient(circle at top, rgba(233, 171, 74, 0.18), transparent 30%),
        radial-gradient(circle at bottom left, rgba(88, 132, 181, 0.18), transparent 25%),
        linear-gradient(135deg, #09111a 0%, #101926 52%, #080d13 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at center, black, transparent 85%);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

button,
a {
    color: inherit;
}

code {
    font-family: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
    font-size: 0.92em;
}

button {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
iframe:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 0.18rem rgba(8, 13, 19, 0.95),
        0 0 0 0.28rem rgba(233, 171, 74, 0.45);
}

#app {
    min-height: 100vh;
}

.shell-loading {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.shell-loading-mark {
    width: 3.6rem;
    height: 3.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(240, 201, 132, 0.42);
    background:
        linear-gradient(180deg, rgba(18, 28, 41, 0.96), rgba(7, 11, 17, 0.92)),
        radial-gradient(circle at top, rgba(240, 201, 132, 0.18), transparent 55%);
    color: #f0c984;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.shell-loading-copy {
    margin: 0;
    color: rgba(237, 244, 255, 0.8);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#blazor-error-ui {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    display: none;
    gap: 0.75rem;
    align-items: center;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(199, 66, 66, 0.42);
    background: rgba(107, 20, 20, 0.92);
    color: #ffd6d6;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

#blazor-error-ui .reload {
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
}

.shell-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.45rem;
}

.shell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(214, 224, 237, 0.16);
    background:
        linear-gradient(180deg, rgba(18, 28, 41, 0.96), rgba(7, 11, 17, 0.92)),
        radial-gradient(circle at left center, rgba(233, 171, 74, 0.12), transparent 30%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 12px 26px rgba(0, 0, 0, 0.2);
}

.shell-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shell-brand-mark {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    border: 1px solid rgba(214, 224, 237, 0.16);
    background: rgba(5, 8, 12, 0.72);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 10px 18px rgba(0, 0, 0, 0.24);
}

.shell-brand-mark svg {
    display: block;
    width: 100%;
    height: 100%;
}

.shell-brand-mark path:last-of-type {
    transform: translate(-2.4px, 0);
}

.shell-brand-copy,
.shell-user-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.shell-brand-copy {
    gap: 0.18rem;
}

.shell-brand-caption,
.shell-user-caption,
.shell-not-found-caption {
    color: rgba(240, 201, 132, 0.8);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: uppercase;
}

.shell-brand-title {
    min-width: 0;
    color: #f6fbff;
    font-size: clamp(1rem, 1.4vw + 0.72rem, 1.45rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.1;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shell-user-status,
.shell-auth-close,
.shell-auth-provider-button,
.shell-action-button,
.shell-not-found-link {
    transition:
        transform 150ms ease,
        border-color 150ms ease,
        color 150ms ease,
        box-shadow 150ms ease;
}

.shell-user-status {
    min-width: 11.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(214, 224, 237, 0.18);
    background:
        linear-gradient(180deg, rgba(16, 26, 39, 0.98), rgba(8, 13, 20, 0.92)),
        radial-gradient(circle at top left, rgba(233, 171, 74, 0.14), transparent 45%);
    color: #eef5ff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 10px 20px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.shell-user-status:hover:not(:disabled),
.shell-auth-close:hover:not(:disabled),
.shell-auth-provider-button:hover:not(:disabled),
.shell-action-button:hover,
.shell-not-found-link:hover {
    transform: translateY(-1px);
    border-color: rgba(233, 171, 74, 0.55);
    color: #f8deb0;
}

.shell-user-status:disabled,
.shell-auth-close:disabled,
.shell-auth-provider-button:disabled {
    cursor: progress;
    opacity: 0.6;
}

.shell-user-status.is-logged-out {
    justify-content: center;
}

.shell-user-status.is-logged-in {
    min-width: 13rem;
}

.shell-user-avatar,
.shell-user-avatar-image,
.shell-auth-account-avatar,
.shell-auth-account-image {
    flex-shrink: 0;
    border: 1px solid rgba(240, 201, 132, 0.5);
}

.shell-user-avatar,
.shell-user-avatar-image {
    width: 2.25rem;
    height: 2.25rem;
}

.shell-user-avatar,
.shell-auth-account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(37, 53, 73, 0.98), rgba(14, 21, 31, 0.92)),
        radial-gradient(circle at top, rgba(240, 201, 132, 0.18), transparent 55%);
    color: #f0c984;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.shell-user-avatar {
    font-size: 0.8rem;
}

.shell-user-avatar-image,
.shell-auth-account-image {
    display: block;
    object-fit: cover;
}

.shell-user-copy {
    gap: 0.16rem;
    align-items: flex-start;
}

.shell-user-copy-logged-out {
    justify-content: center;
}

.shell-user-name {
    min-width: 0;
    color: #f6fbff;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.shell-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background:
        radial-gradient(circle at top, rgba(233, 171, 74, 0.14), transparent 32%),
        rgba(3, 6, 10, 0.78);
    backdrop-filter: blur(8px);
}

.shell-auth-card {
    width: min(32rem, calc(100vw - 1.5rem));
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(214, 224, 237, 0.18);
    background:
        linear-gradient(180deg, rgba(18, 28, 41, 0.98), rgba(7, 11, 17, 0.96)),
        radial-gradient(circle at top right, rgba(233, 171, 74, 0.1), transparent 34%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 18px 42px rgba(0, 0, 0, 0.34);
}

.shell-auth-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.shell-auth-caption {
    margin: 0 0 0.2rem;
    color: rgba(240, 201, 132, 0.8);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: uppercase;
}

.shell-auth-title,
.shell-not-found-title {
    margin: 0;
    color: #f6fbff;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.shell-auth-title {
    font-size: 1.35rem;
}

.shell-auth-close {
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(214, 224, 237, 0.14);
    background:
        linear-gradient(180deg, rgba(15, 25, 38, 0.96), rgba(6, 10, 16, 0.92)),
        radial-gradient(circle at top, rgba(233, 171, 74, 0.14), transparent 55%);
    color: #d3deee;
    cursor: pointer;
}

.shell-auth-copy,
.shell-not-found-copy {
    margin: 0;
    color: rgba(237, 244, 255, 0.86);
    font-size: 0.95rem;
    line-height: 1.45;
}

.shell-auth-error {
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(199, 66, 66, 0.42);
    background: rgba(107, 20, 20, 0.38);
    color: #ffd6d6;
    font-size: 0.92rem;
    line-height: 1.4;
}

.shell-auth-provider-grid {
    display: grid;
    gap: 0.65rem;
}

.shell-auth-provider-button,
.shell-not-found-link {
    border: 1px solid rgba(214, 224, 237, 0.16);
    background:
        linear-gradient(180deg, rgba(16, 26, 39, 0.98), rgba(8, 13, 20, 0.92)),
        radial-gradient(circle at top left, rgba(233, 171, 74, 0.12), transparent 50%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 10px 20px rgba(0, 0, 0, 0.22);
}

.shell-auth-provider-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: #eef5ff;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.shell-auth-provider-badge {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(240, 201, 132, 0.5);
    background:
        linear-gradient(180deg, rgba(37, 53, 73, 0.98), rgba(14, 21, 31, 0.92)),
        radial-gradient(circle at top, rgba(240, 201, 132, 0.16), transparent 55%);
    color: #f0c984;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.shell-auth-account-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid rgba(214, 224, 237, 0.16);
    background:
        linear-gradient(180deg, rgba(14, 22, 33, 0.96), rgba(7, 11, 17, 0.92)),
        radial-gradient(circle at top left, rgba(233, 171, 74, 0.1), transparent 44%);
}

.shell-auth-account-avatar,
.shell-auth-account-image {
    width: 3rem;
    height: 3rem;
}

.shell-auth-account-avatar {
    font-size: 1rem;
}

.shell-auth-account-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.shell-auth-account-name {
    color: #f6fbff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.shell-auth-account-meta {
    color: rgba(237, 244, 255, 0.75);
    font-size: 0.86rem;
    line-height: 1.35;
    word-break: break-word;
}

.shell-auth-signout-button {
    justify-content: center;
}

.shell-stat-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.35rem;
}

.shell-stat-card {
    min-height: 2rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.45rem;
    border: 1px solid rgba(214, 224, 237, 0.14);
    background:
        linear-gradient(180deg, rgba(17, 29, 43, 0.95), rgba(10, 17, 26, 0.86)),
        linear-gradient(90deg, rgba(233, 171, 74, 0.14), transparent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 18px rgba(0, 0, 0, 0.18);
}

.shell-stat-icon {
    width: 0.85rem;
    height: 0.85rem;
    flex-shrink: 0;
    fill: #f0c984;
}

.shell-stat-label {
    color: #f0c984;
    font-size: 0.66rem;
    letter-spacing: 0.05em;
    line-height: 1;
    text-transform: uppercase;
}

.shell-board {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(3rem, 3.6rem) minmax(0, 1fr) minmax(3rem, 3.6rem);
    gap: 0.45rem;
}

.shell-action-column {
    display: grid;
    grid-auto-rows: max-content;
    gap: 0.2rem;
    align-content: start;
}

.shell-action-button {
    width: 100%;
    aspect-ratio: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(214, 224, 237, 0.14);
    background:
        linear-gradient(180deg, rgba(15, 25, 38, 0.96), rgba(6, 10, 16, 0.92)),
        radial-gradient(circle at top, rgba(233, 171, 74, 0.2), transparent 55%);
    color: #d3deee;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 18px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.shell-action-button.is-active {
    border-color: rgba(233, 171, 74, 0.8);
    color: #f7deb0;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 0 16px rgba(233, 171, 74, 0.16),
        0 10px 22px rgba(0, 0, 0, 0.28);
}

.shell-action-button svg {
    width: 1.45rem;
    height: 1.45rem;
    fill: currentColor;
}

.shell-center-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0.55rem;
    border: 1px solid rgba(214, 224, 237, 0.16);
    background:
        linear-gradient(180deg, rgba(18, 28, 41, 0.92), rgba(7, 11, 17, 0.92)),
        radial-gradient(circle at top right, rgba(233, 171, 74, 0.08), transparent 34%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 12px 26px rgba(0, 0, 0, 0.24);
}

.shell-viewport-frame {
    position: relative;
    flex: 1;
    min-height: 30rem;
    overflow: hidden;
    border: 1px solid rgba(214, 224, 237, 0.14);
    background: #05080c;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 0 0 36px rgba(0, 0, 0, 0.34);
}

.shell-viewport-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.shell-game-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #05080c;
}

.shell-not-found {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.shell-not-found-card {
    width: min(30rem, 100%);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.2rem;
    border: 1px solid rgba(214, 224, 237, 0.18);
    background:
        linear-gradient(180deg, rgba(18, 28, 41, 0.98), rgba(7, 11, 17, 0.96)),
        radial-gradient(circle at top right, rgba(233, 171, 74, 0.1), transparent 34%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 18px 42px rgba(0, 0, 0, 0.34);
}

.shell-not-found-title {
    font-size: 1.5rem;
}

.shell-not-found-link {
    width: fit-content;
    padding: 0.75rem 0.95rem;
    text-decoration: none;
}

@media (max-width: 980px) {
    .shell-page {
        padding: 0.35rem;
    }

    .shell-header {
        flex-direction: column;
        align-items: stretch;
        padding: 0.55rem;
    }

    .shell-user-status {
        width: 100%;
        min-width: 0;
    }

    .shell-board {
        grid-template-columns: minmax(2.55rem, 2.95rem) minmax(0, 1fr) minmax(2.55rem, 2.95rem);
        gap: 0.3rem;
    }

    .shell-action-column {
        gap: 0.25rem;
    }

    .shell-action-button svg {
        width: 1.15rem;
        height: 1.15rem;
    }

    .shell-viewport-frame {
        min-height: 22rem;
    }
}

@media (max-width: 720px) {
    .shell-stat-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shell-brand {
        align-items: flex-start;
    }

    .shell-brand-title {
        white-space: normal;
    }

    .shell-auth-account-card {
        align-items: flex-start;
    }
}
