/* The user portal shares the native app's palette, shell and card styles. */
:root[data-portal="user"] body { display:grid; place-items:center; min-width:0; padding:0; }
.portal.user-portal {
    width:100%;
    height:var(--app-height);
    display:flex;
    border-radius:var(--app-radius);
    outline:none;
}
@media (min-width:460px) and (pointer:fine) {
    :root[data-portal="user"]:not([data-host="linux"]) .user-portal { outline:1px solid var(--p-line); }
}
@media (max-width:459px), (pointer:coarse) {
    :root[data-portal="user"] { --app-width:100%; --app-height:100dvh; --app-bottom:0px; --app-radius:0px; }
    :root[data-portal="user"] .user-portal { outline:none; }
}

.user-portal .local-nav { flex-shrink:0; padding:0 12px; }
.user-portal .top-title { min-width:0; }
.user-portal .portal-brand { gap:4px; padding:0; height:64px; font-size:21px; }
.user-portal .portal-brand img { width:64px; height:64px; }
.user-portal .portal-main { padding:14px 16px 20px; }
.user-portal.workspace .portal-main { padding:10px 8px 24px; }
@media (min-width:760px) {
    :root[data-portal="user"][data-host="linux"]:has(.portal-linux-home #portal-home-tools[data-multiple-accounts]) {
        --app-width:min(1000px, calc(100vw - 24px));
    }
    :root[data-portal="user"][data-host="linux"] .portal-linux-home #portal-home-tools[data-multiple-accounts] .local-account-grid {
        grid-template-columns:repeat(2, minmax(0, 1fr));
        align-items:start;
    }
}
@media (min-width:760px) and (pointer:fine) {
    :root[data-portal="user"][data-host="linux"]:has(#game-settings) {
        --app-width:min(680px, calc(100vw - 24px));
    }
}
.user-portal .portal-nav { margin:12px 16px 0; }
.user-portal .portal-main > h1 { margin:0 0 14px; font-size:19px; }
.user-portal .primary, .user-portal .sign-out button, .user-portal.auth form button {
    min-height:44px;
    border-radius:10px;
    font-weight:500;
}
.user-portal.auth form button {
    background:var(--p-accent);
    color:var(--p-on-accent);
}
.user-portal .portal-card, .user-portal.auth form {
    box-shadow:0 4px 13px #1e2e4614, 0 1px 3px #1e2e4605;
}
.user-portal .release-list { display:grid; gap:12px; }
.user-portal .release-list .portal-card { margin:0; }

.user-portal.workspace .app-menu summary { list-style:none; cursor:pointer; }
.user-portal.workspace .app-menu summary::-webkit-details-marker { display:none; }
.user-portal.workspace .app-menu-panel a[aria-current="page"] { background:var(--p-tint); color:var(--p-accent); }
.user-portal.detail-screen .portal-main { display:flex; flex-direction:column; overflow:hidden; padding:0; }
#portal-runtime-view { flex:1; min-height:0; display:flex; flex-direction:column; }
.game-editor-toolbar {
    min-height:44px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    flex:none;
    padding-inline:16px;
    background:var(--p-shell);
    border-top:1px solid var(--p-rule);
    color:var(--p-label);
    font-size:12px;
}
.game-editor-toolbar button { min-height:44px; padding:0 2px; color:var(--p-accent); background:transparent; }
#game-settings { flex:1; min-height:0; display:flex; flex-direction:column; }
#game-settings .setting-container { height:auto; }
#game-settings .setting-container > .local-empty,
#game-settings .setting-container > .local-error,
#game-settings .setting-container > .race-feedback { margin:8px 16px 0; }
#game-settings .setting-container button:not(.local-primary, .ant-btn-primary) { box-shadow:none; }

.portal-sheet {
    position:fixed;
    inset:auto 0 var(--app-bottom);
    width:calc(var(--app-width) - 24px);
    margin:0 auto;
    max-height:min(85dvh, calc(var(--app-height) - 24px));
    padding:20px 20px max(20px, env(safe-area-inset-bottom));
    border:0;
    border-radius:20px 20px var(--app-radius) var(--app-radius);
    background:var(--p-card);
    color:var(--p-text);
    box-shadow:0 -9px 30px #15253d29;
}
.portal-sheet::backdrop { background:#14243d63; }
.portal-sheet h2 { margin:0 0 16px; font-size:18px; }
.portal-sheet p:not(.error) { margin:0 0 16px; }
.portal-sheet form { display:grid; gap:6px; }
.portal-sheet input {
    min-height:44px;
    width:100%;
    margin-bottom:8px;
    padding:8px 10px;
    border:1px solid var(--p-line);
    border-radius:9px;
    background:var(--p-tint);
    color:var(--p-text);
}
.portal-sheet-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; margin-top:6px; }
.portal-sheet-actions button { min-height:44px; padding:8px 14px; border-radius:10px; }
.portal-sheet-actions .portal-danger { color:var(--p-on-accent); background:var(--error); }
@media (max-width:350px) {
    .user-portal.auth .portal-main { padding-inline:12px; }
    .game-editor-toolbar { padding-inline:12px; }
}
