:root {
    color-scheme: dark;
    background: #000;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
    background: #000;
}

body {
    overscroll-behavior: none;
    user-select: none;
    touch-action: manipulation;
}

#app {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: #000;
}

.background-layer {
    position: absolute;
    inset: 0;
    z-index: 1;

    opacity: 0;
    background: rgb(0 0 0);

    will-change: opacity, background-color;
}

.background-layer.is-visible {
    opacity: 1;
}

.text-layer {
    position: absolute;
    z-index: 2;

    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding:
        max(2rem, env(safe-area-inset-top)) max(2rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(2rem, env(safe-area-inset-left));

    text-align: center;

    font-size: clamp(2rem, 12vw, 10rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: 0.04em;
    word-break: break-word;

    color: rgb(255 255 255);
    opacity: 0;

    text-shadow:
        0 0 0.2em rgb(0 0 0 / 30%),
        0 0 0.6em rgb(0 0 0 / 25%);

    pointer-events: none;
    will-change: opacity, color;
}

.dialog-overlay {
    position: absolute;
    z-index: 10;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding:
        max(1.5rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));

    background: rgb(0 0 0 / 75%);
    backdrop-filter: blur(8px);
}

.dialog-overlay.is-hidden {
    display: none;
}

.dialog-card {
    width: min(100%, 34rem);
    padding: 1.5rem;

    color: #fff;
    background: rgb(25 25 25 / 96%);

    border: 1px solid rgb(255 255 255 / 20%);
    border-radius: 1rem;

    box-shadow: 0 1rem 4rem rgb(0 0 0 / 55%);
}

.dialog-card h1 {
    margin-top: 0;
    font-size: 1.6rem;
}

.dialog-card p,
.dialog-card li {
    font-size: 1rem;
    line-height: 1.45;
}

.dialog-card ul {
    padding-left: 1.3rem;
}

.dialog-note {
    color: rgb(255 255 255 / 72%);
    font-size: 0.9rem !important;
}

#start-button {
    display: block;
    width: 100%;

    margin-top: 1.5rem;
    padding: 1rem;

    border: 0;
    border-radius: 0.75rem;

    color: #000;
    background: #fff;

    font-size: 1.1rem;
    font-weight: 800;

    cursor: pointer;
}

#start-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.startup-status {
    min-height: 1.4rem;
    margin-bottom: 0;

    color: rgb(255 255 255 / 80%);
    font-size: 0.9rem !important;
    text-align: center;
}

.connection-indicator {
    position: absolute;
    z-index: 20;

    top: max(0.75rem, env(safe-area-inset-top));
    right: max(0.75rem, env(safe-area-inset-right));

    display: flex;
    gap: 0.45rem;
    align-items: center;

    padding: 0.45rem 0.65rem;

    color: rgb(255 255 255 / 85%);
    background: rgb(0 0 0 / 35%);

    border-radius: 999px;

    font-size: 0.75rem;
    opacity: 0.75;

    pointer-events: none;
}

.connection-dot {
    width: 0.6rem;
    height: 0.6rem;

    background: #b00020;
    border-radius: 50%;
}

.connection-dot.is-connected {
    background: #22c55e;
}

.connection-dot.is-connecting {
    background: #f59e0b;
}

@media (display-mode: standalone) {
    .connection-indicator {
        top: max(0.4rem, env(safe-area-inset-top));
    }
}