html {
    overscroll-behavior: none !important;
}

body {
    background: #0b0a0a;
    padding: 0;
    margin: 0;
    z-index: 0;
}

#root > div {
    z-index: 2;
    width: 100%;
    min-height: 100%;
}

#preloader.preloader-hidden {
    opacity: 1;
}

/* Shared winter error presentation: standalone MRKT logo, muted frost canopy,
   and edge foliage reused from the loader. Both error pages share these styles;
   visibility remains controlled by the existing .show / .has-error hooks. */
#error-page {
    display: none;
    height: 100dvh;
    width: 100%;
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 50% 38%, #173d5c 0%, #0a2439 38%, #031322 75%);
    z-index: 99999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 44px;
    overflow: hidden;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
}

#error-page.show {
    display: flex;
}

#error-page::before {
    content: "";
    position: absolute;
    top: -270px;
    right: calc(50% - 550px);
    width: 740px;
    height: 740px;
    background: url("images/events/winter-is-coming/preloader/winter-is-coming-bg.webp") center / contain no-repeat;
    filter: grayscale(1) sepia(0.3) hue-rotate(160deg) saturate(1.4);
    opacity: 0.4;
    mask-image: linear-gradient(180deg, #000 25%, transparent 85%);
    pointer-events: none;
}

#error-page::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("images/events/winter-is-coming/preloader/winter-is-coming-leaves.webp") center / cover;
    opacity: 0.32;
    mask-image: linear-gradient(180deg, #000, transparent 35%, transparent 65%, #000);
    pointer-events: none;
}

.error-brand {
    position: relative;
    z-index: 1;
    display: block;
    width: min(210px, 54vw, 40dvh);
    height: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 18px 32px rgba(0, 8, 18, 0.45));
}

.error-copy {
    position: relative;
    z-index: 1;
    max-width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.error-text {
    margin: 0;
    color: #f0f7fc;
    font-family: inherit;
    font-size: clamp(23px, 6vw, 28px);
    font-weight: 600;
    letter-spacing: -0.8px;
    line-height: 1.2;
    text-align: center;
}

.error-description {
    margin: 14px auto 0;
    max-width: 245px;
    color: #9fb5c6;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0;
}

@media (max-height: 450px) {
    #error-page { gap: 24px; }
    .error-brand { width: 140px; }
}

#root {
    display: none !important;
}

body.authenticated #root {
    display: block !important;
}

body.has-error #root,
body.has-error #preloader {
    display: none !important;
}

body.has-error {
    background: #031322 !important;
}