.loading-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

/* Screen-reader-only: visible to assistive tech, hidden visually. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 1rem;
    font-size: 1.2rem;
    color: #007bff;
}
.landing-page {
    position: relative;
    min-height: calc(100vh - 48px);
    background: url(../dm.jpeg) center center / cover no-repeat;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
}

.landing-overlay {
    position: fixed;
    inset: 0;
    top: 48px;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        rgba(0, 0, 0, 0.85) 100%
    );
}

.landing-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 24px;
    max-width: 960px;
    width: 100%;
}

.landing-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 440px;
    padding: 32px 24px;
    background: rgba(30, 30, 30, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

.landing-title {
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.landing-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.landing-btn {
    width: 100%;
    max-width: 320px;
}

/* Adventure layout */
.adventure-layout {
    height: calc(100vh - 48px);
    display: flex;
    overflow: hidden;
    padding: 16px;
}

.image-placeholder {
    aspect-ratio: 16 / 9;
    width: 100%;
    max-height: 60vh;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.narrative-panel {
    flex: 1 1 0;
    overflow-y: auto;
    min-height: 200px;
}

.input-bar {
    flex: 0 0 auto;
    margin-top: 12px;
}

.input-bar--disabled .mud-input-control,
.input-bar--disabled .mud-icon-button[type="submit"] {
    opacity: 0.5;
    pointer-events: none;
}

.input-bar--disabled .audio-controls {
    opacity: 1;
    pointer-events: auto;
}

@keyframes pulse-wave {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.speaking-indicator {
    animation: pulse-wave 1.5s ease-in-out infinite;
}

.processing-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* Reset inherited CSS properties on SVG text elements — MudBlazor's body typography
   rules (letter-spacing, word-spacing, text-transform) cascade into inline SVG and
   break label rendering when the SVG viewBox uses fractional user units. */
.world-map-container svg text {
    letter-spacing: normal;
    word-spacing: normal;
    text-transform: none;
}

@media (max-width: 959px) {
    .adventure-layout {
        overflow-y: auto;
    }

    .narrative-panel {
        min-height: 30vh;
        max-height: 40vh;
    }

    .image-placeholder {
        max-height: 25vh;
    }
}

/* Small screens — phones */
@media (max-width: 599px) {
    .landing-content {
        padding: 24px 12px;
    }

    .landing-hero {
        padding: 24px 16px;
        border-radius: 12px;
    }

    .adventure-layout {
        padding: 8px;
    }
}