/* shared app chrome — same geometry as current Player / Admin header */

:root, [data-theme="light"] {
    --bg: #f8fafc;
    --bg-elevated: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --accent: #0F3054;
    --header-h: 4rem;
    --sb-width: 3.35rem;
}

[data-theme="dark"] {
    --bg: #020617;
    --bg-elevated: #0f172a;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --accent: #3989C6;
}

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

html {
    scrollbar-gutter: stable;
}

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

body.ubn-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

#ubn-root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ubn-header {
    height: var(--header-h);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
    flex-shrink: 0;
    color: var(--text);
}

.ubn-header-inner {
    display: flex;
    align-items: center;
    height: 4rem;
    width: 100%;
}

.ubn-header-logo {
    flex: 0 0 var(--sb-width);
    width: var(--sb-width);
    max-width: var(--sb-width);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.ubn-header-logo img {
    height: 2.15rem;
    width: 2.15rem;
    border-radius: 9999px;
    object-fit: contain;
}

.ubn-header-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem 0 0.2rem;
}

.ubn-header-wordmark {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ubn-header-tools {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.ubn-header-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.35rem 0.5rem;
}

.ubn-header-link:hover {
    color: var(--text);
}

.ubn-header-dropdown {
    position: relative;
}

.ubn-header-theme {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ubn-header-theme:hover,
.ubn-header-theme[aria-expanded="true"] {
    color: var(--text);
    border-color: var(--accent);
}

.ubn-header-theme-icon,
.ubn-header-theme svg {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
}

.ubn-header-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    width: 11rem;
    padding: 0.25rem 0;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg-elevated);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    z-index: 50;
}

.ubn-header-menu[hidden] {
    display: none !important;
}

.ubn-header-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
    color: var(--text);
    text-decoration: none;
    background: transparent;
    border: 0;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
}

.ubn-header-menu-item:hover {
    background: color-mix(in srgb, var(--border) 65%, transparent);
}

.ubn-main {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
}

.ubn-footer {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    font-size: 0.875rem;
}

.ubn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.6rem;
    padding: 0.55rem 1.2rem;
    border-radius: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    color: #f8fafc;
    background: var(--ubn-grad, linear-gradient(135deg, #0F3054 0%, #1d4ed8 55%, #3989C6 100%));
    border: 1px solid rgba(56, 189, 248, 0.45);
    cursor: pointer;
}

.ubn-cta:hover {
    filter: brightness(1.06);
}

.ubn-cta--secondary {
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border);
}

.ubn-cta--secondary:hover {
    filter: none;
    border-color: var(--accent);
    color: var(--accent);
}

.ubn-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: center;
}

@media (max-width: 640px) {
    .ubn-header-wordmark,
    .ubn-header-link {
        display: none;
    }
}
