/* Splash shown while the WASM app downloads. Kept tiny so it appears instantly on slow networks. */
html, body {
    background: #0F1222;
}

.avalonia-splash {
    position: absolute;
    height: 100%;
    width: 100%;
    background: #0F1222;
    color: #F4F5FA;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    justify-content: center;
    align-items: center;
    display: flex;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    padding: 0 16px;
}

.splash-content h1 {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin: 0 0 8px;
}

.splash-content p {
    color: #A3A9C7;
    margin: 0 0 20px;
}

.splash-content small {
    color: #A3A9C7;
    display: block;
    margin-top: 24px;
}

.splash-bar {
    width: 220px;
    height: 6px;
    margin: 0 auto;
    border-radius: 3px;
    background: #252B48;
    overflow: hidden;
}

/* Indeterminate until the runtime reports progress, then a real progress bar. */
.splash-bar div.determinate {
    animation: none;
    transform: none;
    transition: width 150ms;
}

.splash-bar div {
    width: 40%;
    height: 100%;
    border-radius: 3px;
    background: #8B5CF6;
    animation: splash-slide 1.2s ease-in-out infinite;
}

@keyframes splash-slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}

.avalonia-splash.splash-close {
    transition: opacity 200ms, display 200ms;
    display: none;
    opacity: 0;
}

/* Read by screen readers, not shown (see a11y.js). */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Someone moving through the page with a keyboard sees the screen reader copy as a panel, not invisible focus. */
.sr-only:focus-within {
    position: fixed;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    width: min(640px, calc(100% - 16px));
    height: auto;
    max-height: calc(100% - 16px);
    margin: 0;
    padding: 16px;
    box-sizing: border-box;
    overflow: auto;
    clip: auto;
    white-space: normal;
    background: #1A1F36;
    color: #F4F5FA;
    border: 1px solid #2E3556;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.4;
    z-index: 10;
}

.sr-only:focus-within h1 { font-size: 1.05rem; margin: 0 0 4px; }
.sr-only:focus-within p { margin: 0 0 12px; color: #A3A9C7; }

/* Each field: its label on top, then the box and its button side by side. */
.sr-only:focus-within form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 8px;
    align-items: center;
    flex: 1 1 100%;
    margin: 0 0 6px;
}
.sr-only:focus-within label { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: #A3A9C7; }
.sr-only:focus-within input {
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid #3A4166;
    border-radius: 10px;
    background: #252B48;
    color: #F4F5FA;
    font: inherit;
}
.sr-only:focus-within input::placeholder { color: #6F7699; }
.sr-only:focus-within input:focus { outline: none; border-color: #8B5CF6; box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.35); }

.sr-only:focus-within button {
    margin: 0;
    padding: 9px 14px;
    border: 0;
    border-radius: 10px;
    background: #7C3AED;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.sr-only:focus-within button:hover { background: #8B5CF6; }
.sr-only:focus-within button:focus-visible { outline: 3px solid rgba(139, 92, 246, 0.55); outline-offset: 2px; }
.sr-only:focus-within button[aria-disabled="true"] { opacity: 0.5; cursor: default; }

/* The other actions wrap as a row of buttons. */
.sr-only:focus-within > div { display: flex; flex-wrap: wrap; gap: 8px; }
