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

body, html {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #000000;
    overflow: hidden;
}

/* The React scene browser fills the whole viewport. */
.home-container {
    width: 100%;
    height: 100%;
}

.scene-selector-wrapper {
    width: 100%;
    height: 100%;
}

/* Pre-mount splash: just the logo, centered, until React paints the browser. */
.home-booting {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-booting-logo {
    width: 72px;
    height: auto;
    opacity: 0.5;
    animation: home-booting-pulse 1.6s ease-in-out infinite;
}

@keyframes home-booting-pulse {
    0%, 100% { opacity: 0.25; }
    50%      { opacity: 0.6; }
}

/* ------------------------------------------------------------------ */
/* Scene browser — scrollbars, hovers, responsive                     */
/* ------------------------------------------------------------------ */

.sb-nav,
.sb-main {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.sb-nav::-webkit-scrollbar,
.sb-main::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.sb-nav::-webkit-scrollbar-track,
.sb-main::-webkit-scrollbar-track {
    background: transparent;
}

.sb-nav::-webkit-scrollbar-thumb,
.sb-main::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.sb-nav::-webkit-scrollbar-thumb:hover,
.sb-main::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

/* App-like: never let clicking/dragging select card & nav text (that drag-select
   was the "random highlighting"). Set on every browser element explicitly so it
   can't be defeated by a selection dragged in from a selectable ancestor. */
.sb-topbar, .sb-topbar *,
.sb-body, .sb-body *,
.sb-actionbar, .sb-actionbar * {
    -webkit-user-select: none;
    user-select: none;
}
/* …but keep form fields (search box, tag inputs/select) selectable/usable. */
.sb-sidebar input,
.sb-main input,
.sb-actionbar input,
.sb-actionbar select,
.sb-actionbar textarea {
    -webkit-user-select: text;
    user-select: text;
}

.sb-card {
    transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.sb-card:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
}

.sb-card:focus-visible {
    border-color: rgba(255, 255, 255, 0.4) !important;
    outline: none;
}

.sb-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.sb-nav-item:focus-visible {
    background-color: rgba(255, 255, 255, 0.08) !important;
    outline: none;
}

.sb-icon-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.14) !important;
}

.sb-open-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.sb-open-btn:active {
    transform: translateY(0);
}

/* ------------------------------------------------------------------ */
/* Scene selector — shared dropdown styling (local-scene-selector)     */
/* ------------------------------------------------------------------ */

.scene-dropdown-menu {
    animation: scene-dropdown-fade 0.14s ease-out;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.scene-dropdown-menu::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.scene-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.scene-dropdown-menu::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    transition: background-color 0.15s ease;
}

.scene-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

.scene-dropdown-menu::-webkit-scrollbar-corner {
    background: transparent;
}

@keyframes scene-dropdown-fade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.scene-dropdown-item {
    transition: background-color 0.15s ease;
    position: relative;
}

.scene-dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

.scene-dropdown-button:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

.scene-load-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scene-load-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* ------------------------------------------------------------------ */
/* Admin link — secondary nav button in the top bar                    */
/* ------------------------------------------------------------------ */

.home-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.65);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.home-admin-link:hover {
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.35);
    background-color: rgba(255, 255, 255, 0.04);
}

.home-admin-link:focus-visible {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.06);
}

/* ------------------------------------------------------------------ */
/* Responsive: collapse the sidebar above the content on narrow screens*/
/* ------------------------------------------------------------------ */

@media (max-width: 720px) {
    .sb-body {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto 1fr !important;
    }

    .sb-sidebar {
        max-height: 42vh;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    .sb-userchip {
        display: none !important;
    }

    .sb-card {
        min-height: 72px !important;
    }
}
