/* Voidstrife WebGL page. The look is the web game's boot screen
   (client/src/style.css "Boot overlay"), a little heavier for legibility:
   the user has low vision, so the bar is thicker and the line brighter. */

:root {
    --ink: #cfe6ff;
    --ink-dim: #5f7d99;
    --accent: #47e0d0;
    --error: #ff7a7a;
    --ground: #03060d;
    --font: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    /* No scrolling, no pull-to-refresh, no pinch: the page is the game. */
    overscroll-behavior: none;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* The canvas fills the window and follows it. Unity matches the WebGL
   drawing buffer to this CSS size times devicePixelRatio every frame. */
#unity-canvas {
    position: fixed;
    inset: 0;
    display: block;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    outline: none;
    touch-action: none;
    /* Until Unity's first frame the canvas shows the same splash as the
       overlay, so nothing flashes black under the fade. */
    background: var(--ground) url("splash.webp") center / cover no-repeat;
}

/* Boot overlay ---------------------------------------------------------- */

#vs-boot {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--ground);
    z-index: 10;
    transition: opacity 0.6s ease;
    overflow: hidden;
}

#vs-boot.is-done {
    opacity: 0;
    pointer-events: none;
}

.boot__art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.boot__panel {
    position: relative;
    align-self: end;
    display: grid;
    justify-items: center;
    gap: 12px;
    margin-bottom: 9vh;
    margin-bottom: 9dvh;
    padding: 16px 26px;
    max-width: calc(100vw - 32px);
    background: rgba(3, 6, 13, 0.72);
    border: 1px solid rgba(71, 224, 208, 0.45);
    border-radius: 5px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.boot__bar {
    width: 260px;
    max-width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.16);
    overflow: hidden;
}

.boot__bar i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.25s ease;
}

.boot__msg {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink);
    text-align: center;
}

/* Failure: the friendly line in large, the browser's own words small. */
#vs-boot.is-error .boot__bar {
    display: none;
}

.boot__error {
    display: none;
    max-width: 520px;
    text-align: center;
}

#vs-boot.is-error .boot__error {
    display: grid;
    gap: 10px;
    justify-items: center;
}

#vs-boot.is-error .boot__msg {
    display: none;
}

.boot__error-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--error);
}

.boot__error-detail {
    font-size: 11px;
    line-height: 1.4;
    color: var(--ink);
    opacity: 0.8;
    word-break: break-word;
    max-height: 30vh;
    overflow: auto;
}

.boot__retry {
    margin-top: 4px;
    padding: 8px 18px;
    font: 700 13px var(--font);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ground);
    background: var(--accent);
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.boot__retry:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

/* Unity's diagnostics overlay (development builds with Show Diagnostics). */
#diagnostics-icon {
    position: fixed;
    right: 8px;
    bottom: 8px;
    z-index: 20;
    cursor: pointer;
}
