/* Battle Barge — Shell layout
   ============================================================ */

/* Footer is hidden by default and only shown on the Home screen.
   Earlier draft rendered the disclaimer on every screen and pushed it
   away from the action; users read it as repetitive chrome. */
.app-footer {
    display: none;
}
body[data-active-screen="home"] .app-footer {
    display: block;
    text-align: center;
    padding: var(--bb-space-4) var(--bb-space-4) var(--bb-space-6);
    color: var(--bb-text-muted);
    font-size: var(--bb-text-xs);
    line-height: 1.45;
}
body[data-active-screen="home"] .app-footer p {
    margin: 0 auto var(--bb-space-1);
    max-width: 480px;
}

.screen-mount {
    /* 116px = header (56px) + bottom nav (60px). Body padding-top +
       padding-bottom already account for safe-area insets, so don't
       subtract them here too. */
    min-height: calc(100dvh - 116px);
    /* Honor iPhone landscape home indicator + notch by stretching the
       horizontal padding into the safe-area insets. Without this, content
       in landscape gets clipped under the home indicator on the right. */
    padding-top: var(--bb-space-4);
    padding-bottom: var(--bb-space-4);
    padding-left: max(var(--bb-space-4), env(safe-area-inset-left, 0px));
    padding-right: max(var(--bb-space-4), env(safe-area-inset-right, 0px));
    max-width: 960px;
    margin: 0 auto;
}

.screen-mount-loading {
    text-align: center;
    margin-top: var(--bb-space-8);
}

.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--bb-bg-elevated);
    color: var(--bb-text-primary);
    padding: var(--bb-space-2) var(--bb-space-4);
    z-index: 9999;
}
.skip-to-content:focus {
    top: 0;
}

/* Splash overlay
   ============================================================ */

.bb-splash[hidden] { display: none; }

.bb-splash {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--bb-space-4);
}

.bb-splash-card {
    background: var(--bb-bg-surface);
    border: 1px solid var(--bb-border);
    border-radius: var(--bb-radius-lg);
    padding: var(--bb-space-8);
    max-width: 560px;
    width: 100%;
    box-shadow: var(--bb-shadow-lg);
    position: relative;
}

.bb-splash-close {
    position: absolute;
    top: var(--bb-space-2);
    right: var(--bb-space-3);
    background: transparent;
    border: 0;
    color: var(--bb-text-secondary);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: var(--bb-space-1) var(--bb-space-2);
    border-radius: var(--bb-radius-sm);
    transition: color var(--bb-transition-fast), background var(--bb-transition-fast);
}

.bb-splash-close:hover {
    color: var(--bb-text-primary);
    background: var(--bb-bg-elevated);
}

.bb-splash-close[hidden] { display: none; }

.bb-splash-title {
    font-family: var(--bb-font-display);
    font-size: var(--bb-text-2xl);
    color: var(--bb-text-primary);
    margin: 0 0 var(--bb-space-2);
}

.bb-splash-subtitle {
    font-size: var(--bb-text-base);
    margin: 0 0 var(--bb-space-6);
}

.bb-splash-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--bb-space-4);
}

@media (max-width: 480px) {
    .bb-splash-options { grid-template-columns: 1fr; }
}

.bb-splash-option {
    background: var(--bb-bg-elevated);
    border: 2px solid var(--bb-border);
    border-radius: var(--bb-radius-md);
    padding: var(--bb-space-6);
    cursor: pointer;
    text-align: left;
    transition: border-color var(--bb-transition-fast), transform var(--bb-transition-fast);
    color: var(--bb-text-primary);
}

.bb-splash-option:hover {
    border-color: var(--bb-accent-primary);
    transform: translateY(-2px);
}

.bb-splash-option-title {
    display: block;
    font-family: var(--bb-font-display);
    font-size: var(--bb-text-xl);
    margin-bottom: var(--bb-space-1);
}

.bb-splash-option-tag {
    display: block;
    color: var(--bb-text-secondary);
    font-size: var(--bb-text-sm);
}

/* Universe accents on the splash cards. The two cards used to render
   identically — first impression of the app showed zero brand
   differentiation between HH (Horus Heresy) and TOW (Old World).
   Per-data-pick gradients + matching hover borders give each its
   own visual identity without invoking per-universe CSS. */
.bb-splash-option[data-pick="hh"] {
    background:
        linear-gradient(140deg,
            rgba(196, 156, 92, 0.12) 0%,
            rgba(196, 156, 92, 0) 55%),
        var(--bb-bg-elevated);
    border-color: rgba(196, 156, 92, 0.45);
}
.bb-splash-option[data-pick="hh"] .bb-splash-option-title {
    color: #d6b27a;
}
.bb-splash-option[data-pick="hh"]:hover,
.bb-splash-option[data-pick="hh"]:focus-visible {
    border-color: #d6b27a;
}

.bb-splash-option[data-pick="tow"] {
    background:
        linear-gradient(140deg,
            rgba(146, 112, 60, 0.16) 0%,
            rgba(58, 38, 18, 0.18) 60%,
            rgba(58, 38, 18, 0) 100%),
        var(--bb-bg-elevated);
    border-color: rgba(170, 124, 70, 0.5);
}
.bb-splash-option[data-pick="tow"] .bb-splash-option-title {
    color: #c79a5a;
    font-family: var(--bb-font-display);
}
.bb-splash-option[data-pick="tow"]:hover,
.bb-splash-option[data-pick="tow"]:focus-visible {
    border-color: #c79a5a;
}

/* ----------------------------------------------------------------
   Toasts — pumped into #toast-container by bb-shell.js _showToast().
   ---------------------------------------------------------------- */
#toast-container {
    position: fixed;
    left: 50%;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--bb-space-2);
    pointer-events: none;
    width: min(420px, calc(100vw - 32px));
}
.bb-toast {
    background: var(--bb-bg-elevated);
    color: var(--bb-text-primary);
    border: 1px solid var(--bb-border);
    border-left: 4px solid var(--bb-accent-primary);
    border-radius: var(--bb-radius-sm);
    padding: var(--bb-space-3) var(--bb-space-4);
    font-size: var(--bb-text-sm);
    line-height: 1.4;
    box-shadow: var(--bb-shadow-md);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 200ms ease-out, transform 200ms ease-out;
    pointer-events: auto;
}
.bb-toast.is-open { opacity: 1; transform: translateY(0); }
.bb-toast-error   { border-left-color: var(--bb-accent-danger); }
.bb-toast-success { border-left-color: var(--bb-accent-success, #4ea672); }
.bb-toast-info    { border-left-color: var(--bb-accent-primary); }
