/* Master Plan viewer modal — no download UI; right-click + drag disabled
 * via JS. The visible image is one server-rendered PNG page; the source
 * PDF is blocked at the /assets/maps/master_plan/ route.
 */
.mpv-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 16, 30, 0.86);
    z-index: 99999;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
}

.mpv-overlay[hidden] { display: none; }

.mpv-modal {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    background: #1a1f2b;
    color: #fff;
}

.mpv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 18px;
    background: #0b1424;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.mpv-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 50vw;
}

.mpv-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mpv-btn {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 32px;
}

.mpv-btn:hover { background: rgba(255,255,255,0.18); }
.mpv-btn:active { transform: scale(0.96); }

.mpv-btn-close { background: rgba(220, 53, 69, 0.6); border-color: rgba(220, 53, 69, 0.7); }
.mpv-btn-close:hover { background: rgba(220, 53, 69, 0.85); }

.mpv-pager,
.mpv-zoom {
    font-size: 13px;
    padding: 0 8px;
    color: rgba(255,255,255,0.85);
    min-width: 56px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.mpv-divider {
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,0.15);
    margin: 0 4px;
}

.mpv-stage {
    flex: 1 1 auto;
    overflow: hidden;
    position: relative;
    background:
        linear-gradient(45deg, #161b26 25%, transparent 25%, transparent 75%, #161b26 75%) 0 0 / 24px 24px,
        linear-gradient(45deg, #161b26 25%, transparent 25%, transparent 75%, #161b26 75%) 12px 12px / 24px 24px,
        #1a1f2b;
    cursor: grab;
    user-select: none;
}

.mpv-stage-dragging { cursor: grabbing; }

.mpv-canvas {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.mpv-canvas img {
    max-width: none;
    max-height: none;
    box-shadow: 0 12px 40px rgba(0,0,0,0.45);
    background: #fff;
    pointer-events: auto;
    -webkit-user-drag: none;
    user-select: none;
    transform-origin: center center;
    will-change: transform;
}

.mpv-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 640px) {
    .mpv-title { max-width: 36vw; font-size: 14px; }
    .mpv-btn { min-width: 30px; min-height: 28px; padding: 4px 8px; font-size: 13px; }
    .mpv-pager, .mpv-zoom { font-size: 12px; min-width: 44px; }
}
