/* ══════════════════════════════════════════════
   Under Construction Overlay
   ══════════════════════════════════════════════ */

/* ── Full-screen overlay container ── */
#under-construction-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0806;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    gap: 3.5rem;
    padding: 2.5rem;
    overflow: hidden; /* Prevent horizontal and vertical browser scrollbars */
    flex-wrap: wrap;
    color: #e8dcc8;
    font-family: 'Lora', Georgia, serif;
}

#under-construction-overlay.uc-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ── Background image ── */
.uc-bg-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url('/assets/art/UnderConstruction.png') center center / cover no-repeat;
    filter: brightness(0.35) saturate(0.7);
    animation: ucBgPulse 8s ease-in-out infinite alternate;
}

@keyframes ucBgPulse {
    0%   { filter: brightness(0.30) saturate(0.6); transform: scale(1); }
    100% { filter: brightness(0.40) saturate(0.8); transform: scale(1.03); }
}

/* ── Noise overlay ── */
.uc-noise {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.06;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* ── Vignette ── */
.uc-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.7) 100%);
}

/* ── Film bars ── */
.uc-film-bar {
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    z-index: 10;
    background: repeating-linear-gradient(
        90deg,
        rgba(180,150,100,0.5) 0px,
        rgba(180,150,100,0.5) 8px,
        transparent 8px,
        transparent 16px
    );
}

.uc-film-bar--top { top: 0; }
.uc-film-bar--bottom { bottom: 0; }

/* ── Dust particles ── */
.uc-particles {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.uc-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(200, 170, 110, 0.3);
    border-radius: 50%;
    animation: ucDrift linear infinite;
}

@keyframes ucDrift {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(-20px) translateX(80px);
        opacity: 0;
    }
}

