/* =============================================================================
   SP SHELL — Shared navigation header + optional footer
   =============================================================================
   Injected by sp_shell.js on every game surface (landing page excluded).
   Sits fixed at top, z-index 200, above any surface chrome.

   Layout:  [WORDMARK]                                    [UTILITY LINKS]
   ============================================================================= */

/* ---- Header bar ---- */

.sp-shell {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--bg, #0e0f10);
    border-bottom: 1px solid var(--line, #2a2d31);
    z-index: 200;
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    -webkit-font-smoothing: antialiased;
}

/* Spacer — pushes page content below the fixed header */
.sp-shell-spacer {
    height: 48px;
    flex-shrink: 0;
}

/* ---- Wordmark (left) ---- */

.sp-shell__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-family: var(--font-sans, "Space Grotesk", sans-serif);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink, #e9ebee);
    flex-shrink: 0;
}

.sp-shell__logo-slash {
    background: linear-gradient(160deg, #ff7a55 0%, #d84a2b 45%, #8a2913 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 400;
    margin-left: 2px;
}

.sp-shell__logo:hover {
    color: var(--ink, #e9ebee);
}

/* ---- Utility links (right) ---- */

.sp-shell__utils {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

/* Keep each util on one line; the row scrolls rather than wrapping. */
.sp-shell__util,
.sp-shell__utils-divider {
    flex-shrink: 0;
    white-space: nowrap;
}

.sp-shell__util {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-faint, #55595f);
    border: 1px solid transparent;
    transition: color 0.1s ease, border-color 0.1s ease;
}

.sp-shell__util:hover {
    color: var(--ink, #e9ebee);
    border-color: var(--line, #2a2d31);
}

.sp-shell__util--active {
    color: #fff;
    background: linear-gradient(
        160deg,
        rgba(255, 122, 85, 0.25) 0%,
        rgba(216, 74, 43, 0.2) 45%,
        rgba(138, 41, 19, 0.15) 100%
    );
    border-color: rgba(216, 74, 43, 0.5);
    border-radius: 3px;
}

.sp-shell__utils-divider {
    margin: 0 10px;
    font-size: 14px;
    font-weight: 400;
    background: linear-gradient(160deg, #ff7a55 0%, #d84a2b 45%, #8a2913 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    flex-shrink: 0;
}

/* ---- Pipeline breadcrumb (pipeline pages only) ---- */

.sp-pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--line, #2a2d31);
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    -webkit-font-smoothing: antialiased;
}

.sp-pipeline__step {
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-faint, #55595f);
    cursor: default;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.sp-pipeline__step--completed {
    color: var(--ink-dim, #9aa0a6);
    cursor: pointer;
}

.sp-pipeline__step--completed:hover {
    color: var(--ink, #e9ebee);
}

.sp-pipeline__step--active {
    color: var(--accent, #d84a2b);
}

.sp-pipeline__step--future {
    color: var(--ink-faint, #55595f);
    pointer-events: none;
}

.sp-pipeline__check {
    margin-right: 4px;
    font-size: 9px;
}

.sp-pipeline__sep {
    color: var(--line-strong, #3a3e44);
    font-size: 10px;
    padding: 0 2px;
    user-select: none;
}

/* ---- Fixed footer statusbar ---- */

.sp-shell-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 34px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 32px;
    border-top: 1px solid var(--line, #2a2d31);
    background: var(--bg, #0e0f10);
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 11px;
    color: var(--ink-faint, #55595f);
    letter-spacing: 0.04em;
    z-index: 200;
    -webkit-font-smoothing: antialiased;
}

.sp-shell-footer .k {
    color: var(--ink-ghost, #33363b);
    margin-right: 8px;
}

.sp-shell-footer .gap {
    margin-left: auto;
}

.sp-shell-footer .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: oklch(0.78 0.15 150);
    box-shadow: 0 0 8px oklch(0.78 0.15 150);
}

.sp-shell-footer-spacer {
    height: 34px;
    flex-shrink: 0;
}

/* ---- Pregame mode — wordmark + CTA only ---- */

.sp-shell--pregame {
    justify-content: space-between;
}

.sp-shell__cta {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink, #e9ebee);
    padding: 6px 14px;
    border: 1px solid var(--line, #2a2d31);
    transition: border-color 0.15s ease, color 0.15s ease;
}

.sp-shell__cta:hover {
    border-color: var(--accent, #d84a2b);
    color: var(--accent, #d84a2b);
}

.sp-shell__cta-slash {
    background: linear-gradient(160deg, #ff7a55 0%, #d84a2b 45%, #8a2913 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-left: 6px;
}

/* ---- Pregame actions row ---- */

.sp-shell__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sp-shell__login {
    background: none;
    border: 1px solid var(--line, #2a2d31);
    color: var(--ink-dim, #9aa0a6);
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 11px;
    letter-spacing: 0.16em;
    padding: 6px 14px;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.sp-shell__login:hover,
.sp-shell__login--active {
    border-color: var(--ink-dim, #9aa0a6);
    color: var(--ink, #e9ebee);
}

/* ---- Login panel (dropdown below header) ---- */

.sp-login-panel {
    position: absolute;
    top: 48px;
    right: 20px;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg, #0e0f10);
    border: 1px solid var(--line, #2a2d31);
    border-top: none;
    z-index: 201;
}

.sp-login-panel--open {
    display: flex;
}

.sp-login-input {
    background: transparent;
    border: 1px solid var(--line, #2a2d31);
    color: var(--ink, #e9ebee);
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 12px;
    letter-spacing: 0.12em;
    padding: 6px 10px;
    width: 180px;
    outline: none;
}

.sp-login-input:focus {
    border-color: var(--ink-dim, #9aa0a6);
}

.sp-login-input::placeholder {
    color: var(--ink-faint, #55595f);
}

.sp-login-submit {
    background: none;
    border: 1px solid var(--line, #2a2d31);
    color: var(--ink-dim, #9aa0a6);
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 10px;
    letter-spacing: 0.16em;
    padding: 6px 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.sp-login-submit:hover:not(:disabled) {
    border-color: var(--accent, #d84a2b);
    color: var(--ink, #e9ebee);
}

.sp-login-submit:disabled {
    opacity: 0.4;
    cursor: default;
}

.sp-login-status {
    font-family: var(--font-mono, "JetBrains Mono", monospace);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--ink-dim, #9aa0a6);
}

.sp-login-status--error {
    color: var(--accent, #d84a2b);
}

/* ---- Pipeline mode — logo only, no utils ---- */

.sp-shell--pipeline {
    justify-content: flex-start;
}
