.olain-phase-popup,
.olain-phase-popup * {
    box-sizing: border-box;
}

.olain-phase-popup[hidden],
.olain-phase-trigger[hidden] {
    display: none !important;
}

.olain-phase-popup {
    position: fixed;
    z-index: 99999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(1, 4, 10, .88);
    backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity .28s ease;
}

.olain-phase-popup.is-open {
    opacity: 1;
}

.olain-phase-popup__dialog {
    position: relative;
    width: min(660px, 94vw, calc((100vh - 36px) * .646154));
    max-height: calc(100vh - 36px);
    overflow: hidden;
    border: 1px solid rgba(65, 178, 255, .56);
    border-radius: 24px;
    background: #02060b;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .72), 0 0 50px rgba(22, 142, 255, .24);
    transform: translateY(18px) scale(.98);
    transition: transform .32s ease;
}

.olain-phase-popup.is-open .olain-phase-popup__dialog {
    transform: translateY(0) scale(1);
}

.olain-phase-popup__poster {
    position: relative;
    margin: auto;
    aspect-ratio: 1008 / 1560;
    max-height: calc(100vh - 38px);
}

.olain-phase-popup__poster > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.olain-phase-popup__close {
    position: absolute;
    z-index: 4;
    top: 13px;
    right: 13px;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(1, 7, 15, .82);
    color: #fff;
    font: 700 26px/1 Arial, sans-serif;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.olain-phase-popup__close:hover,
.olain-phase-popup__close:focus-visible {
    border-color: #27d8ff;
    outline: 0;
    box-shadow: 0 0 20px rgba(39, 216, 255, .55);
}

/* Covers the poster's sample digits with the real Phase 2 UTC countdown. */
.olain-phase-popup__countdown {
    position: absolute;
    z-index: 3;
    top: 53.45%;
    left: 52.15%;
    display: grid;
    width: 39.45%;
    height: 5.45%;
    grid-template-columns: repeat(4, 1fr);
    gap: 4.2%;
    padding: 0;
}

.olain-phase-popup__unit {
    display: grid;
    min-width: 0;
    place-items: stretch;
    text-align: center;
}

.olain-phase-popup__unit strong {
    display: grid;
    width: 100%;
    height: 100%;
    padding: .08em 0 0;
    place-items: center;
    border: 1px solid rgba(96, 255, 0, .62);
    background: rgba(3, 7, 8, .98);
    clip-path: polygon(12% 0, 88% 0, 100% 18%, 100% 82%, 88% 100%, 12% 100%, 0 82%, 0 18%);
    color: #ff2d2d;
    font-family: "Courier New", monospace;
    font-size: clamp(17px, 2.85vw, 34px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.09em;
    text-shadow: 0 0 8px rgba(255, 25, 25, .85);
}

.olain-phase-popup__unit span {
    display: none;
}

.olain-phase-popup.is-complete .olain-phase-popup__countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    border-color: rgba(255, 177, 0, .78);
    background: rgba(17, 8, 0, .96);
    color: #ffd14a;
    font: 900 clamp(15px, 2.4vw, 30px)/1.1 Arial, sans-serif;
    letter-spacing: .08em;
    text-align: center;
    text-shadow: 0 0 12px rgba(255, 157, 0, .7);
}

.olain-phase-trigger {
    position: fixed;
    z-index: 9998;
    right: 18px;
    bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border: 1px solid rgba(0, 204, 255, .56);
    border-radius: 999px;
    background: rgba(2, 9, 18, .94);
    color: #fff;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .42), 0 0 24px rgba(0, 150, 255, .18);
    font-family: Arial, sans-serif;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.olain-phase-trigger > span {
    color: #43dcff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.olain-phase-trigger > strong {
    color: #ff3c38;
    font-family: "Courier New", monospace;
    font-size: 15px;
    text-shadow: 0 0 8px rgba(255, 30, 30, .62);
}

body.olain-phase-popup-lock {
    overflow: hidden !important;
}

@media (max-width: 575.98px) {
    .olain-phase-popup { padding: 8px; }
    .olain-phase-popup__dialog { width: min(100%, 430px); max-height: calc(100vh - 16px); border-radius: 17px; }
    .olain-phase-popup__poster { max-height: calc(100vh - 18px); }
    .olain-phase-popup__close { top: 8px; right: 8px; width: 38px; height: 38px; font-size: 23px; }
    .olain-phase-popup__unit strong { font-size: clamp(13px, 5vw, 20px); }
    .olain-phase-popup__unit span { font-size: clamp(4px, 1.45vw, 6px); }
    .olain-phase-trigger { right: 10px; bottom: 10px; max-width: calc(100vw - 20px); padding: 10px 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .olain-phase-popup,
    .olain-phase-popup__dialog { transition: none; }
}
