/* The page behind the canvas, and the splash shown while the .NET runtime downloads. */
html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: #2A1D15;
    /* No pull-to-refresh or rubber-band scrolling: a swipe on a page's edge turns the page, it does not move the view. */
    overscroll-behavior: none;
}

/*
   Fixed to the viewport's four edges rather than sized from the body: installed on an iPhone's home screen, the page
   can be laid out before the viewport has its final width, and the book then stopped short of the right edge.
*/
#out {
    position: fixed;
    inset: 0;
}

.splash {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: linear-gradient(135deg, #22345C, #0E1630);
    color: #E9C46A;
    font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    pointer-events: none;
}

.splash h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.splash p {
    margin: 0;
    color: #E6EAF2;
    opacity: 0.8;
}

/* How much of the runtime and the book has arrived, by file (main.js). */
.splash-progress {
    width: min(240px, 60vw);
    height: 6px;
    border-radius: 3px;
    background: rgba(230, 234, 242, 0.2);
    overflow: hidden;
}

.splash-progress > div {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #E9C46A;
    transition: width 200ms ease-out;
}

/* Under the bar: the file coming in, then the whole download's size, speed and time left (download-progress.js). */
.splash-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 2.6em; /* both lines' room from the start, so the bar does not move when they fill in */
    max-width: 90vw;
    margin-top: -6px;
    color: #E6EAF2;
    opacity: 0.7;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.splash-detail > span {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.splash.splash-close {
    transition: opacity 200ms, display 200ms;
    display: none;
    opacity: 0;
}