/* ── Content card ── */
.uc-content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 56px 72px;
    max-width: 720px;
    background: linear-gradient(
        145deg,
        rgba(20, 16, 10, 0.88),
        rgba(30, 24, 15, 0.92)
    );
    border: 1px solid rgba(180, 150, 100, 0.25);
    border-radius: 8px;
    box-shadow:
        0 0 60px rgba(0, 0, 0, 0.6),
        0 0 120px rgba(120, 90, 40, 0.08),
        inset 0 1px 0 rgba(255, 230, 170, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: ucCardAppear 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ucCardAppear {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Ornament ── */
.uc-ornament {
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0.5;
    animation: ucFadeIn 2s ease both 0.4s;
}

.uc-ornament__line {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(180, 150, 100, 0.6), transparent);
}

.uc-ornament__star {
    font-size: 18px;
    color: #b49664;
    animation: ucRotateStar 12s linear infinite;
}

@keyframes ucRotateStar {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes ucFadeIn {
    from { opacity: 0; }
    to   { opacity: 0.5; }
}

/* ── Gear icon ── */
.uc-gear-icon {
    width: 64px;
    height: 64px;
    opacity: 0;
    animation: ucGearAppear 1s ease both 0.5s, ucGearSpin 20s linear infinite 1.5s;
    background-color: #b49664;
    -webkit-mask-image: url('/assets/icons/Gear.svg');
    mask-image: url('/assets/icons/Gear.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

@keyframes ucGearAppear {
    from { opacity: 0; transform: scale(0.5) rotate(-90deg); }
    to   { opacity: 0.7; transform: scale(1) rotate(0deg); }
}

@keyframes ucGearSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Title ── */
.uc-title {
    font-family: 'Special Elite', 'Courier New', monospace;
    font-size: clamp(28px, 5vw, 44px);
    color: #e8dcc8;
    text-align: center;
    letter-spacing: 3px;
    text-shadow:
        0 0 20px rgba(180, 150, 100, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.5);
    opacity: 0;
    animation: ucTitleReveal 1s ease both 0.7s;
}

@keyframes ucTitleReveal {
    from {
        opacity: 0;
        letter-spacing: 12px;
        filter: blur(4px);
    }
    to {
        opacity: 1;
        letter-spacing: 3px;
        filter: blur(0);
    }
}

/* ── Subtitle ── */
.uc-subtitle {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: clamp(14px, 2.5vw, 18px);
    color: rgba(180, 160, 130, 0.7);
    text-align: center;
    line-height: 1.7;
    max-width: 480px;
    opacity: 0;
    animation: ucFadeUp 1s ease both 1s;
}

@keyframes ucFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Progress bar ── */
.uc-progress-wrapper {
    width: 100%;
    max-width: 360px;
    opacity: 0;
    animation: ucFadeUp 1s ease both 1.2s;
}

.uc-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(180, 150, 100, 0.12);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.uc-progress-fill {
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #b49664, transparent);
    border-radius: 4px;
    animation: ucProgressSlide 2.5s ease-in-out infinite;
}

@keyframes ucProgressSlide {
    0%   { left: -40%; }
    100% { left: 100%; }
}

/* ── Console prompt ── */
.uc-console {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(180, 150, 100, 0.3);
    border-radius: 4px;
    font-family: 'Special Elite', monospace;
    font-size: 16px;
    color: #b49664;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

.uc-console.uc-console--visible {
    opacity: 1;
    visibility: visible;
}

.uc-console__prefix {
    color: rgba(180, 150, 100, 0.5);
    user-select: none;
}

.uc-console__input {
    background: none;
    border: none;
    outline: none;
    color: #e8dcc8;
    font-family: 'Special Elite', monospace;
    font-size: 16px;
    width: 120px;
    caret-color: #b49664;
    text-transform: uppercase;
}

.uc-console__input::placeholder {
    color: rgba(180, 150, 100, 0.25);
}

/* ── Shake animation for wrong password ── */
.uc-console--shake {
    animation: ucShake 0.4s ease;
}

@keyframes ucShake {
    0%, 100% { transform: translateX(-50%); }
    20%      { transform: translateX(calc(-50% - 8px)); }
    40%      { transform: translateX(calc(-50% + 8px)); }
    60%      { transform: translateX(calc(-50% - 4px)); }
    80%      { transform: translateX(calc(-50% + 4px)); }
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .uc-content {
        padding: 40px 28px;
        margin: 16px;
        gap: 24px;
    }

    .uc-ornament__line {
        width: 48px;
    }
}

/* ── Game Title Logotype Override for Overlay ── */
.uc-content .game-title {
    margin-top: 8px;
    margin-bottom: 0;
    text-align: center;
    font-size: clamp(32px, 5.5vw, 48px);
    font-family: 'Special Elite', 'Courier New', monospace;
    font-weight: 400;
    letter-spacing: -1px;
    color: #e8dcc8;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.logotype-i-container {
    position: relative;
    display: inline-block;
}

.logotype-dot {
    position: absolute;
    top: -0.15em;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.18em;
    height: 0.18em;
    background-color: currentColor;
    border-radius: 50%;
    display: inline-block;
}

/* ── Developer Note in Maintenance ── */
.uc-dev-note {
    max-width: 440px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    z-index: 5;
    animation: ucCardAppear 1.2s cubic-bezier(0.22, 1, 0.36, 1) both 0.2s !important;
}

@media (max-width: 960px) {
    #under-construction-overlay {
        flex-direction: column;
        justify-content: center;
        overflow: hidden;
        padding: 2rem 1.5rem;
        gap: 1.5rem;
    }
    
    .uc-dev-note {
        max-width: 720px;
    }
}

/* Make under-construction elements fit beautifully in smaller viewports without scrollbars */
@media (max-width: 1350px), (max-height: 850px) {
    #under-construction-overlay {
        gap: 2rem;
        padding: 1.5rem;
    }
    
    .uc-content {
        padding: 30px 40px;
        gap: 20px;
        max-width: 500px;
    }
    
    .uc-dev-note {
        max-width: 380px;
        padding: 20px 25px !important;
    }
    
    .uc-title {
        font-size: clamp(22px, 3.5vw, 32px);
    }
    
    .uc-subtitle {
        font-size: clamp(13px, 2vw, 15px);
    }
    
    .uc-gear-icon {
        width: 48px;
        height: 48px;
    }
    
    .uc-content .game-title {
        font-size: clamp(24px, 4vw, 36px);
    }
    
    .uc-ornament {
        gap: 10px;
    }
    
    .uc-ornament__line {
        width: 50px;
    }
}

@media (max-width: 1050px), (max-height: 720px) {
    #under-construction-overlay {
        gap: 1.5rem;
        padding: 1rem;
    }
    
    .uc-content {
        padding: 20px 30px;
        gap: 15px;
        max-width: 420px;
    }
    
    .uc-dev-note {
        max-width: 320px;
        padding: 15px 20px !important;
        border-left-width: 8px !important;
    }
    
    .uc-title {
        font-size: 24px;
        letter-spacing: 2px;
    }
    
    .uc-subtitle {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .uc-gear-icon {
        width: 36px;
        height: 36px;
    }
    
    .uc-content .game-title {
        font-size: 28px;
    }

/* ── Developer Note Styling ── */
.dev-note-container.telegraph-message {
    position: relative;
    width: 100%;
    background: #e6dcc5;
    background-image: repeating-linear-gradient(rgba(0, 0, 0, 0.02) 0px, rgba(0, 0, 0, 0.02) 1px, transparent 1px, transparent 25px);
    padding: 30px 35px;
    border: none;
    border-left: 15px solid #dcdcdc;
    border-right: 1px solid #dcdcdc;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    font-family: 'Special Elite', monospace;
    color: #222;
    animation: ucCardAppear 1.2s cubic-bezier(0.22, 1, 0.36, 1) both 0.2s;
    flex: 1;
    min-height: 120px;
    overflow-y: auto;
}

.stamp-important {
    position: absolute;
    bottom: 20px;
    right: 20px;
    border: 5px solid #8b0000;
    color: #8b0000;
    padding: 5px 20px;
    font-weight: bold;
    font-size: 1.6rem;
    transform: rotate(-8deg);
    background: rgba(230, 220, 197, 0.4);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    letter-spacing: 3px;
    text-transform: uppercase;
    z-index: 10;
    opacity: 0.8;
}

.dev-note-container h3 {
    margin-top: 5px;
    font-size: 18px;
    color: #444;
    border-bottom: 1px solid #444;
    padding-bottom: 8px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.dev-note-container p {
    font-size: 14px;
    line-height: 1.4;
    margin: 0 0 12px 0;
    text-align: left;
    font-weight: 300;
}

.dev-note-list {
    margin: 0 0 12px 0;
    padding-left: 1.2rem;
    list-style-type: none;
}

.dev-note-list li {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 6px;
    position: relative;
    font-weight: 300;
}

.dev-note-list li::before {
    content: "•";
    position: absolute;
    left: -1rem;
    color: #8b0000;
}

    
    .uc-progress-wrapper {
        max-width: 260px;
    }
    
    .dev-note-container h3 {
        font-size: 1.05rem;
        margin-bottom: 8px;
    }
    
    .dev-note-container p, .dev-note-list li {
        font-size: 0.8rem !important;
        margin-bottom: 8px;
        line-height: 1.35;
    }
    
    .stamp-important {
        font-size: 1.1rem !important;
        padding: 3px 12px !important;
        border-width: 3px !important;
        bottom: 10px !important;
        right: 10px !important;
    }
}
