/* The look of the splash. Change these variables to restyle it: the first block is for a dark splash background, and the second for a light one, which `loader.js` picks from the background of `app.json`. */
:root {
    --splash-logo-size: min(40vmin, 200px);
    --splash-bar-width: min(60vw, 280px);
    --splash-bar-height: 4px;
    --splash-gap: 20px;
    --splash-font: 500 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
    --splash-text: rgba(255, 255, 255, 0.8);
    --splash-track: rgba(255, 255, 255, 0.15);
    --splash-bar: #ffffff;
    --splash-failed: #feb2b2;
    --splash-details-background: rgba(0, 0, 0, 0.35);
    --splash-details-text: #ffffff;
}

#splash.light {
    --splash-text: rgba(16, 20, 24, 0.8);
    --splash-track: rgba(16, 20, 24, 0.12);
    --splash-bar: #101418;
    --splash-failed: #c53030;
    --splash-details-background: rgba(16, 20, 24, 0.06);
    --splash-details-text: #101418;
}

html, body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #101418;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

#canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    display: block;
    outline: none;
}

#splash {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--splash-gap);
    padding: 24px;
    box-sizing: border-box;
    background: inherit;
    color: var(--splash-text);
    font: var(--splash-font);
    transition: opacity 0.3s ease;
}

#splash.hidden {
    opacity: 0;
    pointer-events: none;
}

#splash-logo {
    width: var(--splash-logo-size);
    height: var(--splash-logo-size);
    object-fit: contain;
}

#splash-progress {
    width: var(--splash-bar-width);
    height: var(--splash-bar-height);
    border-radius: calc(var(--splash-bar-height) / 2);
    background: var(--splash-track);
    overflow: hidden;
}

#splash-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--splash-bar);
    transition: width 0.15s linear;
}

#splash-percent {
    margin: calc(var(--splash-gap) / -2) 0 0;
    font-variant-numeric: tabular-nums;
}

#splash-status {
    margin: 0;
    max-width: 640px;
    text-align: center;
    color: var(--splash-failed);
}

#splash.failed #splash-progress,
#splash.failed #splash-percent {
    display: none;
}

#splash-details {
    margin: 0;
    max-width: min(90vw, 900px);
    max-height: 40vh;
    overflow: auto;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--splash-details-background);
    color: var(--splash-details-text);
    font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace;
    white-space: pre-wrap;
    -webkit-user-select: text;
    user-select: text;
}
