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

.home-popup {
    position: fixed;
    inset: 0;
    margin: auto;
    padding: 0;
    /* Keep the entire poster and its controls within short / landscape screens. */
    width: min(560px, calc(100vw - 32px), calc((100vh - 112px) * 0.8002853));
    width: min(560px, calc(100vw - 32px), calc((100dvh - 112px) * 0.8002853));
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    border: 1px solid rgba(231, 196, 139, 0.3);
    border-radius: 14px;
    background: #091426;
    color: #f9efde;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    overflow: auto;
    overscroll-behavior: contain;
}

.home-popup:not([open]) {
    display: none;
}

/* Initial focus stays on the dialog; Tab highlights the action buttons. */
.home-popup:focus {
    outline: none;
}

.home-popup::backdrop {
    background: rgba(3, 9, 19, 0.68);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.home-popup-image {
    display: block;
    width: 100%;
    height: auto;
}

.home-popup-actions {
    display: flex;
    align-items: stretch;
    border-top: 1px solid rgba(231, 196, 139, 0.22);
}

.home-popup-actions button {
    min-height: 54px;
    padding: 12px 16px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    touch-action: manipulation;
}

.home-popup-actions .home-popup-today {
    flex: 1;
    min-width: 0;
    color: #e7c48b;
}

.home-popup-actions .home-popup-close {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    border-left: 1px solid rgba(231, 196, 139, 0.22);
}

.home-popup-actions button:focus-visible {
    outline: 2px solid #e7c48b;
    outline-offset: -5px;
}

@media (hover: hover) {
    .home-popup-actions button:hover {
        background: rgba(231, 196, 139, 0.12);
    }
}

@media (max-width: 480px), (max-height: 480px) {
    .home-popup {
        border-radius: 10px;
    }

    .home-popup-actions button {
        padding: 12px;
        font-size: 13px;
    }
}

html.home-popup-open {
    overflow: hidden;
}

body.home-popup-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}
