* {
    box-sizing: border-box;
}



html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #000000;
    color: #f5f5f5;
    overflow: auto;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-header {
    padding: 1rem 1.25rem 0.25rem;
    text-align: center;
}

.page-header p {
    margin: 0;
    font-size: 0.9rem;
    color: #dddddd;
}

.page-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stage-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0;
    align-items: flex-end;
}

.mosaic-container {
    position: relative;
    width: 100%;
    max-width: 520px;
    aspect-ratio: 9 / 16;
    max-height: 100vh;
    overflow: hidden;
    background: #ffffff;
}

#mosaic-canvas {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: auto;
    height: 100%;
    display: block;
    aspect-ratio: 9 / 16;
}

.mosaic-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #222222 0, #000000 65%);
    color: #f5f5f5;
    z-index: 2;
    gap: 0.75rem;
    transition: opacity 0.5s ease;
}

.mosaic-loader-spinner {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
    animation: mosaic-spin 0.8s linear infinite;
}

.mosaic-loader-text {
    font-size: 0.95rem;
    text-align: center;
    opacity: 0.85;
}

.mosaic-loader--hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes mosaic-spin {
    to {
        transform: rotate(360deg);
    }
}
